Ver código fonte

Merge remote-tracking branch 'origin/master'

zhangxiaomu 1 ano atrás
pai
commit
455f0948da
22 arquivos alterados com 305 adições e 112 exclusões
  1. 9 0
      src/main/java/com/dk/mdm/controller/mst/CusFollowController.java
  2. 10 0
      src/main/java/com/dk/mdm/mapper/ivt/InboundItemMapper.java
  3. 86 36
      src/main/java/com/dk/mdm/mapper/ivt/InboundItemMapper.xml
  4. 12 10
      src/main/java/com/dk/mdm/mapper/ivt/InboundMapper.xml
  5. 8 0
      src/main/java/com/dk/mdm/mapper/ivt/OutboundItemMapper.java
  6. 16 0
      src/main/java/com/dk/mdm/mapper/ivt/OutboundItemMapper.xml
  7. 10 0
      src/main/java/com/dk/mdm/mapper/mst/FollowPlanMapper.java
  8. 28 24
      src/main/java/com/dk/mdm/mapper/mst/FollowPlanMapper.xml
  9. 1 0
      src/main/java/com/dk/mdm/mapper/report/ReportMapper.xml
  10. 14 0
      src/main/java/com/dk/mdm/mapper/sale/OrderMapper.xml
  11. 5 0
      src/main/java/com/dk/mdm/model/response/ivt/InboundItemResponse.java
  12. 7 0
      src/main/java/com/dk/mdm/model/vo/pur/PurchaseItemVO.java
  13. 7 0
      src/main/java/com/dk/mdm/model/vo/sale/OrderItemVO.java
  14. 5 2
      src/main/java/com/dk/mdm/service/ivt/InboundReturnService.java
  15. 2 2
      src/main/java/com/dk/mdm/service/ivt/inbound/InboundPurchaseService.java
  16. 1 0
      src/main/java/com/dk/mdm/service/ivt/inventory/InventoryService.java
  17. 8 8
      src/main/java/com/dk/mdm/service/ivt/outbound/OutboundSaleOrderService.java
  18. 11 8
      src/main/java/com/dk/mdm/service/ivt/outbound/OutboundSaleReturnService.java
  19. 26 17
      src/main/java/com/dk/mdm/service/mst/CusFollowService.java
  20. 8 0
      src/main/java/com/dk/mdm/service/pur/PurchaseService.java
  21. 30 4
      src/main/java/com/dk/mdm/service/report/ReportService.java
  22. 1 1
      src/main/resources/test/bootstrap.yml

+ 9 - 0
src/main/java/com/dk/mdm/controller/mst/CusFollowController.java

@@ -123,4 +123,13 @@ public class CusFollowController{
         return cusFollowService.selectCusFollow(customerQuery);
     }
 
+
+    @ApiOperation(
+            value = "测试推送",
+            notes = "测试推送"
+    )
+    @PostMapping("test_push")
+    public ResponseResultVO<?> testPush() {
+        return cusFollowService.customerReminder();
+    }
 }

+ 10 - 0
src/main/java/com/dk/mdm/mapper/ivt/InboundItemMapper.java

@@ -8,6 +8,7 @@ import com.dk.mdm.model.query.ivt.InboundQuery;
 import com.dk.mdm.model.query.ivt.OutboundItemQuery;
 import com.dk.mdm.model.response.ivt.InboundItemResponse;
 import com.dk.mdm.model.response.ivt.InboundResponse;
+import com.dk.mdm.model.response.ivt.OutboundItemResponse;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
@@ -115,5 +116,14 @@ public interface InboundItemMapper extends BaseMapper<InboundItem>{
     Long selectHasReturn(InboundItemQuery inboundItemQuery);
 
 
+    /**
+     * @desc   : 根据条件进行查询
+     * @date   : 2024/7/16 8:38
+     * @author : 寇珊珊
+     */
+    List<InboundItemResponse> selectMessageByOtherCondition(InboundItemQuery inboundItemQuery);
+
+
+
 }
 

+ 86 - 36
src/main/java/com/dk/mdm/mapper/ivt/InboundItemMapper.xml

@@ -136,6 +136,7 @@
         <result column="into_status" property="intoStatus"/>
         <result column="intoing_qty" property="intoingQty"/>
         <result column="intoing_amt" property="intoingAmt"/>
+        <result column="can_return_qty" property="canReturnQty"/>
         <result column="into_qty" property="intoQty"/>
         <result column="into_amt" property="intoAmt"/>
         <result column="return_qty" property="returnQty"/>
@@ -545,42 +546,76 @@
 
     <select id="selectByInboundReturnCond" resultMap="BaseResultMapReturnResponse">
         SELECT
