shenyijian
2024-06-20 b51fc02e94099f3419781cb59b3a6d8762bddaf3
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/service/impl/SgProgressReportServiceImpl.java
@@ -10,6 +10,7 @@
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;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -329,6 +330,29 @@
      }
      return true;
   }
   @Override
   public IPage<SgProgressReportVO> progressPage(IPage<SgProgressReportVO> page, ProjectSearchDTO searchDTO) {
      Long userId = AuthUtil.getUserId();
      searchDTO.setUserId(userId);
      List<SgProgressReportVO> list = sgProgressReportMapper.queryList(page, searchDTO);
      return page.setRecords(list);
   }
   @Override
   public String getDeviceReport(Long gxDeviceId, Long gxStepId) {
      QueryWrapper<SgProgressReportDO> wrapper = new QueryWrapper<>();
      wrapper.eq("gx_device_id",gxDeviceId);
      if (gxStepId!=null){
         wrapper.eq("gx_step_id",gxStepId);
      }
      List<SgProgressReportDO> sgProgressReportDOS = sgProgressReportMapper.selectList(wrapper);
      if (CollectionUtils.isNotEmpty(sgProgressReportDOS)){
         sgProgressReportDOS.sort((u1, u2) -> u2.getCreateTime().compareTo(u1.getCreateTime()));
      return sgProgressReportDOS.get(0).getId().toString();
      }
      return null;
   }
}