Commit b3440885 by jiangyun

修改

parent d917eaee
...@@ -1863,98 +1863,102 @@ public class SjDjjcController extends BaseController { ...@@ -1863,98 +1863,102 @@ public class SjDjjcController extends BaseController {
lastRowNum = sheet.getLastRowNum(); lastRowNum = sheet.getLastRowNum();
List<ClFxsb> clFxsbList = clFxsbMapper.selectClFxsbList(new ClFxsb()); List<ClFxsb> clFxsbList = clFxsbMapper.selectClFxsbList(new ClFxsb());
sjZysxMapper.deleteSjZysxByJh(jh); sjZysxMapper.deleteSjZysxByJh(jh);
String zysx = new DataFormatter().formatCellValue(sheet.getRow(1).getCell(0)); System.out.println(sheet.getRow(1));
if (StringUtils.isNotEmpty(zysx)) { if(sheet.getRow(1)!=null){
SjZysx sjZysx = new SjZysx(); String zysx = new DataFormatter().formatCellValue(sheet.getRow(1).getCell(0));
sjZysx.setJh(jh); if (StringUtils.isNotEmpty(zysx)) {
sjZysx.setLb("邻井扫描"); SjZysx sjZysx = new SjZysx();
sjZysx.setZysx(zysx); sjZysx.setJh(jh);
for (SjLjsm sjLjsm : sjLjsmList) { sjZysx.setLb("邻井扫描");
Double zjjl = sjLjsm.getBjzjjl(); sjZysx.setZysx(zysx);
Double js = sjLjsm.getJs(); for (SjLjsm sjLjsm : sjLjsmList) {
if (zjjl < 5) { Double zjjl = sjLjsm.getBjzjjl();
if (StringUtils.isNotEmpty(sjZysx.getZysx())) { Double js = sjLjsm.getJs();
sjZysx.setZysx(sjZysx.getZysx() + ";本井在井深" + sjLjsm.getJs() + "m处与同台" + sjLjsm.getBjjh() + "井最近距离 " + zjjl + "m,现场施工时注意防碰"); if (zjjl < 5) {
} else { if (StringUtils.isNotEmpty(sjZysx.getZysx())) {
sjZysx.setZysx("本井在井深" + sjLjsm.getJs() + "m处与同台" + sjLjsm.getBjjh() + "井最近距离 " + zjjl + "m,现场施工时注意防碰"); sjZysx.setZysx(sjZysx.getZysx() + ";本井在井深" + sjLjsm.getJs() + "m处与同台" + sjLjsm.getBjjh() + "井最近距离 " + zjjl + "m,现场施工时注意防碰");
}
Double ksjs = 0.0;
for (int i = 0; i < sjJsjgList.size(); i++) {
SjJsjg sjJsjg = sjJsjgList.get(i);
String kc = sjJsjg.getKc();
if (i == 0) {
ksjs = 0.0;
} else { } else {
ksjs = sjJsjgList.get(i - 1).getJs(); sjZysx.setZysx("本井在井深" + sjLjsm.getJs() + "m处与同台" + sjLjsm.getBjjh() + "井最近距离 " + zjjl + "m,现场施工时注意防碰");
} }
ClFxsb clFxsb = clFxsbList.stream().filter(it -> it.getFxys().equals("防碰距离")).findFirst().orElse(null); Double ksjs = 0.0;
if (js > ksjs && js < sjJsjg.getJs()) { for (int i = 0; i < sjJsjgList.size(); i++) {
SjFdsgcs sjFdsgcs = new SjFdsgcs(); SjJsjg sjJsjg = sjJsjgList.get(i);
sjFdsgcs.setJh(jh); String kc = sjJsjg.getKc();
sjFdsgcs.setKc(sjJsjg.getKc()); if (i == 0) {
SjFdsgcs sjFdsgcs1 = sjFdsgcsMapper.selectSjFdsgcsByJhAndKc(sjFdsgcs); ksjs = 0.0;
if (sjFdsgcs1 != null) { } else {
if (clFxsb != null) { ksjs = sjJsjgList.get(i - 1).getJs();
String zjycs = clFxsb.getZjycs(); }
String gcjscs = clFxsb.getGcjscs(); ClFxsb clFxsb = clFxsbList.stream().filter(it -> it.getFxys().equals("防碰距离")).findFirst().orElse(null);
String zyfx = "<p><br/><span style=\"font-size: 14px; font-family: 宋体;line-height: 1.5;\">防碰风险:本井在井深" + sjLjsm.getJs() + "m处与同台" + sjLjsm.getBjjh() + "井最近距离 " + zjjl + "m,现场施工时注意防碰;风险描述:" + clFxsb.getFxms() + "</span></p>"; if (js > ksjs && js < sjJsjg.getJs()) {
if (StringUtils.isNotEmpty(sjFdsgcs1.getZyfx())) { SjFdsgcs sjFdsgcs = new SjFdsgcs();
if (!sjFdsgcs1.getZyfx().contains("防碰风险")) { sjFdsgcs.setJh(jh);
sjFdsgcs1.setZyfx(sjFdsgcs1.getZyfx() + "<br/> " + zyfx); sjFdsgcs.setKc(sjJsjg.getKc());
} SjFdsgcs sjFdsgcs1 = sjFdsgcsMapper.selectSjFdsgcsByJhAndKc(sjFdsgcs);
} else { if (sjFdsgcs1 != null) {
sjFdsgcs1.setZyfx(zyfx); if (clFxsb != null) {
} String zjycs = clFxsb.getZjycs();
String gcjscs = clFxsb.getGcjscs();
if (StringUtils.isNotEmpty(zjycs)) { String zyfx = "<p><br/><span style=\"font-size: 14px; font-family: 宋体;line-height: 1.5;\">防碰风险:本井在井深" + sjLjsm.getJs() + "m处与同台" + sjLjsm.getBjjh() + "井最近距离 " + zjjl + "m,现场施工时注意防碰;风险描述:" + clFxsb.getFxms() + "</span></p>";
String zjycsms = "<p><span style=\"font-size: 14px; font-family: 宋体;line-height: 1.5;\">防碰风险:钻井液措施:" + zjycs + "</span></p>"; if (StringUtils.isNotEmpty(sjFdsgcs1.getZyfx())) {
if (StringUtils.isNotEmpty(sjFdsgcs1.getZjycs())) { if (!sjFdsgcs1.getZyfx().contains("防碰风险")) {
if (!sjFdsgcs1.getZjycs().contains("防碰风险")) { sjFdsgcs1.setZyfx(sjFdsgcs1.getZyfx() + "<br/> " + zyfx);
sjFdsgcs1.setZjycs(sjFdsgcs1.getZjycs() + " <br/>" + zjycsms);
} }
} else { } else {
sjFdsgcs1.setZjycs(zjycsms); sjFdsgcs1.setZyfx(zyfx);
} }
} if (StringUtils.isNotEmpty(zjycs)) {
if (StringUtils.isNotEmpty(gcjscs)) { String zjycsms = "<p><span style=\"font-size: 14px; font-family: 宋体;line-height: 1.5;\">防碰风险:钻井液措施:" + zjycs + "</span></p>";
if (StringUtils.isNotEmpty(sjFdsgcs1.getZjgccs())) { if (StringUtils.isNotEmpty(sjFdsgcs1.getZjycs())) {
if (!sjFdsgcs1.getZjgccs().contains("防碰风险")) { if (!sjFdsgcs1.getZjycs().contains("防碰风险")) {
sjFdsgcs1.setZjgccs(sjFdsgcs1.getZjgccs() + "<br/><p><span style=\"font-size: 14px; font-family: 宋体;line-height: 1.5;\"> 防碰风险:工程技术措施:" + gcjscs + "</span></p>"); sjFdsgcs1.setZjycs(sjFdsgcs1.getZjycs() + " <br/>" + zjycsms);
}
} else {
sjFdsgcs1.setZjycs(zjycsms);
} }
} else {
sjFdsgcs1.setZjgccs("<p><span style=\"font-size: 14px; font-family: 宋体;line-height: 1.5;\">防碰风险:工程技术措施:" + gcjscs + "</span></p>");
} }
if (StringUtils.isNotEmpty(gcjscs)) {
if (StringUtils.isNotEmpty(sjFdsgcs1.getZjgccs())) {
if (!sjFdsgcs1.getZjgccs().contains("防碰风险")) {
sjFdsgcs1.setZjgccs(sjFdsgcs1.getZjgccs() + "<br/><p><span style=\"font-size: 14px; font-family: 宋体;line-height: 1.5;\"> 防碰风险:工程技术措施:" + gcjscs + "</span></p>");
}
} else {
sjFdsgcs1.setZjgccs("<p><span style=\"font-size: 14px; font-family: 宋体;line-height: 1.5;\">防碰风险:工程技术措施:" + gcjscs + "</span></p>");
}
}
} }
} sjFdsgcsMapper.updateSjFdsgcs(sjFdsgcs1);
sjFdsgcsMapper.updateSjFdsgcs(sjFdsgcs1); } else {
} else { sjFdsgcs1 = new SjFdsgcs();
sjFdsgcs1 = new SjFdsgcs(); sjFdsgcs1.setJh(jh);
sjFdsgcs1.setJh(jh); sjFdsgcs1.setKc(kc);
sjFdsgcs1.setKc(kc);
if (clFxsb != null) {
if (clFxsb != null) { String zjycs = clFxsb.getZjycs();
String zjycs = clFxsb.getZjycs(); String gcjscs = clFxsb.getGcjscs();
String gcjscs = clFxsb.getGcjscs(); sjFdsgcs1.setZyfx("<p><span style=\"font-size: 14px; font-family: 宋体;line-height: 1.5;\">本井在井深" + sjLjsm.getJs() + "m处与同台" + sjLjsm.getBjjh() + "井最近距离 " + zjjl + "m,现场施工时注意防碰;风险描述:" + clFxsb.getFxms() + "</span></p>");
sjFdsgcs1.setZyfx("<p><span style=\"font-size: 14px; font-family: 宋体;line-height: 1.5;\">本井在井深" + sjLjsm.getJs() + "m处与同台" + sjLjsm.getBjjh() + "井最近距离 " + zjjl + "m,现场施工时注意防碰;风险描述:" + clFxsb.getFxms() + "</span></p>"); if (StringUtils.isNotEmpty(zjycs)) {
if (StringUtils.isNotEmpty(zjycs)) { sjFdsgcs1.setZjycs("<p><span style=\"font-size: 14px; font-family: 宋体;line-height: 1.5;\">防碰风险:钻井液措施:" + zjycs + "</span></p>");
sjFdsgcs1.setZjycs("<p><span style=\"font-size: 14px; font-family: 宋体;line-height: 1.5;\">防碰风险:钻井液措施:" + zjycs + "</span></p>"); }
} if (StringUtils.isNotEmpty(gcjscs)) {
if (StringUtils.isNotEmpty(gcjscs)) { sjFdsgcs1.setZjgccs("<p><span style=\"font-size: 14px; font-family: 宋体;line-height: 1.5;\">防碰风险:工程技术措施:" + gcjscs + "</span></p>");
sjFdsgcs1.setZjgccs("<p><span style=\"font-size: 14px; font-family: 宋体;line-height: 1.5;\">防碰风险:工程技术措施:" + gcjscs + "</span></p>"); }
} }
sjFdsgcsMapper.insertSjFdsgcs(sjFdsgcs1);
} }
sjFdsgcsMapper.insertSjFdsgcs(sjFdsgcs1);
} }
} }
} }
}
}
sjZysxMapper.insertSjZysx(sjZysx);
} }
sjZysxMapper.insertSjZysx(sjZysx);
} }
//邻井扫描 注意事项end--------------------------------------------------- //邻井扫描 注意事项end---------------------------------------------------
//H2S table--------------------------------------------------- //H2S table---------------------------------------------------
sheet = workbook.getSheetAt(20); sheet = workbook.getSheetAt(20);
...@@ -2021,15 +2025,18 @@ public class SjDjjcController extends BaseController { ...@@ -2021,15 +2025,18 @@ public class SjDjjcController extends BaseController {
//H2S 注意事项--------------------------------------------------- //H2S 注意事项---------------------------------------------------
sheet = workbook.getSheetAt(21); sheet = workbook.getSheetAt(21);
lastRowNum = sheet.getLastRowNum(); lastRowNum = sheet.getLastRowNum();
String zysx1 = new DataFormatter().formatCellValue(sheet.getRow(1).getCell(0)); if(sheet.getRow(1)!=null){
if (StringUtils.isNotEmpty(zysx1)) { String zysx1 = new DataFormatter().formatCellValue(sheet.getRow(1).getCell(0));
SjZysx sjZysx = new SjZysx(); if (StringUtils.isNotEmpty(zysx1)) {
sjZysx.setJh(jh); SjZysx sjZysx = new SjZysx();
sjZysx.setLb("H2S"); sjZysx.setJh(jh);
sjZysx.setZysx(zysx1); sjZysx.setLb("H2S");
sjZysx.setZysx(zysx1);
// sjZysxMapper.deleteSjZysxByJh(jh); // sjZysxMapper.deleteSjZysxByJh(jh);
sjZysxMapper.insertSjZysx(sjZysx); sjZysxMapper.insertSjZysx(sjZysx);
}
} }
//H2S 注意事项end--------------------------------------------------- //H2S 注意事项end---------------------------------------------------
//喷漏卡塌 --------------------------------------------------- //喷漏卡塌 ---------------------------------------------------
sheet = workbook.getSheetAt(22); sheet = workbook.getSheetAt(22);
...@@ -2121,6 +2128,7 @@ public class SjDjjcController extends BaseController { ...@@ -2121,6 +2128,7 @@ public class SjDjjcController extends BaseController {
//计算地质分层 //计算地质分层
CommonParam param = new CommonParam(); CommonParam param = new CommonParam();
param.setJh(jh); param.setJh(jh);
List<SjDcfxDzfc> dzfcList = djdcService.getDzfcList2(param); List<SjDcfxDzfc> dzfcList = djdcService.getDzfcList2(param);
List<SjFdfx> sjFdfxList = new ArrayList<>(); List<SjFdfx> sjFdfxList = new ArrayList<>();
if (dzfcList.size() > 0) { if (dzfcList.size() > 0) {
...@@ -2302,6 +2310,8 @@ public class SjDjjcController extends BaseController { ...@@ -2302,6 +2310,8 @@ public class SjDjjcController extends BaseController {
public AjaxResult jxdzzl(SjDjjc sjDjjc) throws Exception { public AjaxResult jxdzzl(SjDjjc sjDjjc) throws Exception {
Long id = sjDjjc.getId(); Long id = sjDjjc.getId();
sjSjzlErrorLogMapper.add(SjSjzlErrorLog.builder().jh(id).body("调用系统接口").build());
SjDjjc sjDjjcnew = sjDjjcService.selectSjDjjcById(id); SjDjjc sjDjjcnew = sjDjjcService.selectSjDjjcById(id);
CommonFile commonFile = new CommonFile(); CommonFile commonFile = new CommonFile();
commonFile.setBusinessId(id.toString()); commonFile.setBusinessId(id.toString());
...@@ -2309,7 +2319,7 @@ public class SjDjjcController extends BaseController { ...@@ -2309,7 +2319,7 @@ public class SjDjjcController extends BaseController {
System.out.println(commonFiles); System.out.println(commonFiles);
if (commonFiles.size() > 0) { if (commonFiles.size() > 0) {
Map<String, List<CommonFile>> collect = commonFiles.stream().filter(it -> !it.getTemplateName().equals("模板数据导入")) Map<String, List<CommonFile>> collect = commonFiles.stream().filter(it -> !it.getTemplateName().equals("模板数据导入"))
.filter(it -> it.getFileSuffix().toLowerCase().equals("pdf")) .filter(it -> it.getFileSuffix().toLowerCase().equals("pdf") || it.getFileSuffix().toLowerCase().equals("docx"))
.collect(Collectors.groupingBy(CommonFile::getTemplateName)); .collect(Collectors.groupingBy(CommonFile::getTemplateName));
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
for (String key : collect.keySet()) { for (String key : collect.keySet()) {
...@@ -2381,6 +2391,8 @@ public class SjDjjcController extends BaseController { ...@@ -2381,6 +2391,8 @@ public class SjDjjcController extends BaseController {
// System.out.println("最终参数"+param); // System.out.println("最终参数"+param);
try { try {
//调用接口 //调用接口
sjSjzlErrorLogMapper.add(SjSjzlErrorLog.builder().jh(id).body("调用pdf解析接口").build());
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();//测试
// String body = HttpRequest.post("http://10.68.249.11:5174/api/pdf2xlsx").body(param).execute().body();//正式 // String body = HttpRequest.post("http://10.68.249.11:5174/api/pdf2xlsx").body(param).execute().body();//正式
System.out.println("接口返回数据" + body); System.out.println("接口返回数据" + body);
...@@ -2398,8 +2410,15 @@ public class SjDjjcController extends BaseController { ...@@ -2398,8 +2410,15 @@ public class SjDjjcController extends BaseController {
FileBase64Converter.base64ToExcel(s, outPath); FileBase64Converter.base64ToExcel(s, outPath);
File testFile = new File(outPath); File testFile = new File(outPath);
MultipartFile multipartFile = FileToMultipartFileConverter.convert(testFile); MultipartFile multipartFile = FileToMultipartFileConverter.convert(testFile);
sjSjzlErrorLogMapper.add(SjSjzlErrorLog.builder().jh(id).body("解析完成,正在插入数据").build());
AjaxResult ajaxResult = importData(multipartFile, false, sjDjjcnew); AjaxResult ajaxResult = importData(multipartFile, false, sjDjjcnew);
sjSjzlErrorLogMapper.add(SjSjzlErrorLog.builder().jh(id).body(ajaxResult.get("msg").toString()).build()); if(ajaxResult.isError()){
sjSjzlErrorLogMapper.add(SjSjzlErrorLog.builder().jh(id).body("数据插入失败").build());
}else {
sjSjzlErrorLogMapper.add(SjSjzlErrorLog.builder().jh(id).body(ajaxResult.get("msg").toString()).build());
}
} }
} else { } else {
sjSjzlErrorLogMapper.add(SjSjzlErrorLog.builder().jh(id).body(body).build()); sjSjzlErrorLogMapper.add(SjSjzlErrorLog.builder().jh(id).body(body).build());
...@@ -2407,11 +2426,14 @@ public class SjDjjcController extends BaseController { ...@@ -2407,11 +2426,14 @@ public class SjDjjcController extends BaseController {
return AjaxResult.error(s); return AjaxResult.error(s);
} }
} catch (Exception e) { } catch (Exception e) {
sjSjzlErrorLogMapper.add(SjSjzlErrorLog.builder().jh(id).body("调用接口失败,连接超时").build()); sjSjzlErrorLogMapper.add(SjSjzlErrorLog.builder().jh(id).body("解析接口出现异常").build());
return AjaxResult.error("调用接口失败,连接超时"); return AjaxResult.error("解析接口失败");
} }
} }
}else {
sjSjzlErrorLogMapper.add(SjSjzlErrorLog.builder().jh(id).body("未找到解析文件").build());
} }
return AjaxResult.success("解析成功"); return AjaxResult.success("解析成功");
} }
......
...@@ -38,7 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -38,7 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE 1=1 WHERE 1=1
<if test="jhs!=null"> <if test="jhs!=null and jhs.length>0">
and and
<foreach item="jh" collection="jhs" <foreach item="jh" collection="jhs"
open="(" separator=" or " close=")"> open="(" separator=" or " close=")">
...@@ -97,7 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -97,7 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND A.djsd1 > B.djsd1 AND A.djsd1 > B.djsd1
AND A.djsd2 &lt; B.djsd2 AND A.djsd2 &lt; B.djsd2
WHERE 1=1 WHERE 1=1
<if test="jhs!=null"> <if test="jhs!=null and jhs.length>0">
and and
<foreach item="jh" collection="jhs" <foreach item="jh" collection="jhs"
open="(" separator=" or " close=")"> open="(" separator=" or " close=")">
......
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