-        <include refid="Base_Column_List_Response"/>
-        ,tmgs.sku_code  as "skuCode"
-        ,tmgs.sku_model as "skuModel"
-        ,tmgs.sku_name  as "skuName"
-        ,tmgs.sku_spec  as "skuSpec"
-        ,tmgs.sku_images
-        ,tmgb.brand_name  as "brandName"
-        ,tmgb.short_name  as "shortName"
-        ,tmw.wh_id as "whId"
-        ,tmw.wh_code as "whCode"
-        ,tmw.wh_name as "whName"
-        ,sys.f_remove_zero(tpsii.intoing_qty) as  "sIntoItemIntoingQty"
-        ,tpsii.intoing_amt as "sIntoItemIntoingAmt"
-        ,sys.f_remove_zero(tpsii.into_qty) as "sIntoItemIntoQty"
-        ,tpsii.into_amt as "sIntoItemIntoAmt"
-        ,sys.f_remove_zero(tpsii.return_qty) as "sIntoItemReturnQty"
-        ,tpsii.return_amt as "sIntoItemReturnAmt"
-
-        ,sys.f_remove_zero(tppi.intoing_qty) as "sPurItemIntoingQty"
-        ,tppi.intoing_amt as "sPurItemIntoingAmt"
-        ,sys.f_remove_zero(tppi.into_qty) as "sPurItemIntoQty"
-        ,tppi.into_amt as "sPurItemIntoAmt"
-        ,sys.f_remove_zero(tppi.return_qty)  as "sPurItemReturnQty"
-        ,tppi.return_amt as "sPurItemReturnAmt"
-
-        ,sys.f_remove_zero(tpi.usable_qty) AS "usableQty"
-        ,tpi.non_std_code AS "nonStdCode"
-        ,(select ul.decimal_places from  dkic_b.t_mst_unit ul where tpii.unit_id = ul.unit_id) as "decimalPlaces"
-        FROM dkic_b.t_psi_inbound_item tpii
-        left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = tpii.sku_id
-        left join dkic_b.t_mst_goods_brand tmgb on tmgb.brand_id = tmgs.brand_id
-        left join dkic_b.t_psi_inventory tpi on tpi.inv_id = tpii.inv_id
-        left join dkic_b.t_mst_warehouse tmw on tmw.wh_id = tpii.wh_id
-
-        left join  dkic_b.t_psi_inbound_item  tpsii  on  tpsii.item_id = tpii.s_into_item_id
-        left join  dkic_b.t_psi_purchase_item  tppi  on  tppi.item_id = tpii.s_pur_item_id
+        tpii.item_id,
+        tpii.into_id,
+        tpii.into_type,
+        tpii.from_id,
+        tpii.from_item_id,
+        tpii.item_index,
+        tpii.sku_id,
+        tpii.price_into,
+        tpii.non_std_code,
+        tpii.into_status,
+         sys.f_remove_zero(tpii.into_qty - tpii.return_qty)  AS can_return_qty,
+         sys.f_remove_zero(tpii.into_qty - tpii.return_qty)  AS intoing_qty,
+         tpii.price_into * (tpii.into_qty - tpii.return_qty)  as intoing_amt,
+        sys.f_remove_zero ( tpii.into_qty ) AS into_qty,
+        tpii.into_amt,
+        sys.f_remove_zero ( tpii.return_qty ) AS return_qty,
+        tpii.return_amt,
+        tpii.remarks,
+        tpii.inv_id,
+        tpii.cost_price,
+        tpii.cost_amt,
+        sys.f_remove_zero ( tpii.out_qty ) AS out_qty,
+        sys.f_remove_zero ( tpii.inv_qty ) AS inv_qty,
+        tpii.flg_valid,
+        tpii.cp_id,
+        tpii.s_into_id,
+        tpii.s_into_item_id,
+        tpii.s_pur_id,
+        tpii.s_pur_item_id,
+        tpii.intoing_box,
+        tpii.intoing_piece,
+        tpii.into_box,
+        tpii.into_piece,
+        tpii.unit_id,
+        tpii.sub_unit_id,
+        tpii.pack_box,
+        tpii.flg_cost_check,
+        tmgs.sku_code AS "skuCode",
+        tmgs.sku_model AS "skuModel",
+        tmgs.sku_name AS "skuName",
+        tmgs.sku_spec AS "skuSpec",
+        tmgs.sku_images,
+        tmgb.brand_name AS "brandName",
+        tmgb.short_name AS "shortName",
+        tmw.wh_id AS "whId",
+        tmw.wh_code AS "whCode",
+        tmw.wh_name AS "whName",
+        sys.f_remove_zero ( tpsii.intoing_qty ) AS "sIntoItemIntoingQty",
+        tpsii.intoing_amt AS "sIntoItemIntoingAmt",
+        sys.f_remove_zero ( tpsii.into_qty ) AS "sIntoItemIntoQty",
+        tpsii.into_amt AS "sIntoItemIntoAmt",
+        sys.f_remove_zero ( tpsii.return_qty ) AS "sIntoItemReturnQty",
+        tpsii.return_amt AS "sIntoItemReturnAmt",
+        sys.f_remove_zero ( tppi.intoing_qty ) AS "sPurItemIntoingQty",
+        tppi.intoing_amt AS "sPurItemIntoingAmt",
+        sys.f_remove_zero ( tppi.into_qty ) AS "sPurItemIntoQty",
+        tppi.into_amt AS "sPurItemIntoAmt",
+        sys.f_remove_zero ( tppi.return_qty ) AS "sPurItemReturnQty",
+        tppi.return_amt AS "sPurItemReturnAmt",
+        sys.f_remove_zero ( tpi.usable_qty ) AS "usableQty",
+        tpi.non_std_code AS "non_std_code",
+        ( SELECT ul.decimal_places FROM dkic_b.t_mst_unit ul WHERE tpii.unit_id = ul.unit_id ) AS "decimalPlaces"
+        FROM
+        dkic_b.t_psi_inbound_item tpii
+        LEFT JOIN dkic_b.t_mst_goods_sku tmgs ON tmgs.sku_id = tpii.sku_id
+        LEFT JOIN dkic_b.t_mst_goods_brand tmgb ON tmgb.brand_id = tmgs.brand_id
+        LEFT JOIN dkic_b.t_psi_inventory tpi ON tpi.inv_id = tpii.inv_id
+        LEFT JOIN dkic_b.t_mst_warehouse tmw ON tmw.wh_id = tpii.wh_id
+        LEFT JOIN dkic_b.t_psi_inbound_item tpsii ON tpsii.item_id = tpii.s_into_item_id
+        LEFT JOIN dkic_b.t_psi_purchase_item tppi ON tppi.item_id = tpii.s_pur_item_id
         <include refid="Condition"/>
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
@@ -1097,4 +1132,19 @@
           AND ti.into_type = #{intoType}
     </select>
 
+    <!--根据条件进行查询-->
+    <select id="selectMessageByOtherCondition" resultMap="BaseResultMapResponse">
+        SELECT
+        <include refid="Base_Column_List_Response"/>
+        FROM dkic_b.t_psi_inbound_item tpii
+        <where>
+            <if test="intoId != null and intoId != ''">
+                AND tpii.into_id = #{intoId}::uuid
+            </if>
+            <if test="fromId != null and fromId != ''">
+                AND tpoi.from_id = #{fromId}::uuid
+            </if>
+        </where>
+    </select>
+
 </mapper>

+ 12 - 10
src/main/java/com/dk/mdm/mapper/ivt/InboundMapper.xml

