Bladeren bron

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

# Conflicts:
#	src/main/java/com/dk/mdm/mapper/mst/MoneyAccountMapper.xml
jiangn 1 jaar geleden
bovenliggende
commit
64c204fb2f

+ 7 - 2
src/main/java/com/dk/mdm/mapper/ivt/FreezeMapper.xml

@@ -6,7 +6,7 @@
     <!-- 通用查询列 -->
     <sql id="Base_Column_List">
         freeze_id
-        , freeze_no, cus_id, org_id, staff_id, freeze_status, freeze_date, auto_unfreeze_date,
+        , freeze_no, cus_id, org_id, staff_id, freeze_status, freeze_date, unfreeze_date,auto_unfreeze_date,
         sys.f_remove_zero(sum_quantity) as sum_quantity, remarks, 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,annex_paths
     </sql>
 
@@ -74,6 +74,10 @@
         fre
         .
         annex_paths
+        ,
+        fre
+        .
+        unfreeze_date
     </sql>
 
     <!-- 通用查询映射结果 -->
@@ -85,6 +89,7 @@
         <result column="staff_id" property="staffId" typeHandler="UuidTypeHandler"/>
         <result column="freeze_status" property="freezeStatus"/>
         <result column="freeze_date" property="freezeDate" typeHandler="TimestampTypeHandler"/>
+        <result column="unfreeze_date" property="unfreezeDate" typeHandler="TimestampTypeHandler"/>
         <result column="auto_unfreeze_date" property="autoUnfreezeDate" typeHandler="TimestampTypeHandler"/>
         <result column="sum_quantity" property="sumQuantity"/>
         <result column="remarks" property="remarks"/>
@@ -113,7 +118,7 @@
         <result column="staff_id" property="staffId" typeHandler="UuidTypeHandler"/>
         <result column="freeze_status" property="freezeStatus"/>
         <result column="freeze_date" property="freezeDate" typeHandler="TimestampTypeHandler"/>
-        <result column="auto_unfreeze_date" property="autoUnfreezeDate" typeHandler="TimestampTypeHandler"/>
+        <result column="unfreeze_date" property="unfreezeDate" typeHandler="TimestampTypeHandler"/>
         <result column="sum_quantity" property="sumQuantity"/>
         <result column="remarks" property="remarks"/>
         <result column="make_staff" property="makeStaff" typeHandler="UuidTypeHandler"/>

+ 1 - 1
src/main/java/com/dk/mdm/mapper/mac/OtherReceivableMapper.xml

@@ -142,7 +142,7 @@
                tmc.cus_code         as "cusCode",
                tmc.cus_name         as "cusName",
                tmc.cus_phone        as "cusPhone",
-               tmc.contact_name
+               tmc.contact_name,
                t.org_id,
                tmo.org_name         as "orgName",
                t.staff_id,

+ 2 - 1
src/main/java/com/dk/mdm/mapper/mst/CustomerMapper.xml

@@ -109,7 +109,7 @@
         <result column="outboundNotQuantity" property="outboundNotQuantity"/>
         <result column="outboundReturnQuantity" property="outboundReturnQuantity"/>
         <result column="outboundReturnAmount" property="outboundReturnAmount"/>
-
+        <result column="receipt_lock" property="receiptLock"/>
         <result column="startAmount" property="startAmount"/>
     </resultMap>
 
@@ -313,6 +313,7 @@
         tma.receivable,
         tma.receivable_residue,
         tma.receipt_residue,
+        tma.receipt_lock,
         tmor.sum_amt_receivable AS "startAmount"
 --         concat(tms3.staff_name)  AS "followStaffsName"
         FROM dkic_b.t_mst_customer tmc

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

