| @@ -124,7 +124,7 @@ public class WxCouponChannelController extends BaseController { | |||||
| logger.debug("[" + getIpAddr() + "] WxCouponChannelController::addbatch"); | logger.debug("[" + getIpAddr() + "] WxCouponChannelController::addbatch"); | ||||
| String[] ids = wxCouponChannelDto.getCouponIds().split(","); | String[] ids = wxCouponChannelDto.getCouponIds().split(","); | ||||
| String[] channelId = wxCouponChannelDto.getChannelId().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; | return resultData; | ||||
| } | } | ||||
| @@ -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`; | |||||
| @@ -110,7 +110,7 @@ public class WxCouponChannelController extends BaseController { | |||||
| logger.debug("[" + getIpAddr() + "] WxCouponChannelController::addbatch"); | logger.debug("[" + getIpAddr() + "] WxCouponChannelController::addbatch"); | ||||
| String[] ids = wxCouponChannelDto.getCouponIds().split(","); | String[] ids = wxCouponChannelDto.getCouponIds().split(","); | ||||
| String[] channelId = wxCouponChannelDto.getChannelId().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; | return resultData; | ||||
| } | } | ||||
| @@ -61,6 +61,7 @@ public class WxCouponChannelController extends BaseController { | |||||
| if(StringUtils.isNotBlank(wxCouponChannel.getSortColumn())){ | if(StringUtils.isNotBlank(wxCouponChannel.getSortColumn())){ | ||||
| wxCouponChannel.setSortColumn("cc."+wxCouponChannel.getSortColumn()); | wxCouponChannel.setSortColumn("cc."+wxCouponChannel.getSortColumn()); | ||||
| } | } | ||||
| wxCouponChannel.setShowBeginTime(new Date()); | |||||
| PageInfo<WxCouponChannelVo> page = wxCouponChannelService.listPageCVo(wxCouponChannel, pageNum, pageSize); | PageInfo<WxCouponChannelVo> page = wxCouponChannelService.listPageCVo(wxCouponChannel, pageNum, pageSize); | ||||
| filterTimed(wxCouponChannel, page); | filterTimed(wxCouponChannel, page); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| @@ -78,6 +79,7 @@ public class WxCouponChannelController extends BaseController { | |||||
| wxCouponChannel.setSortColumns(BaseEntity.SortField.UpdateDate_DESC, BaseEntity.SortField.Id_DESC); | wxCouponChannel.setSortColumns(BaseEntity.SortField.UpdateDate_DESC, BaseEntity.SortField.Id_DESC); | ||||
| Map<String,Object> map = new HashedMap(); | Map<String,Object> map = new HashedMap(); | ||||
| wxCouponChannel.setShowBeginTime(new Date()); | |||||
| PageInfo<WxCouponChannelVo> page = wxCouponChannelService.listByMerchant(wxCouponChannel,pageNum,pageSize); | PageInfo<WxCouponChannelVo> page = wxCouponChannelService.listByMerchant(wxCouponChannel,pageNum,pageSize); | ||||
| filterTimed(wxCouponChannel, page); | filterTimed(wxCouponChannel, page); | ||||
| @@ -17,6 +17,8 @@ public class WxCouponChannelDto implements Serializable { | |||||
| private Date beginTime; | private Date beginTime; | ||||
| private Date endTime; | private Date endTime; | ||||
| private Date showBeginTime; | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @io.swagger.annotations.ApiModelProperty(value = "审批流参数", name = "flowParams") | @io.swagger.annotations.ApiModelProperty(value = "审批流参数", name = "flowParams") | ||||
| private Map<String, Object> flowParams; | private Map<String, Object> flowParams; | ||||
| @@ -49,6 +49,8 @@ public class WxCouponChannel extends TenantEntity { | |||||
| private Integer business; | private Integer business; | ||||
| @io.swagger.annotations.ApiModelProperty(value="子业态",name="subBusiness") | @io.swagger.annotations.ApiModelProperty(value="子业态",name="subBusiness") | ||||
| private Integer subBusiness; | private Integer subBusiness; | ||||
| @io.swagger.annotations.ApiModelProperty(value="开始显示时间",name="showBeginTime") | |||||
| private Date showBeginTime; | |||||
| @io.swagger.annotations.ApiModelProperty(value="开始时间",name="beginTime") | @io.swagger.annotations.ApiModelProperty(value="开始时间",name="beginTime") | ||||
| private Date beginTime; | private Date beginTime; | ||||
| @io.swagger.annotations.ApiModelProperty(value="结束时间",name="endTime") | @io.swagger.annotations.ApiModelProperty(value="结束时间",name="endTime") | ||||
| @@ -70,7 +70,7 @@ public interface WxCouponChannelService { | |||||
| */ | */ | ||||
| ResultData saveOrUpdate(WxCouponChannel record); | 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); | void updateStatusByCouponId(Long couponId,TenantEntity tenantEntity,int status); | ||||
| @@ -141,13 +141,13 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| } | } | ||||
| @Override | @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<WxCouponChannelAddVo> errorList = new ArrayList<>(); | List<WxCouponChannelAddVo> errorList = new ArrayList<>(); | ||||
| for (String targetIdstr:channelId) { | for (String targetIdstr:channelId) { | ||||
| Integer targetId = Integer.parseInt(targetIdstr); | Integer targetId = Integer.parseInt(targetIdstr); | ||||
| for (String couponidstr:ids) { | for (String couponidstr:ids) { | ||||
| Long couponid = Long.parseLong(couponidstr); | 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()){ | if(!vo.isSuc()){ | ||||
| errorList.add(vo); | errorList.add(vo); | ||||
| } | } | ||||
| @@ -210,7 +210,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| return false; | 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(); | WxCouponChannelAddVo vo = new WxCouponChannelAddVo(); | ||||
| @@ -271,6 +271,11 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| } | } | ||||
| WxCouponChannel wxCouponChannel = new WxCouponChannel(); | WxCouponChannel wxCouponChannel = new WxCouponChannel(); | ||||
| if(showBeginTime == null){ | |||||
| wxCouponChannel.setShowBeginTime(new Date()); | |||||
| }else { | |||||
| wxCouponChannel.setShowBeginTime(showBeginTime); | |||||
| } | |||||
| wxCouponChannel.setEndTime(endTime); | wxCouponChannel.setEndTime(endTime); | ||||
| wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | ||||
| wxCouponChannel.setBeginTime(beginTime); | wxCouponChannel.setBeginTime(beginTime); | ||||
| @@ -11,6 +11,7 @@ | |||||
| <result column="target_ad" jdbcType="INTEGER" property="targetAd" /> | <result column="target_ad" jdbcType="INTEGER" property="targetAd" /> | ||||
| <result column="business" jdbcType="INTEGER" property="business" /> | <result column="business" jdbcType="INTEGER" property="business" /> | ||||
| <result column="sub_business" jdbcType="INTEGER" property="subBusiness" /> | <result column="sub_business" jdbcType="INTEGER" property="subBusiness" /> | ||||
| <result column="show_begin_time" jdbcType="TIMESTAMP" property="showBeginTime" /> | |||||
| <result column="begin_time" jdbcType="TIMESTAMP" property="beginTime" /> | <result column="begin_time" jdbcType="TIMESTAMP" property="beginTime" /> | ||||
| <result column="end_time" jdbcType="TIMESTAMP" property="endTime" /> | <result column="end_time" jdbcType="TIMESTAMP" property="endTime" /> | ||||
| <result column="status" jdbcType="INTEGER" property="status" /> | <result column="status" jdbcType="INTEGER" property="status" /> | ||||
| @@ -71,6 +72,10 @@ | |||||
| and cc.`sub_business` = #{subBusiness} | and cc.`sub_business` = #{subBusiness} | ||||
| </if> | </if> | ||||
| <if test=" null != showBeginTime "> | |||||
| and cc.`show_begin_time` <= #{showBeginTime} | |||||
| </if> | |||||
| <if test=" null != startdate and null!=enddate"> | <if test=" null != startdate and null!=enddate"> | ||||
| and cc.`create_date` between #{startdate} and #{enddate} | and cc.`create_date` between #{startdate} and #{enddate} | ||||
| </if> | </if> | ||||
| @@ -234,6 +239,9 @@ | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | <if test=" null != parentTenantId and '' != parentTenantId"> | ||||
| and cc.`parent_tenant_id` = #{parentTenantId} | and cc.`parent_tenant_id` = #{parentTenantId} | ||||
| </if> | </if> | ||||
| <if test=" null != showBeginTime "> | |||||
| and cc.`show_begin_time` <= #{showBeginTime} | |||||
| </if> | |||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | <if test=" null != sortColumns"> order by ${sortColumns} </if> | ||||
| </select> | </select> | ||||
| @@ -22,7 +22,7 @@ spring: | |||||
| redis: | redis: | ||||
| time-to-live: 60000ms #很重要,缓存的有效时间,以便缓存的过期(单位为毫秒) | time-to-live: 60000ms #很重要,缓存的有效时间,以便缓存的过期(单位为毫秒) | ||||
| rocketmq: | rocketmq: | ||||
| nameServer: 202.165.179.86:9876 | |||||
| nameServer: 101.200.130.134:9876 | |||||
| producer: | producer: | ||||
| retry-times-when-send-async-failed: 0 | retry-times-when-send-async-failed: 0 | ||||
| send-msg-timeout: 300000 | send-msg-timeout: 300000 | ||||
| @@ -31,7 +31,7 @@ spring: | |||||
| retry-another-broker-when-not-store-ok: false | retry-another-broker-when-not-store-ok: false | ||||
| retry-times-when-send-failed: 2 | retry-times-when-send-failed: 2 | ||||
| rabbitmq: | rabbitmq: | ||||
| host: 202.165.179.86 | |||||
| host: 101.200.130.134 | |||||
| port: 5672 | port: 5672 | ||||
| username: guest | username: guest | ||||
| password: guest | password: guest | ||||