Commit 107e5814 by jiang'yun

修改

parent f03ceafc
......@@ -15,6 +15,9 @@ import com.ruoyi.project.zjsgfa.domain.*;
import com.ruoyi.project.zjsgfa.domain.Vo.DrillingFluidConstant;
import com.ruoyi.project.zjsgfa.mapper.*;
import com.ruoyi.project.zt.domain.CommonParam;
import com.ruoyi.project.zt.domain.Ljjw;
import com.ruoyi.project.zt.service.DjdcService;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.*;
import org.springframework.http.MediaType;
......@@ -99,6 +102,9 @@ public class SjDjjcController extends BaseController
/**
* 查询设计信息-井基础信息列表
*/
......@@ -1450,6 +1456,18 @@ public class SjDjjcController extends BaseController
/**
* 保存邻井资料
*/
@PostMapping("/saveLjzl")
public AjaxResult saveLjzl(@RequestBody CommonParam param) throws Exception{
return sjDjjcService.saveLjzl(param);
}
/**
* 计算指定方向上的视平移
* @param closureAzimuth 闭合方位角(度)
* @param nsDisplacement 南北位移(米)
......
......@@ -19,11 +19,11 @@ public class SjLjjw extends BaseEntity
private Long id;
/** 井号 */
@Excel(name = "井号")
// @Excel(name = "井号")
private String jh;
/** 邻井井号 */
@Excel(name = "邻井井号")
@Excel(name = "井号")
private String ljjh;
/** 井型 */
......
......@@ -19,7 +19,7 @@ public class SjQkztfx extends BaseEntity
private Long id;
/** 井号 */
@Excel(name = "井号")
// @Excel(name = "井号")
private String jh;
/** 开次 */
......@@ -47,19 +47,19 @@ public class SjQkztfx extends BaseEntity
private Double ytzl;
/** 二趟钻率 */
@Excel(name = "二趟钻率")
// @Excel(name = "二趟钻率")
private Double etzl;
/** 三趟钻率 */
@Excel(name = "三趟钻率")
// @Excel(name = "三趟钻率")
private Double stzl;
/** 四趟钻率 */
@Excel(name = "四趟钻率")
// @Excel(name = "四趟钻率")
private Double sitzl;
/** 五趟钻率 */
@Excel(name = "五趟钻率")
// @Excel(name = "五趟钻率")
private Double wtzl;
/** 进尺中位数 */
......
......@@ -2,6 +2,7 @@ package com.ruoyi.project.zjsgfa.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
......@@ -13,6 +14,7 @@ import com.ruoyi.framework.web.domain.BaseEntity;
* @author ruoyi
* @date 2025-07-22
*/
@Data
public class SjSzfxjg extends BaseEntity
{
private static final long serialVersionUID = 1L;
......@@ -20,6 +22,8 @@ public class SjSzfxjg extends BaseEntity
/** 主键 */
private Long id;
private String jh;
/** 分析范围 */
@Excel(name = "分析范围")
private String fxfw;
......@@ -57,12 +61,12 @@ public class SjSzfxjg extends BaseEntity
private Double tjpf;
/** 创建人 */
@Excel(name = "创建人")
// @Excel(name = "创建人")
private String createdBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
// @JsonFormat(pattern = "yyyy-MM-dd")
// @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createdTime;
public void setId(Long id)
......
......@@ -19,15 +19,15 @@ public class SjZqfx extends BaseEntity
private Long id;
/** 井号 */
@Excel(name = "井号")
// @Excel(name = "井号")
private String jh;
/** 邻井井号 */
@Excel(name = "邻井井号")
@Excel(name = "井号")
private String ljjh;
/** 井筒名 */
@Excel(name = "井筒名")
// @Excel(name = "井筒名")
private String jtm;
/** 开始井深 */
......@@ -75,7 +75,7 @@ public class SjZqfx extends BaseEntity
private Double wjycsl;
/** 完井(中完)生产周期 */
@Excel(name = "完井", readConverterExp = "中=完")
@Excel(name = "完井生产周期")
private Double wjsczq;
/** 钻井异常描述 */
......@@ -83,7 +83,7 @@ public class SjZqfx extends BaseEntity
private String zjycms;
/** 中完(完井异常描述) */
@Excel(name = "中完", readConverterExp = "完=井异常描述")
@Excel(name = "中完异常描述")
private String wjycms;
public void setId(Long id)
......
......@@ -19,11 +19,11 @@ public class SjZtgjsj extends BaseEntity
private Long id;
/** 井号 */
@Excel(name = "井号")
// @Excel(name = "井号")
private String jh;
/** 邻井井号 */
@Excel(name = "邻井井号")
@Excel(name = "井号")
private String ljjh;
/** 开次 */
......
......@@ -58,4 +58,9 @@ public interface SjLjjwMapper
* @return 结果
*/
public int deleteSjLjjwByIds(Long[] ids);
int deleteSjLjjwByJh(String jh);
int insertSjLjjwBatch(List<SjLjjw> sjLjjwList);
}
......@@ -58,4 +58,9 @@ public interface SjQkztfxMapper
* @return 结果
*/
public int deleteSjQkztfxByIds(Long[] ids);
int deleteSjQkztfxByJh(String jh);
int insertSjQkztfxBatch(List<SjQkztfx> sjQkztfxList);
}
......@@ -58,4 +58,9 @@ public interface SjSzfxjgMapper
* @return 结果
*/
public int deleteSjSzfxjgByIds(Long[] ids);
int deleteSjSzfxjgByJh(String jh);
int insertSjSzfxjgBatch(List<SjSzfxjg> sjSzfxjgList);
}
......@@ -58,4 +58,9 @@ public interface SjZqfxMapper
* @return 结果
*/
public int deleteSjZqfxByIds(Long[] ids);
int deleteSjZqfxByJh(String jh);
int insertSjZqfxBatch(List<SjZqfx> sjZqfxList);
}
......@@ -58,4 +58,9 @@ public interface SjZtgjsjMapper
* @return 结果
*/
public int deleteSjZtgjsjByIds(Long[] ids);
int deleteSjZtgjsjByJh(String jh);
int insertSjZtgjsjBatch(List<SjZtgjsj> sjZtgjsjList);
}
package com.ruoyi.project.zjsgfa.service;
import java.util.List;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.zjsgfa.domain.SjDjjc;
import com.ruoyi.project.zt.domain.CommonParam;
/**
* 设计信息-井基础信息Service接口
......@@ -58,4 +61,7 @@ public interface ISjDjjcService
* @return 结果
*/
public int deleteSjDjjcById(Long id);
AjaxResult saveLjzl(CommonParam param) throws Exception;
}
package com.ruoyi.project.zjsgfa.service.impl;
import java.util.ArrayList;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.domain.BaseEntity;
import com.ruoyi.project.zjsgfa.domain.*;
import com.ruoyi.project.zjsgfa.mapper.*;
import com.ruoyi.project.zt.domain.*;
import com.ruoyi.project.zt.domain.vo.SjInfo;
import com.ruoyi.project.zt.service.DjdcService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.zjsgfa.mapper.SjDjjcMapper;
import com.ruoyi.project.zjsgfa.domain.SjDjjc;
import com.ruoyi.project.zjsgfa.service.ISjDjjcService;
/**
......@@ -21,6 +28,22 @@ public class SjDjjcServiceImpl implements ISjDjjcService
@Autowired
private SjDjjcMapper sjDjjcMapper;
@Autowired
private DjdcService djdcService;
@Autowired
private SjLjjwMapper sjLjjwMapper;
@Autowired
private SjZqfxMapper sjZqfxMapper;
@Autowired
private SjZtgjsjMapper sjZtgjsjMapper;
@Autowired
private SjQkztfxMapper sjQkztfxMapper;
@Autowired
private SjJsjgMapper sjJsjgMapper;
@Autowired
private SjSzfxjgMapper sjSzfxjgMapper;
/**
* 查询设计信息-井基础信息
*
......@@ -100,4 +123,103 @@ public class SjDjjcServiceImpl implements ISjDjjcService
{
return sjDjjcMapper.deleteSjDjjcById(id);
}
@Override
public AjaxResult saveLjzl(CommonParam param) throws Exception {
String jh = param.getSjjh();
SjDjjc sjDjjc = sjDjjcMapper.selectSjDjjcByJh(jh);
param.setQk(sjDjjc.getQk());
param.setJkhzb(sjDjjc.getJkhzb());
param.setJkzzb(sjDjjc.getJkzzb());
param.setJdhzb(sjDjjc.getJdhzb());
param.setJdzzb(sjDjjc.getJdzzb());
//保存邻井
List<Ljjw> ljjwList = djdcService.getLjjwList(param);
List<SjLjjw> sjLjjwList=new ArrayList<>();
ljjwList.forEach(item->{
SjLjjw sjLjjw=new SjLjjw();
BeanUtils.copyProperties(item,sjLjjw);
sjLjjw.setJh(jh);
sjLjjw.setLjjh(item.getJh());
sjLjjwList.add(sjLjjw);
});
if(sjLjjwList.size()>0){
sjLjjwMapper.deleteSjLjjwByJh(jh);
sjLjjwMapper.insertSjLjjwBatch(sjLjjwList);
}
param.setJkhzb(null);
param.setJkzzb(null);
param.setJdhzb(null);
param.setJdzzb(null);
//周期分析
List<DjZqsjfx> zqshfxList = djdcService.getZqshfxList(param);
List<SjZqfx> sjZqfxList=new ArrayList<>();
zqshfxList.forEach(item->{
SjZqfx sjZqfx=new SjZqfx();
BeanUtils.copyProperties(item,sjZqfx);
sjZqfx.setJh(jh);
sjZqfx.setLjjh(item.getJh());
sjZqfxList.add(sjZqfx);
});
if(sjZqfxList.size()>0){
sjZqfxMapper.deleteSjZqfxByJh(jh);
sjZqfxMapper.insertSjZqfxBatch(sjZqfxList);
}
//钻头关键数据
List<Djjc> djjcList = djdcService.getDjjcList(param);
List<SjZtgjsj> sjZtgjsjList=new ArrayList<>();
djjcList.forEach(item->{
SjZtgjsj sjZtgjsj=new SjZtgjsj();
BeanUtils.copyProperties(item,sjZtgjsj);
sjZtgjsj.setJh(jh);
sjZtgjsj.setLjjh(item.getJh());
sjZtgjsjList.add(sjZtgjsj);
});
if(sjZtgjsjList.size()>0){
sjZtgjsjMapper.deleteSjZtgjsjByJh(jh);
sjZtgjsjMapper.insertSjZtgjsjBatch(sjZtgjsjList);
}
//区块钻头分析
List<DjZtfx> djZtfxList = djdcService.getDjZtfxList(param);
List<SjQkztfx> sjQkztfxList=new ArrayList<>();
djZtfxList.forEach(item->{
SjQkztfx sjQkztfx=new SjQkztfx();
BeanUtils.copyProperties(item,sjQkztfx);
sjQkztfx.setJh(jh);
sjQkztfxList.add(sjQkztfx);
});
if(sjQkztfxList.size()>0){
sjQkztfxMapper.deleteSjQkztfxByJh(jh);
sjQkztfxMapper.insertSjQkztfxBatch(sjQkztfxList);
}
//实钻分析结果
SjJsjg sjJsjg =new SjJsjg();
sjJsjg.setJh(jh);
List<SjJsjg> sjJsjgList = sjJsjgMapper.selectSjJsjgList(sjJsjg);
List<SjInfo> sjInfoList=new ArrayList<>();
for(int i=0;i<sjJsjgList.size();i++){
SjInfo sjInfo =new SjInfo();
sjInfo.setKc((i+1)+"");
sjInfo.setZtcc(sjJsjgList.get(0).getZtzj());
sjInfoList.add(sjInfo);
}
param.setSj(sjInfoList);
List<LjSzfxjg> ljSzfxjgList=djdcService.getSztfxjgList(djZtfxList,djjcList,param);
List<SjSzfxjg> sjSzfxjgList=new ArrayList<>();
ljSzfxjgList.forEach(item->{
SjSzfxjg sjSzfxjg=new SjSzfxjg();
BeanUtils.copyProperties(item,sjSzfxjg);
sjSzfxjg.setJh(jh);
sjSzfxjgList.add(sjSzfxjg);
});
if(sjSzfxjgList.size()>0){
sjSzfxjgMapper.deleteSjSzfxjgByJh(jh);
sjSzfxjgMapper.insertSjSzfxjgBatch(sjSzfxjgList);
}
return AjaxResult.success();
}
}
......@@ -16,6 +16,8 @@ public class CommonParam {
private String exportPath;
//井号
private String jh;
//设计井号
private String sjjh;
//井型
private List<String> jxs;
......
......@@ -45,4 +45,6 @@ public interface DjdcService {
List<LjDzfc> getDzfcList(CommonParam param);
List<LjSzfxjg> getSztfxjgList(List<DjZtfx> djZtfxList, List<Djjc> djjcList, CommonParam param);
}
......@@ -278,598 +278,15 @@ public class DjdcServiceImpl implements DjdcService {
// param.setJdzzb(djjc.getJdzzb());
// }
}
//调用接口查询数据
String jsonString = "{\n" +
" \"columns\": [\n" +
" \"JHDM\",\n" +
" \"JH\",\n" +
" \"ZYMC\",\n" +
" \"ZYMCBM\",\n" +
" \"JS\",\n" +
" \"ZYSJ\",\n" +
" \"DATASUBTIME\"\n" +
" ],\n" +
" \"result\": [\n" +
" [\n" +
" \"SL2024022603\",\n" +
" \"滨648-侧斜28\",\n" +
" \"完井\",\n" +
" \"09\",\n" +
" 2978,\n" +
" \"Tue, 17 Sep 2024 22:30:00 GMT\",\n" +
" \"Wed, 18 Sep 2024 07:49:50 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024021905\",\n" +
" \"滨648-斜69\",\n" +
" \"第二次开钻\",\n" +
" \"02\",\n" +
" 317,\n" +
" \"Wed, 05 Jun 2024 11:30:00 GMT\",\n" +
" \"Thu, 06 Jun 2024 08:05:38 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024021905\",\n" +
" \"滨648-斜69\",\n" +
" \"第一次开钻\",\n" +
" \"01\",\n" +
" 0,\n" +
" \"Tue, 04 Jun 2024 11:00:00 GMT\",\n" +
" \"Wed, 05 Jun 2024 09:01:52 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024021905\",\n" +
" \"滨648-斜69\",\n" +
" \"第一次完钻\",\n" +
" \"13\",\n" +
" 317,\n" +
" \"Tue, 04 Jun 2024 14:00:00 GMT\",\n" +
" \"Thu, 06 Jun 2024 08:05:29 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024021905\",\n" +
" \"滨648-斜69\",\n" +
" \"完钻\",\n" +
" \"08\",\n" +
" 2923,\n" +
" \"Thu, 13 Jun 2024 21:30:00 GMT\",\n" +
" \"Fri, 14 Jun 2024 07:26:29 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024021905\",\n" +
" \"滨648-斜69\",\n" +
" \"第二次完钻\",\n" +
" \"14\",\n" +
" 2923,\n" +
" \"Thu, 13 Jun 2024 21:30:00 GMT\",\n" +
" \"Fri, 14 Jun 2024 07:26:36 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024021905\",\n" +
" \"滨648-斜69\",\n" +
" \"完井\",\n" +
" \"09\",\n" +
" 2985,\n" +
" \"Tue, 18 Jun 2024 19:30:00 GMT\",\n" +
" \"Wed, 19 Jun 2024 06:13:50 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024022603\",\n" +
" \"滨648-侧斜28\",\n" +
" \"第一次开钻\",\n" +
" \"01\",\n" +
" 213,\n" +
" \"Wed, 04 Sep 2024 22:00:00 GMT\",\n" +
" \"Thu, 05 Sep 2024 06:29:17 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024022603\",\n" +
" \"滨648-侧斜28\",\n" +
" \"完钻\",\n" +
" \"08\",\n" +
" 2978,\n" +
" \"Wed, 11 Sep 2024 11:00:00 GMT\",\n" +
" \"Thu, 12 Sep 2024 06:59:38 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100817\",\n" +
" \"滨648-斜72\",\n" +
" \"第二次完钻\",\n" +
" \"14\",\n" +
" 3251,\n" +
" \"Sat, 25 Jan 2025 12:30:00 GMT\",\n" +
" \"Mon, 27 Jan 2025 06:55:31 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100817\",\n" +
" \"滨648-斜72\",\n" +
" \"完钻\",\n" +
" \"08\",\n" +
" 3251,\n" +
" \"Sat, 25 Jan 2025 12:30:00 GMT\",\n" +
" \"Mon, 27 Jan 2025 06:55:31 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100818\",\n" +
" \"滨648-斜73\",\n" +
" \"第二次开钻\",\n" +
" \"02\",\n" +
" 308,\n" +
" \"Sun, 12 Jan 2025 23:00:00 GMT\",\n" +
" \"Tue, 14 Jan 2025 06:55:29 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100817\",\n" +
" \"滨648-斜72\",\n" +
" \"第二次开钻\",\n" +
" \"02\",\n" +
" 462,\n" +
" \"Wed, 22 Jan 2025 21:30:00 GMT\",\n" +
" \"Fri, 24 Jan 2025 06:55:25 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100816\",\n" +
" \"滨648-斜71\",\n" +
" \"第一次开钻\",\n" +
" \"01\",\n" +
" 0,\n" +
" \"Sun, 02 Feb 2025 12:00:00 GMT\",\n" +
" \"Mon, 03 Feb 2025 06:55:23 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100816\",\n" +
" \"滨648-斜71\",\n" +
" \"第一次完钻\",\n" +
" \"13\",\n" +
" 453,\n" +
" \"Sun, 02 Feb 2025 18:00:00 GMT\",\n" +
" \"Mon, 03 Feb 2025 06:55:23 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100825\",\n" +
" \"滨648-斜88\",\n" +
" \"完钻\",\n" +
" \"08\",\n" +
" 3049,\n" +
" \"Tue, 24 Dec 2024 18:30:00 GMT\",\n" +
" \"Wed, 01 Jan 2025 06:55:22 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100825\",\n" +
" \"滨648-斜88\",\n" +
" \"第二次完钻\",\n" +
" \"14\",\n" +
" 3049,\n" +
" \"Tue, 24 Dec 2024 18:30:00 GMT\",\n" +
" \"Wed, 01 Jan 2025 06:55:22 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100818\",\n" +
" \"滨648-斜73\",\n" +
" \"第一次开钻\",\n" +
" \"01\",\n" +
" 0,\n" +
" \"Sat, 11 Jan 2025 18:30:00 GMT\",\n" +
" \"Mon, 13 Jan 2025 06:55:25 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100818\",\n" +
" \"滨648-斜73\",\n" +
" \"第一次完钻\",\n" +
" \"13\",\n" +
" 308,\n" +
" \"Sat, 11 Jan 2025 22:30:00 GMT\",\n" +
" \"Mon, 13 Jan 2025 06:55:25 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100817\",\n" +
" \"滨648-斜72\",\n" +
" \"第一次开钻\",\n" +
" \"01\",\n" +
" 0,\n" +
" \"Tue, 21 Jan 2025 12:00:00 GMT\",\n" +
" \"Thu, 23 Jan 2025 06:55:26 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100825\",\n" +
" \"滨648-斜88\",\n" +
" \"完井\",\n" +
" \"09\",\n" +
" 3049,\n" +
" \"Mon, 30 Dec 2024 19:00:00 GMT\",\n" +
" \"Wed, 01 Jan 2025 06:55:22 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100818\",\n" +
" \"滨648-斜73\",\n" +
" \"完井\",\n" +
" \"09\",\n" +
" 2981,\n" +
" \"Mon, 20 Jan 2025 11:00:00 GMT\",\n" +
" \"Tue, 21 Jan 2025 06:55:30 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100816\",\n" +
" \"滨648-斜71\",\n" +
" \"第二次开钻\",\n" +
" \"02\",\n" +
" 453,\n" +
" \"Mon, 03 Feb 2025 23:30:00 GMT\",\n" +
" \"Wed, 05 Feb 2025 06:55:32 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100816\",\n" +
" \"滨648-斜71\",\n" +
" \"完井\",\n" +
" \"09\",\n" +
" 3030,\n" +
" \"Tue, 11 Feb 2025 18:00:00 GMT\",\n" +
" \"Thu, 13 Feb 2025 06:55:25 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100817\",\n" +
" \"滨648-斜72\",\n" +
" \"第一次完钻\",\n" +
" \"13\",\n" +
" 462,\n" +
" \"Tue, 21 Jan 2025 18:00:00 GMT\",\n" +
" \"Thu, 23 Jan 2025 06:55:26 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100825\",\n" +
" \"滨648-斜88\",\n" +
" \"第一次开钻\",\n" +
" \"01\",\n" +
" 0,\n" +
" \"Fri, 20 Dec 2024 15:30:00 GMT\",\n" +
" \"Wed, 25 Dec 2024 06:55:28 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100825\",\n" +
" \"滨648-斜88\",\n" +
" \"第一次完钻\",\n" +
" \"13\",\n" +
" 324,\n" +
" \"Fri, 20 Dec 2024 19:30:00 GMT\",\n" +
" \"Wed, 25 Dec 2024 06:55:28 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100825\",\n" +
" \"滨648-斜88\",\n" +
" \"第二次开钻\",\n" +
" \"02\",\n" +
" 324,\n" +
" \"Sun, 22 Dec 2024 00:00:00 GMT\",\n" +
" \"Wed, 25 Dec 2024 06:55:28 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100817\",\n" +
" \"滨648-斜72\",\n" +
" \"完井\",\n" +
" \"09\",\n" +
" 3251,\n" +
" \"Sat, 01 Feb 2025 13:00:00 GMT\",\n" +
" \"Sun, 02 Feb 2025 06:55:30 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100824\",\n" +
" \"滨648-斜87\",\n" +
" \"第二次完钻\",\n" +
" \"14\",\n" +
" 2840,\n" +
" \"Wed, 26 Mar 2025 12:30:00 GMT\",\n" +
" \"Sun, 30 Mar 2025 06:55:24 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100824\",\n" +
" \"滨648-斜87\",\n" +
" \"完钻\",\n" +
" \"08\",\n" +
" 2840,\n" +
" \"Wed, 26 Mar 2025 12:30:00 GMT\",\n" +
" \"Sun, 30 Mar 2025 06:55:24 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100818\",\n" +
" \"滨648-斜73\",\n" +
" \"第二次完钻\",\n" +
" \"14\",\n" +
" 2981,\n" +
" \"Wed, 15 Jan 2025 12:00:00 GMT\",\n" +
" \"Fri, 17 Jan 2025 06:55:28 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100818\",\n" +
" \"滨648-斜73\",\n" +
" \"完钻\",\n" +
" \"08\",\n" +
" 2981,\n" +
" \"Wed, 15 Jan 2025 12:00:00 GMT\",\n" +
" \"Fri, 17 Jan 2025 06:55:28 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100821\",\n" +
" \"滨648-斜78\",\n" +
" \"第一次完钻\",\n" +
" \"13\",\n" +
" 313,\n" +
" \"Sun, 16 Mar 2025 15:30:00 GMT\",\n" +
" \"Mon, 17 Mar 2025 06:55:24 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100821\",\n" +
" \"滨648-斜78\",\n" +
" \"第一次开钻\",\n" +
" \"01\",\n" +
" 0,\n" +
" \"Sun, 16 Mar 2025 13:00:00 GMT\",\n" +
" \"Mon, 17 Mar 2025 06:55:24 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100820\",\n" +
" \"滨648-斜76\",\n" +
" \"完井\",\n" +
" \"09\",\n" +
" 2763,\n" +
" \"Sat, 15 Mar 2025 08:00:00 GMT\",\n" +
" \"Sun, 16 Mar 2025 06:55:29 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100820\",\n" +
" \"滨648-斜76\",\n" +
" \"第二次开钻\",\n" +
" \"02\",\n" +
" 322,\n" +
" \"Sun, 09 Mar 2025 16:00:00 GMT\",\n" +
" \"Sun, 16 Mar 2025 06:55:29 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100820\",\n" +
" \"滨648-斜76\",\n" +
" \"第一次开钻\",\n" +
" \"01\",\n" +
" 0,\n" +
" \"Sat, 08 Mar 2025 14:00:00 GMT\",\n" +
" \"Mon, 10 Mar 2025 06:55:28 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100820\",\n" +
" \"滨648-斜76\",\n" +
" \"第一次完钻\",\n" +
" \"13\",\n" +
" 322,\n" +
" \"Sat, 08 Mar 2025 17:30:00 GMT\",\n" +
" \"Mon, 10 Mar 2025 06:55:28 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100821\",\n" +
" \"滨648-斜78\",\n" +
" \"完井\",\n" +
" \"09\",\n" +
" 2819,\n" +
" \"Sat, 22 Mar 2025 07:30:00 GMT\",\n" +
" \"Sun, 23 Mar 2025 06:55:24 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100824\",\n" +
" \"滨648-斜87\",\n" +
" \"第二次开钻\",\n" +
" \"02\",\n" +
" 324,\n" +
" \"Mon, 24 Mar 2025 15:00:00 GMT\",\n" +
" \"Sun, 30 Mar 2025 06:55:24 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100820\",\n" +
" \"滨648-斜76\",\n" +
" \"第二次完钻\",\n" +
" \"14\",\n" +
" 2763,\n" +
" \"Tue, 11 Mar 2025 15:00:00 GMT\",\n" +
" \"Sun, 16 Mar 2025 06:55:29 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100824\",\n" +
" \"滨648-斜87\",\n" +
" \"第一次开钻\",\n" +
" \"01\",\n" +
" 0,\n" +
" \"Sun, 23 Mar 2025 12:30:00 GMT\",\n" +
" \"Sun, 30 Mar 2025 06:55:24 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100824\",\n" +
" \"滨648-斜87\",\n" +
" \"第一次完钻\",\n" +
" \"13\",\n" +
" 324,\n" +
" \"Sun, 23 Mar 2025 16:00:00 GMT\",\n" +
" \"Sun, 30 Mar 2025 06:55:24 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100821\",\n" +
" \"滨648-斜78\",\n" +
" \"第二次开钻\",\n" +
" \"02\",\n" +
" 313,\n" +
" \"Mon, 17 Mar 2025 16:00:00 GMT\",\n" +
" \"Wed, 19 Mar 2025 06:55:27 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100816\",\n" +
" \"滨648-斜71\",\n" +
" \"第二次完钻\",\n" +
" \"14\",\n" +
" 3030,\n" +
" \"Wed, 05 Feb 2025 18:00:00 GMT\",\n" +
" \"Fri, 07 Feb 2025 06:55:31 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100816\",\n" +
" \"滨648-斜71\",\n" +
" \"完钻\",\n" +
" \"08\",\n" +
" 3030,\n" +
" \"Wed, 05 Feb 2025 18:00:00 GMT\",\n" +
" \"Fri, 07 Feb 2025 06:55:31 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100821\",\n" +
" \"滨648-斜78\",\n" +
" \"第二次完钻\",\n" +
" \"14\",\n" +
" 2819,\n" +
" \"Wed, 19 Mar 2025 09:00:00 GMT\",\n" +
" \"Thu, 20 Mar 2025 06:55:23 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100821\",\n" +
" \"滨648-斜78\",\n" +
" \"完钻\",\n" +
" \"08\",\n" +
" 2819,\n" +
" \"Wed, 19 Mar 2025 09:00:00 GMT\",\n" +
" \"Thu, 20 Mar 2025 06:55:23 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100820\",\n" +
" \"滨648-斜76\",\n" +
" \"完钻\",\n" +
" \"08\",\n" +
" 2763,\n" +
" \"Tue, 11 Mar 2025 15:00:00 GMT\",\n" +
" \"Sun, 16 Mar 2025 06:55:29 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100824\",\n" +
" \"滨648-斜87\",\n" +
" \"完井\",\n" +
" \"09\",\n" +
" 2840,\n" +
" \"Sat, 29 Mar 2025 09:00:00 GMT\",\n" +
" \"Sun, 30 Mar 2025 06:55:24 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100826\",\n" +
" \"滨648-斜90\",\n" +
" \"完钻\",\n" +
" \"08\",\n" +
" 2834,\n" +
" \"Thu, 03 Apr 2025 02:00:00 GMT\",\n" +
" \"Sat, 05 Apr 2025 06:55:26 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100826\",\n" +
" \"滨648-斜90\",\n" +
" \"第二次完钻\",\n" +
" \"14\",\n" +
" 2834,\n" +
" \"Thu, 03 Apr 2025 02:00:00 GMT\",\n" +
" \"Sat, 05 Apr 2025 06:55:26 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100826\",\n" +
" \"滨648-斜90\",\n" +
" \"第一次开钻\",\n" +
" \"01\",\n" +
" 0,\n" +
" \"Sun, 30 Mar 2025 10:30:00 GMT\",\n" +
" \"Tue, 01 Apr 2025 06:55:29 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100826\",\n" +
" \"滨648-斜90\",\n" +
" \"第一次完钻\",\n" +
" \"13\",\n" +
" 310,\n" +
" \"Sun, 30 Mar 2025 14:00:00 GMT\",\n" +
" \"Tue, 01 Apr 2025 06:55:29 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100822\",\n" +
" \"滨648-斜79\",\n" +
" \"完钻\",\n" +
" \"08\",\n" +
" 2888,\n" +
" \"Thu, 10 Apr 2025 12:00:00 GMT\",\n" +
" \"Sun, 13 Apr 2025 06:55:29 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100822\",\n" +
" \"滨648-斜79\",\n" +
" \"第二次完钻\",\n" +
" \"14\",\n" +
" 2888,\n" +
" \"Thu, 10 Apr 2025 12:00:00 GMT\",\n" +
" \"Sun, 13 Apr 2025 06:55:29 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100822\",\n" +
" \"滨648-斜79\",\n" +
" \"第一次完钻\",\n" +
" \"13\",\n" +
" 312,\n" +
" \"Mon, 07 Apr 2025 16:30:00 GMT\",\n" +
" \"Wed, 09 Apr 2025 06:55:23 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100822\",\n" +
" \"滨648-斜79\",\n" +
" \"第一次开钻\",\n" +
" \"01\",\n" +
" 0,\n" +
" \"Mon, 07 Apr 2025 13:00:00 GMT\",\n" +
" \"Wed, 09 Apr 2025 06:55:23 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100822\",\n" +
" \"滨648-斜79\",\n" +
" \"完井\",\n" +
" \"09\",\n" +
" 2888,\n" +
" \"Tue, 15 Apr 2025 18:00:00 GMT\",\n" +
" \"Thu, 17 Apr 2025 06:55:27 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100822\",\n" +
" \"滨648-斜79\",\n" +
" \"第二次开钻\",\n" +
" \"02\",\n" +
" 312,\n" +
" \"Tue, 08 Apr 2025 15:30:00 GMT\",\n" +
" \"Thu, 10 Apr 2025 06:55:30 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100826\",\n" +
" \"滨648-斜90\",\n" +
" \"完井\",\n" +
" \"09\",\n" +
" 2834,\n" +
" \"Sun, 06 Apr 2025 08:30:00 GMT\",\n" +
" \"Tue, 08 Apr 2025 06:55:26 GMT\"\n" +
" ],\n" +
" [\n" +
" \"SL2024100826\",\n" +
" \"滨648-斜90\",\n" +
" \"第二次开钻\",\n" +
" \"02\",\n" +
" 310,\n" +
" \"Mon, 31 Mar 2025 15:30:00 GMT\",\n" +
" \"Wed, 02 Apr 2025 06:55:26 GMT\"\n" +
" ]\n" +
" ]\n" +
"}";
String url="http://10.68.16.217:33333/get_epbp_jhlist?tn=ZJ_ZJSGJDSJ&jl="+param.getJh();
// String result2 = HttpRequest.get(url).execute().body();
// System.out.println(result2);
// 模拟返回值
// List<Map<String, Object>> mapList = processJson(result2);
List<Map<String, Object>> mapList = processJson(jsonString);
// List<Map<String, Object>> mapList = processJson(jsonString);
List<Map<String, Object>> jh = mapList.stream().filter(it -> param.getJh().equals(it.get("JH").toString())).collect(Collectors.toList());
// List<Map<String, Object>> jh = mapList.stream().filter(it -> param.getJh().equals(it.get("JH").toString())).collect(Collectors.toList());
List<DjZqsjfx> list =djdcInfoMapper.getZqshfxList(param);
DecimalFormat df = new DecimalFormat("#.00");
......@@ -886,216 +303,6 @@ public class DjdcServiceImpl implements DjdcService {
}
item.setJc(djZqsjfx.getJc());
item.setCw(djZqsjfx.getCw().substring(djZqsjfx.getCw().lastIndexOf("-")+1));
//查询周期
// Jsta jsta =new Jsta();
// jsta.setJh(item.getJh());
// jsta.setJd2(item.getJs());
// jsta.setJd1(item.getKsjs());
// List<Jsta> jstaList = jstaMapper.getList(jsta);
// Double zjzq =0.0;
// Double zwzq =0.0;
// Double js = item.getJs();
// for(Jsta it:jstaList){
// Double jd1=it.getJd1()==null?0.0:it.getJd1();
// Double jd2=it.getJd2()==null?0.0:it.getJd2();
// if(jd1==0&jd2==0){
// continue;
// } else if(jd1.equals(js) && js.equals(jd2)){
// zwzq=zwzq+it.getSjts();
// }else {
// zjzq=zjzq+it.getSjts();
// }
// }
// item.setZjzq(Double.parseDouble(df.format(zjzq)));
// item.setZwzq(Double.parseDouble(df.format(zwzq)));
// if(item.getZjzq()>0){
// System.out.println(item.getZjzq());
// System.out.println(zwzq);
// Double zjsl=item.getJc()/item.getZjzq();
// System.out.println(zjsl);
// item.setZjsl(Double.parseDouble(df.format(zjsl)));
// }
//查询钻井日志
// Jswa jswa =new Jswa();
// jswa.setJh(item.getJh());
// jswa.setJs(item.getJs());
// jswa.setKsjs(item.getKsjs());
// List<Jswa> jswaList=jswaMapper.getList(jswa);
// Double zjycsl=0.0;
// Double wjycsl=0.0;
// for(Jswa wa:jswaList){
// Double js1 = wa.getJs();
// Double rjc = wa.getRjc();
// if (rjc!=0 && js1<= js) {
// //钻进
// zjycsl=zjycsl+(wa.getSg()+wa.getXl()+wa.getZrtg()+wa.getZztg()+wa.getFzqk());
// }else if(rjc==0 && Objects.equals(js1, item.getJs())) {
// //完井
// wjycsl=wjycsl+(wa.getSg()+wa.getXl()+wa.getZrtg()+wa.getZztg()+wa.getFzqk());
// }
// }
// item.setZjycsl(Double.parseDouble(df.format(zjycsl)));
// item.setWjycsl(Double.parseDouble(df.format(wjycsl)));
//计算周期
// List<Map<String, Object>> jhzqList = mapList.stream().filter(it -> item.getJh().equals(it.get("JH").toString())).collect(Collectors.toList());
// ZonedDateTime kssj=null;
// ZonedDateTime zwsj=null;
// ZonedDateTime jssj=null;
// if(item.getKc().equals("1")){
// //取出开始日期
// Map<String, Object> mapks = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("01")).findFirst().orElse(null);
//
// if(mapks!=null){
// String dateStr = (String) mapks.get("ZYSJ");
// if (dateStr != null) {
// kssj= ZonedDateTime.parse(dateStr, formatter);
// }
// }
// //取出钻完日期
// Map<String, Object> mapzw = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("13")).findFirst().orElse(null);
//
// if(mapzw!=null){
// String dateStr = (String) mapzw.get("ZYSJ");
//
// if (dateStr != null) {
// zwsj = ZonedDateTime.parse(dateStr, formatter);
// }
// }else {
// mapzw = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("08")).findFirst().orElse(null);
// if(mapzw!=null){
// String dateStr = (String) mapzw.get("ZYSJ");
// if (dateStr != null) {
// zwsj = ZonedDateTime.parse(dateStr, formatter);
// }
// }
// }
// //取出结束日期
//
// Map<String, Object> mapjs = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("02")).findFirst().orElse(null);
//
// if(mapjs!=null){
// String dateStr = (String) mapjs.get("ZYSJ");
// if (dateStr != null) {
// jssj = ZonedDateTime.parse(dateStr, formatter);
// }
// }else {
// mapjs = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("09")).findFirst().orElse(null);
// if(mapjs!=null){
// String dateStr = (String) mapjs.get("ZYSJ");
// if (dateStr != null) {
// jssj = ZonedDateTime.parse(dateStr, formatter);
// }
// }
// }
//
// }else if(item.getKc().equals("2")){
//
// //取出开始日期
// Map<String, Object> mapks = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("02")).findFirst().orElse(null);
//
// if(mapks!=null){
// String dateStr = (String) mapks.get("ZYSJ");
//
// if (dateStr != null) {
// kssj= ZonedDateTime.parse(dateStr, formatter);
// }
// }
// //取出钻完日期
// Map<String, Object> mapzw = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("14")).findFirst().orElse(null);
//
// if(mapzw!=null){
// String dateStr = (String) mapzw.get("ZYSJ");
//
// if (dateStr != null) {
// SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);
// zwsj = ZonedDateTime.parse(dateStr, formatter);
// }
// }else {
// mapzw = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("08")).findFirst().orElse(null);
// if(mapzw!=null){
// String dateStr = (String) mapzw.get("ZYSJ");
// if (dateStr != null) {
// zwsj = ZonedDateTime.parse(dateStr, formatter);
// }
// }
// }
// //取出结束日期
// Map<String, Object> mapjs = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("03")).findFirst().orElse(null);
//
// if(mapjs!=null){
//
// if(mapjs!=null){
// String dateStr = (String) mapjs.get("ZYSJ");
// if (dateStr != null) {
// jssj = ZonedDateTime.parse(dateStr, formatter);
// }
// }
// }else {
// mapjs = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("09")).findFirst().orElse(null);
// if(mapjs!=null){
// String dateStr = (String) mapjs.get("ZYSJ");
// if (dateStr != null) {
// jssj = ZonedDateTime.parse(dateStr, formatter);
// }
// }
// }
//
//
//
// }else if(item.getKc().equals("3")){
// //取出开始日期
// Map<String, Object> mapks = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("03")).findFirst().orElse(null);
//
// if(mapks!=null){
// String dateStr = (String) mapks.get("ZYSJ");
//
// if (dateStr != null) {
// SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);
// kssj= ZonedDateTime.parse(dateStr, formatter);
// }
// }
// //取出钻完日期
// Map<String, Object> mapzw = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("15")).findFirst().orElse(null);
//
// if(mapzw!=null){
// String dateStr = (String) mapzw.get("ZYSJ");
//
// if (dateStr != null) {
// SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);
// zwsj = ZonedDateTime.parse(dateStr, formatter);
// }
// }else {
// mapzw = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("08")).findFirst().orElse(null);
// if(mapzw!=null){
// String dateStr = (String) mapzw.get("ZYSJ");
// if (dateStr != null) {
// zwsj = ZonedDateTime.parse(dateStr, formatter);
// }
// }
// }
// //取出结束日期
// Map<String, Object> mapjs = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("04")).findFirst().orElse(null);
//
// if(mapjs!=null){
//
// if(mapjs!=null){
// String dateStr = (String) mapjs.get("ZYSJ");
// if (dateStr != null) {
// jssj = ZonedDateTime.parse(dateStr, formatter);
// }
// }
// }else {
// mapjs = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("09")).findFirst().orElse(null);
// if(mapjs!=null){
// String dateStr = (String) mapjs.get("ZYSJ");
// if (dateStr != null) {
// jssj = ZonedDateTime.parse(dateStr, formatter);
// }
// }
// }
// }
//查询日志表
String kssj =item.getKssj();
String jssj =item.getJssj();
......@@ -2014,6 +1221,194 @@ public class DjdcServiceImpl implements DjdcService {
return list;
}
@Override
public List<LjSzfxjg> getSztfxjgList(List<DjZtfx> djZtfxList, List<Djjc> djjcList, CommonParam param) {
Map<String,Object> map = new HashMap<>();
List<LjSzfxjg> ljSzfxjgList=new ArrayList<>();
DecimalFormat df = new DecimalFormat("#.00");
List<SjInfo> sjInfoList = param.getSj();
for(SjInfo info :sjInfoList){
List<SjInfo> reList =new ArrayList<>();
//钻头分析模块
List<DjZtfx> collect = djZtfxList.stream().filter(ztfx -> equals(ztfx.getCc(), info.getZtcc()) && info.getKc().equals(ztfx.getKc())).collect(Collectors.toList());
//按使用数量排序
List<DjZtfx> ztslList=collect.stream()
.sorted(Comparator.comparingInt(DjZtfx::getZtsl).reversed()).collect(Collectors.toList());
int size=0;
if(ztslList.size()>3){
size=3;
}else {
size=ztslList.size();
}
int ztsl=0;
for(int i =0;i<size;i++){
DjZtfx djZtfx = ztslList.get(i);
SjInfo sjInfo=new SjInfo();
sjInfo.setKc(djZtfx.getKc());
sjInfo.setZtcc(djZtfx.getCc());
sjInfo.setZtxh(djZtfx.getZtxh());
sjInfo.setJc(djZtfx.getJcZw());
sjInfo.setJs(djZtfx.getJxzsZw());
sjInfo.setZb(0.0);
sjInfo.setSl(djZtfx.getZtsl());
sjInfo.setGnmk("钻头分析区块");
sjInfo.setYtzl(djZtfx.getYtzl());
ztsl=djZtfx.getZtsl();
reList.add(sjInfo);
}
if(size==3){
for(int i =3;i<ztslList.size();i++){
DjZtfx djZtfx = ztslList.get(i);
if(ztsl==djZtfx.getZtsl()){
SjInfo sjInfo=new SjInfo();
sjInfo.setKc(djZtfx.getKc());
sjInfo.setZtcc(djZtfx.getCc());
sjInfo.setZtxh(djZtfx.getZtxh());
sjInfo.setJc(djZtfx.getJcZw());
sjInfo.setJs(djZtfx.getJxzsZw());
sjInfo.setZb(0.0);
sjInfo.setSl(djZtfx.getZtsl());
sjInfo.setGnmk("钻头分析区块");
sjInfo.setYtzl(djZtfx.getYtzl());
reList.add(sjInfo);
ztsl=djZtfx.getZtsl();
}
}
}
//按一趟钻率排序
List<DjZtfx> zjlList=collect.stream()
.sorted(Comparator.comparingDouble(DjZtfx::getYtzl).reversed()).collect(Collectors.toList());
if(zjlList.size()>3){
size=3;
}else {
size=zjlList.size();
}
Double ytzl=0.0;
for(int i =0;i<size;i++){
DjZtfx djZtfx = zjlList.get(i);
SjInfo sjInfo=new SjInfo();
sjInfo.setKc(djZtfx.getKc());
sjInfo.setZtcc(djZtfx.getCc());
sjInfo.setZtxh(djZtfx.getZtxh());
sjInfo.setJc(djZtfx.getJcZw());
sjInfo.setJs(djZtfx.getJxzsZw());
sjInfo.setZb(0.0);
sjInfo.setSl(djZtfx.getZtsl());
sjInfo.setGnmk("钻头分析区块");
sjInfo.setYtzl(djZtfx.getYtzl());
ytzl=djZtfx.getYtzl();
reList.add(sjInfo);
}
if(size==3){
for(int i =3;i<ztslList.size();i++){
DjZtfx djZtfx = ztslList.get(i);
if( equals(ytzl, djZtfx.getYtzl())){
SjInfo sjInfo=new SjInfo();
sjInfo.setKc(djZtfx.getKc());
sjInfo.setZtcc(djZtfx.getCc());
sjInfo.setZtxh(djZtfx.getZtxh());
sjInfo.setJc(djZtfx.getJcZw());
sjInfo.setJs(djZtfx.getJxzsZw());
sjInfo.setZb(0.0);
sjInfo.setSl(djZtfx.getZtsl());
sjInfo.setGnmk("钻头分析区块");
sjInfo.setYtzl(djZtfx.getYtzl());
reList.add(sjInfo);
ytzl=djZtfx.getYtzl();
}
}
}
List<SjInfo> collect1 = reList.stream().distinct().collect(Collectors.toList());
//计算得分
calculateScores(collect1);
// 按进尺降序排序
List<SjInfo> jcSorted = collect1.stream()
.sorted(Comparator.comparingDouble(SjInfo::getJc).reversed())
.collect(Collectors.toList());
LjSzfxjg ljSzfxjg=new LjSzfxjg();
ljSzfxjg.setGnmk("钻头分析区块");
ljSzfxjg.setFxfw(info.getKc()+"开");
ljSzfxjg.setFxdx("钻头使用");
ljSzfxjg.setScfx("钻头选型");
ljSzfxjg.setYxyj("进尺最高");
if(jcSorted.size()>=2){
SjInfo sjInfo = jcSorted.get(0);
SjInfo sjInfo2 = jcSorted.get(1);
ljSzfxjg.setFxxy("钻头进尺最高是"+sjInfo.getZtxh()+"("+sjInfo.getSl()+"只)、进尺"+sjInfo.getJc()+"、一趟钻率("+sjInfo.getYtzl()+"%),其次钻头进尺最高是"+sjInfo2.getZtxh()+"("+sjInfo2.getSl()+"只),进尺"+sjInfo2.getJc()+"、一趟钻率("+sjInfo2.getYtzl()+"%)");
ljSzfxjg.setZyjy(sjInfo.getZtxh());
ljSzfxjg.setQcyj(sjInfo2.getZtxh());
ljSzfxjg.setTjpf(Double.parseDouble(df.format(sjInfo.getTotalScore())));
}else if(jcSorted.size()==1){
SjInfo sjInfo = jcSorted.get(0);
ljSzfxjg.setFxxy("钻头进尺最高是"+sjInfo.getZtxh()+"("+sjInfo.getSl()+"只)、进尺"+sjInfo.getJc()+"、一趟钻率("+sjInfo.getYtzl()+"%)");
ljSzfxjg.setZyjy(sjInfo.getZtxh());
ljSzfxjg.setTjpf(Double.parseDouble(df.format(sjInfo.getTotalScore())));
}
ljSzfxjgList.add(ljSzfxjg);
// 按机速降序排序
List<SjInfo> jsSorted = collect1.stream()
.sorted(Comparator.comparingDouble(SjInfo::getJs).reversed())
.collect(Collectors.toList());
LjSzfxjg ljSzfxjgjs=new LjSzfxjg();
ljSzfxjgjs.setGnmk("钻头分析区块");
ljSzfxjgjs.setFxfw(info.getKc()+"开");
ljSzfxjgjs.setFxdx("钻头使用");
ljSzfxjgjs.setScfx("钻头选型");
ljSzfxjgjs.setYxyj("机速最快");
if(jsSorted.size()>=2){
SjInfo sjInfo = jsSorted.get(0);
SjInfo sjInfo2 = jsSorted.get(1);
ljSzfxjgjs.setFxxy("钻头机速最快是"+sjInfo.getZtxh()+"("+sjInfo.getSl()+"只)、机械转速为"+sjInfo.getJs()+"、一趟钻率("+sjInfo.getYtzl()+"%),其次钻头数量使用最多是"+sjInfo2.getZtxh()+"("+sjInfo2.getSl()+"只),机械转速为"+sjInfo2.getJs()+"、一趟钻率("+sjInfo2.getYtzl()+"%)");
ljSzfxjgjs.setZyjy(sjInfo.getZtxh());
ljSzfxjgjs.setQcyj(sjInfo2.getZtxh());
ljSzfxjgjs.setTjpf(Double.parseDouble(df.format(sjInfo.getTotalScore())));
}else if(jsSorted.size()==1){
SjInfo sjInfo = jsSorted.get(0);
ljSzfxjgjs.setFxxy("钻头机速最快是"+sjInfo.getZtxh()+"("+sjInfo.getSl()+"只)、机械转速为"+sjInfo.getJs()+"、一趟钻率("+sjInfo.getYtzl()+"%)");
ljSzfxjgjs.setZyjy(sjInfo.getZtxh());
ljSzfxjgjs.setTjpf(Double.parseDouble(df.format(sjInfo.getTotalScore())));
}
ljSzfxjgList.add(ljSzfxjgjs);
// 按数量降序排序
List<SjInfo> slSorted = collect1.stream()
.sorted(Comparator.comparingInt(SjInfo::getSl).reversed())
.collect(Collectors.toList());
LjSzfxjg ljSzfxjgSl=new LjSzfxjg();
ljSzfxjgSl.setGnmk("钻头分析区块");
ljSzfxjgSl.setFxfw(info.getKc()+"开");
ljSzfxjgSl.setFxdx("钻头使用");
ljSzfxjgSl.setScfx("钻头选型");
ljSzfxjgSl.setYxyj("数量最多");
if(slSorted.size()>=2){
SjInfo sjInfo = slSorted.get(0);
SjInfo sjInfo2 = slSorted.get(1);
ljSzfxjgSl.setFxxy("钻头数量使用最多是"+sjInfo.getZtxh()+"("+sjInfo.getSl()+"只)、一趟钻率("+sjInfo.getYtzl()+"%),其次钻头数量使用最多是"+sjInfo2.getZtxh()+"("+sjInfo2.getSl()+"只),一趟钻率("+sjInfo2.getYtzl()+"%)");
ljSzfxjgSl.setZyjy(sjInfo.getZtxh());
ljSzfxjgSl.setQcyj(sjInfo2.getZtxh());
ljSzfxjgSl.setTjpf(Double.parseDouble(df.format(sjInfo.getTotalScore())));
}else if(slSorted.size()==1){
SjInfo sjInfo = slSorted.get(0);
ljSzfxjgSl.setFxxy("钻头数量使用最多是"+sjInfo.getZtxh()+"、一趟钻率("+sjInfo.getYtzl()+"%)");
ljSzfxjgSl.setZyjy(sjInfo.getZtxh());
ljSzfxjgSl.setTjpf(Double.parseDouble(df.format(sjInfo.getTotalScore())));
}
ljSzfxjgList.add(ljSzfxjgSl);
}
return ljSzfxjgList;
}
public static void calculateScores(List<SjInfo> items) {
// 按进尺降序排序
......
......@@ -106,6 +106,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="jdzjl != null">#{jdzjl},</if>
</trim>
</insert>
<insert id="insertSjLjjwBatch">
INSERT INTO sj_ljjw
(
jh, ljjh, jx, wjjs, wjczjs, wzcw, kc, zjzq, wjzq,
jkjl, jdjl, jkhzb, jkzzb, jkhjl, jkzjl,
jdhzb, jdzzb, jdhjl, jdzjl
)
VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.jh},
#{item.ljjh},
#{item.jx},
#{item.wjjs},
#{item.wjczjs},
#{item.wzcw},
#{item.kc},
#{item.zjzq},
#{item.wjzq},
#{item.jkjl},
#{item.jdjl},
#{item.jkhzb},
#{item.jkzzb},
#{item.jkhjl},
#{item.jkzjl},
#{item.jdhzb},
#{item.jdzzb},
#{item.jdhjl},
#{item.jdzjl}
)
</foreach>
</insert>
<update id="updateSjLjjw" parameterType="SjLjjw">
update sj_ljjw
......@@ -143,4 +176,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<delete id="deleteSjLjjwByJh">
delete from sj_ljjw where jh = #{jh}
</delete>
</mapper>
\ No newline at end of file
......@@ -94,6 +94,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="qsjsZw != null">#{qsjsZw},</if>
</trim>
</insert>
<insert id="insertSjQkztfxBatch">
INSERT INTO sj_qkztfx
(
jh, kc, ztxh, cj, cc, ztsl,
ytzl, etzl, stzl, sitzl, wtzl,
jc_zw, jc_max, jxzs_zw, jxzs_max, qsjs_zw
)
VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.jh},
#{item.kc},
#{item.ztxh},
#{item.cj},
#{item.cc},
#{item.ztsl},
#{item.ytzl},
#{item.etzl},
#{item.stzl},
#{item.sitzl},
#{item.wtzl},
#{item.jcZw},
#{item.jcMax},
#{item.jxzsZw},
#{item.jxzsMax},
#{item.qsjsZw}
)
</foreach>
</insert>
<update id="updateSjQkztfx" parameterType="SjQkztfx">
update sj_qkztfx
......@@ -128,4 +158,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<delete id="deleteSjQkztfxByJh">
delete from sj_qkztfx where jh = #{jh}
</delete>
</mapper>
\ No newline at end of file
......@@ -19,15 +19,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createdTime" column="created_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="jh" column="jh" />
</resultMap>
<sql id="selectSjSzfxjgVo">
select id, fxfw, fxdx, fxxy, fxjl, scfx, yxyj, zyjy, qcyj, tjpf, created_by, created_time, update_by, update_time from sj_szfxjg
select id, jh,fxfw, fxdx, fxxy, fxjl, scfx, yxyj, zyjy, qcyj, tjpf, created_by, created_time, update_by, update_time from sj_szfxjg
</sql>
<select id="selectSjSzfxjgList" parameterType="SjSzfxjg" resultMap="SjSzfxjgResult">
<include refid="selectSjSzfxjgVo"/>
<where>
<if test="jh != null and jh != ''"> and jh = #{jh}</if>
<if test="fxfw != null and fxfw != ''"> and fxfw = #{fxfw}</if>
<if test="fxdx != null and fxdx != ''"> and fxdx = #{fxdx}</if>
<if test="fxxy != null and fxxy != ''"> and fxxy = #{fxxy}</if>
......@@ -63,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createdTime != null">created_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="jh != null">jh,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fxfw != null">#{fxfw},</if>
......@@ -78,8 +81,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createdTime != null">#{createdTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="jh != null">#{jh},</if>
</trim>
</insert>
<insert id="insertSjSzfxjgBatch">
INSERT INTO sj_szfxjg
(
jh,fxfw, fxdx, fxxy, fxjl, scfx,
yxyj, zyjy, qcyj, tjpf,
created_by, created_time, update_by, update_time
)
VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.jh},
#{item.fxfw},
#{item.fxdx},
#{item.fxxy},
#{item.fxjl},
#{item.scfx},
#{item.yxyj},
#{item.zyjy},
#{item.qcyj},
#{item.tjpf},
#{item.createdBy},
#{item.createdTime},
#{item.updateBy},
#{item.updateTime}
)
</foreach>
</insert>
<update id="updateSjSzfxjg" parameterType="SjSzfxjg">
update sj_szfxjg
......@@ -97,6 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="jh != null">jh = #{jh},</if>
</trim>
where id = #{id}
</update>
......@@ -111,4 +144,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<delete id="deleteSjSzfxjgByJh">
delete from sj_szfxjg where jh = #{jh}
</delete>
</mapper>
\ No newline at end of file
......@@ -98,6 +98,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="wjycms != null">#{wjycms},</if>
</trim>
</insert>
<insert id="insertSjZqfxBatch">
INSERT INTO sj_zqfx
(
jh, ljjh, jtm, ksjs, js, kc, jc, cw,
zjzq, zjycsl, zjsczq, zjsl, zwzq,
wjycsl, wjsczq, zjycms, wjycms
)
VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.jh},
#{item.ljjh},
#{item.jtm},
#{item.ksjs},
#{item.js},
#{item.kc},
#{item.jc},
#{item.cw},
#{item.zjzq},
#{item.zjycsl},
#{item.zjsczq},
#{item.zjsl},
#{item.zwzq},
#{item.wjycsl},
#{item.wjsczq},
#{item.zjycms},
#{item.wjycms}
)
</foreach>
</insert>
<update id="updateSjZqfx" parameterType="SjZqfx">
update sj_zqfx
......@@ -133,4 +164,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<delete id="deleteSjZqfxByJh">
delete from sj_zqfx where jh = #{jh}
</delete>
</mapper>
\ No newline at end of file
......@@ -94,6 +94,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="zb != null">#{zb},</if>
</trim>
</insert>
<insert id="insertSjZtgjsjBatch">
INSERT INTO sj_ztgjsj
(
jh, ljjh, kc, jd, ztcc, ztxh, pz, mxqk,
qzyy, cw, zjymd, pl, lgby, jc, jxzs, zb
)
VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.jh},
#{item.ljjh},
#{item.kc},
#{item.jd},
#{item.ztcc},
#{item.ztxh},
#{item.pz},
#{item.mxqk},
#{item.qzyy},
#{item.cw},
#{item.zjymd},
#{item.pl},
#{item.lgby},
#{item.jc},
#{item.jxzs},
#{item.zb}
)
</foreach>
</insert>
<update id="updateSjZtgjsj" parameterType="SjZtgjsj">
update sj_ztgjsj
......@@ -128,4 +157,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<delete id="deleteSjZtgjsjByJh">
delete from sj_ztgjsj where jh = #{jh}
</delete>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment