Sfoglia il codice sorgente

套餐表新增小程序跳转url、小程序优惠券备注信息

xdd 2 mesi fa
parent
commit
7f99a3ce21

+ 5 - 2
fs-admin/pom.xml

@@ -138,8 +138,11 @@
             <version>1.7.30</version>
             <scope>provided</scope>
         </dependency>
-
-
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
 
     </dependencies>
 

+ 1 - 1
fs-admin/src/main/java/com/fs/store/controller/FsStorePaymentController.java

@@ -122,7 +122,7 @@ public class FsStorePaymentController extends BaseController
 
 
     @ApiOperation("支付手动通知")
-    @PreAuthorize("@ss.hasPermi('store:storePayment:payNotify')")
+//    @PreAuthorize("@ss.hasPermi('store:storePayment:payNotify')")
     @PostMapping("/returnPayStatus")
     public R returnPayStatus(@RequestBody FsStorePayment fsStorePayment) throws Exception
     {

+ 4 - 4
fs-admin/src/main/java/com/fs/task/MiniProgramSubTask.java

@@ -60,7 +60,7 @@ public class MiniProgramSubTask {
             ClientCredGrantReqDTO clientCredGrantReqDTO = new ClientCredGrantReqDTO();
             clientCredGrantReqDTO.setAppid(config.getAppid());
             clientCredGrantReqDTO.setSecret(config.getSecret());
-            clientCredGrantReqDTO.setGrantType("client_credential");
+            clientCredGrantReqDTO.setGrant_type("client_credential");
 
            try{
                // 获取accessToken
@@ -71,10 +71,10 @@ public class MiniProgramSubTask {
 
                // 调用微信小程序订阅通知
                TemplateMessageSendRequestDTO sendRequestDTO = new TemplateMessageSendRequestDTO();
-               sendRequestDTO.setTemplateId(pendingDatum.getTemplateId());
+               sendRequestDTO.setTemplate_id(pendingDatum.getTemplateId());
                sendRequestDTO.setTouser(pendingDatum.getTouser());
                sendRequestDTO.setPage(pendingDatum.getPage());
-               TypeReference<Map<String, TemplateMessageSendRequestDTO.TemplateDataValue>> typeReference = new TypeReference(){};
+               TypeReference<Map<String, TemplateMessageSendRequestDTO.TemplateDataValue>> typeReference = new TypeReference<Map<String, TemplateMessageSendRequestDTO.TemplateDataValue>>() {};
                sendRequestDTO.setData(JSONObject.parseObject(pendingDatum.getData(),typeReference));
                MiniGramSubsMsgResultDTO miniGramSubsMsgResultDTO = wechatMiniProgrService.sendSubscribeMsg(accessToken, sendRequestDTO);
                pendingDatum.setRequestBody(JSONObject.toJSONString(sendRequestDTO));
@@ -89,7 +89,7 @@ public class MiniProgramSubTask {
                    pendingDatum.setErrorMessage(JSONObject.toJSONString(miniGramSubsMsgResultDTO));
                    pendingDatum.setRetryCount(pendingDatum.getRetryCount() +1);
                }
-           }catch (Exception e){
+           }catch (Throwable e){
                // 更新任务状态为执行失败
                pendingDatum.setStatus(MiniAppNotifyTaskStatusEnum.FAILED.getValue());
                pendingDatum.setErrorMessage(ExceptionUtils.getStackTrace(e));

+ 103 - 0
fs-admin/src/test/java/com/fs/store/controller/FsStorePaymentControllerTest.java

@@ -0,0 +1,103 @@
+package com.fs.store.controller;
+
+import com.fs.FSAdminApplication;
+import com.fs.common.core.domain.R;
+import com.fs.store.domain.FsCouponSchedule;
+import com.fs.store.domain.FsMiniprogramSubNotifyTask;
+import com.fs.store.domain.FsStorePayment;
+import com.fs.store.enums.IcgProcessStatusEnum;
+import com.fs.store.mapper.FsMiniprogramSubNotifyTaskMapper;
+import com.fs.store.service.IFsCouponScheduleService;
+import com.fs.task.MiniProgramSubTask;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
+import org.springframework.security.core.context.SecurityContextHolder;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.Collections;
+import java.util.Date;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = FSAdminApplication.class)
+@RequiredArgsConstructor
+@Slf4j
+public class FsStorePaymentControllerTest {
+
+    @Autowired
+    private FsStorePaymentController fsStorePaymentController;
+
+    @Autowired
+    private IFsCouponScheduleService fsCouponScheduleService;
+
+    @Autowired
+    private MiniProgramSubTask miniProgramSubTask;
+    @Test
+    public void returnPayStatus() throws Exception {
+
+        Authentication authentication = new UsernamePasswordAuthenticationToken(
+                "admin",
+                "sadmin#258",
+                Collections.singletonList(new SimpleGrantedAuthority("ADMIN"))
+        );
+
+        // Set the Authentication in the SecurityContext
+        SecurityContextHolder.getContext().setAuthentication(authentication);
+
+
+        FsStorePayment fsStorePayment = new FsStorePayment();
+        fsStorePayment.setPaymentId(01L);
+        fsStorePayment.setStatus(1);
+        fsStorePayment.setOrderId(1899279950347763712L);
+        fsStorePayment.setPayTypeCode("weixin");
+        fsStorePayment.setPayMoney(new BigDecimal("0.01"));
+        fsStorePayment.setPayTime(new Date());
+        fsStorePayment.setTradeNo("002900TOP3B250311101453P779ac1369bc00000");
+        fsStorePayment.setUserId(520391L);
+        fsStorePayment.setOpenId("obmfC6y5ZOuvq9b4UlL7GUayuYQE");
+        fsStorePayment.setCompanyId(12L);
+        fsStorePayment.setCompanyUserId(42L);
+        fsStorePayment.setDeptId(144L);
+        fsStorePayment.setBankSerialNo("1899279950347763712L");
+        fsStorePayment.setPayMode("hf");
+        R r = fsStorePaymentController.returnPayStatus(fsStorePayment);
+    }
+
+    @Test
+    public void test() throws Exception {
+        FsCouponSchedule fsCouponSchedule = new FsCouponSchedule();
+        fsCouponSchedule.setOrderId(1899279950347763712L);
+        fsCouponSchedule.setSetmealId(1800L);
+        fsCouponSchedule.setSetmealTitle("甘草干姜汤(北京同仁堂)1盒");
+        fsCouponSchedule.setMonth(4L);
+        fsCouponSchedule.setCount(0L);
+        fsCouponSchedule.setStatus(IcgProcessStatusEnum.PENDING.getCode());
+        fsCouponSchedule.setOrderTime(LocalDateTime.now());
+        fsCouponSchedule.setUserId(520391L);
+        // 如果上次发送时间为空,那么预计发送时间等于=下单时间+1月
+        fsCouponSchedule.setSendTime(fsCouponSchedule.getOrderTime().plusMonths(1L));
+        fsCouponSchedule.setRetryCount(0);
+
+        fsCouponScheduleService.insertFsCouponSchedule(fsCouponSchedule);
+    }
+
+    @Test
+    public void issueCoupon() throws Exception {
+        fsCouponScheduleService.issueCoupon();
+    }
+
+    @Test
+    public void notifyMiniAppSub(){
+        miniProgramSubTask.notifyMiniAppSub();
+    }
+
+
+}

+ 7 - 2
fs-service-system/src/main/java/com/fs/store/domain/FsCouponSchedule.java

@@ -4,6 +4,7 @@ import java.time.LocalDateTime;
 import java.util.Date;
 import java.util.HashSet;
 import java.util.Set;
+import java.util.stream.Collectors;
 
 import cn.hutool.core.util.ObjectUtil;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -11,6 +12,7 @@ import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntity;
 import com.hc.openapi.tool.util.StringUtils;
 import lombok.Data;
+import org.apache.commons.collections4.CollectionUtils;
 
 /**
  * 定时发放优惠券队列对象 fs_coupon_schedule
@@ -86,9 +88,12 @@ public class FsCouponSchedule extends BaseEntity
     }
 
     public String getCouponIds() {
-        if(ObjectUtil.isNotNull(couponId)){
-            couponIds=String.join(",", couponId.toString());
+        if(CollectionUtils.isNotEmpty(couponId)){
+            couponIds = couponId.stream()
+                    .map(String::valueOf)
+                    .collect(Collectors.joining(","));
         }
+
         return couponIds;
     }
 

+ 11 - 0
fs-service-system/src/main/java/com/fs/store/domain/FsStoreProductPackage.java

@@ -118,6 +118,17 @@ public class FsStoreProductPackage extends BaseEntity
         return icgCouponsId;
     }
 
+
+    /**
+     * 分期赠送优惠券-url配置
+     */
+    private String icgUrl;
+
+    /**
+     * 分期赠送优惠券-备注
+     */
+    private String icgMark;
+
     List<StoreOrderProductDTO> productList;
 
 }

+ 1 - 1
fs-service-system/src/main/java/com/fs/store/dto/ClientCredGrantReqDTO.java

@@ -23,7 +23,7 @@ public class ClientCredGrantReqDTO implements Serializable {
      * 固定值 "client_credential",表示客户端凭证授权模式。
      * </p>
      */
-    private String grantType;
+    private String grant_type;
 
     /**
      * 应用ID

+ 1 - 1
fs-service-system/src/main/java/com/fs/store/dto/TemplateMessageSendRequestDTO.java

@@ -30,7 +30,7 @@ public class TemplateMessageSendRequestDTO {
      * 所需下发的模板消息的id。
      * </p>
      */
-    private String templateId;
+    private String template_id;
 
     /**
      * 跳转页面

+ 3 - 0
fs-service-system/src/main/java/com/fs/store/dto/WeXinAccessTokenDTO.java

@@ -30,4 +30,7 @@ public class WeXinAccessTokenDTO {
      * </p>
      */
     private Integer expiresIn;
+
+    private Long errcode;
+    private String errmsg;
 }

+ 2 - 1
fs-service-system/src/main/java/com/fs/store/enums/IcgProcessStatusEnum.java

@@ -11,7 +11,8 @@ public enum IcgProcessStatusEnum {
     PROCESSING(1, "正在处理"),
     SUCCESS(2, "成功"),
     FAILED(-1, "失败"),
-    REJECTED_OR_RETURNED(3, "用户拒签或者退货");
+    REJECTED_OR_RETURNED(3, "用户拒签或者退货"),
+    FINISHED(4, "已完成");
 
     private final Integer code;
     private final String description;

+ 2 - 2
fs-service-system/src/main/java/com/fs/store/service/IFsStoreCouponIssueService.java

@@ -78,8 +78,8 @@ public interface IFsStoreCouponIssueService
 
     /**
      * 查询优惠券领取列表
-     * @param ids
-     * @return
+     * @param couponId
+     * @return FsStoreCouponIssue
      */
     FsStoreCouponIssue selectFsStoreCouponIssueByCouponId(Long couponId);
 }

+ 35 - 18
fs-service-system/src/main/java/com/fs/store/service/impl/FsCouponScheduleServiceImpl.java

@@ -171,6 +171,7 @@ public class FsCouponScheduleServiceImpl implements IFsCouponScheduleService
      * 发放优惠券
      */
     @Override
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     public void issueCoupon() {
         List<FsCouponSchedule> fsCouponSchedules = fsCouponScheduleMapper.selectPendingCouponList();
         List<FsCouponScheduleLog> logList = new ArrayList<>();
@@ -188,17 +189,28 @@ public class FsCouponScheduleServiceImpl implements IFsCouponScheduleService
             scheduleLog.setRetryCountBefore(fsCouponSchedule.getRetryCount());
             scheduleLog.setOperator("SYSTEM");
             scheduleLog.setOperationTime(LocalDateTime.now());
-
-            FsStoreCouponReceiveParam param = new FsStoreCouponReceiveParam();
+            // 获取优惠券名称
+            Set<Long> couponIds = fsCouponSchedule.getCouponId();
+            if(CollectionUtils.isEmpty(couponIds)){
+                log.info("当前优惠券没有被选择!已经跳过");
+                continue;
+            }
+            // 优惠券id (有多张这里只取第一张)
+            Long couponId = couponIds.stream().findFirst().get();
+            // 找到该优惠券
+            FsStoreCouponIssue fsStoreCouponIssue = fsStoreCouponIssueService.selectFsStoreCouponIssueByCouponId(couponId);
             Long userId = fsCouponSchedule.getUserId();
             // 领取优惠券
+            FsStoreCouponReceiveParam param = new FsStoreCouponReceiveParam();
+            param.setId(fsStoreCouponIssue.getId());
             R receive = fsStoreCouponIssueService.receive(String.valueOf(userId), param);
+
             Set<String> operationTypeSet = new HashSet<>();
             if(fsCouponSchedule.getRetryCount()>0) {
                 operationTypeSet.add(IcgScheduleOperationTypeEnum.RETRY.getCode());
             }
             // 如果不等于200表示失败了
-            if(ObjectUtil.equal(200,receive.get("code"))){
+            if(ObjectUtil.notEqual(200,receive.get("code"))){
                 fsCouponSchedule.setErrorMessage(JSON.toJSONString(receive));
                 fsCouponSchedule.setStatus(IcgProcessStatusEnum.FAILED.getCode());
                 fsCouponSchedule.setRetryCount(fsCouponSchedule.getRetryCount()+1);
@@ -208,11 +220,16 @@ public class FsCouponScheduleServiceImpl implements IFsCouponScheduleService
 
                 operationTypeSet.add(IcgScheduleOperationTypeEnum.ERROR.getCode());
             } else {
-                fsCouponSchedule.setStatus(IcgProcessStatusEnum.SUCCESS.getCode());
+                if(fsCouponSchedule.getCount() >=  fsCouponSchedule.getMonth()){
+                    fsCouponSchedule.setStatus(IcgProcessStatusEnum.FINISHED.getCode());
+                } else {
+                    fsCouponSchedule.setStatus(IcgProcessStatusEnum.SUCCESS.getCode());
+                }
                 fsCouponSchedule.setActualSendTime(LocalDateTime.now());
                 fsCouponSchedule.setSendTime(fsCouponSchedule.getActualSendTime().plusMonths(1));
                 fsCouponSchedule.setCount(fsCouponSchedule.getCount()+1);
-
+                // 清空错误信息
+                fsCouponSchedule.setErrorMessage(null);
                 scheduleLog.setStatusAfter(IcgProcessStatusEnum.SUCCESS.getCode());
                 scheduleLog.setActualSendTime(fsCouponSchedule.getActualSendTime());
                 scheduleLog.setSendTimeAfter(fsCouponSchedule.getSendTime());
@@ -231,15 +248,10 @@ public class FsCouponScheduleServiceImpl implements IFsCouponScheduleService
                 // 状态等待执行
                 notifyTask.setStatus(MiniAppNotifyTaskStatusEnum.WAITING.getValue());
                 notifyTask.setRetryCount(0);
+                notifyTask.setMaxRetries(3);
+                notifyTask.setUpdateTime(LocalDateTime.now());
                 Map<String, TemplateMessageSendRequestDTO.TemplateDataValue> data = new HashMap<>();
-                // 获取优惠券名称
-                Set<Long> couponIds = fsCouponSchedule.getCouponId();
-                if(CollectionUtils.isEmpty(couponIds)){
-                    log.info("当前优惠券没有被选择!已经跳过");
-                    continue;
-                }
-                // 优惠券id (有多张这里只取第一张)
-                Long couponId = couponIds.stream().findFirst().get();
+
 
                 TemplateMessageSendRequestDTO.TemplateDataValue couponName = new TemplateMessageSendRequestDTO.TemplateDataValue();
                 FsStoreCoupon fsStoreCoupon = fsStoreCouponMapper.selectFsStoreCouponById(couponId);
@@ -253,17 +265,22 @@ public class FsCouponScheduleServiceImpl implements IFsCouponScheduleService
                 // 获取优惠券时间范围
                 TemplateMessageSendRequestDTO.TemplateDataValue couponValidate = new TemplateMessageSendRequestDTO.TemplateDataValue();
 
-                FsStoreCouponIssue fsStoreCouponIssue = fsStoreCouponIssueService.selectFsStoreCouponIssueByCouponId(couponId);
+
                 if(ObjectUtil.isNotNull(fsStoreCouponIssue)){
-                    String beginTime = fsStoreCouponIssue.getBeginTime();
-                    String endTime = fsStoreCouponIssue.getEndTime();
-                    if(StringUtil.isNotEmpty(beginTime) && StringUtil.isNotEmpty(endTime)){
+                    Date beginTime = fsStoreCouponIssue.getStartTime();
+                    Date endTime = fsStoreCouponIssue.getLimitTime();
+                    String beginTimeStr = DateUtil.format(beginTime, "yyyy-MM-dd");
+                    String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd");
+
+                    if(StringUtil.isNotEmpty(beginTimeStr) && StringUtil.isNotEmpty(endTimeStr)){
                         couponValidate.setValue(beginTime + " ~ " + endTime);
+                    } else {
+                        couponValidate.setValue("#");
                     }
                 }
                 // 备注消息
                 TemplateMessageSendRequestDTO.TemplateDataValue couponMark = new TemplateMessageSendRequestDTO.TemplateDataValue();
-                couponMark.setValue("");
+                couponMark.setValue("");
 
                 // 面值
                 TemplateMessageSendRequestDTO.TemplateDataValue couponPrice = new TemplateMessageSendRequestDTO.TemplateDataValue();

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

@@ -1390,7 +1390,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
                     fsCouponSchedule.setCount(0L);
                     fsCouponSchedule.setStatus(IcgProcessStatusEnum.PENDING.getCode());
                     fsCouponSchedule.setOrderTime(LocalDateTime.now());
-
+                    fsCouponSchedule.setUserId(order.getUserId());
                     // 如果上次发送时间为空,那么预计发送时间等于=下单时间+1月
                     fsCouponSchedule.setSendTime(fsCouponSchedule.getOrderTime().plusMonths(1L));
                     fsCouponSchedule.setRetryCount(0);

+ 10 - 2
fs-service-system/src/main/java/com/fs/store/utils/MiniProgramHttp.java

@@ -1,5 +1,7 @@
 package com.fs.store.utils;
 
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.http.HttpRequest;
 import cn.hutool.http.HttpUtil;
 import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson.JSONObject;
@@ -48,6 +50,9 @@ public class MiniProgramHttp {
             log.info("发送小程序订阅消息, HTTP 响应: {}", response);
 
             MiniGramSubsMsgResultDTO result = JSONObject.parseObject(response, MiniGramSubsMsgResultDTO.class);
+            if(ObjectUtil.notEqual(result.getErrcode(),0)){
+                throw new RuntimeException("发送小程序订阅消息失败, " + result.getErrmsg());
+            }
             log.info("发送小程序订阅消息, 解析结果: {}", JSON.toJSONString(result));
             return result;
 
@@ -67,8 +72,8 @@ public class MiniProgramHttp {
         log.info("获取微信 Stable Access Token, 请求参数: {}", requestBody); // 打印请求参数
 
         try {
-            String responseJson = HttpUtil.post(TOKEN_URL, requestBody);
-
+            String responseJson =
+            HttpRequest.post(TOKEN_URL).contentType("application/json").body(requestBody).execute().body();
             log.info("获取微信 Stable Access Token, HTTP 请求 URL: {}", TOKEN_URL);
             log.info("获取微信 Stable Access Token, HTTP 请求体: {}", requestBody);
             log.info("获取微信 Stable Access Token, HTTP 响应: {}", responseJson);
@@ -78,6 +83,9 @@ public class MiniProgramHttp {
             }
             WeXinAccessTokenDTO result = JSONObject.parseObject(responseJson, WeXinAccessTokenDTO.class);
             log.info("获取微信 Stable Access Token, 解析结果: {}", JSONObject.toJSONString(result)); //记录解析结果
+            if(result == null || StringUtils.isBlank(result.getAccessToken())){
+                throw new RuntimeException("获取微信 Stable Access Token 失败, accessToken为空");
+            }
             return result;
 
         } catch (Exception e) {

+ 22 - 21
fs-service-system/src/main/resources/mapper/store/FsCouponScheduleMapper.xml

@@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </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, 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 from fs_coupon_schedule
     </sql>
 
     <select id="selectFsCouponScheduleList" parameterType="FsCouponSchedule" resultMap="FsCouponScheduleResult">
@@ -56,7 +56,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectPendingCouponList" resultType="com.fs.store.domain.FsCouponSchedule">
         <include refid="selectFsCouponScheduleVo"/>
-        where status in (0,-1) and retry_count &lt; 3 and count &lt; month
+        where status IN (0,-1,2) AND retry_count &lt; 3 AND count &lt; month
+        AND now()>=send_time
         limit 500
     </select>
     <select id="selectFsCouponScheduleByOrderId" resultType="com.fs.store.domain.FsCouponSchedule">
@@ -136,26 +137,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <foreach collection="list" separator=";" item="item">
             update fs_coupon_schedule
             <trim prefix="SET" suffixOverrides=",">
-                <if test="userId != null">user_id = #{item.userId},</if>
-                <if test="orderId != null and orderId != ''">order_id = #{item.orderId},</if>
-                <if test="setmealId != null">setmeal_id = #{item.setmealId},</if>
-                <if test="month != null">month = #{item.month},</if>
-                <if test="count != null">count = #{item.count},</if>
-                <if test="status != null">status = #{item.status},</if>
-                <if test="createTime != null">create_time = #{item.createTime},</if>
-                <if test="createBy != null">create_by = #{item.createBy},</if>
-                <if test="updateTime != null">update_time = #{item.updateTime},</if>
-                <if test="updateBy != null">update_by = #{item.updateBy},</if>
-                <if test="orderTime != null">order_time = #{item.orderTime},</if>
-                <if test="couponIds != null">coupon_id = #{item.couponIds},</if>
-                <if test="sendTime != null">send_time = #{item.sendTime},</if>
-                <if test="actualSendTime != null">actual_send_time = #{item.actualSendTime},</if>
-                <if test="errorMessage != null">error_message = #{item.errorMessage},</if>
-                <if test="retryCount != null">retry_count = #{item.retryCount},</if>
-                <if test="maxRetries != null">max_retries = #{item.maxRetries},</if>
-                <if test="remark != null">remark = #{item.remark},</if>
+                <if test="item.userId != null">user_id = #{item.userId},</if>
+                <if test="item.orderId != null and item.orderId != ''">order_id = #{item.orderId},</if>
+                <if test="item.setmealId != null">setmeal_id = #{item.setmealId},</if>
+                <if test="item.month != null">month = #{item.month},</if>
+                <if test="item.count != null">count = #{item.count},</if>
+                <if test="item.status != null">status = #{item.status},</if>
+                <if test="item.createTime != null">create_time = #{item.createTime},</if>
+                <if test="item.createBy != null">create_by = #{item.createBy},</if>
+                <if test="item.updateTime != null">update_time = #{item.updateTime},</if>
+                <if test="item.updateBy != null">update_by = #{item.updateBy},</if>
+                <if test="item.orderTime != null">order_time = #{item.orderTime},</if>
+                <if test="item.couponIds != null">coupon_id = #{item.couponIds},</if>
+                <if test="item.sendTime != null">send_time = #{item.sendTime},</if>
+                <if test="item.actualSendTime != null">actual_send_time = #{item.actualSendTime},</if>
+                <if test="item.errorMessage != null">error_message = #{item.errorMessage},</if>
+                <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>
             </trim>
-            where id = #{id}
+            where id = #{item.id}
         </foreach>
     </update>
 

+ 11 - 1
fs-service-system/src/main/resources/mapper/store/FsStoreProductPackageMapper.xml

@@ -23,10 +23,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="icgEnable"    column="icg_enable"    />
         <result property="icgMonth"    column="icg_month"    />
         <result property="icgCoupons"    column="icg_coupons"    />
+        <result property="icgUrl"    column="icg_url"    />
+        <result property="icgMark"    column="icg_mark"    />
     </resultMap>
 
     <sql id="selectFsStoreProductPackageVo">
-        select package_id, title, descs, content, img_url,images, products, money, pay_money, company_id, dept_id,pay_type,limit_count,cate_id,sort,status,icg_enable,icg_month,icg_coupons from fs_store_product_package
+        select package_id, title, descs, content, img_url,images, products, money, pay_money, company_id, dept_id,pay_type,limit_count,cate_id,sort,status,icg_enable,icg_month,icg_coupons,icg_url,icg_mark from fs_store_product_package
     </sql>
 
     <select id="selectFsStoreProductPackageList" parameterType="FsStoreProductPackage" resultMap="FsStoreProductPackageResult">
@@ -46,6 +48,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="icgEnable != null "> and icg_enable = #{icgEnable}</if>
             <if test="icgMonth != null "> and icg_month = #{icgMonth}</if>
             <if test="icgCoupons != null "> and icg_coupons = #{icgCoupons}</if>
+            <if test="icgUrl != null "> and icg_url = #{icgUrl}</if>
+            <if test="icgMark != null "> and icg_mark = #{icgMark}</if>
         </where>
     </select>
 
@@ -78,6 +82,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="icgEnable != null">icg_enable,</if>
             <if test="icgMonth != null">icg_month,</if>
             <if test="icgCoupons != null">icg_coupons,</if>
+            <if test="icgUrl != null">icg_url,</if>
+            <if test="icgMark != null">icg_mark,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="packageId != null">#{packageId},</if>
@@ -99,6 +105,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="icgEnable != null">#{icgEnable},</if>
             <if test="icgMonth != null">#{icgMonth},</if>
             <if test="icgCoupons != null">#{icgCoupons},</if>
+            <if test="icgUrl != null">#{icgUrl},</if>
+            <if test="icgMark != null">#{IcgMark},</if>
          </trim>
     </insert>
 
@@ -123,6 +131,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="icgEnable != null">icg_enable = #{icgEnable},</if>
             <if test="icgMonth != null">icg_month = #{icgMonth},</if>
             <if test="icgCoupons != null">icg_coupons = #{icgCoupons},</if>
+            <if test="icgUrl != null">icg_url = #{icgUrl},</if>
+            <if test="icgMark != null">icg_mark = #{icgMark},</if>
         </trim>
         where package_id = #{packageId}
     </update>