| | |
| | | + ",role_id = " + "'" + user.getRoleId() + "'" |
| | | + ",dept_id = " + "'" + user.getDeptId() + "'" |
| | | + ",cardid = " + "'" + user.getCardid() + "'" |
| | | + ",guncode = " + "'" + user.getGuncode() + "'" |
| | | + " " + "where id = " + "'" + user.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | } |
| | |
| | | + ",hold = " + "'" + user.getHold() + "'" |
| | | + ",jurisdiction = " + "'" + user.getJurisdiction() + "'" |
| | | + ",reason_for_leav = " + "'" + user.getReasonForLeav() + "'" |
| | | + ",guncode = " + "'" + user.getGuncode() + "'" |
| | | + " " + "where id = " + "'" + user.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | return R.success("修改成功"); |
| | |
| | | return R.success("操作成功"); |
| | | } |
| | | |
| | | /** |
| | | * 导入持枪保安员 |
| | | */ |
| | | @PostMapping("import-securityYy") |
| | | @ApiOperationSupport(order = 12) |
| | | @ApiOperation(value = "导入用户", notes = "传入excel") |
| | | public R importSecurityYy(MultipartFile file, Integer isCovered,String deptId) { |
| | | SecurityYyImporter securityYyImporter = new SecurityYyImporter(userService, false,deptId); |
| | | ExcelUtil.save(file, securityYyImporter, SecurityYyExcel.class); |
| | | return R.success("操作成功"); |
| | | } |
| | | |
| | | // /** |
| | | // * 导出用户 |
| | | // */ |
| | |
| | | public void exportUser(HttpServletResponse response) { |
| | | List<UserExcel> list = new ArrayList<>(); |
| | | ExcelUtil.export(response, "用户数据模板", "用户数据表", list, UserExcel.class); |
| | | } |
| | | |
| | | /** |
| | | * 导出持枪保安模板 |
| | | */ |
| | | @GetMapping("export-templateYy") |
| | | @ApiOperationSupport(order = 14) |
| | | @ApiOperation(value = "导出模板") |
| | | public void exportUserYy(HttpServletResponse response) { |
| | | List<SecurityYyExcel> list = new ArrayList<>(); |
| | | ExcelUtil.export(response, "持枪保安员数据模板", "持枪保安员数据表", list, SecurityYyExcel.class); |
| | | } |
| | | |
| | | /** |
| | |
| | | response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
| | | //修改单元格格式为文本格式 |
| | | EasyExcel.write(response.getOutputStream(), SecurityExcel.class).sheet("保安员数据表").registerWriteHandler(new RowWriteHandler()).doWrite(list); |
| | | } catch (Throwable var6) { |
| | | throw var6; |
| | | } |
| | | // ExcelUtil.export(response, "保安员导入数据模板", "保安员数据表", list, UserExcel.class); |
| | | } |
| | | |
| | | /** |
| | | * 持枪保安员导出模板 |
| | | */ |
| | | @GetMapping("export-template-securityYy") |
| | | @ApiOperationSupport(order = 14) |
| | | @ApiOperation(value = "导出模板") |
| | | public void exportSecurityYy(HttpServletResponse response) throws IOException { |
| | | List<SecurityYyExcel> list = new ArrayList<>(); |
| | | SecurityYyExcel securityExcel = new SecurityYyExcel(); |
| | | securityExcel.setDeptId("xxx保安公司"); |
| | | securityExcel.setRealName("张三"); |
| | | securityExcel.setPhone("12345678901"); |
| | | securityExcel.setSex("男"); |
| | | securityExcel.setCardid("360XXX19XXXXXX****"); |
| | | securityExcel.setNation("汉"); |
| | | securityExcel.setRegistered("江西省南昌市******"); |
| | | securityExcel.setHold("是"); |
| | | securityExcel.setSecuritynumber("赣洪202100001"); |
| | | list.add(securityExcel); |
| | | |
| | | SecurityYyExcel securityExcel1 = new SecurityYyExcel(); |
| | | securityExcel1.setDeptId("xxx保安公司"); |
| | | securityExcel1.setRealName("李四"); |
| | | securityExcel1.setPhone("12345678901"); |
| | | securityExcel1.setSex("女"); |
| | | securityExcel1.setCardid("360XXX19XXXXXX****"); |
| | | securityExcel1.setNation("汉"); |
| | | securityExcel1.setRegistered("江西省南昌市******"); |
| | | securityExcel1.setHold("否"); |
| | | securityExcel1.setSecuritynumber(""); |
| | | list.add(securityExcel1); |
| | | String fileName = null; |
| | | try { |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding(org.apache.commons.codec.Charsets.UTF_8.name()); |
| | | fileName = URLEncoder.encode("保安员导入数据模板"+DateUtil.time(), Charsets.UTF_8.name()); |
| | | response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
| | | //修改单元格格式为文本格式 |
| | | EasyExcel.write(response.getOutputStream(), SecurityYyExcel.class).sheet("保安员数据表").registerWriteHandler(new RowWriteHandler()).doWrite(list); |
| | | } catch (Throwable var6) { |
| | | throw var6; |
| | | } |
| | |
| | | "id,tenant_id,account,password,name,real_name,avatar,email,phone,sex," + |
| | | "role_id,dept_id,cardid,nativePlace,nation,fingerprint,education," + |
| | | "politicaloutlook,healstats,height,address,registered,rtime," + |
| | | "securitynumber,hold,jurisdiction,examination_type,status,is_deleted,dispatch) " + |
| | | "securitynumber,hold,jurisdiction,examination_type,status,is_deleted,dispatch,guncode) " + |
| | | "values(" + "'" + user.getId() + "'" + |
| | | "," + "'" + user.getTenantId() + "'" + |
| | | "," + "'" + user.getAccount() + "'" + |
| | |
| | | "," + "'" + user.getExaminationType() + "'" + |
| | | "," + "'" + user.getStatus() + "'" + |
| | | "," + "'" + user.getIsDeleted() + "'" + |
| | | "," + "'" + user.getDispatch() + "'" + ")"; |
| | | "," + "'" + user.getIsDeleted() + "'" + |
| | | "," + "'" + user.getGuncode() + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s); |
| | | |
| | | //获取从业记录 |