Ver código fonte

Merge branch 'master' of http://git.dongkesoft.com:9001/iBOSS-2.0-Mini/iboss-server-mdm

changhaoning 2 anos atrás
pai
commit
0842a4d7ed
31 arquivos alterados com 940 adições e 558 exclusões
  1. 3 3
      pom.xml
  2. 15 1
      src/main/java/com/dk/mdm/controller/ivt/InboundController.java
  3. 2 0
      src/main/java/com/dk/mdm/controller/ivt/IntoReturnController.java
  4. 13 0
      src/main/java/com/dk/mdm/controller/pur/PurchaseController.java
  5. 1 1
      src/main/java/com/dk/mdm/generator/Generator.java
  6. 16 0
      src/main/java/com/dk/mdm/mapper/ivt/InboundMapper.java
  7. 92 5
      src/main/java/com/dk/mdm/mapper/ivt/InboundMapper.xml
  8. 5 12
      src/main/java/com/dk/mdm/mapper/ivt/IntoReturnMapper.xml
  9. 54 46
      src/main/java/com/dk/mdm/mapper/ivt/OutboundItemMapper.xml
  10. 70 50
      src/main/java/com/dk/mdm/mapper/ivt/OutboundMapper.xml
  11. 14 0
      src/main/java/com/dk/mdm/mapper/pur/PurchaseMapper.java
  12. 31 0
      src/main/java/com/dk/mdm/mapper/pur/PurchaseMapper.xml
  13. 74 74
      src/main/java/com/dk/mdm/mapper/sale/OrderItemMapper.xml
  14. 131 131
      src/main/java/com/dk/mdm/mapper/sale/OrderMapper.xml
  15. 51 46
      src/main/java/com/dk/mdm/mapper/sale/OutReturnItemMapper.xml
  16. 93 61
      src/main/java/com/dk/mdm/mapper/sale/OutReturnMapper.xml
  17. 1 7
      src/main/java/com/dk/mdm/model/pojo/ivt/IntoReturn.java
  18. 1 7
      src/main/java/com/dk/mdm/model/query/ivt/IntoReturnQuery.java
  19. 37 0
      src/main/java/com/dk/mdm/model/response/ivt/InboundResponse.java
  20. 1 7
      src/main/java/com/dk/mdm/model/response/ivt/IntoReturnResponse.java
  21. 13 0
      src/main/java/com/dk/mdm/model/response/ivt/OutboundItemResponse.java
  22. 35 0
      src/main/java/com/dk/mdm/model/response/ivt/OutboundResponse.java
  23. 11 0
      src/main/java/com/dk/mdm/model/response/sale/OutReturnItemResponse.java
  24. 31 0
      src/main/java/com/dk/mdm/model/response/sale/OutReturnResponse.java
  25. 1 7
      src/main/java/com/dk/mdm/model/vo/ivt/InboundVO.java
  26. 11 0
      src/main/java/com/dk/mdm/service/ivt/InboundService.java
  27. 90 86
      src/main/java/com/dk/mdm/service/ivt/IntoReturnService.java
  28. 9 1
      src/main/java/com/dk/mdm/service/pur/PurchaseService.java
  29. 8 2
      src/main/java/com/dk/mdm/service/wxapi/basic/WechatPayService.java
  30. 1 1
      src/main/resources/dev/bootstrap.yml
  31. 25 10
      src/main/resources/test/bootstrap.yml

+ 3 - 3
pom.xml

@@ -5,9 +5,9 @@
     <modelVersion>4.0.0</modelVersion>
 
     <groupId>com.dk.iboss</groupId>
-    <artifactId>iboss-server-mdm</artifactId>
+    <artifactId>dkic-server-mdm</artifactId>
     <version>3.0.0</version>
-    <name>iboss-server-mdm</name>
+    <name>dkic-server-mdm</name>
     <description>dk iboss mdm server</description>
 
 
@@ -62,7 +62,7 @@
         <!--公共模块-->
         <dependency>
             <groupId>com.dk.iboss</groupId>
-            <artifactId>iboss-dependency-common</artifactId>
+            <artifactId>dkic-dependency-common</artifactId>
             <version>3.0.0</version>
         </dependency>
         <!--lombok-->

+ 15 - 1
src/main/java/com/dk/mdm/controller/ivt/InboundController.java

@@ -6,8 +6,10 @@ import com.dk.common.response.ResponseResultVO;
 import com.dk.mdm.model.pojo.ivt.Inbound;
 import com.dk.common.service.BaseService;
 import com.dk.mdm.model.query.ivt.InboundQuery;
+import com.dk.mdm.model.query.pur.PurchaseQuery;
 import com.dk.mdm.model.response.ivt.InboundResponse;
 
+import com.dk.mdm.model.response.pur.PurchaseResponse;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -32,7 +34,19 @@ public class InboundController{
 
 
 
-
+    /**
+     * @desc   : 条件查询
+     * @author : 王英杰
+     * @date   : 2024/3/8 10:58
+     */
+    @ApiOperation(
+            value = "分页、关联、条件查询",
+            notes = "分页、关联、条件查询"
+    )
+    @PostMapping({"list_by"})
+    public ResponseResultVO<PageList<PurchaseResponse>> selectByCond(@RequestBody InboundQuery inboundQuery) {
+        return inboundService.selectByCond(inboundQuery);
+    }
     /**
      * @desc : 查看来源单据,总单加明细  采购退货用
      * @author : 于继渤

+ 2 - 0
src/main/java/com/dk/mdm/controller/ivt/IntoReturnController.java

@@ -20,6 +20,8 @@ import org.springframework.web.bind.annotation.RestController;
 import io.swagger.annotations.Api;
 import com.dk.mdm.service.ivt.IntoReturnService;
 
+import java.util.List;
+
 @Api(tags = "入库退货API接口")
 @RestController
 @RequestMapping("/ivt/intoReturn")

+ 13 - 0
src/main/java/com/dk/mdm/controller/pur/PurchaseController.java

@@ -42,6 +42,19 @@ public class PurchaseController{
         return purchaseService.selectByCond(purchaseQuery);
     }
 
+    /**
+     * @desc   : 采购订单 待入库查询
+     * @author : 王英杰
+     * @date   : 2024/2/28 9:46
+     */
+    @ApiOperation(
+            value = "分页、关联、条件查询",
+            notes = "分页、关联、条件查询"
+    )
+    @PostMapping({"no_storedlist_by"})
+    public ResponseResultVO<PageList<PurchaseResponse>> noStoredSelectByCond(@RequestBody PurchaseQuery purchaseQuery) {
+        return purchaseService.noStoredSelectByCond(purchaseQuery);
+    }
     @ApiOperation(
             value = "新建",
             notes = "新建"

+ 1 - 1
src/main/java/com/dk/mdm/generator/Generator.java

@@ -95,7 +95,7 @@ public class Generator {
         //4、策略配置
         StrategyConfig strategy = new StrategyConfig();
         strategy.setTablePrefix("t_psi");                                             //表名前缀
-        strategy.setInclude("t_psi_outbound_item");                                        //设置要映射的表名,只需改这里即可,可以是一个数组,一次性生成多张表。
+        strategy.setInclude("t_psi_inbound");                                        //设置要映射的表名,只需改这里即可,可以是一个数组,一次性生成多张表。
         strategy.setNaming(NamingStrategy.underline_to_camel);                      //转驼峰
         strategy.setColumnNaming(NamingStrategy.underline_to_camel);                //字段下划线转驼峰
         strategy.setEntityLombokModel(true);                                        //是否使用lombok开启注解

+ 16 - 0
src/main/java/com/dk/mdm/mapper/ivt/InboundMapper.java

@@ -4,7 +4,9 @@ import com.dk.mdm.model.pojo.ivt.Inbound;
 import com.dk.common.mapper.BaseMapper;
 import com.dk.mdm.model.pojo.ivt.InboundItem;
 import com.dk.mdm.model.query.ivt.InboundQuery;
+import com.dk.mdm.model.query.pur.PurchaseQuery;
 import com.dk.mdm.model.response.mst.DictionaryDataResponse;
+import com.dk.mdm.model.response.pur.PurchaseResponse;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
@@ -33,5 +35,19 @@ public interface InboundMapper extends BaseMapper<Inbound>{
 
 
     int  updateAmount(Inbound inbound);
+
+    /**
+     * @desc   : 条件查询 (采购入库用)
+     * @author : 王英杰
+     * @date   : 2024/3/8 10:58
+     */
+    List<PurchaseResponse> selectByCond(InboundQuery inboundQuery);
+
+    /**
+     * @desc   : 条件查询个数 (采购入库用)
+     * @author : 王英杰
+     * @date   : 2024/3/8 10:58
+     */
+    Long countByCond(InboundQuery inboundQuery);
 }
 

+ 92 - 5
src/main/java/com/dk/mdm/mapper/ivt/InboundMapper.xml

@@ -8,6 +8,40 @@
         into_id
         , into_no, into_type, from_id, from_no, org_id, staff_id, cus_id, sup_id, into_status, intoing_qty, intoing_amt, into_qty, into_amt, return_qty, return_amt, into_date, remarks, annex_paths, make_staff, make_time, receivable_id, payable_id, flg_valid, cp_id, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user
     </sql>
+    <sql id="Base_Column_List_tpi">
+        tpi.into_id
+        , tpi.into_no
+    , tpi.into_type
+    , tpi.from_id
+    , tpi.from_no
+    , tpi.org_id
+    , tpi.staff_id
+    , tpi.cus_id
+    , tpi.sup_id
+    , tpi.into_status
+    , tpi.intoing_qty
+    , tpi.intoing_amt
+    , tpi.into_qty
+    , tpi.into_amt
+    , tpi.return_qty
+    , tpi.return_amt
+    , tpi.into_date
+    , tpi.remarks
+    , tpi.annex_paths
+    , tpi.make_staff
+    , tpi.make_time
+    , tpi.receivable_id
+    , tpi.payable_id
+    , tpi.flg_valid
+    , tpi.cp_id
+    , tpi.op_create_time
+    , tpi.op_create_user_id
+    , tpi.op_update_time
+    , tpi.op_update_user_id
+    , tpi.op_app_code
+    , tpi.op_timestamp
+    , tpi.op_db_user
+    </sql>
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.ivt.Inbound">
@@ -45,6 +79,41 @@
         <result column="op_db_user" property="opDbUser"/>
     </resultMap>
 
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMapResponse" type="com.dk.mdm.model.response.ivt.InboundResponse">
+        <id column="into_id" property="intoId"/>
+        <result column="into_no" property="intoNo"/>
+        <result column="into_type" property="intoType"/>
+        <result column="from_id" property="fromId" typeHandler="UuidTypeHandler"/>
+        <result column="from_no" property="fromNo"/>
+        <result column="org_id" property="orgId" typeHandler="UuidTypeHandler"/>
+        <result column="staff_id" property="staffId" typeHandler="UuidTypeHandler"/>
+        <result column="cus_id" property="cusId" typeHandler="UuidTypeHandler"/>
+        <result column="sup_id" property="supId" typeHandler="UuidTypeHandler"/>
+        <result column="into_status" property="intoStatus"/>
+        <result column="intoing_qty" property="intoingQty"/>
+        <result column="intoing_amt" property="intoingAmt"/>
+        <result column="into_qty" property="intoQty"/>
+        <result column="into_amt" property="intoAmt"/>
+        <result column="return_qty" property="returnQty"/>
+        <result column="return_amt" property="returnAmt"/>
+        <result column="into_date" property="intoDate" typeHandler="TimestampTypeHandler"/>
+        <result column="remarks" property="remarks"/>
+        <result column="annex_paths" property="annexPaths" typeHandler="JsonTypeHandler"/>
+        <result column="make_staff" property="makeStaff" typeHandler="UuidTypeHandler"/>
+        <result column="make_time" property="makeTime" typeHandler="TimestampTypeHandler"/>
+        <result column="receivable_id" property="receivableId" typeHandler="UuidTypeHandler"/>
+        <result column="payable_id" property="payableId" typeHandler="UuidTypeHandler"/>
+        <result column="flg_valid" property="flgValid"/>
+        <result column="cp_id" property="cpId"/>
+        <result column="op_create_time" property="opCreateTime" typeHandler="TimestampTypeHandler"/>
+        <result column="op_create_user_id" property="opCreateUserId" typeHandler="UuidTypeHandler"/>
+        <result column="op_update_time" property="opUpdateTime" typeHandler="TimestampTypeHandler"/>
+        <result column="op_update_user_id" property="opUpdateUserId" typeHandler="UuidTypeHandler"/>
+        <result column="op_app_code" property="opAppCode"/>
+        <result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
+        <result column="op_db_user" property="opDbUser"/>
+    </resultMap>
 
 
 
@@ -118,6 +187,10 @@
         <result column="price_purchase" property="pricePurchase"/>
         <result column="reject_qty" property="rejectQty"/>
         <result column="sku_images" property="skuImages"  typeHandler="JsonTypeHandler"/>
+        <result column="usable_qty" property="usable_qty"/>
+        <result column="inv_qty" property="invQty"/>
+        <result column="outing_qty" property="outingQty"/>
+
     </resultMap>
 
 
@@ -308,11 +381,21 @@
     </sql>
 
     <!-- 查询表t_psi_inbound,(条件查询+分页)列表 -->
-    <select id="selectByCond" resultMap="BaseResultMap">
+    <select id="selectByCond" resultMap="BaseResultMapResponse">
         SELECT
-        <include refid="Base_Column_List"/>
-        FROM dkic_b.t_psi_inbound
-        <include refid="Condition"/>
+        <include refid="Base_Column_List_tpi"/>,
+        tmo.org_name AS "orgName",
+        tmp.sup_name AS "supplierName",
+        tms.staff_name AS "staffName",
+        tms.staff_name AS "makeStaffName",
+        sys.f_get_name_i18n(tdk.kind_name_i18n, 'zh_CN') AS  "intoStatusName"
+        FROM dkic_b.t_psi_inbound tpi
+        Left join dkic_b.t_mst_org tmo on tmo.org_id = tpi.org_id
+        Left join dkic_b.t_mst_supplier tmp on tmp.sup_id = tpi.sup_id
+        Left join dkic_b.t_mst_staff tms on tms.staff_id = tpi.staff_id
+        Left join dkic_b.t_mst_staff tms1 on tms1.staff_id = tpi.make_staff
+        LEFT JOIN sys.t_data_kind tdk   ON tdk.kind_code = tpi.into_status
+        <include refid="Condition_Join"/>
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
         </if>
@@ -450,7 +533,10 @@
         tmgs.price_purchase AS  list_price_purchase,
         tmgs.sku_images AS  list_sku_images,
 
-        ( tpii.into_qty + tpii.return_qty)  AS list_reject_qty
+        ( tpii.into_qty + tpii.return_qty)  AS list_reject_qty,
+        tpit.usable_qty AS list_usable_qty,
+        tpit.inv_qty AS list_inv_qty,
+        tpit.outing_qty AS list_outing_qty
     </sql>
 
 
@@ -462,6 +548,7 @@
         FROM dkic_b.t_psi_inbound  tpi
         left join dkic_b.t_psi_inbound_item tpii  on tpi.into_id = tpii.into_id
         left join  dkic_b.t_mst_goods_sku  tmgs on tmgs.sku_id = tpii.sku_id
+        left join  dkic_b.t_psi_inventory  tpit on tpit.sku_id = tpii.sku_id
         <include refid="Condition_Join"/>
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}

+ 5 - 12
src/main/java/com/dk/mdm/mapper/ivt/IntoReturnMapper.xml

@@ -5,7 +5,7 @@
     <!-- 通用设置 -->
     <!-- 通用查询列 -->
     <sql id="Base_Column_List">
-        return_id, return_no, return_type, into_id, pur_id, into_no, pur_no, org_id, staff_id, sup_id, contact_name, contact_phone, delivery_date, sum_quantity, sum_standard, sum_amount, sale_discount, return_status, out_status, outing_qty, outing_amt, out_qty, out_amt, amt_payable, amt_handle, amt_residue, remarks, annex_paths, make_staff, make_time, flg_valid, cp_id, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user
+        return_id, return_no, return_type,  pur_id, into_no, pur_no, org_id, staff_id, sup_id, contact_name, contact_phone, delivery_date, sum_quantity, sum_standard, sum_amount, sale_discount, return_status, out_status, outing_qty, outing_amt, out_qty, out_amt, amt_payable, amt_handle, amt_residue, remarks, annex_paths, make_staff, make_time, flg_valid, cp_id, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user
     </sql>
 
     <!-- 通用查询映射结果 -->
@@ -13,7 +13,7 @@
         <id column="return_id" property="returnId"/>
                 <result column="return_no" property="returnNo"/>
                 <result column="return_type" property="returnType"/>
-                <result column="into_id" property="intoId" typeHandler="UuidTypeHandler"/>
+
                 <result column="pur_id" property="purId" typeHandler="UuidTypeHandler"/>
                 <result column="into_no" property="intoNo"/>
                 <result column="pur_no" property="purNo"/>
@@ -55,7 +55,7 @@
 
 
     <sql id="Base_Column_List_Response">
-        tpir.return_id, tpir.return_no, tpir.return_type, tpir.into_id, tpir.pur_id, tpir.into_no, tpir.pur_no, tpir.org_id,
+        tpir.return_id, tpir.return_no, tpir.return_type,  tpir.pur_id, tpir.into_no, tpir.pur_no, tpir.org_id,
         tpir.staff_id, tpir.sup_id, tpir.contact_name, tpir.contact_phone, tpir.delivery_date, tpir.sum_quantity,
         tpir.sum_standard, tpir.sum_amount, tpir.sale_discount, tpir.return_status, tpir.out_status,
         tpir.outing_qty, tpir.outing_amt, tpir.out_qty, tpir.out_amt, tpir.amt_payable, tpir.amt_handle, tpir.amt_residue,
@@ -67,7 +67,6 @@
         <id column="return_id" property="returnId"/>
         <result column="return_no" property="returnNo"/>
         <result column="return_type" property="returnType"/>
-        <result column="into_id" property="intoId" typeHandler="UuidTypeHandler"/>
         <result column="pur_id" property="purId" typeHandler="UuidTypeHandler"/>
         <result column="into_no" property="intoNo"/>
         <result column="pur_no" property="purNo"/>
@@ -121,9 +120,7 @@
             <if test="returnType != null and returnType != ''">
                 AND return_type = #{returnType}
             </if>
-            <if test="intoId != null and intoId != ''">
-                AND into_id = #{intoId}
-            </if>
+
             <if test="purId != null and purId != ''">
                 AND pur_id = #{purId}
             </if>
@@ -240,9 +237,7 @@
             <if test="returnType != null and returnType != ''">
                 AND tpir.return_type = #{returnType}
             </if>
-            <if test="intoId != null and intoId != ''">
-                AND tpir.into_id = #{intoId}
-            </if>
+
             <if test="purId != null and purId != ''">
                 AND tpir.pur_id = #{purId}
             </if>
@@ -414,7 +409,6 @@
         <trim suffixOverrides=",">
             return_no,
             return_type,
-            into_id,
             pur_id,
             into_no,
             pur_no,
@@ -451,7 +445,6 @@
             <trim suffixOverrides=",">
                 #{item.returnNo},
                 #{item.returnType},
-                #{item.intoId}::uuid,
                 #{item.purId}::uuid,
                 #{item.intoNo},
                 #{item.purNo},

+ 54 - 46
src/main/java/com/dk/mdm/mapper/ivt/OutboundItemMapper.xml

@@ -78,88 +78,67 @@
     <sql id="Condition">
         <where>
             <if test="outId != null and outId != ''">
-                AND out_id = #{outId}::uuid
+                AND t.out_id = #{outId}::uuid
             </if>
             <if test="outType != null and outType != ''">
-                AND out_type = #{outType}
+                AND t.out_type = #{outType}
             </if>
             <if test="fromId != null and fromId != ''">
-                AND from_id = #{fromId}
+                AND t.from_id = #{fromId}
             </if>
             <if test="fromItemId != null and fromItemId != ''">
-                AND from_item_id = #{fromItemId}
+                AND t.from_item_id = #{fromItemId}
             </if>
             <if test="itemIndex != null">
-                AND item_index = #{itemIndex}
+                AND t.item_index = #{itemIndex}
             </if>
             <if test="skuId != null and skuId != ''">
-                AND sku_id = #{skuId}
+                AND t.sku_id = #{skuId}
             </if>
             <if test="priceOut != null">
-                AND price_out = #{priceOut}
+                AND t.price_out = #{priceOut}
             </if>
             <if test="nonStdCode != null and nonStdCode != ''">
-                AND non_std_code = #{nonStdCode}
+                AND t.non_std_code = #{nonStdCode}
             </if>
             <if test="outStatus != null and outStatus != ''">
-                AND out_status = #{outStatus}
+                AND t.out_status = #{outStatus}
             </if>
             <if test="outingQty != null">
-                AND outing_qty = #{outingQty}
+                AND t.outing_qty = #{outingQty}
             </if>
             <if test="outingAmt != null">
-                AND outing_amt = #{outingAmt}
+                AND t.outing_amt = #{outingAmt}
             </if>
             <if test="outQty != null">
-                AND out_qty = #{outQty}
+                AND t.out_qty = #{outQty}
             </if>
             <if test="outAmt != null">
-                AND out_amt = #{outAmt}
+                AND t.out_amt = #{outAmt}
             </if>
             <if test="returnQty != null">
-                AND return_qty = #{returnQty}
+                AND t.return_qty = #{returnQty}
             </if>
             <if test="returnAmt != null">
-                AND return_amt = #{returnAmt}
+                AND t.return_amt = #{returnAmt}
             </if>
             <if test="remarks != null and remarks != ''">
-                AND remarks = #{remarks}
+                AND t.remarks = #{remarks}
             </if>
             <if test="invId != null and invId != ''">
-                AND inv_id = #{invId}
+                AND t.inv_id = #{invId}
             </if>
             <if test="costPrice != null">
-                AND cost_price = #{costPrice}
+                AND t.cost_price = #{costPrice}
             </if>
             <if test="costAmt != null">
-                AND cost_amt = #{costAmt}
+                AND t.cost_amt = #{costAmt}
             </if>
             <if test="flgValid != null">
-                AND flg_valid = #{flgValid}
+                AND t.flg_valid = #{flgValid}
             </if>
             <if test="cpId != null">
-                AND cp_id = #{cpId}
-            </if>
-            <if test="opCreateTime != null">
-                AND op_create_time = #{opCreateTime}
-            </if>
-            <if test="opCreateUserId != null and opCreateUserId != ''">
-                AND op_create_user_id = #{opCreateUserId}
-            </if>
-            <if test="opUpdateTime != null">
-                AND op_update_time = #{opUpdateTime}
-            </if>
-            <if test="opUpdateUserId != null and opUpdateUserId != ''">
-                AND op_update_user_id = #{opUpdateUserId}
-            </if>
-            <if test="opAppCode != null and opAppCode != ''">
-                AND op_app_code = #{opAppCode}
-            </if>
-            <if test="opTimestamp != null">
-                AND op_timestamp = #{opTimestamp}
-            </if>
-            <if test="opDbUser != null and opDbUser != ''">
-                AND op_db_user = #{opDbUser}
+                AND t.cp_id = #{cpId}
             </if>
         </where>
     </sql>
@@ -174,9 +153,38 @@
 
     <!-- 查询表t_psi_outbound_item,(条件查询+分页)列表 -->
     <select id="selectByCond" resultMap="BaseResultMapResponse">
-        SELECT
-        <include refid="Base_Column_List"/>
-        FROM t_psi_outbound_item
+        SELECT t.item_id,
+               t.out_id,
+               t.out_type,
+               t.from_id,
+               t.from_item_id,
+               t.item_index,
+               t.sku_id,
+               tmgs.sku_code                                    as "skuCode",
+               tmgs.sku_model                                   as "skuModel",
+               tmgs.sku_name                                    as "skuName",
+               t.price_out,
+               t.non_std_code,
+               t.out_status,
+               t.outing_qty,
+               t.outing_amt,
+               t.out_qty,
+               t.out_amt,
+               t.return_qty,
+               t.return_amt,
+               t.remarks,
+               t.inv_id,
+               t.cost_price,
+               t.cost_amt,
+               t.flg_valid,
+               t.cp_id,
+               tmw.wh_name                                      as "whName",
+               sys.f_get_name_i18n(tdk.kind_name_i18n, 'zh_CN') as "outStatusName"
+        FROM t_psi_outbound_item as t
+                 left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = t.sku_id
+                 left join dkic_b.t_psi_inventory as tpi on tpi.inv_id = t.inv_id
+                 left join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id
+                 left join sys.t_data_kind as tdk on tdk.kind_code = t.out_status
         <include refid="Condition"/>
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
@@ -187,7 +195,7 @@
     <select id="countByCond" resultType="Long">
         SELECT
         count(1)
-        FROM t_psi_outbound_item
+        FROM t_psi_outbound_item as t
         <include refid="Condition"/>
     </select>
 

+ 70 - 50
src/main/java/com/dk/mdm/mapper/ivt/OutboundMapper.xml

@@ -5,7 +5,7 @@
     <!-- 通用设置 -->
     <!-- 通用查询列 -->
     <sql id="Base_Column_List">
-        out_id, out_no, out_type, from_id, from_no, org_id, staff_id, cus_id, sup_id, out_status, outing_qty, outing_amt, out_qty, out_amt, return_qty, return_amt, out_date, remarks, annex_paths, make_staff, make_time, receivable_id, payable_id, flg_valid, cp_id, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user
+        out_id, out_no, out_type, from_id, from_no, org_id, staff_id, cus_id, sup_id, out_status, outing_qty, outing_amt, out_qty, out_amt, return_qty, return_amt, out_date, remarks, annex_paths, make_staff, make_time, receivable_id, payable_id, flg_valid, cp_id
     </sql>
 
     <!-- 通用查询映射结果 -->
@@ -84,97 +84,76 @@
     <sql id="Condition">
         <where>
             <if test="outNo != null and outNo != ''">
-                AND out_no = #{outNo}
+                AND t.out_no = #{outNo}
             </if>
             <if test="outType != null and outType != ''">
-                AND out_type = #{outType}
+                AND t.out_type = #{outType}
             </if>
             <if test="fromId != null and fromId != ''">
-                AND from_id = #{fromId}
+                AND t.from_id = #{fromId}
             </if>
             <if test="fromNo != null and fromNo != ''">
-                AND from_no = #{fromNo}
+                AND t.from_no = #{fromNo}
             </if>
             <if test="orgId != null and orgId != ''">
-                AND org_id = #{orgId}
+                AND t.org_id = #{orgId}
             </if>
             <if test="staffId != null and staffId != ''">
-                AND staff_id = #{staffId}
+                AND t.staff_id = #{staffId}
             </if>
             <if test="cusId != null and cusId != ''">
-                AND cus_id = #{cusId}
+                AND t.cus_id = #{cusId}
             </if>
             <if test="supId != null and supId != ''">
-                AND sup_id = #{supId}
+                AND t.sup_id = #{supId}
             </if>
             <if test="outStatus != null and outStatus != ''">
-                AND out_status = #{outStatus}
+                AND t.out_status = #{outStatus}
             </if>
             <if test="outingQty != null">
-                AND outing_qty = #{outingQty}
+                AND t.outing_qty = #{outingQty}
             </if>
             <if test="outingAmt != null">
-                AND outing_amt = #{outingAmt}
+                AND t.outing_amt = #{outingAmt}
             </if>
             <if test="outQty != null">
-                AND out_qty = #{outQty}
+                AND t.out_qty = #{outQty}
             </if>
             <if test="outAmt != null">
-                AND out_amt = #{outAmt}
+                AND t.out_amt = #{outAmt}
             </if>
             <if test="returnQty != null">
-                AND return_qty = #{returnQty}
+                AND t.return_qty = #{returnQty}
             </if>
             <if test="returnAmt != null">
-                AND return_amt = #{returnAmt}
+                AND t.return_amt = #{returnAmt}
             </if>
             <if test="outDate != null">
-                AND out_date = #{outDate}
+                AND t.out_date = #{outDate}
             </if>
             <if test="remarks != null and remarks != ''">
-                AND remarks = #{remarks}
+                AND t.remarks = #{remarks}
             </if>
             <if test="annexPaths != null and annexPaths != ''">
-                AND annex_paths = #{annexPaths}
+                AND t.annex_paths = #{annexPaths}
             </if>
             <if test="makeStaff != null and makeStaff != ''">
-                AND make_staff = #{makeStaff}
+                AND t.make_staff = #{makeStaff}
             </if>
             <if test="makeTime != null">
-                AND make_time = #{makeTime}
+                AND t.make_time = #{makeTime}
             </if>
             <if test="receivableId != null and receivableId != ''">
-                AND receivable_id = #{receivableId}
+                AND t.receivable_id = #{receivableId}
             </if>
             <if test="payableId != null and payableId != ''">
-                AND payable_id = #{payableId}
+                AND t.payable_id = #{payableId}
             </if>
             <if test="flgValid != null">
-                AND flg_valid = #{flgValid}
+                AND t.flg_valid = #{flgValid}
             </if>
             <if test="cpId != null">
-                AND cp_id = #{cpId}
-            </if>
-            <if test="opCreateTime != null">
-                AND op_create_time = #{opCreateTime}
-            </if>
-            <if test="opCreateUserId != null and opCreateUserId != ''">
-                AND op_create_user_id = #{opCreateUserId}
-            </if>
-            <if test="opUpdateTime != null">
-                AND op_update_time = #{opUpdateTime}
-            </if>
-            <if test="opUpdateUserId != null and opUpdateUserId != ''">
-                AND op_update_user_id = #{opUpdateUserId}
-            </if>
-            <if test="opAppCode != null and opAppCode != ''">
-                AND op_app_code = #{opAppCode}
-            </if>
-            <if test="opTimestamp != null">
-                AND op_timestamp = #{opTimestamp}
-            </if>
-            <if test="opDbUser != null and opDbUser != ''">
-                AND op_db_user = #{opDbUser}
+                AND t.cp_id = #{cpId}
             </if>
         </where>
     </sql>
@@ -189,9 +168,50 @@
 
     <!-- 查询表t_psi_outbound,(条件查询+分页)列表 -->
     <select id="selectByCond" resultMap="BaseResultMapResponse">
-        SELECT
-        <include refid="Base_Column_List"/>
-        FROM t_psi_outbound
+        SELECT t.out_id,
+               t.out_no,
+               t.out_type,
+               t.from_id,
+               t.from_no,
+               t.from_no                                         as "orderNo",
+               t.org_id,
+               tmo.org_name                                      as "orgName",
+               t.staff_id,
+               tms.staff_name                                    as "staffName",
+               t.cus_id,
+               tmc.cus_code                                      as "cusCode",
+               tmc.cus_name                                      as "cusName",
+               tmc.cus_phone                                     as "cusPhone",
+               tmc.cus_from                                      as "cusFrom",
+               tmc.contact_phone                                 as "contactPhone",
+               tmc.address_full                                  as "addressFull",
+               tmdd.data_value                                   as "cusFromName",
+               t.sup_id,
+               t.out_status,
+               sys.f_get_name_i18n(tdk1.kind_name_i18n, 'zh_CN') as "outStatusName",
+               t.outing_qty,
+               t.outing_amt,
+               t.out_qty,
+               t.out_amt,
+               t.return_qty,
+               t.return_amt,
+               t.out_date,
+               t.remarks,
+               t.annex_paths,
+               t.make_staff,
+               makestaff.staff_name                              as "makeStaffName",
+               t.make_time,
+               t.receivable_id,
+               t.payable_id,
+               t.flg_valid,
+               t.cp_id
+        FROM t_psi_outbound as t
+                 left join dkic_b.t_mst_org tmo on tmo.org_id = t.org_id
+                 left join dkic_b.t_mst_staff tms on tms.staff_id = t.staff_id
+                 left join dkic_b.t_mst_staff as makestaff on makestaff.staff_id = t.make_staff
+                 left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.cus_id
+                 left join dkic_b.t_mst_dictionary_data tmdd on tmdd.data_id = tmc.cus_from
+                 left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.out_status
         <include refid="Condition"/>
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
@@ -202,7 +222,7 @@
     <select id="countByCond" resultType="Long">
         SELECT
         count(1)
-        FROM t_psi_outbound
+        FROM t_psi_outbound as t
         <include refid="Condition"/>
     </select>
 

+ 14 - 0
src/main/java/com/dk/mdm/mapper/pur/PurchaseMapper.java

@@ -39,6 +39,20 @@ public interface PurchaseMapper extends BaseMapper<Purchase>{
      */
     PurchaseResponse  selectById(@Param("purId") String purId);
 
+    /**
+     * @desc   : 采购订单 待入库查询
+     * @author : 王英杰
+     * @date   : 2024/2/28 9:46
+     */
+    List<PurchaseResponse> noStoredSelectByCond(PurchaseQuery purchaseQuery);
+
+    /**
+     * @desc   : 采购订单 待入库查询 个数
+     * @author : 王英杰
+     * @date   : 2024/2/28 9:46
+     */
+    Long noStoredCountByCond(PurchaseQuery purchaseQuery);
+
     int updateAmount(Purchase purchase);
 
     Purchase selectPurchaseByRighting(PurchaseQuery purchaseQuery);

+ 31 - 0
src/main/java/com/dk/mdm/mapper/pur/PurchaseMapper.xml

@@ -459,6 +459,37 @@
         <include refid="Condition_1"/>
     </select>
 
+
+    <!-- 查询表dkic_b.t_psi_purchase,(条件查询+分页)列表 -->
+    <select id="noStoredSelectByCond" resultMap="BaseResultMapResponse">
+        SELECT
+        <include refid="Base_Column_List_Left_join"/>
+        ,tmo.org_name as "orgName"
+        ,tms.staff_name as "staffName"
+        ,tms1.staff_name as "makeStaffName"
+        ,tmp.sup_name as "supplierName"
+        ,tmw.wh_name as "whName"
+        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_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 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"/>
+        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+            limit #{end} offset #{start}
+        </if>
+    </select>
+
+    <!-- 查询表dkic_b.t_psi_purchase,(条件查询)个数 -->
+    <select id="noStoredCountByCond" resultType="Long">
+        SELECT
+        count(1)
+        FROM dkic_b.t_psi_purchase tpp
+        <include refid="Condition_1"/>
+    </select>
+
+
     <update id="updateAmount" parameterType="com.dk.mdm.model.pojo.pur.Purchase">
         update dkic_b.t_psi_purchase
         <set>

+ 74 - 74
src/main/java/com/dk/mdm/mapper/sale/OrderItemMapper.xml

@@ -77,64 +77,64 @@
     <sql id="Condition">
         <where>
             <if test="orderId != null and orderId != ''">
-                AND tpoi.order_id = #{orderId}::uuid
+                AND t.order_id = #{orderId}::uuid
             </if>
             <if test="itemIndex != null">
-                AND tpoi.item_index = #{itemIndex}
+                AND t.item_index = #{itemIndex}
             </if>
             <if test="skuId != null and skuId != ''">
-                AND tpoi.sku_id = #{skuId}
+                AND t.sku_id = #{skuId}
             </if>
             <if test="itemQty != null">
-                AND tpoi.item_qty = #{itemQty}
+                AND t.item_qty = #{itemQty}
             </if>
             <if test="priceStd != null">
-                AND tpoi.price_std = #{priceStd}
+                AND t.price_std = #{priceStd}
             </if>
             <if test="amtStd != null">
-                AND tpoi.amt_std = #{amtStd}
+                AND t.amt_std = #{amtStd}
             </if>
             <if test="priceSale != null">
-                AND tpoi.price_sale = #{priceSale}
+                AND t.price_sale = #{priceSale}
             </if>
             <if test="itemAmt != null">
-                AND tpoi.item_amt = #{itemAmt}
+                AND t.item_amt = #{itemAmt}
             </if>
             <if test="priceDiscount != null">
-                AND tpoi.price_discount = #{priceDiscount}
+                AND t.price_discount = #{priceDiscount}
             </if>
             <if test="nonStdCode != null and nonStdCode != ''">
-                AND tpoi.non_std_code = #{nonStdCode}
+                AND t.non_std_code = #{nonStdCode}
             </if>
             <if test="outStatus != null and outStatus != ''">
-                AND tpoi.out_status = #{outStatus}
+                AND t.out_status = #{outStatus}
             </if>
             <if test="outingQty != null">
-                AND tpoi.outing_qty = #{outingQty}
+                AND t.outing_qty = #{outingQty}
             </if>
             <if test="outingAmt != null">
-                AND tpoi.outing_amt = #{outingAmt}
+                AND t.outing_amt = #{outingAmt}
             </if>
             <if test="outQty != null">
-                AND tpoi.out_qty = #{outQty}
+                AND t.out_qty = #{outQty}
             </if>
             <if test="outAmt != null">
-                AND tpoi.out_amt = #{outAmt}
+                AND t.out_amt = #{outAmt}
             </if>
             <if test="returnQty != null">
-                AND tpoi.return_qty = #{returnQty}
+                AND t.return_qty = #{returnQty}
             </if>
             <if test="returnAmt != null">
-                AND tpoi.return_amt = #{returnAmt}
+                AND t.return_amt = #{returnAmt}
             </if>
             <if test="remarks != null and remarks != ''">
-                AND tpoi.remarks = #{remarks}
+                AND t.remarks = #{remarks}
             </if>
             <if test="flgValid != null">
-                AND tpoi.flg_valid = #{flgValid}
+                AND t.flg_valid = #{flgValid}
             </if>
             <if test="cpId != null">
-                AND tpoi.cp_id = #{cpId}
+                AND t.cp_id = #{cpId}
             </if>
         </where>
     </sql>
@@ -149,32 +149,32 @@
 
     <!-- 查询表t_psi_order_item,(条件查询+分页)列表 -->
     <select id="selectByCond" resultMap="BaseResultMapResponse">
-        SELECT tpoi.item_id,
-               tpoi.order_id,
-               tpoi.item_index,
-               tpoi.sku_id,
+        SELECT t.item_id,
+               t.order_id,
+               t.item_index,
+               t.sku_id,
                tmgs.sku_code  as "skuCode",
                tmgs.sku_model as "skuModel",
                tmgs.sku_name  as "skuName",
-               tpoi.item_qty,
-               tpoi.price_std,
-               tpoi.amt_std,
-               tpoi.price_sale,
-               tpoi.item_amt,
-               tpoi.price_discount,
-               tpoi.non_std_code,
-               tpoi.out_status,
-               tpoi.outing_qty,
-               tpoi.outing_amt,
-               tpoi.out_qty,
-               tpoi.out_amt,
-               tpoi.return_qty,
-               tpoi.return_amt,
-               tpoi.remarks
-        FROM dkic_b.t_psi_order_item as tpoi
-                 inner join dkic_b.t_mst_goods_sku tmgs on tpoi.sku_id = tmgs.sku_id
+               t.item_qty,
+               t.price_std,
+               t.amt_std,
+               t.price_sale,
+               t.item_amt,
+               t.price_discount,
+               t.non_std_code,
+               t.out_status,
+               t.outing_qty,
+               t.outing_amt,
+               t.out_qty,
+               t.out_amt,
+               t.return_qty,
+               t.return_amt,
+               t.remarks
+        FROM dkic_b.t_psi_order_item as t
+                 inner join dkic_b.t_mst_goods_sku tmgs on t.sku_id = tmgs.sku_id
         <include refid="Condition"/>
-        order by tpoi.item_index
+        order by t.item_index
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
         </if>
@@ -184,7 +184,7 @@
     <select id="countByCond" resultType="Long">
         SELECT
         count(1)
-        FROM t_psi_order_item
+        FROM t_psi_order_item as t
         <include refid="Condition"/>
     </select>
 
@@ -277,63 +277,63 @@
 
     <!-- 根据条件进行查询(出库用) -->
     <select id="selectByCondForOut" resultMap="BaseResultMapResponse">
-        SELECT tpoi.item_id                                        as "fromItemId",
-               tpoi.order_id                                       as "fromId",
-               tpoi.item_index,
-               tpoi.sku_id,
+        SELECT t.item_id                                        as "fromItemId",
+               t.order_id                                       as "fromId",
+               t.item_index,
+               t.sku_id,
                tmgs.sku_code                                       as "skuCode",
                tmgs.sku_model                                      as "skuModel",
                tmgs.sku_name                                       as "skuName",
-               tpoi.item_qty                                       as "orderQty",
-               tpoi.item_qty - tpoi.outing_qty                     as "canOutingQty",
-               tpoi.item_qty - tpoi.outing_qty                     as outing_qty,
-               tpoi.price_sale                                     as "priceOut",
-               tpoi.price_sale * (tpoi.item_qty - tpoi.outing_qty) as outing_amt,
-               tpoi.non_std_code,
-               tpoi.remarks,
+               t.item_qty                                       as "orderQty",
+               t.item_qty - t.outing_qty                     as "canOutingQty",
+               t.item_qty - t.outing_qty                     as outing_qty,
+               t.price_sale                                     as "priceOut",
+               t.price_sale * (t.item_qty - t.outing_qty) as outing_amt,
+               t.non_std_code,
+               t.remarks,
                tpi.inv_id                                          as "invId",
                tpi.wh_id                                           as "whId",
                tpi.inv_qty                                         as "invQty",
                tpi.usable_qty                                      as "usableQty",
                tmw.wh_name                                         as "whName"
-        FROM dkic_b.t_psi_order_item as tpoi
-                 inner join dkic_b.t_mst_goods_sku tmgs on tpoi.sku_id = tmgs.sku_id
+        FROM dkic_b.t_psi_order_item as t
+                 inner join dkic_b.t_mst_goods_sku tmgs on t.sku_id = tmgs.sku_id
                  left join dkic_b.t_psi_inventory as tpi
-                           on tpi.sku_id = tpoi.sku_id and tpi.non_std_code = tpoi.non_std_code and
-                              tpi.cp_id = tpoi.cp_id
+                           on tpi.sku_id = t.sku_id and tpi.non_std_code = t.non_std_code and
+                              tpi.cp_id = t.cp_id
                  left join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id
-        where tpoi.flg_valid
-          and tpoi.item_qty > tpoi.outing_qty
-          and tpoi.order_id = #{orderId}::uuid
-        order by tpoi.item_index
+        where t.flg_valid
+          and t.item_qty > t.outing_qty
+          and t.order_id = #{orderId}::uuid
+        order by t.item_index
     </select>
 
     <!-- 根据条件进行查询(出库用) -->
     <select id="selectByCondForReturn" resultMap="BaseResultMapResponse">
         SELECT tpobi.out_id                                         as "outId",
                tpobi.item_id                                        as "outItemId",
-               tpoi.order_id                                        as order_id,
-               tpoi.item_id                                         as "orderItemId",
-               tpoi.sku_id,
+               t.order_id                                        as order_id,
+               t.item_id                                         as "orderItemId",
+               t.sku_id,
                tmgs.sku_code                                        as "skuCode",
                tmgs.sku_model                                       as "skuModel",
                tmgs.sku_name                                        as "skuName",
                tpobi.out_qty                                        as out_qty,
                tpobi.out_qty - tpobi.return_qty                     as "canReturnQty",
                tpobi.out_qty - tpobi.return_qty                     as item_qty,
-               tpoi.price_std,
-               tpoi.price_std * (tpobi.out_qty - tpobi.return_qty)  as amt_std,
-               tpoi.price_sale                                      as "priceReturn",
-               tpoi.price_sale * (tpobi.out_qty - tpobi.return_qty) as item_amt,
-               tpoi.non_std_code,
+               t.price_std,
+               t.price_std * (tpobi.out_qty - tpobi.return_qty)  as amt_std,
+               t.price_sale                                      as "priceReturn",
+               t.price_sale * (tpobi.out_qty - tpobi.return_qty) as item_amt,
+               t.non_std_code,
                tpobi.remarks
         FROM dkic_b.t_psi_outbound_item as tpobi
-                 inner join dkic_b.t_psi_order_item as tpoi on tpoi.item_id = tpobi.from_item_id
-                 inner join dkic_b.t_mst_goods_sku tmgs on tpoi.sku_id = tmgs.sku_id
+                 inner join dkic_b.t_psi_order_item as t on t.item_id = tpobi.from_item_id
+                 inner join dkic_b.t_mst_goods_sku tmgs on t.sku_id = tmgs.sku_id
         where tpobi.flg_valid
           and tpobi.out_type = '出库类型-销售出库'
           and tpobi.out_qty > tpobi.return_qty
-          and tpoi.order_id = #{orderId}::uuid
-        order by tpoi.item_index
+          and t.order_id = #{orderId}::uuid
+        order by t.item_index
     </select>
 </mapper>

+ 131 - 131
src/main/java/com/dk/mdm/mapper/sale/OrderMapper.xml

@@ -106,126 +106,126 @@
     <sql id="Condition">
         <where>
             <if test="orderNo != null and orderNo != ''">
-                AND tpo.order_no = #{orderNo}
+                AND t.order_no = #{orderNo}
             </if>
             <if test="orderType != null and orderType != ''">
-                AND tpo.order_type = #{orderType}
+                AND t.order_type = #{orderType}
             </if>
             <if test="orgId != null and orgId != ''">
-                AND tpo.org_id = #{orgId}
+                AND t.org_id = #{orgId}
             </if>
             <if test="staffId != null and staffId != ''">
-                AND tpo.staff_id = #{staffId}
+                AND t.staff_id = #{staffId}
             </if>
             <if test="cusId != null and cusId != ''">
-                AND tpo.cus_id = #{cusId}
+                AND t.cus_id = #{cusId}
             </if>
             <if test="addressArea != null and addressArea != ''">
-                AND tpo.address_area = #{addressArea}
+                AND t.address_area = #{addressArea}
             </if>
             <if test="addressName != null and addressName != ''">
-                AND tpo.address_name = #{addressName}
+                AND t.address_name = #{addressName}
             </if>
             <if test="addressNo != null and addressNo != ''">
-                AND tpo.address_no = #{addressNo}
+                AND t.address_no = #{addressNo}
             </if>
             <if test="addressGcj02 != null and addressGcj02 != ''">
-                AND tpo.address_gcj02 = #{addressGcj02}
+                AND t.address_gcj02 = #{addressGcj02}
             </if>
             <if test="addressFull != null and addressFull != ''">
-                AND tpo.address_full = #{addressFull}
+                AND t.address_full = #{addressFull}
             </if>
             <if test="contactName != null and contactName != ''">
-                AND tpo.contact_name = #{contactName}
+                AND t.contact_name = #{contactName}
             </if>
             <if test="contactPhone != null and contactPhone != ''">
-                AND tpo.contact_phone = #{contactPhone}
+                AND t.contact_phone = #{contactPhone}
             </if>
             <if test="salesChannel != null and salesChannel != ''">
-                AND tpo.sales_channel = #{salesChannel}
+                AND t.sales_channel = #{salesChannel}
             </if>
             <if test="deliveryDate != null">
-                AND tpo.delivery_date = #{deliveryDate}
+                AND t.delivery_date = #{deliveryDate}
             </if>
             <if test="sumQuantity != null">
-                AND tpo.sum_quantity = #{sumQuantity}
+                AND t.sum_quantity = #{sumQuantity}
             </if>
             <if test="sumStandard != null">
-                AND tpo.sum_standard = #{sumStandard}
+                AND t.sum_standard = #{sumStandard}
             </if>
             <if test="sumAmount != null">
-                AND tpo.sum_amount = #{sumAmount}
+                AND t.sum_amount = #{sumAmount}
             </if>
             <if test="saleDiscount != null">
-                AND tpo.sale_discount = #{saleDiscount}
+                AND t.sale_discount = #{saleDiscount}
             </if>
             <if test="orderStatus != null and orderStatus != ''">
-                AND tpo.order_status = #{orderStatus}
+                AND t.order_status = #{orderStatus}
             </if>
             <if test="outStatus != null and outStatus != ''">
-                AND tpo.out_status = #{outStatus}
+                AND t.out_status = #{outStatus}
             </if>
             <if test="outingQty != null">
-                AND tpo.outing_qty = #{outingQty}
+                AND t.outing_qty = #{outingQty}
             </if>
             <if test="outingAmt != null">
-                AND tpo.outing_amt = #{outingAmt}
+                AND t.outing_amt = #{outingAmt}
             </if>
             <if test="outQty != null">
-                AND tpo.out_qty = #{outQty}
+                AND t.out_qty = #{outQty}
             </if>
             <if test="outAmt != null">
-                AND tpo.out_amt = #{outAmt}
+                AND t.out_amt = #{outAmt}
             </if>
             <if test="returnQty != null">
-                AND tpo.return_qty = #{returnQty}
+                AND t.return_qty = #{returnQty}
             </if>
             <if test="returnAmt != null">
-                AND tpo.return_amt = #{returnAmt}
+                AND t.return_amt = #{returnAmt}
             </if>
             <if test="amtReceivable != null">
-                AND tpo.amt_receivable = #{amtReceivable}
+                AND t.amt_receivable = #{amtReceivable}
             </if>
             <if test="amtHandle != null">
-                AND tpo.amt_handle = #{amtHandle}
+                AND t.amt_handle = #{amtHandle}
             </if>
             <if test="amtResidue != null">
-                AND tpo.amt_residue = #{amtResidue}
+                AND t.amt_residue = #{amtResidue}
             </if>
             <if test="remarks != null and remarks != ''">
-                AND tpo.remarks = #{remarks}
+                AND t.remarks = #{remarks}
             </if>
             <if test="annexPaths != null and annexPaths != ''">
-                AND tpo.annex_paths = #{annexPaths}
+                AND t.annex_paths = #{annexPaths}
             </if>
             <if test="makeStaff != null and makeStaff != ''">
-                AND tpo.make_staff = #{makeStaff}
+                AND t.make_staff = #{makeStaff}
             </if>
             <if test="makeTime != null">
-                AND tpo.make_time = #{makeTime}
+                AND t.make_time = #{makeTime}
             </if>
             <if test="flgValid != null">
-                AND tpo.flg_valid = #{flgValid}
+                AND t.flg_valid = #{flgValid}
             </if>
             <if test="cpId != null">
-                AND tpo.cp_id = #{cpId}
+                AND t.cp_id = #{cpId}
             </if>
             <if test="orgIdList != null and orgIdList.size() > 0">
-                AND tpo.org_id  =any(#{orgIdList, typeHandler=uuidListTypeHandler})
+                AND t.org_id  =any(#{orgIdList, typeHandler=uuidListTypeHandler})
             </if>
             <if test="staffIdList != null and staffIdList.size() > 0">
-                AND tpo.staff_id  =any(#{staffIdList, typeHandler=uuidListTypeHandler})
+                AND t.staff_id  =any(#{staffIdList, typeHandler=uuidListTypeHandler})
             </if>
             <if test="outStatusList != null and outStatusList.size() > 0">
-                AND tpo.out_status  =any(#{outStatusList, typeHandler=StringListTypeHandler})
+                AND t.out_status  =any(#{outStatusList, typeHandler=StringListTypeHandler})
             </if>
             <if test="makeTimeStart != null and makeTimeEnd != null">
-                AND tpo.make_time &gt;= #{makeTimeStart}::timestamp with time zone
-                AND tpo.make_time &lt; #{makeTimeEnd}::timestamp with time zone + interval '1 day'
+                AND t.make_time &gt;= #{makeTimeStart}::timestamp with time zone
+                AND t.make_time &lt; #{makeTimeEnd}::timestamp with time zone + interval '1 day'
             </if>
             <if test="deliveryDateStart != null and deliveryDateEnd != null">
-                AND tpo.delivery_date &gt;= #{deliveryDateStart}::timestamp with time zone
-                AND tpo.delivery_date &lt; #{deliveryDateEnd}::timestamp with time zone + interval '1 day'
+                AND t.delivery_date &gt;= #{deliveryDateStart}::timestamp with time zone
+                AND t.delivery_date &lt; #{deliveryDateEnd}::timestamp with time zone + interval '1 day'
             </if>
         </where>
     </sql>
@@ -240,64 +240,64 @@
 
     <!-- 查询表t_psi_order,(条件查询+分页)列表 -->
     <select id="selectByCond" resultMap="BaseResultMapResponse">
-        SELECT tpo.order_id,
-               tpo.order_no,
-               tpo.order_type,
+        SELECT t.order_id,
+               t.order_no,
+               t.order_type,
                sys.f_get_name_i18n(tdk1.kind_name_i18n, 'zh_CN') as "orderTypeName",
-               tpo.org_id,
+               t.org_id,
                tmo.org_name                                      as "orgName",
-               tpo.staff_id,
+               t.staff_id,
                tms.staff_name                                    as "staffName",
-               tpo.cus_id,
+               t.cus_id,
                tmc.cus_code                                      as "cusCode",
                tmc.cus_name                                      as "cusName",
                tmc.cus_phone                                     as "cusPhone",
                tmc.cus_from                                      as "cusFrom",
                tmdd.data_value                                   as "cusFromName",
-               tpo.address_area,
-               tpo.address_name,
-               tpo.address_no,
-               tpo.address_gcj02,
-               tpo.address_full,
-               tpo.contact_name,
-               tpo.contact_phone,
-               tpo.sales_channel,
+               t.address_area,
+               t.address_name,
+               t.address_no,
+               t.address_gcj02,
+               t.address_full,
+               t.contact_name,
+               t.contact_phone,
+               t.sales_channel,
                tmsc.channel_name                                 as "channelName",
-               tpo.delivery_date,
-               tpo.sum_quantity,
-               tpo.sum_standard,
-               tpo.sum_amount,
-               tpo.sale_discount,
-               tpo.order_status,
+               t.delivery_date,
+               t.sum_quantity,
+               t.sum_standard,
+               t.sum_amount,
+               t.sale_discount,
+               t.order_status,
                sys.f_get_name_i18n(tdk2.kind_name_i18n, 'zh_CN') as "orderStatusName",
-               tpo.out_status,
+               t.out_status,
                sys.f_get_name_i18n(tdk3.kind_name_i18n, 'zh_CN') as "outStatusName",
-               tpo.outing_qty,
-               tpo.outing_amt,
-               tpo.out_qty,
-               tpo.out_amt,
-               tpo.return_qty,
-               tpo.return_amt,
-               tpo.amt_receivable,
-               tpo.amt_handle,
-               tpo.amt_residue,
-               tpo.remarks,
-               tpo.annex_paths,
+               t.outing_qty,
+               t.outing_amt,
+               t.out_qty,
+               t.out_amt,
+               t.return_qty,
+               t.return_amt,
+               t.amt_receivable,
+               t.amt_handle,
+               t.amt_residue,
+               t.remarks,
+               t.annex_paths,
                makestaff.staff_name                              as "makeStaffName",
-               tpo.make_time,
-               tpo.cp_id
-        FROM dkic_b.t_psi_order as tpo
-                 left join dkic_b.t_mst_sale_channel tmsc on tpo.sales_channel = tmsc.channel_id
-                 left join dkic_b.t_mst_org tmo on tpo.org_id = tmo.org_id
-                 left join dkic_b.t_mst_staff tms on tpo.staff_id = tms.staff_id
-                 left join dkic_b.t_mst_staff as makestaff on tpo.make_staff = makestaff.staff_id
-                 left join dkic_b.t_mst_customer tmc on tpo.cus_id = tmc.cus_id
+               t.make_time,
+               t.cp_id
+        FROM dkic_b.t_psi_order as t
+                 left join dkic_b.t_mst_sale_channel tmsc on t.sales_channel = tmsc.channel_id
+                 left join dkic_b.t_mst_org tmo on t.org_id = tmo.org_id
+                 left join dkic_b.t_mst_staff tms on t.staff_id = tms.staff_id
+                 left join dkic_b.t_mst_staff as makestaff on t.make_staff = makestaff.staff_id
+                 left join dkic_b.t_mst_customer tmc on t.cus_id = tmc.cus_id
                  left join dkic_b.t_mst_dictionary_data tmdd on tmc.cus_from = tmdd.data_id
-                 left join sys.t_data_kind as tdk1 on tpo.order_type = tdk1.kind_code
-                 left join sys.t_data_kind as tdk2 on tpo.order_status = tdk2.kind_code
-                 left join sys.t_data_kind as tdk3 on tpo.out_status = tdk3.kind_code
+                 left join sys.t_data_kind as tdk1 on t.order_type = tdk1.kind_code
+                 left join sys.t_data_kind as tdk2 on t.order_status = tdk2.kind_code
+                 left join sys.t_data_kind as tdk3 on t.out_status = tdk3.kind_code
         <include refid="Condition"/>
-        order by tpo.op_create_time desc
+        order by t.op_create_time desc
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
         </if>
@@ -307,69 +307,69 @@
     <select id="countByCond" resultType="Long">
         SELECT
         count(1)
-        FROM dkic_b.t_psi_order as tpo
+        FROM dkic_b.t_psi_order as t
         <include refid="Condition"/>
     </select>
 
     <!-- 根据主键查询表t_psi_order的一行数据 -->
     <select id="selectById" resultMap="BaseResultMapResponse">
-        SELECT tpo.order_id,
-               tpo.order_no,
-               tpo.order_type,
+        SELECT t.order_id,
+               t.order_no,
+               t.order_type,
                sys.f_get_name_i18n(tdk1.kind_name_i18n, 'zh_CN') as "orderTypeName",
-               tpo.org_id,
+               t.org_id,
                tmo.org_name                                      as "orgName",
-               tpo.staff_id,
+               t.staff_id,
                tms.staff_name                                    as "staffName",
-               tpo.cus_id,
+               t.cus_id,
                tmc.cus_code                                      as "cusCode",
                tmc.cus_name                                      as "cusName",
                tmc.cus_phone                                     as "cusPhone",
                tmc.cus_from                                      as "cusFrom",
                tmdd.data_value                                   as "cusFromName",
-               tpo.address_area,
-               tpo.address_name,
-               tpo.address_no,
-               tpo.address_gcj02,
-               tpo.address_full,
-               tpo.contact_name,
-               tpo.contact_phone,
-               tpo.sales_channel,
+               t.address_area,
+               t.address_name,
+               t.address_no,
+               t.address_gcj02,
+               t.address_full,
+               t.contact_name,
+               t.contact_phone,
+               t.sales_channel,
                tmsc.channel_name                                 as "channelName",
-               tpo.delivery_date,
-               tpo.sum_quantity,
-               tpo.sum_standard,
-               tpo.sum_amount,
-               tpo.sale_discount,
-               tpo.order_status,
+               t.delivery_date,
+               t.sum_quantity,
+               t.sum_standard,
+               t.sum_amount,
+               t.sale_discount,
+               t.order_status,
                sys.f_get_name_i18n(tdk2.kind_name_i18n, 'zh_CN') as "orderStatusName",
-               tpo.out_status,
+               t.out_status,
                sys.f_get_name_i18n(tdk3.kind_name_i18n, 'zh_CN') as "outStatusName",
-               tpo.outing_qty,
-               tpo.outing_amt,
-               tpo.out_qty,
-               tpo.out_amt,
-               tpo.return_qty,
-               tpo.return_amt,
-               tpo.amt_receivable,
-               tpo.amt_handle,
-               tpo.amt_residue,
-               tpo.remarks,
-               tpo.annex_paths,
+               t.outing_qty,
+               t.outing_amt,
+               t.out_qty,
+               t.out_amt,
+               t.return_qty,
+               t.return_amt,
+               t.amt_receivable,
+               t.amt_handle,
+               t.amt_residue,
+               t.remarks,
+               t.annex_paths,
                makestaff.staff_name                              as "makeStaffName",
-               tpo.make_time,
-               tpo.cp_id
-        FROM dkic_b.t_psi_order as tpo
-                 left join dkic_b.t_mst_sale_channel tmsc on tpo.sales_channel = tmsc.channel_id
-                 left join dkic_b.t_mst_org tmo on tpo.org_id = tmo.org_id
-                 left join dkic_b.t_mst_staff tms on tpo.staff_id = tms.staff_id
-                 left join dkic_b.t_mst_staff as makestaff on tpo.make_staff = makestaff.staff_id
-                 left join dkic_b.t_mst_customer tmc on tpo.cus_id = tmc.cus_id
+               t.make_time,
+               t.cp_id
+        FROM dkic_b.t_psi_order as t
+                 left join dkic_b.t_mst_sale_channel tmsc on t.sales_channel = tmsc.channel_id
+                 left join dkic_b.t_mst_org tmo on t.org_id = tmo.org_id
+                 left join dkic_b.t_mst_staff tms on t.staff_id = tms.staff_id
+                 left join dkic_b.t_mst_staff as makestaff on t.make_staff = makestaff.staff_id
+                 left join dkic_b.t_mst_customer tmc on t.cus_id = tmc.cus_id
                  left join dkic_b.t_mst_dictionary_data tmdd on tmc.cus_from = tmdd.data_id
-                 left join sys.t_data_kind as tdk1 on tpo.order_type = tdk1.kind_code
-                 left join sys.t_data_kind as tdk2 on tpo.order_status = tdk2.kind_code
-                 left join sys.t_data_kind as tdk3 on tpo.out_status = tdk3.kind_code
-        WHERE tpo.order_id = #{orderId}::uuid
+                 left join sys.t_data_kind as tdk1 on t.order_type = tdk1.kind_code
+                 left join sys.t_data_kind as tdk2 on t.order_status = tdk2.kind_code
+                 left join sys.t_data_kind as tdk3 on t.out_status = tdk3.kind_code
+        WHERE t.order_id = #{orderId}::uuid
     </select>
 
     <!-- 根据主键锁定表t_psi_order的一行数据 -->

+ 51 - 46
src/main/java/com/dk/mdm/mapper/sale/OutReturnItemMapper.xml

@@ -78,88 +78,67 @@
     <sql id="Condition">
         <where>
             <if test="returnId != null and returnId != ''">
-                AND return_id = #{returnId}::uuid
+                AND t.return_id = #{returnId}::uuid
             </if>
             <if test="outId != null and outId != ''">
-                AND out_id = #{outId}
+                AND t.out_id = #{outId}
             </if>
             <if test="outItemId != null and outItemId != ''">
-                AND out_item_id = #{outItemId}
+                AND t.out_item_id = #{outItemId}
             </if>
             <if test="orderId != null and orderId != ''">
-                AND order_id = #{orderId}
+                AND t.order_id = #{orderId}
             </if>
             <if test="orderItemId != null and orderItemId != ''">
-                AND order_item_id = #{orderItemId}
+                AND t.order_item_id = #{orderItemId}
             </if>
             <if test="itemIndex != null">
-                AND item_index = #{itemIndex}
+                AND t.item_index = #{itemIndex}
             </if>
             <if test="skuId != null and skuId != ''">
-                AND sku_id = #{skuId}
+                AND t.sku_id = #{skuId}
             </if>
             <if test="itemQty != null">
-                AND item_qty = #{itemQty}
+                AND t.item_qty = #{itemQty}
             </if>
             <if test="priceStd != null">
-                AND price_std = #{priceStd}
+                AND t.price_std = #{priceStd}
             </if>
             <if test="amtStd != null">
-                AND amt_std = #{amtStd}
+                AND t.amt_std = #{amtStd}
             </if>
             <if test="priceReturn != null">
-                AND price_return = #{priceReturn}
+                AND t.price_return = #{priceReturn}
             </if>
             <if test="itemAmt != null">
-                AND item_amt = #{itemAmt}
+                AND t.item_amt = #{itemAmt}
             </if>
             <if test="nonStdCode != null and nonStdCode != ''">
-                AND non_std_code = #{nonStdCode}
+                AND t.non_std_code = #{nonStdCode}
             </if>
             <if test="intoStatus != null and intoStatus != ''">
-                AND into_status = #{intoStatus}
+                AND t.into_status = #{intoStatus}
             </if>
             <if test="intoingQty != null">
-                AND intoing_qty = #{intoingQty}
+                AND t.intoing_qty = #{intoingQty}
             </if>
             <if test="intoingAmt != null">
-                AND intoing_amt = #{intoingAmt}
+                AND t.intoing_amt = #{intoingAmt}
             </if>
             <if test="intoQty != null">
-                AND into_qty = #{intoQty}
+                AND t.into_qty = #{intoQty}
             </if>
             <if test="intoAmt != null">
-                AND into_amt = #{intoAmt}
+                AND t.into_amt = #{intoAmt}
             </if>
             <if test="remarks != null and remarks != ''">
-                AND remarks = #{remarks}
+                AND t.remarks = #{remarks}
             </if>
             <if test="flgValid != null">
-                AND flg_valid = #{flgValid}
+                AND t.flg_valid = #{flgValid}
             </if>
             <if test="cpId != null">
-                AND cp_id = #{cpId}
-            </if>
-            <if test="opCreateTime != null">
-                AND op_create_time = #{opCreateTime}
-            </if>
-            <if test="opCreateUserId != null and opCreateUserId != ''">
-                AND op_create_user_id = #{opCreateUserId}
-            </if>
-            <if test="opUpdateTime != null">
-                AND op_update_time = #{opUpdateTime}
-            </if>
-            <if test="opUpdateUserId != null and opUpdateUserId != ''">
-                AND op_update_user_id = #{opUpdateUserId}
-            </if>
-            <if test="opAppCode != null and opAppCode != ''">
-                AND op_app_code = #{opAppCode}
-            </if>
-            <if test="opTimestamp != null">
-                AND op_timestamp = #{opTimestamp}
-            </if>
-            <if test="opDbUser != null and opDbUser != ''">
-                AND op_db_user = #{opDbUser}
+                AND t.cp_id = #{cpId}
             </if>
         </where>
     </sql>
@@ -174,9 +153,35 @@
 
     <!-- 查询表t_psi_out_return_item,(条件查询+分页)列表 -->
     <select id="selectByCond" resultMap="BaseResultMapResponse">
-        SELECT
-        <include refid="Base_Column_List"/>
-        FROM t_psi_out_return_item
+        SELECT t.item_id,
+               t.return_id,
+               t.out_id,
+               tpo.out_no     as "outNo",
+               t.out_item_id,
+               t.order_id,
+               t.order_item_id,
+               t.item_index,
+               t.sku_id,
+               tmgs.sku_code  as "skuCode",
+               tmgs.sku_model as "skuModel",
+               tmgs.sku_name  as "skuName",
+               t.item_qty,
+               t.price_std,
+               t.amt_std,
+               t.price_return,
+               t.item_amt,
+               t.non_std_code,
+               t.into_status,
+               t.intoing_qty,
+               t.intoing_amt,
+               t.into_qty,
+               t.into_amt,
+               t.remarks,
+               t.flg_valid,
+               t.cp_id
+        FROM t_psi_out_return_item as t
+                 left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = t.sku_id
+                 left join dkic_b.t_psi_outbound as tpo on tpo.out_id = t.out_id
         <include refid="Condition"/>
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
@@ -187,7 +192,7 @@
     <select id="countByCond" resultType="Long">
         SELECT
         count(1)
-        FROM t_psi_out_return_item
+        FROM t_psi_out_return_item as t
         <include refid="Condition"/>
     </select>
 

+ 93 - 61
src/main/java/com/dk/mdm/mapper/sale/OutReturnMapper.xml

@@ -5,7 +5,7 @@
     <!-- 通用设置 -->
     <!-- 通用查询列 -->
     <sql id="Base_Column_List">
-        return_id, return_no, return_type, order_id, order_no, org_id, staff_id, cus_id, address_area, address_name, address_no, address_gcj02, address_full, contact_name, contact_phone, sales_channel, pickup_date, sum_quantity, sum_standard, sum_amount, sale_discount, return_status, into_status, intoing_qty, intoing_amt, into_qty, into_amt, amt_receivable, amt_handle, amt_residue, remarks, annex_paths, make_staff, make_time, flg_valid, cp_id, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user
+        return_id, return_no, return_type, order_id, order_no, org_id, staff_id, cus_id, address_area, address_name, address_no, address_gcj02, address_full, contact_name, contact_phone, sales_channel, pickup_date, sum_quantity, sum_standard, sum_amount, sale_discount, return_status, into_status, intoing_qty, intoing_amt, into_qty, into_amt, amt_receivable, amt_handle, amt_residue, remarks, annex_paths, make_staff, make_time, flg_valid, cp_id
     </sql>
 
     <!-- 通用查询映射结果 -->
@@ -106,130 +106,109 @@
     <sql id="Condition">
         <where>
             <if test="returnNo != null and returnNo != ''">
-                AND return_no = #{returnNo}
+                AND t.return_no = #{returnNo}
             </if>
             <if test="returnType != null and returnType != ''">
-                AND return_type = #{returnType}
+                AND t.return_type = #{returnType}
             </if>
             <if test="orderId != null and orderId != ''">
-                AND order_id = #{orderId}
+                AND t.order_id = #{orderId}
             </if>
             <if test="orderNo != null and orderNo != ''">
-                AND order_no = #{orderNo}
+                AND t.order_no = #{orderNo}
             </if>
             <if test="orgId != null and orgId != ''">
-                AND org_id = #{orgId}
+                AND t.org_id = #{orgId}
             </if>
             <if test="staffId != null and staffId != ''">
-                AND staff_id = #{staffId}
+                AND t.staff_id = #{staffId}
             </if>
             <if test="cusId != null and cusId != ''">
-                AND cus_id = #{cusId}
+                AND t.cus_id = #{cusId}
             </if>
             <if test="addressArea != null and addressArea != ''">
-                AND address_area = #{addressArea}
+                AND t.address_area = #{addressArea}
             </if>
             <if test="addressName != null and addressName != ''">
-                AND address_name = #{addressName}
+                AND t.address_name = #{addressName}
             </if>
             <if test="addressNo != null and addressNo != ''">
-                AND address_no = #{addressNo}
+                AND t.address_no = #{addressNo}
             </if>
             <if test="addressGcj02 != null and addressGcj02 != ''">
-                AND address_gcj02 = #{addressGcj02}
+                AND t.address_gcj02 = #{addressGcj02}
             </if>
             <if test="addressFull != null and addressFull != ''">
-                AND address_full = #{addressFull}
+                AND t.address_full = #{addressFull}
             </if>
             <if test="contactName != null and contactName != ''">
-                AND contact_name = #{contactName}
+                AND t.contact_name = #{contactName}
             </if>
             <if test="contactPhone != null and contactPhone != ''">
-                AND contact_phone = #{contactPhone}
+                AND t.contact_phone = #{contactPhone}
             </if>
             <if test="salesChannel != null and salesChannel != ''">
-                AND sales_channel = #{salesChannel}
+                AND t.sales_channel = #{salesChannel}
             </if>
             <if test="pickupDate != null">
-                AND pickup_date = #{pickupDate}
+                AND t.pickup_date = #{pickupDate}
             </if>
             <if test="sumQuantity != null">
-                AND sum_quantity = #{sumQuantity}
+                AND t.sum_quantity = #{sumQuantity}
             </if>
             <if test="sumStandard != null">
-                AND sum_standard = #{sumStandard}
+                AND t.sum_standard = #{sumStandard}
             </if>
             <if test="sumAmount != null">
-                AND sum_amount = #{sumAmount}
+                AND t.sum_amount = #{sumAmount}
             </if>
             <if test="saleDiscount != null">
-                AND sale_discount = #{saleDiscount}
+                AND t.sale_discount = #{saleDiscount}
             </if>
             <if test="returnStatus != null and returnStatus != ''">
-                AND return_status = #{returnStatus}
+                AND t.return_status = #{returnStatus}
             </if>
             <if test="intoStatus != null and intoStatus != ''">
-                AND into_status = #{intoStatus}
+                AND t.into_status = #{intoStatus}
             </if>
             <if test="intoingQty != null">
-                AND intoing_qty = #{intoingQty}
+                AND t.intoing_qty = #{intoingQty}
             </if>
             <if test="intoingAmt != null">
-                AND intoing_amt = #{intoingAmt}
+                AND t.intoing_amt = #{intoingAmt}
             </if>
             <if test="intoQty != null">
-                AND into_qty = #{intoQty}
+                AND t.into_qty = #{intoQty}
             </if>
             <if test="intoAmt != null">
-                AND into_amt = #{intoAmt}
+                AND t.into_amt = #{intoAmt}
             </if>
             <if test="amtReceivable != null">
-                AND amt_receivable = #{amtReceivable}
+                AND t.amt_receivable = #{amtReceivable}
             </if>
             <if test="amtHandle != null">
-                AND amt_handle = #{amtHandle}
+                AND t.amt_handle = #{amtHandle}
             </if>
             <if test="amtResidue != null">
-                AND amt_residue = #{amtResidue}
+                AND t.amt_residue = #{amtResidue}
             </if>
             <if test="remarks != null and remarks != ''">
-                AND remarks = #{remarks}
+                AND t.remarks = #{remarks}
             </if>
             <if test="annexPaths != null and annexPaths != ''">
-                AND annex_paths = #{annexPaths}
+                AND t.annex_paths = #{annexPaths}
             </if>
             <if test="makeStaff != null and makeStaff != ''">
-                AND make_staff = #{makeStaff}
+                AND t.make_staff = #{makeStaff}
             </if>
             <if test="makeTime != null">
-                AND make_time = #{makeTime}
+                AND t.make_time = #{makeTime}
             </if>
             <if test="flgValid != null">
-                AND flg_valid = #{flgValid}
+                AND t.flg_valid = #{flgValid}
             </if>
             <if test="cpId != null">
-                AND cp_id = #{cpId}
-            </if>
-            <if test="opCreateTime != null">
-                AND op_create_time = #{opCreateTime}
-            </if>
-            <if test="opCreateUserId != null and opCreateUserId != ''">
-                AND op_create_user_id = #{opCreateUserId}
-            </if>
-            <if test="opUpdateTime != null">
-                AND op_update_time = #{opUpdateTime}
-            </if>
-            <if test="opUpdateUserId != null and opUpdateUserId != ''">
-                AND op_update_user_id = #{opUpdateUserId}
-            </if>
-            <if test="opAppCode != null and opAppCode != ''">
-                AND op_app_code = #{opAppCode}
-            </if>
-            <if test="opTimestamp != null">
-                AND op_timestamp = #{opTimestamp}
-            </if>
-            <if test="opDbUser != null and opDbUser != ''">
-                AND op_db_user = #{opDbUser}
+                AND t.cp_id = #{cpId}
             </if>
         </where>
     </sql>
@@ -244,9 +223,62 @@
 
     <!-- 查询表t_psi_out_return,(条件查询+分页)列表 -->
     <select id="selectByCond" resultMap="BaseResultMapResponse">
-        SELECT
-        <include refid="Base_Column_List"/>
-        FROM t_psi_out_return
+        SELECT t.return_id,
+               t.return_no,
+               t.return_type,
+               t.order_id,
+               t.order_no,
+               t.org_id,
+               tmo.org_name                                      as "orgName",
+               t.staff_id,
+               tms.staff_name                                    as "staffName",
+               t.cus_id,
+               tmc.cus_code                                      as "cusCode",
+               tmc.cus_name                                      as "cusName",
+               tmc.cus_phone                                     as "cusPhone",
+               tmc.cus_from                                      as "cusFrom",
+               tmdd.data_value                                   as "cusFromName",
+               t.address_area,
+               t.address_name,
+               t.address_no,
+               t.address_gcj02,
+               t.address_full,
+               t.contact_name,
+               t.contact_phone,
+               t.sales_channel,
+               tmsc.channel_name                                 as "channelName",
+               t.pickup_date,
+               t.sum_quantity,
+               t.sum_standard,
+               t.sum_amount,
+               t.sale_discount,
+               t.return_status,
+               sys.f_get_name_i18n(tdk1.kind_name_i18n, 'zh_CN') as "returnStatusName",
+               t.into_status,
+               sys.f_get_name_i18n(tdk2.kind_name_i18n, 'zh_CN') as "intoStatusName",
+               t.intoing_qty,
+               t.intoing_amt,
+               t.into_qty,
+               t.into_amt,
+               t.amt_receivable,
+               t.amt_handle,
+               t.amt_residue,
+               t.remarks,
+               t.annex_paths,
+               t.make_staff,
+               makestaff.staff_name                              as "makeStaffName",
+               t.make_time,
+               t.flg_valid,
+               t.cp_id
+        FROM t_psi_out_return as t
+                 left join dkic_b.t_mst_sale_channel tmsc on t.sales_channel = tmsc.channel_id
+                 left join dkic_b.t_mst_org tmo on t.org_id = tmo.org_id
+                 left join dkic_b.t_mst_staff tms on t.staff_id = tms.staff_id
+                 left join dkic_b.t_mst_staff as makestaff on t.make_staff = makestaff.staff_id
+                 left join dkic_b.t_mst_customer tmc on t.cus_id = tmc.cus_id
+                 left join dkic_b.t_mst_dictionary_data tmdd on tmc.cus_from = tmdd.data_id
+                 left join sys.t_data_kind as tdk1 on t.return_status = tdk1.kind_code
+                 left join sys.t_data_kind as tdk2 on t.into_status = tdk2.kind_code
         <include refid="Condition"/>
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
@@ -257,7 +289,7 @@
     <select id="countByCond" resultType="Long">
         SELECT
         count(1)
-        FROM t_psi_out_return
+        FROM t_psi_out_return as t
         <include refid="Condition"/>
     </select>
 

+ 1 - 7
src/main/java/com/dk/mdm/model/pojo/ivt/IntoReturn.java

@@ -63,13 +63,7 @@ public class IntoReturn extends PageInfo<IntoReturn> implements Serializable {
     private String returnType;
 
 
-    /**
-     * 入库单
-     */
-    @Excel(name = "入库单")
-    @ApiModelProperty(value = "入库单")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String intoId;
+
 
 
     /**

+ 1 - 7
src/main/java/com/dk/mdm/model/query/ivt/IntoReturnQuery.java

@@ -66,13 +66,7 @@ public class IntoReturnQuery extends PageInfo<IntoReturnQuery> implements Serial
     private String returnType;
 
 
-    /**
-     * 入库单
-     */
-    @Excel(name = "入库单")
-    @ApiModelProperty(value = "入库单")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String intoId;
+
 
 
     /**

+ 37 - 0
src/main/java/com/dk/mdm/model/response/ivt/InboundResponse.java

@@ -321,6 +321,43 @@ public class InboundResponse extends PageInfo<InboundResponse> implements Serial
     private String opDbUser;
 
 
+    /**
+     * 组织名称
+     */
+    @Excel(name = "组织名称",width = 20, type = 10)
+    @ApiModelProperty(value = "组织名称")
+    private String orgName;
+
+    /**
+     * 员工名称
+     */
+    @Excel(name = "员工名称", width = 20, type = 10)
+    @ApiModelProperty(value = "员工名称")
+    private String staffName;
+
+    /**
+     * 员工名称
+     */
+    @Excel(name = "制单员", width = 20, type = 10)
+    @ApiModelProperty(value = "制单员")
+    private String makeStaffName;
+
+
+    /**
+     * 供应商名称
+     */
+    @Excel(name = "供应商名称")
+    @ApiModelProperty(value = "供应商名称")
+    private String supplierName;
+
+    /**
+     * 供应商名称
+     */
+    @Excel(name = "入库状态名称")
+    @ApiModelProperty(value = "入库状态名称")
+    private String intoStatusName;
+
+
     /*
      * 相关属性
      * @TableField(exist = false)

+ 1 - 7
src/main/java/com/dk/mdm/model/response/ivt/IntoReturnResponse.java

@@ -63,13 +63,7 @@ public class IntoReturnResponse  implements Serializable {
     private String returnType;
 
 
-    /**
-     * 入库单
-     */
-    @Excel(name = "入库单")
-    @ApiModelProperty(value = "入库单")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String intoId;
+
 
 
     /**

+ 13 - 0
src/main/java/com/dk/mdm/model/response/ivt/OutboundItemResponse.java

@@ -282,7 +282,20 @@ public class OutboundItemResponse extends PageInfo<OutboundItemResponse> impleme
     @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
     private String opDbUser;
 
+    @ApiModelProperty(value = "商品编码")
+    private String skuCode;
 
+    @ApiModelProperty(value = "商品型号")
+    private String skuModel;
+
+    @ApiModelProperty(value = "商品名称")
+    private String skuName;
+
+    @ApiModelProperty(value = "仓库名称")
+    private String whName;
+
+    @ApiModelProperty(value = "出库状态")
+    private String outStatusName;
     /*
      * 相关属性
      * @TableField(exist = false)

+ 35 - 0
src/main/java/com/dk/mdm/model/response/ivt/OutboundResponse.java

@@ -317,6 +317,41 @@ public class OutboundResponse extends PageInfo<OutboundResponse> implements Seri
     @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
     private String opDbUser;
 
+    @ApiModelProperty(value = "订单单号")
+    private String orderNo;
+
+    @ApiModelProperty(value = "组织名称")
+    private String orgName;
+
+    @ApiModelProperty(value = "员工姓名")
+    private String staffName;
+
+    @ApiModelProperty(value = "客户编码")
+    private String cusCode;
+
+    @ApiModelProperty(value = "客户名称")
+    private String cusName;
+
+    @ApiModelProperty(value = "客户电话")
+    private String cusPhone;
+
+    @ApiModelProperty(value = "联系电话")
+    private String contactPhone;
+
+    @ApiModelProperty(value = "详细地址")
+    private String addressFull;
+
+    @ApiModelProperty(value = "客户来源")
+    private String cusFrom;
+
+    @ApiModelProperty(value = "客户来源名称")
+    private String cusFromName;
+
+    @ApiModelProperty(value = "制单员")
+    private String makeStaffName;
+
+    @ApiModelProperty(value = "出库状态")
+    private String outStatusName;
 
     /*
      * 相关属性

+ 11 - 0
src/main/java/com/dk/mdm/model/response/sale/OutReturnItemResponse.java

@@ -283,6 +283,17 @@ public class OutReturnItemResponse extends PageInfo<OutReturnItemResponse> imple
     @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
     private String opDbUser;
 
+    @ApiModelProperty(value = "商品编码")
+    private String skuCode;
+
+    @ApiModelProperty(value = "商品型号")
+    private String skuModel;
+
+    @ApiModelProperty(value = "商品名称")
+    private String skuName;
+
+    @ApiModelProperty(value = "出库单号")
+    private String outNo;
 
     /*
      * 相关属性

+ 31 - 0
src/main/java/com/dk/mdm/model/response/sale/OutReturnResponse.java

@@ -405,7 +405,38 @@ public class OutReturnResponse extends PageInfo<OutReturnResponse> implements Se
     @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
     private String opDbUser;
 
+    @ApiModelProperty(value = "组织名称")
+    private String orgName;
 
+    @ApiModelProperty(value = "员工姓名")
+    private String staffName;
+
+    @ApiModelProperty(value = "客户编码")
+    private String cusCode;
+
+    @ApiModelProperty(value = "客户名称")
+    private String cusName;
+
+    @ApiModelProperty(value = "客户电话")
+    private String cusPhone;
+
+    @ApiModelProperty(value = "客户来源")
+    private String cusFrom;
+
+    @ApiModelProperty(value = "客户来源名称")
+    private String cusFromName;
+
+    @ApiModelProperty(value = "销售渠道")
+    private String channelName;
+
+    @ApiModelProperty(value = "制单员")
+    private String makeStaffName;
+
+    @ApiModelProperty(value = "退货状态")
+    private String returnStatusName;
+
+    @ApiModelProperty(value = "入库状态")
+    private String intoStatusName;
     /*
      * 相关属性
      * @TableField(exist = false)

+ 1 - 7
src/main/java/com/dk/mdm/model/vo/ivt/InboundVO.java

@@ -42,13 +42,7 @@ public class InboundVO extends PageInfo<InboundVO> implements Serializable {
      * 数据库字段
      */
 
-    /**
-     * 入库单ID
-     */
-    @TableId(value = "into_id", type = IdType.AUTO)
-    @ApiModelProperty(value = "入库单ID")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String intoId;
+
 
 
     /**

+ 11 - 0
src/main/java/com/dk/mdm/service/ivt/InboundService.java

@@ -8,7 +8,9 @@ import com.dk.mdm.mapper.ivt.InboundMapper;
 import com.dk.common.service.BaseService;
 import com.dk.common.mapper.BaseMapper;
 import com.dk.mdm.model.query.ivt.InboundQuery;
+import com.dk.mdm.model.query.pur.PurchaseQuery;
 import com.dk.mdm.model.response.ivt.InboundResponse;
+import com.dk.mdm.model.response.pur.PurchaseResponse;
 import org.springframework.stereotype.Service;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
@@ -28,6 +30,15 @@ public class InboundService extends BaseService<Inbound> {
 	private InboundMapper inboundMapper;
 
 
+	/**
+	 * @desc   : 条件查询 (采购入库用)
+	 * @author : 王英杰
+	 * @date   : 2024/3/8 10:58
+	 */
+	@Pagination
+	public ResponseResultVO<PageList<PurchaseResponse>> selectByCond(InboundQuery inboundQuery) {
+		return super.mergeListWithCount(inboundQuery, inboundMapper.selectByCond(inboundQuery), inboundMapper.countByCond(inboundQuery));
+	}
 
 
 	/**

+ 90 - 86
src/main/java/com/dk/mdm/service/ivt/IntoReturnService.java

@@ -106,91 +106,97 @@ public class IntoReturnService extends BaseService<IntoReturn> {
             rollbackFor = {Exception.class}
     )
     public ResponseResultVO<?> insert(IntoReturnVO intoReturnVO) {
-        //校验明细长度
-        List<IntoReturnItemVO> intoReturnItemVOList = intoReturnVO.getIntoReturnItemVOList();
-        //明细不存在
-        if (intoReturnItemVOList == null || intoReturnItemVOList.size() == 0) {
-            //返回 采购退货明细不可为空,请重新操作
-            return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.PURCHASE_RETURN_DETAIL_NOT_EXIST.getMessage());
-        }
-        //查询采购订单
-        PurchaseResponse purchaseResponse = purchaseMapper.selectById(intoReturnVO.getPurId());
-        //设置总单
-        intoReturnVO = this.insertTotal(intoReturnVO, purchaseResponse);
-        //设置明细
-        intoReturnItemVOList = this.insertDetail(intoReturnVO, intoReturnItemVOList);
-
-        //反写入库单 反写退货数量金额
-        Inbound inbound = inboundMapper.selectById(intoReturnVO.getIntoId());
-        inboundMapper.updateAmount(new Inbound().setIntoId(intoReturnVO.getIntoId())
-                .setReturnQty(inbound.getReturnQty().add(intoReturnVO.getSumQuantity()))
-                .setReturnAmt(inbound.getReturnAmt().add(intoReturnVO.getSumAmount())));
-        //反写订单已入库退货数量、金额
-        purchaseMapper.updateAmount(new Purchase().setPurId(purchaseResponse.getPurId())
-                .setReturnQty(purchaseResponse.getReturnQty().add(intoReturnVO.getSumQuantity()))
-                .setReturnAmt(purchaseResponse.getReturnAmt().add(intoReturnVO.getSumAmount()))
-        );
-
-        //反写入库订单明细、反写订单明细
-        for (IntoReturnItemVO intoReturnItemVO : intoReturnItemVOList) {
-
-            //根据退货明细中入库明细id查询入库明细数据
-            InboundItem inboundItem = inboundItemMapper.selectById(intoReturnItemVO.getIntoItemId());
-            inboundItemMapper.updateAmount(
-                    new InboundItem()
-                            .setItemId(inboundItem.getItemId())
-                            .setReturnQty(inboundItem.getReturnQty().add(intoReturnItemVO.getItemQty().setScale(6, BigDecimal.ROUND_HALF_UP)))
-                            .setReturnAmt(inboundItem.getReturnAmt().add(intoReturnItemVO.getItemAmt().setScale(6, BigDecimal.ROUND_HALF_UP)))
-            );
-            //TODO 反写订单出库明细 退货数量和退货金额
-            //查询采购订单明细数据
-            PurchaseItemResponse purchaseItemResponse = purchaseItemMapper.selectById(intoReturnItemVO.getPurItemId());
-            //反写订单明细退货数量和退货金额
-            purchaseItemMapper.updateAmount(
-                    new PurchaseItem()
-                            .setItemId(intoReturnItemVO.getPurItemId())
-                            .setReturnQty(purchaseItemResponse.getReturnQty().add(intoReturnItemVO.getItemQty().setScale(6, BigDecimal.ROUND_HALF_UP)))
-                            .setReturnAmt(purchaseItemResponse.getReturnAmt().add(intoReturnItemVO.getItemAmt().setScale(6, BigDecimal.ROUND_HALF_UP)))
-
+            //校验明细长度
+            List<IntoReturnItemVO> intoReturnItemVOList = intoReturnVO.getIntoReturnItemVOList();
+            //明细不存在
+            if (intoReturnItemVOList == null || intoReturnItemVOList.size() == 0) {
+                //返回 采购退货明细不可为空,请重新操作
+                return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.PURCHASE_RETURN_DETAIL_NOT_EXIST.getMessage());
+            }
+            //查询采购订单
+            PurchaseResponse purchaseResponse = purchaseMapper.selectById(intoReturnVO.getPurId());
+            //设置总单
+            intoReturnVO = this.insertTotal(intoReturnVO, purchaseResponse);
+            //设置明细
+            intoReturnItemVOList = this.insertDetail(intoReturnVO, intoReturnItemVOList);
+
+
+            //反写采购订单已入库退货数量、金额
+            purchaseMapper.updateAmount(new Purchase().setPurId(intoReturnVO.getPurId())
+                    .setReturnQty(purchaseResponse.getReturnQty().add(intoReturnVO.getSumQuantity()))
+                    .setReturnAmt(purchaseResponse.getReturnAmt().add(intoReturnVO.getSumAmount()))
             );
-        }
-
-        //新建出库单
-        OutboundVO outboundVO = new OutboundVO();
-        //来源ID
-        outboundVO.setFromId(intoReturnVO.getReturnId());
-        //来源单号
-        outboundVO.setFromNo(intoReturnVO.getReturnNo());
-        //部门
-        outboundVO.setOrgId(intoReturnVO.getOrgId());
-        //员工
-        outboundVO.setStaffId(intoReturnVO.getStaffId());
-        //出库状态 待出库
-        outboundVO.setOutStatus(Constant.OutStatus.DAICHUKU.getName());
-        //供应商
-        outboundVO.setSupId(intoReturnVO.getSupId());
-        outboundVO.setMakeStaff(authUtils.getStaff().getStaffId());
-        outboundVO.setCpId(authUtils.getStaff().getCpId());
+            BigDecimal sumReturnQty = BigDecimal.ZERO;
+            BigDecimal sumReturnAmt = BigDecimal.ZERO;
+            //反写入库订单明细、反写订单明细
+            for (IntoReturnItemVO intoReturnItemVO : intoReturnItemVOList) {
+
+                //根据退货明细中入库明细id查询入库明细数据
+                InboundItem inboundItem = inboundItemMapper.selectById(intoReturnItemVO.getIntoItemId());
+                BigDecimal returnQty = inboundItem.getReturnQty().add(intoReturnItemVO.getItemQty().setScale(6, BigDecimal.ROUND_HALF_UP));
+                BigDecimal returnAmt = inboundItem.getReturnAmt().add(intoReturnItemVO.getItemAmt().setScale(6, BigDecimal.ROUND_HALF_UP));
+                sumReturnQty = sumReturnQty.add(returnQty);
+                sumReturnAmt = sumReturnAmt.add(returnAmt);
+                inboundItemMapper.updateAmount(
+                        new InboundItem()
+                                .setItemId(inboundItem.getItemId())
+                                .setReturnQty(returnQty)
+                                .setReturnAmt(returnAmt)
+                );
+                //TODO 反写订单出库明细 退货数量和退货金额
+                //查询采购订单明细数据
+                PurchaseItemResponse purchaseItemResponse = purchaseItemMapper.selectById(intoReturnItemVO.getPurItemId());
+                //反写订单明细退货数量和退货金额
+                purchaseItemMapper.updateAmount(
+                        new PurchaseItem()
+                                .setItemId(intoReturnItemVO.getPurItemId())
+                                .setReturnQty(purchaseItemResponse.getReturnQty().add(intoReturnItemVO.getItemQty().setScale(6, BigDecimal.ROUND_HALF_UP)))
+                                .setReturnAmt(purchaseItemResponse.getReturnAmt().add(intoReturnItemVO.getItemAmt().setScale(6, BigDecimal.ROUND_HALF_UP)))
+
+                );
+            }
+            //反写入库单退货数量金额 todo
+            Inbound inbound = inboundMapper.selectById(intoReturnVO.getIntoId());
+            inboundMapper.updateAmount(new Inbound().setIntoId(intoReturnVO.getIntoId())
+                    .setReturnQty(inbound.getReturnQty().add(sumReturnQty))
+                    .setReturnAmt(inbound.getReturnAmt().add(sumReturnAmt)));
+            //新建出库单
+            OutboundVO outboundVO = new OutboundVO();
+            //来源ID
+            outboundVO.setFromId(intoReturnVO.getReturnId());
+            //来源单号
+            outboundVO.setFromNo(intoReturnVO.getReturnNo());
+            //部门
+            outboundVO.setOrgId(intoReturnVO.getOrgId());
+            //员工
+            outboundVO.setStaffId(intoReturnVO.getStaffId());
+            //出库状态 待出库
+            outboundVO.setOutStatus(Constant.OutStatus.DAICHUKU.getName());
+            //供应商
+            outboundVO.setSupId(intoReturnVO.getSupId());
+            outboundVO.setMakeStaff(authUtils.getStaff().getStaffId());
+            outboundVO.setCpId(authUtils.getStaff().getCpId());
+
+            outboundVO.setFromId(intoReturnVO.getReturnId());
+            List<OutboundItemVO> itemList = new ArrayList<>();
+            Integer itemIndex = 0;
+            for (IntoReturnItemVO intoReturnItemVO : intoReturnItemVOList) {
+                //来源单ID 入库退货
+                OutboundItemVO outboundItemVO = new OutboundItemVO();
+
+                outboundItemVO.setFromId(intoReturnItemVO.getReturnId());
+                outboundItemVO.setFromItemId(intoReturnItemVO.getItemId());
+                outboundItemVO.setSkuId(intoReturnItemVO.getSkuId());
+                outboundItemVO.setItemIndex(itemIndex + 1);
+                outboundItemVO.setPriceOut(intoReturnItemVO.getPriceReturn());
+                outboundItemVO.setInvId(intoReturnItemVO.getInvId());
+                itemList.add(outboundItemVO);
+            }
+
+            outboundVO.setItemList(itemList);
+            //新建出库单
+            outboundService.insertOutBound(outboundVO);
 
-        outboundVO.setFromId(intoReturnVO.getReturnId());
-        List<OutboundItemVO> itemList = new ArrayList<>();
-        Integer itemIndex = 0;
-        for (IntoReturnItemVO intoReturnItemVO : intoReturnItemVOList) {
-            //来源单ID 入库退货
-            OutboundItemVO outboundItemVO = new OutboundItemVO();
-
-            outboundItemVO.setFromId(intoReturnItemVO.getReturnId());
-            outboundItemVO.setFromItemId(intoReturnItemVO.getItemId());
-            outboundItemVO.setSkuId(intoReturnItemVO.getSkuId());
-            outboundItemVO.setItemIndex(itemIndex + 1);
-            outboundItemVO.setPriceOut(intoReturnItemVO.getPriceReturn());
-            outboundItemVO.setInvId(intoReturnItemVO.getInvId());
-            itemList.add(outboundItemVO);
-        }
-
-        outboundVO.setItemList(itemList);
-        //新建出库单
-        outboundService.insertOutBound(outboundVO);
         return ResponseResultUtil.success();
     }
 
@@ -270,6 +276,7 @@ public class IntoReturnService extends BaseService<IntoReturn> {
 
 
     //TODO 未完成
+
     /**
      * @desc : 冲正
      * @date : 2022/6/28 16:58
@@ -288,7 +295,6 @@ public class IntoReturnService extends BaseService<IntoReturn> {
         List<IntoReturnResponse> intoReturnResponsesList = intoReturnMapper.selectByCond(new IntoReturnQuery().setIntoReturnIdList(intoReturnIdList));
 
 
-
         //本次冲正退货总额
         BigDecimal sumReturnAmount = intoReturnResponsesList.stream().map(IntoReturnResponse::getSumAmount)
                 .reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, BigDecimal.ROUND_HALF_UP);
@@ -328,8 +334,6 @@ public class IntoReturnService extends BaseService<IntoReturn> {
         //endregion
 
 
-
-
     }
 
 }

+ 9 - 1
src/main/java/com/dk/mdm/service/pur/PurchaseService.java

@@ -79,7 +79,15 @@ public class PurchaseService extends BaseService<Purchase> {
 	public ResponseResultVO<PageList<PurchaseResponse>> selectByCond(PurchaseQuery purchaseQuery) {
 		return super.mergeListWithCount(purchaseQuery, purchaseMapper.selectByCond(purchaseQuery), purchaseMapper.countByCond(purchaseQuery));
 	}
-
+	/**
+	 * @desc   : 采购订单 待入库查询
+	 * @author : 王英杰
+	 * @date   : 2024/2/28 9:46
+	 */
+	@Pagination
+	public ResponseResultVO<PageList<PurchaseResponse>> noStoredSelectByCond(PurchaseQuery purchaseQuery) {
+		return super.mergeListWithCount(purchaseQuery, purchaseMapper.noStoredSelectByCond(purchaseQuery), purchaseMapper.noStoredCountByCond(purchaseQuery));
+	}
 	/**
 	 * @desc   : 新建
 	 * @author : 常皓宁

+ 8 - 2
src/main/java/com/dk/mdm/service/wxapi/basic/WechatPayService.java

@@ -45,6 +45,7 @@ public class WechatPayService {
     public ResponseResultVO unifiedOrder(Map<String, Object> param) throws WxPayException {
         String paymentSn = param.get("paymentSn").toString();
         String openId = param.get("openId").toString();
+        log.info("下单选取旗舰版或专业版的订单1----------" + param.toString());
         try {
             // 获取单据的金额
             String payFee = "0.01";
@@ -69,6 +70,7 @@ public class WechatPayService {
                     + pack + "&signType=" + signType + "&timeStamp=" + timeStamp;
             sigmTemp = sigmTemp + "&key=" + wechatPayConfigInfo.getMchKey();
             paySign = Md5Utils.hash(sigmTemp);
+            log.info("下单选取旗舰版或专业版的订单2----------" + prepay_id + "--" + sigmTemp + "--");
             Map<String, Object> params = new HashMap<String, Object>();
             params.put("appId", wxPayUnifiedOrderResult.getAppid());
             params.put("timeStamp", timeStamp);
@@ -76,9 +78,10 @@ public class WechatPayService {
             params.put("pack", pack);
             params.put("signType", signType);
             params.put("paySign", paySign);
+            log.info("下单选取旗舰版或专业版的订单3----------" + params.toString());
             return ResponseResultUtil.success(params);
         } catch (Exception e) {
-            log.error("微信支付失败!支付单号:{},原因:{}", paymentSn, e.getMessage());
+            log.error("unifiedOrder--微信支付失败!支付单号:{},原因:{}", paymentSn, e.getMessage());
             return ResponseResultUtil.error("支付失败,请稍后重试!");
         }
     }
@@ -89,6 +92,8 @@ public class WechatPayService {
      * @date : 2024/03/06 11:29
      */
     public ResponseResultVO notifyWechatPay(WxPayOrderNotifyResult info) {
+        log.info("处理支付成功逻辑----------" + info.getOutTradeNo() + "---------" + info.toString());
+
         //  判断支付金额是否一致
 //        ShopOrderPaymentDto sop = new ShopOrderPaymentDto();
 //        sop.setPaymentsn(info.getOutTradeNo());
@@ -122,13 +127,14 @@ public class WechatPayService {
      * @date : 2023-08-02 17:30
      */
     public WxPayService getWxPayService() {
+        log.info("getWxPayService----------" + wechatPayConfigInfo.toString());
         WxPayConfig payConfig = new WxPayConfig();
         payConfig.setAppId(StringUtils.trimToNull(wechatPayConfigInfo.getAppId()));
         payConfig.setMchId(StringUtils.trimToNull(wechatPayConfigInfo.getMchId()));
         payConfig.setMchKey(StringUtils.trimToNull(wechatPayConfigInfo.getMchKey()));
 //        payConfig.setSubAppId(null);
 //        payConfig.setSubMchId(null);
-        payConfig.setKeyPath(StringUtils.trimToNull(wechatPayConfigInfo.getKeyPath()));
+//        payConfig.setKeyPath(StringUtils.trimToNull(wechatPayConfigInfo.getKeyPath()));
         // 可以指定是否使用沙箱环境
         payConfig.setUseSandboxEnv(false);
         WxPayService wxPayService = new WxPayServiceImpl();

+ 1 - 1
src/main/resources/dev/bootstrap.yml

@@ -123,7 +123,7 @@ wx:
     # 证书路径
     keyPath: /mnt/cert/2021/05/11/404727f0-e5be-424e-b009-59f1ec8d102e.p12
     # 小程序支付的回调接口地址
-    wechatNotifyUrl: https://ibossmp.dongkesoft.com:7040/mdm-server/wxapi/basic/wechat/pay/notify/order
+    wechatNotifyUrl: https://s.dev01.dkiboss.com:7000/api/mdm-server/wxapi/basic/wechat/pay/notify/order
 
 
 dongke:

+ 25 - 10
src/main/resources/test/bootstrap.yml

@@ -1,8 +1,8 @@
 server:
-  port: 6003
+  port: 7008
 spring:
   application:
-    name: mdm-server
+    name: mdm-server-dkic-b1
   cloud:
     nacos:
       config:
@@ -13,8 +13,8 @@ spring:
         namespace: iboss-dev
   datasource:
     driver-class-name: org.postgresql.Driver
-    url: jdbc:postgresql://s.dev01.dkiboss.com:15000/dkmes3
-    username: mes_dev
+    url: jdbc:postgresql://dkdev.dkiboss.com:15000/dkic_dev_b1
+    username: dkic_b
     password: dk
     type: com.alibaba.druid.pool.DruidDataSource
     druid:
@@ -70,7 +70,7 @@ spring:
       max-file-size: 10MB
 
 logback:
-  file: /data/java_project/dk_mes/${spring.application.name}/${spring.application.name}_logs
+  file: /data/java_project/dkic/${spring.application.name}/${spring.application.name}_logs
 
 feign:
   sentinel:
@@ -111,6 +111,21 @@ wx:
   edit_corp_tag: https://qyapi.weixin.qq.com/cgi-bin/externalcontact/edit_corp_tag?access_token=
   #  删除企业客户标签
   del_corp_tag: https://qyapi.weixin.qq.com/cgi-bin/externalcontact/del_corp_tag?access_token=
+  # 支付的信息
+  pay:
+    # 商户号 微信支付
+    mchId: 1669762764
+    # 小程序的appid
+    appId: wxe27c8f5249b7aeab
+    # 小程序的appSecret
+    appSecret: 9bd0efa102f148ff4ca09a1152310555
+    # 支付密钥
+    mchKey: 399e76d7db9511ee9c24fa163eacb119
+    # 证书路径
+    keyPath: /mnt/cert/2021/05/11/404727f0-e5be-424e-b009-59f1ec8d102e.p12
+    # 小程序支付的回调接口地址
+    wechatNotifyUrl: https://ibossmp.dongkesoft.com:7040/mdm-server/wxapi/basic/wechat/pay/notify/order
+
 
 dongke:
   base:
@@ -148,11 +163,11 @@ xxl:
       logretentiondays: 30
 
 
-pdf-folder: /data/java_project/dk_mes/${spring.application.name}/pdf/
+pdf-folder: /data/java_project/dkic/${spring.application.name}/pdf/
 #  自定义报表导出sql文件路径
-custom-report-sql: /data/java_project/dk_mes/sql/custom-report-sql.sql
+custom-report-sql: /data/java_project/dkic/sql/custom-report-sql.sql
 ####apk文件夾
-apk-folder: /data/java_project/dk_mes/apk/
+apk-folder: /data/java_project/dkic/apk/
 ####原生android-webiview
 apk-file-name: mes3-v23.05.18.01.apk
 apk-version: 23.05.18.01
@@ -163,7 +178,7 @@ apk-version-smtt: 23.05.18.01
 apk-file-name-crosswalk: crosswalk-v23.05.18.01.apk
 apk-version-crosswalk: 23.05.18.01
 
-excel-folder: /data/java_project/dk_mes/mdm-server/excel/
+excel-folder: /data/java_project/dkic/mdm-server/excel/
 
 #文件上传
-upload-path: /data/java_project/dk_mes/mdm-server/file/
+upload-path: /data/java_project/dkic/mdm-server/file/