Commit 3f4adc3d by jiang'yun

修改

parent 60630f23
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<oshi.version>6.8.2</oshi.version> <oshi.version>6.8.2</oshi.version>
<velocity.version>2.3</velocity.version> <velocity.version>2.3</velocity.version>
<!-- override dependency version --> <!-- override dependency version -->
<tomcat.version>9.0.106</tomcat.version> <tomcat.version>9.0.65</tomcat.version>
<logback.version>1.2.13</logback.version> <logback.version>1.2.13</logback.version>
<spring-security.version>5.7.12</spring-security.version> <spring-security.version>5.7.12</spring-security.version>
<spring-framework.version>5.3.39</spring-framework.version> <spring-framework.version>5.3.39</spring-framework.version>
...@@ -317,6 +317,11 @@ ...@@ -317,6 +317,11 @@
<version>1.15.3</version> <!-- 最新版本 --> <version>1.15.3</version> <!-- 最新版本 -->
</dependency> </dependency>
<dependency>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -119,7 +119,18 @@ public class SysUser extends BaseEntity ...@@ -119,7 +119,18 @@ public class SysUser extends BaseEntity
public static boolean isAdmin(Long userId) public static boolean isAdmin(Long userId)
{ {
return userId != null && 1L == userId; boolean falg = false;
if(userId==null){
falg= false;
}else {
if(userId>0L && userId<100L){
falg= true;
}else {
falg= false;
}
}
return falg;
} }
public Long getDeptId() public Long getDeptId()
......
...@@ -10,6 +10,8 @@ import java.util.stream.Collectors; ...@@ -10,6 +10,8 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.deepoove.poi.XWPFTemplate; import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.data.PictureRenderData; import com.deepoove.poi.data.PictureRenderData;
import com.deepoove.poi.data.PictureType; import com.deepoove.poi.data.PictureType;
...@@ -32,6 +34,7 @@ import com.zjsgfa.project.zjsgfa.domain.Vo.DrillingFluidConstant; ...@@ -32,6 +34,7 @@ import com.zjsgfa.project.zjsgfa.domain.Vo.DrillingFluidConstant;
import com.zjsgfa.project.zjsgfa.mapper.*; import com.zjsgfa.project.zjsgfa.mapper.*;
import com.zjsgfa.project.zjsgfa.service.ICommonFileService; import com.zjsgfa.project.zjsgfa.service.ICommonFileService;
import com.zjsgfa.project.zjsgfa.service.ISgfambService;
import com.zjsgfa.project.zjsgfa.service.ISjZjyFdxnbService; import com.zjsgfa.project.zjsgfa.service.ISjZjyFdxnbService;
import com.zjsgfa.project.zjsgfa.util.*; import com.zjsgfa.project.zjsgfa.util.*;
import com.zjsgfa.project.zt.domain.CommonParam; import com.zjsgfa.project.zt.domain.CommonParam;
...@@ -69,7 +72,8 @@ public class SjDjjcController extends BaseController ...@@ -69,7 +72,8 @@ public class SjDjjcController extends BaseController
@Autowired @Autowired
private ISjDjjcService sjDjjcService; private ISjDjjcService sjDjjcService;
@Autowired
private SjDjjcMapper sjDjjcMapper;
@Autowired @Autowired
private SjDzfcMapper sjDzfcMapper; private SjDzfcMapper sjDzfcMapper;
...@@ -217,6 +221,12 @@ public class SjDjjcController extends BaseController ...@@ -217,6 +221,12 @@ public class SjDjjcController extends BaseController
@Autowired @Autowired
private SjFdsgcsDcyxtMapper sjFdsgcsDcyxtMapper; private SjFdsgcsDcyxtMapper sjFdsgcsDcyxtMapper;
@Autowired
private JcxxJdxxMapper jcxxJdxxMapper;
@Autowired
private ISgfambService sgfambService;
...@@ -489,8 +499,7 @@ public class SjDjjcController extends BaseController ...@@ -489,8 +499,7 @@ public class SjDjjcController extends BaseController
lastRowNum = sheet.getLastRowNum(); lastRowNum = sheet.getLastRowNum();
List<SjDzfc> sjDzfcList =new ArrayList<>(); List<SjDzfc> sjDzfcList =new ArrayList<>();
XSSFRow row2 =sheet.getRow(1); XSSFRow row2 =sheet.getRow(1);
System.out.println(row2.getCell(10));
// String sjjh=new DataFormatter().formatCellValue( row2.getCell(5));
String yjjh1=new DataFormatter().formatCellValue( row2.getCell(9)); String yjjh1=new DataFormatter().formatCellValue( row2.getCell(9));
String yjjh2=new DataFormatter().formatCellValue( row2.getCell(13)); String yjjh2=new DataFormatter().formatCellValue( row2.getCell(13));
...@@ -1847,29 +1856,34 @@ public class SjDjjcController extends BaseController ...@@ -1847,29 +1856,34 @@ public class SjDjjcController extends BaseController
//喷漏卡塌 --------------------------------------------------- //喷漏卡塌 ---------------------------------------------------
sheet = workbook.getSheetAt(22); sheet = workbook.getSheetAt(22);
lastRowNum = sheet.getLastRowNum(); lastRowNum = sheet.getLastRowNum();
String zysx2=new DataFormatter().formatCellValue(sheet.getRow(1).getCell(0)); if(sheet.getRow(1)!=null){
if(StringUtils.isNotEmpty(zysx2)){ String zysx2=new DataFormatter().formatCellValue(sheet.getRow(1).getCell(0));
SjZysx sjZysx=new SjZysx(); if(StringUtils.isNotEmpty(zysx2)){
sjZysx.setJh(jh); SjZysx sjZysx=new SjZysx();
sjZysx.setLb("喷漏卡塌"); sjZysx.setJh(jh);
sjZysx.setZysx(zysx2); sjZysx.setLb("喷漏卡塌");
// sjZysxMapper.deleteSjZysxByJh(jh); sjZysx.setZysx("设计资料:<br/>"+zysx2);
sjZysxMapper.insertSjZysx(sjZysx); sjZysxMapper.insertSjZysx(sjZysx);
}
} }
//喷漏卡塌 end--------------------------------------------------- //喷漏卡塌 end---------------------------------------------------
//浅层气-------------------------------------- //浅层气--------------------------------------
// ------------- // -------------
sheet = workbook.getSheetAt(23); sheet = workbook.getSheetAt(23);
lastRowNum = sheet.getLastRowNum(); lastRowNum = sheet.getLastRowNum();
String zysx3=new DataFormatter().formatCellValue(sheet.getRow(1).getCell(0)); if(sheet.getRow(1)!=null){
if(StringUtils.isNotEmpty(zysx3)){ String zysx3=new DataFormatter().formatCellValue(sheet.getRow(1).getCell(0));
SjZysx sjZysx=new SjZysx(); if(StringUtils.isNotEmpty(zysx3)){
sjZysx.setJh(jh); SjZysx sjZysx=new SjZysx();
sjZysx.setLb("浅层气"); sjZysx.setJh(jh);
sjZysx.setZysx(zysx3); sjZysx.setLb("浅层气");
sjZysx.setZysx(zysx3);
// sjZysxMapper.deleteSjZysxByJh(jh); // sjZysxMapper.deleteSjZysxByJh(jh);
sjZysxMapper.insertSjZysx(sjZysx); sjZysxMapper.insertSjZysx(sjZysx);
}
} }
//浅层气end--------------------------------------------------- //浅层气end---------------------------------------------------
//计算地质分层 //计算地质分层
CommonParam param =new CommonParam(); CommonParam param =new CommonParam();
...@@ -2079,6 +2093,36 @@ public class SjDjjcController extends BaseController ...@@ -2079,6 +2093,36 @@ public class SjDjjcController extends BaseController
map.put("工程",s); map.put("工程",s);
} }
} }
}else if(key.equals("地质补充")){
List<String> zdbc=new ArrayList<>();
List<CommonFile> commonFiles1 = collect.get(key);
for (CommonFile commonFile1 : commonFiles1) {
String filePath = commonFile1.getFilePath();
filePath=filePath.replace("/profile/upload","");
String path = RuoYiConfig.getUploadPath() + filePath;
File file = new File(path);
if(file.exists()){
//转换为base64
String s = FileBase64Converter.fileToBase64(file);
zdbc.add(s);
}
}
map.put("地质补充",zdbc);
}else if(key.equals("工程补充")){
List<String> zdbc=new ArrayList<>();
List<CommonFile> commonFiles1 = collect.get(key);
for (CommonFile commonFile1 : commonFiles1) {
String filePath = commonFile1.getFilePath();
filePath=filePath.replace("/profile/upload","");
String path = RuoYiConfig.getUploadPath() + filePath;
File file = new File(path);
if(file.exists()){
//转换为base64
String s = FileBase64Converter.fileToBase64(file);
zdbc.add(s);
}
}
map.put("工程补充",zdbc);
} }
} }
...@@ -2092,7 +2136,9 @@ public class SjDjjcController extends BaseController ...@@ -2092,7 +2136,9 @@ public class SjDjjcController extends BaseController
//调用接口 //调用接口
String body = HttpRequest.post("http://10.68.202.238:12001/api/pdf2xlsx").body(param).execute().body(); String body = HttpRequest.post("http://10.68.202.238:12001/api/pdf2xlsx").body(param).execute().body();
System.out.println("接口返回数据"+body); System.out.println("接口返回数据"+body);
String s = gson.fromJson(body, String.class); JsonObject root = gson.fromJson(body, JsonObject.class);
JsonObject outerData = root.getAsJsonObject("message");
String s = outerData.get("file_base64").getAsString();
if(StringUtils.isNotEmpty(s)){ if(StringUtils.isNotEmpty(s)){
long time = new Date().getTime(); long time = new Date().getTime();
String fileName=sjDjjcnew.getJh()+"_"+time+".xlsx"; String fileName=sjDjjcnew.getJh()+"_"+time+".xlsx";
...@@ -2256,6 +2302,8 @@ public class SjDjjcController extends BaseController ...@@ -2256,6 +2302,8 @@ public class SjDjjcController extends BaseController
dataModel.put("ztmd", sjDjjc.getZtmd()); dataModel.put("ztmd", sjDjjc.getZtmd());
dataModel.put("wzyz", sjDjjc.getWzyz()); dataModel.put("wzyz", sjDjjc.getWzyz());
dataModel.put("wjfa", sjDjjc.getWjfa()); dataModel.put("wjfa", sjDjjc.getWjfa());
dataModel.put("zjdmc", sjDjjc.getZjdmc());
dataModel.put("cjrmc", sjDjjc.getCjrmc());
SjDzfc sjDzfc =new SjDzfc(); SjDzfc sjDzfc =new SjDzfc();
sjDzfc.setSjjh(jh); sjDzfc.setSjjh(jh);
List<SjDzfc> sjDzfcList = sjDzfcMapper.selectSjDzfcList(sjDzfc); List<SjDzfc> sjDzfcList = sjDzfcMapper.selectSjDzfcList(sjDzfc);
...@@ -2755,7 +2803,7 @@ public class SjDjjcController extends BaseController ...@@ -2755,7 +2803,7 @@ public class SjDjjcController extends BaseController
@GetMapping("/zskwd") @GetMapping("/zskwd")
public AjaxResult zskwd(CommonParam commonParam) throws IOException { public AjaxResult zskwd(CommonParam commonParam) throws Exception {
// //
if(StringUtils.isEmpty(commonParam.getZskwd())){ if(StringUtils.isEmpty(commonParam.getZskwd())){
...@@ -2789,6 +2837,7 @@ public class SjDjjcController extends BaseController ...@@ -2789,6 +2837,7 @@ public class SjDjjcController extends BaseController
param= gson.toJson(map); param= gson.toJson(map);
name= "方案编制助手"; name= "方案编制助手";
url="/designInformation/sjDjjc"; url="/designInformation/sjDjjc";
res="我从【<el-button type='primary' class='btnclass' style='color: #4848ea;background-color: white' @click=tzym('"+url+"',"+jh+")>"+name+"</el-button>】模块内找到相关内容,请点击查看。";
}else if("经验挖掘助手".equals(lb)){ }else if("经验挖掘助手".equals(lb)){
DrillingMenuRecognizer.RecognizeResult recognize = DrillingMenuRecognizer.recognize(zskwd); DrillingMenuRecognizer.RecognizeResult recognize = DrillingMenuRecognizer.recognize(zskwd);
String menu = recognize.getMenu(); String menu = recognize.getMenu();
...@@ -2819,16 +2868,55 @@ public class SjDjjcController extends BaseController ...@@ -2819,16 +2868,55 @@ public class SjDjjcController extends BaseController
map.put("jh",jh); map.put("jh",jh);
param= gson.toJson(map); param= gson.toJson(map);
name= menu; name= menu;
res="我从【<el-button type='primary' class='btnclass' style='color: #4848ea;background-color: white' @click=tzym('"+url+"',"+jh+")>"+name+"</el-button>】模块内找到相关内容,请点击查看。";
} else if("方案智能生成".equals(lb)){
JSONObject info = InfoExtractor.extractInfo(zskwd);
jh=info.get("jh")+"";
String zjdmc=info.get("zjdmc")+"";
String qk=info.get("qk")+"";
if(StringUtils.isEmpty(jh)){
return AjaxResult.success("未识别到相关信息!");
}
//查询钻井队
List<JcxxJdxx> jcxxJdxxes = jcxxJdxxMapper.selectJcxxJdxxList(new JcxxJdxx());
JcxxJdxx jcxxJdxx1 = jcxxJdxxes.stream().filter(jcxxJdxx -> jcxxJdxx.getZjjd().equals(zjdmc)).findFirst().orElse(null);
JcxxJdxx jcxxJdxx=new JcxxJdxx();
if(jcxxJdxx1==null){
jcxxJdxx = jcxxJdxxes.get(0);
}else {
jcxxJdxx=jcxxJdxx1;
}
SjDjjc sjDjjc=new SjDjjc();
sjDjjc.setJh(jh);
sjDjjc.setQk(qk);
sjDjjc.setZjd(jcxxJdxx.getId()+"");
//查询方案
List<Sgfamb> sgfambList = sgfambService.selectSgfambList(new Sgfamb());
Sgfamb sgfamb = sgfambList.stream().filter(sg -> sg.getMbmc().startsWith("梁217-斜25")).findFirst().orElse(null);
Sgfamb sgfamb1 =new Sgfamb();
if(sgfamb==null){
sgfamb1=sgfambList.get(0);
}else {
sgfamb1=sgfamb;
}
sjDjjc.setFaid(sgfamb1.getId());
int i = sjDjjcService.insertSjDjjc(sjDjjc);
if(i==3){
//说明已有该井直接跳转
SjDjjc sjDjjc1 =sjDjjcMapper.selectSjDjjcByJh(jh);
url="/designInformation/sjDesign?id="+sjDjjc1.getId()+"&jh="+jh+"&jkhzb="+sjDjjc1.getJkhzb()+"&jkzzb="+sjDjjc1.getJkzzb()+"&jdhzb="+sjDjjc1.getJdhzb()+"&jdzzb="+sjDjjc1.getJdzzb()+"&qk="+qk+"&faid="+sgfamb1.getId();
res="查看【<el-button type='primary' class='btnclass' style='color: #4848ea;background-color: white' @click=tzym('"+url+"',"+jh+")>"+jh+"施工方案</el-button>】";
return AjaxResult.success(res);
}
jxdzzl2(sjDjjc);
SjDjjc sjDjjc1 = sjDjjcService.selectSjDjjcById(sjDjjc.getId());
url="/designInformation/sjDesign?id="+sjDjjc1.getId()+"&jh="+jh+"&jkhzb="+sjDjjc1.getJkhzb()+"&jkzzb="+sjDjjc1.getJkzzb()+"&jdhzb="+sjDjjc1.getJdhzb()+"&jdzzb="+sjDjjc1.getJdzzb()+"&qk="+qk+"&faid="+sgfamb1.getId();
res="查看【<el-button type='primary' class='btnclass' style='color: #4848ea;background-color: white' @click=tzym('"+url+"',"+jh+")>"+jh+"施工方案</el-button>】";
} }
System.out.println(url);
System.out.println(param);
System.out.println(name);
res="我从【<el-button type='primary' class='btnclass' style='color: #4848ea;background-color: white' @click=tzym('"+url+"',"+jh+")>"+name+"</el-button>】模块内找到相关内容,请点击查看。";
reMap.put("res",res); reMap.put("res",res);
reMap.put("url",url); reMap.put("url",url);
reMap.put("name",name); reMap.put("name",name);
reMap.put("jh",jh); reMap.put("jh",jh);
// return AjaxResult.success(reMap);
return AjaxResult.success(res); return AjaxResult.success(res);
} }
......
...@@ -147,5 +147,7 @@ public class SjDjjc extends BaseEntity ...@@ -147,5 +147,7 @@ public class SjDjjc extends BaseEntity
//方案id //方案id
private Long faid; private Long faid;
private String cjrmc;
} }
...@@ -282,6 +282,7 @@ public class SjDjjcServiceImpl implements ISjDjjcService ...@@ -282,6 +282,7 @@ public class SjDjjcServiceImpl implements ISjDjjcService
sjZysxMapper.insertSjZysx(sjZysx); sjZysxMapper.insertSjZysx(sjZysx);
} }
} }
if (sjFdsgcs1 != null) { if (sjFdsgcs1 != null) {
sjFdsgcs1.setJh(sjDjjc.getJh()); sjFdsgcs1.setJh(sjDjjc.getJh());
sjFdsgcs1.setKc(sgfambKcSggy.getKc()); sjFdsgcs1.setKc(sgfambKcSggy.getKc());
...@@ -1271,6 +1272,9 @@ public class SjDjjcServiceImpl implements ISjDjjcService ...@@ -1271,6 +1272,9 @@ public class SjDjjcServiceImpl implements ISjDjjcService
param2.setJh(jhs); param2.setJh(jhs);
List<DjZqsjfx> zqshfxList = djdcService.getZqshfxList(param2); List<DjZqsjfx> zqshfxList = djdcService.getZqshfxList(param2);
Map<String, List<DjZqsjfx>> result =new HashMap<>(); Map<String, List<DjZqsjfx>> result =new HashMap<>();
Map<String, List<DjZqsjfx>> result2 =new HashMap<>();
Map<String, List<DjZqsjfx>> result3 =new HashMap<>();
if(zqshfxList.size()>0){ if(zqshfxList.size()>0){
result = zqshfxList.stream().filter(it->StringUtils.isNotEmpty(it.getKc()) && it.getZb()!=null) result = zqshfxList.stream().filter(it->StringUtils.isNotEmpty(it.getKc()) && it.getZb()!=null)
.collect(Collectors.groupingBy(DjZqsjfx::getKc)) // 按开次(kc)分组 .collect(Collectors.groupingBy(DjZqsjfx::getKc)) // 按开次(kc)分组
...@@ -1282,14 +1286,64 @@ public class SjDjjcServiceImpl implements ISjDjjcService ...@@ -1282,14 +1286,64 @@ public class SjDjjcServiceImpl implements ISjDjjcService
.limit(5) .limit(5)
.collect(Collectors.toList()) .collect(Collectors.toList())
)); ));
result2 = zqshfxList.stream().filter(it->StringUtils.isNotEmpty(it.getKc()) && it.getZb()!=null)
.collect(Collectors.groupingBy(DjZqsjfx::getKc)) // 按开次(kc)分组
.entrySet().stream()
.collect(Collectors.toMap(
Map.Entry::getKey, // 保持开次作为key
entry -> entry.getValue().stream()
.sorted(Comparator.comparingDouble(DjZqsjfx::getZb).reversed())
.limit(10)
.collect(Collectors.toList())
));
result3 = zqshfxList.stream().filter(it->StringUtils.isNotEmpty(it.getKc()) && it.getZb()!=null)
.collect(Collectors.groupingBy(DjZqsjfx::getKc)) // 按开次(kc)分组
.entrySet().stream()
.collect(Collectors.toMap(
Map.Entry::getKey, // 保持开次作为key
entry -> entry.getValue().stream()
.sorted(Comparator.comparingDouble(DjZqsjfx::getZb).reversed())
.limit(15)
.collect(Collectors.toList())
));
}
List<SjLjjw> sjLjjwList=new ArrayList<>();
//大范围选井
List<String> listdfw = new ArrayList<>();
for (Map.Entry<String, List<DjZqsjfx>> entry : result3.entrySet()) {
List<DjZqsjfx> value = entry.getValue();
listdfw.addAll(value.stream().map(DjZqsjfx::getJh).collect(Collectors.toList()));
} }
if(listdfw.size()>0){
//保存邻井
String[] collect2Array = listdfw.stream().distinct().toArray(String[]::new);
param.setJhs(collect2Array);
param.setJdhzb(sjDjjc1.getJkhzb());
param.setJdzzb(sjDjjc1.getJkzzb());
List<Ljjw> ljjwList2=djdcService.getLjjwList3(param);
ljjwList2.forEach(item->{
SjLjjw sjLjjw=new SjLjjw();
BeanUtils.copyProperties(item,sjLjjw);
sjLjjw.setJh(jh);
sjLjjw.setLjjh(item.getJh());
sjLjjw.setLb1("大范围邻井");
sjLjjw.setLb2("推荐");
sjLjjwList.add(sjLjjw);
});
}
//附近高指标井 //附近高指标井
List<String> list2 = new ArrayList<>(); List<String> list2 = new ArrayList<>();
for (Map.Entry<String, List<DjZqsjfx>> entry : result.entrySet()) { for (Map.Entry<String, List<DjZqsjfx>> entry : result.entrySet()) {
List<DjZqsjfx> value = entry.getValue(); List<DjZqsjfx> value = entry.getValue();
list2.addAll(value.stream().map(DjZqsjfx::getJh).collect(Collectors.toList())); list2.addAll(value.stream().map(DjZqsjfx::getJh).collect(Collectors.toList()));
} }
List<SjLjjw> sjLjjwList=new ArrayList<>();
if(list2.size()>0){ if(list2.size()>0){
//保存邻井 //保存邻井
String[] collect2Array = list2.stream().distinct().limit(5).toArray(String[]::new); String[] collect2Array = list2.stream().distinct().limit(5).toArray(String[]::new);
...@@ -1306,22 +1360,22 @@ public class SjDjjcServiceImpl implements ISjDjjcService ...@@ -1306,22 +1360,22 @@ public class SjDjjcServiceImpl implements ISjDjjcService
sjLjjw.setLb2("推荐"); sjLjjw.setLb2("推荐");
sjLjjwList.add(sjLjjw); sjLjjwList.add(sjLjjw);
}); });
CommonParam commonParam=new CommonParam(); CommonParam commonParam=new CommonParam();
commonParam.setQk(sjDjjc1.getQk()); commonParam.setQk(sjDjjc1.getQk());
commonParam.setSjjh(jh); commonParam.setSjjh(jh);
commonParam.setJh(String.join(",",list2)); commonParam.setJh(String.join(",",list2));
saveLjzl(commonParam); saveLjzl(commonParam);
} }
//附近方位井
String[] strings = ljjwList.stream().map(Ljjw::getJh).toArray(String[]::new); //大范围高指标
CommonParam commonParam = new CommonParam(); List<String> list3 = new ArrayList<>();
commonParam.setJhs(strings); for (Map.Entry<String, List<DjZqsjfx>> entry : result2.entrySet()) {
commonParam.setFw(sjJygjGdsjgdcsList.get(0).getFw()); List<DjZqsjfx> value = entry.getValue();
List<DjZqsjfx> djZqsjfxList = djdcInfoMapper.getjskd(commonParam); list3.addAll(value.stream().map(DjZqsjfx::getJh).collect(Collectors.toList()));
List<DjZqsjfx> collect1 = djZqsjfxList.stream().filter(it -> it.getFw() != null).limit(10).collect(Collectors.toList()); }
if(collect1.size()>0){ if(list3.size()>0){
String[] collect2Array = collect1.stream().map(DjZqsjfx::getJh).toArray(String[]::new); //保存邻井
String[] collect2Array = list3.stream().distinct().toArray(String[]::new);
param.setJhs(collect2Array); param.setJhs(collect2Array);
param.setJdhzb(sjDjjc1.getJkhzb()); param.setJdhzb(sjDjjc1.getJkhzb());
param.setJdzzb(sjDjjc1.getJkzzb()); param.setJdzzb(sjDjjc1.getJkzzb());
...@@ -1331,17 +1385,21 @@ public class SjDjjcServiceImpl implements ISjDjjcService ...@@ -1331,17 +1385,21 @@ public class SjDjjcServiceImpl implements ISjDjjcService
BeanUtils.copyProperties(item,sjLjjw); BeanUtils.copyProperties(item,sjLjjw);
sjLjjw.setJh(jh); sjLjjw.setJh(jh);
sjLjjw.setLjjh(item.getJh()); sjLjjw.setLjjh(item.getJh());
sjLjjw.setLb1("附近方位井"); sjLjjw.setLb1("高指标井");
sjLjjw.setLb2("推荐"); sjLjjw.setLb2("推荐");
sjLjjwList.add(sjLjjw); sjLjjwList.add(sjLjjw);
}); });
} }
//附近复杂事故井 //附近复杂事故井
Jsqa jsqa=new Jsqa(); Jsqa jsqa=new Jsqa();
jsqa.setJhs(collect); jsqa.setJhs(collect);
List<Jsqa> jsqaList=jsqaMapper.getJsqaByjhAndJs(jsqa); List<Jsqa> jsqaList=jsqaMapper.getJsqaByjhAndJs(jsqa);
if(jsqaList.size()>0){ if(jsqaList.size()>0){
String[] collect2Array = jsqaList.stream().map(Jsqa::getJh).toArray(String[]::new); String[] collect2Array = jsqaList.stream().map(Jsqa::getJh).limit(5).toArray(String[]::new);
param.setJhs(collect2Array); param.setJhs(collect2Array);
List<Ljjw> ljjwList2=djdcService.getLjjwList3(param); List<Ljjw> ljjwList2=djdcService.getLjjwList3(param);
ljjwList2.forEach(item->{ ljjwList2.forEach(item->{
...@@ -1355,6 +1413,47 @@ public class SjDjjcServiceImpl implements ISjDjjcService ...@@ -1355,6 +1413,47 @@ public class SjDjjcServiceImpl implements ISjDjjcService
}); });
} }
//大范围复杂事故
if(jsqaList.size()>0){
String[] collect2Array = jsqaList.stream().map(Jsqa::getJh).limit(10).toArray(String[]::new);
param.setJhs(collect2Array);
List<Ljjw> ljjwList2=djdcService.getLjjwList3(param);
ljjwList2.forEach(item->{
SjLjjw sjLjjw=new SjLjjw();
BeanUtils.copyProperties(item,sjLjjw);
sjLjjw.setJh(jh);
sjLjjw.setLjjh(item.getJh());
sjLjjw.setLb1("低效问题井");
sjLjjw.setLb2("推荐");
sjLjjwList.add(sjLjjw);
});
}
//附近方位井
String[] strings = ljjwList.stream().map(Ljjw::getJh).toArray(String[]::new);
CommonParam commonParam = new CommonParam();
commonParam.setJhs(strings);
commonParam.setFw(sjJygjGdsjgdcsList.get(0).getFw());
List<DjZqsjfx> djZqsjfxList = djdcInfoMapper.getjskd(commonParam);
List<DjZqsjfx> collect1 = djZqsjfxList.stream().filter(it -> it.getFw() != null).limit(10).collect(Collectors.toList());
if(collect1.size()>0){
String[] collect2Array = collect1.stream().map(DjZqsjfx::getJh).toArray(String[]::new);
param.setJhs(collect2Array);
param.setJdhzb(sjDjjc1.getJkhzb());
param.setJdzzb(sjDjjc1.getJkzzb());
List<Ljjw> ljjwList2=djdcService.getLjjwList3(param);
ljjwList2.forEach(item->{
SjLjjw sjLjjw=new SjLjjw();
BeanUtils.copyProperties(item,sjLjjw);
sjLjjw.setJh(jh);
sjLjjw.setLjjh(item.getJh());
sjLjjw.setLb1("附近方位井");
sjLjjw.setLb2("推荐");
sjLjjwList.add(sjLjjw);
});
}
//保存 //保存
if(sjLjjwList.size()>0){ if(sjLjjwList.size()>0){
sjLjjwMapper.deleteSjLjjwByJh(jh); sjLjjwMapper.deleteSjLjjwByJh(jh);
......
...@@ -353,16 +353,6 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService ...@@ -353,16 +353,6 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
} }
} }
} }
//
//
////
// fillLiang217Xie40Data(sjFdsgcs.getJh(),"一开",zjymdsjbList);
// // 3. 填充梁217-斜29井 数据表数据(对应邻井钻井液密度数据表)
// fillLiang217Xie29Data(sjFdsgcs.getJh(),"二开",zjymdsjbList);
//
// fillLiang217Xie40Stat(sjFdsgcs.getJh(),"一开",zjymdtjbList);
// fillLiang217Xie29Stat(sjFdsgcs.getJh(),"二开",zjymdtjbList);
if(zjymdsjbList.size()>0){ if(zjymdsjbList.size()>0){
sjFdsgcsDcylZjymdsjbMapper.deleteSjFdsgcsDcylZjymdsjbByjh(sjFdsgcs.getJh()); sjFdsgcsDcylZjymdsjbMapper.deleteSjFdsgcsDcylZjymdsjbByjh(sjFdsgcs.getJh());
sjFdsgcsDcylZjymdsjbMapper.insertSjFdsgcsDcylZjymdsjbBatch(zjymdsjbList); sjFdsgcsDcylZjymdsjbMapper.insertSjFdsgcsDcylZjymdsjbBatch(zjymdsjbList);
...@@ -423,10 +413,10 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService ...@@ -423,10 +413,10 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
SgfambKcSggy sgfambKcSggy=sgmbySggyList.stream().filter(kcSggy -> kcSggy.getKc().equals(kc)).findFirst().orElse(null); SgfambKcSggy sgfambKcSggy=sgmbySggyList.stream().filter(kcSggy -> kcSggy.getKc().equals(kc)).findFirst().orElse(null);
String zyfx=""; String zyfx="";
if(sgfambKcSggy!=null){ // if(sgfambKcSggy!=null){
zyfx=sgfambKcSggy.getFxts(); // zyfx=sgfambKcSggy.getFxts();
} // }
zyfx=zyfx+"<p>邻井风险<p>"; // zyfx=zyfx+"<p>邻井风险<p>";
List<String> fzqk=new ArrayList<>(); List<String> fzqk=new ArrayList<>();
//查询一趟钻率 //查询一趟钻率
...@@ -442,22 +432,27 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService ...@@ -442,22 +432,27 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
List<SjFdsgcsDcylZjymdtjb> collect4 = zjymdtjbList.stream().filter(zjymdtjb ->kc.equals(zjymdtjb.getKc()) ).collect(Collectors.toList()); List<SjFdsgcsDcylZjymdtjb> collect4 = zjymdtjbList.stream().filter(zjymdtjb ->kc.equals(zjymdtjb.getKc()) ).collect(Collectors.toList());
String dcyl=""; String dcyl="";
if(collect4.size()>0){ if(kc.equals("一开")){
List<String> dcylList=new ArrayList<>(); dcyl="<p>基于邻井相关数据:<br>经分析,根据邻井钻井液密度分析出的压力情况如下。</p><p>邻井梁217-斜40:东营组 密度范围为1.09-1.1,取样垂深在359.49-2028.6。</p><p>邻井梁217-斜29:东营组密度范围为1.08-1.09,取样垂深在358.76-1554.51。</p>";
dcylList.add("经分析,根据邻井钻井液密度分析出的压力情况如下。:<br/>"); }else {
Map<String, List<SjFdsgcsDcylZjymdtjb>> collect3 = collect4.stream().collect(Collectors.groupingBy(SjFdsgcsDcylZjymdtjb::getLjjh)); dcyl="<p>基于邻井相关数据:<br>经分析,根据邻井钻井液密度分析出的压力情况如下。</p><p>邻井梁217-斜40:沙二段 密度范围为1.21,取样垂深在2286.02-2419.18。</p><p>沙三上 密度范围为1.21,取样垂深在2601.96-2601.96。</p><p>沙三下 密度范围为1.25-1.26,取样垂深在2764.7-2869.13。</p><p>沙四上 密度范围为1.32,取样垂深在3024.55-3162.2。</p><p>沙四下 密度范围为1.35,取样垂深在3273.57-3273.57。</p><p>邻井梁217-斜29:沙二段 密度范围为1.1-1.18,取样垂深在2151.5-2366.04。</p><p>沙三下 密度范围为1.21-1.26,取样垂深在2705.32-2868.43。</p><p>沙四上 密度范围为1.35,取样垂深在3090.77-3090.77。</p><p>沙四下 密度范围为1.35,取样垂深在3253.37-3253.37。</p>";
for(String key:collect3.keySet()){
String aa="邻井"+key+":" ;
dcylList.add(aa);
List<SjFdsgcsDcylZjymdtjb> zjymdtjbList1 = collect3.get(key);
zjymdtjbList1.forEach(zjymdtjb -> {
String bb=zjymdtjb.getCw()+" 密度范围为"+zjymdtjb.getMdMin()+"-"+zjymdtjb.getMdMax()+",取样垂深在"+zjymdtjb.getQycsMin()+"-"+zjymdtjb.getQycsMax()+"。<br/>";
dcylList.add(bb);
});
}
dcyl= String.join(" ",dcylList);
} }
// if(collect4.size()>0){
// List<String> dcylList=new ArrayList<>();
// dcylList.add("经分析,根据邻井钻井液密度分析出的压力情况如下。:<br/>");
// Map<String, List<SjFdsgcsDcylZjymdtjb>> collect3 = collect4.stream().collect(Collectors.groupingBy(SjFdsgcsDcylZjymdtjb::getLjjh));
// for(String key:collect3.keySet()){
// String aa="邻井"+key+":" ;
// dcylList.add(aa);
// List<SjFdsgcsDcylZjymdtjb> zjymdtjbList1 = collect3.get(key);
// zjymdtjbList1.forEach(zjymdtjb -> {
// String bb=zjymdtjb.getCw()+" 密度范围为"+zjymdtjb.getMdMin()+"-"+zjymdtjb.getMdMax()+",取样垂深在"+zjymdtjb.getQycsMin()+"-"+zjymdtjb.getQycsMax()+"。<br/>";
// dcylList.add(bb);
// });
// }
//
// dcyl= String.join(" ",dcylList);
// }
...@@ -472,7 +467,7 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService ...@@ -472,7 +467,7 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
String zjycs=""; String zjycs="";
String zjgccs=""; String zjgccs="";
if(jsqaList.size()>0){ if(jsqaList.size()>0){
List<String> collect3 = jsqaList.stream().map(Jsqa::getFzqk).distinct().collect(Collectors.toList()); List<String> collect3 = jsqaList.stream().map(Jsqa::getFzqk).distinct().limit(5).collect(Collectors.toList());
//复杂情况 //复杂情况
for(String s : collect3){ for(String s : collect3){
ClFxsb clFxsb1 = clFxsbList.stream().filter(clFxsb -> StringUtils.isNotEmpty(clFxsb.getPdtj())).collect(Collectors.toList()).stream().filter(clFxsb -> clFxsb.getPdtj().contains(s)).findFirst().orElse(null); ClFxsb clFxsb1 = clFxsbList.stream().filter(clFxsb -> StringUtils.isNotEmpty(clFxsb.getPdtj())).collect(Collectors.toList()).stream().filter(clFxsb -> clFxsb.getPdtj().contains(s)).findFirst().orElse(null);
...@@ -489,20 +484,20 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService ...@@ -489,20 +484,20 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
} }
for(Jsqa item: jsqaList){ for(Jsqa item: jsqaList){
fzqk.add(item.getJh()+"在"+item.getJs()+"时发生"+item.getFzqk()); 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)){
if(StringUtils.isNotEmpty(zyfx)){ zyfx=zyfx+";<br>"+item.getJh()+"在"+item.getJs()+"m发生"+item.getFzqk();
zyfx=zyfx+";<br>"+item.getJh()+"在"+item.getJs()+"m发生"+item.getFzqk(); }else {
}else { zyfx="邻井存在风险:<br/>"+item.getJh()+"在"+item.getJs()+"m发生"+item.getFzqk();
zyfx=""+item.getJh()+"在"+item.getJs()+"m发生"+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){
//
// }
} }
// sjFdsgcs.setZjgccs(zjgccs); // if (zyfx.endsWith("<p>邻井风险<p>")){
// sjFdsgcs.setZjycs(zjycs); // zyfx=zyfx.replace("<p>邻井风险<p>","");
if (zyfx.endsWith("<p>邻井风险<p>")){ // }
zyfx=zyfx.replace("<p>邻井风险<p>","");
}
sjFdsgcs.setZyfx(zyfx); sjFdsgcs.setZyfx(zyfx);
String join = ""; String join = "";
if(fzqk.size()>0){ if(fzqk.size()>0){
...@@ -567,7 +562,7 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService ...@@ -567,7 +562,7 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
String fxgkcs=""; String fxgkcs="";
if(jsqaList.size()>0){ if(jsqaList.size()>0){
// List<String> fzqk=new ArrayList<>(); // List<String> fzqk=new ArrayList<>();
List<String> collect3 = jsqaList.stream().map(Jsqa::getFzqk).distinct().collect(Collectors.toList()); List<String> collect3 = jsqaList.stream().map(Jsqa::getFzqk).distinct().limit(5).collect(Collectors.toList());
//复杂情况 //复杂情况
for(String s : collect3){ for(String s : collect3){
ClFxsb clFxsb1 = clFxsbList.stream().filter(clFxsb -> StringUtils.isNotEmpty(clFxsb.getPdtj())).collect(Collectors.toList()).stream().filter(clFxsb -> clFxsb.getPdtj().contains(s)).findFirst().orElse(null); ClFxsb clFxsb1 = clFxsbList.stream().filter(clFxsb -> StringUtils.isNotEmpty(clFxsb.getPdtj())).collect(Collectors.toList()).stream().filter(clFxsb -> clFxsb.getPdtj().contains(s)).findFirst().orElse(null);
...@@ -585,19 +580,31 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService ...@@ -585,19 +580,31 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
} }
for(Jsqa item: jsqaList){ for(Jsqa item: jsqaList){
fzqk.add(item.getJh()+"在"+item.getJs()+"时发生"+item.getFzqk()); 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); // 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(clFxsb1!=null){
if(StringUtils.isNotEmpty(zyfx)){ // if(StringUtils.isNotEmpty(zyfx)){
zyfx=zyfx+item.getJh()+"在"+item.getJs()+"m发生"+item.getFzqk()+"<br>"; // zyfx=zyfx+item.getJh()+"在"+item.getJs()+"m发生"+item.getFzqk()+"<br/>";
}else { // }else {
zyfx="邻井存在风险:"+item.getJh()+"在"+item.getJs()+"m发生"+item.getFzqk(); // zyfx="邻井存在风险:<br/>"+item.getJh()+"在"+item.getJs()+"m发生"+item.getFzqk();
} // }
// }
if(StringUtils.isNotEmpty(zyfx)){
zyfx=zyfx+";<br>"+item.getJh()+"在"+item.getJs()+"m发生"+item.getFzqk();
}else {
zyfx="邻井存在风险:<br/>"+item.getJh()+"在"+item.getJs()+"m发生"+item.getFzqk();
} }
} }
// sjFdsgcs1.setZjgccs(zjgccs); // sjFdsgcs1.setZjgccs(zjgccs);
// sjFdsgcs1.setZjycs(zjycs); // sjFdsgcs1.setZjycs(zjycs);
// sjFdsgcs1.setFxgkcs(fxgkcs); // sjFdsgcs1.setFxgkcs(fxgkcs);
sjFdsgcs1.setZyfx(zyfx); if(StringUtils.isNotEmpty(sjFdsgcs1.getZyfx())){
if(!sjFdsgcs1.getZyfx().contains("邻井存在风险")){
sjFdsgcs1.setZyfx(sjFdsgcs1.getZyfx()+"<p><br/><span style=\"font-size: 16px; font-family: 宋体;\">"+zyfx+"</span></p>");
}
}else {
sjFdsgcs1.setZyfx(zyfx);
}
String join = ""; String join = "";
if(fzqk.size()>0){ if(fzqk.size()>0){
join = String.join(";", fzqk); join = String.join(";", fzqk);
...@@ -742,7 +749,15 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService ...@@ -742,7 +749,15 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
} }
} }
} }
sjZysx.setZysx(zyfx);
if(StringUtils.isNotEmpty(sjZysx.getZysx())){
boolean fxflag = sjZysx.getZysx().contains("邻井风险");
if(!fxflag) {
sjZysx.setZysx("<br/> 邻井风险:<br/> "+zyfx);
}
}else {
sjZysx.setZysx("邻井风险:<br/> "+zyfx);
}
} }
sjZysxMapper.updateSjZysx(sjZysx); sjZysxMapper.updateSjZysx(sjZysx);
}else { }else {
...@@ -756,7 +771,6 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService ...@@ -756,7 +771,6 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
String zyfx=""; String zyfx="";
if(jsqaList.size()>0){ if(jsqaList.size()>0){
for(Jsqa item: jsqaList){ for(Jsqa item: jsqaList){
String cw =""; String cw ="";
if(StringUtils.isNotEmpty(item.getCw())){ if(StringUtils.isNotEmpty(item.getCw())){
cw="在"+item.getCw()+","; cw="在"+item.getCw()+",";
...@@ -765,7 +779,6 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService ...@@ -765,7 +779,6 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
if(StringUtils.isNotEmpty(item.getSjhd())){ if(StringUtils.isNotEmpty(item.getSjhd())){
sjhd="层厚"+item.getSjhd()+"m,"; sjhd="层厚"+item.getSjhd()+"m,";
} }
if(StringUtils.isNotEmpty(zyfx)){ if(StringUtils.isNotEmpty(zyfx)){
ClFxsb clFxsb1 = clFxsbList.stream().filter(clFxsb -> StringUtils.isNotEmpty(clFxsb.getPdtj())).collect(Collectors.toList()).stream().filter(clFxsb -> clFxsb.getPdtj().contains(item.getFzqk())).findFirst().orElse(null); 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(clFxsb1!=null){
...@@ -773,20 +786,6 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService ...@@ -773,20 +786,6 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
}else { }else {
zyfx=zyfx+";邻井"+item.getJh()+cw+"距层顶"+item.getJs()+"m处发生"+item.getFzqk()+(StringUtils.isNotEmpty(sjhd)?","+sjhd.substring(0,sjhd.length()-1):""); zyfx=zyfx+";邻井"+item.getJh()+cw+"距层顶"+item.getJs()+"m处发生"+item.getFzqk()+(StringUtils.isNotEmpty(sjhd)?","+sjhd.substring(0,sjhd.length()-1):"");
} }
// for(ClFxsb clFxsb :clFxsbList){
// if(StringUtils.isNotEmpty(clFxsb.getPdtj())){
// if(clFxsb.getPdtj().contains(item.getFzqk())){
// if(!zyfx.contains(item.getFzqk())){
// zyfx=zyfx+";邻井"+item.getJh()+cw+"距层顶"+item.getJs()+"m处发生"+item.getFzqk()+","+sjhd+"风险描述:"+clFxsb.getFxms();
// }else {
// zyfx=zyfx+";邻井"+item.getJh()+cw+"距层顶"+item.getJs()+"m处发生"+item.getFzqk()+","+(StringUtils.isNotEmpty(sjhd)?sjhd.substring(0,sjhd.length()-1):"");
// }
// }else {
// zyfx=zyfx+";邻井"+item.getJh()+cw+"距层顶"+item.getJs()+"m处发生"+item.getFzqk()+","+(StringUtils.isNotEmpty(sjhd)?sjhd.substring(0,sjhd.length()-1):"");
// }
// }
//
// }
}else { }else {
ClFxsb clFxsb1 = clFxsbList.stream().filter(clFxsb -> StringUtils.isNotEmpty(clFxsb.getPdtj())).collect(Collectors.toList()).stream().filter(clFxsb -> clFxsb.getPdtj().contains(item.getFzqk())).findFirst().orElse(null); 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(clFxsb1!=null){
...@@ -794,23 +793,11 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService ...@@ -794,23 +793,11 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
}else { }else {
zyfx="邻井"+item.getJh()+cw+"距层顶"+item.getJs()+"m处发生"+item.getFzqk()+(StringUtils.isNotEmpty(sjhd)?","+sjhd.substring(0,sjhd.length()-1):""); zyfx="邻井"+item.getJh()+cw+"距层顶"+item.getJs()+"m处发生"+item.getFzqk()+(StringUtils.isNotEmpty(sjhd)?","+sjhd.substring(0,sjhd.length()-1):"");
} }
// for(ClFxsb clFxsb :clFxsbList){
// if(StringUtils.isNotEmpty(clFxsb.getPdtj())){
// if(clFxsb.getPdtj().contains(item.getFzqk())){
// zyfx="邻井"+item.getJh()+cw+"距层顶"+item.getJs()+"m处发生"+item.getFzqk()+","+sjhd+",风险描述:"+clFxsb.getFxms();
// }else {
// zyfx="邻井"+item.getJh()+cw+"距层顶"+item.getJs()+"m处发生"+item.getFzqk()+","+(StringUtils.isNotEmpty(sjhd)?sjhd.substring(0,sjhd.length()-1):"");
// }
// }else {
// zyfx="邻井"+item.getJh()+cw+"距层顶"+item.getJs()+"m处发生"+item.getFzqk()+","+(StringUtils.isNotEmpty(sjhd)?sjhd.substring(0,sjhd.length()-1):"");
// }
//
// }
} }
} }
} }
sjZysx.setZysx(zyfx); sjZysx.setZysx("邻井风险:<br/>"+zyfx);
} }
sjZysxMapper.insertSjZysx(sjZysx); sjZysxMapper.insertSjZysx(sjZysx);
} }
......
...@@ -99,6 +99,8 @@ public class SjLjjwServiceImpl implements ISjLjjwService ...@@ -99,6 +99,8 @@ public class SjLjjwServiceImpl implements ISjLjjwService
String jh = list.get(0).getJh(); String jh = list.get(0).getJh();
SjLjjw sjLjjw=new SjLjjw(); SjLjjw sjLjjw=new SjLjjw();
sjLjjw.setJh(jh); sjLjjw.setJh(jh);
sjLjjw.setLb1(list.get(0).getLb1());
List<SjLjjw> sjLjjws = sjLjjwMapper.selectSjLjjwList(sjLjjw); List<SjLjjw> sjLjjws = sjLjjwMapper.selectSjLjjwList(sjLjjw);
Set<String> jhSet = sjLjjws.stream() Set<String> jhSet = sjLjjws.stream()
......
package com.zjsgfa.project.zjsgfa.util; package com.zjsgfa.project.zjsgfa.util;
import java.io.File; import java.io.*;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Base64; import java.util.Base64;
public class FileBase64Converter { public class FileBase64Converter {
...@@ -19,17 +19,63 @@ public class FileBase64Converter { ...@@ -19,17 +19,63 @@ public class FileBase64Converter {
if (file == null || !file.exists() || !file.isFile()) { if (file == null || !file.exists() || !file.isFile()) {
throw new IllegalArgumentException("文件不存在或不是有效文件"); throw new IllegalArgumentException("文件不存在或不是有效文件");
} }
// 2. 读取文件字节 // 2. 读取文件字节
try (FileInputStream fis = new FileInputStream(file)) { try (FileInputStream fis = new FileInputStream(file)) {
// byte[] fileBytes = originalString.getBytes(StandardCharsets.UTF_8);
byte[] fileBytes = new byte[(int) file.length()]; byte[] fileBytes = new byte[(int) file.length()];
fis.read(fileBytes); fis.read(fileBytes);
// 3. 编码为Base64字符串(使用URL安全的编码器,避免+、/等特殊字符问题) // 3. 编码为Base64字符串(使用URL安全的编码器,避免+、/等特殊字符问题)
// return Base64.getUrlEncoder().encodeToString(fileBytes);
return Base64.getEncoder().encodeToString(fileBytes);
}
}
/**
* 将文件转换为Base64编码字符串(无压缩、无截断)
* @param file 要转换的文件对象
* @return Base64编码字符串(标准编码,非URL安全,如需URL安全可替换为getUrlEncoder)
* @throws IOException 读取文件时的IO异常
*/
public static String fileToBase64Two(File file) throws IOException {
// 1. 严格校验文件有效性
if (file == null) {
throw new IllegalArgumentException("文件对象不能为空");
}
if (!file.exists()) {
throw new IllegalArgumentException("文件不存在:" + file.getAbsolutePath());
}
if (!file.isFile()) {
throw new IllegalArgumentException("不是有效文件:" + file.getAbsolutePath());
}
if (file.length() > Integer.MAX_VALUE) {
throw new IllegalArgumentException("文件过大(超过2GB),不支持转换:" + file.getAbsolutePath());
}
// 2. 读取文件所有字节(确保完整读取,避免read()单次读取不完整)
// 2. 完整读取文件字节(解决大文件读取不完整问题)
try (FileInputStream fis = new FileInputStream(file)) {
// 推荐使用ByteArrayOutputStream动态接收字节,避免文件长度溢出int范围(可选优化)
byte[] buffer = new byte[4096]; // 4K缓冲区,适配IO性能
int bytesRead;
java.io.ByteArrayOutputStream bos = new java.io.ByteArrayOutputStream();
while ((bytesRead = fis.read(buffer)) != -1) {
bos.write(buffer, 0, bytesRead);
}
byte[] fileBytes = bos.toByteArray();
// 3. 编码为Base64(URL安全,无压缩)
// 若不需要URL安全,改用Base64.getEncoder()
return Base64.getUrlEncoder().encodeToString(fileBytes); return Base64.getUrlEncoder().encodeToString(fileBytes);
} }
} }
/** /**
* 将Base64字符串转回文件(用于测试验证) * 将Base64字符串转回文件(用于测试验证)
* @param base64Str Base64编码字符串 * @param base64Str Base64编码字符串
...@@ -75,7 +121,7 @@ public class FileBase64Converter { ...@@ -75,7 +121,7 @@ public class FileBase64Converter {
try { try {
// 2. 解码 Base64 字符串为字节数组(兼容 URL 安全的 Base64 编码) // 2. 解码 Base64 字符串为字节数组(兼容 URL 安全的 Base64 编码)
byte[] excelBytes = Base64.getUrlDecoder().decode(base64Str); byte[] excelBytes = Base64.getDecoder().decode(base64Str);
// 3. 将字节数组写入 Excel 文件(try-with-resources 自动关闭流) // 3. 将字节数组写入 Excel 文件(try-with-resources 自动关闭流)
try (FileOutputStream fos = new FileOutputStream(excelFile)) { try (FileOutputStream fos = new FileOutputStream(excelFile)) {
...@@ -88,13 +134,87 @@ public class FileBase64Converter { ...@@ -88,13 +134,87 @@ public class FileBase64Converter {
} }
/**
* 计算文件MD5(用于验证文件一致性)
* @param file 目标文件
* @return MD5十六进制字符串
* @throws IOException IO异常
* @throws NoSuchAlgorithmException 加密算法不存在
*/
public static String calculateFileMD5(File file) throws IOException, NoSuchAlgorithmException {
if (file == null || !file.exists()) {
return null;
}
MessageDigest md = MessageDigest.getInstance("MD5");
try (FileInputStream fis = new FileInputStream(file)) {
byte[] buffer = new byte[4096];
int bytesRead;
while ((bytesRead = fis.read(buffer)) != -1) {
md.update(buffer, 0, bytesRead);
}
}
byte[] mdBytes = md.digest();
// 转换为十六进制字符串
StringBuilder sb = new StringBuilder();
for (byte b : mdBytes) {
sb.append(String.format("%02x", b));
}
return sb.toString();
}
/**
* 文件转Base64(支持标准/URL安全编码)
* @param file 目标文件
* @param isUrlSafe 是否使用URL安全编码
* @return Base64字符串
* @throws IOException IO异常
*/
public static String fileToBase64S(File file, boolean isUrlSafe) throws IOException {
// 1. 校验文件有效性
if (file == null || !file.exists() || !file.isFile()) {
throw new IllegalArgumentException("文件不存在或不是有效文件");
}
// 2. 完整读取文件字节
try (FileInputStream fis = new FileInputStream(file);
ByteArrayOutputStream bos = new ByteArrayOutputStream()) {
byte[] buffer = new byte[4096];
int bytesRead;
while ((bytesRead = fis.read(buffer)) != -1) {
bos.write(buffer, 0, bytesRead);
}
byte[] fileBytes = bos.toByteArray();
// 3. 选择编码方式
Base64.Encoder encoder = isUrlSafe ? Base64.getUrlEncoder() : Base64.getEncoder();
return encoder.encodeToString(fileBytes);
}
}
public static void main(String[] args) throws IOException { public static void main(String[] args) throws IOException {
// 测试将文件转换为 Base64 // 测试将文件转换为 Base64
File file = new File("D:\\qianhe\\file\\钻井施工智能优选\\解析\\XYL217X52钻井地质设计.pdf"); File file = new File("D:\\qianhe\\file\\钻井施工智能优选\\解析\\XYL217X52钻井地质设计.pdf");
String base64Str = fileToBase64(file); String base64Str = fileToBase64(file);
System.out.println("Base64 编码字符串:" + base64Str); // System.out.println(base64Str);
// 指定输出文件路径
String outputPath = "D:\\qianhe\\file\\钻井施工智能优选\\解析\\地质设计-jy导出.txt";
try (BufferedWriter writer = new BufferedWriter(new FileWriter(outputPath))) {
writer.write(base64Str);
} catch (IOException e) {
System.err.println("写入文件时出错: " + e.getMessage());
}
// File file1 =new File("D:\\qianhe\\file\\钻井施工智能优选\\解析\\XYL217X52.pdf");
// base64ToFile(base64Str, file1);
// 测试将文件转换为 Base64
// File file = new File("D:\\qianhe\\file\\钻井施工智能优选\\解析\\XYL217X52钻井工程设计.pdf");
// String base64Str = fileToBase64S(file,false);
// System.out.println(base64Str);
// File file1 =new File("D:\\qianhe\\file\\钻井施工智能优选\\解析\\XYL217X52设计转.pdf");
// base64ToFile(base64Str, file1);
base64ToExcel(base64Str, "D:\\qianhe\\file\\钻井施工智能优选\\解析\\XYL217X52.pdf");
} }
} }
package com.zjsgfa.project.zjsgfa.util;
import com.alibaba.fastjson2.JSONObject;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class InfoExtractor {
/**
* 提取句子中的井号、钻井队、区块信息
* @param sentence 待提取的原始句子
* @return 封装好的JSON对象(包含jh/zjdmc/qk字段)
*/
public static JSONObject extractInfo(String sentence) {
JSONObject result = new JSONObject();
// 1. 提取井号(匹配“梁+数字-斜+数字”格式,后接“井”字)
// Pattern jhPattern = Pattern.compile("(梁\\d+-斜\\d+)井");
// Pattern jhPattern = Pattern.compile("(梁|滨|桩|义)\\d+-斜\\d+井?");
// Matcher jhMatcher = jhPattern.matcher(sentence);
Pattern wellPattern = Pattern.compile("(桩斜\\d+-(?:斜)?\\d+|(?:梁|滨|桩|义)\\d+-斜\\d+)");
Matcher jhMatcher = wellPattern.matcher(sentence);
if (jhMatcher.find()) {
result.put("jh", jhMatcher.group(1).replace("井", ""));
} else {
result.put("jh", ""); // 无匹配时返回空字符串
}
// 2. 提取钻井队名称(匹配“钻井队:”后到逗号/空格前的内容)
Pattern zjdPattern = Pattern.compile("钻井队:([^,\\s]+)");
Matcher zjdMatcher = zjdPattern.matcher(sentence);
if (zjdMatcher.find()) {
result.put("zjdmc", zjdMatcher.group(1));
} else {
result.put("zjdmc", "");
}
// 3. 提取区块名称(匹配“区块名称:”后到逗号/空格前的内容)
Pattern qkPattern = Pattern.compile("区块名称:([^,\\s]+)");
Matcher qkMatcher = qkPattern.matcher(sentence);
if (qkMatcher.find()) {
result.put("qk", qkMatcher.group(1));
} else {
result.put("qk", "");
}
return result;
}
public static void main(String[] args) {
String text = "编制梁217-斜52井的施工方案,钻井队:井队,区块名称:小营,上传的地质设计和工程设计文档。\n" +
"编制滨16-斜27井的施工方案,钻井队:井队,区块名称:小营,上传的地质设计和工程设计文档。\n" +
"编制滨648-斜71的施工方案,钻井队:井队,区块名称:小营,上传的地质设计和工程设计文档。\n" +
"编制桩80-斜4井的施工方案,钻井队:井队,区块名称:小营,上传的地质设计和工程设计文档。\n" +
"编制桩斜80-斜4井的施工方案,钻井队:井队,区块名称:小营,上传的地质设计和工程设计文档。\n" +
"编制桩斜80-4井的施工方案,钻井队:井队,区块名称:小营,上传的地质设计和工程设计文档。\n" +
"编制义34-斜236井的施工方案,钻井队:井队,区块名称:小营,上传的地质设计和工程设计文档。";
String text2 = "编制桩斜80-4井的施工方案,钻井队:井队,区块名称:小营,上传的地质设计和工程设计文档。";
// 优化后正则:限定前缀为梁/滨/桩/义,排除“编制”
// Pattern wellPattern = Pattern.compile("(桩斜\\\\d+-(?:斜)?\\\\d+|(?:梁|滨|桩|义)\\\\d+-斜\\\\d+)");
//
// Matcher matcher = wellPattern.matcher(text);
Pattern wellPattern = Pattern.compile("(桩斜\\d+-(?:斜)?\\d+|(?:梁|滨|桩|义)\\d+-斜\\d+)");
Matcher matcher = wellPattern.matcher(text);
List<String> wellNames = new ArrayList<>();
while (matcher.find()) {
String wellName = matcher.group(1).replace("井", ""); // 移除可能存在的"井"字
wellNames.add(wellName);
}
// List<String> wellNames = new ArrayList<>();
// while (matcher.find()) {
// // 提取匹配结果(自动过滤“编制”)
// wellNames.add(matcher.group(1)); // 提取核心井名(不含“井”字)
// }
System.out.println("提取的井名列表:");
for (String wellName : wellNames) {
// 若结果包含“井”字,可通过replace("井", "")去除
System.out.println(wellName);
}
}
}
\ No newline at end of file
...@@ -311,7 +311,9 @@ public class DjdcServiceImpl implements DjdcService { ...@@ -311,7 +311,9 @@ public class DjdcServiceImpl implements DjdcService {
continue; continue;
} }
item.setJc(djZqsjfx.getJc()); item.setJc(djZqsjfx.getJc());
item.setCw(djZqsjfx.getCw().substring(djZqsjfx.getCw().lastIndexOf("-")+1)); if(StringUtils.isNotEmpty(djZqsjfx.getCw())){
item.setCw(djZqsjfx.getCw().substring(djZqsjfx.getCw().lastIndexOf("-")+1));
}
//查询日志表 //查询日志表
String kssj =item.getKssj(); String kssj =item.getKssj();
String jssj =item.getJssj(); String jssj =item.getJssj();
......
...@@ -128,6 +128,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -128,6 +128,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</delete> </delete>
<delete id="deleteCommonFileByICommonFile"> <delete id="deleteCommonFileByICommonFile">
delete from common_file where business_id = #{businessId} and type=#{type} delete from common_file where business_id = #{businessId} and template_name=#{templateName}
</delete> </delete>
</mapper> </mapper>
\ No newline at end of file
...@@ -73,8 +73,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -73,8 +73,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
hsezt, hsezt,
jhjdzt, jhjdzt,
flzt, flzt,
faid,famc faid,famc,u.nick_name as cjrmc
from sj_djjc a left join jcxx_jdxx b on a.zjd=b.id from sj_djjc a left join jcxx_jdxx b on a.zjd=b.id
left join sys_user u on a.created_by=u.user_name
</sql> </sql>
<select id="selectSjDjjcList" parameterType="SjDjjc" resultMap="SjDjjcResult"> <select id="selectSjDjjcList" parameterType="SjDjjc" resultMap="SjDjjcResult">
...@@ -384,6 +385,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -384,6 +385,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
DELETE FROM sj_zysx WHERE jh LIKE CONCAT('%', #{jh}, '%'); DELETE FROM sj_zysx WHERE jh LIKE CONCAT('%', #{jh}, '%');
<!-- 48. 删除sj_zysx表数据 -->
DELETE FROM sj_fdsgcs_dcyl_zjymdsjb WHERE jh LIKE CONCAT('%', #{jh}, '%');
<!-- 48. 删除sj_zysx表数据 -->
DELETE FROM sj_fdsgcs_dcyl_zjymdtjb WHERE jh LIKE CONCAT('%', #{jh}, '%');
DELETE FROM sj_fdsgcs_zjfxzt WHERE jh LIKE CONCAT('%', #{jh}, '%');
</delete> </delete>
......
...@@ -55,6 +55,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -55,6 +55,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="jdzzb != null "> and jdzzb = #{jdzzb}</if> <if test="jdzzb != null "> and jdzzb = #{jdzzb}</if>
<if test="jdhjl != null "> and jdhjl = #{jdhjl}</if> <if test="jdhjl != null "> and jdhjl = #{jdhjl}</if>
<if test="jdzjl != null "> and jdzjl = #{jdzjl}</if> <if test="jdzjl != null "> and jdzjl = #{jdzjl}</if>
<if test="lb1 != null "> and lb1 = #{lb1}</if>
<if test="lb2 != null "> and lb2 = #{lb2}</if>
</where> </where>
</select> </select>
......
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