| @@ -62,6 +62,12 @@ public class WxTopicServiceImpl implements WxTopicService { | |||||
| @Override | @Override | ||||
| public ResultData saveOrUpdate(WxTopic record) { | public ResultData saveOrUpdate(WxTopic record) { | ||||
| if(record.getStatus().equals(EnumWxTopicStatus.VAILD.getCode())) { | |||||
| WxTopic showTopic = wxTopicMapper.show(record); | |||||
| if (showTopic != null) { | |||||
| return new ResultData(ErrorCode.SYS_REPEAT_SUBMIT_EXCEPTION.getCode(), "["+showTopic.getName()+"]正在活动中,截止至"+ DateUtils.date2String(showTopic.getEndTime(),"yyyy-MM-dd")); | |||||
| } | |||||
| } | |||||
| if (record.getId() == null) { | if (record.getId() == null) { | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| @@ -72,12 +78,6 @@ public class WxTopicServiceImpl implements WxTopicService { | |||||
| } | } | ||||
| return new ResultData(Result.SUCCESS,"添加成功"); | return new ResultData(Result.SUCCESS,"添加成功"); | ||||
| } else { | } else { | ||||
| if(record.getStatus().equals(EnumWxTopicStatus.VAILD.getCode())) { | |||||
| WxTopic showTopic = wxTopicMapper.show(record); | |||||
| if (showTopic != null) { | |||||
| return new ResultData(ErrorCode.SYS_REPEAT_SUBMIT_EXCEPTION.getCode(), "["+showTopic.getName()+"]正在活动中,截止至"+ DateUtils.date2String(showTopic.getEndTime(),"yyyy-MM-dd")); | |||||
| } | |||||
| } | |||||
| record.setUpdatetime(new Date()); | record.setUpdatetime(new Date()); | ||||
| wxTopicMapper.updateByPrimaryKeySelective(record); | wxTopicMapper.updateByPrimaryKeySelective(record); | ||||
| if(StringUtils.isNotBlank(record.getCouponIds())) { | if(StringUtils.isNotBlank(record.getCouponIds())) { | ||||