| | |
| | | import org.springblade.modules.system.excel.*; |
| | | import org.springblade.modules.system.node.TreeNode; |
| | | import org.springblade.modules.system.service.*; |
| | | import org.springblade.modules.system.vo.UserInfoDetail; |
| | | import org.springblade.modules.system.vo.UserVO; |
| | | import org.springblade.modules.system.wrapper.UserWrapper; |
| | | import org.springblade.modules.training.entity.TrainingRegistration; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 微信注册 |
| | | * @param user |
| | | * @return |
| | | */ |
| | | @PostMapping("/wxRegister") |
| | | public R wxRegister(User user){ |
| | | //密码加密 |
| | | if (Func.isNotEmpty(user.getPassword())) { |
| | | user.setPassword(DigestUtil.encrypt(user.getPassword())); |
| | | } |
| | | |
| | | Boolean result = userService.wxRegister(user); |
| | | return R.status(result); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.dataSync(s1); |
| | | } else { |
| | | //新增 |
| | | if (null != user.getRtime()) { |
| | | experience.setEntrytime(user.getRtime()); |
| | | } else { |
| | | experience.setEntrytime(new Date()); |
| | | } |
| | | experience.setDeparturetime(new Date()); |
| | | experience.setName(user.getRealName()); |
| | | if (null != user.getReasonForLeav() && !user.getReasonForLeav().equals("")) { |
| | |
| | | experience.setSecurityid(user.getId().toString()); |
| | | //新增 |
| | | boolean save = experienceService.save(experience); |
| | | if (save) { |
| | | //内网同步 |
| | | String s = "insert into sys_experience(id,name,entryTime,departureTime,leaving,cardId,companyname,securityId) " + |
| | | "values(" + "'" + experience.getId() + "'" + |
| | | "," + "'" + experience.getName() + "'" + |
| | | "," + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience.getEntrytime()) + "'" + |
| | | "," + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience.getDeparturetime()) + "'" + |
| | | "," + "'" + experience.getLeaving() + "'" + |
| | | "," + "'" + experience.getCardid() + "'" + |
| | | "," + "'" + experience.getCompanyname() + "'" + |
| | | "," + "'" + experience.getSecurityid() + "'" |
| | | + ")"; |
| | | myAsyncService.dataSync(s); |
| | | } |
| | | } |
| | | |
| | | boolean status = userService.updateById(user); |
| | | //qfqk 数据推送 |
| | | if (status) { |
| | | // myAsyncService.updateUserByQfqk(user); |
| | | //内网更新 |
| | | String s1 = |
| | | "update blade_user set status = " + "'" + user.getStatus() + "'" |
| | | + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'" |
| | | + " " + "where id = " + "'" + user.getId() + "'"; |
| | | myAsyncService.dataSync(s1); |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | |
| | | signInRecordsService.updateById(inRecordsServiceOne); |
| | | } |
| | | } |
| | | |
| | | //内网同步 |
| | | String s1 = |
| | | "update blade_user set account = " + "'" + user.getCardid() + "'" |
| | | + ",real_name = " + "'" + user.getRealName() + "'" |
| | | + ",avatar = " + "'" + user.getAvatar() + "'" |
| | | + ",sex = " + "'" + user.getSex() + "'" |
| | | + ",cardid = " + "'" + user.getCardid() + "'" |
| | | + ",nation = " + "'" + user.getNation() + "'" |
| | | + ",fingerprint = " + "'" + url + "'" |
| | | + ",my_picture = " + "'" + user.getMyPicture() + "'" |
| | | + ",address = " + "'" + user.getAddress() + "'" |
| | | + ",registered = " + "'" + user.getRegistered() + "'" |
| | | + ",securitynumber = " + "'" + user.getSecuritynumber() + "'" |
| | | + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'" |
| | | + ",hold = " + "'" + user.getHold() + "'" |
| | | + ",cell = " + "'" + user.getCell() + "'" |
| | | + " " + "where id = " + "'" + user.getId() + "'"; |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.dataSync(s1); |
| | | return R.success("修改成功"); |
| | | } |
| | | |
| | |
| | | return R.success("操作成功"); |
| | | } |
| | | |
| | | // /** |
| | | // * 导出用户 |
| | | // */ |
| | | // @GetMapping("export-user") |
| | | // @ApiOperationSupport(order = 13) |
| | | // @ApiOperation(value = "导出用户", notes = "传入user") |
| | | // public void exportUser(@ApiIgnore @RequestParam Map<String, Object> user, BladeUser bladeUser, HttpServletResponse response) { |
| | | /** |
| | | * 导出用户 |
| | | */ |
| | | @GetMapping("export-user") |
| | | @ApiOperationSupport(order = 13) |
| | | @ApiOperation(value = "导出用户", notes = "传入user") |
| | | public void exportUser(@ApiIgnore @RequestParam Map<String, Object> user, BladeUser bladeUser, HttpServletResponse response) { |
| | | // QueryWrapper<User> queryWrapper = Condition.getQueryWrapper(user, User.class); |
| | | // if (!AuthUtil.isAdministrator()) { |
| | | // queryWrapper.lambda().eq(User::getTenantId, bladeUser.getTenantId()); |
| | | // } |
| | | // queryWrapper.lambda().eq(User::getIsDeleted, BladeConstant.DB_NOT_DELETED); |
| | | // List<UserExcel> list = userService.exportUser(queryWrapper); |
| | | // ExcelUtil.export(response, "用户数据" + DateUtil.time(), "用户数据表", list, UserExcel.class); |
| | | // } |
| | | List<UserExcel> list = userService.exportUser(user); |
| | | ExcelUtil.export(response, "用户数据" + DateUtil.time(), "用户数据表", list, UserExcel.class); |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | securityExcel.setSex("男"); |
| | | securityExcel.setCardid("360XXX19XXXXXX****"); |
| | | securityExcel.setNation("汉"); |
| | | securityExcel.setRegistered("山西省晋城市******"); |
| | | securityExcel.setPermanentResidenceAddress("山西省晋城市******"); |
| | | securityExcel.setEducation("本科"); |
| | | securityExcel.setPoliticaloutlook("群众"); |
| | | securityExcel.setUnitName("晋城市***公司"); |
| | | securityExcel.setAddress("山西省晋城市******"); |
| | | securityExcel.setDwellAddress("山西省晋城市******"); |
| | | securityExcel.setAcceptanceTime("2023/12/01"); |
| | | list.add(securityExcel); |
| | | |
| | | SecurityExcel securityExcel1 = new SecurityExcel(); |
| | |
| | | securityExcel1.setSex("女"); |
| | | securityExcel1.setCardid("360XXX19XXXXXX****"); |
| | | securityExcel1.setNation("汉"); |
| | | securityExcel1.setRegistered("山西省晋城市******"); |
| | | securityExcel1.setPermanentResidenceAddress("山西省晋城市******"); |
| | | securityExcel1.setEducation("本科"); |
| | | securityExcel1.setPoliticaloutlook("党员"); |
| | | securityExcel1.setUnitName("晋城市***公司"); |
| | | securityExcel1.setAddress("山西省晋城市******"); |
| | | securityExcel1.setDwellAddress("山西省晋城市******"); |
| | | securityExcel1.setAcceptanceTime("2023/12/01"); |
| | | list.add(securityExcel1); |
| | | String fileName = null; |
| | | try { |
| | |
| | | public void experienceSave(User user) { |
| | | //从业记录新增 |
| | | Experience experience = new Experience(); |
| | | |
| | | String rtime; |
| | | String paperTime; |
| | | if (user.getRtime() == null) { |
| | | rtime = null; |
| | | } else { |
| | | rtime = new SimpleDateFormat("yyyy-MM-dd").format(user.getRtime()); |
| | | experience.setEntrytime(user.getRtime()); |
| | | } |
| | | Dept dept = iDeptService.getById(user.getDeptId()); |
| | | experience.setCardid(user.getCardid()); |
| | | experience.setSecurityid(user.getId().toString()); |
| | |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.dataSync(s1); |
| | | } else { |
| | | //新增 |
| | | if (null != user.getRtime()) { |
| | | experience.setEntrytime(user.getRtime()); |
| | | } else { |
| | | experience.setEntrytime(new Date()); |
| | | } |
| | | experience.setDeparturetime(new Date()); |
| | | experience.setName(user.getRealName()); |
| | | if (null != user.getReasonForLeav() && !user.getReasonForLeav().equals("")) { |
| | |
| | | public R getNotUpdatePwdInfo() { |
| | | return R.data(userService.getNotUpdatePwdInfo()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 数据处理 |
| | | * @return |
| | | */ |
| | | @GetMapping("/dataHandler") |
| | | public R dataHandler() { |
| | | return R.data(userService.dataHandler()); |
| | | } |
| | | |
| | | |
| | | //获取用户表和用户详情表的信息 |
| | | @GetMapping("/getUserInfoDetail") |
| | | public R getUserInfoDetail(String id){ |
| | | UserInfoDetail userInfoDetail = userService.getUserInfoDetail(id); |
| | | return R.data(userInfoDetail); |
| | | } |
| | | |
| | | @PostMapping("/batchAudit") |
| | | public R batchAudit(String ids,String auditStatus){ |
| | | boolean result = userService.batchAudit(ids,auditStatus); |
| | | return R.status(result); |
| | | } |
| | | |
| | | |
| | | } |