From 4f7fc25d26c30dd9b934455fd90041acb301117b Mon Sep 17 00:00:00 2001 From: Burce Date: Fri, 16 Aug 2019 10:26:23 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BC=9A=E5=91=98?= =?UTF-8?q?=E7=94=9F=E6=97=A5=E5=88=B8couponsend=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxCouponSendServiceImpl.java | 38 +++++-------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java index 0c342a68d..6d7632e27 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java @@ -88,40 +88,20 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { /** * 会员生日券处理 + * * @param record * @return */ private WxCouponSend buildConditions(WxCouponSend record) { - if (!Objects.equals(record.getSendType(), EnumCouponSendSendType.BIRTHDAY.getCode())) { - return record ; + if (Objects.equals(record.getSendType(), EnumCouponSendSendType.BIRTHDAY.getCode())) { + if (Objects.isNull(record.getTitle())) { + record.setTitle(""); + } + if (Objects.isNull(record.getCouponId())) { + record.setCouponId(0L); + } + return record; } -// //会员生日券 -// JSONObject conditions = JSONObject.parseObject(record.getConditions()); -// Long couponId = record.getCouponId(); -// if (Objects.nonNull(couponId)) { -// JSONArray couponIds; -// if (Objects.isNull(record.getId())) { -// //添加新卡券 -// couponIds = new JSONArray(); -// couponIds.add(couponId); -// } else { -// //更新卡券列表 -// WxCouponSend couponSend = wxCouponSendMapper.selectByPrimaryKey(record.getId()); -// JSONObject couponSendJo = JSONObject.parseObject(couponSend.getConditions()); -// couponIds = couponSendJo.getJSONArray(WxCouponSend.KEY_COUPONIDS); -// if (Objects.isNull(couponIds)) { -// couponIds = new JSONArray(); -// couponIds.add(couponId); -// } else { -// //添加新卡券 -// if (!couponIds.contains(couponId)) { -// couponIds.add(couponId); -// } -// } -// } -// conditions.put(WxCouponSend.KEY_COUPONIDS, couponIds); -// } -// record.setConditions(conditions.toJSONString()); return record; } From e07655d87e40804af5f7752ef21241828dd0588e Mon Sep 17 00:00:00 2001 From: Burce Date: Fri, 16 Aug 2019 10:28:58 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BC=9A=E5=91=98?= =?UTF-8?q?=E7=94=9F=E6=97=A5=E5=88=B8couponsend=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/iformall/domain/po/WxCouponSend.java | 2 +- .../java/com/iformall/service/impl/WxCouponSendServiceImpl.java | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCouponSend.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCouponSend.java index 3c85c7ef5..742ebdb04 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCouponSend.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCouponSend.java @@ -32,7 +32,7 @@ public class WxCouponSend extends BaseEntity { private String title; @io.swagger.annotations.ApiModelProperty(value="发券方式(1.主动领取,2.停车发券,3.核销发券)",name="sendType") private Integer sendType; - @io.swagger.annotations.ApiModelProperty(value="发券条件",name="condition",required = true) + @io.swagger.annotations.ApiModelProperty(value="发券条件",name="condition") private String conditions; @io.swagger.annotations.ApiModelProperty(value="0:有效 1:无效",name="status") private Integer status; diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java index 6d7632e27..1d0a2619b 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java @@ -1,6 +1,5 @@ package com.iformall.service.impl; -import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -24,7 +23,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; -import springfox.documentation.spring.web.json.Json; import java.text.SimpleDateFormat; import java.util.*;