| | |
| | | import com.whyc.constant.UserConstant; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.UserMapper; |
| | | import com.whyc.mapper.UserPermitGroupDataMapper; |
| | | import com.whyc.pojo.UserClient; |
| | | import com.whyc.pojo.UserInf; |
| | | import com.whyc.pojo.UserPermitGroupData; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.RSAUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | private UserMapper userMapper; |
| | | |
| | | @Resource |
| | | private UserPermitGroupDataMapper permitMapper; |
| | | @Resource |
| | | private UserBridgeService userBridgeService; |
| | | |
| | | @Autowired |
| | |
| | | throw new InvalidParameterException("参数校验失败"); |
| | | } |
| | | user.setUpassword(RSAUtil.encrypt(password,RSAUtil.getPublicKey())); |
| | | if (userMapper.insert(user) > 0) { |
| | | int flag = userMapper.insert(user); |
| | | if (flag > 0) { |
| | | Integer uId= userMapper.getUserInfoByPhoneNumber(user.getUMobilephone()).getUId().intValue(); |
| | | UserPermitGroupData permitGroupData = new UserPermitGroupData(); |
| | | permitGroupData.setPermitGroupId(user.getPermitGroupId()); |
| | | permitGroupData.setUId(uId); |
| | | permitMapper.insert(permitGroupData); |
| | | return new Response<>().set(1, true); |
| | | } else { |
| | | return new Response<>().set(1, false, "添加失败"); |
| | |
| | | String[] dataArr = RSAUtil.decryptFront(password, RSAUtil.fontSeparator); |
| | | String pwd = RSAUtil.encrypt(dataArr[0],RSAUtil.getPublicKey()); |
| | | user.setUpassword(pwd); |
| | | if (userMapper.insert(user) > 0) { |
| | | int flag = userMapper.insert(user); |
| | | if (flag > 0) { |
| | | Integer uId= userMapper.getUserInfoByPhoneNumber(user.getUMobilephone()).getUId().intValue(); |
| | | UserPermitGroupData permitGroupData = new UserPermitGroupData(); |
| | | permitGroupData.setPermitGroupId(user.getPermitGroupId()); |
| | | permitGroupData.setUId(uId); |
| | | permitMapper.insert(permitGroupData); |
| | | return new Response<>().set(1, true); |
| | | } else { |
| | | return new Response<>().set(1, false, "添加失败"); |