@@ -206,6 +206,8 @@
         <result column="usable_qty" property="usableQty"/>
         <result column="wh_name" property="whName"/>
         <result column="pack_box_text" property="packBoxText"/>
+        <result column="can_return_qty" property="canReturnQty"/>
+        <result column="price_into" property="priceInto"/>
 
     </resultMap>
 
@@ -599,11 +601,13 @@
         tpii.from_item_id AS list_from_item_id,
         tpii.item_index AS list_item_index,
         tpii.sku_id AS list_sku_id,
-        tpii.price_into AS list_price_into,
+--         tpii.price_into AS list_price_into,
         tpii.non_std_code AS list_non_std_code,
         tpii.into_status AS list_into_status,
-        sys.f_remove_zero(tpii.intoing_qty) AS list_intoing_qty,
-        tpii.intoing_amt  AS list_intoing_amt,
+       - sys.f_remove_zero(tpii.into_qty - tpii.return_qty)                     as list_can_return_qty,
+           - sys.f_remove_zero(tpii.into_qty - tpii.return_qty)                 as list_intoing_qty,
+           - t.price_pur * (tpii.into_qty - tpii.return_qty)  as list_intoing_amt,
+             t.price_pur                                         as list_price_into,
         sys.f_remove_zero(tpii.into_qty)  AS list_into_qty,
         tpii.into_amt AS list_into_amt,
         sys.f_remove_zero(tpii.return_qty) AS list_return_qty,
@@ -620,14 +624,7 @@
         tmgs.sku_name AS  list_sku_name,
         tmgs.sku_model AS  list_sku_model,
         tmgb.short_name AS  list_short_name,
-        tmgs.price_purchase AS  list_price_purchase,
         tmgs.sku_images AS  list_sku_images,
