| | |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.StringPool; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.excel.SecurityExcel; |
| | | import org.springblade.modules.system.excel.UserExcel; |
| | | import org.springblade.modules.system.excel.UserImporter; |
| | | import org.springblade.modules.system.service.IUserService; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "查看详情", notes = "传入id") |
| | | @GetMapping("/detail") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R<UserVO> detail(User user) { |
| | | User detail = userService.getOne(Condition.getQueryWrapper(user)); |
| | | return R.data(UserWrapper.build().entityVO(detail)); |
| | |
| | | |
| | | |
| | | /** |
| | | * 自定义用户列表, |
| | | */ |
| | | @GetMapping("/pages") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "account", value = "账号名", paramType = "query", dataType = "string"), |
| | | @ApiImplicitParam(name = "realName", value = "姓名", paramType = "query", dataType = "string") |
| | | }) |
| | | public R<IPage<UserVO>> pages(@ApiIgnore UserVO user, Query query) { |
| | | IPage<User> pages = userService.selectUserPages(Condition.getPage(query), user); |
| | | return R.data(UserWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 自定义用户列表(只有保安员) |
| | | */ |
| | | @GetMapping("/page-security") |
| | | public R<IPage<UserVO>> pageSecurity(@ApiIgnore UserVO user, Query query, Long deptId, BladeUser bladeUser) { |
| | | user.setAccount("admin"); |
| | | IPage<UserVO> pages = userService.selectUserPageSecurity(Condition.getPage(query), user, deptId, (bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID) ? StringPool.EMPTY : bladeUser.getTenantId())); |
| | | public R<IPage<UserVO>> pageSecurity(@ApiIgnore UserVO user, Query query) { |
| | | //user.setAccount("admin"); |
| | | IPage<UserVO> pages = userService.selectUserPageSecurity(Condition.getPage(query), user); |
| | | return R.data(pages); |
| | | } |
| | | |
| | |
| | | public R submit(@Valid @RequestBody User user) { |
| | | CacheUtil.clear(USER_CACHE); |
| | | //资格审查 |
| | | String body = InvestigateUtil.httpGet(user.getCardid()); |
| | | String body = InvestigateUtil.httpGetOne(user.getCardid()); |
| | | JSONObject jsonObject = new JSONObject(body); |
| | | String data = jsonObject.get("data").toString(); |
| | | JSONObject jsonData = new JSONObject(data); |
| | |
| | | user.setExaminationType("0"); |
| | | }else { |
| | | user.setExaminationType("1"); |
| | | user.setExaminationMx(res.getJSONObject(0).get("zdxsfzqkry").toString()); |
| | | user.setExaminationMx(res.getJSONObject(0).get("zdrylbjh").toString()); |
| | | } |
| | | return R.status(userService.submit(user)); |
| | | } |
| | |
| | | public R update(@Valid @RequestBody User user) { |
| | | CacheUtil.clear(USER_CACHE); |
| | | return R.status(userService.updateUser(user)); |
| | | } |
| | | |
| | | /** |
| | | * 修改用户信息 |
| | | */ |
| | | @PostMapping("/updateUser") |
| | | public R updateUser(@Valid @RequestBody User user) { |
| | | user.setUpdateTime(new Date()); |
| | | return R.status(userService.updateById(user)); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 导出用户审查明细 |
| | | */ |
| | | @GetMapping("export-security") |
| | | @ApiOperationSupport(order = 13) |
| | | @ApiOperation(value = "导出用户", notes = "传入user") |
| | | public void exportSecurity(UserVO user, HttpServletResponse response) { |
| | | List<SecurityExcel> list = userService.exportSecurity(user); |
| | | ExcelUtil.export(response, "保安员审查数据" + DateUtil.time(), "保安员审查数据表", list, SecurityExcel.class); |
| | | } |
| | | |
| | | /** |
| | | * 导出模板 |
| | | */ |
| | | @GetMapping("export-template") |
| | |
| | | return R.success("吊销成功"); |
| | | } |
| | | |
| | | /** |
| | | * 查询押运人员 |
| | | * |
| | | * @return |
| | | */ |
| | | @GetMapping("/selectPeo") |
| | | public R selectPeo(@ApiIgnore UserVO user) { |
| | | List list = userService.selectPeo(user); |
| | | return R.data(list); |
| | | } |
| | | |
| | | /** |
| | | * 查询保安员信息 |
| | | * @param user |
| | | * @return |
| | | */ |
| | | @GetMapping("/getSecurityInfoByIdCardNo") |
| | | public R getSecurityInfoByIdCardNo(User user){ |
| | | return R.data(userService.getSecurityInfoByIdCardNo(user)); |
| | | } |
| | | |
| | | } |