| | |
| | | public void add(SgProgressReportDO sgProgressReportDO) { |
| | | Date now = DateUtil.now(); |
| | | sgProgressReportDO.setReportTime(now); |
| | | sgProgressReportDO.setCreateTime(now); |
| | | Long gxDeviceId = sgProgressReportDO.getGxDeviceId(); |
| | | Long gxStepId = sgProgressReportDO.getGxStepId(); |
| | | List<SgGxStepDO> list = sgGxStepMapper.selectByGxInfoId(gxDeviceId); |
| | |
| | | QueryWrapper<SgProgressReportDO> wrapper1 = new QueryWrapper<>(); |
| | | wrapper1.eq("gx_step_id", gxStepDO.getId()); |
| | | SgProgressReportDO one = sgProgressReportMapper.selectOne(wrapper1); |
| | | if (one != null && one.getStatus() != 2) { |
| | | if (one == null || one.getStatus() != 2) { |
| | | throw new ServiceException("请先完成" + gxStepDO.getGxStepName() + "的审批!"); |
| | | } |
| | | } |
| | |
| | | List<SgDeviceGxStepDO> sgDeviceGxStepDOs = sgGxStepMapper.getDeviceGXList(sgDeviceDO.getId()); |
| | | |
| | | if (sgDeviceGxStepDOs != null) { |
| | | int countStatus = 0; |
| | | for (SgDeviceGxStepDO sgDeviceGxStepDO : sgDeviceGxStepDOs) { |
| | | countStatus = +sgDeviceGxStepDO.getStatus(); |
| | | |
| | | } |
| | | int size = sgDeviceGxStepDOs.size(); |
| | | if (countStatus != 0 && (size * 2) / countStatus == 1) { |
| | | // int countStatus = 0; |
| | | // for (SgDeviceGxStepDO sgDeviceGxStepDO : sgDeviceGxStepDOs) { |
| | | // countStatus = +sgDeviceGxStepDO.getStatus(); |
| | | // |
| | | // } |
| | | // int size = sgDeviceGxStepDOs.size(); //4 |
| | | boolean allStatusesAreTwo = sgDeviceGxStepDOs.stream() |
| | | .allMatch(s -> s.getStatus() == 2); |
| | | if (allStatusesAreTwo) { |
| | | //如果设备下全部工序审核完成 |
| | | sgDeviceDO.setStatus(2); |
| | | sgDeviceMapper.updateById(sgDeviceDO); |
| | | deviceFinishCount++; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | | if (deviceFinishCount == sgDeviceDOS.size()) { |
| | |
| | | public Map<String, Long> countList(ProjectSearchDTO searchDTO) { |
| | | Long userId = AuthUtil.getUserId(); |
| | | searchDTO.setUserId(userId); |
| | | searchDTO.setApprovalStatus(0); |
| | | Long pending = sgProgressReportMapper.countList(searchDTO); |
| | | searchDTO.setApprovalStatus(1); |
| | | Long over = sgProgressReportMapper.countList(searchDTO); |
| | | Map<String, Long> map = new HashMap<>(); |
| | | map.put("pending",pending); |