Commit ed08fcdd by guotao

主要风险:

①是模板里的
②是邻井的,邻井匹配的单独一块,列出的是 附近复杂故障井 里的复杂故障记录

风险管控措施
①模板里加上
②邻井匹配到的复杂故障的对应措施(溢流、漏失、卡钻,匹配到就出来一段。)

轨迹优化
邻井的相似方位井
轨迹统计
parent f5755400
......@@ -143,7 +143,8 @@ public class SgfambKcSggy extends BaseEntity
/** 复合片齿形 */
@Excel(name = "复合片齿形")
private String ffpcx;
@Excel(name = "风险管控措施")
private String fxgkcs;
}
......@@ -530,7 +530,7 @@ public class SjDjjcServiceImpl implements ISjDjjcService
}
}
String fxts="";
String fxts="区块风险:<p>";
//邻井风险
if(StringUtils.isNotEmpty( sgfambKcSggy.getFxts())){
SjZysx sjZysx=new SjZysx();
......@@ -554,12 +554,15 @@ public class SjDjjcServiceImpl implements ISjDjjcService
);
String tokenres = HttpUtil.get(url, resultMap);
System.out.println(tokenres);
fxts=tokenres;
fxts+=tokenres;
}else {
fxts= s;
fxts+= s;
}
}else {
fxts= sgfambKcSggy.getFxts();
fxts+= sgfambKcSggy.getFxts();
}
if (fxts.equals("区块风险:<p>")){
fxts="";
}
if(sjZysxes.size()>0){
SjZysx sjZysx1 = sjZysxes.get(0);
......@@ -578,6 +581,7 @@ public class SjDjjcServiceImpl implements ISjDjjcService
sjFdsgcs1.setGjfx(sgfambKcSggy.getGjfx());
sjFdsgcs1.setGjyh(sgfambKcSggy.getGjyh());
sjFdsgcs1.setZjycs(sgfambKcSggy.getZjycs());
sjFdsgcs1.setFxgkcs(sgfambKcSggy.getFxgkcs());
sjFdsgcs1.setZjgccs(sgfambKcSggy.getZjgccs());
sjFdsgcs1.setZyfx(fxts);
sjFdsgcsMapper.updateSjFdsgcs(sjFdsgcs1);
......@@ -591,6 +595,7 @@ public class SjDjjcServiceImpl implements ISjDjjcService
sjFdsgcs1.setGjyh(sgfambKcSggy.getGjyh());
sjFdsgcs1.setZjycs(sgfambKcSggy.getZjycs());
sjFdsgcs1.setZjgccs(sgfambKcSggy.getZjgccs());
sjFdsgcs1.setFxgkcs(sgfambKcSggy.getFxgkcs());
sjFdsgcs1.setZyfx(fxts);
sjFdsgcsMapper.insertSjFdsgcs(sjFdsgcs1);
}
......@@ -663,9 +668,14 @@ public class SjDjjcServiceImpl implements ISjDjjcService
sjZtcsxxMapper.insertSjZtcsxx(sjZtcsxx);
}
}
sjSggyGjsbxnyq.setSjyh(String.join(";", sjggjyh));
sjSggyGjsbxnyqMapper.updateSjSggyGjsbxnyqByjh(sjSggyGjsbxnyq);
return sjDjjcMapper.updateSjDjjc(sjDjjc);
}
......@@ -816,6 +826,9 @@ public class SjDjjcServiceImpl implements ISjDjjcService
sjSzfxjgMapper.deleteSjSzfxjgByJh(jh);
sjSzfxjgMapper.insertSjSzfxjgBatch(sjSzfxjgList);
}
return AjaxResult.success();
}
......
......@@ -12,9 +12,8 @@ import com.zjsgfa.common.utils.StringUtils;
import com.zjsgfa.project.zjsgfa.domain.*;
import com.zjsgfa.project.zjsgfa.mapper.*;
import com.zjsgfa.project.zjsgfa.util.CxszhUtil;
import com.zjsgfa.project.zt.domain.CommonParam;
import com.zjsgfa.project.zt.domain.Jsqa;
import com.zjsgfa.project.zt.domain.Ljjw;
import com.zjsgfa.project.zt.domain.*;
import com.zjsgfa.project.zt.mapper.DjdcInfoMapper;
import com.zjsgfa.project.zt.mapper.JsqaMapper;
import com.zjsgfa.project.zt.service.DjdcService;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -69,7 +68,10 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
@Autowired
private SgfambKcSggyMapper sgfambKcSggyMapper;
@Autowired
private DjdcInfoMapper djdcInfoMapper;
@Autowired
private SjJygjGdfdcsMapper sjJygjGdfdcsMapper;
/**
* 查询设计-分段施工措施
......@@ -239,6 +241,7 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
SjJsjg sjJsjg =new SjJsjg();
sjJsjg.setJh(sjFdsgcs.getJh());
List<SjJsjg> sjJsjgList = sjJsjgMapper.selectSjJsjgList(sjJsjg);
//查询邻井
SjLjjw sjLjjw =new SjLjjw();
sjLjjw.setJh(sjFdsgcs.getJh());
List<SjLjjw> sjLjjwList = sjLjjwMapper.selectSjLjjwList(sjLjjw);
......@@ -259,6 +262,34 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
if(sjDjjc1.getFaid()!=null){
sgmbySggyList = sgfambKcSggyList.stream().filter(sgfambKcSggy -> sgfambKcSggy.getZbid().toString().equals(sjDjjc1.getFaid().toString())).collect(Collectors.toList());
}
//获取所有井的造斜规律数据
List<Jskd> jskdList = new ArrayList<>();
List<DjZqsjfx> djZqsjfxList=null;
///如果邻井不为空,则进行造斜率的数据封装
if (sjLjjwList.size() > 0) {
Object djdcinfo;
CommonParam commonParam = new CommonParam();
String[] jhs=new String[sjLjjwList.size()];
for (int i = 0; i < sjLjjwList.size(); i++) {
jhs[i]=sjLjjwList.get(i).getLjjh();
}
commonParam.setJhs(jhs);
commonParam.setFw(sjJygjGdsjgdcsList.get(0).getFw());
djZqsjfxList = djdcInfoMapper.getjskd(commonParam);
//如果获取的方位相同的井列表不为空
// if (djZqsjfxList.size() > 0){
// ///获取所有井的造斜规律数据
// CommonParam commonParam1 = new CommonParam();
// String[] jhs2=new String[djZqsjfxList.size()];
// for (int i = 0; i < djZqsjfxList.size(); i++) {
// jhs2[i]=djZqsjfxList.get(i).getJh();
// }
// commonParam1.setJhs(jhs2);
// jskdList= djdcService.getJskdList(commonParam1);
// }
}
double previousDepth= 0;
double csaa= 0;
......@@ -270,6 +301,33 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
//上一次的垂深
previousDepth = csaa;
}
String gjyh="";
/////查询符合开次的测斜数据
if(djZqsjfxList!=null){
List<Jskd> jskdList_kc =new ArrayList<>();
double ksjs=0.0;
if (i==0){
//开始井深
ksjs=0;
}else {
ksjs= sjJsjgList.get(i).getJs();
}
double jsjs=sjJsjg1.getJs();
CommonParam commonParam = new CommonParam();
String[] jhs= djZqsjfxList.stream().map(djZqsjfx -> djZqsjfx.getJh()).toArray(String[]::new) ;
commonParam.setJhs(jhs);
commonParam.setKsjs(ksjs);
commonParam.setJsjs(jsjs);
jskdList_kc=djdcInfoMapper.getJskdList2(commonParam);
if (jskdList_kc.size()>0){
for (Jskd jskd : jskdList_kc) {
gjyh+=jskd.getGldc()+": 自然增:"+jskd.getZrz()+", 自然减:"+jskd.getZrj()+", 人工增:"+jskd.getRgz()+", 人工减:"+jskd.getRgj()+"<br>";
}
}
}
String kc = sjJsjg1.getKc();
sjFdsgcs.setKc(kc);
SjFdsgcs sjFdsgcs1 =sjFdsgcsMapper.selectSjFdsgcsByJhAndKc(sjFdsgcs);
......@@ -279,6 +337,7 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
if(sgfambKcSggy!=null){
zyfx=sgfambKcSggy.getFxts();
}
zyfx=zyfx+"<p>邻井风险<p>";
List<String> fzqk=new ArrayList<>();
//查询一趟钻率
int kc1=i+1;
......@@ -291,6 +350,7 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
}
if(sjFdsgcs1==null){
//查询是否有复杂情况
if(collect.size()>0){
Jsqa jsqa= new Jsqa();
......@@ -322,12 +382,15 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
if(StringUtils.isNotEmpty(zyfx)){
zyfx=zyfx+";<br>"+item.getJh()+"在"+item.getJs()+"m发生"+item.getFzqk();
}else {
zyfx="邻井存在风险:"+item.getJh()+"在"+item.getJs()+"m发生"+item.getFzqk();
zyfx=""+item.getJh()+"在"+item.getJs()+"m发生"+item.getFzqk();
}
}
}
sjFdsgcs.setZjgccs(zjgccs);
sjFdsgcs.setZjycs(zjycs);
if (zyfx.endsWith("<p>邻井风险<p>")){
zyfx=zyfx.replace("<p>邻井风险<p>","");
}
sjFdsgcs.setZyfx(zyfx);
String join = "";
if(fzqk.size()>0){
......@@ -376,8 +439,10 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
sjFdsgcs.setJdqk(previousDepth+"-"+cs+","+sjFdsgcsDcyxList.get(0).getDcmc()+"-"+sjFdsgcsDcyxList.get(sjFdsgcsDcyxList.size()-1).getDcmc());
}
}
sjFdsgcs.setGjyh(gjyh);
sjFdsgcsMapper.insertSjFdsgcs(sjFdsgcs);
}else {
sjFdsgcs1.setGjyh(gjyh);
//查询是否有复杂情况
if(collect.size()>0){
Jsqa jsqa= new Jsqa();
......@@ -386,6 +451,7 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
List<Jsqa> jsqaList=jsqaMapper.getJsqaByjhAndJs(jsqa);
String zjycs="";
String zjgccs="";
String fxgkcs="";
if(jsqaList.size()>0){
// List<String> fzqk=new ArrayList<>();
List<String> collect3 = jsqaList.stream().map(Jsqa::getFzqk).distinct().collect(Collectors.toList());
......@@ -396,19 +462,20 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
if(StringUtils.isNotEmpty(zjgccs)){
zjgccs=zjgccs+";"+s+":钻井工程措施:"+clFxsb1.getGcjscs();
zjycs=zjycs+";"+s+":钻井液措施:"+clFxsb1.getZjycs();
fxgkcs=fxgkcs+";"+s+":"+clFxsb1.getJkcs()+"<p>";
}else {
zjycs=zjycs+":钻井液措施:"+clFxsb1.getZjycs();
zjgccs=zjgccs+";"+s+":钻井工程措施:"+clFxsb1.getGcjscs();
fxgkcs=fxgkcs+";"+s+":"+clFxsb1.getJkcs()+"<p>";
}
}
}
for(Jsqa item: jsqaList){
fzqk.add(item.getJh()+"在"+item.getJs()+"时发生"+item.getFzqk());
ClFxsb clFxsb1 = clFxsbList.stream().filter(clFxsb -> StringUtils.isNotEmpty(clFxsb.getPdtj())).collect(Collectors.toList()).stream().filter(clFxsb -> clFxsb.getPdtj().contains(item.getFzqk())).findFirst().orElse(null);
if(clFxsb1!=null){
if(StringUtils.isNotEmpty(zyfx)){
zyfx=zyfx+";<br>"+item.getJh()+"在"+item.getJs()+"m发生"+item.getFzqk();
zyfx=zyfx+item.getJh()+"在"+item.getJs()+"m发生"+item.getFzqk()+"<br>";
}else {
zyfx="邻井存在风险:"+item.getJh()+"在"+item.getJs()+"m发生"+item.getFzqk();
}
......@@ -416,6 +483,7 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
}
sjFdsgcs1.setZjgccs(zjgccs);
sjFdsgcs1.setZjycs(zjycs);
sjFdsgcs1.setFxgkcs(fxgkcs);
sjFdsgcs1.setZyfx(zyfx);
String join = "";
if(fzqk.size()>0){
......
......@@ -73,7 +73,8 @@ public class CommonParam {
private Double ksjs;
private Double jsjs;
private Double fw;
private String dc;
......
......@@ -47,6 +47,9 @@ public class Jskd {
private String gldc;
@Excel(name = "关联造斜点")
private String glzxd;
private String zrj;
private String zrz;
private String rgz;
private String rgj;
private List<Jskd> list;
}
\ No newline at end of file
......@@ -43,7 +43,12 @@ public interface DjdcInfoMapper {
List<DjZqsjfx> getZqshfxList2(CommonParam param);
/**
* 获取方位相同的井号
* @param param
* @return
*/
List<DjZqsjfx> getjskd(CommonParam param);
List<Zsjfx> getZsjList(CommonParam param);
......@@ -61,7 +66,12 @@ public interface DjdcInfoMapper {
List<Jskd> getJskdList(CommonParam param);
/**
* 根据井深进行合并查询输出测斜规律
* @param param
* @return
*/
List<Jskd> getJskdList2(CommonParam param);
Jsqa jsljfzqk(CommonParam param);
Double jsgtzjds(CommonParam param);
......
......@@ -67,6 +67,12 @@ public interface DjdcService {
List<Jskd> getJskdList(CommonParam param);
/**
* 获取方位相同的井号
* @param param
* @return
*/
List<DjZqsjfx> getjskdList(CommonParam param);
String jsljfzqk(CommonParam param);
......
......@@ -2002,6 +2002,11 @@ public class DjdcServiceImpl implements DjdcService {
}
@Override
public List<DjZqsjfx> getjskdList(CommonParam param) {
return null;
}
@Override
public String jsljfzqk(CommonParam param) {
String jh = param.getJh();
// if(StringUtils.isNotEmpty(param.getJh())){
......
......@@ -42,10 +42,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="dy" column="dy" />
<result property="ffp" column="ffp" />
<result property="ffpcx" column="ffpcx" />
<result property="fxgkcs" column="fxgkcs" />
</resultMap>
<sql id="selectSgfambKcSggyVo">
select id, zbid, kc, ksjs, jsjs, ztxh, zjzy, zjzs, zjpl, zjby, zjzh, zjzhzysx, gjfx, gjyh, zjycs,
fxgkcs,
zjgccs, created_by, created_time, update_by, update_time, zttjid,zjzhtjid,sgcstjid,tjmc,fxts,zjzysx,zjzssx,zjplsx,zjbysx,cj,cc,sy,yj,zjymd,dy,ffp,ffpcx from sgfamb_kc_sggy
</sql>
......@@ -84,6 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="zjymd != null and zjymd != ''"> and zjymd = #{zjymd}</if>
<if test="dy != null and dy != ''"> and dy = #{dy}</if>
<if test="ffp != null and ffp != ''"> and ffp = #{ffp}</if>
<if test="fxgkcs != null and fxgkcs != ''"> and fxgkcs = #{fxgkcs}</if>
<if test="ffpcx != null and ffpcx != ''"> and ffpcx = #{ffpcx}</if>
</where>
</select>
......@@ -146,6 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="dy != null">dy,</if>
<if test="ffp != null">ffp,</if>
<if test="ffpcx != null">ffpcx,</if>
<if test="fxgkcs != null">fxgkcs,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="zbid != null">#{zbid},</if>
......@@ -184,6 +188,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="dy != null">#{dy},</if>
<if test="ffp != null">#{ffp},</if>
<if test="ffpcx != null">#{ffpcx},</if>
<if test="fxgkcs != null">#{fxgkcs},</if>
</trim>
</insert>
......@@ -226,6 +231,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="dy != null">dy = #{dy},</if>
<if test="ffp != null">ffp = #{ffp},</if>
<if test="ffpcx != null">ffpcx = #{ffpcx},</if>
<if test="fxgkcs != null">fxgkcs = #{fxgkcs},</if>
</trim>
where id = #{id}
</update>
......
......@@ -222,10 +222,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by kc asc,zb desc
</select>
<select id="getjskd" resultType="com.zjsgfa.project.zt.domain.DjZqsjfx">
select JSKD.JH,JSKD.fw from
(
select jh, max(xh) xh from JSKD
group by jh
) ss
left JOIN JSKD
on ss.jh=JSKD.JH and ss.xh=jskd.xh
where 1=1
<if test="jhs!=null">
and ss.jh in
<foreach item="jh" collection="jhs" open="(" separator="," close=")">
#{jh}
</foreach>
</if>
<if test="fw!=null">
and JSKD.fw BETWEEN #{fw}-30 and #{fw}+30
</if>
</select>
<select id="getZqshfxList" resultType="com.zjsgfa.project.zt.domain.DjZqsjfx">
select a.jh,c.kc,ksjs,c.js,d.zb,to_char((case when c.kc ='1' then b.KZRQ1 when c.kc ='2' then b.KZRQ2 when c.kc ='3' then b.KZRQ3 when c.kc ='4' then b.KZRQ4 when c.kc ='5' then b.KZRQ5 else null end ),'YYYY-MM-DD') || ' ' ||
TO_CHAR(TO_DATE((case when c.kc ='1' then b.KZSJ1 when c.kc ='2' then b.KZSJ2 when c.kc ='3' then b.KZSJ3 when c.kc ='4' then b.KZSJ4 when c.kc ='5' then b.KZSJ5 else null end ), 'HH24MI'), 'HH24:MI') || ':00' AS kssj
,to_char((case when c.kc ='1' then b.KZRQ2 when c.kc ='2' then (case when KZRQ3 is null or KZRQ3 ='' then WJRQ else KZRQ3 end ) when c.kc ='3' then (case when KZRQ4 is null or KZRQ4 ='' then WJRQ else KZRQ4 end ) when c.kc ='4' then (case when KZRQ5 is null or KZRQ5 ='' then WJRQ else KZRQ5 end ) when c.kc ='5' then b.WJRQ else null end ),'YYYY-MM-DD') || ' ' ||
......@@ -897,6 +913,77 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
ORDER BY a.jh, a.xh
</select>
<select id="getJskdList2" resultType="com.zjsgfa.project.zt.domain.Jskd">
select gldc,sum( case zrzjx when '自然降' then 1 ELSE 0 end ) as zrj,sum( case zrzjx when '自然增' then 1 ELSE 0 end) as zrz,
sum( case zrzjx when '人工增' then 1 ELSE 0 end) as rgz,sum( case zrzjx when '人工降' then 1 ELSE 0 end) as rgj from (
SELECT
a.*,
c.cw gldc,
LEAD(a.jx) OVER (PARTITION BY a.jh ORDER BY a.xh) AS nextjx,
LEAD(a.dc) OVER (PARTITION BY a.jh ORDER BY a.xh) AS nextdc,
CASE
WHEN LEAD(a.dc) OVER (PARTITION BY a.jh ORDER BY a.xh) IS NOT NULL
THEN (LEAD(a.jx) OVER (PARTITION BY a.jh ORDER BY a.xh) - a.jx)
/ LEAD(a.dc) OVER (PARTITION BY a.jh ORDER BY a.xh) * 30
ELSE NULL
END AS jxbhl,
CASE
WHEN LEAD(dc) OVER (PARTITION BY a.jh ORDER BY a.xh) IS NULL THEN NULL
WHEN (LEAD(jx) OVER (PARTITION BY a.jh ORDER BY a.xh) - jx)
/ LEAD(dc) OVER (PARTITION BY a.jh ORDER BY a.xh) * 30 > 0
AND (LEAD(jx) OVER (PARTITION BY a.jh ORDER BY a.xh) - jx)
/ LEAD(dc) OVER (PARTITION BY a.jh ORDER BY a.xh) * 30
&lt;
0.1
THEN '自然增'
WHEN (LEAD(jx) OVER (PARTITION BY a.jh ORDER BY a.xh) - jx)
/ LEAD(dc) OVER (PARTITION BY a.jh ORDER BY a.xh) * 30
&lt;
0
AND (LEAD(jx) OVER (PARTITION BY a.jh ORDER BY a.xh) - jx)
/ LEAD(dc) OVER (PARTITION BY a.jh ORDER BY a.xh) * 30 > -0.1
THEN '自然降'
WHEN (LEAD(jx) OVER (PARTITION BY a.jh ORDER BY a.xh) - jx)
/ LEAD(dc) OVER (PARTITION BY a.jh ORDER BY a.xh) * 30 > 1
THEN '人工增'
WHEN (LEAD(jx) OVER (PARTITION BY a.jh ORDER BY a.xh) - jx)
/ LEAD(dc) OVER (PARTITION BY a.jh ORDER BY a.xh) * 30
&lt;
-1
THEN '人工降'
ELSE null
END AS zrzjx,d.gynr glzxd
FROM jskd a
left join (
SELECT
jh,
LAG(SJDJSD2, 1, 0) OVER (PARTITION BY jh ORDER BY SJDJSD2) AS ksjs,
SJDJSD2,CW
FROM jsbb) c on a.JH=c.JH and NVL(a.LJCZJS,0)>=c.ksjs and NVL(a.LJCZJS,0) &lt; c.SJDJSD2
left join jskc d on a.JH=d.jh and a.xh=d.xh
where 1=1
<if test="jhs!=null">
and a.jh in
<foreach item="jh" collection="jhs"
open="(" separator="," close=")">
#{jh}
</foreach>
</if>
<if test="ksjs!=null">
and xjs between #{ksjs} and #{jsjs}
</if>
ORDER BY a.jh, a.xh) sss
group by gldc
</select>
<select id="jsljfzqk" resultType="com.zjsgfa.project.zt.domain.Jsqa">
select a.jh,a.FZQK,a.js, cw,c.SJHD,ROUND(a.js/max(j.XJS)*100,1) bfb
from JSQA a
......
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