|
|
@@ -0,0 +1,187 @@
|
|
|
+package cn.iocoder.yudao.module.pms.service.laswelldata;
|
|
|
+
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
+import cn.hutool.core.util.ObjUtil;
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
+import cn.iocoder.yudao.module.pms.controller.admin.laswell.vo.LasWellRespVO;
|
|
|
+import cn.iocoder.yudao.module.pms.controller.admin.laswelldata.vo.LasWellDataPageReqVO;
|
|
|
+import cn.iocoder.yudao.module.pms.controller.admin.laswelldata.vo.LasWellDataSaveReqVO;
|
|
|
+import cn.iocoder.yudao.module.pms.controller.admin.laswelldata.vo.LasWellDataSetRespVO;
|
|
|
+import cn.iocoder.yudao.module.pms.dal.dataobject.laswell.LasWellDO;
|
|
|
+import cn.iocoder.yudao.module.pms.dal.dataobject.laswelldata.LasWellDataDO;
|
|
|
+import cn.iocoder.yudao.module.pms.dal.mysql.laswell.LasWellMapper;
|
|
|
+import cn.iocoder.yudao.module.pms.dal.mysql.laswelldata.LasWellDataMapper;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
|
+import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstant.LAS_WELL_DATA_NOT_EXISTS;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 数字油藏LAS数据文件-测井数据 Service 实现类
|
|
|
+ *
|
|
|
+ * @author ruiqi
|
|
|
+ */
|
|
|
+@Service
|
|
|
+@Validated
|
|
|
+public class LasWellDataServiceImpl implements LasWellDataService {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private LasWellDataMapper lasWellDataMapper;
|
|
|
+ @Resource
|
|
|
+ private LasWellMapper lasWellMapper;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Long createLasWellData(LasWellDataSaveReqVO createReqVO) {
|
|
|
+ // 插入
|
|
|
+ LasWellDataDO lasWellData = BeanUtils.toBean(createReqVO, LasWellDataDO.class);
|
|
|
+ lasWellDataMapper.insert(lasWellData);
|
|
|
+ // 返回
|
|
|
+ return lasWellData.getId();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void updateLasWellData(LasWellDataSaveReqVO updateReqVO) {
|
|
|
+ // 校验存在
|
|
|
+ validateLasWellDataExists(updateReqVO.getId());
|
|
|
+ // 更新
|
|
|
+ LasWellDataDO updateObj = BeanUtils.toBean(updateReqVO, LasWellDataDO.class);
|
|
|
+ lasWellDataMapper.updateById(updateObj);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void deleteLasWellData(Long id) {
|
|
|
+ // 校验存在
|
|
|
+ validateLasWellDataExists(id);
|
|
|
+ // 删除
|
|
|
+ lasWellDataMapper.deleteById(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void validateLasWellDataExists(Long id) {
|
|
|
+ if (lasWellDataMapper.selectById(id) == null) {
|
|
|
+ throw exception(LAS_WELL_DATA_NOT_EXISTS);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public LasWellDataDO getLasWellData(Long id) {
|
|
|
+ return lasWellDataMapper.selectById(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PageResult<LasWellDataDO> getLasWellDataPage(LasWellDataPageReqVO pageReqVO) {
|
|
|
+ return lasWellDataMapper.selectPage(pageReqVO);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public LasWellDataSetRespVO wellLogDataset(LasWellDataPageReqVO pageReqVO) {
|
|
|
+ Long wellId = pageReqVO.getWellId();
|
|
|
+ if (ObjUtil.isEmpty(wellId)) {
|
|
|
+ throw exception(LAS_WELL_DATA_NOT_EXISTS);
|
|
|
+ }
|
|
|
+ LasWellDataSetRespVO result = new LasWellDataSetRespVO();
|
|
|
+ // 查询油藏井基础信息
|
|
|
+ LasWellDO well = lasWellMapper.selectById(wellId);
|
|
|
+ if (ObjUtil.isEmpty(well)) {
|
|
|
+ throw exception(LAS_WELL_DATA_NOT_EXISTS);
|
|
|
+ }
|
|
|
+ LasWellRespVO wellResp = BeanUtils.toBean(well, LasWellRespVO.class);
|
|
|
+ result.setWellInfo(wellResp);
|
|
|
+ // 查询井的所有测井数据集合
|
|
|
+ pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
+ PageResult<LasWellDataDO> pageData = lasWellDataMapper.selectPage(pageReqVO);
|
|
|
+ List<LasWellDataDO> wellData = pageData.getList();
|
|
|
+ // 井深集合
|
|
|
+ List<BigDecimal> depths = new ArrayList<>();
|
|
|
+ // 井径集合
|
|
|
+ List<BigDecimal> calis = new ArrayList<>();
|
|
|
+ // 计算伽马集合
|
|
|
+ List<BigDecimal> cgrs = new ArrayList<>();
|
|
|
+ // 深感应电阻率集合
|
|
|
+ List<BigDecimal> cilds = new ArrayList<>();
|
|
|
+ // us/m声波时差集合
|
|
|
+ List<BigDecimal> dts = new ArrayList<>();
|
|
|
+ // API自然伽马集合
|
|
|
+ List<BigDecimal> grs = new ArrayList<>();
|
|
|
+ // 侵入带电阻率集合
|
|
|
+ List<BigDecimal> minvs = new ArrayList<>();
|
|
|
+ // 微电阻率集合
|
|
|
+ List<BigDecimal> mnors = new ArrayList<>();
|
|
|
+ // 渗透率集合
|
|
|
+ List<BigDecimal> perms = new ArrayList<>();
|
|
|
+ // 有效孔隙度集合
|
|
|
+ List<BigDecimal> poras = new ArrayList<>();
|
|
|
+ // 总孔隙度集合
|
|
|
+ List<BigDecimal> pords = new ArrayList<>();
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ */
|
|
|
+ // 中子孔隙度集合
|
|
|
+ List<BigDecimal> porns = new ArrayList<>();
|
|
|
+ // ohm.m浅电阻率集合
|
|
|
+ List<BigDecimal> r25s = new ArrayList<>();
|
|
|
+ // g/cm3体积密度集合
|
|
|
+ List<BigDecimal> rhobs = new ArrayList<>();
|
|
|
+ // ohm.m冲洗带电阻率集合
|
|
|
+ List<BigDecimal> rxos = new ArrayList<>();
|
|
|
+ // mV自然电位集合
|
|
|
+ List<BigDecimal> sps = new ArrayList<>();
|
|
|
+ // 含水饱和度集合
|
|
|
+ List<BigDecimal> sws = new ArrayList<>();
|
|
|
+ // 冲洗带含水饱和度集合
|
|
|
+ List<BigDecimal> sxos = new ArrayList<>();
|
|
|
+
|
|
|
+ if (CollUtil.isNotEmpty(wellData)) {
|
|
|
+ wellData.forEach(logData -> {
|
|
|
+ // 数据按照id升序排列 即井深由浅入深排列
|
|
|
+ depths.add(logData.getDepth());
|
|
|
+ calis.add(logData.getCali());
|
|
|
+ cgrs.add(logData.getCgr());
|
|
|
+ cilds.add(logData.getCild());
|
|
|
+ dts.add(logData.getDt());
|
|
|
+ grs.add(logData.getGr());
|
|
|
+ minvs.add(logData.getMinv());
|
|
|
+ mnors.add(logData.getMnor());
|
|
|
+ perms.add(logData.getPerm());
|
|
|
+ poras.add(logData.getPora());
|
|
|
+ pords.add(logData.getPord());
|
|
|
+ porns.add(logData.getPorn());
|
|
|
+ r25s.add(logData.getR25());
|
|
|
+ rhobs.add(logData.getRhob());
|
|
|
+ rxos.add(logData.getRxo());
|
|
|
+ sps.add(logData.getSp());
|
|
|
+ sws.add(logData.getSw());
|
|
|
+ sxos.add(logData.getSxo());
|
|
|
+
|
|
|
+ });
|
|
|
+ result.setDepths(depths);
|
|
|
+ result.setCalis(calis);
|
|
|
+ result.setCgrs(cgrs);
|
|
|
+ result.setCilds(cilds);
|
|
|
+ result.setDts(dts);
|
|
|
+ result.setGrs(grs);
|
|
|
+ result.setMinvs(minvs);
|
|
|
+ result.setMnors(mnors);
|
|
|
+ result.setPerms(perms);
|
|
|
+ result.setPoras(poras);
|
|
|
+ result.setPords(pords);
|
|
|
+ result.setPorns(porns);
|
|
|
+ result.setR25s(r25s);
|
|
|
+ result.setRhobs(rhobs);
|
|
|
+ result.setRxos(rxos);
|
|
|
+ result.setSps(sps);
|
|
|
+ result.setSws(sws);
|
|
|
+ result.setSxos(sxos);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|