@@ -189,6 +189,7 @@
         insert into dkic_b.t_mst_dictionary_data
         (
         <trim suffixOverrides=",">
+            data_id,
             dict_code,
             data_value,
             display_no,
@@ -204,6 +205,7 @@
         <foreach collection="list" index="index" item="item" separator=",">
             (
             <trim suffixOverrides=",">
+                #{item.dataId}::uuid,
                 #{item.dictCode},
                 #{item.dataValue},
                 #{item.displayNo},

+ 17 - 0
src/main/java/com/dk/mdm/mapper/mst/MoneyAccountMapper.xml

@@ -80,6 +80,7 @@
     <!-- 查询表t_mst_money_account,(条件查询+分页)列表 -->
     <select id="selectByCond" resultMap="BaseResultMapResponse">
         SELECT t.mac_id,
+<<<<<<< HEAD
         t.mac_code,
         t.mac_name,
         t.mac_Type,
@@ -93,6 +94,22 @@
         t.flg_valid,
         t.cp_id,
         coalesce(tmti.amt_trf, 0) as "initBalance"
+=======
+               t.mac_code,
+               t.mac_name,
+               t.mac_Type,
+               dd.data_value             AS "macTypeName",
+               t.balance,
+               t.display_no,
+               t.mac_receipt_code,
+               t.acc_date,
+               t.flg_negative,
+               t.remarks,
+               t.flg_valid,
+                t.flg_default,
+               t.cp_id,
+               coalesce(tmti.amt_trf, 0) as "initBalance"
+>>>>>>> 83f9d270283aa09f581977351123c663d2d1f6a5
         FROM dkic_b.t_mst_money_account as t
         left join dkic_b.t_mst_dictionary_data as dd on t.mac_type = dd.data_id
         left join(select tmti.trf_in_mac, tmti.amt_trf

+ 5 - 5
src/main/java/com/dk/mdm/mapper/mst/SupplierMapper.xml

@@ -58,7 +58,7 @@ op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user,return_
         <result column="inboundAmount" property="inboundAmount"/>
         <result column="inboundNotQuantity" property="inboundNotQuantity"/>
         <result column="inboundNotAmount" property="inboundNotAmount"/>
-
+        <result column="sum_amt_payable" property="sumAmtPayable"/>
 
 
 
@@ -315,16 +315,16 @@ op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user,return_
         msl.cp_id AND tpob.flg_valid AND tpob.into_type = '入库类型-采购入库' AND tpob.into_status = '入库状态-入库中') AS
         "inboundNotAmount",
         tma.payable_residue AS "payableResidue",
-        tma.payment AS "payment"
-
-
-
+        tma.payment AS "payment",
+        tmop.sum_amt_payable
         FROM dkic_b.t_mst_supplier msl
         LEFT JOIN dkic_b.t_mst_staff  tms   ON tms.staff_id = msl.staff_id
+        LEFT JOIN dkic_b.t_mac_other_payable tmop   ON tmop.object_id = msl.sup_id and tmop.business_type = 0
         LEFT JOIN dkic_b.t_mst_org  tmo   ON tmo.org_id = msl.org_id
         LEFT JOIN sys.t_data_kind tdk   ON tdk.kind_code = msl.sup_type
         LEFT JOIN dkic_b.t_mac_account tma   ON tma.object_id = msl.sup_id
         WHERE msl.sup_id = #{id}::uuid
+
     </select>
 
     <!-- 根据主键锁定表t_mst_supplier的一行数据 -->

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

@@ -880,7 +880,7 @@
     </select>
     <!-- 采购明细报表明细 -->
     <select id="getPurDetailReport" resultType="java.util.Map">
-        select
+        select distinct
         tpp.pur_id as "purId"
         ,tpp.pur_no as "purNo"
         ,tmo.org_name as "orgName"
@@ -902,7 +902,7 @@
         ,tpp.amt_residue as "amtResidue"
         ,tpp.remarks
         ,tpo.order_no as "orderNo"
-        ,ib.into_no as "intoNo"
+        ,tpp.make_time as "makeTime"
         ,tmgs.sku_name as "skuName"
         ,tmgs.sku_model as "skuModel"
         ,tmgs.sku_spec as "skuSpec"
@@ -938,13 +938,12 @@
         left join dkic_b.t_mst_goods_category as tmgc on tmgc.cat_id = tmgs.category_id
         left join dkic_b.t_mst_goods_series as series on series.series_id = tmgs.series_id
         left join dkic_b.t_psi_order as tpo on tpo.order_id = tppi.from_id
-        left join dkic_b.t_psi_inbound_item as ibi on ibi.from_item_id=tppi.item_id
-        left join dkic_b.t_psi_inbound as ib on ibi.into_id=ib.into_id
+
         left join sys.t_data_kind tdk3 on tdk3.kind_code = tppi.into_status
         left join dkic_b.t_mst_unit as tmgu on tmgs.unit_id = tmgu.unit_id
         left join dkic_b.t_mst_unit as tmgus on tmgs.sub_unit_id = tmgus.unit_id
         <include refid="Condition_PurDetailReport"/>
-        order by tpp.op_create_time desc
+        order by tpp.make_time desc
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
         </if>
@@ -966,8 +965,6 @@
         left join dkic_b.t_mst_goods_category as tmgc on tmgc.cat_id = tmgs.category_id
         left join dkic_b.t_mst_goods_series as series on series.series_id = tmgs.series_id
         left join dkic_b.t_psi_order as tpo on tpo.order_id = tppi.from_id
-        left join dkic_b.t_psi_inbound_item as ibi on ibi.from_item_id=tppi.item_id
-        left join dkic_b.t_psi_inbound as ib on ibi.into_id=ib.into_id
         left join sys.t_data_kind tdk3 on tdk3.kind_code = tppi.into_status
         <include refid="Condition_PurDetailReport"/>
     </select>

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

@@ -257,6 +257,8 @@
             <result column="wh_name" property="whName"/>
             <result column="max_out_qty" property="maxOutQty"/>
             <result column="pack_box_text" property="packBoxText"/>
+            <result column="fact_amt" property="factAmt"/>
+            <result column="fact_price" property="factPrice"/>
     </resultMap>
     <!--小程序用 总单-->
     <sql id="Base_Column_List_Detail_Join">

+ 11 - 0
src/main/java/com/dk/mdm/model/pojo/ivt/Freeze.java

@@ -92,6 +92,8 @@ public class Freeze extends PageInfo<Freeze> implements Serializable {
     private String freezeStatus;
 
 
+
+
     /**
      * 冻结日期
      */
@@ -101,6 +103,15 @@ public class Freeze extends PageInfo<Freeze> implements Serializable {
     @TableField(typeHandler = TimestampTypeHandler.class)
     private LocalDate freezeDate;
 
+    /**
+     * 冻结日期
+     */
+    @Excel(name = "解冻日期")
+    @ApiModelProperty(value = "解冻日期")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDate unfreezeDate;
+
 
     /**
      * 自动解冻日期

+ 10 - 2
src/main/java/com/dk/mdm/model/pojo/mst/Customer.java

@@ -172,13 +172,21 @@ public class Customer extends PageInfo<Customer> implements Serializable {
     private String staffId;
 
     /**
-     * 员工名称
+     * 业务员编码
      */
     @Excel(name = "业务员编码")
-    @ApiModelProperty(value = "员工名称")
+    @ApiModelProperty(value = "业务员编码")
     @TableField(exist = false)
     private String staffCode;
 
+    /**
+     * 员工名称
+     */
+    @Excel(name = "员工名称")
+    @ApiModelProperty(value = "员工名称")
+    @TableField(exist = false)
+    private String staffName;
+
 
     /**
      * 报备人

+ 9 - 0
src/main/java/com/dk/mdm/model/response/ivt/FreezeResponse.java

@@ -48,6 +48,7 @@ public class FreezeResponse extends PageInfo<FreezeResponse> implements Serializ
     private String freezeId;
 
 
+
     /**
      * 附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)
      */
@@ -109,6 +110,14 @@ public class FreezeResponse extends PageInfo<FreezeResponse> implements Serializ
 
 
     /**
+     * 冻结日期
+     */
+    @Excel(name = "解冻日期")
+    @ApiModelProperty(value = "解冻日期")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate unfreezeDate;
+
+    /**
      * 自动解冻日期
      */
     @Excel(name = "自动解冻日期")

+ 2 - 1
src/main/java/com/dk/mdm/model/response/mst/CustomerResponse.java

@@ -347,7 +347,8 @@ public class CustomerResponse extends PageInfo<CustomerResponse> implements Seri
 
     private String followStaffsName;
 
-
+    @ApiModelProperty(value = "总收款锁定金额 (SUM(收款+退收款)(锁定金额))")
+    private BigDecimal receiptLock;
 
 
     private static final long serialVersionUID = 1L;

+ 5 - 1
src/main/java/com/dk/mdm/service/common/CommonService.java

@@ -815,7 +815,11 @@ public class CommonService extends BaseService<Map<String, Object>> {
             map.put("moneyAccount", "资金账户");
             list = commonMapper.getDataKind(map);
         }
-
+        // 发票类型
+        if (dataSourceCode.equals("receiptType")) {
+            map.put("kindType", "发票类型");
+            list = commonMapper.getDataKind(map);
+        }
         return ResponseResultUtil.success(list);
     }
 

+ 82 - 4
src/main/java/com/dk/mdm/service/ivt/FreezeService.java

@@ -5,6 +5,7 @@ import com.dk.common.exception.BaseBusinessException;
 import com.dk.common.infrastructure.annotaiton.Pagination;
 import com.dk.common.infrastructure.constant.Constant;
 import com.dk.common.infrastructure.enums.ErrorCodeEnum;
+import com.dk.common.infrastructure.xxl.XxlJobUtils;
 import com.dk.common.model.pojo.PageList;
 import com.dk.common.response.ResponseCodeEnum;
 import com.dk.common.response.ResponseResultUtil;
@@ -20,6 +21,8 @@ import com.dk.common.service.BaseService;
 import com.dk.common.mapper.BaseMapper;
 import com.dk.mdm.model.pojo.ivt.FreezeItem;
 import com.dk.mdm.model.pojo.ivt.Inventory;
+import com.dk.mdm.model.pojo.mst.CusFollow;
+import com.dk.mdm.model.pojo.mst.FollowPlan;
 import com.dk.mdm.model.pojo.sale.Order;
 import com.dk.mdm.model.pojo.sale.OrderItem;
 import com.dk.mdm.model.query.ivt.FreezeItemQuery;
@@ -37,17 +40,20 @@ import com.dk.mdm.model.vo.sale.OrderVO;
 import com.dk.mdm.service.common.CommonService;
 import com.dk.mdm.service.ivt.inventory.InventoryService;
 import com.dk.mdm.service.sale.OrderItemService;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 
 import java.math.BigDecimal;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
+import java.time.*;
 import java.util.*;
 import java.util.stream.Collectors;
 
+@Slf4j
 @Service
 @Transactional
 public class FreezeService extends BaseService<Freeze> {
@@ -80,6 +86,9 @@ public class FreezeService extends BaseService<Freeze> {
 
 	@Autowired
 	private InventoryMapper inventoryMapper;
+
+	@Autowired
+	private XxlJobUtils xxlJobUtils;
 	/**
 	 * @desc   : 重写主键
 	 * @author : 宋扬
@@ -110,7 +119,7 @@ public class FreezeService extends BaseService<Freeze> {
 	public ResponseResultVO<?> insert(FreezeVO freezeVO) {
 		// 转化实体
 		Freeze freeze = freezeConvert.convertToPo(freezeVO);
-		Map<String, Object> codeMap = commonService.getUniqueNoteCode(Constant.docNameConstant.Freeze.getName(), true);
+		Map<String, Object> codeMap = commonService.getUniqueNoteCode(Constant.docNameConstant.Freeze.getName(), false);
 		// 获取冻结状态 获取冻结日期(当前日期) 插入冻结表的实体
 		freeze.setFreezeStatus(Constant.FreezeStatusType.ALLFREEZE.getName()).setFreezeDate(LocalDate.now())
 				.setCusId(freezeVO.getCusId()).setMakeStaff(freezeVO.getMakeStaff()).setOrgId(freezeVO.getOrgId())
@@ -145,10 +154,79 @@ public class FreezeService extends BaseService<Freeze> {
 				inventoryService.updateByUuid(inventoryUpdate);
 			}
 		}
+
+		// 只要有自动解冻日期
+		if (freezeVO.getAutoUnfreezeDate() != null) {
+			// 保存跟进信息
+			saveToXxlJob(freeze);
+		}
+
+
 		return ResponseResultUtil.success();
 	}
 
 	/**
+	 * @desc : 保存跟进信息到xxl job
+	 * @author : 王英杰
+	 * @date : 2022-05-27 09:53
+	 */
+	@Transactional(rollbackFor = {Exception.class})
+	public void saveToXxlJob(Freeze freeze) {
+		 xxlJobUtils.create(Math.toIntExact(
+				(LocalDateTime.of(freeze.getAutoUnfreezeDate(),LocalTime.of(23, 59, 59)).toInstant(ZoneOffset.of("+8")).toEpochMilli() - System.currentTimeMillis()) / 1000
+		), freeze.getFreezeId(), Constant.XxlJobInfo.FREEZE.getValue());
+	}
+
+	/**
+	 * @desc : 客户跟进提醒回调
+	 * @author : 姜永辉
+	 * @date : 2022-06-29 14:22
+	 */
+	@Transactional(rollbackFor = {Exception.class})
+	@XxlJob("freeze-reminder")
+	public ResponseResultVO customerReminder() {
+//		log.info("@XxlJob(\"freeze-reminder\")");
+//		log.info("followPlan id: {}", XxlJobHelper.getJobParam());
+//        String planid = "10112024-0715-0000-0000-0004a8b4d1e6";
+        String id =  XxlJobHelper.getJobParam();
+//		String id = "10112024-0808-0000-0000-0004da956d40";
+		// 赋值全部解冻
+		String freezeStatus=Constant.FreezeStatusType.ALLUNFREEZE.getName();
+		// 查询冻结单明细
+		FreezeItemQuery freezeItemQuery = new FreezeItemQuery();
+		freezeItemQuery.setFreezeId(id);
+		List<FreezeItemResponse> itemList = freezeItemMapper.selectByCond(freezeItemQuery);
+		// 解冻
+		for (FreezeItemResponse freezeItemVO : itemList) {
+
+			FreezeItem freezeItem = new FreezeItem();
+			// 赋值实体
+			freezeItem.setItemId(freezeItemVO.getItemId()).setUnfreezeQty(freezeItemVO.getSurplusQty())
+					.setSurplusQty(BigDecimal.ZERO);
+			// 修改冻结单明细解冻量
+			freezeItemService.updateByUuid(freezeItem);
+			// 查询库存信息
+			Inventory inventoryForUpdate=inventoryMapper.selectByIdForUpdate(freezeItemVO.getInvId());
+			// 库存冻结量=库存冻结量-实际解冻量
+			BigDecimal freezeqty=inventoryForUpdate.getFreezeQty().subtract(freezeItemVO.getSurplusQty());
+			// 库存可售量=库存可售量+实际解冻量
+			BigDecimal usableQt=inventoryForUpdate.getUsableQty().add(freezeItemVO.getSurplusQty());
+			// 更新修改内容信息
+			Inventory inventoryUpdate = new Inventory();
+			// 赋值库存可售量、冻结量和库存ID值
+			inventoryUpdate.setInvId(freezeItemVO.getInvId()).setFreezeQty(freezeqty).setUsableQty(usableQt);
+			// 修改库存冻结量、可售量
+			inventoryService.updateByUuid(inventoryUpdate);
+		}
+		// 赋值冻结表状态和ID
+		Freeze freeze=new Freeze();
+		freeze.setFreezeId(id).setFreezeStatus(freezeStatus).setUnfreezeDate(LocalDate.now());
+		// 更新主表冻结状态
+		return ResponseResultUtil.success(super.updateByUuid(freeze));
+
+	}
+
+	/**
 	 * @desc   : 获取冻结单信息(解冻用)
 	 * @author : 宋扬
 	 * @date   : 2024/3/19 15:29
@@ -253,7 +331,7 @@ public class FreezeService extends BaseService<Freeze> {
 		}
 		// 赋值冻结表状态和ID
 		Freeze freeze=new Freeze();
-		freeze.setFreezeId(id).setFreezeStatus(freezeStatus);
+		freeze.setFreezeId(id).setFreezeStatus(freezeStatus).setUnfreezeDate(LocalDate.now());
 		// 更新主表冻结状态
 		return ResponseResultUtil.success(super.updateByUuid(freeze));
 	}

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

@@ -203,14 +203,30 @@ public class InboundPurchaseService extends BaseService<Inbound> {
         //入库类型
         inboundVO.setIntoType(Constant.IntoType.SALE.getName());
         //自动入库标识
+//        if (inboundVO.getFlgAutoHandle()) {
+//            //已入库
+//            inboundVO.setIntoStatus(Constant.IntoStatus.YIRUKU.getName());
+//            //入库日期
+//            inboundVO.setIntoDate(inboundVO.getIntoDate() == null ? LocalDate.now() : inboundVO.getIntoDate());
+//        } else {
+//            //入库中
+//            inboundVO.setIntoStatus(Constant.IntoStatus.RUKUZHONG.getName());
+//        }
         if (inboundVO.getFlgAutoHandle()) {
+            if (inboundVO.getInboundProcessingFlag()) {
+                //已入库
+                inboundVO.setIntoStatus(Constant.IntoStatus.YIRUKU.getName());
+                //入库日期
+                inboundVO.setIntoDate(inboundVO.getIntoDate() == null ? LocalDate.now() : inboundVO.getIntoDate());
+            } else {
+                //入库中
+                inboundVO.setIntoStatus(Constant.IntoStatus.RUKUZHONG.getName());
+            }
+        } else {
             //已入库
             inboundVO.setIntoStatus(Constant.IntoStatus.YIRUKU.getName());
             //入库日期
             inboundVO.setIntoDate(inboundVO.getIntoDate() == null ? LocalDate.now() : inboundVO.getIntoDate());
-        } else {
-            //入库中
-            inboundVO.setIntoStatus(Constant.IntoStatus.RUKUZHONG.getName());
         }
         //入库状态等于已入库 更新合计入库数量/金额 = 入库中数量/入库中金额
         if (Constant.IntoStatus.YIRUKU.getName().equals(inboundVO.getIntoStatus())) {
@@ -229,8 +245,11 @@ public class InboundPurchaseService extends BaseService<Inbound> {
         inboundMapper.insert(inbound);
         //endregion
 
-        //region 采购总单
-        this.insertOrderMessageByEdit(inboundVO, inboundVO.getItemList());
+        if (inboundVO.getFromId() != null) {
+            //region 采购总单
+            this.insertOrderMessageByEdit(inboundVO, inboundVO.getItemList());
+        }
+
         //endregion
 
         //region 明细
@@ -1423,8 +1442,8 @@ public class InboundPurchaseService extends BaseService<Inbound> {
                 purchase.setPurId(fromId);
                 purchase.setIntoQty(purchaseSumQty);
                 purchase.setIntoAmt(purchaseSumAmt);
-                purchase.setIntoingAmt(updatePurchaseIntoingQty.negate());
-                purchase.setIntoingQty(updatePurchaseIntoingAmt.negate());
+                purchase.setIntoingAmt(updatePurchaseIntoingAmt.negate());
+                purchase.setIntoingQty(updatePurchaseIntoingQty.negate());
                 //入库状态
                 String purIntoStatus = this.setIntoStatus(purchaseResponse.getIntoingQty().add(purchase.getIntoingQty()),
                         purchaseResponse.getIntoQty().add(purchase.getIntoQty()), purchaseResponse.getSumQuantity());
@@ -1792,8 +1811,14 @@ public class InboundPurchaseService extends BaseService<Inbound> {
         }
         //已入库 数量>0 入库中数量=0
         else if (intoQty.compareTo(BigDecimal.ZERO) > 0 && intoingQty.compareTo(BigDecimal.ZERO) == 0) {
-            //已入库
-            intoStatus = Constant.IntoStatus.YIRUKU.getName();
+            if (sumQty.compareTo(intoQty.add(intoingQty)) == 0) {
+                //已入库
+                intoStatus = Constant.IntoStatus.YIRUKU.getName();
+            } else {
+                //入库中
+                intoStatus = Constant.IntoStatus.RUKUZHONG.getName();
+            }
+
         }
         return intoStatus;
     }

+ 3 - 1
src/main/java/com/dk/mdm/service/mac/ReceiptService.java

@@ -802,7 +802,7 @@ public class ReceiptService extends BaseService<RecPay> {
                         .setStaffId(recPayVO.getStaffId())
                         .setAccDate(recPayVO.getAccDate())
                         .setRecStatus(Constant.recStatuse.QUE_DING.getName())
-                        .setAmtPay(recPayItem.getAmtRec())
+                        .setAmtPay(recPayItem.getAmtPay())
                         .setBiznisType("t_mac_rec_pay_item")
                         .setBiznisId(recPayItem.getRpId())
                         .setBiznisNo(recPayVO.getRpNo())
@@ -839,6 +839,8 @@ public class ReceiptService extends BaseService<RecPay> {
                 .setObjectId(accountForUpdate.getObjectId());
         accountService.updateByUuid(accountUpdate);
         return ResponseResultUtil.success();
+
+
     }
 
 

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

@@ -340,7 +340,7 @@ public class CusFollowService extends BaseService<CusFollow> {
      * @date : 2022-06-29 14:22
      */
     @Transactional(rollbackFor = {Exception.class})
-    @XxlJob("customer-reminder")
+//    @XxlJob("customer-reminder")
     public ResponseResultVO customerReminder() {
         log.info("@XxlJob(\"customer-reminder\")");
         log.info("followPlan id: {}", XxlJobHelper.getJobParam());
@@ -384,7 +384,7 @@ public class CusFollowService extends BaseService<CusFollow> {
      * @date : 2022-06-29 14:22
      */
     @Transactional(rollbackFor = {Exception.class})
-    @XxlJob("plan-reminder")
+//    @XxlJob("plan-reminder")
     public void planReminder() {
         log.info("@XxlJob(\"plan-reminder\")");
         log.info("followPlan id: {}", XxlJobHelper.getJobParam());

+ 8 - 0
src/main/java/com/dk/mdm/service/mst/MoneyAccountService.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.dk.common.infrastructure.annotaiton.Pagination;
 import com.dk.common.infrastructure.constant.Constant;
 import com.dk.common.model.pojo.PageList;
+import com.dk.common.response.ResponseCodeEnum;
 import com.dk.common.response.ResponseResultUtil;
 import com.dk.common.response.ResponseResultVO;
 import com.dk.mdm.infrastructure.convert.mst.MoneyAccountConvert;
@@ -132,6 +133,13 @@ public class MoneyAccountService extends BaseService<MoneyAccount> {
 	public ResponseResultVO<?> insert(MoneyAccountVO moneyAccountVO) {
 		// 转化实体
 		MoneyAccount moneyAccount = moneyAccountConvert.convertToPo(moneyAccountVO);
+		// 资金账户账户名称在同一公司先应该唯一,不能重复,后台新建编辑方法要校验
+        if(moneyAccount.getMacName()!=null){
+			List<MoneyAccountResponse> itemList = moneyAccountMapper.selectByCond(new MoneyAccountQuery().setMacName(moneyAccount.getMacName()).setCpId(authUtils.getStaff().getCpId()).setFlgValid(true));
+			if(itemList.size()>0){
+				return ResponseResultUtil.error( 666, "资金账户名称已存在");
+			}
+		}
 		// 赋值期初
 		moneyAccount.setBalance(moneyAccountVO.getInitBalance());
 		// 获取编码和主键UuId

+ 46 - 31
src/main/java/com/dk/mdm/service/mst/StaffService.java

@@ -25,11 +25,13 @@ import com.dk.common.service.BaseService;
 import com.dk.common.mapper.BaseMapper;
 import com.dk.mdm.model.query.ivt.InboundItemQuery;
 import com.dk.mdm.model.query.mst.ComMenuQuery;
+import com.dk.mdm.model.query.mst.DictionaryDataQuery;
 import com.dk.mdm.model.query.mst.GoodsCategoryQuery;
 import com.dk.mdm.model.query.mst.StaffQuery;
 import com.dk.common.model.response.mst.StaffResponse;
 import com.dk.common.model.vo.mst.StaffVO;
 import com.dk.mdm.model.response.mst.ComMenuResponse;
+import com.dk.mdm.model.response.mst.DictionaryDataResponse;
 import com.dk.mdm.model.vo.mst.ComMenuVO;
 import com.dk.mdm.service.common.CommonService;
 import lombok.extern.slf4j.Slf4j;
@@ -216,14 +218,14 @@ public class StaffService extends BaseService<Staff> {
                         ErrorCodeEnum.USER_REGISTER_ERROR.getMessage());
             } else {
                 Map<String, Object> mp = (Map<String, Object>) resultMaxnum.getData();
-                int intWebMaxnum =0;
-                if(mp.get("web_max_num") != null ){
-                    intWebMaxnum =  Integer.parseInt(mp.get("web_max_num") + "");
+                int intWebMaxnum = 0;
+                if (mp.get("web_max_num") != null) {
+                    intWebMaxnum = Integer.parseInt(mp.get("web_max_num") + "");
                 }
 
                 int intWxMaxnum = 0;
-                if(mp.get("wx_max_num") != null ){
-                    intWxMaxnum =  Integer.parseInt(mp.get("wx_max_num") + "");
+                if (mp.get("wx_max_num") != null) {
+                    intWxMaxnum = Integer.parseInt(mp.get("wx_max_num") + "");
                 }
                 staffQuery = new StaffQuery();
                 staffQuery.setFlgCanLogin(true);
@@ -418,7 +420,7 @@ public class StaffService extends BaseService<Staff> {
                 role.setFlgNolimitFun(true);
                 role.setFlgNolimitPvw(true);
                 role.setFlgNolimitSen(true);
-            }else{
+            } else {
                 role.setFlgNolimitFun(false);
                 role.setFlgNolimitPvw(false);
                 role.setFlgNolimitSen(false);
@@ -480,6 +482,9 @@ public class StaffService extends BaseService<Staff> {
             for (int i = 0; i < listDictionaryDatas.size(); i++) {
                 Map<String, Object> m = listDictionaryDatas.get(i);
                 DictionaryData dictionaryData = new DictionaryData();
+//                Map<String, Object> codeMap = commonService.getUniqueNoteCode(Constant.docNameConstant.DICTIONARYDATA.getName(),cpId, true);
+//                // 获取编码和主键UuId  codeMap.get("outId").toString()
+                dictionaryData.setDataId(UUID.randomUUID().toString());
                 dictionaryData.setDictCode(m.get("dictCode").toString());
                 dictionaryData.setDataCode(m.get("dataCode").toString());
                 dictionaryData.setDataValue(m.get("dataValue").toString());
@@ -501,8 +506,18 @@ public class StaffService extends BaseService<Staff> {
                 MoneyAccount moneyAccount = new MoneyAccount();
                 moneyAccount.setMacCode(m.get("macCode").toString());
                 moneyAccount.setMacName(m.get("macName").toString());
-                moneyAccount.setMacType(m.get("macType").toString());
-                moneyAccount.setAccDate(LocalDate.parse(m.get("accDate").toString()));
+//               从上面数据字典中查询 新的id 240814
+                List<DictionaryData> dictionaryDatas = listDD.stream().filter(it ->
+                        "基础资料-账户".equals(it.getDictCode()) && (m.get("macName") + "").equals(it.getDataValue())
+                ).collect(Collectors.toList());
+
+                if (dictionaryDatas != null && dictionaryDatas.size() > 0) {
+                    moneyAccount.setMacType(dictionaryDatas.get(0).getDataId());
+                } else {
+                    // 该值不正确  要清洗数据
+                    moneyAccount.setMacType(m.get("macType").toString());
+                }
+                moneyAccount.setAccDate(LocalDate.now());
 //                moneyAccount.setBalance((BigDecimal) m.get("balance"));
                 moneyAccount.setBalance(new BigDecimal(m.get("balance").toString()));
                 moneyAccount.setFlgDefault((Boolean) m.get("flgDefault"));
@@ -556,7 +571,7 @@ public class StaffService extends BaseService<Staff> {
                 goodsCategoryMapper.insert(goodsCategory);
                 listG = new ArrayList<>();
                 // 插入子级
-                for(Map<String, Object> c : childList){
+                for (Map<String, Object> c : childList) {
                     GoodsCategory gc = new GoodsCategory();
                     gc.setCatCode(c.get("catCode") + "");
                     gc.setCatName(c.get("catName") + "");
@@ -566,8 +581,9 @@ public class StaffService extends BaseService<Staff> {
                     gc.setCpId(cpId);
                     gc.setOpCreateUserId(staffId);
                     listG.add(gc);
-                };
-                if(listG != null && listG.size() > 0){
+                }
+                ;
+                if (listG != null && listG.size() > 0) {
                     goodsCategoryMapper.insertBatch(listG);
                 }
             }
@@ -676,14 +692,14 @@ public class StaffService extends BaseService<Staff> {
             } else {
                 if (staffResponseOld.getFlgCanLogin() != staffVO.getFlgCanLogin()) {
                     Map<String, Object> mp = (Map<String, Object>) resultMaxnum.getData();
-                    int intWebMaxnum =0;
-                    if(mp.get("web_max_num") != null ){
-                        intWebMaxnum =  Integer.parseInt(mp.get("web_max_num") + "");
+                    int intWebMaxnum = 0;
+                    if (mp.get("web_max_num") != null) {
+                        intWebMaxnum = Integer.parseInt(mp.get("web_max_num") + "");
                     }
 
                     int intWxMaxnum = 0;
-                    if(mp.get("wx_max_num") != null ){
-                        intWxMaxnum =  Integer.parseInt(mp.get("wx_max_num") + "");
+                    if (mp.get("wx_max_num") != null) {
+                        intWxMaxnum = Integer.parseInt(mp.get("wx_max_num") + "");
                     }
                     StaffQuery staffQueryf = new StaffQuery();
                     staffQueryf.setFlgCanLogin(true);
@@ -748,7 +764,7 @@ public class StaffService extends BaseService<Staff> {
      * @author : 姜永辉
      * @date : 2023/1/9 10:49
      */
-    @Transactional(rollbackFor = {Exception.class} )
+    @Transactional(rollbackFor = {Exception.class})
     public ResponseResultVO<Boolean> updateFeignStaffFlgCanLogin(List<String> list) {
         //  FlgCanLogin  登录系统(1:PC端,2:移动端,3:PC+移动端, 4:无)
         staffMapper.updateFeignStaffFlgCanLogin(list);
@@ -915,9 +931,9 @@ public class StaffService extends BaseService<Staff> {
 
 
     /**
-     * @desc   : 生成幽灵标识的数据
+     * @desc : 生成幽灵标识的数据
      * @author : 常皓宁
-     * @date   : 2024/6/19 10:53
+     * @date : 2024/6/19 10:53
      */
     @Transactional(
             rollbackFor = {Exception.class}
@@ -930,9 +946,9 @@ public class StaffService extends BaseService<Staff> {
         staffQuery.setCpId(staff.getCpId());
         List<StaffResponse> staffResponses = staffMapper.selectByCond(staffQuery);
         if (staffResponses == null || staffResponses.size() == 0) {
-            return ResponseResultUtil.error(-200,"绑定员工不存在");
-        }else {
-            for (StaffResponse staffResponse:staffResponses){
+            return ResponseResultUtil.error(-200, "绑定员工不存在");
+        } else {
+            for (StaffResponse staffResponse : staffResponses) {
                 // 获取编码和主键UuId
                 Map<String, Object> codeMap = commonService.getUniqueNoteCode(
                         Constant.docNameConstant.STAFF.getName(), staff.getCpId(), true);
@@ -955,9 +971,9 @@ public class StaffService extends BaseService<Staff> {
     }
 
     /**
-     * @desc   : 删除幽灵标识数据
+     * @desc : 删除幽灵标识数据
      * @author : 常皓宁
-     * @date   : 2024/6/19 10:53
+     * @date : 2024/6/19 10:53
      */
     @Transactional(
             rollbackFor = {Exception.class}
@@ -970,22 +986,21 @@ public class StaffService extends BaseService<Staff> {
         staffQuery.setStaffPhone(staff.getStaffPhone());
         staffQuery.setCpId(staff.getCpId());
         int a = staffMapper.deleteGhostStaff(staffQuery);
-        if (a > 0){
+        if (a > 0) {
             return ResponseResultUtil.success();
-        }
-        else{
-            return ResponseResultUtil.error(-200,"绑定员工不存在");
+        } else {
+            return ResponseResultUtil.error(-200, "绑定员工不存在");
         }
     }
 
     /**
-     * @desc   : 更新负责人标识
+     * @desc : 更新负责人标识
      * @author : 刘尧
-     * @date   : 2024/6/21 16:24
+     * @date : 2024/6/21 16:24
      */
     public ResponseResultVO updateFlgInit(Map<String, Object> params) {
         boolean updateBool = staffMapper.updateFlgInit(params);
-        if (updateBool){
+        if (updateBool) {
             updateBool = staffMapper.updateFlgInitById(String.valueOf(params.get("owner")));
             return ResponseResultUtil.success(updateBool);
         }

+ 352 - 0
src/main/java/com/dk/mdm/service/xxl/XxlService.java

@@ -0,0 +1,352 @@
+package com.dk.mdm.service.xxl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.dk.common.infrastructure.constant.Constant;
+import com.dk.common.infrastructure.xxl.XxlJobUtils;
+import com.dk.common.mapper.BaseMapper;
+import com.dk.common.model.response.mst.StaffResponse;
+import com.dk.common.response.ResponseCodeEnum;
+import com.dk.common.response.ResponseResultVO;
+import com.dk.common.service.BaseService;
+import com.dk.common.util.HttpUtils;
+import com.dk.mdm.feign.UserFeign;
+import com.dk.mdm.infrastructure.config.Config;
+import com.dk.mdm.mapper.mst.CusFollowMapper;
+import com.dk.mdm.mapper.mst.CustomerMapper;
+import com.dk.mdm.mapper.mst.FollowPlanMapper;
+import com.dk.mdm.mapper.mst.StaffMapper;
+import com.dk.mdm.model.pojo.mst.CusFollow;
+import com.dk.mdm.model.pojo.mst.Customer;
+import com.dk.mdm.model.pojo.mst.FollowPlan;
+import com.dk.mdm.model.query.mst.CustomerQuery;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+@Slf4j
+@Service
+public class XxlService extends BaseService<CusFollow> {
+    @Override
+    public BaseMapper<CusFollow> getRepository() {
+        return cusFollowMapper;
+    }
+
+    @Autowired
+    private CustomerMapper customerMapper;
+    @Autowired
+    private StaffMapper staffMapper;
+    @Autowired
+    private CusFollowMapper cusFollowMapper;
+    @Autowired
+    private FollowPlanMapper followPlanMapper;
+    @Autowired
+    private XxlJobUtils xxlJobUtils;
+    @Autowired
+    private Config config;
+    @Resource
+    private UserFeign userFeign;
+
+    /**
+     * @desc : 客户跟进提醒回调
+     * @author : 姜永辉
+     * @date : 2022-06-29 14:22
+     */
+    @Transactional(rollbackFor = {Exception.class})
+    @XxlJob("customer-reminder")
+    public ResponseResultVO customerReminder() {
+        log.info("@XxlJob(\"customer-reminder\")");
+        log.info("followPlan id: {}", 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 {
+                    //发消息
+                    String msg = sendFollowMessage(follow, followPlan);
+                    if (msg == null) {
+                        plan.setCallStatus(Constant.CallStatus.CALL_STATUS_DONE.getName() + "");
+                    } else {
+                        plan.setCallStatus(Constant.CallStatus.CALL_STATUS_ERROR.getName() + "").setRemarks(msg);
+                    }
+
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    log.error("客户跟进发送消息异常:{}", e.getMessage());
+                    plan.setCallStatus(Constant.CallStatus.CALL_STATUS_ERROR.getName() + "").setRemarks(e.getMessage());
+                }
+
+                //修改状态
+                followPlanMapper.update(plan,
+                        new UpdateWrapper<FollowPlan>().lambda()
+                                .eq(FollowPlan::getPlanId, UUID.fromString(plan.getPlanId())));
+
+                //删除任务
+                xxlJobUtils.delete(followPlan.getXxlJobId());
+            }
+
+        }
+        return null;
+    }
+
+    /**
+     * @desc : 客户计划任务提醒回调
+     * @author : jyh
+     * @date : 2022-06-29 14:22
+     */
+    @Transactional(rollbackFor = {Exception.class})
+    @XxlJob("plan-reminder")
+    public void planReminder() {
+        log.info("@XxlJob(\"plan-reminder\")");
+        log.info("followPlan id: {}", 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 {
+                //发消息
+                String msg = sendFollowPlanMessage(followPlan);
+                if (msg == null) {
+                    plan.setCallStatus(Constant.CallStatus.CALL_STATUS_DONE.getName() + "");
+                } else {
+                    plan.setCallStatus(Constant.CallStatus.CALL_STATUS_ERROR.getName() + "").setRemarks(msg);
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+                log.error("跟进任务发送消息异常:{}", e.getMessage());
+                plan.setCallStatus(Constant.CallStatus.CALL_STATUS_ERROR.getName() + "").setRemarks(e.getMessage());
+            }
+            //修改状态
+            followPlanMapper.updateById(plan);
+            //删除任务
+            xxlJobUtils.delete(followPlan.getXxlJobId());
+
+        }
+    }
+
+    /**
+     * @desc : 发送跟进任务消息
+     * @author : 姜永辉
+     * @date : 2022-06-30 19:24
+     */
+    public String sendFollowPlanMessage(FollowPlan followPlan) {
+        log.info("sendFollowMessage:{}", JSONObject.toJSONString(followPlan));
+        // 跟进人
+        StaffResponse followStaff = staffMapper.selectById(followPlan.getFollowUser());
+
+        Customer customer = customerMapper.selectById(new CustomerQuery().setCusId(followPlan.getCusId()));
+
+        if (customer != null) {
+            // 小程序消息
+
+
+            return null;
+        } else {
+            return ResponseCodeEnum.SELECT_NULL.getMessage();
+        }
+    }
+
+    /**
+     * @desc : 发送跟进消息
+     * @author : 姜永辉
+     * @date : 2022-05-27 09:34
+     */
+    public String sendFollowMessage(CusFollow follow, FollowPlan followPlan) {
+        log.info("sendFollowMessage:{}", JSONObject.toJSONString(follow));
+        // 跟进人
+        StaffResponse followStaff = null;
+        // 当跟进计划状态为跟尺时 获取设计师信息
+        if (follow.getFollowStatus().equals("跟进状态-约尺")) {
+            followStaff = staffMapper.selectById(follow.getDesignStaff());
+        } else {
+            followStaff = staffMapper.selectById(followPlan.getFollowUser());
+        }
+        //查到跟进人
+        if (followStaff != null) {
+            log.info("sendFollowMessage:{}", JSONObject.toJSONString(followStaff));
+            Customer customer = customerMapper.selectById(follow.getCusId());
+            log.info("customer:{}", JSONObject.toJSONString(customer));
+            Map<String, Object> otherParamMap = new HashMap<>();
+            if (customer != null) {
+                if (follow.getFollowStatus().equals("跟进状态-约尺")) {
+//                    customer.setStaffName(followStaff.getStaffName());
+//                    // 暂时用最后一次 跟进id传过去
+//                    customer.setLastFollowId(follow.getFollowId());
+                    otherParamMap.put("staffName", followStaff.getStaffName());
+                    otherParamMap.put("followId", follow.getFollowId());
+                }
+                String loginType = "4";
+//                List<String> list = new ArrayList<>();
+                Map<String, String> keywordMap = new HashMap<>();
+                if (Constant.BasicDataConstant.FOLLOW_STATUS_4.getValue().equals(follow.getFollowStatus()) ||
+                        Constant.BasicDataConstant.FOLLOW_STATUS_1.getValue().equals(follow.getFollowStatus()) ||
+                        Constant.BasicDataConstant.FOLLOW_STATUS_5.getValue().equals(follow.getFollowStatus())) {
+//                    list.add("您有客户需要跟进");
+                    keywordMap.put("remark", "您有客户需要跟进");
+                    loginType = "4";
+
+                } else if (Constant.BasicDataConstant.FOLLOW_STATUS_6.getValue().equals(follow.getFollowStatus())) {
+//                    list.add("您有客户需要量尺服务");
+                    keywordMap.put("remark", "您有客户需要量尺服务");
+                    loginType = "6";
+
+                } else if (Constant.BasicDataConstant.FOLLOW_STATUS_2.getValue().equals(follow.getFollowStatus())) {
+//                    list.add("您有客户邀约进店");
+                    keywordMap.put("remark", "您有客户邀约进店");
+                    loginType = "2";
+
+                } else if (Constant.BasicDataConstant.FOLLOW_STATUS_3.getValue().equals(follow.getFollowStatus())) {
+//                    list.add("您有客户需要约尺服务");
+                    keywordMap.put("remark", "您有客户需要约尺服务");
+                    loginType = "3";
+                }
+//                list.add(customer.getCusName());
+//                list.add(customer.getCusPhone());
+                LocalDateTime followTime = follow.getFollowTime();
+                DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+                keywordMap.put("cusName", customer.getCusName());
+                keywordMap.put("cusPhone", customer.getCusPhone());
+                keywordMap.put("followTime", followTime.format(formatter));
+                // 查询跟进人的openid和publicOpenId   7.19 加了userWxId 刘尧
+                ResponseResultVO<?> resultVO = userFeign.getUser(followStaff.getWxUserId());
+                // 如果没有成功返回,状态设置为待审
+                if (resultVO.getCode() != ResponseCodeEnum.SUCCESS.getCode()) {
+                    log.error("客户查询异常:为空{}", follow.getCusId());
+                    return ResponseCodeEnum.SELECT_NULL.getMessage();
+                } else {
+                    Map<String, Object> user = (Map<String, Object>) resultVO.getData();
+                    if (user != null) {
+                        // 发送消息
+                        Map<String, Object> mapMessage = new HashMap<>();
+                        mapMessage.put("loginType", loginType);
+                        otherParamMap.put("cusId", customer.getCusId());
+                        mapMessage.put("otherParam", JSONObject.toJSONString(otherParamMap));
+//                        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("remark", "客户跟进备注");
+//                      sendUniformMessage(mapMessage);
+                        List<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.get(0), data, mapMessage);
+                    }
+                }
+
+                return null;
+            } else {
+                log.error("客户查询异常:为空{}", follow.getCusId());
+                return ResponseCodeEnum.SELECT_NULL.getMessage();
+            }
+        } else {
+            log.error("跟进人异常:为空{}", followPlan.getFollowUser());
+            return ResponseCodeEnum.SELECT_NULL.getMessage();
+        }
+
+    }
+
+    /**
+     * @desc : 构造消息推送模板中data值
+     * @author : 刘尧
+     * @date : 2024-07-19 08:56
+     */
+    private static Map<String, Object> createDataItem(String name, String value) {
+        Map<String, Object> item = new HashMap<>();
+        item.put(name, value);
+        return item;
+    }
+
+
+    /**
+     * @desc : 向用户推送小程序订阅消息方法
+     * @author : 刘尧
+     * @date : 2024-07-19 08:56
+     */
+    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", messId);
+        // 点击模板卡片后的跳转页面
+        if (map.containsKey("otherParam")) {
+            params.put("page", "pages/welcome/welcome?loginType=" + map.get("loginType").toString() + "&otherParam=" + map.get("otherParam").toString());
+        } else {
+            params.put("page", "pages/welcome/welcome?loginType=" + map.get("loginType").toString());
+        }
+        // 接收者(用户)的 openid
+        params.put("touser", map.get("userWxId"));
+        // 跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;
+        params.put("miniprogram_state", "trial");
+        // 配置模板中明细值
+        params.put("data", data);
+
+        ResponseResultVO<JSONObject> post = HttpUtils.post("https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=" + wxToken, params);
+        return post;
+    }
+
+    /**
+     * @desc : 获取微信小程序后台Token
+     * @author : 刘尧
+     * @date : 2024-07-19 08:56
+     */
+    private String getWxToken() {
+        String appId = config.getAppId();
+        String appSecret = config.getAppSecret();
+        ResponseResultVO<JSONObject> tokenRes = HttpUtils.get("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + appId + "&secret=" + appSecret);
+        JSONObject data = tokenRes.getData();
+        return String.valueOf(data.get("access_token"));
+    }
+
+    /**
+     * @desc : 将字节转化为十六进制字符串
+     * @author : 刘尧
+     * @date : 2024-07-19 08:56
+     */
+    private static String byteToStr(byte[] byteArray) {
+        String strDigest = "";
+        for (int i = 0; i < byteArray.length; i++) {
+            strDigest += byteToHexStr(byteArray[i]);
+        }
+        return strDigest;
+    }
+
+    /**
+     * @desc : 将字节转换成对应的两位十六进制字符串
+     * @author : 刘尧
+     * @date : 2024-07-19 08:56
+     */
+    private static String byteToHexStr(byte mByte) {
+        char[] Digit = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A',
+                'B', 'C', 'D', 'E', 'F'};
+        char[] tempArr = new char[2];
+        tempArr[0] = Digit[(mByte >>> 4) & 0X0F];
+        tempArr[1] = Digit[mByte & 0X0F];
+        String s = new String(tempArr);
+        return s;
+    }
+
+}