| | |
| | | import cn.gistack.sm.sg.DTO.ApprovalDTO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.VO.SgProgressReportVO; |
| | | import cn.gistack.sm.sg.VO.SgProjectInfoVO; |
| | | import cn.gistack.sm.sg.VO.SgReportVO; |
| | | import cn.gistack.sm.sg.VO.SgStepReportVO; |
| | | import cn.gistack.sm.sg.mapper.*; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.lang.Long; |
| | | import java.util.*; |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | |
| | | QueryWrapper<SgProgressReportDO> wrappers = new QueryWrapper<>(); |
| | | wrappers.eq("profram_id", sgProgressReportDO.getProframId()).ne("status", 4).eq("gx_step_name", "施工准备"); |
| | | List<SgProgressReportDO> sgProgressReportDOS1 = sgProgressReportMapper.selectList(wrappers); |
| | | |
| | | if(sgProgressReportDO.getGxDeviceId()==998){ |
| | | ProjectSearchDTO search = new ProjectSearchDTO(); |
| | | search.setProjectId(sgProgressReportDO.getProframId().toString()); |
| | | List<SgProjectInfoVO> sgProjectInfoVOS = sgProjectInfoMapper.queryStepByProject(search); |
| | | if(sgProjectInfoVOS != null){ |
| | | sgProjectInfoVOS.forEach(s ->{ |
| | | if(!s.getProjectStatus().equals(2)){ |
| | | throw new ServiceException("请完成所有设备工序审批!"); |
| | | } |
| | | }); |
| | | }else{ |
| | | throw new ServiceException("无设备审批数据!"); |
| | | } |
| | | |
| | | } |
| | | |
| | | if (sgProgressReportDOS1!= null && sgProgressReportDOS1.size() > 0) { |
| | | for (SgProgressReportDO sgProgressReportDO1 : sgProgressReportDOS1) { |
| | |
| | | } |
| | | |
| | | //加个项目及设备的状态判断 方便统计计算 |
| | | if (sgDeviceDO != null && sgDeviceDO.getStatus() == 0) { |
| | | sgDeviceDO.setStatus(1); |
| | | sgDeviceMapper.updateById(sgDeviceDO); |
| | | if(gxStepId != 25 && gxStepId != 26 ) { |
| | | if (sgDeviceDO != null && sgDeviceDO.getStatus() == 0) { |
| | | sgDeviceDO.setStatus(1); |
| | | sgDeviceMapper.updateById(sgDeviceDO); |
| | | } |
| | | } |
| | | SgProjectInfoDO sgProjectInfoDO = sgProjectInfoMapper.selectById(sgProgressReportDO.getProframId()); |
| | | if (sgProjectInfoDO != null && sgProjectInfoDO.getStatus() == 0) { |
| | |
| | | SgDeviceDO sgDeviceDO = sgDeviceMapper.selectById(sgProgressReportVO.getGxDeviceId()); |
| | | SgGxStepDO sgGxStepDO = sgGxStepMapper.selectById(sgProgressReportVO.getGxStepId()); |
| | | sgProgressReportVO.setStepRemark(sgGxStepDO.getRemark()); |
| | | sgProgressReportVO.setDeviceName(sgDeviceDO.getDeviceName()); |
| | | if(sgProgressReportVO.getGxDeviceId() !=999 && sgProgressReportVO.getGxDeviceId() !=998){ |
| | | sgProgressReportVO.setDeviceName(sgDeviceDO.getDeviceName()); |
| | | }else { |
| | | sgProgressReportVO.setDeviceName("");} |
| | | List<SgReportUserDO> list = new LambdaQueryChainWrapper<>(sgReportUserMapper).eq(SgReportUserDO::getReportId, id).orderByAsc(SgReportUserDO::getId).list(); |
| | | List<Long> ids = list.stream().map(s -> s.getUserId()).collect(Collectors.toList()); |
| | | List<Map<String,Object>> users = sgProgressReportMapper.getUserByIds(ids); |