From 83a5d357ffaab1b9218ec29824006b4cae628ac7 Mon Sep 17 00:00:00 2001 From: xhxu Date: Sat, 10 Oct 2020 14:17:22 +0800 Subject: [PATCH] dingshifajuan --- .../controller/market/WxCouponChannelController.java | 2 +- .../V202010100001__couponchannel_show_begin.sql | 2 ++ .../controller/WxCouponChannelController.java | 2 +- .../controller/WxCouponChannelController.java | 2 ++ .../com/iformall/domain/dto/WxCouponChannelDto.java | 2 ++ .../java/com/iformall/domain/po/WxCouponChannel.java | 2 ++ .../com/iformall/service/WxCouponChannelService.java | 2 +- .../service/impl/WxCouponChannelServiceImpl.java | 11 ++++++++--- .../main/resources/mapper/WxCouponChannelMapper.xml | 8 ++++++++ mallinkSysAdmin/src/main/resources/application.yml | 4 ++-- 10 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 mallinkAdmin/src/main/resources/db/migration/V202010100001__couponchannel_show_begin.sql diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java index 8509358e9..c88671ccd 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java @@ -124,7 +124,7 @@ public class WxCouponChannelController extends BaseController { logger.debug("[" + getIpAddr() + "] WxCouponChannelController::addbatch"); String[] ids = wxCouponChannelDto.getCouponIds().split(","); String[] channelId = wxCouponChannelDto.getChannelId().split(","); - ResultData resultData = wxCouponChannelService.addBatch(ids, channelId, getTenantInfo(), wxCouponChannelDto.getBeginTime(), wxCouponChannelDto.getEndTime()); + ResultData resultData = wxCouponChannelService.addBatch(ids, channelId, getTenantInfo(),wxCouponChannelDto.getShowBeginTime(), wxCouponChannelDto.getBeginTime(), wxCouponChannelDto.getEndTime()); return resultData; } diff --git a/mallinkAdmin/src/main/resources/db/migration/V202010100001__couponchannel_show_begin.sql b/mallinkAdmin/src/main/resources/db/migration/V202010100001__couponchannel_show_begin.sql new file mode 100644 index 000000000..d40465868 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V202010100001__couponchannel_show_begin.sql @@ -0,0 +1,2 @@ +ALTER TABLE `mallink`.`wx_coupon_channel` +ADD COLUMN `show_begin_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `sub_business`; \ No newline at end of file diff --git a/mallinkBApi/src/main/java/com/iformall/controller/WxCouponChannelController.java b/mallinkBApi/src/main/java/com/iformall/controller/WxCouponChannelController.java index 94213295b..00251e4e6 100644 --- a/mallinkBApi/src/main/java/com/iformall/controller/WxCouponChannelController.java +++ b/mallinkBApi/src/main/java/com/iformall/controller/WxCouponChannelController.java @@ -110,7 +110,7 @@ public class WxCouponChannelController extends BaseController { logger.debug("[" + getIpAddr() + "] WxCouponChannelController::addbatch"); String[] ids = wxCouponChannelDto.getCouponIds().split(","); String[] channelId = wxCouponChannelDto.getChannelId().split(","); - ResultData resultData = wxCouponChannelService.addBatch(ids, channelId, getTenantInfo(), wxCouponChannelDto.getBeginTime(), wxCouponChannelDto.getEndTime()); + ResultData resultData = wxCouponChannelService.addBatch(ids, channelId, getTenantInfo(),wxCouponChannelDto.getShowBeginTime(), wxCouponChannelDto.getBeginTime(), wxCouponChannelDto.getEndTime()); return resultData; } diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java index 6287be36e..4d3fe2624 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java @@ -61,6 +61,7 @@ public class WxCouponChannelController extends BaseController { if(StringUtils.isNotBlank(wxCouponChannel.getSortColumn())){ wxCouponChannel.setSortColumn("cc."+wxCouponChannel.getSortColumn()); } + wxCouponChannel.setShowBeginTime(new Date()); PageInfo page = wxCouponChannelService.listPageCVo(wxCouponChannel, pageNum, pageSize); filterTimed(wxCouponChannel, page); return new ResultData(page); @@ -78,6 +79,7 @@ public class WxCouponChannelController extends BaseController { wxCouponChannel.setSortColumns(BaseEntity.SortField.UpdateDate_DESC, BaseEntity.SortField.Id_DESC); Map map = new HashedMap(); + wxCouponChannel.setShowBeginTime(new Date()); PageInfo page = wxCouponChannelService.listByMerchant(wxCouponChannel,pageNum,pageSize); filterTimed(wxCouponChannel, page); diff --git a/mallinkService/src/main/java/com/iformall/domain/dto/WxCouponChannelDto.java b/mallinkService/src/main/java/com/iformall/domain/dto/WxCouponChannelDto.java index 3dc2aad75..da622e2ab 100644 --- a/mallinkService/src/main/java/com/iformall/domain/dto/WxCouponChannelDto.java +++ b/mallinkService/src/main/java/com/iformall/domain/dto/WxCouponChannelDto.java @@ -17,6 +17,8 @@ public class WxCouponChannelDto implements Serializable { private Date beginTime; private Date endTime; + private Date showBeginTime; + @TableField(exist = false) @io.swagger.annotations.ApiModelProperty(value = "审批流参数", name = "flowParams") private Map flowParams; diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCouponChannel.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCouponChannel.java index 5f864524b..7d8e41dd8 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCouponChannel.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCouponChannel.java @@ -49,6 +49,8 @@ public class WxCouponChannel extends TenantEntity { private Integer business; @io.swagger.annotations.ApiModelProperty(value="子业态",name="subBusiness") private Integer subBusiness; + @io.swagger.annotations.ApiModelProperty(value="开始显示时间",name="showBeginTime") + private Date showBeginTime; @io.swagger.annotations.ApiModelProperty(value="开始时间",name="beginTime") private Date beginTime; @io.swagger.annotations.ApiModelProperty(value="结束时间",name="endTime") diff --git a/mallinkService/src/main/java/com/iformall/service/WxCouponChannelService.java b/mallinkService/src/main/java/com/iformall/service/WxCouponChannelService.java index c72d2c09d..735223066 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCouponChannelService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCouponChannelService.java @@ -70,7 +70,7 @@ public interface WxCouponChannelService { */ ResultData saveOrUpdate(WxCouponChannel record); - ResultData addBatch(String[] ids, String[] channelId, TenantEntity tenantEntity, Date beginTime, Date endTime); + ResultData addBatch(String[] ids, String[] channelId, TenantEntity tenantEntity, Date showBeginTime, Date beginTime, Date endTime); void updateStatusByCouponId(Long couponId,TenantEntity tenantEntity,int status); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java index dd03edcb7..0b71a678c 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java @@ -141,13 +141,13 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { } @Override - public ResultData addBatch(String[] ids, String[] channelId, TenantEntity tenantEntity, Date beginTime, Date endTime) { + public ResultData addBatch(String[] ids, String[] channelId, TenantEntity tenantEntity, Date showBeginTime, Date beginTime, Date endTime) { List errorList = new ArrayList<>(); for (String targetIdstr:channelId) { Integer targetId = Integer.parseInt(targetIdstr); for (String couponidstr:ids) { Long couponid = Long.parseLong(couponidstr); - WxCouponChannelAddVo vo = addCouponChannel(couponid,targetId,tenantEntity,beginTime,endTime); + WxCouponChannelAddVo vo = addCouponChannel(couponid,targetId,tenantEntity,showBeginTime,beginTime,endTime); if(!vo.isSuc()){ errorList.add(vo); } @@ -210,7 +210,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { return false; } - public WxCouponChannelAddVo addCouponChannel(Long couponid,Integer channelId, TenantEntity tenantEntity,Date beginTime,Date endTime){ + public WxCouponChannelAddVo addCouponChannel(Long couponid,Integer channelId, TenantEntity tenantEntity,Date showBeginTime,Date beginTime,Date endTime){ WxCouponChannelAddVo vo = new WxCouponChannelAddVo(); @@ -271,6 +271,11 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { } WxCouponChannel wxCouponChannel = new WxCouponChannel(); + if(showBeginTime == null){ + wxCouponChannel.setShowBeginTime(new Date()); + }else { + wxCouponChannel.setShowBeginTime(showBeginTime); + } wxCouponChannel.setEndTime(endTime); wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); wxCouponChannel.setBeginTime(beginTime); diff --git a/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml index 0f67821a6..30fc959ee 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml @@ -11,6 +11,7 @@ + @@ -71,6 +72,10 @@ and cc.`sub_business` = #{subBusiness} + + and cc.`show_begin_time` <= #{showBeginTime} + + and cc.`create_date` between #{startdate} and #{enddate} @@ -234,6 +239,9 @@ and cc.`parent_tenant_id` = #{parentTenantId} + + and cc.`show_begin_time` <= #{showBeginTime} + order by ${sortColumns} diff --git a/mallinkSysAdmin/src/main/resources/application.yml b/mallinkSysAdmin/src/main/resources/application.yml index e4b7042f4..3baa905c3 100644 --- a/mallinkSysAdmin/src/main/resources/application.yml +++ b/mallinkSysAdmin/src/main/resources/application.yml @@ -22,7 +22,7 @@ spring: redis: time-to-live: 60000ms #很重要,缓存的有效时间,以便缓存的过期(单位为毫秒) rocketmq: - nameServer: 202.165.179.86:9876 + nameServer: 101.200.130.134:9876 producer: retry-times-when-send-async-failed: 0 send-msg-timeout: 300000 @@ -31,7 +31,7 @@ spring: retry-another-broker-when-not-store-ok: false retry-times-when-send-failed: 2 rabbitmq: - host: 202.165.179.86 + host: 101.200.130.134 port: 5672 username: guest password: guest