| | |
| | | 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); |
| | |
| | | typeVO.setTypeProgress(getBigDecimalPercent(divideDevice)); |
| | | sgGxDOS.add(typeVO); |
| | | } |
| | | |
| | | List<PreAcceVO> palist = new ArrayList<>(); |
| | | palist.add(handleQuery(12, 25, list.get(0).getId())); |
| | | palist.add(handleQuery(13, 26,list.get(0).getId())); |
| | | sgProjectInfoDO.setPreAcce(palist); |
| | | BigDecimal allDeviceSize = BigDecimal.valueOf(allDevice.size()); |
| | | if (!allDeviceSize.equals(BigDecimal.ZERO)){ |
| | | double sum = allDevice.stream().mapToDouble(s -> Double.parseDouble(s.getProgress())).sum(); |
| | |
| | | |
| | | } |
| | | |
| | | // 处理查询和添加到列表的方法 |
| | | private PreAcceVO handleQuery(int gxStepId, int stepIdForNull, Long programId) { |
| | | QueryWrapper<SgProgressReportDO> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("gx_step_id", gxStepId) |
| | | .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()); |
| | | } else { |
| | | preAcceVO.setName(sgGxStepMapper.selectById(stepIdForNull).getGxStepName()); |
| | | } |
| | | return preAcceVO; |
| | | |
| | | } |
| | | |
| | | } |