Commit 7fe6c4f7 by jiang'yun

修改

parent 018e522b
package com.zjsgfa.framework.task;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson2.JSON;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject;
import com.zjsgfa.project.zjsgfa.domain.Mxfxjgb;
import com.zjsgfa.project.zjsgfa.mapper.MxfxjgbMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Component("mxdyTask")
public class MxdyTask {
@Autowired
private MxfxjgbMapper mxfxjgbMapper;
public void ryParams(Long mxid)
{
Mxfxjgb mxfxjgb = mxfxjgbMapper.selectMxfxjgbById(mxid);
System.out.println(mxfxjgb);
Map<String, Object> map = new HashMap<>();
map.put("stream", false);
Map<String, Object> map2 = new HashMap<>();
map2.put("field_name","data");
map2.put("type","input");
map2.put("value",mxfxjgb.getRwnr());
List<Map> listMap =new ArrayList<>();
listMap.add(map2);
map.put("content",listMap);
String url = "https://agent.ai.sinopec.com/aicoapi/gateway/v2/workflow/api_run/53f4afd436d2417180cb27d6dc0a3e17";
String key="278GANwseRJ98YbADs3G1tj7Fg40sI7d";
Gson gson = new GsonBuilder().setPrettyPrinting().create();
String json = gson.toJson(map);
String result2 = HttpRequest.post(url).header("Authorization","Bearer "+key).body(json).execute().body();
System.out.println(result2);
// // 解析API响应
String textPresentation ="";
// 解析为顶层JsonObject
JsonObject root = gson.fromJson(result2, JsonObject.class);
// 逐层获取"文本呈现"内容
// 1. 获取外层data节点
JsonObject outerData = root.getAsJsonObject("data");
// 2. 获取内层data节点
JsonObject innerData = outerData.getAsJsonObject("data");
// 3. 获取"文本呈现"字段的值
textPresentation = innerData.get("文本呈现").getAsString();
// 打印结果
System.out.println("文本呈现内容:\n" + textPresentation);
mxfxjgb.setFhjg(textPresentation);
mxfxjgb.setJxzt("解析完成");
mxfxjgbMapper.updateMxfxjgb(mxfxjgb);
}
}
...@@ -2,6 +2,12 @@ package com.zjsgfa.project.zjsgfa.controller; ...@@ -2,6 +2,12 @@ package com.zjsgfa.project.zjsgfa.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.zjsgfa.common.exception.job.TaskException;
import com.zjsgfa.project.monitor.domain.SysJob;
import com.zjsgfa.project.monitor.service.ISysJobService;
import oracle.jdbc.proxy.annotation.Post;
import org.quartz.SchedulerException;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -34,6 +40,9 @@ public class MxfxjgbController extends BaseController ...@@ -34,6 +40,9 @@ public class MxfxjgbController extends BaseController
@Autowired @Autowired
private IMxfxjgbService mxfxjgbService; private IMxfxjgbService mxfxjgbService;
@Autowired
private ISysJobService jobService;
/** /**
* 查询大模型分析列表 * 查询大模型分析列表
*/ */
...@@ -75,8 +84,7 @@ public class MxfxjgbController extends BaseController ...@@ -75,8 +84,7 @@ public class MxfxjgbController extends BaseController
//@PreAuthorize("@ss.hasPermi('system:mxfxjgb:add')") //@PreAuthorize("@ss.hasPermi('system:mxfxjgb:add')")
@Log(title = "大模型分析", businessType = BusinessType.INSERT) @Log(title = "大模型分析", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody Mxfxjgb mxfxjgb) public AjaxResult add(@RequestBody Mxfxjgb mxfxjgb) throws SchedulerException, TaskException {
{
return toAjax(mxfxjgbService.insertMxfxjgb(mxfxjgb)); return toAjax(mxfxjgbService.insertMxfxjgb(mxfxjgb));
} }
...@@ -101,4 +109,29 @@ public class MxfxjgbController extends BaseController ...@@ -101,4 +109,29 @@ public class MxfxjgbController extends BaseController
{ {
return toAjax(mxfxjgbService.deleteMxfxjgbByIds(ids)); return toAjax(mxfxjgbService.deleteMxfxjgbByIds(ids));
} }
@GetMapping("/run/{id}")
public AjaxResult run(@PathVariable("id") Long id) throws SchedulerException
{
boolean result=false;
Mxfxjgb mxfxjgb1 = mxfxjgbService.selectMxfxjgbById(id);
if(mxfxjgb1!=null){
if(mxfxjgb1.getJobid()!=null){
SysJob job = jobService.selectJobById(mxfxjgb1.getJobid());
result = jobService.run(job);
if(result){
mxfxjgb1.setJxzt("解析中");
}else {
mxfxjgb1.setJxzt("解析失败");
}
mxfxjgbService.updateMxfxjgb(mxfxjgb1);
}
}
return result ? success() : error("任务不存在或已过期!");
}
} }
...@@ -649,8 +649,12 @@ public class SjDjjcController extends BaseController ...@@ -649,8 +649,12 @@ public class SjDjjcController extends BaseController
sjJsjgMapper.insertSjJsjgBatch(sjJsjgList); sjJsjgMapper.insertSjJsjgBatch(sjJsjgList);
} }
//井身结构 end--------------------------------------------------- //井身结构 end---------------------------------------------------
//井眼轨迹 --------------------------------------------------- //井眼轨迹 ---------------------------------------------------
sheet = workbook.getSheetAt(3); sheet = workbook.getSheetAt(3);
lastRowNum = sheet.getLastRowNum(); lastRowNum = sheet.getLastRowNum();
...@@ -1540,12 +1544,54 @@ public class SjDjjcController extends BaseController ...@@ -1540,12 +1544,54 @@ public class SjDjjcController extends BaseController
sjGztzList.add(sjGztz); sjGztzList.add(sjGztz);
} }
} }
if(sjGztzList.size()>0){
sjGztzMapper.deleteSjGztzByJh(jh);
sjGztzMapper.insertSjGztzBatch(sjGztzList);
//井身结构图
sheet = workbook.getSheetAt(12);
if(sheet!=null){
List<XSSFPicture> picturesJsjgt = getPictures(sheet);
// 遍历图片并处理
for (XSSFPicture picture : picturesJsjgt) {
// 获取锚点信息(位置)
XSSFClientAnchor anchor = picture.getClientAnchor();
XSSFPictureData pictureData = picture.getPictureData();
String ext = pictureData.suggestFileExtension();
String filePath = RuoYiConfig.getUploadPath()+"/gztz/";
//判断是否为井位图
if(isPictureInRow(anchor, 0, 0)){
SjGztz sjGztz=new SjGztz();
sjGztz.setJh(jh);
sjGztz.setGzlx("井身结构图");
String fileName = UUID.randomUUID().toString();
String lj = filePath + fileName + "." + ext;
File desc = new File(lj);
if (!desc.exists())
{
if (!desc.getParentFile().exists())
{
desc.getParentFile().mkdirs();
}
}
sjGztz.setLj( Constants.RESOURCE_PREFIX +"/upload/gztz/"+fileName + "." + ext);
FileOutputStream fos = new FileOutputStream(new File(filePath+fileName+"." + ext));
fos.write(pictureData.getData());
fos.close();
sjGztzList.add(sjGztz);
}
}
if(sjGztzList.size()>0){
sjGztzMapper.deleteSjGztzByJh(jh);
sjGztzMapper.insertSjGztzBatch(sjGztzList);
}
} }
//构造特征end--------------------------------------------------- //构造特征end---------------------------------------------------
//邻井扫描 table--------------------------------------------------- //邻井扫描 table---------------------------------------------------
sheet = workbook.getSheetAt(8); sheet = workbook.getSheetAt(8);
...@@ -1918,853 +1964,875 @@ public class SjDjjcController extends BaseController ...@@ -1918,853 +1964,875 @@ public class SjDjjcController extends BaseController
} }
/**
* 保存邻井资料
*/
@PostMapping("/saveLjzl")
public AjaxResult saveLjzl(@RequestBody CommonParam param) throws Exception{
return sjDjjcService.saveLjzl(param);
}
// /**
// * 计算风险
// */
// @PostMapping("/saveFx")
// public AjaxResult saveFx(@RequestBody CommonParam param) throws Exception{
//
// return sjDjjcService.saveLjzl(param);
// }
/**
* 计算钻头
*/
@PostMapping("/saveZtxh")
public AjaxResult saveZtxh(@RequestBody CommonParam param) throws Exception{
return sjDjjcService.saveZtxh(param);
}
/**
* 计算钻具组合
*/
@PostMapping("/saveZjzh")
public AjaxResult saveZjzh(@RequestBody CommonParam param) throws Exception{
return sjDjjcService.saveZjzh(param);
}
private static List<SjFdsgcsDcyx> processAndDisplay(List<SjDcfxDzfc> stratumList,double kscs, double targetCs,String jh,String kc) {
List<SjFdsgcsDcyx> list =new ArrayList<>(); /**
* 计算邻井井组
* @param sjDjjc
* @return
*/
@GetMapping("/jsljjz")
public AjaxResult jsljjz(SjDjjc sjDjjc) throws Exception {
return sjDjjcService.jsljjz(sjDjjc);
}
System.out.println("名称\t井段垂深 / m"); @PostMapping("/exportWord")
public void exportWord(long id,HttpServletResponse response) throws Exception {
SjDjjc sjDjjc = sjDjjcService.selectSjDjjcById(id);
double previousDepth = kscs; // 从kscs开始计算 InputStream in = null;
boolean foundStartingPoint = false; XWPFTemplate template = null;
OutputStream os = null;
try {
in = this.getClass().getResourceAsStream("/static/excel/sgfamb.docx");
os = response.getOutputStream();
String fileName = sjDjjc.getJh() + "井施工方案";
System.out.println("名称\t井段垂深 / m");
for (SjDcfxDzfc stratum : stratumList) { // 设置响应头
double currentDepth = stratum.getCs(); response.setContentType("application/force-download");
response.setHeader("Content-Disposition",
"attachment;filename=" + URLEncoder.encode(fileName, "UTF-8") + ".docx");
//加载数据
Map<String, Object> data = buildDataModel(sjDjjc);
// 配置
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
LoopColumnTableRenderPolicy policyCol = new LoopColumnTableRenderPolicy();
HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy();
// 如果还没找到起始点,且当前地层深度小于kscs,跳过 Configure config = Configure.builder().useSpringEL()
if (!foundStartingPoint && currentDepth < kscs) { .bind("sjDzfcList", policy)//行循环策略
continue; .bind("sjJsjgList", policy)//行循环策略
.bind("sjJygjGdfdcsList", policy)//行循环策略
.bind("sjJygjGdsjgdcsList", policy)//行循环策略
.bind("sjJygjGdsjList", policy)//行循环策略
.bind("zjyFdsjList", policy)//行循环策略
.bind("zjyCljlList", policy)//行循环策略
.bind("sjZjyFdxnbList", policyCol)//列循环策略
.bind("sjTgTgzList", policy)//行循环策略
.bind("sjTgTgxnsjList", policy)//行循环策略
.bind("sjTgTgqdjhList", policy)//行循环策略
.bind("sjZlyqList", policy)//行循环策略
.bind("sjZlyqZbyqList", policy)//行循环策略
.bind("sjLjjwList", policy)//行循环策略
.bind("sjZqfxList", policy)//行循环策略
.bind("sjZtgjsjList", policy)//行循环策略
.bind("sjQkztfxList", policy)//行循环策略
.bind("sjSzfxjgList", policy)//行循环策略
.bind("sjDcfxDzfcList", policy)//行循环策略
.bind("sjDcfxTsyxList", policy)//行循环策略
.bind("sjJhzqList", policy)//行循环策略
.bind("sjH2sList", policy)//行循环策略
.bind("sjLjsmList", policy)//行循环策略
.bind("plqt", htmlRenderPolicy)//富文本策略
.bind("tsyxfx", htmlRenderPolicy)//富文本策略
.bind("sjyh", htmlRenderPolicy)//富文本策略
.bind("sjSggyZjzhcsList", policy)//行循环策略
.bind("sjSggyZjyFdxnbList", policyCol)//列循环策略
.bind("sjSggyZjyFdsjList", policy)//行循环策略
.bind("sjSggyZjyCljlList", policy)//行循环策略
.bind("zjkzz", htmlRenderPolicy)//富文本策略
.bind("jlgh", htmlRenderPolicy)//富文本策略
.bind("syyq", htmlRenderPolicy)//富文本策略
.bind("clcb", htmlRenderPolicy)//富文本策略
.bind("hse", htmlRenderPolicy)//富文本策略
.bind("yjlxfs", htmlRenderPolicy)//富文本策略
.bind("yfgkcs", htmlRenderPolicy)//富文本策略
.bind("wjsgcs", htmlRenderPolicy)//富文本策略
.bind("syzn", htmlRenderPolicy)//富文本策略
.bind("tsyxzs", htmlRenderPolicy)//富文本策略
.bind("gjfx", htmlRenderPolicy)//富文本策略
.bind("gjyh", htmlRenderPolicy)//富文本策略
.bind("dcyl", htmlRenderPolicy)//富文本策略
.bind("zyfx", htmlRenderPolicy)//富文本策略
.bind("fxgkcs", htmlRenderPolicy)//富文本策略
.bind("zjzh", htmlRenderPolicy)//富文本策略
.bind("zjzhzysx", htmlRenderPolicy)//富文本策略
.bind("zjycs", htmlRenderPolicy)//富文本策略
.bind("zjgccs", htmlRenderPolicy)//富文本策略
.bind("sjFdsgcsTsgjList", policy)//行策略
.bind("sjFdsgcsDcyxList", policy)//行策略
.bind("sjLjtjztList", policy)//行策略
.bind("sjZtcsxxList", policy)//行策略
.bind("sjFdsgcsZjyFdxnbList", policyCol)//列策略
.build();
XWPFTemplate compile = XWPFTemplate.compile(in, config);
// 加载模板并填充数据
template = compile.render(data);
template.write(os);
os.flush();
} catch (Exception e) {
throw e;
} finally {
if (in != null) {
in.close();
}
if (template != null) {
template.close();
} }
// 标记已找到起始点 if (os != null) {
foundStartingPoint = true; os.close();
// 确定当前地层的显示结束深度
double endDepth = Math.min(currentDepth, targetCs);
// 显示当前地层的范围
System.out.printf("%s\t%.0f-%.0f%n",
stratum.getDzfc(), previousDepth, endDepth);
SjFdsgcsDcyx sjFdsgcsDcyx = new SjFdsgcsDcyx();
sjFdsgcsDcyx.setJh(jh);
sjFdsgcsDcyx.setKc(kc);
sjFdsgcsDcyx.setDcmc(stratum.getDzfc());
sjFdsgcsDcyx.setJdcs(previousDepth + "-" + endDepth);
sjFdsgcsDcyx.setYx(stratum.getYxts());
list.add(sjFdsgcsDcyx);
// 更新上一个深度
previousDepth = currentDepth;
// 如果当前地层已经超过cs参数,结束处理
if (currentDepth >= targetCs) {
break;
} }
}
return list; }
} }
public Map<String, Object> buildDataModel(SjDjjc sjDjjc) {
Map<String, Object> dataModel = new HashMap<>();
String jh = sjDjjc.getJh();
// 添加基础信息
dataModel.put("jh", jh);
dataModel.put("jb", sjDjjc.getJb());
dataModel.put("jx", sjDjjc.getJx());
DecimalFormat df = new DecimalFormat("0"); // 或使用"#,###"等格式
String str = df.format(sjDjjc.getJkhzb());
dataModel.put("jkhzb", df.format(sjDjjc.getJkhzb()));
dataModel.put("jkzzb", df.format(sjDjjc.getJkzzb()));
dataModel.put("gzwz", sjDjjc.getGzwz());
dataModel.put("wzcw", sjDjjc.getWzcw());
dataModel.put("ztmd", sjDjjc.getZtmd());
dataModel.put("wzyz", sjDjjc.getWzyz());
dataModel.put("wjfa", sjDjjc.getWjfa());
SjDzfc sjDzfc =new SjDzfc();
sjDzfc.setSjjh(jh);
List<SjDzfc> sjDzfcList = sjDzfcMapper.selectSjDzfcList(sjDzfc);
dataModel.put("sjDzfcList", sjDzfcList);
SjJsjg sjJsjg =new SjJsjg();
sjJsjg.setJh(jh);
List<SjJsjg> sjJsjgList = sjJsjgMapper.selectSjJsjgList(sjJsjg);
dataModel.put("sjJsjgList", sjJsjgList);
private static List<SjFdsgcsDcyx> processAndDisplayDc(List<SjDcfxDzfc> stratumList,double kscs, double targetCs,String jh,String kc,List<SjJygjGdsjgdcs> sjJygjGdsjgdcsList) {
List<SjFdsgcsDcyx> list =new ArrayList<>();
System.out.println("名称\t井段垂深 / m");
double previousDepth = kscs; // 从kscs开始计算
boolean foundStartingPoint = false;
System.out.println("名称\t井段垂深 / m");
for (SjDcfxDzfc stratum : stratumList) { SjJygjInfo sjJygjInfo =new SjJygjInfo();
double currentDepth = stratum.getCs(); sjJygjInfo.setJh(jh);
List<SjJygjInfo> sjJygjInfos = sjJygjInfoMapper.selectSjJygjInfoList(sjJygjInfo);
String gdlx="";
if(sjJygjInfos.size()>0){
gdlx=sjJygjInfos.get(0).getGdlx();
}
dataModel.put("gdlx", gdlx);
SjJygjgdsj sjJygjgdsj =new SjJygjgdsj();
sjJygjgdsj.setJh(jh);
List<SjJygjgdsj> sjJygjgdsjList = sjJygjgdsjMapper.selectSjJygjgdsjList(sjJygjgdsj);
dataModel.put("sjJygjGdsjList", sjJygjgdsjList);
//井眼轨迹分段参数
SjJygjGdfdcs sjJygjGdfdcs=new SjJygjGdfdcs();
sjJygjGdfdcs.setJh(jh);
List<SjJygjGdfdcs> sjJygjGdfdcsList = sjJygjGdfdcsMapper.selectSjJygjGdfdcsList(sjJygjGdfdcs);
dataModel.put("sjJygjGdfdcsList", sjJygjGdfdcsList);
// 添加井眼轨迹设计各点参数
SjJygjGdsjgdcs sjJygjGdsjgdcs =new SjJygjGdsjgdcs();
sjJygjGdsjgdcs.setJh(jh);
List<SjJygjGdsjgdcs> sjJygjGdsjgdcsList = sjJygjGdsjgdcsMapper.selectSjJygjGdsjgdcsList(sjJygjGdsjgdcs);
dataModel.put("sjJygjGdsjgdcsList", sjJygjGdsjgdcsList);
//钻井液分段设计
SjZjyFdsj sjZjyFdsj =new SjZjyFdsj();
sjZjyFdsj.setJh(jh);
List<SjZjyFdsj> zjyFdsjList = sjZjyFdsjMapper.selectSjZjyFdsjList(sjZjyFdsj);
dataModel.put("zjyFdsjList", zjyFdsjList);
SjZjyCljl sjZjyCljl =new SjZjyCljl();
sjZjyCljl.setJh(jh);
List<SjZjyCljl> zjyCljlList = sjZjyCljlMapper.selectSjZjyCljlList(sjZjyCljl);
for(int i=0;i<zjyCljlList.size();i++){
zjyCljlList.get(i).setNum(i+1);
}
dataModel.put("zjyCljlList", zjyCljlList);
// 如果还没找到起始点,且当前地层深度小于kscs,跳过 SjZjyFdxnb sjZjyFdxnb= new SjZjyFdxnb();
if (!foundStartingPoint && currentDepth < kscs) { sjZjyFdxnb.setJh(jh);
continue; List<SjZjyFdxnb> sjZjyFdxnbList = sjZjyFdxnbMapper.selectSjZjyFdxnbList(sjZjyFdxnb);
} dataModel.put("sjZjyFdxnbList", sjZjyFdxnbList);
//套管柱
// 标记已找到起始点 SjTgTgz sjTgTgz =new SjTgTgz();
foundStartingPoint = true; sjTgTgz.setJh(jh);
List<SjTgTgz> sjTgTgzList = sjTgTgzMapper.selectSjTgTgzList(sjTgTgz);
// 确定当前地层的显示结束深度 dataModel.put("sjTgTgzList", sjTgTgzList);
double endDepth = Math.min(currentDepth, targetCs); SjTgTgxnsj sjTgTgxnsj =new SjTgTgxnsj();
sjTgTgxnsj.setJh(jh);
List<SjTgTgxnsj> tgxnsjList = sjTgTgxnsjMapper.selectSjTgTgxnsjList(sjTgTgxnsj);
// 显示当前地层的范围 dataModel.put("sjTgTgxnsjList", tgxnsjList);
System.out.printf("%s\t%.0f-%.0f%n", SjTgTgqdjh sjTgTgqdjh =new SjTgTgqdjh();
stratum.getDzfc(), previousDepth, endDepth); sjTgTgqdjh.setJh(jh);
SjFdsgcsDcyx sjFdsgcsDcyx = new SjFdsgcsDcyx(); List<SjTgTgqdjh> sjTgTgqdjhList = sjTgTgqdjhMapper.selectSjTgTgqdjhList(sjTgTgqdjh);
sjFdsgcsDcyx.setJh(jh); dataModel.put("sjTgTgqdjhList", sjTgTgqdjhList);
sjFdsgcsDcyx.setKc(kc);
sjFdsgcsDcyx.setDcmc(stratum.getDzfc());
sjFdsgcsDcyx.setJdcs(previousDepth + "-" + endDepth);
Double ksxs=getJs(sjJygjGdsjgdcsList,previousDepth);
Double jsxs=getJs(sjJygjGdsjgdcsList,endDepth);
sjFdsgcsDcyx.setJdxs(ksxs + "-" + jsxs);
sjFdsgcsDcyx.setYx(stratum.getYxts());
list.add(sjFdsgcsDcyx);
// 更新上一个深度
previousDepth = currentDepth;
// 如果当前地层已经超过cs参数,结束处理 SjZlyq sjZlyq =new SjZlyq();
if (currentDepth >= targetCs) { sjZlyq.setJh(jh);
break; List<SjZlyq> sjZlyqList = sjZlyqMapper.selectSjZlyqList(sjZlyq);
} dataModel.put("sjZlyqList", sjZlyqList);
SjZlyqZbyq sjZlyqZbyq =new SjZlyqZbyq();
sjZlyqZbyq.setJh(jh);
List<SjZlyqZbyq> sjZlyqZbyqList = sjZlyqZbyqMapper.selectSjZlyqZbyqList(sjZlyqZbyq);
dataModel.put("sjZlyqZbyqList", sjZlyqZbyqList);
SjZlyqXx sjZlyqXx =new SjZlyqXx();
sjZlyqXx.setJh(jh);
List<SjZlyqXx> sjZlyqXxList = sjZlyqXxMapper.selectSjZlyqXxList(sjZlyqXx);
if(sjZlyqXxList.size()>0){
SjZlyqXx item = sjZlyqXxList.get(0);
dataModel.put("gjzlyq",item.getGjzlyq());
dataModel.put("wcjjkzlyq",item.getWcjjkzlyq());
dataModel.put("yqcwrpdyq",item.getYqcwrpdyq());
}else {
dataModel.put("gjzlyq","");
dataModel.put("wcjjkzlyq","");
dataModel.put("yqcwrpdyq","");
} }
return list; //邻井
} SjLjjw sjLjjw =new SjLjjw();
sjLjjw.setJh(jh);
List<SjLjjw> sjLjjwList = sjLjjwMapper.selectSjLjjwList(sjLjjw);
private static List<SjFdfx> processAndDisplayFd(List<SjDcfxDzfc> stratumList,double kscs, double targetCs,String jh,String kc,List<SjJygjGdsjgdcs> sjJygjGdsjgdcsList,Long id) { dataModel.put("sjLjjwList", sjLjjwList);
SjZqfx sjZqfx =new SjZqfx();
List<SjFdfx> list =new ArrayList<>(); sjZqfx.setJh(jh);
List<SjZqfx> sjZqfxList = sjZqfxMapper.selectSjZqfxList(sjZqfx);
dataModel.put("sjZqfxList", sjZqfxList);
SjZtgjsj sjZtgjsj =new SjZtgjsj();
sjZtgjsj.setJh(jh);
List<SjZtgjsj> sjZtgjsjList = sjZtgjsjMapper.selectSjZtgjsjList(sjZtgjsj);
dataModel.put("sjZtgjsjList", sjZtgjsjList);
SjQkztfx sjQkztfx =new SjQkztfx();
sjQkztfx.setJh(jh);
List<SjQkztfx> sjQkztfxList = sjQkztfxMapper.selectSjQkztfxList(sjQkztfx);
dataModel.put("sjQkztfxList", sjQkztfxList);
SjSzfxjg sjSzfxjg =new SjSzfxjg();
sjSzfxjg.setJh(jh);
List<SjSzfxjg> sjSzfxjgList = sjSzfxjgMapper.selectSjSzfxjgList(sjSzfxjg);
dataModel.put("sjSzfxjgList", sjSzfxjgList);
System.out.println("名称\t井段垂深 / m"); SjDcfxDzfc sjDcfxDzfc =new SjDcfxDzfc();
sjDcfxDzfc.setJh(jh);
List<SjDcfxDzfc> sjDcfxDzfcList = sjDcfxDzfcMapper.selectSjDcfxDzfcList(sjDcfxDzfc);
dataModel.put("sjDcfxDzfcList", sjDcfxDzfcList);
SjDcfxTsyx sjDcfxTsyx =new SjDcfxTsyx();
sjDcfxTsyx.setJh(jh);
List<SjDcfxTsyx> sjDcfxTsyxList = sjDcfxTsyxMapper.selectSjDcfxTsyxList(sjDcfxTsyx);
dataModel.put("sjDcfxTsyxList", sjDcfxTsyxList);
double previousDepth = kscs; // 从kscs开始计算 SjGztz sjGztz =new SjGztz();
boolean foundStartingPoint = false; sjGztz.setJh(jh);
List<SjGztz> gztzList = sjGztzMapper.selectSjGztzList(sjGztz);
List<String> jwtList = gztzList.stream().filter(it -> it.getGzlx().equals("井位图")).map(SjGztz::getLj).collect(Collectors.toList());
if(jwtList.size()>0){
List<Map<String, PictureRenderData>> pictureList = createPictureList(jwtList, 500, 600);
dataModel.put("jwtList", pictureList);
}else {
dataModel.put("jwtList", new ArrayList<>());
}
System.out.println("名称\t井段垂深 / m"); List<String> dzpmtList = gztzList.stream().filter(it -> it.getGzlx().equals("地震刨面图")).map(SjGztz::getLj).collect(Collectors.toList());
if(dzpmtList.size()>0){
List<Map<String, PictureRenderData>> pictureList = createPictureList(dzpmtList, 500, 600);
dataModel.put("dzpmtList", pictureList);
}else {
dataModel.put("dzpmtList", new ArrayList<>());
}
for (SjDcfxDzfc stratum : stratumList) { List<String> sylpmtList = gztzList.stream().filter(it -> it.getGzlx().equals("三压力刨面图")).map(SjGztz::getLj).collect(Collectors.toList());
double currentDepth = stratum.getCs(); if(sylpmtList.size()>0){
List<Map<String, PictureRenderData>> pictureList = createPictureList(sylpmtList, 500, 600);
dataModel.put("sylpmtList", pictureList);
}else {
dataModel.put("sylpmtList", new ArrayList<>());
}
// 如果还没找到起始点,且当前地层深度小于kscs,跳过 //查询井身结构图
if (!foundStartingPoint && currentDepth < kscs) { List<String> jsjgtList = gztzList.stream().filter(it -> it.getGzlx().equals("井身结构图")).map(SjGztz::getLj).collect(Collectors.toList());
continue; if(jsjgtList.size()>0){
PictureRenderData pictureMap2 = createPictureMap2(jsjgtList.get(0), 500, 600);
if(pictureMap2!=null){
dataModel.put("jsjgt", pictureMap2);
}else {
dataModel.put("jsjgt", null);
} }
}else {
// 标记已找到起始点 SjJsjgt sjJsjgt=sjJsjgMapper.selectSjJsjgtById(sjDjjc.getId()+"");
foundStartingPoint = true; if(sjJsjgt!=null){
String svgContent = ImageProcessUtil.extractSvgFromBase64(sjJsjgt.getJsjgt());
// 确定当前地层的显示结束深度
double endDepth = Math.min(currentDepth, targetCs); InputStream pngStream = ImageProcessUtil.convertSvgToPng(svgContent);
SjFdfx sjFdfx = new SjFdfx(); PictureRenderData image = Pictures.ofStream(pngStream, PictureType.PNG)
sjFdfx.setZbid(id); .size(500, 600)
sjFdfx.setJh(jh); .create();
sjFdfx.setKc(kc); dataModel.put("jsjgt", image);
sjFdfx.setDzfc(stratum.getDzfc()); }else {
sjFdfx.setCs(endDepth); dataModel.put("jsjgt", null);
//计算斜深
sjFdfx.setXs(getJs(sjJygjGdsjgdcsList,endDepth));
sjFdfx.setYxts(stratum.getYxts());
sjFdfx.setYqsts(stratum.getYqsts());
sjFdfx.setGzts(stratum.getGzts());
list.add(sjFdfx);
// 更新上一个深度
previousDepth = currentDepth;
// 如果当前地层已经超过cs参数,结束处理
if (currentDepth >= targetCs) {
break;
} }
} }
return list;
}
public static double getCs(List<SjJygjGdsjgdcs> yjMnJygjJgList, double js){
DecimalFormat df = new DecimalFormat("#.00");
double cs=0;
for (int i=0;i<yjMnJygjJgList.size();i++){
SjJygjGdsjgdcs jg=yjMnJygjJgList.get(i);
double sd=jg.getJs();
if (sd>=js){
if (i == 0){
cs=yjMnJygjJgList.get(i).getJs();
break;
}else {
// 找到md所在的区间
// SurveyPoint prev = surveyPoints.get(i-1);
// SurveyPoint curr = surveyPoints.get(i);
// double md; // 斜深(Measured Depth),单位:米
// double inc; // 井斜角(Inclination),单位:度
// double azim; // 方位角(Azimuth),单位:度
// double tvd; // 垂深(True Vertical Depth),单位:米
// double northing; // 北向坐标
// double easting; // 东向坐标
// 线性插值计算垂深
double ratio = (js - yjMnJygjJgList.get(i-1).getJs()) / (yjMnJygjJgList.get(i).getJs() - yjMnJygjJgList.get(i-1).getJs());
cs= yjMnJygjJgList.get(i-1).getCs() + ratio * (yjMnJygjJgList.get(i).getCs() -yjMnJygjJgList.get(i-1).getCs());
break;
}
}
//计划周期
SjJhzq sjJhzq =new SjJhzq();
sjJhzq.setJh(jh);
List<SjJhzq> sjJhzqList = sjJhzqMapper.selectSjJhzqList(sjJhzq);
dataModel.put("sjJhzqList",sjJhzqList);
//H2s
SjH2s sjH2s =new SjH2s();
sjH2s.setJh(jh);
List<SjH2s> sjH2sList = sjH2sMapper.selectSjH2sList(sjH2s);
dataModel.put("sjH2sList",sjH2sList);
SjLjsm sjLjsm =new SjLjsm();
sjLjsm.setJh(jh);
List<SjLjsm> sjLjsmList = sjLjsmMapper.selectSjLjsmList(sjLjsm);
dataModel.put("sjLjsmList",sjLjsmList);
SjZysx sjZysx =new SjZysx();
sjZysx.setJh(jh);
List<SjZysx> sjZysxList = sjZysxMapper.selectSjZysxList(sjZysx);
SjZysx h2S = sjZysxList.stream().filter(it -> it.getLb().equals("H2S")).findFirst().orElse(null);
if(h2S!=null){
dataModel.put("h2S",h2S.getZysx());
}else {
dataModel.put("h2S","");
} }
return Double.parseDouble(df.format(cs)); SjZysx plqt = sjZysxList.stream().filter(it -> it.getLb().equals("喷漏卡塌")).findFirst().orElse(null);
} if(plqt!=null){
public static double getJs(List<SjJygjGdsjgdcs> yjMnJygjJgList, double cs) { dataModel.put("plqt",plqt.getZysx());
// 创建DecimalFormat对象,用于保留两位小数 }else {
DecimalFormat df = new DecimalFormat("#.00"); dataModel.put("plqt","");
double js = 0;
// 遍历所有数据点
for (int i = 0; i < yjMnJygjJgList.size(); i++) {
SjJygjGdsjgdcs jg = yjMnJygjJgList.get(i);
double currentCs = jg.getCs();
// 找到垂深大于等于目标垂深的点
if (currentCs >= cs) {
// 如果是第一个点,直接返回该点的斜深
if (i == 0) {
js = yjMnJygjJgList.get(i).getJs();
break;
} else {
// 找到目标垂深所在的区间,进行线性插值计算斜深
double prevCs = yjMnJygjJgList.get(i-1).getCs();
double prevJs = yjMnJygjJgList.get(i-1).getJs();
double currJs = yjMnJygjJgList.get(i).getJs();
// 计算插值比例
double ratio = (cs - prevCs) / (currentCs - prevCs);
// 线性插值计算斜深
js = prevJs + ratio * (currJs - prevJs);
break;
}
}
} }
// 格式化结果并返回 SjZysx tsyxfx = sjZysxList.stream().filter(it -> it.getLb().equals("特殊岩性风险")).findFirst().orElse(null);
return Double.parseDouble(df.format(js)); if(tsyxfx!=null){
} dataModel.put("tsyxfx",tsyxfx.getZysx());
}else {
dataModel.put("tsyxfx","");
}
SjZysx fpfx = sjZysxList.stream().filter(it -> it.getLb().equals("邻井扫描")).findFirst().orElse(null);
if(fpfx!=null){
dataModel.put("fpfx",fpfx.getZysx());
}else {
dataModel.put("fpfx","");
}
//施工概要
SjSggyGjsbxnyq sjSggyGjsbxnyq =new SjSggyGjsbxnyq();
sjSggyGjsbxnyq.setJh(jh);
List<SjSggyGjsbxnyq> sjSggyGjsbxnyqList = sjSggyGjsbxnyqMapper.selectSjSggyGjsbxnyqList(sjSggyGjsbxnyq);
if(sjSggyGjsbxnyqList.size()>0){
SjSggyGjsbxnyq gjsbxnyq = sjSggyGjsbxnyqList.get(0);
dataModel.put("sjyh",gjsbxnyq.getSjyh());
dataModel.put("zjxh", gjsbxnyq.getZjxh());
dataModel.put("wddy", gjsbxnyq.getWddy());
dataModel.put("dkwdscgl", gjsbxnyq.getDkwdscgl());
dataModel.put("zjnlZjlx", gjsbxnyq.getZjnlZjlx());
dataModel.put("zjnlZdcsll", gjsbxnyq.getZjnlZdcsll());
dataModel.put("zjnlZgcsby", gjsbxnyq.getZjnlZgcsby());
dataModel.put("xzxtDdzp", gjsbxnyq.getXzxtDdzp());
dataModel.put("xzxtDq", gjsbxnyq.getXzxtDq());
dataModel.put("xhxtB1lx", gjsbxnyq.getXhxtB1lx());
dataModel.put("xhxtB1xh", gjsbxnyq.getXhxtB1xh());
dataModel.put("xhxtB1zdgl", gjsbxnyq.getXhxtB1zdgl());
dataModel.put("xhxtB2lx", gjsbxnyq.getXhxtB2lx());
dataModel.put("xhxtB2xh", gjsbxnyq.getXhxtB2xh());
dataModel.put("xhxtB2zdgl", gjsbxnyq.getXhxtB2zdgl());
dataModel.put("xhxtB3lx", gjsbxnyq.getXhxtB3lx());
dataModel.put("xhxtB3xh", gjsbxnyq.getXhxtB3xh());
dataModel.put("xhxtB3zdgl", gjsbxnyq.getXhxtB3zdgl());
dataModel.put("gksbZdslx", gjsbxnyq.getGksbZdslx());
dataModel.put("gksbLxj1lx", gjsbxnyq.getGksbLxj1lx());
dataModel.put("gksbLxj1zdjgl", gjsbxnyq.getGksbLxj1zdjgl());
dataModel.put("gksbLxj2lx", gjsbxnyq.getGksbLxj2lx());
dataModel.put("gksbLxj2zdjgl", gjsbxnyq.getGksbLxj2zdjgl());
dataModel.put("gksbLxj3lx", gjsbxnyq.getGksbLxj3lx());
dataModel.put("gksbLxj3zdjgl", gjsbxnyq.getGksbLxj3zdjgl());
dataModel.put("xhgSl", gjsbxnyq.getXhgSl());
dataModel.put("xhgZrl", gjsbxnyq.getXhgZrl());
dataModel.put("cbgSl", gjsbxnyq.getCbgSl());
dataModel.put("cbgZrl", gjsbxnyq.getCbgZrl());
}else {
dataModel.put("sjyh","");
dataModel.put("zjxh", "");
dataModel.put("wddy", "");
dataModel.put("dkwdscgl", "");
dataModel.put("zjnlZjlx", "");
dataModel.put("zjnlZdcsll", "");
dataModel.put("zjnlZgcsby", "");
dataModel.put("xzxtDdzp", "");
dataModel.put("xzxtDq", "");
dataModel.put("xhxtB1lx", "");
dataModel.put("xhxtB1xh", "");
dataModel.put("xhxtB1zdgl", "");
dataModel.put("xhxtB2lx", "");
dataModel.put("xhxtB2xh", "");
dataModel.put("xhxtB2zdgl", "");
dataModel.put("xhxtB3lx", "");
dataModel.put("xhxtB3xh", "");
dataModel.put("xhxtB3zdgl", "");
dataModel.put("gksbZdslx", "");
dataModel.put("gksbLxj1lx", "");
dataModel.put("gksbLxj1zdjgl", "");
dataModel.put("gksbLxj2lx", "");
dataModel.put("gksbLxj2zdjgl", "");
dataModel.put("gksbLxj3lx", "");
dataModel.put("gksbLxj3zdjgl", "");
dataModel.put("xhgSl", "");
dataModel.put("xhgZrl", "");
dataModel.put("cbgSl", "");
dataModel.put("cbgZrl", "");
}
public static String extractNumber(String str) { SjSggyZjzhcs sjSggyZjzhcs =new SjSggyZjzhcs();
// 正则表达式:匹配-或~,然后捕获后面的数字 sjSggyZjzhcs.setJh(jh);
Pattern pattern = Pattern.compile("[\\-~](\\d+)"); List<SjSggyZjzhcs> sjSggyZjzhcsList = sjSggyZjzhcsMapper.selectSjSggyZjzhcsList(sjSggyZjzhcs);
Matcher matcher = pattern.matcher(str); dataModel.put("sjSggyZjzhcsList",sjSggyZjzhcsList);
SjSggyZjyFdxnb sjSggyZjyFdxnb =new SjSggyZjyFdxnb();
sjSggyZjyFdxnb.setJh(jh);
List<SjSggyZjyFdxnb> sjSggyZjyFdxnbList = sjSggyZjyFdxnbMapper.selectSjSggyZjyFdxnbList(sjSggyZjyFdxnb);
dataModel.put("sjSggyZjyFdxnbList",sjSggyZjyFdxnbList);
if (matcher.find()) { SjSggyZjyFdsj sjSggyZjyFdsj =new SjSggyZjyFdsj();
// 返回第一个捕获组的内容(即数字部分) sjSggyZjyFdsj.setJh(jh);
return matcher.group(1); List<SjSggyZjyFdsj> sjSggyZjyFdsjList = sjSggyZjyFdsjMapper.selectSjSggyZjyFdsjList(sjSggyZjyFdsj);
dataModel.put("sjSggyZjyFdsjList",sjSggyZjyFdsjList);
SjSggyZjyCljl sjSggyZjyCljl =new SjSggyZjyCljl();
sjSggyZjyCljl.setJh(jh);
List<SjSggyZjyCljl> sjSggyZjyCljlList = sjSggyZjyCljlMapper.selectSjSggyZjyCljlList(sjSggyZjyCljl);
dataModel.put("sjSggyZjyCljlList",sjSggyZjyCljlList);
SjJkzp sjJkzp =new SjJkzp();
sjJkzp.setJh(jh);
List<SjJkzp> sjJkzpList = sjJkzpMapper.selectSjJkzpList(sjJkzp);
if(sjJkzpList.size()>0){
SjJkzp sjJkzp1 = sjJkzpList.get(0);
dataModel.put("zjkzz", sjJkzp1.getZjkzz());
dataModel.put("jlgh", sjJkzp1.getJlgh());
dataModel.put("syyq", sjJkzp1.getSyyq());
dataModel.put("clcb", sjJkzp1.getClcb());
}else {
dataModel.put("zjkzz", sjJkzp.getZjkzz());
dataModel.put("jlgh", sjJkzp.getJlgh());
dataModel.put("syyq", sjJkzp.getSyyq());
dataModel.put("clcb", sjJkzp.getClcb());
}
SjHse sjHse =new SjHse();
sjHse.setJh(jh);
List<SjHse> sjHseList = sjHseMapper.selectSjHseList(sjHse);
if(sjHseList.size()>0){
SjHse sjHse1 = sjHseList.get(0);
dataModel.put("hse", sjHse1.getHse());
}else {
dataModel.put("hse", sjHse.getHse());
}
SjFl sjFl =new SjFl();
sjFl.setJh(jh);
List<SjFl> sjFlList = sjFlMapper.selectSjFlList(sjFl);
if(sjFlList.size()>0){
SjFl sjFl1 = sjFlList.get(0);
dataModel.put("yjlxfs", sjFl1.getYjlxfs());
dataModel.put("yfgkcs", sjFl1.getYfgkcs());
dataModel.put("wjsgcs", sjFl1.getWjsgcs());
dataModel.put("syzn", sjFl1.getSyzn());
dataModel.put("tsyxzs", sjFl1.getTsyxzs());
}else {
dataModel.put("yjlxfs", sjFl.getYjlxfs());
dataModel.put("yfgkcs", sjFl.getYfgkcs());
dataModel.put("wjsgcs", sjFl.getWjsgcs());
dataModel.put("syzn", sjFl.getSyzn());
dataModel.put("tsyxzs", sjFl.getTsyxzs());
} }
return null; // 如果没有匹配到,返回null
}
/** List<Map<String, Object>> fdsgcsList =new ArrayList<>();
* 保存邻井资料
*/
@PostMapping("/saveLjzl")
public AjaxResult saveLjzl(@RequestBody CommonParam param) throws Exception{
return sjDjjcService.saveLjzl(param);
}
// /** for(int i=0;i<sjJsjgList.size();i++){
// * 计算风险 SjJsjg sjJsjg1 = sjJsjgList.get(i);
// */ String num="";
// @PostMapping("/saveFx") if(i==0){
// public AjaxResult saveFx(@RequestBody CommonParam param) throws Exception{ num="(一) ";
// }else if(i==1){
// return sjDjjcService.saveLjzl(param); num="(二) ";
// } }else if(i==2){
num="(三) ";
}else if(i==3){
num="(四) ";
}else if(i==4){
num="(五) ";
}else if(i==5){
num="(六) ";
}else if(i==6){
num="(七) ";
}else if(i==7){
num="(八) ";
}
String kc = sjJsjg1.getKc();
Map<String, Object> map = new HashMap<>();
map.put("kc",num+ kc+"施工措施:");
SjFdsgcs sjFdsgcs =new SjFdsgcs();
sjFdsgcs.setJh(jh);
sjFdsgcs.setKc(kc);
List<SjFdsgcs> sjFdsgcsList= sjFdsgcsMapper.selectSjFdsgcsList(sjFdsgcs);
SjFdsgcs sjFdsgcs1 = sjFdsgcsList.get(0);
map.put("tzqk", sjFdsgcs1.getTzqk());
map.put("jdqk", sjFdsgcs1.getJdqk());
map.put("gjfx", sjFdsgcs1.getGjfx());
map.put("gjyh", sjFdsgcs1.getGjyh());
map.put("dcyl", sjFdsgcs1.getDcyl());
map.put("zyfx", sjFdsgcs1.getZyfx());
map.put("fxgkcs", sjFdsgcs1.getFxgkcs());
map.put("zjzh", sjFdsgcs1.getZjzh());
map.put("zjzhzysx", sjFdsgcs1.getZjzhzysx());
map.put("zjycs", sjFdsgcs1.getZjycs());
map.put("zjgccs", sjFdsgcs1.getZjgccs());
//特殊工具
SjFdsgcsTsgj sjFdsgcsTsgj =new SjFdsgcsTsgj();
sjFdsgcsTsgj.setJh(jh);
sjFdsgcsTsgj.setKc(kc);
List<SjFdsgcsTsgj> sjFdsgcsTsgjList = sjFdsgcsTsgjMapper.selectSjFdsgcsTsgjList(sjFdsgcsTsgj);
if(sjFdsgcsTsgjList.size()==0){
SjFdsgcsTsgj sjFdsgcsTsgj1 =new SjFdsgcsTsgj();
sjFdsgcsTsgj1.setJh("-");
sjFdsgcsTsgj1.setKc("-");
sjFdsgcsTsgj1.setGgxh("-");
sjFdsgcsTsgj1.setGjmc("-");
sjFdsgcsTsgj1.setGgxh("-");
sjFdsgcsTsgj1.setSl("-");
sjFdsgcsTsgj1.setYqxg("-");
sjFdsgcsTsgj1.setYjazwz("-");
sjFdsgcsTsgj1.setXnzb("-");
sjFdsgcsTsgj1.setRemark("-");
}
map.put("sjFdsgcsTsgjList", sjFdsgcsTsgjList);
SjZtxx sjZtxx=new SjZtxx();
sjZtxx.setJh(jh);
sjZtxx.setKc(kc);
List<SjZtxx> sjZtxxList = sjZtxxMapper.selectSjZtxxList(sjZtxx);
SjZtxx sjZtxx1 = sjZtxxList.get(0);
map.put("ztxh", sjZtxx1.getZtxh());
SjFdsgcsDcyx sjFdsgcsDcyx =new SjFdsgcsDcyx();
sjFdsgcsDcyx.setJh(jh);
sjFdsgcsDcyx.setKc(kc);
List<SjFdsgcsDcyx> sjFdsgcsDcyxList = sjFdsgcsDcyxMapper.selectSjFdsgcsDcyxList(sjFdsgcsDcyx);
map.put("sjFdsgcsDcyxList", sjFdsgcsDcyxList);
SjLjtjzt sjLjtjzt =new SjLjtjzt();
sjLjtjzt.setJh(jh);
sjLjtjzt.setKc(kc);
List<SjLjtjzt> sjLjtjztList = sjLjtjztMapper.selectSjLjtjztList(sjLjtjzt);
map.put("sjLjtjztList", sjLjtjztList);
SjZtcsxx sjZtcsxx =new SjZtcsxx();
sjZtcsxx.setJh(jh);
sjZtcsxx.setKc(kc);
List<SjZtcsxx> sjZtcsxxList = sjZtcsxxMapper.selectSjZtcsxxList(sjZtcsxx);
map.put("sjZtcsxxList", sjZtcsxxList);
/** SjZjcsxx sjZjcsxx =new SjZjcsxx();
* 计算钻头 sjZjcsxx.setJh(jh);
*/ sjZjcsxx.setKc(kc);
@PostMapping("/saveZtxh") List<SjZjcsxx> sjZjcsxxList = sjZjcsxxMapper.selectSjZjcsxxList(sjZjcsxx);
public AjaxResult saveZtxh(@RequestBody CommonParam param) throws Exception{ SjZjcsxx sjZjcsxx1 = sjZjcsxxList.get(0);
map.put("zjpl", sjZjcsxx1.getZjpl());
map.put("zjzy", sjZjcsxx1.getZjzy());
map.put("zjzs", sjZjcsxx1.getZjzs());
return sjDjjcService.saveZtxh(param); SjFdsgcsZjyFdxnb sjFdsgcsZjyFdxnb =new SjFdsgcsZjyFdxnb();
} sjFdsgcsZjyFdxnb.setJh(jh);
sjFdsgcsZjyFdxnb.setKc(kc);
List<SjFdsgcsZjyFdxnb> sjFdsgcsZjyFdxnbList = sjFdsgcsZjyFdxnbMapper.selectSjFdsgcsZjyFdxnbList(sjFdsgcsZjyFdxnb);
map.put("sjFdsgcsZjyFdxnbList", sjFdsgcsZjyFdxnbList);
fdsgcsList.add(map);
}
/** dataModel.put("fdsgcsList", fdsgcsList);
* 计算钻具组合
*/
@PostMapping("/saveZjzh")
public AjaxResult saveZjzh(@RequestBody CommonParam param) throws Exception{
return sjDjjcService.saveZjzh(param);
}
/**
* 计算邻井井组 return dataModel;
* @param sjDjjc
* @return
*/
@GetMapping("/jsljjz")
public AjaxResult jsljjz(SjDjjc sjDjjc) throws Exception {
return sjDjjcService.jsljjz(sjDjjc);
} }
@PostMapping("/exportWord")
public void exportWord(long id,HttpServletResponse response) throws Exception {
SjDjjc sjDjjc = sjDjjcService.selectSjDjjcById(id);
InputStream in = null;
XWPFTemplate template = null;
OutputStream os = null;
try {
in = this.getClass().getResourceAsStream("/static/excel/sgfamb.docx");
os = response.getOutputStream();
String fileName = sjDjjc.getJh() + "井施工方案";
// 设置响应头
response.setContentType("application/force-download");
response.setHeader("Content-Disposition",
"attachment;filename=" + URLEncoder.encode(fileName, "UTF-8") + ".docx");
//加载数据
Map<String, Object> data = buildDataModel(sjDjjc);
// 配置
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
LoopColumnTableRenderPolicy policyCol = new LoopColumnTableRenderPolicy();
HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy();
Configure config = Configure.builder().useSpringEL()
.bind("sjDzfcList", policy)//行循环策略
.bind("sjJsjgList", policy)//行循环策略
.bind("sjJygjGdfdcsList", policy)//行循环策略
.bind("sjJygjGdsjgdcsList", policy)//行循环策略
.bind("sjJygjGdsjList", policy)//行循环策略
.bind("zjyFdsjList", policy)//行循环策略
.bind("zjyCljlList", policy)//行循环策略
.bind("sjZjyFdxnbList", policyCol)//列循环策略
.bind("sjTgTgzList", policy)//行循环策略
.bind("sjTgTgxnsjList", policy)//行循环策略
.bind("sjTgTgqdjhList", policy)//行循环策略
.bind("sjZlyqList", policy)//行循环策略
.bind("sjZlyqZbyqList", policy)//行循环策略
.bind("sjLjjwList", policy)//行循环策略
.bind("sjZqfxList", policy)//行循环策略
.bind("sjZtgjsjList", policy)//行循环策略
.bind("sjQkztfxList", policy)//行循环策略
.bind("sjSzfxjgList", policy)//行循环策略
.bind("sjDcfxDzfcList", policy)//行循环策略
.bind("sjDcfxTsyxList", policy)//行循环策略
.bind("sjJhzqList", policy)//行循环策略
.bind("sjH2sList", policy)//行循环策略
.bind("sjLjsmList", policy)//行循环策略
.bind("plqt", htmlRenderPolicy)//富文本策略
.bind("tsyxfx", htmlRenderPolicy)//富文本策略
.bind("sjyh", htmlRenderPolicy)//富文本策略
.bind("sjSggyZjzhcsList", policy)//行循环策略
.bind("sjSggyZjyFdxnbList", policyCol)//列循环策略
.bind("sjSggyZjyFdsjList", policy)//行循环策略
.bind("sjSggyZjyCljlList", policy)//行循环策略
.bind("zjkzz", htmlRenderPolicy)//富文本策略
.bind("jlgh", htmlRenderPolicy)//富文本策略
.bind("syyq", htmlRenderPolicy)//富文本策略
.bind("clcb", htmlRenderPolicy)//富文本策略
.bind("hse", htmlRenderPolicy)//富文本策略
.bind("yjlxfs", htmlRenderPolicy)//富文本策略
.bind("yfgkcs", htmlRenderPolicy)//富文本策略
.bind("wjsgcs", htmlRenderPolicy)//富文本策略
.bind("syzn", htmlRenderPolicy)//富文本策略
.bind("tsyxzs", htmlRenderPolicy)//富文本策略
.bind("gjfx", htmlRenderPolicy)//富文本策略
.bind("gjyh", htmlRenderPolicy)//富文本策略
.bind("dcyl", htmlRenderPolicy)//富文本策略
.bind("zyfx", htmlRenderPolicy)//富文本策略
.bind("fxgkcs", htmlRenderPolicy)//富文本策略
.bind("zjzh", htmlRenderPolicy)//富文本策略
.bind("zjzhzysx", htmlRenderPolicy)//富文本策略
.bind("zjycs", htmlRenderPolicy)//富文本策略
.bind("zjgccs", htmlRenderPolicy)//富文本策略
.bind("sjFdsgcsTsgjList", policy)//行策略
.bind("sjFdsgcsDcyxList", policy)//行策略
.bind("sjLjtjztList", policy)//行策略
.bind("sjZtcsxxList", policy)//行策略
.bind("sjFdsgcsZjyFdxnbList", policyCol)//列策略
.build();
XWPFTemplate compile = XWPFTemplate.compile(in, config);
// 加载模板并填充数据
template = compile.render(data);
template.write(os);
os.flush();
} catch (Exception e) {
throw e;
} finally {
if (in != null) {
in.close();
}
if (template != null) {
template.close();
}
if (os != null) {
os.close();
private static List<SjFdsgcsDcyx> processAndDisplay(List<SjDcfxDzfc> stratumList,double kscs, double targetCs,String jh,String kc) {
List<SjFdsgcsDcyx> list =new ArrayList<>();
System.out.println("名称\t井段垂深 / m");
double previousDepth = kscs; // 从kscs开始计算
boolean foundStartingPoint = false;
System.out.println("名称\t井段垂深 / m");
for (SjDcfxDzfc stratum : stratumList) {
double currentDepth = stratum.getCs();
// 如果还没找到起始点,且当前地层深度小于kscs,跳过
if (!foundStartingPoint && currentDepth < kscs) {
continue;
} }
// 标记已找到起始点
foundStartingPoint = true;
// 确定当前地层的显示结束深度
double endDepth = Math.min(currentDepth, targetCs);
// 显示当前地层的范围
System.out.printf("%s\t%.0f-%.0f%n",
stratum.getDzfc(), previousDepth, endDepth);
SjFdsgcsDcyx sjFdsgcsDcyx = new SjFdsgcsDcyx();
sjFdsgcsDcyx.setJh(jh);
sjFdsgcsDcyx.setKc(kc);
sjFdsgcsDcyx.setDcmc(stratum.getDzfc());
sjFdsgcsDcyx.setJdcs(previousDepth + "-" + endDepth);
sjFdsgcsDcyx.setYx(stratum.getYxts());
list.add(sjFdsgcsDcyx);
// 更新上一个深度
previousDepth = currentDepth;
// 如果当前地层已经超过cs参数,结束处理
if (currentDepth >= targetCs) {
break;
}
} }
return list;
} }
public Map<String, Object> buildDataModel(SjDjjc sjDjjc) {
Map<String, Object> dataModel = new HashMap<>();
String jh = sjDjjc.getJh();
// 添加基础信息
dataModel.put("jh", jh);
dataModel.put("jb", sjDjjc.getJb());
dataModel.put("jx", sjDjjc.getJx());
DecimalFormat df = new DecimalFormat("0"); // 或使用"#,###"等格式
String str = df.format(sjDjjc.getJkhzb());
dataModel.put("jkhzb", df.format(sjDjjc.getJkhzb()));
dataModel.put("jkzzb", df.format(sjDjjc.getJkzzb()));
dataModel.put("gzwz", sjDjjc.getGzwz());
dataModel.put("wzcw", sjDjjc.getWzcw());
dataModel.put("ztmd", sjDjjc.getZtmd());
dataModel.put("wzyz", sjDjjc.getWzyz());
dataModel.put("wjfa", sjDjjc.getWjfa());
SjDzfc sjDzfc =new SjDzfc();
sjDzfc.setSjjh(jh);
List<SjDzfc> sjDzfcList = sjDzfcMapper.selectSjDzfcList(sjDzfc);
dataModel.put("sjDzfcList", sjDzfcList);
SjJsjg sjJsjg =new SjJsjg();
sjJsjg.setJh(jh);
List<SjJsjg> sjJsjgList = sjJsjgMapper.selectSjJsjgList(sjJsjg);
dataModel.put("sjJsjgList", sjJsjgList);
//查询井身结构图
SjJsjgt sjJsjgt=sjJsjgMapper.selectSjJsjgtById(sjDjjc.getId()+"");
if(sjJsjgt!=null){
String svgContent = ImageProcessUtil.extractSvgFromBase64(sjJsjgt.getJsjgt());
InputStream pngStream = ImageProcessUtil.convertSvgToPng(svgContent);
PictureRenderData image = Pictures.ofStream(pngStream, PictureType.PNG)
.size(500, 600)
.create();
dataModel.put("jsjgt", image);
}else {
dataModel.put("jsjgt", null);
}
SjJygjInfo sjJygjInfo =new SjJygjInfo();
sjJygjInfo.setJh(jh);
List<SjJygjInfo> sjJygjInfos = sjJygjInfoMapper.selectSjJygjInfoList(sjJygjInfo);
String gdlx="";
if(sjJygjInfos.size()>0){
gdlx=sjJygjInfos.get(0).getGdlx();
}
dataModel.put("gdlx", gdlx);
SjJygjgdsj sjJygjgdsj =new SjJygjgdsj();
sjJygjgdsj.setJh(jh);
List<SjJygjgdsj> sjJygjgdsjList = sjJygjgdsjMapper.selectSjJygjgdsjList(sjJygjgdsj);
dataModel.put("sjJygjGdsjList", sjJygjgdsjList);
//井眼轨迹分段参数
SjJygjGdfdcs sjJygjGdfdcs=new SjJygjGdfdcs();
sjJygjGdfdcs.setJh(jh);
List<SjJygjGdfdcs> sjJygjGdfdcsList = sjJygjGdfdcsMapper.selectSjJygjGdfdcsList(sjJygjGdfdcs);
dataModel.put("sjJygjGdfdcsList", sjJygjGdfdcsList);
// 添加井眼轨迹设计各点参数
SjJygjGdsjgdcs sjJygjGdsjgdcs =new SjJygjGdsjgdcs();
sjJygjGdsjgdcs.setJh(jh);
List<SjJygjGdsjgdcs> sjJygjGdsjgdcsList = sjJygjGdsjgdcsMapper.selectSjJygjGdsjgdcsList(sjJygjGdsjgdcs);
dataModel.put("sjJygjGdsjgdcsList", sjJygjGdsjgdcsList);
//钻井液分段设计
SjZjyFdsj sjZjyFdsj =new SjZjyFdsj();
sjZjyFdsj.setJh(jh);
List<SjZjyFdsj> zjyFdsjList = sjZjyFdsjMapper.selectSjZjyFdsjList(sjZjyFdsj);
dataModel.put("zjyFdsjList", zjyFdsjList);
SjZjyCljl sjZjyCljl =new SjZjyCljl();
sjZjyCljl.setJh(jh);
List<SjZjyCljl> zjyCljlList = sjZjyCljlMapper.selectSjZjyCljlList(sjZjyCljl);
for(int i=0;i<zjyCljlList.size();i++){
zjyCljlList.get(i).setNum(i+1);
}
dataModel.put("zjyCljlList", zjyCljlList);
SjZjyFdxnb sjZjyFdxnb= new SjZjyFdxnb(); private static List<SjFdsgcsDcyx> processAndDisplayDc(List<SjDcfxDzfc> stratumList,double kscs, double targetCs,String jh,String kc,List<SjJygjGdsjgdcs> sjJygjGdsjgdcsList) {
sjZjyFdxnb.setJh(jh);
List<SjZjyFdxnb> sjZjyFdxnbList = sjZjyFdxnbMapper.selectSjZjyFdxnbList(sjZjyFdxnb); List<SjFdsgcsDcyx> list =new ArrayList<>();
dataModel.put("sjZjyFdxnbList", sjZjyFdxnbList);
//套管柱
SjTgTgz sjTgTgz =new SjTgTgz(); System.out.println("名称\t井段垂深 / m");
sjTgTgz.setJh(jh);
List<SjTgTgz> sjTgTgzList = sjTgTgzMapper.selectSjTgTgzList(sjTgTgz); double previousDepth = kscs; // 从kscs开始计算
dataModel.put("sjTgTgzList", sjTgTgzList); boolean foundStartingPoint = false;
SjTgTgxnsj sjTgTgxnsj =new SjTgTgxnsj();
sjTgTgxnsj.setJh(jh); System.out.println("名称\t井段垂深 / m");
List<SjTgTgxnsj> tgxnsjList = sjTgTgxnsjMapper.selectSjTgTgxnsjList(sjTgTgxnsj);
dataModel.put("sjTgTgxnsjList", tgxnsjList); for (SjDcfxDzfc stratum : stratumList) {
SjTgTgqdjh sjTgTgqdjh =new SjTgTgqdjh(); double currentDepth = stratum.getCs();
sjTgTgqdjh.setJh(jh);
List<SjTgTgqdjh> sjTgTgqdjhList = sjTgTgqdjhMapper.selectSjTgTgqdjhList(sjTgTgqdjh);
dataModel.put("sjTgTgqdjhList", sjTgTgqdjhList);
SjZlyq sjZlyq =new SjZlyq(); // 如果还没找到起始点,且当前地层深度小于kscs,跳过
sjZlyq.setJh(jh); if (!foundStartingPoint && currentDepth < kscs) {
List<SjZlyq> sjZlyqList = sjZlyqMapper.selectSjZlyqList(sjZlyq); continue;
dataModel.put("sjZlyqList", sjZlyqList); }
SjZlyqZbyq sjZlyqZbyq =new SjZlyqZbyq();
sjZlyqZbyq.setJh(jh);
List<SjZlyqZbyq> sjZlyqZbyqList = sjZlyqZbyqMapper.selectSjZlyqZbyqList(sjZlyqZbyq);
dataModel.put("sjZlyqZbyqList", sjZlyqZbyqList);
SjZlyqXx sjZlyqXx =new SjZlyqXx();
sjZlyqXx.setJh(jh);
List<SjZlyqXx> sjZlyqXxList = sjZlyqXxMapper.selectSjZlyqXxList(sjZlyqXx);
if(sjZlyqXxList.size()>0){
SjZlyqXx item = sjZlyqXxList.get(0);
dataModel.put("gjzlyq",item.getGjzlyq());
dataModel.put("wcjjkzlyq",item.getWcjjkzlyq());
dataModel.put("yqcwrpdyq",item.getYqcwrpdyq());
}else {
dataModel.put("gjzlyq","");
dataModel.put("wcjjkzlyq","");
dataModel.put("yqcwrpdyq","");
}
//邻井 // 标记已找到起始点
SjLjjw sjLjjw =new SjLjjw(); foundStartingPoint = true;
sjLjjw.setJh(jh);
List<SjLjjw> sjLjjwList = sjLjjwMapper.selectSjLjjwList(sjLjjw);
dataModel.put("sjLjjwList", sjLjjwList);
SjZqfx sjZqfx =new SjZqfx();
sjZqfx.setJh(jh);
List<SjZqfx> sjZqfxList = sjZqfxMapper.selectSjZqfxList(sjZqfx);
dataModel.put("sjZqfxList", sjZqfxList);
SjZtgjsj sjZtgjsj =new SjZtgjsj();
sjZtgjsj.setJh(jh);
List<SjZtgjsj> sjZtgjsjList = sjZtgjsjMapper.selectSjZtgjsjList(sjZtgjsj);
dataModel.put("sjZtgjsjList", sjZtgjsjList);
SjQkztfx sjQkztfx =new SjQkztfx();
sjQkztfx.setJh(jh);
List<SjQkztfx> sjQkztfxList = sjQkztfxMapper.selectSjQkztfxList(sjQkztfx);
dataModel.put("sjQkztfxList", sjQkztfxList);
SjSzfxjg sjSzfxjg =new SjSzfxjg(); // 确定当前地层的显示结束深度
sjSzfxjg.setJh(jh); double endDepth = Math.min(currentDepth, targetCs);
List<SjSzfxjg> sjSzfxjgList = sjSzfxjgMapper.selectSjSzfxjgList(sjSzfxjg);
dataModel.put("sjSzfxjgList", sjSzfxjgList);
SjDcfxDzfc sjDcfxDzfc =new SjDcfxDzfc();
sjDcfxDzfc.setJh(jh);
List<SjDcfxDzfc> sjDcfxDzfcList = sjDcfxDzfcMapper.selectSjDcfxDzfcList(sjDcfxDzfc);
dataModel.put("sjDcfxDzfcList", sjDcfxDzfcList);
SjDcfxTsyx sjDcfxTsyx =new SjDcfxTsyx();
sjDcfxTsyx.setJh(jh);
List<SjDcfxTsyx> sjDcfxTsyxList = sjDcfxTsyxMapper.selectSjDcfxTsyxList(sjDcfxTsyx);
dataModel.put("sjDcfxTsyxList", sjDcfxTsyxList);
//
SjGztz sjGztz =new SjGztz();
sjGztz.setJh(jh);
List<SjGztz> gztzList = sjGztzMapper.selectSjGztzList(sjGztz);
List<String> jwtList = gztzList.stream().filter(it -> it.getGzlx().equals("井位图")).map(SjGztz::getLj).collect(Collectors.toList());
if(jwtList.size()>0){
List<Map<String, PictureRenderData>> pictureList = createPictureList(jwtList, 500, 600);
dataModel.put("jwtList", pictureList);
}else {
dataModel.put("jwtList", new ArrayList<>());
}
List<String> dzpmtList = gztzList.stream().filter(it -> it.getGzlx().equals("地震刨面图")).map(SjGztz::getLj).collect(Collectors.toList()); // 显示当前地层的范围
if(dzpmtList.size()>0){ System.out.printf("%s\t%.0f-%.0f%n",
List<Map<String, PictureRenderData>> pictureList = createPictureList(dzpmtList, 500, 600); stratum.getDzfc(), previousDepth, endDepth);
dataModel.put("dzpmtList", pictureList); SjFdsgcsDcyx sjFdsgcsDcyx = new SjFdsgcsDcyx();
}else { sjFdsgcsDcyx.setJh(jh);
dataModel.put("dzpmtList", new ArrayList<>()); sjFdsgcsDcyx.setKc(kc);
} sjFdsgcsDcyx.setDcmc(stratum.getDzfc());
sjFdsgcsDcyx.setJdcs(previousDepth + "-" + endDepth);
Double ksxs=getJs(sjJygjGdsjgdcsList,previousDepth);
Double jsxs=getJs(sjJygjGdsjgdcsList,endDepth);
sjFdsgcsDcyx.setJdxs(ksxs + "-" + jsxs);
sjFdsgcsDcyx.setYx(stratum.getYxts());
list.add(sjFdsgcsDcyx);
List<String> sylpmtList = gztzList.stream().filter(it -> it.getGzlx().equals("三压力刨面图")).map(SjGztz::getLj).collect(Collectors.toList()); // 更新上一个深度
if(sylpmtList.size()>0){ previousDepth = currentDepth;
List<Map<String, PictureRenderData>> pictureList = createPictureList(sylpmtList, 500, 600);
dataModel.put("sylpmtList", pictureList); // 如果当前地层已经超过cs参数,结束处理
}else { if (currentDepth >= targetCs) {
dataModel.put("sylpmtList", new ArrayList<>()); break;
}
} }
//计划周期 return list;
SjJhzq sjJhzq =new SjJhzq(); }
sjJhzq.setJh(jh);
List<SjJhzq> sjJhzqList = sjJhzqMapper.selectSjJhzqList(sjJhzq);
dataModel.put("sjJhzqList",sjJhzqList);
//H2s
SjH2s sjH2s =new SjH2s();
sjH2s.setJh(jh);
List<SjH2s> sjH2sList = sjH2sMapper.selectSjH2sList(sjH2s);
dataModel.put("sjH2sList",sjH2sList);
SjLjsm sjLjsm =new SjLjsm();
sjLjsm.setJh(jh);
List<SjLjsm> sjLjsmList = sjLjsmMapper.selectSjLjsmList(sjLjsm);
dataModel.put("sjLjsmList",sjLjsmList);
SjZysx sjZysx =new SjZysx();
sjZysx.setJh(jh);
List<SjZysx> sjZysxList = sjZysxMapper.selectSjZysxList(sjZysx);
SjZysx h2S = sjZysxList.stream().filter(it -> it.getLb().equals("H2S")).findFirst().orElse(null);
if(h2S!=null){
dataModel.put("h2S",h2S.getZysx());
}else {
dataModel.put("h2S","");
}
SjZysx plqt = sjZysxList.stream().filter(it -> it.getLb().equals("喷漏卡塌")).findFirst().orElse(null); private static List<SjFdfx> processAndDisplayFd(List<SjDcfxDzfc> stratumList,double kscs, double targetCs,String jh,String kc,List<SjJygjGdsjgdcs> sjJygjGdsjgdcsList,Long id) {
if(plqt!=null){
dataModel.put("plqt",plqt.getZysx());
}else {
dataModel.put("plqt","");
}
SjZysx tsyxfx = sjZysxList.stream().filter(it -> it.getLb().equals("特殊岩性风险")).findFirst().orElse(null); List<SjFdfx> list =new ArrayList<>();
if(tsyxfx!=null){
dataModel.put("tsyxfx",tsyxfx.getZysx());
}else { System.out.println("名称\t井段垂深 / m");
dataModel.put("tsyxfx","");
} double previousDepth = kscs; // 从kscs开始计算
SjZysx fpfx = sjZysxList.stream().filter(it -> it.getLb().equals("邻井扫描")).findFirst().orElse(null); boolean foundStartingPoint = false;
if(fpfx!=null){
dataModel.put("fpfx",fpfx.getZysx()); System.out.println("名称\t井段垂深 / m");
}else {
dataModel.put("fpfx",""); for (SjDcfxDzfc stratum : stratumList) {
} double currentDepth = stratum.getCs();
//施工概要
SjSggyGjsbxnyq sjSggyGjsbxnyq =new SjSggyGjsbxnyq(); // 如果还没找到起始点,且当前地层深度小于kscs,跳过
sjSggyGjsbxnyq.setJh(jh); if (!foundStartingPoint && currentDepth < kscs) {
List<SjSggyGjsbxnyq> sjSggyGjsbxnyqList = sjSggyGjsbxnyqMapper.selectSjSggyGjsbxnyqList(sjSggyGjsbxnyq); continue;
if(sjSggyGjsbxnyqList.size()>0){ }
SjSggyGjsbxnyq gjsbxnyq = sjSggyGjsbxnyqList.get(0);
dataModel.put("sjyh",gjsbxnyq.getSjyh()); // 标记已找到起始点
dataModel.put("zjxh", gjsbxnyq.getZjxh()); foundStartingPoint = true;
dataModel.put("wddy", gjsbxnyq.getWddy());
dataModel.put("dkwdscgl", gjsbxnyq.getDkwdscgl()); // 确定当前地层的显示结束深度
dataModel.put("zjnlZjlx", gjsbxnyq.getZjnlZjlx()); double endDepth = Math.min(currentDepth, targetCs);
dataModel.put("zjnlZdcsll", gjsbxnyq.getZjnlZdcsll()); SjFdfx sjFdfx = new SjFdfx();
dataModel.put("zjnlZgcsby", gjsbxnyq.getZjnlZgcsby()); sjFdfx.setZbid(id);
dataModel.put("xzxtDdzp", gjsbxnyq.getXzxtDdzp()); sjFdfx.setJh(jh);
dataModel.put("xzxtDq", gjsbxnyq.getXzxtDq()); sjFdfx.setKc(kc);
dataModel.put("xhxtB1lx", gjsbxnyq.getXhxtB1lx()); sjFdfx.setDzfc(stratum.getDzfc());
dataModel.put("xhxtB1xh", gjsbxnyq.getXhxtB1xh()); sjFdfx.setCs(endDepth);
dataModel.put("xhxtB1zdgl", gjsbxnyq.getXhxtB1zdgl()); //计算斜深
dataModel.put("xhxtB2lx", gjsbxnyq.getXhxtB2lx()); sjFdfx.setXs(getJs(sjJygjGdsjgdcsList,endDepth));
dataModel.put("xhxtB2xh", gjsbxnyq.getXhxtB2xh()); sjFdfx.setYxts(stratum.getYxts());
dataModel.put("xhxtB2zdgl", gjsbxnyq.getXhxtB2zdgl()); sjFdfx.setYqsts(stratum.getYqsts());
dataModel.put("xhxtB3lx", gjsbxnyq.getXhxtB3lx()); sjFdfx.setGzts(stratum.getGzts());
dataModel.put("xhxtB3xh", gjsbxnyq.getXhxtB3xh()); list.add(sjFdfx);
dataModel.put("xhxtB3zdgl", gjsbxnyq.getXhxtB3zdgl());
dataModel.put("gksbZdslx", gjsbxnyq.getGksbZdslx()); // 更新上一个深度
dataModel.put("gksbLxj1lx", gjsbxnyq.getGksbLxj1lx()); previousDepth = currentDepth;
dataModel.put("gksbLxj1zdjgl", gjsbxnyq.getGksbLxj1zdjgl());
dataModel.put("gksbLxj2lx", gjsbxnyq.getGksbLxj2lx()); // 如果当前地层已经超过cs参数,结束处理
dataModel.put("gksbLxj2zdjgl", gjsbxnyq.getGksbLxj2zdjgl()); if (currentDepth >= targetCs) {
dataModel.put("gksbLxj3lx", gjsbxnyq.getGksbLxj3lx()); break;
dataModel.put("gksbLxj3zdjgl", gjsbxnyq.getGksbLxj3zdjgl()); }
dataModel.put("xhgSl", gjsbxnyq.getXhgSl());
dataModel.put("xhgZrl", gjsbxnyq.getXhgZrl());
dataModel.put("cbgSl", gjsbxnyq.getCbgSl());
dataModel.put("cbgZrl", gjsbxnyq.getCbgZrl());
}else {
dataModel.put("sjyh","");
dataModel.put("zjxh", "");
dataModel.put("wddy", "");
dataModel.put("dkwdscgl", "");
dataModel.put("zjnlZjlx", "");
dataModel.put("zjnlZdcsll", "");
dataModel.put("zjnlZgcsby", "");
dataModel.put("xzxtDdzp", "");
dataModel.put("xzxtDq", "");
dataModel.put("xhxtB1lx", "");
dataModel.put("xhxtB1xh", "");
dataModel.put("xhxtB1zdgl", "");
dataModel.put("xhxtB2lx", "");
dataModel.put("xhxtB2xh", "");
dataModel.put("xhxtB2zdgl", "");
dataModel.put("xhxtB3lx", "");
dataModel.put("xhxtB3xh", "");
dataModel.put("xhxtB3zdgl", "");
dataModel.put("gksbZdslx", "");
dataModel.put("gksbLxj1lx", "");
dataModel.put("gksbLxj1zdjgl", "");
dataModel.put("gksbLxj2lx", "");
dataModel.put("gksbLxj2zdjgl", "");
dataModel.put("gksbLxj3lx", "");
dataModel.put("gksbLxj3zdjgl", "");
dataModel.put("xhgSl", "");
dataModel.put("xhgZrl", "");
dataModel.put("cbgSl", "");
dataModel.put("cbgZrl", "");
} }
SjSggyZjzhcs sjSggyZjzhcs =new SjSggyZjzhcs(); return list;
sjSggyZjzhcs.setJh(jh); }
List<SjSggyZjzhcs> sjSggyZjzhcsList = sjSggyZjzhcsMapper.selectSjSggyZjzhcsList(sjSggyZjzhcs);
dataModel.put("sjSggyZjzhcsList",sjSggyZjzhcsList);
SjSggyZjyFdxnb sjSggyZjyFdxnb =new SjSggyZjyFdxnb();
sjSggyZjyFdxnb.setJh(jh);
List<SjSggyZjyFdxnb> sjSggyZjyFdxnbList = sjSggyZjyFdxnbMapper.selectSjSggyZjyFdxnbList(sjSggyZjyFdxnb);
dataModel.put("sjSggyZjyFdxnbList",sjSggyZjyFdxnbList);
SjSggyZjyFdsj sjSggyZjyFdsj =new SjSggyZjyFdsj();
sjSggyZjyFdsj.setJh(jh);
List<SjSggyZjyFdsj> sjSggyZjyFdsjList = sjSggyZjyFdsjMapper.selectSjSggyZjyFdsjList(sjSggyZjyFdsj);
dataModel.put("sjSggyZjyFdsjList",sjSggyZjyFdsjList);
SjSggyZjyCljl sjSggyZjyCljl =new SjSggyZjyCljl();
sjSggyZjyCljl.setJh(jh);
List<SjSggyZjyCljl> sjSggyZjyCljlList = sjSggyZjyCljlMapper.selectSjSggyZjyCljlList(sjSggyZjyCljl);
dataModel.put("sjSggyZjyCljlList",sjSggyZjyCljlList);
SjJkzp sjJkzp =new SjJkzp();
sjJkzp.setJh(jh);
List<SjJkzp> sjJkzpList = sjJkzpMapper.selectSjJkzpList(sjJkzp);
if(sjJkzpList.size()>0){
SjJkzp sjJkzp1 = sjJkzpList.get(0);
dataModel.put("zjkzz", sjJkzp1.getZjkzz());
dataModel.put("jlgh", sjJkzp1.getJlgh());
dataModel.put("syyq", sjJkzp1.getSyyq());
dataModel.put("clcb", sjJkzp1.getClcb());
}else {
dataModel.put("zjkzz", sjJkzp.getZjkzz());
dataModel.put("jlgh", sjJkzp.getJlgh());
dataModel.put("syyq", sjJkzp.getSyyq());
dataModel.put("clcb", sjJkzp.getClcb());
}
SjHse sjHse =new SjHse();
sjHse.setJh(jh);
List<SjHse> sjHseList = sjHseMapper.selectSjHseList(sjHse);
if(sjHseList.size()>0){
SjHse sjHse1 = sjHseList.get(0);
dataModel.put("hse", sjHse1.getHse());
}else {
dataModel.put("hse", sjHse.getHse());
}
SjFl sjFl =new SjFl();
sjFl.setJh(jh);
List<SjFl> sjFlList = sjFlMapper.selectSjFlList(sjFl);
if(sjFlList.size()>0){
SjFl sjFl1 = sjFlList.get(0);
dataModel.put("yjlxfs", sjFl1.getYjlxfs());
dataModel.put("yfgkcs", sjFl1.getYfgkcs());
dataModel.put("wjsgcs", sjFl1.getWjsgcs());
dataModel.put("syzn", sjFl1.getSyzn());
dataModel.put("tsyxzs", sjFl1.getTsyxzs());
}else {
dataModel.put("yjlxfs", sjFl.getYjlxfs());
dataModel.put("yfgkcs", sjFl.getYfgkcs());
dataModel.put("wjsgcs", sjFl.getWjsgcs());
dataModel.put("syzn", sjFl.getSyzn());
dataModel.put("tsyxzs", sjFl.getTsyxzs());
}
List<Map<String, Object>> fdsgcsList =new ArrayList<>();
for(int i=0;i<sjJsjgList.size();i++){ public static double getCs(List<SjJygjGdsjgdcs> yjMnJygjJgList, double js){
SjJsjg sjJsjg1 = sjJsjgList.get(i);
String num=""; DecimalFormat df = new DecimalFormat("#.00");
if(i==0){
num="(一) "; double cs=0;
}else if(i==1){ for (int i=0;i<yjMnJygjJgList.size();i++){
num="(二) "; SjJygjGdsjgdcs jg=yjMnJygjJgList.get(i);
}else if(i==2){ double sd=jg.getJs();
num="(三) "; if (sd>=js){
}else if(i==3){ if (i == 0){
num="(四) "; cs=yjMnJygjJgList.get(i).getJs();
}else if(i==4){ break;
num="(五) "; }else {
}else if(i==5){
num="(六) ";
}else if(i==6){ // 找到md所在的区间
num="(七) "; // SurveyPoint prev = surveyPoints.get(i-1);
}else if(i==7){ // SurveyPoint curr = surveyPoints.get(i);
num="(八) "; // double md; // 斜深(Measured Depth),单位:米
} // double inc; // 井斜角(Inclination),单位:度
String kc = sjJsjg1.getKc(); // double azim; // 方位角(Azimuth),单位:度
Map<String, Object> map = new HashMap<>(); // double tvd; // 垂深(True Vertical Depth),单位:米
map.put("kc",num+ kc+"施工措施:"); // double northing; // 北向坐标
SjFdsgcs sjFdsgcs =new SjFdsgcs(); // double easting; // 东向坐标
sjFdsgcs.setJh(jh); // 线性插值计算垂深
sjFdsgcs.setKc(kc); double ratio = (js - yjMnJygjJgList.get(i-1).getJs()) / (yjMnJygjJgList.get(i).getJs() - yjMnJygjJgList.get(i-1).getJs());
List<SjFdsgcs> sjFdsgcsList= sjFdsgcsMapper.selectSjFdsgcsList(sjFdsgcs); cs= yjMnJygjJgList.get(i-1).getCs() + ratio * (yjMnJygjJgList.get(i).getCs() -yjMnJygjJgList.get(i-1).getCs());
SjFdsgcs sjFdsgcs1 = sjFdsgcsList.get(0); break;
map.put("tzqk", sjFdsgcs1.getTzqk()); }
map.put("jdqk", sjFdsgcs1.getJdqk());
map.put("gjfx", sjFdsgcs1.getGjfx());
map.put("gjyh", sjFdsgcs1.getGjyh());
map.put("dcyl", sjFdsgcs1.getDcyl());
map.put("zyfx", sjFdsgcs1.getZyfx());
map.put("fxgkcs", sjFdsgcs1.getFxgkcs());
map.put("zjzh", sjFdsgcs1.getZjzh());
map.put("zjzhzysx", sjFdsgcs1.getZjzhzysx());
map.put("zjycs", sjFdsgcs1.getZjycs());
map.put("zjgccs", sjFdsgcs1.getZjgccs());
//特殊工具
SjFdsgcsTsgj sjFdsgcsTsgj =new SjFdsgcsTsgj();
sjFdsgcsTsgj.setJh(jh);
sjFdsgcsTsgj.setKc(kc);
List<SjFdsgcsTsgj> sjFdsgcsTsgjList = sjFdsgcsTsgjMapper.selectSjFdsgcsTsgjList(sjFdsgcsTsgj);
if(sjFdsgcsTsgjList.size()==0){
SjFdsgcsTsgj sjFdsgcsTsgj1 =new SjFdsgcsTsgj();
sjFdsgcsTsgj1.setJh("-");
sjFdsgcsTsgj1.setKc("-");
sjFdsgcsTsgj1.setGgxh("-");
sjFdsgcsTsgj1.setGjmc("-");
sjFdsgcsTsgj1.setGgxh("-");
sjFdsgcsTsgj1.setSl("-");
sjFdsgcsTsgj1.setYqxg("-");
sjFdsgcsTsgj1.setYjazwz("-");
sjFdsgcsTsgj1.setXnzb("-");
sjFdsgcsTsgj1.setRemark("-");
} }
map.put("sjFdsgcsTsgjList", sjFdsgcsTsgjList);
SjZtxx sjZtxx=new SjZtxx();
sjZtxx.setJh(jh);
sjZtxx.setKc(kc);
List<SjZtxx> sjZtxxList = sjZtxxMapper.selectSjZtxxList(sjZtxx);
SjZtxx sjZtxx1 = sjZtxxList.get(0);
map.put("ztxh", sjZtxx1.getZtxh());
SjFdsgcsDcyx sjFdsgcsDcyx =new SjFdsgcsDcyx();
sjFdsgcsDcyx.setJh(jh);
sjFdsgcsDcyx.setKc(kc);
List<SjFdsgcsDcyx> sjFdsgcsDcyxList = sjFdsgcsDcyxMapper.selectSjFdsgcsDcyxList(sjFdsgcsDcyx);
map.put("sjFdsgcsDcyxList", sjFdsgcsDcyxList);
SjLjtjzt sjLjtjzt =new SjLjtjzt();
sjLjtjzt.setJh(jh);
sjLjtjzt.setKc(kc);
List<SjLjtjzt> sjLjtjztList = sjLjtjztMapper.selectSjLjtjztList(sjLjtjzt);
map.put("sjLjtjztList", sjLjtjztList);
SjZtcsxx sjZtcsxx =new SjZtcsxx();
sjZtcsxx.setJh(jh);
sjZtcsxx.setKc(kc);
List<SjZtcsxx> sjZtcsxxList = sjZtcsxxMapper.selectSjZtcsxxList(sjZtcsxx);
map.put("sjZtcsxxList", sjZtcsxxList);
SjZjcsxx sjZjcsxx =new SjZjcsxx();
sjZjcsxx.setJh(jh);
sjZjcsxx.setKc(kc);
List<SjZjcsxx> sjZjcsxxList = sjZjcsxxMapper.selectSjZjcsxxList(sjZjcsxx);
SjZjcsxx sjZjcsxx1 = sjZjcsxxList.get(0);
map.put("zjpl", sjZjcsxx1.getZjpl());
map.put("zjzy", sjZjcsxx1.getZjzy());
map.put("zjzs", sjZjcsxx1.getZjzs());
SjFdsgcsZjyFdxnb sjFdsgcsZjyFdxnb =new SjFdsgcsZjyFdxnb();
sjFdsgcsZjyFdxnb.setJh(jh);
sjFdsgcsZjyFdxnb.setKc(kc);
List<SjFdsgcsZjyFdxnb> sjFdsgcsZjyFdxnbList = sjFdsgcsZjyFdxnbMapper.selectSjFdsgcsZjyFdxnbList(sjFdsgcsZjyFdxnb);
map.put("sjFdsgcsZjyFdxnbList", sjFdsgcsZjyFdxnbList);
fdsgcsList.add(map);
} }
dataModel.put("fdsgcsList", fdsgcsList); return Double.parseDouble(df.format(cs));
}
public static double getJs(List<SjJygjGdsjgdcs> yjMnJygjJgList, double cs) {
// 创建DecimalFormat对象,用于保留两位小数
DecimalFormat df = new DecimalFormat("#.00");
double js = 0;
// 遍历所有数据点
for (int i = 0; i < yjMnJygjJgList.size(); i++) {
SjJygjGdsjgdcs jg = yjMnJygjJgList.get(i);
double currentCs = jg.getCs();
// 找到垂深大于等于目标垂深的点
if (currentCs >= cs) {
// 如果是第一个点,直接返回该点的斜深
if (i == 0) {
js = yjMnJygjJgList.get(i).getJs();
break;
} else {
// 找到目标垂深所在的区间,进行线性插值计算斜深
double prevCs = yjMnJygjJgList.get(i-1).getCs();
double prevJs = yjMnJygjJgList.get(i-1).getJs();
double currJs = yjMnJygjJgList.get(i).getJs();
// 计算插值比例
double ratio = (cs - prevCs) / (currentCs - prevCs);
// 线性插值计算斜深
js = prevJs + ratio * (currJs - prevJs);
break;
}
}
}
return dataModel; // 格式化结果并返回
return Double.parseDouble(df.format(js));
} }
public static String extractNumber(String str) {
// 正则表达式:匹配-或~,然后捕获后面的数字
Pattern pattern = Pattern.compile("[\\-~](\\d+)");
Matcher matcher = pattern.matcher(str);
if (matcher.find()) {
// 返回第一个捕获组的内容(即数字部分)
return matcher.group(1);
}
return null; // 如果没有匹配到,返回null
}
private Map<String, PictureRenderData> createPictureMap(String pictureName, int width, int height) { private Map<String, PictureRenderData> createPictureMap(String pictureName, int width, int height) {
Map<String, PictureRenderData> map = new HashMap<>(); Map<String, PictureRenderData> map = new HashMap<>();
String filePath = RuoYiConfig.getUploadPath(); String filePath = RuoYiConfig.getUploadPath();
...@@ -2780,6 +2848,24 @@ public class SjDjjcController extends BaseController ...@@ -2780,6 +2848,24 @@ public class SjDjjcController extends BaseController
return map; return map;
} }
private PictureRenderData createPictureMap2(String pictureName, int width, int height) {
Map<String, PictureRenderData> map = new HashMap<>();
String filePath = RuoYiConfig.getUploadPath();
String lj = pictureName.replaceAll("/profile/upload", "");
String path=filePath + lj;
File file =new File(path);
if(!file.exists()){
return null;
}
//创建PictureRenderData对象并设置其大小
//Pictures还有其他方法,如Pictures.ofStream()流处理,可根据自己的需求及文档替换
PictureRenderData pictureRenderData = Pictures.ofLocal(path).size(width, height).create();
return pictureRenderData;
}
private List<Map<String, PictureRenderData>> createPictureList(List<String> imgList,int width, int height) { private List<Map<String, PictureRenderData>> createPictureList(List<String> imgList,int width, int height) {
List<Map<String, PictureRenderData>> list = new ArrayList<>(); List<Map<String, PictureRenderData>> list = new ArrayList<>();
for(String lj:imgList ){ for(String lj:imgList ){
......
...@@ -38,6 +38,8 @@ public class Mxfxjgb extends BaseEntity ...@@ -38,6 +38,8 @@ public class Mxfxjgb extends BaseEntity
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date rwsj; private Date rwsj;
//任务内容
private String rwnr;
/** 解析状态 */ /** 解析状态 */
@Excel(name = "解析状态") @Excel(name = "解析状态")
...@@ -64,4 +66,6 @@ public class Mxfxjgb extends BaseEntity ...@@ -64,4 +66,6 @@ public class Mxfxjgb extends BaseEntity
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createdTime; private Date createdTime;
private Long jobid;
} }
...@@ -83,8 +83,10 @@ public class SjDjjc extends BaseEntity ...@@ -83,8 +83,10 @@ public class SjDjjc extends BaseEntity
private String zjgs; private String zjgs;
/** 钻井队 */ /** 钻井队 */
@Excel(name = "钻井队")
private String zjd; private String zjd;
@Excel(name = "钻井队")
private String zjdmc;
/** 井底横坐标 */ /** 井底横坐标 */
@Excel(name = "井底横坐标") @Excel(name = "井底横坐标")
......
package com.zjsgfa.project.zjsgfa.service; package com.zjsgfa.project.zjsgfa.service;
import java.util.List; import java.util.List;
import com.zjsgfa.common.exception.job.TaskException;
import com.zjsgfa.project.zjsgfa.domain.Mxfxjgb; import com.zjsgfa.project.zjsgfa.domain.Mxfxjgb;
import org.quartz.SchedulerException;
/** /**
* 大模型分析Service接口 * 大模型分析Service接口
...@@ -33,7 +36,7 @@ public interface IMxfxjgbService ...@@ -33,7 +36,7 @@ public interface IMxfxjgbService
* @param mxfxjgb 大模型分析 * @param mxfxjgb 大模型分析
* @return 结果 * @return 结果
*/ */
public int insertMxfxjgb(Mxfxjgb mxfxjgb); public int insertMxfxjgb(Mxfxjgb mxfxjgb) throws SchedulerException, TaskException;
/** /**
* 修改大模型分析 * 修改大模型分析
......
package com.zjsgfa.project.zjsgfa.service.impl; package com.zjsgfa.project.zjsgfa.service.impl;
import java.util.List; import java.util.List;
import com.zjsgfa.common.exception.job.TaskException;
import com.zjsgfa.common.utils.DateUtils; import com.zjsgfa.common.utils.DateUtils;
import com.zjsgfa.project.monitor.domain.SysJob;
import com.zjsgfa.project.monitor.service.ISysJobService;
import org.quartz.SchedulerException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.zjsgfa.project.zjsgfa.mapper.MxfxjgbMapper; import com.zjsgfa.project.zjsgfa.mapper.MxfxjgbMapper;
import com.zjsgfa.project.zjsgfa.domain.Mxfxjgb; import com.zjsgfa.project.zjsgfa.domain.Mxfxjgb;
import com.zjsgfa.project.zjsgfa.service.IMxfxjgbService; import com.zjsgfa.project.zjsgfa.service.IMxfxjgbService;
import org.springframework.transaction.annotation.Transactional;
/** /**
* 大模型分析Service业务层处理 * 大模型分析Service业务层处理
...@@ -20,6 +26,9 @@ public class MxfxjgbServiceImpl implements IMxfxjgbService ...@@ -20,6 +26,9 @@ public class MxfxjgbServiceImpl implements IMxfxjgbService
@Autowired @Autowired
private MxfxjgbMapper mxfxjgbMapper; private MxfxjgbMapper mxfxjgbMapper;
@Autowired
private ISysJobService jobService;
/** /**
* 查询大模型分析 * 查询大模型分析
* *
...@@ -51,9 +60,22 @@ public class MxfxjgbServiceImpl implements IMxfxjgbService ...@@ -51,9 +60,22 @@ public class MxfxjgbServiceImpl implements IMxfxjgbService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int insertMxfxjgb(Mxfxjgb mxfxjgb) @Transactional(rollbackFor = Exception.class)
{ public int insertMxfxjgb(Mxfxjgb mxfxjgb) throws SchedulerException, TaskException {
return mxfxjgbMapper.insertMxfxjgb(mxfxjgb); int i = mxfxjgbMapper.insertMxfxjgb(mxfxjgb);
if (i > 0) {
SysJob sysJob =new SysJob();
sysJob.setJobName(mxfxjgb.getRwmc());
sysJob.setJobGroup("DEFAULT");
sysJob.setInvokeTarget("mxdyTask.ryParams("+mxfxjgb.getId()+"L)");
sysJob.setCronExpression("0 0 * * * ?");
sysJob.setMisfirePolicy("2");
sysJob.setConcurrent("0");
sysJob.setStatus("0");
jobService.insertJob(sysJob);
mxfxjgb.setJobid(sysJob.getJobId());
}
return i;
} }
/** /**
......
...@@ -396,8 +396,8 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService ...@@ -396,8 +396,8 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
} }
} }
} }
sjFdsgcs.setZjgccs(zjgccs); // sjFdsgcs.setZjgccs(zjgccs);
sjFdsgcs.setZjycs(zjycs); // sjFdsgcs.setZjycs(zjycs);
if (zyfx.endsWith("<p>邻井风险<p>")){ if (zyfx.endsWith("<p>邻井风险<p>")){
zyfx=zyfx.replace("<p>邻井风险<p>",""); zyfx=zyfx.replace("<p>邻井风险<p>","");
} }
...@@ -491,8 +491,8 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService ...@@ -491,8 +491,8 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
} }
} }
} }
sjFdsgcs1.setZjgccs(zjgccs); // sjFdsgcs1.setZjgccs(zjgccs);
sjFdsgcs1.setZjycs(zjycs); // sjFdsgcs1.setZjycs(zjycs);
sjFdsgcs1.setFxgkcs(fxgkcs); sjFdsgcs1.setFxgkcs(fxgkcs);
sjFdsgcs1.setZyfx(zyfx); sjFdsgcs1.setZyfx(zyfx);
String join = ""; String join = "";
......
...@@ -18,10 +18,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -18,10 +18,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createdTime" column="created_time" /> <result property="createdTime" column="created_time" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="rwnr" column="rwnr" />
<result property="jobid" column="jobid" />
</resultMap> </resultMap>
<sql id="selectMxfxjgbVo"> <sql id="selectMxfxjgbVo">
select id, mklx, rwlx, rwmc, rwsj, jxzt, fhjg, url, bz, created_by, created_time, update_by, update_time from mxfxjgb select id, mklx, rwlx, rwmc, rwsj, jxzt, fhjg, url, bz, created_by, created_time, update_by, update_time,rwnr,jobid from mxfxjgb
</sql> </sql>
<select id="selectMxfxjgbList" parameterType="Mxfxjgb" resultMap="MxfxjgbResult"> <select id="selectMxfxjgbList" parameterType="Mxfxjgb" resultMap="MxfxjgbResult">
...@@ -37,7 +39,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -37,7 +39,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="bz != null and bz != ''"> and bz = #{bz}</if> <if test="bz != null and bz != ''"> and bz = #{bz}</if>
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if> <if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
<if test="createdTime != null "> and created_time = #{createdTime}</if> <if test="createdTime != null "> and created_time = #{createdTime}</if>
<if test="jobid != null "> and jobid = #{jobid}</if>
</where> </where>
order by created_time desc
</select> </select>
<select id="selectMxfxjgbById" parameterType="Long" resultMap="MxfxjgbResult"> <select id="selectMxfxjgbById" parameterType="Long" resultMap="MxfxjgbResult">
...@@ -60,6 +64,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -60,6 +64,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createdTime != null">created_time,</if> <if test="createdTime != null">created_time,</if>
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="rwnr != null">rwnr,</if>
<if test="jobid != null">jobid,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="mklx != null">#{mklx},</if> <if test="mklx != null">#{mklx},</if>
...@@ -74,6 +80,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -74,6 +80,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createdTime != null">#{createdTime},</if> <if test="createdTime != null">#{createdTime},</if>
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="rwnr != null">#{rwnr},</if>
<if test="jobid != null">#{jobid},</if>
</trim> </trim>
</insert> </insert>
...@@ -92,6 +100,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -92,6 +100,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createdTime != null">created_time = #{createdTime},</if> <if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="rwnr != null">rwnr = #{rwnr},</if>
<if test="jobid != null">jobid = #{jobid},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
......
...@@ -40,7 +40,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -40,7 +40,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectSjDjjcVo"> <sql id="selectSjDjjcVo">
select id, jh, jb, jx, jkhzb, jkzzb, gzwz, wzcw, ztmd, wzyz, wjfa, created_by, created_time, update_by, update_time, zjgs, zjd, jdhzb, jdzzb, zt, qk, sjzt, ljzlzt, dzfxzt, fxtszt, sggyzt, fdsgzt, jkzt, hsezt, jhjdzt, flzt, faid from sj_djjc select a.id,
jh,
jb,
jx,
jkhzb,
jkzzb,
gzwz,
wzcw,
ztmd,
wzyz,
wjfa,
a.created_by,
a.created_time,
a.update_by,
a.update_time,
a.zjgs,
a.zjd,
b.zjjd zjdmc,
jdhzb,
jdzzb,
zt,
qk,
sjzt,
ljzlzt,
dzfxzt,
fxtszt,
sggyzt,
fdsgzt,
jkzt,
hsezt,
jhjdzt,
flzt,
faid
from sj_djjc a left join jcxx_jdxx b on a.zjd=b.id
</sql> </sql>
<select id="selectSjDjjcList" parameterType="SjDjjc" resultMap="SjDjjcResult"> <select id="selectSjDjjcList" parameterType="SjDjjc" resultMap="SjDjjcResult">
...@@ -75,16 +108,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -75,16 +108,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="jhjdzt != null and jhjdzt != ''"> and jhjdzt = #{jhjdzt}</if> <if test="jhjdzt != null and jhjdzt != ''"> and jhjdzt = #{jhjdzt}</if>
<if test="flzt != null and flzt != ''"> and flzt = #{flzt}</if> <if test="flzt != null and flzt != ''"> and flzt = #{flzt}</if>
</where> </where>
order by created_time desc order by a.created_time desc
</select> </select>
<select id="selectSjDjjcById" parameterType="Long" resultMap="SjDjjcResult"> <select id="selectSjDjjcById" parameterType="Long" resultMap="SjDjjcResult">
<include refid="selectSjDjjcVo"/> <include refid="selectSjDjjcVo"/>
where id = #{id} where a.id = #{id}
</select> </select>
<select id="selectSjDjjcByJh" resultType="com.zjsgfa.project.zjsgfa.domain.SjDjjc"> <select id="selectSjDjjcByJh" resultType="com.zjsgfa.project.zjsgfa.domain.SjDjjc">
<include refid="selectSjDjjcVo"/> <include refid="selectSjDjjcVo"/>
where jh = #{jh} where a.jh = #{jh}
</select> </select>
<insert id="insertSjDjjc" parameterType="SjDjjc" useGeneratedKeys="true" keyProperty="id"> <insert id="insertSjDjjc" parameterType="SjDjjc" useGeneratedKeys="true" keyProperty="id">
......
...@@ -134,7 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -134,7 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getDjjcList" resultType="com.zjsgfa.project.zt.domain.Djjc"> <select id="getDjjcList" resultType="com.zjsgfa.project.zt.domain.Djjc">
select a.jh,a.jdhzb,a.jdzzb,to_char(b.WJRQ,'YYYY-MM-DD') wjrq,c.kc,c.jd,ksjs,c.JS,xh, select a.jh,a.jdhzb,a.jdzzb,to_char(b.WJRQ,'YYYY-MM-DD') wjrq,c.kc,d.QSJS ||'-' || d.ZZJS jd,ksjs,c.JS,xh,
SZDC cw, SZDC cw,
JC, JC,
jxzs, jxzs,
...@@ -192,7 +192,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -192,7 +192,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
Qzyy, Qzyy,
zzjs, zzjs,
ROUND(jc / case when (JCSJHJ / 24) =0 then 1 else (JCSJHJ / 24) end , 2) zb ROUND(jc / case when (JCSJHJ / 24) =0 then 1 else (JCSJHJ / 24) end , 2) zb
,pl,LGBY,cc ,pl,LGBY,cc,QSJS
from JSHA from JSHA
order by xh order by xh
......
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