Commit b3440885 by jiangyun

修改

parent d917eaee
......@@ -1863,6 +1863,8 @@ public class SjDjjcController extends BaseController {
lastRowNum = sheet.getLastRowNum();
List<ClFxsb> clFxsbList = clFxsbMapper.selectClFxsbList(new ClFxsb());
sjZysxMapper.deleteSjZysxByJh(jh);
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();
......@@ -1954,6 +1956,8 @@ public class SjDjjcController extends BaseController {
}
sjZysxMapper.insertSjZysx(sjZysx);
}
}
//邻井扫描 注意事项end---------------------------------------------------
//H2S table---------------------------------------------------
......@@ -2021,6 +2025,7 @@ public class SjDjjcController extends BaseController {
//H2S 注意事项---------------------------------------------------
sheet = workbook.getSheetAt(21);
lastRowNum = sheet.getLastRowNum();
if(sheet.getRow(1)!=null){
String zysx1 = new DataFormatter().formatCellValue(sheet.getRow(1).getCell(0));
if (StringUtils.isNotEmpty(zysx1)) {
SjZysx sjZysx = new SjZysx();
......@@ -2030,6 +2035,8 @@ public class SjDjjcController extends BaseController {
// sjZysxMapper.deleteSjZysxByJh(jh);
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);
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