|
|
@@ -17,13 +17,17 @@ import cn.iocoder.yudao.module.pms.controller.admin.depttype.vo.IotDeptTypePageR
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotprojectinfo.vo.IotProjectInfoPageReqVO;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotprojecttask.vo.IotProjectTaskPageReqVO;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotrydailyreport.vo.*;
|
|
|
+import cn.iocoder.yudao.module.pms.controller.admin.iotrydailyreportdetail.vo.IotRyDailyReportDetailPageReqVO;
|
|
|
+import cn.iocoder.yudao.module.pms.controller.admin.iotrydailyreportdetail.vo.IotRyDailyReportDetailRespVO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.depttype.IotDeptTypeDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotprojectinfo.IotProjectInfoDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotprojecttask.IotProjectTaskDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotprojecttaskattrs.IotTaskAttrModelProperty;
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotrydailyreport.IotRyDailyReportDO;
|
|
|
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotrydailyreportdetail.IotRyDailyReportDetailDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.depttype.IotDeptTypeMapper;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.iotrydailyreport.IotRyDailyReportMapper;
|
|
|
+import cn.iocoder.yudao.module.pms.dal.mysql.iotrydailyreportdetail.IotRyDailyReportDetailMapper;
|
|
|
import cn.iocoder.yudao.module.pms.service.iotprojectinfo.IotProjectInfoService;
|
|
|
import cn.iocoder.yudao.module.pms.service.iotprojecttask.IotProjectTaskService;
|
|
|
import cn.iocoder.yudao.module.pms.service.iotrydailyreport.IotRyDailyReportService;
|
|
|
@@ -74,6 +78,8 @@ public class IotRyDailyReportController {
|
|
|
@Resource
|
|
|
private IotRyDailyReportMapper iotRyDailyReportMapper;
|
|
|
@Resource
|
|
|
+ private IotRyDailyReportDetailMapper iotRyDailyReportDetailMapper;
|
|
|
+ @Resource
|
|
|
private DictDataService dictDataService;
|
|
|
@Resource
|
|
|
private IotDeptTypeMapper iotDeptTypeMapper;
|
|
|
@@ -142,6 +148,16 @@ public class IotRyDailyReportController {
|
|
|
reqVO.setDeptId(deptId);
|
|
|
reqVO.setTaskId(taskId);
|
|
|
List<IotRyDailyReportDO> currentTaskReports = iotRyDailyReportMapper.dailyReports(reqVO);
|
|
|
+ // 查询日报的生产动态详情
|
|
|
+ IotRyDailyReportDetailPageReqVO detailReqVO = new IotRyDailyReportDetailPageReqVO();
|
|
|
+ detailReqVO.setReportId(iotRyDailyReport.getId());
|
|
|
+ detailReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
+ PageResult<IotRyDailyReportDetailDO> reportDetailsPage = iotRyDailyReportDetailMapper.selectPage(detailReqVO);
|
|
|
+ List<IotRyDailyReportDetailDO> reportDetails = reportDetailsPage.getList();
|
|
|
+ if (CollUtil.isNotEmpty(reportDetails)) {
|
|
|
+ List<IotRyDailyReportDetailRespVO> reportDetailsResp = BeanUtils.toBean(reportDetails, IotRyDailyReportDetailRespVO.class);
|
|
|
+ result.setReportDetails(reportDetailsResp);
|
|
|
+ }
|
|
|
// 按照创建时间倒序排列 取第2条记录对应的 当前井深 即 上次日报的当前井深
|
|
|
if (CollUtil.isNotEmpty(currentTaskReports)) {
|
|
|
currentTaskReports.sort(Comparator.comparing(IotRyDailyReportDO::getCreateTime));
|
|
|
@@ -350,6 +366,8 @@ public class IotRyDailyReportController {
|
|
|
Map<String, String> nptReasonPair = new HashMap<>();
|
|
|
// key施工状态数据字典value value施工状态数据字典label
|
|
|
Map<String, String> constructStatusPair = new HashMap<>();
|
|
|
+ // key日报id value生产动态明细
|
|
|
+ Map<Long, List<IotRyDailyReportDetailRespVO>> reportDetailsPair = new HashMap<>();
|
|
|
|
|
|
// 钻井 施工状态 字典数据
|
|
|
List<DictDataDO> rigStatusDictData = dictDataService.getDictDataListByDictType("rigStatus");
|
|
|
@@ -375,7 +393,26 @@ public class IotRyDailyReportController {
|
|
|
constructStatusPair.put(data.getValue(), data.getLabel());
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
+ // 查询每个日报的生产动态明细
|
|
|
+ IotRyDailyReportDetailPageReqVO detailReqVO = new IotRyDailyReportDetailPageReqVO();
|
|
|
+ detailReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
+ detailReqVO.setReportIds(convertList(reports, IotRyDailyReportDO::getId));
|
|
|
+ PageResult<IotRyDailyReportDetailDO> reportDetailsPage = iotRyDailyReportDetailMapper.selectPage(detailReqVO);
|
|
|
+ List<IotRyDailyReportDetailDO> reportDetails = reportDetailsPage.getList();
|
|
|
+ if (CollUtil.isNotEmpty(reportDetails)) {
|
|
|
+ // 设置每个日报的生产动态明细
|
|
|
+ reportDetails.forEach(detail -> {
|
|
|
+ if (reportDetailsPair.containsKey(detail.getReportId())) {
|
|
|
+ List<IotRyDailyReportDetailRespVO> tempDetails = reportDetailsPair.get(detail.getReportId());
|
|
|
+ tempDetails.add(BeanUtils.toBean(detail, IotRyDailyReportDetailRespVO.class));
|
|
|
+ reportDetailsPair.put(detail.getReportId(), tempDetails);
|
|
|
+ } else {
|
|
|
+ List<IotRyDailyReportDetailRespVO> tempDetails = new ArrayList<>();
|
|
|
+ tempDetails.add(BeanUtils.toBean(detail, IotRyDailyReportDetailRespVO.class));
|
|
|
+ reportDetailsPair.put(detail.getReportId(), tempDetails);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
DataPermissionUtils.executeIgnore(() -> {
|
|
|
// 查询日报关联的项目信息
|
|
|
IotProjectInfoPageReqVO reqVO = new IotProjectInfoPageReqVO();
|
|
|
@@ -482,6 +519,8 @@ public class IotRyDailyReportController {
|
|
|
findAndThen(taskPair, reportVO.getTaskId(), taskName -> reportVO.setTaskName(taskName));
|
|
|
// 2.4 设计井深
|
|
|
findAndThen(taskExtPropertyPair, reportVO.getTaskId(), wellDepth -> reportVO.setDesignWellDepth(wellDepth));
|
|
|
+ // 生产动态明细
|
|
|
+ findAndThen(reportDetailsPair, reportVO.getId(), details -> reportVO.setReportDetails(details));
|
|
|
// 施工工艺
|
|
|
findAndThen(taskTechniquePair, reportVO.getTaskId(), technique -> reportVO.setTechnique(technique));
|
|
|
// 井别
|