| | |
| | | @PostMapping("/securitySaves") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R securitySaves(@RequestBody User user) { |
| | | Integer userCount = userService.selectCount(user.getAccount()); |
| | | //判断用户是否存在 |
| | | if (userCount > 0) { |
| | | throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount())); |
| | | } |
| | | // Integer userCount = userService.selectCount(user.getAccount()); |
| | | // //判断用户是否存在 |
| | | // if (userCount > 0) { |
| | | // throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount())); |
| | | // } |
| | | user.setRoleId("1495714343888039937"); |
| | | user.setDeptId("1424615972718895106"); |
| | | user.setStype("1"); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 保安员新增(数据同步调用) |
| | | * 保安员修改(数据同步调用) |
| | | */ |
| | | @PostMapping("/updateBySecurtiy") |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | User user1 = new User(); |
| | | user1.setIsDeleted(0); |
| | | user1.setStatus(1); |
| | | user1.setCardid(user.getCardid()); |
| | | // user1.setCardid(user.getCardid()); |
| | | user1.setSecurityId(user.getSecurityId()); |
| | | User one = userService.getOne(Condition.getQueryWrapper(user1)); |
| | | boolean status = false; |
| | | if (null!=one){ |
| | |
| | | User user1 = new User(); |
| | | user1.setIsDeleted(0); |
| | | user1.setStatus(1); |
| | | user1.setCardid(user.getOldCardid()); |
| | | user1.setSecurityId(user.getSecurityId()); |
| | | // user1.setCardid(user.getOldCardid()); |
| | | User one = userService.getOne(Condition.getQueryWrapper(user1)); |
| | | boolean status = false; |
| | | if (null!=one){ |
| | | //修改 |
| | | one.setAccount(user.getCardid()); |
| | | one.setCardid(user.getCardid()); |
| | | one.setPassword(user.getPassword()); |
| | | one.setAvatar(user.getAvatar()); |
| | | one.setPhone(user.getPhone()); |
| | | one.setRealName(user.getRealName()); |
| | | if (null!= one.getAccount()) { |
| | | one.setAccount(user.getAccount()); |
| | | } |
| | | if (null!= one.getCardid()) { |
| | | one.setCardid(user.getCardid()); |
| | | } |
| | | if (null!= one.getPassword()) { |
| | | one.setPassword(user.getPassword()); |
| | | } |
| | | if (null!= one.getAvatar()) { |
| | | one.setAvatar(user.getAvatar()); |
| | | } |
| | | if (null!= one.getPhone()) { |
| | | one.setPhone(user.getPhone()); |
| | | } |
| | | if (null!= one.getRealName()) { |
| | | one.setRealName(user.getRealName()); |
| | | } |
| | | one.setUpdateTime(new Date()); |
| | | //用户修改 |
| | | status = userService.updateById(one); |
| | |
| | | User user1 = new User(); |
| | | user1.setIsDeleted(0); |
| | | user1.setStatus(1); |
| | | user1.setCardid(user.getCardid()); |
| | | user1.setSecurityId(user.getSecurityId()); |
| | | // user1.setCardid(user.getCardid()); |
| | | User one = userService.getOne(Condition.getQueryWrapper(user1)); |
| | | boolean status = false; |
| | | if (null!=one){ |
| | |
| | | return R.data(res); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 首次登录发送祝贺信 |
| | | */ |
| | | @GetMapping("/firstLogin") |
| | | public R firstLogin(String id) { |
| | | return R.status(userService.firstLogin(id)); |
| | | } |
| | | } |
| | | |