| | |
| | | import org.springblade.core.tool.support.Kv; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.DigestUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringPool; |
| | | import org.springblade.modules.experience.entity.Experience; |
| | | import org.springblade.modules.experience.service.IExperienceService; |
| | | import org.springblade.modules.jurisdiction.entity.Jurisdiction; |
| | | import org.springblade.modules.jurisdiction.service.JurisdictionService; |
| | | import org.springblade.modules.system.entity.Dept; |
| | | import org.springblade.modules.system.entity.Role; |
| | | import org.springblade.modules.system.entity.User; |
| | |
| | | private final IDeptService iDeptService; |
| | | private final IRoleService roleService; |
| | | private final IExperienceService experienceService; |
| | | |
| | | private final JurisdictionService jurisdictionService; |
| | | |
| | | /** |
| | | * 查询单条 |
| | |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "列表", notes = "传入account和realName") |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R<IPage<UserVO>> pages(@ApiIgnore UserVO user, Query query, Long deptId, BladeUser bladeUser) { |
| | | IPage<UserVO> pages = userService.selectUserPages(Condition.getPage(query), user, deptId, "000000"); |
| | | public R<IPage<UserVO>> pages(@ApiIgnore UserVO user, Query query) { |
| | | IPage<UserVO> pages = userService.selectUserPages(Condition.getPage(query), user); |
| | | return R.data(pages); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | //根据 deptId 查询dept信息,公安管理员 |
| | | Dept dept = iDeptService.getById(user.getDeptId()); |
| | | Long sid = 1123598813738675201L; |
| | | if (dept.getParentId().equals(sid)){ |
| | | //获取辖区的数据 |
| | | Jurisdiction jurisdiction = new Jurisdiction(); |
| | | jurisdiction.setDeptName(dept.getDeptName()); |
| | | Jurisdiction one = jurisdictionService.getOne(Condition.getQueryWrapper(jurisdiction)); |
| | | user.setJurisdiction(one.getId().toString()); |
| | | } |
| | | return R.status(userService.submit(user)); |
| | | } |
| | | |
| | |
| | | @GetMapping("/zc") |
| | | public R zc(String username,String password) { |
| | | User user = new User(); |
| | | user.setTenantId("000000"); |
| | | user.setAccount(username); |
| | | user.setPassword(DigestUtil.encrypt(password)); |
| | | user.setRoleId("1428177141018771458"); |
| | | userService.saveOrUpdate(user); |
| | | return R.success("注册成功"); |
| | | } |
| | |
| | | user.setRoleId(oneRole.getId().toString()); |
| | | } |
| | | } |
| | | //密码加密 |
| | | if (Func.isNotEmpty(user.getPassword())) { |
| | | user.setPassword(DigestUtil.encrypt(user.getPassword())); |
| | | } |
| | | //用户新增 |
| | | boolean status = userService.save(user); |
| | | //获取从业记录 |