| | |
| | | |
| | | for (int j = 0; j < page.getRecords().size(); j++) { |
| | | if (page.getRecords().get(j).getWorkjurisdiction() != null && !page.getRecords().get(j).getWorkjurisdiction().equals("")) { |
| | | String[] split = page.getRecords().get(j).getJurisdiction().split(","); |
| | | String[] split = page.getRecords().get(j).getWorkjurisdiction().split(","); |
| | | List<String> list = Arrays.asList(split); |
| | | StringBuffer deptNameBuiffer = new StringBuffer(); |
| | | //数据匹配封装 |
| | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @PostMapping("/inster") |
| | | /* @PostMapping("/inster") |
| | | @ApiOperation(value = "新增", notes = "传入zc") |
| | | public R inster(@Valid @RequestBody Zc zc) { |
| | | //当前时间 |
| | |
| | | zcService.inster(zc); |
| | | System.out.println("插入id++++++++++++"+zc.getId()); |
| | | //内网储存完整数据 |
| | | String s = "insert into act_zc(id,username,password,sname,sex,phone,zctime,parent_id,jurisdiction,cardid,address)" + |
| | | String s = "insert into act_zc(id,username,password,sname,sex,phone,zctime,parent_id,jurisdiction,cardid,address,workjurisdiction)" + |
| | | "values(" + "'" + zc.getId() + "'" + |
| | | "," + "'" + zc.getUsername() + "'" + |
| | | "," + "'" + zc.getPassword() + "'" + |
| | |
| | | "," + "'" + zc.getParentId() + "'" + |
| | | "," + "'" + zc.getJurisdiction() + "'" + |
| | | "," + "'" + cardids + "'" + |
| | | "," + "'" + zc.getAddress() + "'" |
| | | "," + "'" + zc.getAddress() + "'" + |
| | | "," + "'" + zc.getWorkjurisdiction() + "'" |
| | | + ");" |
| | | + |
| | | "insert into blade_user(account,password,real_name,sex,phone,workjurisdiction,role_id,jurisdiction,cardid,address)" + |
| | |
| | | // + ")"; |
| | | FtpUtil.sqlFileUpload(s); |
| | | return R.success("新增成功"); |
| | | }*/ |
| | | |
| | | @PostMapping("/inster") |
| | | @ApiOperation(value = "新增", notes = "传入zc") |
| | | public R inster(@Valid @RequestBody Zc zc) { |
| | | //当前时间 |
| | | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String times = df.format(new Date()); |
| | | zc.setZctime(times); |
| | | |
| | | //保留未脱敏数据 |
| | | String names = zc.getSname(); |
| | | String cardids = zc.getCardid(); |
| | | String phones = zc.getPhone(); |
| | | |
| | | //数据脱敏处理 |
| | | // String name = DesensitizedUtil.desensitizedName(zc.getSname()); |
| | | // String cardid = DesensitizedUtil.desensitizedIdNumber(zc.getCardid()); |
| | | // String phone = DesensitizedUtil.desensitizedPhoneNumber(zc.getPhone()); |
| | | |
| | | //帐号默认姓+身份证后四位 |
| | | zc.setUsername(zc.getPhone()); |
| | | Integer userCount = iUserService.selectCount(zc.getUsername()); |
| | | if (userCount > 0) { |
| | | throw new org.springblade.core.log.exception.ServiceException(StringUtil.format("当前用户 [{}] 已存在!", zc.getUsername())); |
| | | } |
| | | |
| | | |
| | | |
| | | zcService.inster(zc); |
| | | System.out.println("插入id++++++++++++"+zc.getId()); |
| | | //内网储存完整数据 |
| | | String s = "insert into act_zc(id,username,password,sname,sex,phone,zctime,parent_id,jurisdiction,cardid,address,workjurisdiction)" + |
| | | "values(" + "'" + zc.getId() + "'" + |
| | | "," + "'" + zc.getUsername() + "'" + |
| | | "," + "'" + zc.getPassword() + "'" + |
| | | "," + "'" + names + "'" + |
| | | "," + "'" + zc.getSex() + "'" + |
| | | "," + "'" + phones + "'" + |
| | | "," + "'" + zc.getZctime() + "'" + |
| | | "," + "'" + zc.getParentId() + "'" + |
| | | "," + "'" + zc.getJurisdiction() + "'" + |
| | | "," + "'" + cardids + "'" + |
| | | "," + "'" + zc.getAddress() + "'" + |
| | | "," + "'" + zc.getWorkjurisdiction() + "'" |
| | | + ");" |
| | | + |
| | | "insert into blade_user(account,password,real_name,sex,phone,workjurisdiction,role_id,jurisdiction,cardid,address)" + |
| | | "values(" + |
| | | "'" + zc.getUsername() + "'" + |
| | | "," + "'" + DigestUtil.encrypt(zc.getPassword()) + "'" + |
| | | "," + "'" + names + "'" + |
| | | "," + "'" + zc.getSex() + "'" + |
| | | "," + "'" + phones + "'" + |
| | | "," + "'" + zc.getWorkjurisdiction() + "'" + |
| | | "," + "'" + zc.getParentId() + "'" + |
| | | "," + "'" + zc.getJurisdiction() + "'" + |
| | | "," + "'" + cardids + "'" + |
| | | "," + "'" + zc.getAddress() + "'" |
| | | + ")"; |
| | | System.out.println("插入语句++++++++++++"+s); |
| | | //同时新增到用户表 |
| | | User user = new User(); |
| | | user.setAccount(zc.getUsername()); |
| | | user.setPassword(DigestUtil.encrypt(zc.getPassword())); |
| | | user.setRealName(zc.getSname()); |
| | | user.setSex(Integer.valueOf(zc.getSex())); |
| | | user.setPhone(zc.getPhone()); |
| | | //user.setDeptId(zc.getDeptid()); |
| | | user.setRoleId(zc.getParentId()); |
| | | user.setWorkaddress(zc.getWorkaddress()); |
| | | user.setWorkjurisdiction(zc.getWorkjurisdiction()); |
| | | user.setExamination_type("0"); |
| | | user.setExamination_mx("正常"); |
| | | user.setFirstlogin("0"); |
| | | user.setCardid(zc.getCardid()); |
| | | user.setTeam(zc.getTeam()); |
| | | if (!zc.getSignals().equals("")) { |
| | | user.setSignals(zc.getSignals()); |
| | | } |
| | | user.setStype("0"); |
| | | if (!zc.getAddress().equals("")) { |
| | | user.setAddress(zc.getAddress()); |
| | | user.setJurisdiction(zc.getJurisdiction()); |
| | | } |
| | | if (!zc.getJobUnit().equals("")) { |
| | | user.setJobUnit(zc.getJobUnit()); |
| | | } |
| | | iUserService.saveOrUpdate(user); |
| | | |
| | | // String s = "insert into act_zc(id,username,password,sname,sex,phone,zctime,deptid,parent_id,jurisdiction,cardid,address)" + |
| | | // "values(" + "'" + zc.getId() + "'" + |
| | | // "," + "'" + zc.getUsername() + "'" + |
| | | // "," + "'" + zc.getPassword() + "'" + |
| | | // "," + "'" + zc.getSname() + "'" + |
| | | // "," + "'" + zc.getSex() + "'" + |
| | | // "," + "'" + zc.getPhone() + "'" + |
| | | // "," + "'" + zc.getZctime() + "'" + |
| | | // "," + "'" + zc.getDeptid() + "'" + |
| | | // "," + "'" + zc.getParentId() + "'" + |
| | | // "," + "'" + zc.getJurisdiction() + "'" + |
| | | // "," + "'" + zc.getCardid() + "'" + |
| | | // "," + "'" + zc.getAddress() + "'" |
| | | // + ")"; |
| | | FtpUtil.sqlFileUpload(s); |
| | | return R.success("新增成功"); |
| | | } |
| | | |
| | | /** |