| | |
| | | public Boolean insertByBo(SysCompanyBo bo) |
| | | { |
| | | SysCompany add = Convert.convert(SysCompany.class, bo); |
| | | add.setCompanyStatus(1); |
| | | validEntityBeforeSave(add); |
| | | boolean save = this.save(add); |
| | | addCompanyUser(add, 0); |
| | |
| | | if (!delUser) { |
| | | throw new BaseException("原企业用户清除失败,请联系管理员!"); |
| | | } |
| | | this.addCompanyUser(update, 0); |
| | | this.addCompanyUser(update, update.getCompanyStatus()==0 ? 1 : 0); |
| | | } |
| | | validEntityBeforeSave(update); |
| | | return this.updateById(update); |
| | |
| | | user.setPassword(phone); |
| | | user.setDeptId(one.getCompanyId()); |
| | | user.setUserType("02"); |
| | | user.setRecommendUser(user.getPassword()); |
| | | if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user))) |
| | | { |
| | | return; |
| | |
| | | } |
| | | user.setCreateBy(SecurityUtils.getUsername()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | user.setRecommendUser(user.getPassword()); |
| | | userService.insertUser(user); |
| | | } |
| | | |