| @@ -183,20 +183,17 @@ public class MallUserInfoController extends BaseController { | |||||
| if (currentUser.getIsAdmin().equals(EnumUserAdmin.ADMIN.getCode()) && | if (currentUser.getIsAdmin().equals(EnumUserAdmin.ADMIN.getCode()) && | ||||
| currentUser.getId().equals(userInfo.getId())) { | currentUser.getId().equals(userInfo.getId())) { | ||||
| // 超管 | // 超管 | ||||
| boolean bModify = false; | |||||
| MallUserInfo adminUser = new MallUserInfo(); | MallUserInfo adminUser = new MallUserInfo(); | ||||
| adminUser.setFlowPermission(userInfo.getFlowPermission()); | adminUser.setFlowPermission(userInfo.getFlowPermission()); | ||||
| adminUser.setEmail(userInfo.getEmail()); | |||||
| adminUser.setId(userInfo.getId()); | adminUser.setId(userInfo.getId()); | ||||
| if (StringUtils.isNotBlank(userInfo.getPassword()) && userInfo.getPassword().length() > 0) { | if (StringUtils.isNotBlank(userInfo.getPassword()) && userInfo.getPassword().length() > 0) { | ||||
| adminUser.setPassword(userInfo.getPassword()); | adminUser.setPassword(userInfo.getPassword()); | ||||
| bModify = true; | |||||
| } | } | ||||
| if (StringUtils.isNotBlank(userInfo.getUsername())) { | if (StringUtils.isNotBlank(userInfo.getUsername())) { | ||||
| adminUser.setUsername(userInfo.getUsername()); | adminUser.setUsername(userInfo.getUsername()); | ||||
| } | } | ||||
| if (bModify) { | |||||
| userInfoService.saveOrUpdate(adminUser); | |||||
| } | |||||
| userInfoService.saveOrUpdate(adminUser); | |||||
| } else { | } else { | ||||
| userInfoService.saveOrUpdate(userInfo); | userInfoService.saveOrUpdate(userInfo); | ||||
| if (userInfo.getRoleId() != null) { | if (userInfo.getRoleId() != null) { | ||||
| @@ -54,6 +54,7 @@ public class WxTopicController extends BaseController { | |||||
| @PostMapping("saveOrUpdate") | @PostMapping("saveOrUpdate") | ||||
| public ResultData saveOrUpdate(@RequestBody WxTopic wxTopic) { | public ResultData saveOrUpdate(@RequestBody WxTopic wxTopic) { | ||||
| logger.debug("[" + getIpAddr() + "] WxTopicController::saveOrUpdate"); | logger.debug("[" + getIpAddr() + "] WxTopicController::saveOrUpdate"); | ||||
| wxTopic.setTenantId(super.getTenantId()); | |||||
| return wxTopicService.saveOrUpdate(wxTopic); | return wxTopicService.saveOrUpdate(wxTopic); | ||||
| } | } | ||||
| @@ -9,6 +9,8 @@ public interface WxTopicMapper extends CommonMapper<WxTopic, String> { | |||||
| List<WxTopic> findList(WxTopic wxTopic); | List<WxTopic> findList(WxTopic wxTopic); | ||||
| List<WxTopic> findExist(WxTopic wxTopic); | |||||
| WxTopic show(WxTopic record); | WxTopic show(WxTopic record); | ||||
| void updateStatus(WxTopic record); | void updateStatus(WxTopic record); | ||||
| @@ -67,7 +67,6 @@ public class WxTopicServiceImpl implements WxTopicService { | |||||
| if(record.getStatus().equals(EnumWxTopicStatus.VAILD.getCode())) { | if(record.getStatus().equals(EnumWxTopicStatus.VAILD.getCode())) { | ||||
| WxTopic query = new WxTopic(); | WxTopic query = new WxTopic(); | ||||
| query.setTenantId(record.getTenantId()); | query.setTenantId(record.getTenantId()); | ||||
| query.setStatus(EnumWxTopicStatus.VAILD.getCode()); | |||||
| if(record.getId() != null){ | if(record.getId() != null){ | ||||
| WxTopic wt = wxTopicMapper.selectByPrimaryKey(record.getId()); | WxTopic wt = wxTopicMapper.selectByPrimaryKey(record.getId()); | ||||
| query.setBeginTime(wt.getBeginTime()); | query.setBeginTime(wt.getBeginTime()); | ||||
| @@ -76,7 +75,7 @@ public class WxTopicServiceImpl implements WxTopicService { | |||||
| query.setBeginTime(record.getBeginTime()); | query.setBeginTime(record.getBeginTime()); | ||||
| query.setEndTime(record.getEndTime()); | query.setEndTime(record.getEndTime()); | ||||
| } | } | ||||
| List<WxTopic> topicList = wxTopicMapper.findList(record); | |||||
| List<WxTopic> topicList = wxTopicMapper.findExist(query); | |||||
| 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")); | ||||
| } | } | ||||
| @@ -57,6 +57,11 @@ | |||||
| <include refid="dynamicWhereConditions" /> | <include refid="dynamicWhereConditions" /> | ||||
| </select> | </select> | ||||
| <select id="findExist" parameterType="com.iformall.domain.po.WxTopic" resultMap="BaseResultMap"> | |||||
| SELECT * FROM wx_topic WHERE wx_topic.tenant_id = #{tenantId} | |||||
| AND (`begin_time` >= #{beginTime} or `end_time` <= #{endTime}) AND `status` = 1 | |||||
| </select> | |||||
| <select id="show" parameterType="com.iformall.domain.po.WxTopic" resultMap="BaseResultMap"> | <select id="show" parameterType="com.iformall.domain.po.WxTopic" resultMap="BaseResultMap"> | ||||
| select t.*,cc.id as couponChannelId from wx_topic t left join wx_coupon_channel cc on(cc.sub_target_id = t.id) | select t.*,cc.id as couponChannelId from wx_topic t left join wx_coupon_channel cc on(cc.sub_target_id = t.id) | ||||
| where t.status = 1 | where t.status = 1 | ||||