| | |
| | | import cn.gistack.sm.sg.mapper.SgGxStepMapper; |
| | | import cn.gistack.sm.sg.mapper.SgProgressReportMapper; |
| | | import cn.gistack.sm.sg.mapper.SgProjectInfoMapper; |
| | | import cn.gistack.sm.sg.service.SgProgressReportService; |
| | | import cn.gistack.sm.sg.service.SgProjectInfoService; |
| | | import cn.gistack.sm.sjztmd.entity.AttAdBase; |
| | | import cn.gistack.sm.sjztmd.service.IAttAdBaseService; |
| | |
| | | } |
| | | sgProjectInfoDOS.forEach(s->{ |
| | | //土建 |
| | | if (StringUtils.isNotBlank(s.getConstructionUnit())){ |
| | | s.setConstructionUnit(deptMap.get(Long.valueOf(s.getConstructionUnit()))); |
| | | } |
| | | s.setConstructionPerson(getUserNames(userMap, s.getConstructionPerson())); |
| | | String constructionUnit = s.getConstructionUnit(); |
| | | s.setConstructionUnit(getUserOrDeptNames(deptMap,s.getConstructionUnit())); |
| | | s.setConstructionPerson(getUserOrDeptNames(userMap, s.getConstructionPerson())); |
| | | |
| | | //设备 |
| | | if (StringUtils.isNotBlank(s.getSelfUnit())){ |
| | | s.setSelfUnit(deptMap.get(Long.valueOf(s.getSelfUnit()))); |
| | | } |
| | | s.setSelfPerson(getUserNames(userMap, s.getSelfPerson())); |
| | | s.setSelfUnit(getUserOrDeptNames(deptMap,s.getSelfUnit())); |
| | | s.setSelfPerson(getUserOrDeptNames(userMap, s.getSelfPerson())); |
| | | |
| | | //设计 |
| | | if (StringUtils.isNotBlank(s.getDesignUnit())){ |
| | | s.setDesignUnit(deptMap.get(Long.valueOf(s.getDesignUnit()))); |
| | | } |
| | | s.setDesignPerson(getUserNames(userMap, s.getDesignPerson())); |
| | | s.setDesignUnit(getUserOrDeptNames(deptMap, s.getDesignUnit())); |
| | | s.setDesignPerson(getUserOrDeptNames(userMap, s.getDesignPerson())); |
| | | |
| | | //监理 |
| | | if (StringUtils.isNotBlank(s.getControlUnit())){ |
| | | s.setControlUnit(deptMap.get(Long.valueOf(s.getControlUnit()))); |
| | | } |
| | | s.setControlPerson(getUserNames(userMap, s.getControlPerson())); |
| | | s.setControlUnit(getUserOrDeptNames(deptMap, s.getControlUnit())); |
| | | s.setControlPerson(getUserOrDeptNames(userMap, s.getControlPerson())); |
| | | |
| | | //检测 |
| | | if (StringUtils.isNotBlank(s.getAcceptanceUnit())){ |
| | | s.setAcceptanceUnit(deptMap.get(Long.valueOf(s.getAcceptanceUnit()))); |
| | | } |
| | | s.setAcceptancePerson(getUserNames(userMap, s.getAcceptancePerson())); |
| | | s.setAcceptanceUnit(getUserOrDeptNames(deptMap, s.getAcceptanceUnit())); |
| | | s.setAcceptancePerson(getUserOrDeptNames(userMap, s.getAcceptancePerson())); |
| | | }); |
| | | return sgProjectInfoDOS; |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取用户姓名 |
| | | * @param userMap |
| | | * 获取用户或者部门姓名 |
| | | * @return |
| | | */ |
| | | private String getUserNames(Map<Long, String> userMap,String person ) { |
| | | String userNames = ""; |
| | | if (StringUtils.isNotBlank(person)){ |
| | | private String getUserOrDeptNames(Map<Long, String> map, String param ) { |
| | | String result = ""; |
| | | if (StringUtils.isNotBlank(param)){ |
| | | // 使用Stream API来处理分割和映射 |
| | | userNames = Arrays.stream(person.split(",")) // 将字符串按逗号分割成数组,并转为Stream |
| | | result = Arrays.stream(param.split(",")) // 将字符串按逗号分割成数组,并转为Stream |
| | | .map(Long::valueOf) // 将每个字符串元素转换为Long |
| | | .map(userMap::get) // 使用userMap将Long映射为对应的用户名 |
| | | .map(map::get) // 使用userMap将Long映射为对应的用户名 |
| | | .collect(Collectors.joining(",")); // 使用逗号将用户名拼接成一个字符串 |
| | | return userNames; |
| | | return result; |
| | | } |
| | | return userNames; |
| | | return result; |
| | | } |
| | | |
| | | /** |