Commit b3440885 by jiangyun

修改

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