Commit ee29a9fe by MMF

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

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