Commit ee29a9fe by MMF

MMF 2026-03-23 增加接口调用失败日志

parent 341b2926
...@@ -454,15 +454,15 @@ public class SjDjjcController extends BaseController { ...@@ -454,15 +454,15 @@ public class SjDjjcController extends BaseController {
//补充信息 //补充信息
XSSFSheet sheet = workbook.getSheet("补充信息2019"); XSSFSheet sheet = workbook.getSheet("补充信息2019");
int lastRowNum = sheet.getLastRowNum(); int lastRowNum = sheet.getLastRowNum();
List<SjBcxx> sjBcxxList=new ArrayList<>(); List<SjBcxx> sjBcxxList = new ArrayList<>();
String jfdw=""; String jfdw = "";
String bxg=""; String bxg = "";
String yctglrgd=""; String yctglrgd = "";
String gzmc=""; String gzmc = "";
String ahzb=""; String ahzb = "";
String azzb=""; String azzb = "";
String bhzb=""; String bhzb = "";
String bzzb=""; String bzzb = "";
for (int i = 0; i <= lastRowNum; i++) { for (int i = 0; i <= lastRowNum; i++) {
XSSFRow row = sheet.getRow(i); XSSFRow row = sheet.getRow(i);
...@@ -471,36 +471,36 @@ public class SjDjjcController extends BaseController { ...@@ -471,36 +471,36 @@ public class SjDjjcController extends BaseController {
} }
SjBcxx sjBcxx = new SjBcxx(); SjBcxx sjBcxx = new SjBcxx();
String bt = new DataFormatter().formatCellValue(row.getCell(0)); String bt = new DataFormatter().formatCellValue(row.getCell(0));
if(StringUtils.isEmpty(bt)){ if (StringUtils.isEmpty(bt)) {
continue; continue;
} }
sjBcxx.setBt(bt); sjBcxx.setBt(bt);
String nr = new DataFormatter().formatCellValue(row.getCell(1)); String nr = new DataFormatter().formatCellValue(row.getCell(1));
sjBcxx.setNr(nr); sjBcxx.setNr(nr);
if("甲方单位".equals(bt)){ if ("甲方单位".equals(bt)) {
jfdw=nr; jfdw = nr;
} }
if("补心高".equals(bt)){ if ("补心高".equals(bt)) {
bxg=nr; bxg = nr;
} }
if("油层套管联入高度".equals(bt)){ if ("油层套管联入高度".equals(bt)) {
yctglrgd=nr; yctglrgd = nr;
} }
if("构造名称".equals(bt)){ if ("构造名称".equals(bt)) {
gzmc=nr; gzmc = nr;
} }
if("A靶点-横坐标".equals(bt)){ if ("A靶点-横坐标".equals(bt)) {
ahzb=nr; ahzb = nr;
} }
if("A靶点-纵坐标".equals(bt)){ if ("A靶点-纵坐标".equals(bt)) {
azzb=nr; azzb = nr;
} }
if("B靶点-横坐标".equals(bt)){ if ("B靶点-横坐标".equals(bt)) {
bhzb=nr; bhzb = nr;
} }
if("B靶点-纵坐标".equals(bt)){ if ("B靶点-纵坐标".equals(bt)) {
bzzb=nr; bzzb = nr;
} }
String ext1 = new DataFormatter().formatCellValue(row.getCell(2)); String ext1 = new DataFormatter().formatCellValue(row.getCell(2));
sjBcxx.setExt1(ext1); sjBcxx.setExt1(ext1);
...@@ -511,15 +511,12 @@ public class SjDjjcController extends BaseController { ...@@ -511,15 +511,12 @@ public class SjDjjcController extends BaseController {
sjBcxx.setZbid(id); sjBcxx.setZbid(id);
sjBcxxList.add(sjBcxx); sjBcxxList.add(sjBcxx);
} }
if(sjBcxxList.size()>0){ if (sjBcxxList.size() > 0) {
sjBcxxMapper.deleteSjBcxxByZbid(id); sjBcxxMapper.deleteSjBcxxByZbid(id);
sjBcxxMapper.insertSjBcxxBatch(sjBcxxList); sjBcxxMapper.insertSjBcxxBatch(sjBcxxList);
} }
// 获取井基础信息表,下标从0开始 // 获取井基础信息表,下标从0开始
sheet = workbook.getSheetAt(0); sheet = workbook.getSheetAt(0);
lastRowNum = sheet.getLastRowNum(); lastRowNum = sheet.getLastRowNum();
...@@ -565,7 +562,7 @@ public class SjDjjcController extends BaseController { ...@@ -565,7 +562,7 @@ public class SjDjjcController extends BaseController {
// if(StringUtils.isEmpty(jkhzb)){ // if(StringUtils.isEmpty(jkhzb)){
// return AjaxResult.error("井基础信息中第"+(i+1)+"行井口横坐标不能为空"); // return AjaxResult.error("井基础信息中第"+(i+1)+"行井口横坐标不能为空");
// } // }
if(StringUtils.isNotEmpty(jkhzb)) { if (StringUtils.isNotEmpty(jkhzb)) {
info.setJkhzb(Double.parseDouble(jkhzb)); info.setJkhzb(Double.parseDouble(jkhzb));
jkhzbB = jkhzbB + Double.parseDouble(jkhzb); jkhzbB = jkhzbB + Double.parseDouble(jkhzb);
} }
...@@ -574,7 +571,7 @@ public class SjDjjcController extends BaseController { ...@@ -574,7 +571,7 @@ public class SjDjjcController extends BaseController {
// if(StringUtils.isEmpty(jkzzb)){ // if(StringUtils.isEmpty(jkzzb)){
// return AjaxResult.error("井基础信息中第"+(i+1)+"行井口纵坐标不能为空"); // return AjaxResult.error("井基础信息中第"+(i+1)+"行井口纵坐标不能为空");
// } // }
if(StringUtils.isNotEmpty(jkzzb)) { if (StringUtils.isNotEmpty(jkzzb)) {
info.setJkzzb(Double.parseDouble(jkzzb)); info.setJkzzb(Double.parseDouble(jkzzb));
jkzzbB = jkzzbB + Double.parseDouble(jkzzb); jkzzbB = jkzzbB + Double.parseDouble(jkzzb);
} }
...@@ -582,48 +579,46 @@ public class SjDjjcController extends BaseController { ...@@ -582,48 +579,46 @@ public class SjDjjcController extends BaseController {
// if(StringUtils.isEmpty(jdhzb)){ // if(StringUtils.isEmpty(jdhzb)){
// return AjaxResult.error("井基础信息中第"+(i+1)+"行井底横坐标不能为空"); // return AjaxResult.error("井基础信息中第"+(i+1)+"行井底横坐标不能为空");
// } // }
if(StringUtils.isNotEmpty(jdhzb)){ if (StringUtils.isNotEmpty(jdhzb)) {
info.setJdhzb(Double.parseDouble(jdhzb)); info.setJdhzb(Double.parseDouble(jdhzb));
jdhzbB = jdhzbB + Double.parseDouble(jdhzb); jdhzbB = jdhzbB + Double.parseDouble(jdhzb);
}else { } else {
if(StringUtils.isNotEmpty(ahzb)){ if (StringUtils.isNotEmpty(ahzb)) {
info.setJdhzb(Double.parseDouble(ahzb)); info.setJdhzb(Double.parseDouble(ahzb));
}else if(StringUtils.isNotEmpty(bhzb)){ } else if (StringUtils.isNotEmpty(bhzb)) {
info.setJdhzb(Double.parseDouble(bhzb)); info.setJdhzb(Double.parseDouble(bhzb));
} }
} }
if(StringUtils.isNotEmpty(ahzb)){ if (StringUtils.isNotEmpty(ahzb)) {
info.setAhzb(Double.parseDouble(ahzb)); info.setAhzb(Double.parseDouble(ahzb));
} }
if(StringUtils.isNotEmpty(azzb)){ if (StringUtils.isNotEmpty(azzb)) {
info.setAzzb(Double.parseDouble(azzb)); info.setAzzb(Double.parseDouble(azzb));
} }
String jdzzb = new DataFormatter().formatCellValue(row.getCell(7)); String jdzzb = new DataFormatter().formatCellValue(row.getCell(7));
// if(StringUtils.isEmpty(jdzzb)){ // if(StringUtils.isEmpty(jdzzb)){
// return AjaxResult.error("井基础信息中第"+(i+1)+"行井底纵坐标不能为空"); // return AjaxResult.error("井基础信息中第"+(i+1)+"行井底纵坐标不能为空");
// } // }
if(StringUtils.isNotEmpty(jdzzb)){ if (StringUtils.isNotEmpty(jdzzb)) {
info.setJdzzb(Double.parseDouble(jdzzb)); info.setJdzzb(Double.parseDouble(jdzzb));
jdzzbB = jdzzbB + Double.parseDouble(jdzzb); jdzzbB = jdzzbB + Double.parseDouble(jdzzb);
}else { } else {
if(StringUtils.isNotEmpty(azzb)){ if (StringUtils.isNotEmpty(azzb)) {
info.setJdzzb(Double.parseDouble(azzb)); info.setJdzzb(Double.parseDouble(azzb));
}else if(StringUtils.isNotEmpty(bzzb)){ } else if (StringUtils.isNotEmpty(bzzb)) {
info.setJdzzb(Double.parseDouble(bzzb)); info.setJdzzb(Double.parseDouble(bzzb));
} }
} }
if(StringUtils.isNotEmpty(bzzb)){ if (StringUtils.isNotEmpty(bzzb)) {
info.setBzzb(Double.parseDouble(bzzb)); info.setBzzb(Double.parseDouble(bzzb));
} }
if(StringUtils.isNotEmpty(bhzb)){ if (StringUtils.isNotEmpty(bhzb)) {
info.setBhzb(Double.parseDouble(bhzb)); info.setBhzb(Double.parseDouble(bhzb));
} }
...@@ -633,7 +628,6 @@ public class SjDjjcController extends BaseController { ...@@ -633,7 +628,6 @@ public class SjDjjcController extends BaseController {
info.setGzmc(gzmc); info.setGzmc(gzmc);
String gzwz = new DataFormatter().formatCellValue(row.getCell(8)); String gzwz = new DataFormatter().formatCellValue(row.getCell(8));
info.setGzwz(gzwz); info.setGzwz(gzwz);
String wzcw = new DataFormatter().formatCellValue(row.getCell(9)); String wzcw = new DataFormatter().formatCellValue(row.getCell(9));
...@@ -1269,8 +1263,8 @@ public class SjDjjcController extends BaseController { ...@@ -1269,8 +1263,8 @@ public class SjDjjcController extends BaseController {
} }
String value = dataFormatter.formatCellValue(xmRow.getCell(k + ksl)); String value = dataFormatter.formatCellValue(xmRow.getCell(k + ksl));
xm=xm.trim(); xm = xm.trim();
xm=xm.replaceAll(" ",""); xm = xm.replaceAll(" ", "");
String fieldName = DrillingFluidConstant.ITEM_FIELD_MAP.get(xm); String fieldName = DrillingFluidConstant.ITEM_FIELD_MAP.get(xm);
if (StringUtils.isEmpty(fieldName)) { if (StringUtils.isEmpty(fieldName)) {
...@@ -2122,7 +2116,6 @@ public class SjDjjcController extends BaseController { ...@@ -2122,7 +2116,6 @@ public class SjDjjcController extends BaseController {
} }
//浅层气end--------------------------------------------------- //浅层气end---------------------------------------------------
//计算地质分层 //计算地质分层
CommonParam param = new CommonParam(); CommonParam param = new CommonParam();
...@@ -2381,6 +2374,7 @@ public class SjDjjcController extends BaseController { ...@@ -2381,6 +2374,7 @@ public class SjDjjcController extends BaseController {
Gson gson = new GsonBuilder().setPrettyPrinting().create(); Gson gson = new GsonBuilder().setPrettyPrinting().create();
String param = gson.toJson(map2); String param = gson.toJson(map2);
// System.out.println("最终参数"+param); // System.out.println("最终参数"+param);
try {
//调用接口 //调用接口
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();//正式
...@@ -2406,7 +2400,10 @@ public class SjDjjcController extends BaseController { ...@@ -2406,7 +2400,10 @@ public class SjDjjcController extends BaseController {
String s = root.get("message").getAsString(); String s = root.get("message").getAsString();
return AjaxResult.error(s); return AjaxResult.error(s);
} }
} catch (Exception e) {
sjSjzlErrorLogMapper.add(SjSjzlErrorLog.builder().jh(id).body("调用接口失败,连接超时").build());
return AjaxResult.error("调用接口失败,连接超时");
}
} }
} }
return AjaxResult.success("解析成功"); return AjaxResult.success("解析成功");
...@@ -2597,41 +2594,41 @@ public class SjDjjcController extends BaseController { ...@@ -2597,41 +2594,41 @@ public class SjDjjcController extends BaseController {
@Autowired @Autowired
private BizTodoItemMapper bizTodoItemMapper; private BizTodoItemMapper bizTodoItemMapper;
public Map<String, Object> buildDataModel(SjDjjc sjDjjc) { public Map<String, Object> buildDataModel(SjDjjc sjDjjc) {
Map<String, Object> dataModel = new HashMap<>(); Map<String, Object> dataModel = new HashMap<>();
String jh = sjDjjc.getJh(); String jh = sjDjjc.getJh();
//查询审批人和意见 //查询审批人和意见
if(StringUtils.isNotEmpty(sjDjjc.getFalx())){ if (StringUtils.isNotEmpty(sjDjjc.getFalx())) {
//查询审批意见 //查询审批意见
String instanceId = sjDjjc.getInstanceId(); String instanceId = sjDjjc.getInstanceId();
if(sjDjjc.getFalx().equals("钻井液方案")){ if (sjDjjc.getFalx().equals("钻井液方案")) {
instanceId=sjDjjc.getZjyinstanceId(); instanceId = sjDjjc.getZjyinstanceId();
} }
if(StringUtils.isNotEmpty(instanceId)){ if (StringUtils.isNotEmpty(instanceId)) {
//查询审批意见 //查询审批意见
List<BizTodoItem> bizTodoItemList=bizTodoItemMapper.selectBizTodoItemSpList(instanceId); List<BizTodoItem> bizTodoItemList = bizTodoItemMapper.selectBizTodoItemSpList(instanceId);
List<Map<String,Object>> spList=new ArrayList<>(); List<Map<String, Object>> spList = new ArrayList<>();
for(BizTodoItem bizTodoItem:bizTodoItemList){ for (BizTodoItem bizTodoItem : bizTodoItemList) {
Map<String,Object> mapSp=new HashMap<>(); Map<String, Object> mapSp = new HashMap<>();
if (StringUtils.isNotEmpty(bizTodoItem.getDzqm())) { if (StringUtils.isNotEmpty(bizTodoItem.getDzqm())) {
Map<String, PictureRenderData> pictureMap = createPictureMap(bizTodoItem.getDzqm(), 120, 40); Map<String, PictureRenderData> pictureMap = createPictureMap(bizTodoItem.getDzqm(), 120, 40);
mapSp.put("spr", pictureMap.get("jwt")); mapSp.put("spr", pictureMap.get("jwt"));
} else { } else {
mapSp.put("spr", null); mapSp.put("spr", null);
} }
mapSp.put("spyj",bizTodoItem.getComment()); mapSp.put("spyj", bizTodoItem.getComment());
spList.add(mapSp); spList.add(mapSp);
} }
dataModel.put("spList", spList); dataModel.put("spList", spList);
}else { } else {
dataModel.put("spList", new ArrayList<>()); dataModel.put("spList", new ArrayList<>());
} }
}else { } else {
dataModel.put("spList", new ArrayList<>()); dataModel.put("spList", new ArrayList<>());
} }
// 添加基础信息 // 添加基础信息
dataModel.put("jh", jh); dataModel.put("jh", jh);
dataModel.put("jb", sjDjjc.getJb()); dataModel.put("jb", sjDjjc.getJb());
......
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