shenyijian
2024-06-17 cc873cace93a40068d6bb6130b601b6c3e845b42
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/service/impl/SgProjectInfoServiceImpl.java
@@ -6,6 +6,7 @@
import cn.gistack.sm.sg.DO.SgProjectInfoDO;
import cn.gistack.sm.sg.DTO.ProjectSearchDTO;
import cn.gistack.sm.sg.VO.SgProjectInfoVO;
import cn.gistack.sm.sg.VO.SgTypeVO;
import cn.gistack.sm.sg.mapper.SgProjectInfoMapper;
import cn.gistack.sm.sg.service.SgProjectInfoService;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -50,16 +51,16 @@
            continue;
         }
         SgProjectInfoDO sgProjectInfoDO = SgProjectInfoDO.builder().id(porId).projectName(value.get(0).getProjectName()).build();
         List<SgGxDO> sgGxDOS = new ArrayList<>();
         //工序分组
         Map<Long, List<SgProjectInfoVO>> GxMap = value.stream().filter(s->s.getGxId()!=null).collect(Collectors.groupingBy(SgProjectInfoVO::getGxId));
         for (Map.Entry<Long, List<SgProjectInfoVO>> gx : GxMap.entrySet()) {
            Long gxId = gx.getKey();
            List<SgProjectInfoVO> gxList = gx.getValue();
         List<SgTypeVO> sgGxDOS = new ArrayList<>();
         //类型分组
         Map<String, List<SgProjectInfoVO>> GxMap = value.stream().filter(s->s.getDeviceType()!=null).collect(Collectors.groupingBy(SgProjectInfoVO::getDeviceType));
         for (Map.Entry<String, List<SgProjectInfoVO>> ty : GxMap.entrySet()) {
            String type = ty.getKey();
            List<SgProjectInfoVO> gxList = ty.getValue();
            if (CollectionUtils.isEmpty(gxList)){
               continue;
            }
            SgGxDO gxDO = SgGxDO.builder().id(gxId).gxName(gxList.get(0).getGxName()).build();
            SgTypeVO typeVO = SgTypeVO.builder().typeName(gxList.get(0).getTypeName()).build();
            List<SgDeviceDO> deviceDOS = new ArrayList<>();
            //设备分组
            Map<Long, List<SgProjectInfoVO>> dMap = gxList.stream().collect(Collectors.groupingBy(SgProjectInfoVO::getDId));
@@ -72,8 +73,8 @@
               sgDeviceDO.setStepDOList(deList.stream().map(s->SgGxStepDO.builder().gxStepName(s.getGxStepName()).approvalStatus(s.getSTATUS()).build()).collect(Collectors.toList()));
               deviceDOS.add(sgDeviceDO);
            }
            gxDO.setDeviceDOS(deviceDOS);
            sgGxDOS.add(gxDO);
            typeVO.setDeviceDOS(deviceDOS);
            sgGxDOS.add(typeVO);
         }
         sgProjectInfoDO.setSgGxDOS(sgGxDOS);
         result.add(sgProjectInfoDO);