Parcourir la source

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

koushanshan il y a 1 an
Parent
commit
eeda303cb5

+ 11 - 0
src/main/java/com/dk/mdm/controller/mac/ReceiptController.java

@@ -168,6 +168,17 @@ public class ReceiptController {
         return receiptService.getRpSupList(recPayQuery);
     }
 
+    /**
+     * @desc : 供应商收退款查询(供应商详情用)
+     * @author : 于继渤
+     * @date : 2024/7/5 10:36
+     */
+    @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
+    @PostMapping({"get_rp_sup_list_detail"})
+    public ResponseResultVO<PageList<RecPayResponse>> getRpSupListDetail(@RequestBody RecPayQuery recPayQuery) {
+        return receiptService.getRpSupListDetail(recPayQuery);
+    }
+
 
     /**
      * @desc : 新建供应商收款

+ 8 - 0
src/main/java/com/dk/mdm/infrastructure/config/Config.java

@@ -126,4 +126,12 @@ public class Config {
      */
     @Value("${wx.templateId}")
     private String templateId;
+
+    /**
+     * @desc   : 微信小程序订阅消息模板id列表
+     * @author : 刘尧
+     * @date   : 2024/07/22 10:03
+     */
+    @Value("${wx.miniMessageModelIds}")
+    private String[] miniMessageModelIds;
 }

+ 15 - 0
src/main/java/com/dk/mdm/mapper/mac/RecPayMapper.java

