| @@ -63,14 +63,19 @@ public class WxTopicServiceImpl implements WxTopicService { | |||||
| @Override | @Override | ||||
| public ResultData saveOrUpdate(WxTopic record) { | public ResultData saveOrUpdate(WxTopic record) { | ||||
| WxTopic query = new WxTopic(); | |||||
| if(record.getId() != null){ | |||||
| // WxTopic wt = wxTopicMapper.selectByPrimaryKey(record.getId()); | |||||
| // query.setTenantId(record.getTenantId()); | |||||
| // query.setStatus(EnumWxTopicStatus.VAILD); | |||||
| } | |||||
| //验证是否存在已发放的专题 | |||||
| if(record.getStatus().equals(EnumWxTopicStatus.VAILD.getCode())) { | if(record.getStatus().equals(EnumWxTopicStatus.VAILD.getCode())) { | ||||
| WxTopic query = new WxTopic(); | |||||
| query.setTenantId(record.getTenantId()); | |||||
| query.setStatus(EnumWxTopicStatus.VAILD.getCode()); | |||||
| if(record.getId() != null){ | |||||
| WxTopic wt = wxTopicMapper.selectByPrimaryKey(record.getId()); | |||||
| query.setBeginTime(wt.getBeginTime()); | |||||
| query.setEndTime(wt.getEndTime()); | |||||
| }else{ | |||||
| query.setBeginTime(record.getBeginTime()); | |||||
| query.setEndTime(record.getEndTime()); | |||||
| } | |||||
| List<WxTopic> topicList = wxTopicMapper.findList(record); | List<WxTopic> topicList = wxTopicMapper.findList(record); | ||||
| if (CollectionUtils.isNotEmpty(topicList)) { | if (CollectionUtils.isNotEmpty(topicList)) { | ||||
| return new ResultData(ErrorCode.SYS_REPEAT_SUBMIT_EXCEPTION.getCode(), "["+topicList.get(0).getName()+"]正在活动中,截止至"+ DateUtils.date2String(topicList.get(0).getEndTime(),"yyyy-MM-dd")); | return new ResultData(ErrorCode.SYS_REPEAT_SUBMIT_EXCEPTION.getCode(), "["+topicList.get(0).getName()+"]正在活动中,截止至"+ DateUtils.date2String(topicList.get(0).getEndTime(),"yyyy-MM-dd")); | ||||