| | |
| | | user.setCreatetime(new Date()); |
| | | |
| | | User objectUser = UserFactory.createUser(user); |
| | | //查找平台所属公司 |
| | | TCompany company = itCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type", 1).orderBy("id", true).last(" limit 1")); |
| | | if (SinataUtil.isNotEmpty(company)){ |
| | | objectUser.setObjectId(company.getId()); |
| | | } |
| | | Integer objectId = ShiroKit.getUser().getObjectId(); |
| | | objectUser.setObjectId(objectId); |
| | | objectUser.setPassWordUpdate(new Date()); |
| | | this.userService.insert(objectUser); |
| | | |
| | |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | @Autowired |
| | | private ITCompanyService itCompanyService; |
| | | |
| | | /** |
| | | * 冻结用户 |
| | |
| | | } |
| | | assertAuth(userId); |
| | | this.userService.setStatus(userId, ManagerStatus.FREEZED.getCode()); |
| | | |
| | | User user = userService.selectById(userId); |
| | | if (user.getRoleType() == 2){ |
| | | //查询分公司 |
| | | TCompany company = itCompanyService.selectById(user.getObjectId()); |
| | | company.setState(1); |
| | | itCompanyService.updateById(company); |
| | | |
| | | //设置该分公司下的所有司机状态 |
| | | // itDriverService.updateCompanyDriverState(3,company.getId()); |
| | | |
| | | }else if (user.getRoleType() == 3){ |
| | | //查询加盟商 |
| | | TCompany franchisee = itCompanyService.selectById(user.getObjectId()); |
| | | franchisee.setState(1); |
| | | itCompanyService.updateById(franchisee); |
| | | |
| | | //设置该加盟商下的所有司机状态 |
| | | // itDriverService.updateFranchiseeDriverState(3,franchisee.getId()); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | |
| | | } |
| | | assertAuth(userId); |
| | | this.userService.setStatus(userId, ManagerStatus.OK.getCode()); |
| | | |
| | | User user = userService.selectById(userId); |
| | | if (user.getRoleType() == 2){ |
| | | //查询分公司 |
| | | TCompany company = itCompanyService.selectById(user.getObjectId()); |
| | | company.setState(0); |
| | | itCompanyService.updateById(company); |
| | | |
| | | //设置该分公司下的所有司机状态 |
| | | // itDriverService.updateCompanyDriverState(2,company.getId()); |
| | | |
| | | }else if (user.getRoleType() == 3){ |
| | | //查询加盟商 |
| | | TCompany franchisee = itCompanyService.selectById(user.getObjectId()); |
| | | franchisee.setState(0); |
| | | itCompanyService.updateById(franchisee); |
| | | |
| | | //设置该加盟商下的所有司机状态 |
| | | // itDriverService.updateFranchiseeDriverState(2,franchisee.getId()); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |