浏览代码

逻辑完善

xdd 1 月之前
父节点
当前提交
43d3e72a49

+ 12 - 0
fs-service-system/src/main/java/com/fs/store/domain/FsCouponSchedule.java

@@ -58,6 +58,18 @@ public class FsCouponSchedule extends BaseEntity
     @Excel(name = "当前次数")
     private Long count;
 
+    /**
+     * 小程序跳转页面
+     */
+    @Excel(name = "小程序跳转页面")
+    private String page;
+
+    /**
+     * 优惠券备注信息
+     */
+    @Excel(name = "备注")
+    private String remark;
+
     /** 0待处理, 1正在处理, 2成功, -1失败, 3用户拒签或者退货 */
     @Excel(name = "0待处理, 1正在处理, 2成功, -1失败, 3用户拒签或者退货")
     private Integer status;

+ 3 - 7
fs-service-system/src/main/java/com/fs/store/service/impl/FsCouponScheduleServiceImpl.java

@@ -73,11 +73,6 @@ public class FsCouponScheduleServiceImpl implements IFsCouponScheduleService
      */
     private final String WX_MINI_APP_NOTIFY_TEMPLATE_ID = "5ZSzz2nPmJo9EuenZa78mQPScoOMc84LnEfEpV0-i04";
 
-    /**
-     * 小程序消息通知跳转URL
-     */
-    private final String WX_MINI_APP_NOTIFY_GOTO_URL ="";
-
     /**
      * 查询定时发放优惠券队列
      *
@@ -243,7 +238,8 @@ public class FsCouponScheduleServiceImpl implements IFsCouponScheduleService
                 FsUser fsUser = fsUserMapper.selectFsUserById(fsCouponSchedule.getUserId());
                 String maOpenId = fsUser.getMaOpenId();
                 notifyTask.setTouser(maOpenId);
-                notifyTask.setPage(WX_MINI_APP_NOTIFY_GOTO_URL);
+                notifyTask.setPage(fsCouponSchedule.getPage());
+
                 notifyTask.setCreateTime(LocalDateTime.now());
                 // 状态等待执行
                 notifyTask.setStatus(MiniAppNotifyTaskStatusEnum.WAITING.getValue());
@@ -280,7 +276,7 @@ public class FsCouponScheduleServiceImpl implements IFsCouponScheduleService
                 }
                 // 备注消息
                 TemplateMessageSendRequestDTO.TemplateDataValue couponMark = new TemplateMessageSendRequestDTO.TemplateDataValue();
-                couponMark.setValue("无");
+                couponMark.setValue(fsCouponSchedule.getRemark());
 
                 // 面值
                 TemplateMessageSendRequestDTO.TemplateDataValue couponPrice = new TemplateMessageSendRequestDTO.TemplateDataValue();

+ 2 - 0
fs-service-system/src/main/java/com/fs/store/service/impl/FsStoreOrderServiceImpl.java

@@ -1388,6 +1388,8 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
                     fsCouponSchedule.setSetmealTitle(fsStoreProductPackage.getTitle());
                     fsCouponSchedule.setMonth(fsStoreProductPackage.getIcgMonth().longValue());
                     fsCouponSchedule.setCount(0L);
+                    fsCouponSchedule.setPage(fsStoreProductPackage.getIcgUrl());
+                    fsCouponSchedule.setRemark(fsStoreProductPackage.getIcgMark());
                     fsCouponSchedule.setStatus(IcgProcessStatusEnum.PENDING.getCode());
                     fsCouponSchedule.setOrderTime(LocalDateTime.now());
                     fsCouponSchedule.setUserId(order.getUserId());

+ 8 - 1
fs-service-system/src/main/resources/mapper/store/FsCouponScheduleMapper.xml

@@ -24,10 +24,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="retryCount"    column="retry_count"    />
         <result property="maxRetries"    column="max_retries"    />
         <result property="remark"    column="remark"    />
+        <result property="page" column="page"/>
     </resultMap>
 
     <sql id="selectFsCouponScheduleVo">
-        select id, user_id, order_id, setmeal_id, month, count, status, create_time, create_by, update_time, update_by, order_time, coupon_id as coupon_ids, send_time, actual_send_time, error_message, retry_count, max_retries,  remark from fs_coupon_schedule
+        select id, user_id, order_id, setmeal_id, month, count, status, create_time, create_by, update_time, update_by, order_time, coupon_id as coupon_ids, send_time, actual_send_time, error_message, retry_count, max_retries,  remark,page from fs_coupon_schedule
     </sql>
 
     <select id="selectFsCouponScheduleList" parameterType="FsCouponSchedule" resultMap="FsCouponScheduleResult">
@@ -46,6 +47,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="errorMessage != null  and errorMessage != ''"> and error_message = #{errorMessage}</if>
             <if test="retryCount != null "> and retry_count = #{retryCount}</if>
             <if test="maxRetries != null "> and max_retries = #{maxRetries}</if>
+            <if test="remark != null "> and remark = #{remark}</if>
+            <if test="page != null "> and page = #{page}</if>
         </where>
     </select>
 
@@ -86,6 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="retryCount != null">retry_count,</if>
             <if test="maxRetries != null">max_retries,</if>
             <if test="remark != null">remark,</if>
+            <if test="page != null">page,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="userId != null">#{userId},</if>
@@ -106,6 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="retryCount != null">#{retryCount},</if>
             <if test="maxRetries != null">#{maxRetries},</if>
             <if test="remark != null">#{remark},</if>
+            <if test="page != null">#{page},</if>
          </trim>
     </insert>
 
@@ -130,6 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="retryCount != null">retry_count = #{retryCount},</if>
             <if test="maxRetries != null">max_retries = #{maxRetries},</if>
             <if test="remark != null">remark = #{remark},</if>
+            <if test="page != null">page = #{page},</if>
         </trim>
         where id = #{id}
     </update>
@@ -155,6 +161,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 <if test="item.retryCount != null">retry_count = #{item.retryCount},</if>
                 <if test="item.maxRetries != null">max_retries = #{item.maxRetries},</if>
                 <if test="item.remark != null">remark = #{item.remark},</if>
+                <if test="item.page != null">page = #{item.page},</if>
             </trim>
             where id = #{item.id}
         </foreach>