| | |
| | | import com.project.common.utils.StringUtils; |
| | | import com.project.common.utils.poi.ExcelUtil; |
| | | import com.project.system.domain.bo.editBo.UserDeptBo; |
| | | import com.project.system.domain.vo.SysUserResultVo; |
| | | import com.project.system.domain.vo.SysUserVo; |
| | | import com.project.system.service.*; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysUser user) |
| | | { |
| | | |
| | | user.setPassword(user.getPhonenumber()); |
| | | if (user.getDeptId()!=null){ |
| | | user.setUserType("01"); |
| | | SysDept sysDept = deptService.selectDeptById(user.getDeptId()); |
| | |
| | | { |
| | | userService.checkUserAllowed(user); |
| | | userService.checkUserDataScope(user.getUserId()); |
| | | user.setPassword(user.getPhonenumber()); |
| | | if (user.getDeptId()!=null){ |
| | | SysDept sysDept = deptService.selectDeptById(user.getDeptId()); |
| | | if (sysDept.getAncestors().contains("101") || sysDept.getDeptId().equals(101L)){ |
| | | user.setUserType("01"); |
| | | user.setUserType("00"); |
| | | } |
| | | } |
| | | if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user))) |
| | |
| | | public AjaxResult batchUserDeptSave(@RequestBody UserDeptBo bo) |
| | | { |
| | | return AjaxResult.success(userDeptService.batchUserDeptSave(bo)); |
| | | } |
| | | |
| | | @ApiOperation("用户多机构——机构树") |
| | | @GetMapping("/batchUserDeptTree") |
| | | public AjaxResult batchUserDeptTree(@RequestParam("deptId") Long deptId) |
| | | { |
| | | return AjaxResult.success(userDeptService.batchUserDeptTree(deptId)); |
| | | } |
| | | |
| | | @ApiOperation("企业用户重置密码") |
| | |
| | | return AjaxResult.success(userService.doImport(list, deptId)); |
| | | } |
| | | |
| | | // @ApiOperation(value = "校验导入信息") |
| | | // @Log(title = "导入用户信息校验" , businessType = BusinessType.OTHER) |
| | | // @PostMapping("/checkImport") |
| | | // public AjaxResult checkImport(@RequestBody SysCompanyResultVo resultVo) |
| | | // { |
| | | // return AjaxResult.success(userService.checkImport(resultVo)); |
| | | // } |
| | | // |
| | | // @ApiOperation(value = "保存导入信息") |
| | | // @Log(title = "导入用户信息保存" , businessType = BusinessType.IMPORT) |
| | | // @PostMapping("/saveImport") |
| | | // public AjaxResult saveImport(@RequestBody SysCompanyResultVo resultVo) |
| | | // { |
| | | // return toAjax(userService.saveImport(resultVo) ? 1 : 0); |
| | | // } |
| | | @ApiOperation(value = "校验导入信息") |
| | | @Log(title = "导入用户信息校验" , businessType = BusinessType.OTHER) |
| | | @PostMapping("/checkImport") |
| | | public AjaxResult checkImport(@RequestBody SysUserResultVo resultVo) |
| | | { |
| | | return AjaxResult.success(userService.checkImport(resultVo)); |
| | | } |
| | | |
| | | @ApiOperation(value = "保存导入信息") |
| | | @Log(title = "导入用户信息保存" , businessType = BusinessType.IMPORT) |
| | | @PostMapping("/saveImport") |
| | | public AjaxResult saveImport(@RequestBody SysUserResultVo resultVo) |
| | | { |
| | | return toAjax(userService.saveImport(resultVo) ? 1 : 0); |
| | | } |
| | | |
| | | } |