@@ -98,6 +98,21 @@ public interface RecPayMapper extends BaseMapper<RecPay> {
      */
     Long getRpSupListCount(RecPayQuery recPayQuery);
 
+
+    /**
+     * @desc : 根据条件进行查询
+     * @author : 付斌
+     * @date : 2024-02-28 10:18
+     */
+    List<RecPayResponse> getRpSupListDetail(RecPayQuery recPayQuery);
+
+    /**
+     * @desc : 根据条件进行查询(数量)
+     * @author : 付斌
+     * @date : 2024-02-28 10:19
+     */
+    Long getRpSupListCountDetail(RecPayQuery recPayQuery);
+
     /**
      * @desc   : 根据条件查询
      * @date   : 2024/7/16 17:13

+ 91 - 2
src/main/java/com/dk/mdm/mapper/mac/RecPayMapper.xml

@@ -810,6 +810,96 @@
         t.flg_valid,
         t.cp_id,
         tma.receivable_residue,
+        tma.receipt_residue
+        from dkic_b.t_mac_rec_pay as t
+        left join dkic_b.t_mst_supplier tmsp on tmsp.sup_id = t.object_id
+        left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.rp_type
+        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_mac_account tma  on tma.object_id = t.object_id and tma.object_type in ('对象类型-供应商')
+        where t.rp_type in ('收付款类型-付款', '收付款类型-退付款')
+        <include refid="Condition_sup"/>
+        <if test="viewVoidedDocuments !=null and viewVoidedDocuments == false">
+            AND  t.flg_valid = true
+        </if>
+
+        <if test="searchText !=null and searchText != ''">
+            AND (  tmsp.contact_phone LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+            or tmsp.return_address LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+            or tmsp.sup_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+            or tmo.org_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+            or tms.staff_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+            or t.rp_no 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}
+        </if>
+    </select>
+
+    <!-- 查询表t_mac_rec_pay,(条件查询)个数 -->
+    <select id="getRpSupListCount" resultType="Long">
+        SELECT count(1)
+        from dkic_b.t_mac_rec_pay as t
+        left join dkic_b.t_mst_supplier tmsp on tmsp.sup_id = t.object_id
+        left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.rp_type
+        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
+        where t.rp_type in ('收付款类型-付款', '收付款类型-退付款')
+        <include refid="Condition_sup"/>
+        <if test="searchText !=null and searchText != ''">
+            AND (  tmsp.contact_phone LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+            or tmsp.return_address LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+            or tmsp.sup_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+            or tmo.org_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+            or tms.staff_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
+            )
+        </if>
+    </select>
+
+
+    <select id="getRpSupListDetail" resultMap="BaseResultMapResponse">
+        select t.rp_id,
+        t.rp_no,
+        t.rp_type,
+        sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "rpTypeName",
+        t.object_id,
+        tmsp.sup_id,
+        tmsp.sup_code,
+        tmsp.sup_name,
+        tmsp.sup_type,
+        tmsp.contact_name,
+        tmsp.contact_phone,
+        tmsp.return_address,
+        t.org_id,
+        tmo.org_name         as "orgName",
+        t.staff_id,
+        tms.staff_name       as "staffName",
+        t.sum_amt_rec,
+        t.sum_amt_pay,
+        t.sum_should_handle,
+        t.sum_use_receipt_residue,
+        t.sum_use_payment_residue,
+        t.sum_amt_receivable_handle,
+        t.sum_amt_payable_handle,
+        t.sum_waive_amt,
+        t.acc_date,
+        t.remarks,
+        t.annex_paths,
+        t.biznis_type,
+        t.biznis_id,
+        t.biznis_no,
+        t.flg_order_handle,
+        t.flg_lock,
+        t.make_staff,
+        makestaff.staff_name as "makeStaffName",
+        t.make_time,
+        t.flg_valid,
+        t.cp_id,
+        tma.receivable_residue,
         tma.receipt_residue,
         rpi.amt_pay,
         concat (tmma.mac_name ) AS "macNames"
@@ -844,7 +934,7 @@
     </select>
 
     <!-- 查询表t_mac_rec_pay,(条件查询)个数 -->
-    <select id="getRpSupListCount" resultType="Long">
+    <select id="getRpSupListCountDetail" resultType="Long">
         SELECT count(1)
         from dkic_b.t_mac_rec_pay as t
         left join dkic_b.t_mst_supplier tmsp on tmsp.sup_id = t.object_id
@@ -864,7 +954,6 @@
         </if>
     </select>
 
-
     <!--根据条件查询-->
     <select id="selectMessageByOtherCondition" resultMap="BaseResultMapResponse">
         select t.rp_id

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

@@ -24,7 +24,7 @@
         tmgs.price_standard as "priceStandard",
         tmgs.price_wholesale as "priceWholesale",
         tmgs.price_limited as "priceLimited",
-        tmgs.sku_images as "skuImages",
+        jsonb_array_elements(tmgs.sku_images)->>'url' as "path",
         tpi.non_std_code as "nonStdCode",
         sys.f_remove_zero(tpi.inv_qty) as "invQty",
         sys.f_remove_zero(tpi.outing_qty) as "outingQty",

+ 12 - 0
src/main/java/com/dk/mdm/service/mac/ReceiptService.java

@@ -758,6 +758,18 @@ public class ReceiptService extends BaseService<RecPay> {
     }
 
     /**
+     * @desc : 供应商收退款查询
+     * @author : 于继渤
+     * @date : 2024/7/5 10:36
+     */
+    @Pagination
+    public ResponseResultVO<PageList<RecPayResponse>> getRpSupListDetail(RecPayQuery recPayQuery) {
+        return super.mergeListWithCount(recPayQuery, recPayMapper.getRpSupListDetail(recPayQuery),
+                recPayMapper.getRpSupListCountDetail(recPayQuery));
+
+    }
+
+    /**
      * @desc : 新建供应商收款
      * @author : 于继渤
      * @date : 2024/7/5 10:48

+ 15 - 18
src/main/java/com/dk/mdm/service/mst/CusFollowService.java

@@ -476,11 +476,19 @@ public class CusFollowService extends BaseService<CusFollow> {
 //                        mapMessage.put("publicOpenId", user.get("publicOpenId"));
                         mapMessage.put("userWxId", user.get("userWxId"));
                         mapMessage.put("first", "客户跟进提醒");
-//                        mapMessage.put("keywordList", list);
-                        mapMessage.put("keywordMap", keywordMap);
+//                      mapMessage.put("keywordList", list);
+//                      mapMessage.put("keywordMap", keywordMap);
                         mapMessage.put("remark", "客户跟进备注");
-//                        sendUniformMessage(mapMessage);
-                        wxMessagePush(mapMessage);
+//                      sendUniformMessage(mapMessage);
+                        String[] miniMessageModelIds = config.getMiniMessageModelIds();
+                        // 构造对应的显示信息 和模板数据结构对应
+                        JSONObject data = new JSONObject();
+                        data.put("time4", createDataItem("value", String.valueOf(keywordMap.get("followTime"))));
+                        data.put("thing1", createDataItem("value", String.valueOf(keywordMap.get("cusName"))));
+                        data.put("phone_number2", createDataItem("value", String.valueOf(keywordMap.get("cusPhone"))));
+                        data.put("thing6", createDataItem("value", String.valueOf(keywordMap.get("remark"))));
+                        data.put("thing5", createDataItem("value", String.valueOf(mapMessage.get("remark"))));
+                        wxMessagePush(miniMessageModelIds[0], data, mapMessage);
                     }
                 }
 
@@ -558,14 +566,14 @@ public class CusFollowService extends BaseService<CusFollow> {
      * @author : 刘尧
      * @date : 2024-07-19 08:56
      * */
-    public ResponseResultVO<?> wxMessagePush(Map<String, Object> map) {
+    public ResponseResultVO<?> wxMessagePush(String messId, JSONObject data, Map<String, Object> map) {
         // 获取微信Token
         String wxToken = getWxToken();
         Map<String, Object> params = new HashMap<>();
         // 接口调用凭证
         params.put("access_token", wxToken);
         // 所需下发的订阅模板id
-        params.put("template_id", "z3REuwft6NLPxVW8s5HN1UgWjFstWjD0QfCXNLTa0LA");
+        params.put("template_id", messId);
         // 点击模板卡片后的跳转页面
         if (map.containsKey("otherParam")) {
             params.put("page", "pages/welcome/welcome?loginType=" + map.get("loginType").toString() + "&otherParam=" + map.get("otherParam").toString());
@@ -576,18 +584,7 @@ public class CusFollowService extends BaseService<CusFollow> {
         params.put("touser", map.get("userWxId"));
         // 跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;
         params.put("miniprogram_state", "trial");
-
-        // 获取客户信息
-        Object keywordMap = map.get("keywordMap");
-        Map<String, Object> personMap = BeanUtil.beanToMap(keywordMap);
-
-        // 构造对应的显示信息 和模板数据结构对应
-        JSONObject data = new JSONObject();
-        data.put("time4", createDataItem("value", String.valueOf(personMap.get("followTime"))));
-        data.put("thing1", createDataItem("value", String.valueOf(personMap.get("cusName"))));
-        data.put("phone_number2", createDataItem("value", String.valueOf(personMap.get("cusPhone"))));
-        data.put("thing6", createDataItem("value", String.valueOf(personMap.get("remark"))));
-        data.put("thing5", createDataItem("value", String.valueOf(map.get("remark"))));
+        // 配置模板中明细值
         params.put("data", data);
 
         ResponseResultVO<JSONObject> post = HttpUtils.post("https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=" + wxToken, params);

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

@@ -115,7 +115,8 @@ wx:
   wxPublicAccountAppId: wx6bb9335b534f7b28
   wxPublicAccountAppSecret: 78a99837c113756599d1748b813ca698
   templateId: V5Ju7-8BfDKJJm1HgH4j5km68rPs777pMVJ0_MKqR00
-
+  # 微信小程序订阅消息模板id列表
+  miniMessageModelIds: ["z3REuwft6NLPxVW8s5HN1UgWjFstWjD0QfCXNLTa0LA"]
 
   # 支付的信息
   pay:

+ 2 - 0
src/main/resources/prod/bootstrap.yml

@@ -113,6 +113,8 @@ wx:
   wxPublicAccountAppId: wx6bb9335b534f7b28
   wxPublicAccountAppSecret: 78a99837c113756599d1748b813ca698
   templateId: V5Ju7-8BfDKJJm1HgH4j5km68rPs777pMVJ0_MKqR00
+  # 微信小程序订阅消息模板id列表
+  miniMessageModelIds: [ "z3REuwft6NLPxVW8s5HN1UgWjFstWjD0QfCXNLTa0LA" ]
 
   # 支付的信息
   pay:

+ 2 - 0
src/main/resources/st/bootstrap.yml

@@ -103,6 +103,8 @@ 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=
+  # 微信小程序订阅消息模板id列表
+  miniMessageModelIds: [ "z3REuwft6NLPxVW8s5HN1UgWjFstWjD0QfCXNLTa0LA" ]
 
 dongke:
   base:

+ 2 - 0
src/main/resources/test/bootstrap.yml

@@ -113,6 +113,8 @@ wx:
   wxPublicAccountAppId: wx6bb9335b534f7b28
   wxPublicAccountAppSecret: 78a99837c113756599d1748b813ca698
   templateId: FbOkFnLo86XllRKElGwWVFkc8VAXg386PyF9wndqItE
+  # 微信小程序订阅消息模板id列表
+  miniMessageModelIds: [ "z3REuwft6NLPxVW8s5HN1UgWjFstWjD0QfCXNLTa0LA" ]
 
   # 支付的信息
   pay: