Эх сурвалжийг харах

Merge remote-tracking branch 'origin/master'

dongke 2 жил өмнө
parent
commit
d992243648

+ 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-->

+ 24 - 0
src/main/java/com/dk/mdm/controller/mst/RoleController.java

@@ -14,6 +14,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import io.swagger.annotations.Api;
 import com.dk.mdm.service.mst.RoleService;
 
+import java.util.List;
+
 import static net.sf.jsqlparser.util.validation.metadata.NamedObject.role;
 
 
@@ -115,4 +117,26 @@ public class RoleController{
     public ResponseResultVO<?> updateWeb(@RequestBody RoleVo roleVO) {
         return roleService.update(roleVO);
     }
+
+    /**
+     * @desc : 批量启用
+     * @author : 周兴
+     * @date : 2023/3/7 10:34
+     */
+    @ApiOperation(value = "批量启用", notes = "批量启用")
+    @PostMapping("enable_batch")
+    public ResponseResultVO<Boolean> enableBatch(@RequestBody List<String> ids) {
+        return this.getService().enableBatch(ids);
+    }
+
+    /**
+     * @desc : 批量停用
+     * @author : 周兴
+     * @date : 2023/3/7 10:34
+     */
+    @ApiOperation(value = "批量停用", notes = "批量停用")
+    @PostMapping("disable_batch")
+    public ResponseResultVO<Boolean> disableBatch(@RequestBody List<String> ids) {
+        return this.getService().disableBatch(ids);
+    }
 }

+ 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>
 

+ 2 - 0
src/main/java/com/dk/mdm/mapper/mst/StaffPurviewMapper.xml

@@ -146,6 +146,8 @@
                 org.org_name    AS "orgName",
                 org.parent_id  AS "parentId",
                orgb.org_id   AS "orgId",
+               org.level_no AS "levelNo",
+               org.level_code as "levelCode",
                CASE WHEN orgb.org_id IS NULL THEN FALSE ELSE TRUE END    AS "checked"
         FROM dkic_b.t_mst_org org
                  left JOIN dkic_b.t_mst_org orgb ON orgb.org_id = org.org_id  and org.org_id::uuid =  any ( (

+ 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>
 

+ 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)

+ 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/