| | |
| | | package com.panzhihua.service_dangjian.service.impl; |
| | | |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | ComPbServiceTeamDO comPbServiceTeamDO = new ComPbServiceTeamDO(); |
| | | BeanUtils.copyProperties(comPbServiceTeamDTO, comPbServiceTeamDO); |
| | | comPbServiceTeamDO.setIsReg(2); |
| | | if (comPbMemberRoleDAO.getSysUserByPhoneCount(comPbServiceTeamDTO.getPhone()) > 0) { |
| | | Long userId = comPbMemberRoleDAO.getSysUserIdByPhone(comPbServiceTeamDTO.getPhone()); |
| | | if (nonNull(userId)) { |
| | | comPbServiceTeamDO.setIsReg(1); |
| | | } |
| | | int insert = comPbServiceTeamDAO.insert(comPbServiceTeamDO); |
| | | if (insert > 0) { |
| | | if (nonNull(userId)) { |
| | | String userKey = UserConstants.LOGIN_USER_INFO + userId; |
| | | stringRedisTemplate.delete(userKey); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |