| | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * 控制器 |
| | | * |
| | | * @author BladeX |
| | | * @since 2020-09-08 |
| | |
| | | |
| | | IPage<ZcVO> page = zcService.selectZcPage(Condition.getPage(query), zc); |
| | | for (int j = 0; j < page.getRecords().size(); j++) { |
| | | if (page.getRecords().get(j).getDeptid() != null && !page.getRecords().get(j).getDeptid().equals("")){ |
| | | if (page.getRecords().get(j).getDeptid() != null && !page.getRecords().get(j).getDeptid().equals("")) { |
| | | String[] split = page.getRecords().get(j).getDeptid().split(","); |
| | | List<String> list = Arrays.asList(split); |
| | | StringBuffer deptNameBuiffer = new StringBuffer(); |
| | | //数据匹配封装 |
| | | for (String deptId:list) { |
| | | for (DeptVo deptVo:deptVos) { |
| | | if (deptId.equals(deptVo.getId().toString())){ |
| | | for (String deptId : list) { |
| | | for (DeptVo deptVo : deptVos) { |
| | | if (deptId.equals(deptVo.getId().toString())) { |
| | | deptNameBuiffer.append(deptVo.getDeptName()).append(","); |
| | | } |
| | | } |
| | | } |
| | | //封装部门名称数据 |
| | | page.getRecords().get(j).setDeptName(deptNameBuiffer.substring(0,deptNameBuiffer.length()-1)); |
| | | if (deptNameBuiffer.length() > 0) { |
| | | page.getRecords().get(j).setDeptName(deptNameBuiffer.substring(0, deptNameBuiffer.length() - 1)); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | for (int j = 0; j < page.getRecords().size(); j++) { |
| | | if (page.getRecords().get(j).getJurisdiction() != null && !page.getRecords().get(j).getJurisdiction().equals("")){ |
| | | if (page.getRecords().get(j).getJurisdiction() != null && !page.getRecords().get(j).getJurisdiction().equals("")) { |
| | | String[] split = page.getRecords().get(j).getJurisdiction().split(","); |
| | | List<String> list = Arrays.asList(split); |
| | | StringBuffer deptNameBuiffer = new StringBuffer(); |
| | | //数据匹配封装 |
| | | for (String deptId:list) { |
| | | for (DeptVo deptVo:xqVos) { |
| | | if (deptId.equals(deptVo.getId().toString())){ |
| | | for (String deptId : list) { |
| | | for (DeptVo deptVo : xqVos) { |
| | | if (deptId.equals(deptVo.getId().toString())) { |
| | | deptNameBuiffer.append(deptVo.getDeptName()).append(","); |
| | | } |
| | | } |
| | | } |
| | | //封装部门名称数据 |
| | | page.getRecords().get(j).setXQName(deptNameBuiffer.substring(0,deptNameBuiffer.length()-1)); |
| | | if (deptNameBuiffer.length() > 0) { |
| | | page.getRecords().get(j).setXQName(deptNameBuiffer.substring(0, deptNameBuiffer.length() - 1)); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "新增或修改", notes = "传入zc") |
| | | public R submit(@Valid @RequestBody Zc zc) { |
| | | String type = zc.getType(); |
| | | if (type.equals("1")){ |
| | | if (type.equals("1")) { |
| | | User user = new User(); |
| | | user.setAccount(zc.getUsername()); |
| | | user.setPassword(DigestUtil.encrypt(zc.getPassword())); |
| | |
| | | zcService.inster(zc); |
| | | |
| | | String s = "insert into act_zc(id,username,password,sname,sex,phone,zctime,deptid,parent_id,jurisdiction,cardid)" + |
| | | "values(" + zc.getId() + "'" + |
| | | "values(" + "'" + zc.getId() + "'" + |
| | | "," + "'" + zc.getUsername() + "'" + |
| | | "," + "'" + zc.getPassword() + "'" + |
| | | "," + "'" + zc.getSname() + "'" + |