Browse Source

采购订单

changhaoning 2 năm trước cách đây
mục cha
commit
e8fe92cf5d

+ 14 - 0
src/main/java/com/dk/mdm/controller/common/CommonController.java

@@ -1236,6 +1236,20 @@ public class CommonController extends BaseController<Map<String, Object>> {
 
 
 
 
     /**
     /**
+     * @desc   : 获取仓库
+     * @author : 常皓宁
+     * @date   : 2024/3/4 10:49
+     */
+    @ApiOperation(
+            value = "获取仓库",
+            notes = "获取仓库"
+    )
+    @PostMapping("get_warehouse")
+    public ResponseResultVO<List<Map<String, Object>>> getWarehouse(@RequestBody Map<String, Object> param) {
+        return commonService.getWarehouse(param);
+    }
+
+    /**
      * @desc : 获取仓库
      * @desc : 获取仓库
      * @author : 洪旭东
      * @author : 洪旭东
      * @date : 2023-08-09 14:32
      * @date : 2023-08-09 14:32

+ 6 - 1
src/main/java/com/dk/mdm/mapper/common/CommonMapper.java

@@ -826,7 +826,12 @@ public interface CommonMapper extends BaseMapper<Map<String, Object>> {
      */
      */
     List<Map<String, String>> getWsPrinter(Map param);
     List<Map<String, String>> getWsPrinter(Map param);
 
 
-
+    /**
+     * @desc   : 获取仓库
+     * @author : 常皓宁
+     * @date   : 2024/3/4 10:50
+     */
+    List<Map<String, Object>> getWarehouse(Map param);
 
 
     /**
     /**
      * @desc   : 获取仓库
      * @desc   : 获取仓库

+ 19 - 0
src/main/java/com/dk/mdm/mapper/common/CommonMapper.xml

@@ -2577,6 +2577,25 @@
           and ptwp.flg_valid
           and ptwp.flg_valid
     </select>
     </select>
 
 
+    <!-- 获取仓库 -->
+    <select id="getWarehouse" resultType="java.util.Map">
+        SELECT tmw.wh_id as "whId"
+                ,tmw.wh_name as "whName"
+                ,tmw.wh_code as "whCode"
+        FROM dkic_b.t_mst_warehouse tmw
+        WHERE tmw.cp_id = #{cpId}
+        and tmw.flg_valid
+        <if test="whCode!=null and whCode!=''">
+            and position(#{whCode} in tmw.wh_code) > 0
+        </if>
+        <if test="whName!=null and whName!=''">
+            and position(#{whName} in tmw.wh_name) > 0
+        </if>
+        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+            limit #{end} offset #{start}
+        </if>
+    </select>
+
     <!--获取仓库-->
     <!--获取仓库-->
     <select id="getWarehouseByPage" resultType="java.util.Map">
     <select id="getWarehouseByPage" resultType="java.util.Map">
         SELECT mtw.wh_id as "whId",sys.f_code_name(mtw.wh_code,mtw.wh_name) AS "whCodeName"
         SELECT mtw.wh_id as "whId",sys.f_code_name(mtw.wh_code,mtw.wh_name) AS "whCodeName"

+ 26 - 2
src/main/java/com/dk/mdm/mapper/pur/PurchaseMapper.xml

@@ -50,7 +50,8 @@
         tpp.op_update_user_id,
         tpp.op_update_user_id,
         tpp.op_app_code,
         tpp.op_app_code,
         tpp.op_timestamp,
         tpp.op_timestamp,
-        tpp.op_db_user
+        tpp.op_db_user,
+        tpp.wh_id
     </sql>
     </sql>
 
 
     <!-- 通用查询映射结果 -->
     <!-- 通用查询映射结果 -->
@@ -267,7 +268,7 @@
                 AND tpp.staff_id = #{staffId}
                 AND tpp.staff_id = #{staffId}
             </if>
             </if>
             <if test="supId != null and supId != ''">
             <if test="supId != null and supId != ''">
-                AND tpp.sup_id = #{supId}
+                AND tpp.sup_id = #{supId}::uuid
             </if>
             </if>
             <if test="contactName != null and contactName != ''">
             <if test="contactName != null and contactName != ''">
                 AND tpp.contact_name = #{contactName}
                 AND tpp.contact_name = #{contactName}
@@ -362,6 +363,25 @@
             <if test="opDbUser != null and opDbUser != ''">
             <if test="opDbUser != null and opDbUser != ''">
                 AND tpp.op_db_user = #{opDbUser}
                 AND tpp.op_db_user = #{opDbUser}
             </if>
             </if>
+            <if test="intoStatusList != null  and intoStatusList.size()>0">
+                AND tpp.into_status =
+                any(#{intoStatusList,typeHandler=StringListTypeHandler})
+            </if>
+            <if test="skuName != null and skuName!='' ">
+                and exists (select 1 from dkic_b.t_psi_purchase_item tppi
+                left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = tppi.sku_id
+                where
+                tpp.pur_id = tppi.pur_id
+                and tppi.flg_valid
+                AND position(#{skuName} in tmgs.sku_name) > 0
+                )
+            </if>
+            <if test="pickupDateStart != null">
+                AND tpp.pickup_date &gt;= #{pickupDateStart}::timestamp with time zone
+            </if>
+            <if test="pickupDateEnd != null">
+                AND tpp.pickup_date &lt; #{pickupDateEnd}::timestamp with time zone + interval '1 day'
+            </if>
         </where>
         </where>
     </sql>
     </sql>
 
 
@@ -381,11 +401,13 @@
         ,tms.staff_name as "staffName"
         ,tms.staff_name as "staffName"
         ,tms1.staff_name as "makeStaffName"
         ,tms1.staff_name as "makeStaffName"
         ,tmp.sup_name as "supplierName"
         ,tmp.sup_name as "supplierName"
+        ,tmw.wh_name as "whName"
         FROM dkic_b.t_psi_purchase tpp
         FROM dkic_b.t_psi_purchase tpp
         Left join dkic_b.t_mst_org tmo on tpp.org_id = tmo.org_id
         Left join dkic_b.t_mst_org tmo on tpp.org_id = tmo.org_id
         Left join dkic_b.t_mst_supplier tmp on tpp.sup_id = tmp.sup_id
         Left join dkic_b.t_mst_supplier tmp on tpp.sup_id = tmp.sup_id
         Left join dkic_b.t_mst_staff tms on tpp.staff_id = tms.staff_id
         Left join dkic_b.t_mst_staff tms on tpp.staff_id = tms.staff_id
         Left join dkic_b.t_mst_staff tms1 on tpp.make_staff = tms1.staff_id
         Left join dkic_b.t_mst_staff tms1 on tpp.make_staff = tms1.staff_id
+        Left join dkic_b.t_mst_warehouse tmw on tpp.wh_id = tmw.wh_id
         <include refid="Condition_1"/>
         <include refid="Condition_1"/>
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
             limit #{end} offset #{start}
@@ -401,11 +423,13 @@
         ,tms.staff_name as "staffName"
         ,tms.staff_name as "staffName"
         ,tms1.staff_name as "makeStaffName"
         ,tms1.staff_name as "makeStaffName"
         ,tmp.sup_name as "supplierName"
         ,tmp.sup_name as "supplierName"
+        ,tmw.wh_name as "whName"
         FROM dkic_b.t_psi_purchase tpp
         FROM dkic_b.t_psi_purchase tpp
         Left join dkic_b.t_mst_org tmo on tpp.org_id = tmo.org_id
         Left join dkic_b.t_mst_org tmo on tpp.org_id = tmo.org_id
         Left join dkic_b.t_mst_supplier tmp on tpp.sup_id = tmp.sup_id
         Left join dkic_b.t_mst_supplier tmp on tpp.sup_id = tmp.sup_id
         Left join dkic_b.t_mst_staff tms on tpp.staff_id = tms.staff_id
         Left join dkic_b.t_mst_staff tms on tpp.staff_id = tms.staff_id
         Left join dkic_b.t_mst_staff tms1 on tpp.make_staff = tms1.staff_id
         Left join dkic_b.t_mst_staff tms1 on tpp.make_staff = tms1.staff_id
+        Left join dkic_b.t_mst_warehouse tmw on tpp.wh_id = tmw.wh_id
         WHERE pur_id = #{purId}::uuid
         WHERE pur_id = #{purId}::uuid
     </select>
     </select>
 
 

+ 16 - 0
src/main/java/com/dk/mdm/model/query/pur/PurchaseQuery.java

@@ -24,6 +24,7 @@ import java.io.Serializable;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
+import java.util.List;
 
 
 /**
 /**
  *  采购订单
  *  采购订单
@@ -363,6 +364,21 @@ public class PurchaseQuery extends PageInfo<PurchaseQuery> implements Serializab
     @TableField(typeHandler = UuidTypeHandler.class)
     @TableField(typeHandler = UuidTypeHandler.class)
     private String whId;
     private String whId;
 
 
+    @ApiModelProperty(value = "入库状态")
+    private List<String> intoStatusList;
+
+    @ApiModelProperty(value = "商品名称")
+    private String skuName;
+
+    @ApiModelProperty(value = "取货日期开始")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class,exist = false)
+    private LocalDate pickupDateStart;
+
+    @ApiModelProperty(value = "取货日期结束")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class,exist = false)
+    private LocalDate  pickupDateEnd;
 
 
     /*
     /*
      * 相关属性
      * 相关属性

+ 6 - 0
src/main/java/com/dk/mdm/model/response/pur/PurchaseResponse.java

@@ -393,6 +393,12 @@ public class PurchaseResponse extends PageInfo<PurchaseResponse> implements Seri
     @ApiModelProperty(value = "供应商名称")
     @ApiModelProperty(value = "供应商名称")
     private String supplierName;
     private String supplierName;
 
 
+    /**
+     * 收货仓库
+     */
+    @ApiModelProperty(value = "收货仓库")
+    private String whName;
+
 
 
     @ApiModelProperty(value = "采购订单明细")
     @ApiModelProperty(value = "采购订单明细")
     private List<PurchaseItemResponse> purchaseItemResponseList;
     private List<PurchaseItemResponse> purchaseItemResponseList;

+ 10 - 0
src/main/java/com/dk/mdm/service/common/CommonService.java

@@ -1215,6 +1215,16 @@ public class CommonService extends BaseService<Map<String, Object>> {
         return ResponseResultUtil.success(commonMapper.getWsPrinter(param));
         return ResponseResultUtil.success(commonMapper.getWsPrinter(param));
     }
     }
 
 
+    /**
+     * @desc   : 获取仓库
+     * @author : 常皓宁
+     * @date   : 2024/3/4 10:50
+     */
+    public ResponseResultVO<List<Map<String, Object>>> getWarehouse(Map<String, Object> param) {
+        // 获取仓库
+        List<Map<String, Object>> list = commonMapper.getWarehouse(param);
+        return ResponseResultUtil.success(list);
+    }
 
 
     /**
     /**
      * @desc : 获取仓库
      * @desc : 获取仓库