-
-        sys.f_remove_zero( 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
---         ,
         tmgs.price_standard AS list_price_std,
 
         i.inv_id  as list_inv_id,
@@ -645,6 +642,8 @@
         <include refid="Base_Column_List_Item_Response_Join"/>
         FROM dkic_b.t_psi_inbound  tpi
         left  join dkic_b.t_psi_inbound_item tpii  on tpi.into_id = tpii.into_id and  ( tpii.into_qty - tpii.return_qty) > 0
+
+        inner join dkic_b.t_psi_purchase_item as t on t.item_id = tpii.from_item_id
         left  join  dkic_b.t_mst_warehouse tmw on  tmw.wh_id =   tpii.wh_id
         inner join  dkic_b.t_mst_goods_sku  tmgs on tmgs.sku_id = tpii.sku_id
         left join  dkic_b.t_mst_goods_brand  tmgb on tmgb.brand_id = tmgs.brand_id
@@ -1115,6 +1114,7 @@
         <result column="return_address" property="returnAddress" />
         <result column="purSumAmount" property="purSumAmount" />
         <result column="purReturnAmt" property="purReturnAmt" />
+        <result column="intoStatusName" property="intoStatusName" />
 
 
     </resultMap>
@@ -1182,6 +1182,7 @@
         else true end as "paymentFlag"
         ,tpp.sum_amount AS "purSumAmount"
         ,tpp.return_amt AS "purReturnAmt"
+        ,sys.f_get_name_i18n(tdktype.kind_name_i18n,  #{i18n}) 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_psi_purchase tpp on tpp.pur_id = tpi.from_id
@@ -1191,6 +1192,7 @@
         Left join dkic_b.t_mst_warehouse tmw on tmw.wh_id = tpi.wh_id
         left join dkic_b.t_mst_dictionary_data tmd on tmd.data_id = tpi.into_reason
         left join dkic_b.t_mac_account_item tmai on tmai.item_id = tpi.receivable_id
+        LEFT JOIN sys.t_data_kind tdktype   ON tdktype.kind_code = tpi.into_status
         WHERE tpi.into_id = #{id}::uuid AND tpi.flg_valid = true
     </select>
 

+ 8 - 0
src/main/java/com/dk/mdm/mapper/ivt/OutboundItemMapper.java

@@ -124,5 +124,13 @@ public interface OutboundItemMapper extends BaseMapper<OutboundItem>{
      */
     Long selectHasReturn(OutboundItemQuery outboundItemQuery);
 
+
+    /**
+     * @desc   : 根据条件进行查询
+     * @date   : 2024/7/15 17:22
+     * @author : 寇珊珊
+     */
+    List<OutboundItemResponse> selectMessageByOtherCondition(OutboundItemQuery outboundItemQuery);
+
 }
 

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

@@ -869,4 +869,20 @@ sys.f_remove_zero(out_qty) as out_qty, out_amt, sys.f_remove_zero(return_qty) as
           AND ti.out_type = #{outType}
     </select>
 
+
+    <!--根据条件进行查询-->
+    <select id="selectMessageByOtherCondition" resultMap="BaseResultMapResponse">
+        SELECT
+        <include refid="Base_Column_List_Response"/>
+        FROM dkic_b.t_psi_outbound_item tpoi
+        <where>
+            <if test="outId != null and outId != ''">
+                AND tpoi.out_id = #{outId}::uuid
+            </if>
+            <if test="fromId != null and fromId != ''">
+                AND tpoi.from_id = #{fromId}::uuid
+            </if>
+        </where>
+    </select>
+
 </mapper>

+ 10 - 0
src/main/java/com/dk/mdm/mapper/mst/FollowPlanMapper.java

@@ -1,9 +1,11 @@
 package com.dk.mdm.mapper.mst;
 
+import com.dk.common.model.response.mst.StaffResponse;
 import com.dk.mdm.model.pojo.mst.FollowPlan;
 import com.dk.common.mapper.BaseMapper;
 import com.dk.mdm.model.query.mst.FollowPlanQuery;
 import com.dk.mdm.model.response.mst.FollowPlanResponse;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
@@ -27,6 +29,14 @@ public interface FollowPlanMapper extends BaseMapper<FollowPlan>{
      * @date : 2024/2/26 10:36
      */
     Long countByCond(FollowPlanQuery followPlanQuery);
+
+
+    /**
+     * @desc   : 根据计划id查询
+     * @author : 姜永辉
+     * @date   : 2024/3/6 10:42
+     */
+    FollowPlan selectById(@Param("planId") String planId);
 	
 }
 

+ 28 - 24
src/main/java/com/dk/mdm/mapper/mst/FollowPlanMapper.xml

@@ -5,29 +5,33 @@
     <!-- 通用设置 -->
     <!-- 通用查询列 -->
     <sql id="Base_Column_List">
-        plan_id, cus_id, plan_type, follow_id, follow_user, next_follow_plan, next_follow_time, call_status, remarks, 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
+        plan_id
+        , cus_id, plan_type, follow_id, follow_user, next_follow_plan, next_follow_time,
+        call_status, remarks, 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,xxl_job_id
     </sql>
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.mst.FollowPlan">
         <id column="plan_id" property="planId"/>
-                <result column="cus_id" property="cusId" typeHandler="UuidTypeHandler"/>
-                <result column="plan_type" property="planType"/>
-                <result column="follow_id" property="followId" typeHandler="UuidTypeHandler"/>
-                <result column="follow_user" property="followUser" typeHandler="UuidTypeHandler"/>
-                <result column="next_follow_plan" property="nextFollowPlan"/>
-            <result column="next_follow_time" property="nextFollowTime" typeHandler="TimestampTypeHandler"/>
-                <result column="call_status" property="callStatus"/>
-                <result column="remarks" property="remarks"/>
-                <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"/>
+        <result column="cus_id" property="cusId" typeHandler="UuidTypeHandler"/>
+        <result column="plan_type" property="planType"/>
+        <result column="follow_id" property="followId" typeHandler="UuidTypeHandler"/>
+        <result column="follow_user" property="followUser" typeHandler="UuidTypeHandler"/>
+        <result column="next_follow_plan" property="nextFollowPlan"/>
+        <result column="next_follow_time" property="nextFollowTime" typeHandler="TimestampTypeHandler"/>
+        <result column="call_status" property="callStatus"/>
+        <result column="remarks" property="remarks"/>
+        <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"/>
+        <result column="xxl_job_id" property="xxlJobId"/>
     </resultMap>
 
     <!-- 通用条件列 -->
@@ -99,7 +103,7 @@
     <select id="selectByCond" resultMap="BaseResultMap">
         SELECT
         <include refid="Base_Column_List"/>
-        FROM t_csm_follow_plan
+        FROM dkic_b.t_csm_follow_plan
         <include refid="Condition"/>
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
@@ -110,7 +114,7 @@
     <select id="countByCond" resultType="Long">
         SELECT
         count(1)
-        FROM t_csm_follow_plan
+        FROM dkic_b.t_csm_follow_plan
         <include refid="Condition"/>
     </select>
 
@@ -118,7 +122,7 @@
     <select id="selectById" resultMap="BaseResultMap">
         SELECT
         <include refid="Base_Column_List"/>
-        FROM t_csm_follow_plan
+        FROM dkic_b.t_csm_follow_plan
         WHERE plan_id = #{planId}::uuid
     </select>
 
@@ -126,7 +130,7 @@
     <select id="selectByIdForUpdate" resultMap="BaseResultMap">
         SELECT
         <include refid="Base_Column_List"/>
-        FROM t_csm_follow_plan
+        FROM dkic_b.t_csm_follow_plan
         WHERE plan_id = #{planId}
         for update
     </select>
@@ -135,13 +139,13 @@
     <select id="selectByIdsForUpdate" resultMap="BaseResultMap">
         SELECT
         <include refid="Base_Column_List"/>
-        FROM t_csm_follow_plan
+        FROM dkic_b.t_csm_follow_plan
         <include refid="idsForeach"/>
         for update
     </select>
 
     <insert id="insertBatch">
-        insert into t_csm_follow_plan
+        insert into dkic_b.t_csm_follow_plan
         (
         <trim suffixOverrides=",">
             cus_id,

+ 1 - 0
src/main/java/com/dk/mdm/mapper/report/ReportMapper.xml

@@ -44,6 +44,7 @@
         left join dkic_b.t_mst_unit as tmgu on tmgs.unit_id = tmgu.unit_id
         where tpi.flg_valid
         AND tpi.cp_id = #{cpId}
+        AND tpi.inv_qty != 0
         <if test="skuId != null">
             AND tpi.sku_id = #{skuId} ::uuid
         </if>

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

@@ -558,6 +558,13 @@
                  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"/>
+        <if test="searchText !=null">
+            AND (  t.order_no LIKE concat('%', my_ex.likequery(#{searchText}), '%')
+            OR   t.cus_name LIKE concat('%', my_ex.likequery(#{searchText}), '%')
+            OR   t.cus_phone LIKE concat('%', my_ex.likequery(#{searchText}), '%')
+            OR   t.address_full LIKE concat('%', my_ex.likequery(#{searchText}), '%')
+            )
+        </if>
         order by t.op_create_time desc
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
@@ -571,6 +578,13 @@
         FROM dkic_b.t_psi_order as t
                 left join dkic_b.t_mst_customer tmc on t.cus_id = tmc.cus_id
         <include refid="Condition"/>
+        <if test="searchText !=null">
+        AND (  t.order_no LIKE concat('%', my_ex.likequery(#{searchText}), '%')
+        OR   t.cus_name LIKE concat('%', my_ex.likequery(#{searchText}), '%')
+        OR   t.cus_phone LIKE concat('%', my_ex.likequery(#{searchText}), '%')
+        OR   t.address_full LIKE concat('%', my_ex.likequery(#{searchText}), '%')
+        )
+        </if>
     </select>
 
     <sql id="Base_Column_List_Item_Response_Join">

+ 5 - 0
src/main/java/com/dk/mdm/model/response/ivt/InboundItemResponse.java

@@ -440,6 +440,7 @@ public class InboundItemResponse  {
     @ApiModelProperty(value = "可售量")
     private BigDecimal usableQty;
 
+
     @ApiModelProperty(value = "新建编辑标识true:新建,false:编辑")
     private Boolean addOrEditFlag;
     /**
@@ -526,6 +527,10 @@ public class InboundItemResponse  {
     private Boolean flgCostCheck;
     private String flgCostCheckName;
 
+    private BigDecimal canReturnQty;
+
+
+
     private static final long serialVersionUID = 1L;
 
 }

+ 7 - 0
src/main/java/com/dk/mdm/model/vo/pur/PurchaseItemVO.java

@@ -329,6 +329,13 @@ public class PurchaseItemVO extends PageInfo<PurchaseItemVO> implements Serializ
     @ApiModelProperty(value = "入库核对单价")
     private BigDecimal costPrice;
 
+    @ApiModelProperty(value = "原仓库ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String whIdPri;
+
+    @ApiModelProperty(value = "原非标号")
+    private String nonStdCodePri;
+
 
     /**
      * 入库核对金额

+ 7 - 0
src/main/java/com/dk/mdm/model/vo/sale/OrderItemVO.java

@@ -323,6 +323,13 @@ public class OrderItemVO extends PageInfo<OrderItemVO> implements Serializable {
     @ApiModelProperty(value = "成本金额")
     private BigDecimal costAmt;
 
+    @ApiModelProperty(value = "原仓库ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String whIdPri;
+
+    @ApiModelProperty(value = "原非标号")
+    private String nonStdCodePri;
+
     private static final long serialVersionUID = 1L;
 
 }

+ 5 - 2
src/main/java/com/dk/mdm/service/ivt/InboundReturnService.java

@@ -98,10 +98,13 @@ public class InboundReturnService extends BaseService<Inbound> {
             return ResponseResultUtil.error(ErrorCodeEnum.INBOUND_CANNOT_BE_EMPTY.getCode(),
                     ErrorCodeEnum.INBOUND_CANNOT_BE_EMPTY.getMessage());
         }
+
+        Map<String, Object> dataInfo = new HashMap<>();
+        dataInfo.put("data", inboundResponse);
         //查询明细
         List<InboundItemResponse> inboundItemResponselist = inboundItemMapper.selectByInboundReturnCond(new InboundItemQuery().setIntoId(intoId).setFlgValid(true));
-        inboundResponse.setGoodsList(inboundItemResponselist);
-        return ResponseResultUtil.success(inboundResponse);
+        dataInfo.put("dataItem", inboundItemResponselist);
+        return ResponseResultUtil.success(dataInfo);
     }
 
     /**

+ 2 - 2
src/main/java/com/dk/mdm/service/ivt/inbound/InboundPurchaseService.java

@@ -1635,7 +1635,7 @@ public class InboundPurchaseService extends BaseService<Inbound> {
      */
     @Transactional(rollbackFor = {Exception.class})
     public ResponseResultVO<?> oneKeyPurchaseInboundRepeal(String orderId) {
-        List<InboundItemResponse> InboundItemResponses = inboundItemMapper.selectByCond(new InboundItemQuery().setFromId(orderId));
+        List<InboundItemResponse> InboundItemResponses = inboundItemMapper.selectMessageByOtherCondition(new InboundItemQuery().setFromId(orderId));
         if (InboundItemResponses != null && InboundItemResponses.size() > 0) {
             Map<String, List<InboundItemResponse>> inboundItemMap = InboundItemResponses.stream().collect(Collectors.groupingBy(InboundItemResponse::getIntoId));
             for (String str : inboundItemMap.keySet()) {
@@ -1643,7 +1643,7 @@ public class InboundPurchaseService extends BaseService<Inbound> {
                 //根据id查询 此条入库单的数据还未更改前的数据
                 InboundResponse inboundResponse = inboundMapper.selectById(str);
                 //根据总单id查询
-                List<InboundItemResponse> inboundItemResponseList = inboundItemMapper.selectByCond(new InboundItemQuery().setIntoId(inboundResponse.getIntoId()));
+                List<InboundItemResponse> inboundItemResponseList = inboundItemMapper.selectMessageByOtherCondition(new InboundItemQuery().setIntoId(inboundResponse.getIntoId()));
                 //endregion
 
                 //region 已入库状态作废

+ 1 - 0
src/main/java/com/dk/mdm/service/ivt/inventory/InventoryService.java

@@ -1306,6 +1306,7 @@ public class InventoryService extends BaseService<Inventory> {
                         InventoryBatchResponse inventoryBatchResponse = inventoryBatchMapper.selectById(outboundItemCostResponse.getBatchId());
                         InventoryBatch inventoryBatch = new InventoryBatch();
                         inventoryBatch.setBatchId(outboundItemCostResponse.getBatchId());
+                        //库存批次现在数据库的数量 +  上次出库成本写入的数量
                         inventoryBatch.setInvQty(inventoryBatchResponse.getInvQty().add(outboundItemCostResponse.getOutQty()));
                         inventoryBatch.setCostAmt(inventoryBatch.getInvQty().multiply(outboundItemCostResponse.getCostPrice()));
                         inventoryBatchMapper.updateAmtAndQty(inventoryBatch);

+ 8 - 8
src/main/java/com/dk/mdm/service/ivt/outbound/OutboundSaleOrderService.java

@@ -714,9 +714,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
             //region  已出库编辑
             if (Constant.OutStatus.YICHUKU.getName().equals(outboundVO.getOutStatus())) {
                 //region 应收反记账
-                if (outboundVO.getReceivableId() != null) {
-                    accountService.reverseReceivable(outboundVO.getOutId(), Constant.InventoryDocCode.OUTBOUND.getTableName());
-                }
+                accountService.reverseReceivable(outboundVO.getOutId(), Constant.InventoryDocCode.OUTBOUND.getTableName());
                 //endregion
 
                 //region 修改明细
@@ -755,6 +753,10 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
                         outboundItem.setOutAmt(outboundItemVO.getOutingAmt());
                         outboundItem.setFactAmt(outboundItemVO.getFactAmt());
                         outboundItem.setFactPrice(outboundItemVO.getFactPrice());
+                        outboundItem.setCostPrice(outboundItemVO.getCostPrice() != null ?outboundItemVO.getCostPrice() : null);
+                        outboundItem.setCostAmt(outboundItemVO.getCostAmt() != null ? outboundItemVO.getCostAmt() :null );
+                        outboundItem.setWhId(outboundItemVO.getWhId());
+                        outboundItem.setNonStdCode(outboundItemVO.getNonStdCode());
                         //修改
                         outboundItemMapper.update(outboundItem,
                                 new UpdateWrapper<OutboundItem>().lambda()
@@ -882,9 +884,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
                 //endregion
 
                 //region  应收记账
-                if (outboundVO.getReceivableId() != null) {
-                    accountService.accReceivable(outboundResponse.getOutId(), Constant.InventoryDocCode.OUTBOUND.getTableName());
-                }
+                accountService.accReceivable(outboundResponse.getOutId(), Constant.InventoryDocCode.OUTBOUND.getTableName());
                 //endregion
 
                 //region 外协品新建外协入库单
@@ -1950,7 +1950,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
      */
     @Transactional(rollbackFor = {Exception.class})
     public ResponseResultVO<?> oneKeySaleOutboundRepeal(String orderId) {
-        List<OutboundItemResponse> outboundItemResponses = outboundItemMapper.selectByCond(new OutboundItemQuery().setFromId(orderId));
+        List<OutboundItemResponse> outboundItemResponses = outboundItemMapper.selectMessageByOtherCondition(new OutboundItemQuery().setFromId(orderId));
         if (outboundItemResponses != null && outboundItemResponses.size() > 0) {
             Map<String, List<OutboundItemResponse>> outboundItemVOMap = outboundItemResponses.stream().collect(Collectors.groupingBy(OutboundItemResponse::getOutId));
             for (String str : outboundItemVOMap.keySet()) {
@@ -1958,7 +1958,7 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
                 //根据id查询 此条出库单的数据还未更改前的数据
                 OutboundResponse outboundResponse = outboundMapper.selectById(str);
                 //根据总单id查询
-                List<OutboundItemResponse> outboundItemResponseList = outboundItemMapper.selectByCond(new OutboundItemQuery().setOutId(outboundResponse.getOutId()));
+                List<OutboundItemResponse> outboundItemResponseList = outboundItemMapper.selectMessageByOtherCondition(new OutboundItemQuery().setOutId(outboundResponse.getOutId()));
 
                 //endregion
 

+ 11 - 8
src/main/java/com/dk/mdm/service/ivt/outbound/OutboundSaleReturnService.java

@@ -125,7 +125,7 @@ public class OutboundSaleReturnService extends BaseService<Outbound> {
     @Transactional(rollbackFor = {Exception.class})
     public void updatePrimaryTotal(OutboundVO outboundVO) {
 
-        //region 原库单
+        //region 原库单
         Map<String, List<OutboundItemVO>> outboundItemVOListOutPri = outboundVO.getItemList().stream().filter(it -> it.getSOrderId() != null).collect(Collectors.groupingBy(OutboundItemVO::getSOutId));
         for (String str : outboundItemVOListOutPri.keySet()) {
             List<OutboundItemVO> outboundItemList = outboundItemVOListOutPri.get(str);
@@ -523,7 +523,7 @@ public class OutboundSaleReturnService extends BaseService<Outbound> {
         }
         //endregion
 
-        //region 原库单  原销售订单
+        //region 原库单  原销售订单
         this.updatePrimaryTotal(outboundVO);
         //endregion
 
@@ -590,9 +590,9 @@ public class OutboundSaleReturnService extends BaseService<Outbound> {
             if (Constant.OutStatus.YICHUKU.getName().equals(outboundVO.getOutStatus())) {
 
                 //region 退账
-                if (outboundVO.getReceivableId() != null) {
-                    accountService.reverseReceivable(outboundVO.getOutId(), Constant.InventoryDocCode.OUTBOUND.getTableName());
-                }
+//                if (outboundVO.getReceivableId() != null) {
+                accountService.reverseReceivable(outboundVO.getOutId(), Constant.InventoryDocCode.OUTBOUND.getTableName());
+//                }
                 //endregion
 
                 //region  反写出库总单和明细 反写订单总单和明细
@@ -629,6 +629,9 @@ public class OutboundSaleReturnService extends BaseService<Outbound> {
                         outboundItem.setPriceOut(outboundItemVO.getPriceOut());
                         outboundItem.setCostPrice(outboundItemVO.getCostPrice());
                         outboundItem.setCostAmt(outboundItemVO.getCostAmt());
+                        outboundItem.setWhId(outboundItemVO.getWhId());
+                        outboundItem.setNonStdCode(outboundItemVO.getNonStdCode());
+                        outboundItem.setFlgGift(outboundItemVO.getFlgGift());
                         //修改
                         outboundItemMapper.update(outboundItem,
                                 new UpdateWrapper<OutboundItem>().lambda()
@@ -715,9 +718,9 @@ public class OutboundSaleReturnService extends BaseService<Outbound> {
                 //endregion
 
                 //region  入账
-                if (outboundVO.getReceivableId() != null) {
-                    accountService.accReceivable(outboundVO.getOutId(), Constant.InventoryDocCode.OUTBOUND.getTableName());
-                }
+//                if (outboundVO.getReceivableId() != null) {
+                accountService.accReceivable(outboundVO.getOutId(), Constant.InventoryDocCode.OUTBOUND.getTableName());
+//                }
                 //endregion
 
                 //region 修改库存

+ 26 - 17
src/main/java/com/dk/mdm/service/mst/CusFollowService.java

@@ -2,6 +2,7 @@ package com.dk.mdm.service.mst;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.dk.common.exception.BaseBusinessException;
 import com.dk.common.infrastructure.annotaiton.Pagination;
 import com.dk.common.infrastructure.constant.Constant;
@@ -19,6 +20,7 @@ import com.dk.mdm.infrastructure.convert.mst.CusFollowConvert;
 import com.dk.mdm.infrastructure.convert.mst.MeasureReceiptConvert;
 import com.dk.mdm.infrastructure.util.AuthUtils;
 import com.dk.mdm.mapper.mst.*;
+import com.dk.mdm.model.pojo.ivt.InboundItem;
 import com.dk.mdm.model.pojo.mst.*;
 import com.dk.common.service.BaseService;
 import com.dk.common.mapper.BaseMapper;
@@ -332,10 +334,10 @@ public class CusFollowService extends BaseService<CusFollow> {
     public ResponseResultVO customerReminder() {
         log.info("@XxlJob(\"customer-reminder\")");
         log.info("followPlan id: {}", XxlJobHelper.getJobParam());
-        FollowPlan followPlan = followPlanMapper.selectById(Long.valueOf(XxlJobHelper.getJobParam()));
+//        String planid = "10112024-0715-0000-0000-0004a8b4d1e6";
+        FollowPlan followPlan = followPlanMapper.selectById(XxlJobHelper.getJobParam());
         if (followPlan != null) {
             CusFollow follow = cusFollowMapper.selectById(followPlan.getFollowId());
-
             if (follow != null) {
                 FollowPlan plan = new FollowPlan().setPlanId(followPlan.getPlanId());
                 try {
@@ -354,7 +356,9 @@ public class CusFollowService extends BaseService<CusFollow> {
                 }
 
                 //修改状态
-                followPlanMapper.updateById(plan);
+                followPlanMapper.update(plan,
+                        new UpdateWrapper<FollowPlan>().lambda()
+                                .eq(FollowPlan::getPlanId, UUID.fromString(plan.getPlanId())));
 
                 //删除任务
                 xxlJobUtils.delete(followPlan.getXxlJobId());
@@ -374,7 +378,8 @@ public class CusFollowService extends BaseService<CusFollow> {
     public void planReminder() {
         log.info("@XxlJob(\"plan-reminder\")");
         log.info("followPlan id: {}", XxlJobHelper.getJobParam());
-        FollowPlan followPlan = followPlanMapper.selectById(Long.valueOf(XxlJobHelper.getJobParam()));
+//        String planid = "10112024-0715-0000-0000-0004a8b4d1e6";
+        FollowPlan followPlan = followPlanMapper.selectById(XxlJobHelper.getJobParam());
         if (followPlan != null && followPlan.getFlgValid()) {
             FollowPlan plan = new FollowPlan().setPlanId(followPlan.getPlanId());
             try {
@@ -410,27 +415,26 @@ public class CusFollowService extends BaseService<CusFollow> {
         //查到跟进人
         if (followStaff != null) {
             log.info("sendFollowMessage:{}", JSONObject.toJSONString(followStaff));
-            Customer customer = customerMapper.selectById(new CustomerQuery().setCusId(follow.getCusId()));
+            Customer customer = customerMapper.selectById(follow.getCusId());
             if (customer != null) {
-                String loginType = null;
+                String loginType = "4";
                 List<String> list = new ArrayList<>();
                 if (Constant.BasicDataConstant.FOLLOW_STATUS_4.getValue().equals(follow.getFollowStatus()) ||
-                        Constant.BasicDataConstant.FOLLOW_STATUS_5.getValue().equals(follow.getFollowStatus())) {
+                        Constant.BasicDataConstant.FOLLOW_STATUS_1.getValue().equals(follow.getFollowStatus())) {
                     list.add("您有客户需要跟进");
-                    loginType = "8";
+                    loginType = "4";
 
                 } else if (Constant.BasicDataConstant.FOLLOW_STATUS_6.getValue().equals(follow.getFollowStatus())) {
                     list.add("您有客户需要量尺服务");
-                    loginType = "1";
+                    loginType = "6";
 
                 } else if (Constant.BasicDataConstant.FOLLOW_STATUS_2.getValue().equals(follow.getFollowStatus())) {
                     list.add("您有客户邀约进店");
-                    loginType = "1";
+                    loginType = "2";
 
                 } else if (Constant.BasicDataConstant.FOLLOW_STATUS_3.getValue().equals(follow.getFollowStatus())) {
                     list.add("您有客户需要约尺服务");
-                    loginType = "1";
-
+                    loginType = "3";
                 }
                 list.add(customer.getCusName());
                 list.add(customer.getCusPhone());
@@ -446,6 +450,7 @@ public class CusFollowService extends BaseService<CusFollow> {
                         // 发送消息
                         Map<String, Object> mapMessage = new HashMap<>();
                         mapMessage.put("loginType", loginType);
+                        mapMessage.put("otherParam", follow);
                         mapMessage.put("publicOpenId", user.get("publicOpenId"));
                         mapMessage.put("first", "客户跟进提醒");
                         mapMessage.put("keywordList", list);
@@ -487,8 +492,8 @@ public class CusFollowService extends BaseService<CusFollow> {
                 put("appid", config.getAppId());
                 //用户点击公众号推送消息跳转小程序单据详情页 orderType  里面存放json字符串数据
                 //判断InvoiceParam
-                if (map.containsKey("InvoiceParam")) {
-                    put("pagepath", "pages/login/login?loginType=" + map.get("loginType").toString() + "&InvoiceParam=" + map.get("InvoiceParam").toString());
+                if (map.containsKey("otherParam")) {
+                    put("pagepath", "pages/login/login?loginType=" + map.get("loginType").toString() + "&otherParam=" + map.get("otherParam").toString());
                 } else {
                     put("pagepath", "pages/login/login?loginType=" + map.get("loginType").toString());
                 }
@@ -529,11 +534,16 @@ public class CusFollowService extends BaseService<CusFollow> {
      * @desc : 调用中控服务获取公众号的token
      */
     public String getWxPublicAccountToken() {
+        JSONObject json = new JSONObject();
+        //有效期30天,最大可设置30天
+        json.put("appId", config.getWxPublicAccountAppId());
+        json.put("appSecret", config.getWxPublicAccountAppSecret());
         ResponseResultVO<JSONObject> res = HttpUtils.post(config.getWechatUrlToken(),
-                new HashMap() {{
+                new HashMap<String, Object>() {{
                     put("appId", config.getWxPublicAccountAppId());
                     put("appSecret", config.getWxPublicAccountAppSecret());
                 }});
+//        ResponseResultVO<JSONObject> res = HttpUtils.post(config.getWechatUrlToken(),json);
         if (res.getCode() == 200 && JSON.parseObject(JSON.toJSONString(res.getData())).get("code").toString().equals("200")) {
             return JSON.parseObject(JSON.toJSONString(res.getData())).get("data").toString();
         } else {
@@ -574,7 +584,6 @@ public class CusFollowService extends BaseService<CusFollow> {
         //设置ID
         Map<String, Object> uniqueNoteCode = commonService.getUniqueNoteCode(Constant.docNameConstant.FOLLOWPLAN.getName(), true);
         String nextId = uniqueNoteCode.get("outId").toString();
-        cusFollow.setFollowId(nextId);
 
         // 约量尺 && 接受邀约
 //        预约量尺,邀约结果接受,通知设计师提醒时间是(服务时间);邀约结果拒绝,通知创建者提醒时间是(提醒时间)
@@ -596,7 +605,7 @@ public class CusFollowService extends BaseService<CusFollow> {
                         .setNextFollowTime(cusFollow.getNextFollowTime())
                         .setCallStatus(Constant.CallStatus.CALL_STATUS_UN_DONE.getName() + "")
                         .setXxlJobId(id)
-                        .setOpAppCode(Constant.AppCode.WEIXIN.getCode()+"")
+                        .setOpAppCode(Constant.AppCode.WEIXIN.getCode() + "")
                         .setCpId(cusFollow.getCpId())
         );
     }

+ 8 - 0
src/main/java/com/dk/mdm/service/pur/PurchaseService.java

@@ -484,6 +484,10 @@ public class PurchaseService extends BaseService<Purchase> {
                             inboundItemVO.setCostPrice(purchaseItemVO.getPricePur());
                             //成本基恩
                             inboundItemVO.setCostAmt(purchaseItemVO.getItemAmt());
+                            //原仓库
+                            inboundItemVO.setWhIdPri(purchaseItemVO.getWhIdPri());
+                            //原非标号
+                            inboundItemVO.setNonStdCodePri(purchaseItemVO.getNonStdCodePri());
                             //endregion
 
                             //region 根据sku查询商品信息
@@ -553,6 +557,10 @@ public class PurchaseService extends BaseService<Purchase> {
                             inboundItemVO.setCostPrice(purchaseItemVO.getPricePur());
                             //成本基恩
                             inboundItemVO.setCostAmt(purchaseItemVO.getItemAmt());
+                            //原仓库
+                            inboundItemVO.setWhIdPri(purchaseItemVO.getWhIdPri());
+                            //原非标号
+                            inboundItemVO.setNonStdCodePri(purchaseItemVO.getNonStdCodePri());
                             //endregion
 
                             //region 根据sku查询商品信息

+ 30 - 4
src/main/java/com/dk/mdm/service/report/ReportService.java

@@ -133,7 +133,14 @@ public class ReportService {
             dataList = reportMapper.getPurDetailReport(param);
         }
         data.setList(dataList);
-        data.setTotal(reportMapper.getSalesTrackingReportCount(param));
+        if (param.get("flgViewItem") == null) {
+            // 查询主表
+            data.setTotal(reportMapper.getPurReportCount(param));
+        } else {
+            // 查询明细
+            data.setTotal(reportMapper.getPurDetailReportCount(param));
+        }
+
         data.setPageSize((Integer) param.get("pageSize"));
         data.setCurrentPage((Integer) param.get("currentPage"));
         return ResponseResultUtil.success(data);
@@ -163,7 +170,14 @@ public class ReportService {
             dataList = reportMapper.getOrderDetailReport(param);
         }
         data.setList(dataList);
-        data.setTotal(reportMapper.getSalesTrackingReportCount(param));
+        if (param.get("flgViewItem") == null) {
+            // 查询主表
+            data.setTotal(reportMapper.getOrderReportCount(param));
+        } else {
+            // 查询明细
+            data.setTotal(reportMapper.getOrderDetailReportCount(param));
+        }
+
         data.setPageSize((Integer) param.get("pageSize"));
         data.setCurrentPage((Integer) param.get("currentPage"));
         return ResponseResultUtil.success(data);
@@ -192,7 +206,13 @@ public class ReportService {
             dataList = reportMapper.getOutboundDetailReport(param);
         }
         data.setList(dataList);
-        data.setTotal(reportMapper.getOutboundDetailReportCount(param));
+        if (param.get("flgViewItem") == null) {
+            // 查询主表
+            data.setTotal(reportMapper.getOutboundReportCount(param));
+        } else {
+            // 查询明细
+            data.setTotal(reportMapper.getOutboundDetailReportCount(param));
+        }
         data.setPageSize((Integer) param.get("pageSize"));
         data.setCurrentPage((Integer) param.get("currentPage"));
         return ResponseResultUtil.success(data);
@@ -221,7 +241,13 @@ public class ReportService {
             dataList = reportMapper.getInboundDetailReport(param);
         }
         data.setList(dataList);
-        data.setTotal(reportMapper.getSalesTrackingReportCount(param));
+        if (param.get("flgViewItem") == null) {
+            // 查询主表
+            data.setTotal(reportMapper.getInboundlReportCount(param));
+        } else {
+            // 查询明细
+            data.setTotal(reportMapper.getInboundDetailReportCount(param));
+        }
         data.setPageSize((Integer) param.get("pageSize"));
         data.setCurrentPage((Integer) param.get("currentPage"));
         return ResponseResultUtil.success(data);

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

@@ -112,7 +112,7 @@ wx:
   # 公众号的appid appSecret 东科软件 公众号
   wxPublicAccountAppId: wx6bb9335b534f7b28
   wxPublicAccountAppSecret: 78a99837c113756599d1748b813ca698
-  templateId: V5Ju7-8BfDKJJm1HgH4j5km68rPs777pMVJ0_MKqR00
+  templateId: FbOkFnLo86XllRKElGwWVFkc8VAXg386PyF9wndqItE
 
   # 支付的信息
   pay: