|
|
|
@@ -16,6 +16,7 @@ import com.iformall.mapper.WxCouponMapper; |
|
|
|
import com.iformall.mapper.WxTopicMapper; |
|
|
|
import com.iformall.service.WxTopicService; |
|
|
|
import com.iformall.utils.DateUtils; |
|
|
|
import org.apache.commons.collections.CollectionUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import com.iformall.common.ResultData; |
|
|
|
@@ -63,9 +64,9 @@ public class WxTopicServiceImpl implements WxTopicService { |
|
|
|
@Override |
|
|
|
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")); |
|
|
|
List<WxTopic> topicList = wxTopicMapper.findList(record); |
|
|
|
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")); |
|
|
|
} |
|
|
|
} |
|
|
|
if (record.getId() == null) { |
|
|
|
|