| | |
| | | package cn.gistack.sm.sg.service.impl; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgDeviceDO; |
| | | import cn.gistack.sm.sg.DO.SgGxDO; |
| | | import cn.gistack.sm.sg.DO.SgGxStepDO; |
| | | import cn.gistack.sm.sg.DO.SgProjectInfoDO; |
| | | import cn.gistack.sm.sg.DO.*; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.VO.*; |
| | | import cn.gistack.sm.sg.excel.ProjectExcel; |
| | | import cn.gistack.sm.sg.mapper.SgGxStepMapper; |
| | | import cn.gistack.sm.sg.mapper.SgProgressReportMapper; |
| | | import cn.gistack.sm.sg.mapper.SgProjectInfoMapper; |
| | | import cn.gistack.sm.sg.service.SgProjectInfoService; |
| | | import cn.gistack.sm.sjztmd.entity.AttAdBase; |
| | | import cn.gistack.sm.sjztmd.service.IAttAdBaseService; |
| | | import cn.hutool.core.lang.copier.Copier; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | |
| | | private SgProjectInfoMapper sgProjectInfoMapper; |
| | | @Autowired |
| | | private IAttAdBaseService iAttAdBaseService; |
| | | |
| | | @Autowired |
| | | private SgProgressReportMapper sgProgressReportMapper; |
| | | |
| | | @Autowired |
| | | private SgGxStepMapper sgGxStepMapper; |
| | | |
| | | @Override |
| | | public IPage<SgProjectInfoDO> queryPageList(IPage<SgProjectInfoDO> page, ProjectSearchDTO searchDTO) { |
| | | List<SgProjectInfoDO> sgProjectInfoDOS = baseMapper.queryPageList(page,searchDTO); |
| | |
| | | */ |
| | | @Override |
| | | public List<SgProjectInfoDO> queryStepByProject(ProjectSearchDTO searchDTO) { |
| | | List<PreAcceVO> palist = new ArrayList<>(); |
| | | List<SgProjectInfoVO> list = sgProjectInfoMapper.queryStepByProject( searchDTO); |
| | | return getProjectProgress(list); |
| | | palist.add(handleQuery(25, list.get(0).getId())); |
| | | palist.add(handleQuery(26, list.get(0).getId())); |
| | | List<SgProjectInfoDO> projectProgress = getProjectProgress(list); |
| | | projectProgress.forEach(s->{ |
| | | s.setPreAcce(palist); |
| | | }); |
| | | |
| | | |
| | | return projectProgress; |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | } |
| | | |
| | | // 处理查询和添加到列表的方法 |
| | | private PreAcceVO handleQuery( int stepIdForNull, Long programId) { |
| | | QueryWrapper<SgProgressReportDO> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("gx_step_id", stepIdForNull) |
| | | .eq("profram_id", programId); |
| | | SgProgressReportDO sgProgressReportDO = sgProgressReportMapper.selectOne(queryWrapper); |
| | | |
| | | PreAcceVO preAcceVO = new PreAcceVO(); |
| | | if (sgProgressReportDO!= null) { |
| | | preAcceVO.setId(sgProgressReportDO.getId().toString()); |
| | | preAcceVO.setName(sgProgressReportDO.getGxStepName()); |
| | | preAcceVO.setStatus((long) sgProgressReportDO.getStatus()); |
| | | preAcceVO.setProgramId(programId); |
| | | preAcceVO.setGxDeviceId(sgProgressReportDO.getGxDeviceId()); |
| | | preAcceVO.setGxStepId(sgProgressReportDO.getGxStepId()); |
| | | } else { |
| | | SgGxStepDO sgGxStepDO = sgGxStepMapper.selectById(stepIdForNull); |
| | | preAcceVO.setName(sgGxStepDO.getGxStepName()); |
| | | preAcceVO.setProgramId(programId); |
| | | preAcceVO.setGxDeviceId(stepIdForNull != 25? (long)998:(long)999); |
| | | preAcceVO.setGxStepId(sgGxStepDO.getId()); |
| | | |
| | | } |
| | | return preAcceVO; |
| | | |
| | | } |
| | | |
| | | } |