Authored by tanling

领取时间校验

@@ -117,8 +117,8 @@ public class RedpacketConfigServiceImpl implements IRedpacketConfigService { @@ -117,8 +117,8 @@ public class RedpacketConfigServiceImpl implements IRedpacketConfigService {
117 if (redPacketRuleBo.getShowStartTime() != null && redPacketRuleBo.getShowEndTime() != null 117 if (redPacketRuleBo.getShowStartTime() != null && redPacketRuleBo.getShowEndTime() != null
118 && !Objects.isNull(redpacketConfig.getStartTime()) && !Objects.isNull(redpacketConfig.getEndTime())){ 118 && !Objects.isNull(redpacketConfig.getStartTime()) && !Objects.isNull(redpacketConfig.getEndTime())){
119 119
120 - if (Integer.compare(redPacketRuleBo.getShowStartTime(), redpacketConfig.getStartTime())>0  
121 - || Integer.compare(redPacketRuleBo.getShowEndTime(), redpacketConfig.getEndTime())<0){ 120 + if (Integer.compare(redPacketRuleBo.getShowStartTime(), redpacketConfig.getStartTime())< 0
  121 + || Integer.compare(redPacketRuleBo.getShowEndTime(), redpacketConfig.getEndTime())>0){
122 logger.warn("addRedPacketRule token time [start {}] [end {}] < show time [start {}] [end {}] error.", 122 logger.warn("addRedPacketRule token time [start {}] [end {}] < show time [start {}] [end {}] error.",
123 redpacketConfig.getStartTime(), redpacketConfig.getEndTime(), redPacketRuleBo.getShowStartTime(), redPacketRuleBo.getShowEndTime()); 123 redpacketConfig.getStartTime(), redpacketConfig.getEndTime(), redPacketRuleBo.getShowStartTime(), redPacketRuleBo.getShowEndTime());
124 throw new ServiceException(502, "Token的有效期必须>领取时间"); 124 throw new ServiceException(502, "Token的有效期必须>领取时间");
@@ -138,8 +138,8 @@ public class RedpacketConfigServiceImpl implements IRedpacketConfigService { @@ -138,8 +138,8 @@ public class RedpacketConfigServiceImpl implements IRedpacketConfigService {
138 redpacketRuleConfigMapper.insertSelective(redpacketRuleConfig); 138 redpacketRuleConfigMapper.insertSelective(redpacketRuleConfig);
139 139
140 }else{ 140 }else{
141 -  
142 BeanUtils.copyProperties(redPacketRuleBo, redpacketRuleConfig); 141 BeanUtils.copyProperties(redPacketRuleBo, redpacketRuleConfig);
  142 +
143 int now = DateUtils.getCurrentTimeSeconds(); 143 int now = DateUtils.getCurrentTimeSeconds();
144 redpacketRuleConfig.setUpdateTime(now); 144 redpacketRuleConfig.setUpdateTime(now);
145 redpacketRuleConfigMapper.updateByPrimaryKeySelective(redpacketRuleConfig); 145 redpacketRuleConfigMapper.updateByPrimaryKeySelective(redpacketRuleConfig);