shenyijian
2024-08-24 8c7b9f018caa2afb6515a8222aba6df3ed7378fb
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/service/impl/SgProgressReportServiceImpl.java
@@ -136,14 +136,23 @@
      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));
      wrapper.in("status",Arrays.asList(0,1,2,3));
      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);
      }
      List<SgProgressReportDO> sgProgressReportDOS = sgProgressReportMapper.selectList(wrapper);
      if ( sgProgressReportDOS!=null && sgProgressReportDOS.size()>0){
      if (CollectionUtils.isNotEmpty(sgProgressReportDOS)){
         for (SgProgressReportDO reportDO : sgProgressReportDOS) {
            if (reportDO.getStatus()==3 && reportDO.getResubmit()!=null && reportDO.getResubmit()==0){
               throw new ServiceException("此工序已存在审批!");
            }
         }
      }
      List<SgProgressReportDO> reportDOS = sgProgressReportDOS.stream().filter(s -> s.getStatus() != 3).collect(Collectors.toList());
      if ( reportDOS!=null && reportDOS.size()>0){
         throw new ServiceException("此工序已存在审批!");
      }
      for (SgGxStepDO gxStepDO : list) {