| | |
| | | @Autowired |
| | | private SgProjectInfoServiceImpl sgProjectInfoService; |
| | | |
| | | @Autowired |
| | | private SgGxMapper sgGxMapper; |
| | | |
| | | |
| | | |
| | | ExecutorService cachedThreadPool = Executors.newCachedThreadPool(); |
| | |
| | | } |
| | | @Override |
| | | public IPage<SgProgressReportVO> queryPageListAll(IPage<SgProgressReportVO> page, ProjectSearchDTO searchDTO) { |
| | | if (StringUtils.isNotBlank(searchDTO.getTypeName())){ |
| | | List<String> childType = sgGxMapper.childType(searchDTO.getTypeName()); |
| | | searchDTO.setChildTypeList(childType); |
| | | } |
| | | List<SgProgressReportVO> list = sgProgressReportMapper.queryPageListAll(page,searchDTO); |
| | | if(list != null){ |
| | | list.forEach(s ->{ |
| | |
| | | |
| | | } |
| | | |
| | | if (sgProgressReportDOS1!= null && sgProgressReportDOS1.size() > 0) { |
| | | for (SgProgressReportDO sgProgressReportDO1 : sgProgressReportDOS1) { |
| | | if (sgProgressReportDO1.getStatus()!= 2 && sgProgressReportDO1.getStatus()!= 3) { |
| | | throw new ServiceException("请先完成施工准备的审批!"); |
| | | } |
| | | } |
| | | } else if (sgProgressReportDOS1 == null || (!sgProgressReportDO.getGxStepName().equals("施工准备"))) { |
| | | throw new ServiceException("请先发起施工准备的审批!"); |
| | | } |
| | | // if (sgProgressReportDOS1!= null && sgProgressReportDOS1.size() > 0) { |
| | | // for (SgProgressReportDO sgProgressReportDO1 : sgProgressReportDOS1) { |
| | | // if (sgProgressReportDO1.getStatus()!= 2 && sgProgressReportDO1.getStatus()!= 3) { |
| | | // throw new ServiceException("请先完成施工准备的审批!"); |
| | | // } |
| | | // } |
| | | // } else if (sgProgressReportDOS1 == null || (!sgProgressReportDO.getGxStepName().equals("施工准备"))) { |
| | | // throw new ServiceException("请先发起施工准备的审批!"); |
| | | // } |
| | | Long gxDeviceId = sgProgressReportDO.getGxDeviceId(); |
| | | Long gxStepId = sgProgressReportDO.getGxStepId(); |
| | | SgGxStepDO sgGxStepDO = sgGxStepMapper.selectById(gxStepId); |
| | | List<SgGxStepDO> list = sgGxStepMapper.selectByGxInfoId(sgGxStepDO.getGxInfoId()); |
| | | QueryWrapper<SgProgressReportDO> wrapper = new QueryWrapper<>(); |
| | | wrapper.in("status",Arrays.asList(0,1,2,3)); |
| | | if(sgProgressReportDO.getGxDeviceId()==998 || sgProgressReportDO.getGxDeviceId()==999){ |
| | | if(sgProgressReportDO.getGxDeviceId()==998 |
| | | //|| sgProgressReportDO.getGxDeviceId()==999 |
| | | ){ |
| | | wrapper.eq("gx_step_id", gxStepId).eq("gx_device_id",gxDeviceId).ne("status",4).eq("profram_id",sgProgressReportDO.getProframId()); |
| | | }else { |
| | | wrapper.eq("gx_step_id", gxStepId).eq("gx_device_id",gxDeviceId).ne("status",4); |
| | |
| | | sgProgressReportMapper.insert(sgProgressReportDO); |
| | | String deviceType =""; |
| | | SgDeviceDO sgDeviceDO = new SgDeviceDO(); |
| | | if (gxDeviceId == 999){ |
| | | deviceType = "sgzb"; |
| | | //sgReportUserMapper.insert(SgReportUserDO.builder().reportId(sgProgressReportDO.getId()).roleId(Long.parseLong("1811657352658042882")).approvalStatus(0).approvalOrder(1).build()); |
| | | }else if(gxDeviceId == 998){ |
| | | // if (gxDeviceId == 999){ |
| | | // deviceType = "sgzb"; |
| | | // //sgReportUserMapper.insert(SgReportUserDO.builder().reportId(sgProgressReportDO.getId()).roleId(Long.parseLong("1811657352658042882")).approvalStatus(0).approvalOrder(1).build()); |
| | | // }else |
| | | if(gxDeviceId == 998){ |
| | | deviceType = "sgys"; |
| | | //sgReportUserMapper.insert(SgReportUserDO.builder().reportId(sgProgressReportDO.getId()).roleId(Long.parseLong("1811657352658042882")).approvalStatus(0).approvalOrder(1).build()); |
| | | }else { |
| | |
| | | } |
| | | |
| | | //加个项目及设备的状态判断 方便统计计算 |
| | | if(gxStepId != 25 && gxStepId != 26 ) { |
| | | if(//gxStepId != 25 && |
| | | gxStepId != 26 ) { |
| | | if (sgDeviceDO != null && sgDeviceDO.getStatus() == 0) { |
| | | sgDeviceDO.setStatus(1); |
| | | sgDeviceMapper.updateById(sgDeviceDO); |
| | |
| | | |
| | | @Override |
| | | public Map<String, Long> countListAll(ProjectSearchDTO searchDTO) { |
| | | if (StringUtils.isNotBlank(searchDTO.getTypeName())){ |
| | | List<String> childType = sgGxMapper.childType(searchDTO.getTypeName()); |
| | | searchDTO.setChildTypeList(childType); |
| | | } |
| | | List<SgProgressReportVO> list = sgProgressReportMapper.queryPageListAll(null, searchDTO); |
| | | Map<String, Long> map = new HashMap<>(); |
| | | getStatusCountByList(list, map); |