Commit 52706ea7 by jiang'yun

修改

parent a7bafbff
package com.ruoyi.framework.task;
import com.ruoyi.project.zt.domain.CommonParam;
import com.ruoyi.project.zt.service.DjdcService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.annotation.AccessType;
import org.springframework.stereotype.Component;
import com.ruoyi.common.utils.StringUtils;
......@@ -11,6 +15,11 @@ import com.ruoyi.common.utils.StringUtils;
@Component("ryTask")
public class RyTask
{
@Autowired
DjdcService djdcService;
public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i)
{
System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i));
......@@ -25,4 +34,13 @@ public class RyTask
{
System.out.println("执行无参方法");
}
public void dyAiModelJxZjzh(){
System.out.println("执行方法dyAiModelJxZjzh");
djdcService.dyAiModelJxZjzh(new CommonParam());
}
}
......@@ -3,14 +3,12 @@ package com.ruoyi.project.zt.controller;
import cn.hutool.http.HttpRequest;
import com.google.gson.*;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.zt.domain.CommonParam;
import com.ruoyi.project.zt.domain.DjDcInfo;
import com.ruoyi.project.zt.domain.Djjc;
import com.ruoyi.project.zt.domain.Ljinfo;
import com.ruoyi.project.zt.domain.*;
import com.ruoyi.project.zt.service.DjdcService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -47,7 +45,7 @@ public class DjdcController {
* 获取井基础信息
*/
@PostMapping("/api")
public AjaxResult ff(@RequestBody CommonParam param) throws Exception{
public Object ff(@RequestBody CommonParam param) throws Exception{
String path = param.getPath();
Map<String,Object> map =new HashMap<>();
switch (path) {
......@@ -56,13 +54,17 @@ public class DjdcController {
map.put("jh","井号");
map.put("kc","开次");
map.put("jd","井段");
map.put("cw","层位");
map.put("jc","进尺");
map.put("jxzs","机械钻速");
map.put("ztcc","钻头外径");
map.put("ztxh","钻头型号");
map.put("pz","喷嘴");
map.put("mxqk","磨损情况");
map.put("qzyy","起钻原因");
map.put("cw","层位");
map.put("zjymd","钻井液密度");
map.put("lgby","泵压");
map.put("pl","排量");
map.put("jc","进尺");
map.put("jxzs","机械钻速");
map.put("zb","指标");
List<Djjc> djjcList = djdcService.getDjjcList(param);
AjaxResult success = AjaxResult.success(djjcList, map);
......@@ -78,13 +80,21 @@ public class DjdcController {
//获取邻井周期分析
map.put("jh","井号");
map.put("kc","开次");
map.put("cw","层位");
map.put("jtm","井筒名");
map.put("ksjs","开始井深");
map.put("js","结束井深");
map.put("jc","进尺");
map.put("zjzq","钻进周期");
map.put("zwzq","中完周期");
map.put("zjsl","钻进速率");
map.put("cw","到达层位");
map.put("zjzq","钻进实际周期");
map.put("zjycsl","钻进异常周期");
map.put("zjsczq","钻进生产周期");
map.put("zjsl","钻进速率");
map.put("zwzq","中完实际周期");
map.put("wjsczq","完井(中完)生产周期");
map.put("wjycsl","完井异常周期");
map.put("zjycms","钻井异常描述");
map.put("wjycms","中完(完井异常描述)");
return AjaxResult.success( djdcService.getZqshfxList(param),map);
case "getZjzhfxList":
//获取钻具组合分析
......@@ -100,25 +110,28 @@ public class DjdcController {
case "getLjjwList":
//获取邻近井位
map.put("jh","井号");
map.put("jkhzb","井口横坐标");
map.put("jkzzb","井口纵坐标");
map.put("jdhzb","井底横坐标");
map.put("jdzzb","井底纵坐标");
map.put("jx","井型");
map.put("jb","井别");
map.put("wjjs","井深");
map.put("wjczjs","垂深");
map.put("wzcw","完钻层位");
map.put("kc","开次");
map.put("wjzq","完井周期");
map.put("kc","总开次");
map.put("zjzq","钻井周期");
map.put("wjzq","完井周期");
map.put("jkhzb","井口横坐标");
map.put("jkzzb","井口纵坐标");
map.put("jkhjl","井口横距离");
map.put("jkzjl","井口纵距离");
map.put("jdhzb","井底横坐标");
map.put("jdzzb","井底纵坐标");
map.put("jkjl","井口距离");
map.put("jdjl","井底距离");
map.put("jkzjl","井口纵距离");
map.put("jkhjl","井口横距离");
map.put("jdzjl","井底纵距离");
map.put("jdhjl","井底横距离");
return AjaxResult.success( djdcService.getLjjwList(param),map);
List<Ljjw> ljjwList = djdcService.getLjjwList(param);
String md = listToMarkdownTable(ljjwList);
return md;
// return AjaxResult.success("",md,map);
case "getJsqaList":
//获取复杂情况
map.put("jh","井号");
......@@ -142,9 +155,9 @@ public class DjdcController {
map.put("ztsl","钻头数量(钻头使用频次)");
map.put("ytzl","一趟钻率");
map.put("etzl","二趟钻率");
map.put("stzl","三趟钻率");
map.put("sitzl","四趟钻率");
map.put("wtzl","五趟钻率");
// map.put("stzl","三趟钻率");
// map.put("sitzl","四趟钻率");
// map.put("wtzl","五趟钻率");
map.put("jcZw","进尺中位数");
map.put("jcMax","进尺最大值");
map.put("jxzsZw","机械钻速中位数");
......@@ -152,28 +165,123 @@ public class DjdcController {
map.put("qsjsZw","起出井深中位数");
return AjaxResult.success( djdcService.getDjZtfxList(param),map);
case "calZtzhdf":
//计算钻头综合得分
// map.put("kc","开次");
// map.put("ztxh","钻头型号");
// map.put("cc","外径");
// map.put("ztsl","钻头数量(钻头使用频次)");
// map.put("ytzl","一趟钻率");
// map.put("etzl","二趟钻率");
// map.put("stzl","三趟钻率");
// map.put("sitzl","四趟钻率");
// map.put("wtzl","五趟钻率");
// map.put("jcZw","进尺中位数");
// map.put("jcMax","进尺最大值");
// map.put("jxzsZw","机械钻速中位数");
// map.put("jxzsMax","机械钻速最大值");
// map.put("qsjsZw","起出井深中位数");
//计算钻头综合得分和实钻分析结果
return AjaxResult.success( djdcService.calZtzhdf(param));
case "getzhzhdfList":
//获取钻头综合得分
map.put("kc","开次");
map.put("ztxh","钻头型号");
map.put("cc","钻头尺寸");
map.put("jcdf","进尺得分");
map.put("jsdf","机速得分");
map.put("zbdf","指标得分");
map.put("sldf","数量得分");
map.put("zhdf","综合得分");
return AjaxResult.success( djdcService.getzhzhdfList(param),map);
case "getszfxjgList":
//获取实钻分析结果
map.put("gnmk","功能模块");
map.put("fxfw","分析范围");
map.put("fxdx","分析对象");
map.put("fxxy","分析现象");
map.put("fxjl","分析结论");
map.put("scfx","输出方向");
map.put("yxyj","优选依据");
map.put("zyjy","最优建议");
map.put("qcyj","其次建议");
map.put("tjpf","推荐评分");
map.put("xxcs","详细参数");
return AjaxResult.success( djdcService.getszfxjgList(param),map);
case "getZtzhzzdfList":
//获取钻头最终得分
map.put("kc","开次");
map.put("ztxh","钻头型号");
map.put("cc","钻头尺寸");
map.put("jcdf","进尺得分");
map.put("jsdf","机速得分");
// map.put("zbdf","指标得分");
// map.put("sldf","数量得分");
map.put("zhdf","综合得分");
return AjaxResult.success( djdcService.getZtzhzzdfList(param),map);
default:
return AjaxResult.success();
}
}
// 生成Markdown表格
public static String listToMarkdownTable(List<Ljjw> ljjwList) {
StringBuilder markdownTable = new StringBuilder();
// 获取Ljjw类的所有字段
Field[] fields = Ljjw.class.getDeclaredFields();
// 生成表头
markdownTable.append("|");
for (Field field : fields) {
}
markdownTable.append("井号".replace("|", "\\|")).append("|");
markdownTable.append("井口横坐标".replace("|", "\\|")).append("|");
markdownTable.append("井口纵坐标".replace("|", "\\|")).append("|");
markdownTable.append("井底横坐标".replace("|", "\\|")).append("|");
markdownTable.append("井底纵坐标".replace("|", "\\|")).append("|");
markdownTable.append("井型".replace("|", "\\|")).append("|");
markdownTable.append("井别".replace("|", "\\|")).append("|");
markdownTable.append("斜深".replace("|", "\\|")).append("|");
markdownTable.append("垂深".replace("|", "\\|")).append("|");
markdownTable.append("完钻层位".replace("|", "\\|")).append("|");
markdownTable.append("总开次".replace("|", "\\|")).append("|");
markdownTable.append("完井周期".replace("|", "\\|")).append("|");
markdownTable.append("钻井周期".replace("|", "\\|")).append("|");
markdownTable.append("井口距离".replace("|", "\\|")).append("|");
markdownTable.append("井底距离".replace("|", "\\|")).append("|");
markdownTable.append("井口纵距离".replace("|", "\\|")).append("|");
markdownTable.append("井口横距离".replace("|", "\\|")).append("|");
markdownTable.append("井底纵距离".replace("|", "\\|")).append("|");
markdownTable.append("井底横距离".replace("|", "\\|")).append("|");
markdownTable.append("\n");
// 生成表头分隔线
markdownTable.append("|");
for (Field field : fields) {
markdownTable.append("---|");
}
markdownTable.append("\n");
// 生成数据行
for (Ljjw ljjw : ljjwList) {
markdownTable.append("|");
for (Field field : fields) {
field.setAccessible(true);
try {
Object value = field.get(ljjw);
String valueStr = value != null ? value.toString() : "";
// 处理字段值中的|字符
valueStr = valueStr.replace("|", "\\|");
markdownTable.append(valueStr).append("|");
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
markdownTable.append("\n");
}
return markdownTable.toString();
}
/**
* 调用大模型解析钻具组合
* @param param
* @return
* @throws Exception
*/
@PostMapping("/dyAiModelJxZjzh")
public AjaxResult dyAiModelJxZjzh(@RequestBody CommonParam param) throws Exception{
return AjaxResult.success(djdcService.dyAiModelJxZjzh(param));
}
/**
* 调用长城大模型
* @param param
......
package com.ruoyi.project.zt.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.project.zt.domain.LjZjzhfx;
import com.ruoyi.project.zt.service.ILjZjzhfxService;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.page.TableDataInfo;
/**
* 邻井-钻具组合分析Controller
*
* @author ruoyi
* @date 2025-07-02
*/
@RestController
@RequestMapping("/system/ljZjzhfx")
public class LjZjzhfxController extends BaseController
{
@Autowired
private ILjZjzhfxService ljZjzhfxService;
/**
* 查询邻井-钻具组合分析列表
*/
@PreAuthorize("@ss.hasPermi('system:ljZjzhfx:list')")
@GetMapping("/list")
public TableDataInfo list(LjZjzhfx ljZjzhfx)
{
startPage();
List<LjZjzhfx> list = ljZjzhfxService.selectLjZjzhfxList(ljZjzhfx);
return getDataTable(list);
}
/**
* 导出邻井-钻具组合分析列表
*/
@PreAuthorize("@ss.hasPermi('system:ljZjzhfx:export')")
@Log(title = "邻井-钻具组合分析", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, LjZjzhfx ljZjzhfx)
{
List<LjZjzhfx> list = ljZjzhfxService.selectLjZjzhfxList(ljZjzhfx);
ExcelUtil<LjZjzhfx> util = new ExcelUtil<LjZjzhfx>(LjZjzhfx.class);
util.exportExcel(response, list, "邻井-钻具组合分析数据");
}
/**
* 获取邻井-钻具组合分析详细信息
*/
@PreAuthorize("@ss.hasPermi('system:ljZjzhfx:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(ljZjzhfxService.selectLjZjzhfxById(id));
}
/**
* 新增邻井-钻具组合分析
*/
@PreAuthorize("@ss.hasPermi('system:ljZjzhfx:add')")
@Log(title = "邻井-钻具组合分析", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody LjZjzhfx ljZjzhfx)
{
return toAjax(ljZjzhfxService.insertLjZjzhfx(ljZjzhfx));
}
/**
* 修改邻井-钻具组合分析
*/
@PreAuthorize("@ss.hasPermi('system:ljZjzhfx:edit')")
@Log(title = "邻井-钻具组合分析", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody LjZjzhfx ljZjzhfx)
{
return toAjax(ljZjzhfxService.updateLjZjzhfx(ljZjzhfx));
}
/**
* 删除邻井-钻具组合分析
*/
@PreAuthorize("@ss.hasPermi('system:ljZjzhfx:remove')")
@Log(title = "邻井-钻具组合分析", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(ljZjzhfxService.deleteLjZjzhfxByIds(ids));
}
}
package com.ruoyi.project.zt.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.project.zt.domain.LjZtdfzh;
import com.ruoyi.project.zt.service.ILjZtdfzhService;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.page.TableDataInfo;
/**
* 邻井-钻头得分综合Controller
*
* @author ruoyi
* @date 2025-06-30
*/
@RestController
@RequestMapping("/system/ljZtdfzh")
public class LjZtdfzhController extends BaseController
{
@Autowired
private ILjZtdfzhService ljZtdfzhService;
/**
* 查询邻井-钻头得分综合列表
*/
@PreAuthorize("@ss.hasPermi('system:ljZtdfzh:list')")
@GetMapping("/list")
public TableDataInfo list(LjZtdfzh ljZtdfzh)
{
startPage();
List<LjZtdfzh> list = ljZtdfzhService.selectLjZtdfzhList(ljZtdfzh);
return getDataTable(list);
}
/**
* 导出邻井-钻头得分综合列表
*/
@PreAuthorize("@ss.hasPermi('system:ljZtdfzh:export')")
@Log(title = "邻井-钻头得分综合", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, LjZtdfzh ljZtdfzh)
{
List<LjZtdfzh> list = ljZtdfzhService.selectLjZtdfzhList(ljZtdfzh);
ExcelUtil<LjZtdfzh> util = new ExcelUtil<LjZtdfzh>(LjZtdfzh.class);
util.exportExcel(response, list, "邻井-钻头得分综合数据");
}
/**
* 获取邻井-钻头得分综合详细信息
*/
@PreAuthorize("@ss.hasPermi('system:ljZtdfzh:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(ljZtdfzhService.selectLjZtdfzhById(id));
}
/**
* 新增邻井-钻头得分综合
*/
@PreAuthorize("@ss.hasPermi('system:ljZtdfzh:add')")
@Log(title = "邻井-钻头得分综合", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody LjZtdfzh ljZtdfzh)
{
return toAjax(ljZtdfzhService.insertLjZtdfzh(ljZtdfzh));
}
/**
* 修改邻井-钻头得分综合
*/
@PreAuthorize("@ss.hasPermi('system:ljZtdfzh:edit')")
@Log(title = "邻井-钻头得分综合", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody LjZtdfzh ljZtdfzh)
{
return toAjax(ljZtdfzhService.updateLjZtdfzh(ljZtdfzh));
}
/**
* 删除邻井-钻头得分综合
*/
@PreAuthorize("@ss.hasPermi('system:ljZtdfzh:remove')")
@Log(title = "邻井-钻头得分综合", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(ljZtdfzhService.deleteLjZtdfzhByIds(ids));
}
}
......@@ -10,6 +10,11 @@ public class DjZqsjfx {
//井号
private String jh;
//开钻时间
private String kssj;
//结束时间
private String jssj;
private String zwsj;
/**
* 井筒名
*/
......
......@@ -23,6 +23,7 @@ public class Djjc {
private Double jdzzb;
//开始井深
private Double ksjs;
private Double js;
......
package com.ruoyi.project.zt.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;
/**
* 邻井-钻具组合分析对象 lj_zjzhfx
*
* @author ruoyi
* @date 2025-07-02
*/
public class LjZjzhfx extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 井号 */
@Excel(name = "井号")
private String jh;
/** 开次 */
@Excel(name = "开次")
private String kc;
/** 钻具组合模型 */
@Excel(name = "钻具组合模型")
private String zjzhmx;
/** 特殊钻具 */
@Excel(name = "特殊钻具")
private String tsgj;
/** 钻具组合 */
@Excel(name = "钻具组合")
private String zjzh;
/** 创建人 */
@Excel(name = "创建人")
private String createdBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createdTime;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setJh(String jh)
{
this.jh = jh;
}
public String getJh()
{
return jh;
}
public void setKc(String kc)
{
this.kc = kc;
}
public String getKc()
{
return kc;
}
public void setZjzhmx(String zjzhmx)
{
this.zjzhmx = zjzhmx;
}
public String getZjzhmx()
{
return zjzhmx;
}
public void setTsgj(String tsgj)
{
this.tsgj = tsgj;
}
public String getTsgj()
{
return tsgj;
}
public void setZjzh(String zjzh)
{
this.zjzh = zjzh;
}
public String getZjzh()
{
return zjzh;
}
public void setCreatedBy(String createdBy)
{
this.createdBy = createdBy;
}
public String getCreatedBy()
{
return createdBy;
}
public void setCreatedTime(Date createdTime)
{
this.createdTime = createdTime;
}
public Date getCreatedTime()
{
return createdTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("jh", getJh())
.append("kc", getKc())
.append("zjzhmx", getZjzhmx())
.append("tsgj", getTsgj())
.append("zjzh", getZjzh())
.append("createdBy", getCreatedBy())
.append("createdTime", getCreatedTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}
package com.ruoyi.project.zt.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;
/**
* 邻井-钻头得分综合对象 lj_ztdfzh
*
* @author ruoyi
* @date 2025-06-30
*/
public class LjZtdfzh extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 开次 */
@Excel(name = "开次")
private String kc;
/** 钻头型号 */
@Excel(name = "钻头型号")
private String ztxh;
/** 钻头尺寸 */
@Excel(name = "钻头尺寸")
private Double cc;
/** 进尺得分 */
@Excel(name = "进尺得分")
private Double jcdf;
/** 机速得分 */
@Excel(name = "机速得分")
private Double jsdf;
/** 综合得分 */
@Excel(name = "综合得分")
private Double zhdf;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setKc(String kc)
{
this.kc = kc;
}
public String getKc()
{
return kc;
}
public void setZtxh(String ztxh)
{
this.ztxh = ztxh;
}
public String getZtxh()
{
return ztxh;
}
public void setCc(Double cc)
{
this.cc = cc;
}
public Double getCc()
{
return cc;
}
public void setJcdf(Double jcdf)
{
this.jcdf = jcdf;
}
public Double getJcdf()
{
return jcdf;
}
public void setJsdf(Double jsdf)
{
this.jsdf = jsdf;
}
public Double getJsdf()
{
return jsdf;
}
public void setZhdf(Double zhdf)
{
this.zhdf = zhdf;
}
public Double getZhdf()
{
return zhdf;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("kc", getKc())
.append("ztxh", getZtxh())
.append("cc", getCc())
.append("jcdf", getJcdf())
.append("jsdf", getJsdf())
.append("zhdf", getZhdf())
.toString();
}
}
package com.ruoyi.project.zt.domain;
import java.time.LocalTime;
public class TimePointPair {
private LocalTime previousTime;
private LocalTime drillingTime;
public TimePointPair(LocalTime previousTime, LocalTime drillingTime) {
this.previousTime = previousTime;
this.drillingTime = drillingTime;
}
public LocalTime getPreviousTime() {
return previousTime;
}
public LocalTime getDrillingTime() {
return drillingTime;
}
// 判断两个时间点之间是否跨天
public boolean isCrossDay() {
return drillingTime.isBefore(previousTime);
}
@Override
public String toString() {
return previousTime + " - " + drillingTime;
}
}
......@@ -14,4 +14,7 @@ public interface JswaMapper {
Jswa selectMd(Jswa jswapa);
Jswa selectZwsj(Jswa jswap);
}
package com.ruoyi.project.zt.mapper;
import java.util.List;
import com.ruoyi.framework.aspectj.lang.annotation.DataSource;
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
import com.ruoyi.project.zt.domain.CommonParam;
import com.ruoyi.project.zt.domain.LjSzfxjg;
/**
......@@ -9,6 +13,7 @@ import com.ruoyi.project.zt.domain.LjSzfxjg;
* @author ruoyi
* @date 2025-06-29
*/
@DataSource(value = DataSourceType.MASTER)
public interface LjSzfxjgMapper
{
/**
......@@ -61,4 +66,6 @@ public interface LjSzfxjgMapper
int batchLjSzfxjg(List<LjSzfxjg> ljSzfxjgList);
List<LjSzfxjg> getszfxjgList(CommonParam param);
}
package com.ruoyi.project.zt.mapper;
import java.util.List;
import com.ruoyi.framework.aspectj.lang.annotation.DataSource;
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
import com.ruoyi.project.zt.domain.LjZjzhfx;
/**
* 邻井-钻具组合分析Mapper接口
*
* @author ruoyi
* @date 2025-07-02
*/
@DataSource(value = DataSourceType.SLAVE)
public interface LjZjzhfxMapper
{
/**
* 查询邻井-钻具组合分析
*
* @param id 邻井-钻具组合分析主键
* @return 邻井-钻具组合分析
*/
public LjZjzhfx selectLjZjzhfxById(Long id);
/**
* 查询邻井-钻具组合分析列表
*
* @param ljZjzhfx 邻井-钻具组合分析
* @return 邻井-钻具组合分析集合
*/
public List<LjZjzhfx> selectLjZjzhfxList(LjZjzhfx ljZjzhfx);
/**
* 新增邻井-钻具组合分析
*
* @param ljZjzhfx 邻井-钻具组合分析
* @return 结果
*/
public int insertLjZjzhfx(LjZjzhfx ljZjzhfx);
/**
* 修改邻井-钻具组合分析
*
* @param ljZjzhfx 邻井-钻具组合分析
* @return 结果
*/
public int updateLjZjzhfx(LjZjzhfx ljZjzhfx);
/**
* 删除邻井-钻具组合分析
*
* @param id 邻井-钻具组合分析主键
* @return 结果
*/
public int deleteLjZjzhfxById(Long id);
/**
* 批量删除邻井-钻具组合分析
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteLjZjzhfxByIds(Long[] ids);
int batchLjZjzhfx(List<LjZjzhfx> zjzhfxList);
}
package com.ruoyi.project.zt.mapper;
import java.util.List;
import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
import com.ruoyi.framework.aspectj.lang.annotation.DataSource;
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
import com.ruoyi.project.zt.domain.CommonParam;
import com.ruoyi.project.zt.domain.LjZtdfzh;
/**
* 邻井-钻头得分综合Mapper接口
*
* @author ruoyi
* @date 2025-06-30
*/
@DataSource(value = DataSourceType.MASTER)
public interface LjZtdfzhMapper
{
/**
* 查询邻井-钻头得分综合
*
* @param id 邻井-钻头得分综合主键
* @return 邻井-钻头得分综合
*/
public LjZtdfzh selectLjZtdfzhById(Long id);
/**
* 查询邻井-钻头得分综合列表
*
* @param ljZtdfzh 邻井-钻头得分综合
* @return 邻井-钻头得分综合集合
*/
public List<LjZtdfzh> selectLjZtdfzhList(LjZtdfzh ljZtdfzh);
/**
* 新增邻井-钻头得分综合
*
* @param ljZtdfzh 邻井-钻头得分综合
* @return 结果
*/
public int insertLjZtdfzh(LjZtdfzh ljZtdfzh);
/**
* 修改邻井-钻头得分综合
*
* @param ljZtdfzh 邻井-钻头得分综合
* @return 结果
*/
public int updateLjZtdfzh(LjZtdfzh ljZtdfzh);
/**
* 删除邻井-钻头得分综合
*
* @param id 邻井-钻头得分综合主键
* @return 结果
*/
public int deleteLjZtdfzhById(Long id);
/**
* 批量删除邻井-钻头得分综合
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteLjZtdfzhByIds(Long[] ids);
List<LjZtdfzh> getZtzhzzdfList(CommonParam param);
}
......@@ -4,6 +4,7 @@ import java.util.List;
import com.ruoyi.framework.aspectj.lang.annotation.DataSource;
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
import com.ruoyi.project.zt.domain.CommonParam;
import com.ruoyi.project.zt.domain.LjZtzhdf;
/**
......@@ -65,4 +66,6 @@ public interface LjZtzhdfMapper
int batchLjZtzhdf(List<LjZtzhdf> list);
List<LjZtzhdf> selectLjZtzhdfListByCom(CommonParam param);
}
......@@ -5,6 +5,7 @@ import com.ruoyi.project.zt.domain.*;
import com.ruoyi.project.zt.domain.vo.SjInfo;
import java.util.List;
import java.util.Map;
public interface DjdcService {
List<DjDcInfo> getList(DjDcInfo info);
......@@ -30,5 +31,15 @@ public interface DjdcService {
List<DjZtfx> getDjZtfxList(CommonParam param);
List<LjZtzhdf> calZtzhdf(CommonParam param);
Map<String,Object> calZtzhdf(CommonParam param);
List<LjZtzhdf> getzhzhdfList(CommonParam param);
List<LjSzfxjg> getszfxjgList(CommonParam param);
List<LjZtdfzh> getZtzhzzdfList(CommonParam param);
int dyAiModelJxZjzh(CommonParam param);
}
package com.ruoyi.project.zt.service;
import java.util.List;
import com.ruoyi.project.zt.domain.LjZjzhfx;
/**
* 邻井-钻具组合分析Service接口
*
* @author ruoyi
* @date 2025-07-02
*/
public interface ILjZjzhfxService
{
/**
* 查询邻井-钻具组合分析
*
* @param id 邻井-钻具组合分析主键
* @return 邻井-钻具组合分析
*/
public LjZjzhfx selectLjZjzhfxById(Long id);
/**
* 查询邻井-钻具组合分析列表
*
* @param ljZjzhfx 邻井-钻具组合分析
* @return 邻井-钻具组合分析集合
*/
public List<LjZjzhfx> selectLjZjzhfxList(LjZjzhfx ljZjzhfx);
/**
* 新增邻井-钻具组合分析
*
* @param ljZjzhfx 邻井-钻具组合分析
* @return 结果
*/
public int insertLjZjzhfx(LjZjzhfx ljZjzhfx);
/**
* 修改邻井-钻具组合分析
*
* @param ljZjzhfx 邻井-钻具组合分析
* @return 结果
*/
public int updateLjZjzhfx(LjZjzhfx ljZjzhfx);
/**
* 批量删除邻井-钻具组合分析
*
* @param ids 需要删除的邻井-钻具组合分析主键集合
* @return 结果
*/
public int deleteLjZjzhfxByIds(Long[] ids);
/**
* 删除邻井-钻具组合分析信息
*
* @param id 邻井-钻具组合分析主键
* @return 结果
*/
public int deleteLjZjzhfxById(Long id);
}
package com.ruoyi.project.zt.service;
import java.util.List;
import com.ruoyi.project.zt.domain.LjZtdfzh;
/**
* 邻井-钻头得分综合Service接口
*
* @author ruoyi
* @date 2025-06-30
*/
public interface ILjZtdfzhService
{
/**
* 查询邻井-钻头得分综合
*
* @param id 邻井-钻头得分综合主键
* @return 邻井-钻头得分综合
*/
public LjZtdfzh selectLjZtdfzhById(Long id);
/**
* 查询邻井-钻头得分综合列表
*
* @param ljZtdfzh 邻井-钻头得分综合
* @return 邻井-钻头得分综合集合
*/
public List<LjZtdfzh> selectLjZtdfzhList(LjZtdfzh ljZtdfzh);
/**
* 新增邻井-钻头得分综合
*
* @param ljZtdfzh 邻井-钻头得分综合
* @return 结果
*/
public int insertLjZtdfzh(LjZtdfzh ljZtdfzh);
/**
* 修改邻井-钻头得分综合
*
* @param ljZtdfzh 邻井-钻头得分综合
* @return 结果
*/
public int updateLjZtdfzh(LjZtdfzh ljZtdfzh);
/**
* 批量删除邻井-钻头得分综合
*
* @param ids 需要删除的邻井-钻头得分综合主键集合
* @return 结果
*/
public int deleteLjZtdfzhByIds(Long[] ids);
/**
* 删除邻井-钻头得分综合信息
*
* @param id 邻井-钻头得分综合主键
* @return 结果
*/
public int deleteLjZtdfzhById(Long id);
}
......@@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.*;
import com.google.gson.reflect.TypeToken;
import com.google.gson.stream.JsonReader;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.framework.aspectj.lang.annotation.DataSource;
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
import com.ruoyi.project.zt.domain.*;
......@@ -15,6 +17,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.StringReader;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.text.DecimalFormat;
......@@ -26,6 +29,7 @@ import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
@Service
@DataSource(value = DataSourceType.SLAVE)
......@@ -46,6 +50,10 @@ public class DjdcServiceImpl implements DjdcService {
@Autowired
private LjSzfxjgMapper ljSzfxjgMapper;
@Autowired
private LjZtdfzhMapper ljZtdfzhMapper;
@Autowired
private LjZjzhfxMapper ljZjzhfxMapper;
@Override
......@@ -832,12 +840,12 @@ public class DjdcServiceImpl implements DjdcService {
String url="http://10.68.16.217:33333/get_epbp_jhlist?tn=ZJ_ZJSGJDSJ&jl="+param.getJh();
String result2 = HttpRequest.get(url).execute().body();
// String result2 = HttpRequest.get(url).execute().body();
System.out.println(result2);
// System.out.println(result2);
// 模拟返回值
List<Map<String, Object>> mapList = processJson(result2);
// List<Map<String, Object>> mapList = processJson(jsonString);
// List<Map<String, Object>> mapList = processJson(result2);
List<Map<String, Object>> mapList = processJson(jsonString);
List<Map<String, Object>> jh = mapList.stream().filter(it -> param.getJh().equals(it.get("JH").toString())).collect(Collectors.toList());
......@@ -909,177 +917,218 @@ public class DjdcServiceImpl implements DjdcService {
// item.setWjycsl(Double.parseDouble(df.format(wjycsl)));
//计算周期
List<Map<String, Object>> jhzqList = mapList.stream().filter(it -> item.getJh().equals(it.get("JH").toString())).collect(Collectors.toList());
ZonedDateTime kssj=null;
ZonedDateTime zwsj=null;
ZonedDateTime jssj=null;
if(item.getKc().equals("1")){
//取出开始日期
Map<String, Object> mapks = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("01")).findFirst().orElse(null);
if(mapks!=null){
String dateStr = (String) mapks.get("ZYSJ");
if (dateStr != null) {
kssj= ZonedDateTime.parse(dateStr, formatter);
}
}
//取出钻完日期
Map<String, Object> mapzw = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("13")).findFirst().orElse(null);
if(mapzw!=null){
String dateStr = (String) mapzw.get("ZYSJ");
if (dateStr != null) {
zwsj = ZonedDateTime.parse(dateStr, formatter);
}
}else {
mapzw = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("08")).findFirst().orElse(null);
if(mapzw!=null){
String dateStr = (String) mapzw.get("ZYSJ");
if (dateStr != null) {
zwsj = ZonedDateTime.parse(dateStr, formatter);
}
}
}
//取出结束日期
Map<String, Object> mapjs = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("02")).findFirst().orElse(null);
if(mapjs!=null){
String dateStr = (String) mapjs.get("ZYSJ");
if (dateStr != null) {
jssj = ZonedDateTime.parse(dateStr, formatter);
}
}else {
mapjs = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("09")).findFirst().orElse(null);
if(mapjs!=null){
String dateStr = (String) mapjs.get("ZYSJ");
if (dateStr != null) {
jssj = ZonedDateTime.parse(dateStr, formatter);
}
}
}
}else if(item.getKc().equals("2")){
//取出开始日期
Map<String, Object> mapks = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("02")).findFirst().orElse(null);
if(mapks!=null){
String dateStr = (String) mapks.get("ZYSJ");
if (dateStr != null) {
kssj= ZonedDateTime.parse(dateStr, formatter);
}
}
//取出钻完日期
Map<String, Object> mapzw = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("14")).findFirst().orElse(null);
if(mapzw!=null){
String dateStr = (String) mapzw.get("ZYSJ");
if (dateStr != null) {
SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);
zwsj = ZonedDateTime.parse(dateStr, formatter);
}
}else {
mapzw = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("08")).findFirst().orElse(null);
if(mapzw!=null){
String dateStr = (String) mapzw.get("ZYSJ");
if (dateStr != null) {
zwsj = ZonedDateTime.parse(dateStr, formatter);
}
}
}
//取出结束日期
Map<String, Object> mapjs = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("03")).findFirst().orElse(null);
if(mapjs!=null){
if(mapjs!=null){
String dateStr = (String) mapjs.get("ZYSJ");
if (dateStr != null) {
jssj = ZonedDateTime.parse(dateStr, formatter);
}
}
}else {
mapjs = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("09")).findFirst().orElse(null);
if(mapjs!=null){
String dateStr = (String) mapjs.get("ZYSJ");
if (dateStr != null) {
jssj = ZonedDateTime.parse(dateStr, formatter);
}
}
}
}else if(item.getKc().equals("3")){
//取出开始日期
Map<String, Object> mapks = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("03")).findFirst().orElse(null);
if(mapks!=null){
String dateStr = (String) mapks.get("ZYSJ");
if (dateStr != null) {
SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);
kssj= ZonedDateTime.parse(dateStr, formatter);
}
}
//取出钻完日期
Map<String, Object> mapzw = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("15")).findFirst().orElse(null);
if(mapzw!=null){
String dateStr = (String) mapzw.get("ZYSJ");
if (dateStr != null) {
SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);
zwsj = ZonedDateTime.parse(dateStr, formatter);
}
}else {
mapzw = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("08")).findFirst().orElse(null);
if(mapzw!=null){
String dateStr = (String) mapzw.get("ZYSJ");
if (dateStr != null) {
zwsj = ZonedDateTime.parse(dateStr, formatter);
}
}
// List<Map<String, Object>> jhzqList = mapList.stream().filter(it -> item.getJh().equals(it.get("JH").toString())).collect(Collectors.toList());
// ZonedDateTime kssj=null;
// ZonedDateTime zwsj=null;
// ZonedDateTime jssj=null;
// if(item.getKc().equals("1")){
// //取出开始日期
// Map<String, Object> mapks = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("01")).findFirst().orElse(null);
//
// if(mapks!=null){
// String dateStr = (String) mapks.get("ZYSJ");
// if (dateStr != null) {
// kssj= ZonedDateTime.parse(dateStr, formatter);
// }
// }
// //取出钻完日期
// Map<String, Object> mapzw = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("13")).findFirst().orElse(null);
//
// if(mapzw!=null){
// String dateStr = (String) mapzw.get("ZYSJ");
//
// if (dateStr != null) {
// zwsj = ZonedDateTime.parse(dateStr, formatter);
// }
// }else {
// mapzw = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("08")).findFirst().orElse(null);
// if(mapzw!=null){
// String dateStr = (String) mapzw.get("ZYSJ");
// if (dateStr != null) {
// zwsj = ZonedDateTime.parse(dateStr, formatter);
// }
// }
// }
// //取出结束日期
//
// Map<String, Object> mapjs = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("02")).findFirst().orElse(null);
//
// if(mapjs!=null){
// String dateStr = (String) mapjs.get("ZYSJ");
// if (dateStr != null) {
// jssj = ZonedDateTime.parse(dateStr, formatter);
// }
// }else {
// mapjs = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("09")).findFirst().orElse(null);
// if(mapjs!=null){
// String dateStr = (String) mapjs.get("ZYSJ");
// if (dateStr != null) {
// jssj = ZonedDateTime.parse(dateStr, formatter);
// }
// }
// }
//
// }else if(item.getKc().equals("2")){
//
// //取出开始日期
// Map<String, Object> mapks = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("02")).findFirst().orElse(null);
//
// if(mapks!=null){
// String dateStr = (String) mapks.get("ZYSJ");
//
// if (dateStr != null) {
// kssj= ZonedDateTime.parse(dateStr, formatter);
// }
// }
// //取出钻完日期
// Map<String, Object> mapzw = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("14")).findFirst().orElse(null);
//
// if(mapzw!=null){
// String dateStr = (String) mapzw.get("ZYSJ");
//
// if (dateStr != null) {
// SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);
// zwsj = ZonedDateTime.parse(dateStr, formatter);
// }
// }else {
// mapzw = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("08")).findFirst().orElse(null);
// if(mapzw!=null){
// String dateStr = (String) mapzw.get("ZYSJ");
// if (dateStr != null) {
// zwsj = ZonedDateTime.parse(dateStr, formatter);
// }
// }
// }
// //取出结束日期
// Map<String, Object> mapjs = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("03")).findFirst().orElse(null);
//
// if(mapjs!=null){
//
// if(mapjs!=null){
// String dateStr = (String) mapjs.get("ZYSJ");
// if (dateStr != null) {
// jssj = ZonedDateTime.parse(dateStr, formatter);
// }
// }
// }else {
// mapjs = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("09")).findFirst().orElse(null);
// if(mapjs!=null){
// String dateStr = (String) mapjs.get("ZYSJ");
// if (dateStr != null) {
// jssj = ZonedDateTime.parse(dateStr, formatter);
// }
// }
// }
//
//
//
// }else if(item.getKc().equals("3")){
// //取出开始日期
// Map<String, Object> mapks = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("03")).findFirst().orElse(null);
//
// if(mapks!=null){
// String dateStr = (String) mapks.get("ZYSJ");
//
// if (dateStr != null) {
// SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);
// kssj= ZonedDateTime.parse(dateStr, formatter);
// }
// }
// //取出钻完日期
// Map<String, Object> mapzw = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("15")).findFirst().orElse(null);
//
// if(mapzw!=null){
// String dateStr = (String) mapzw.get("ZYSJ");
//
// if (dateStr != null) {
// SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);
// zwsj = ZonedDateTime.parse(dateStr, formatter);
// }
// }else {
// mapzw = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("08")).findFirst().orElse(null);
// if(mapzw!=null){
// String dateStr = (String) mapzw.get("ZYSJ");
// if (dateStr != null) {
// zwsj = ZonedDateTime.parse(dateStr, formatter);
// }
// }
// }
// //取出结束日期
// Map<String, Object> mapjs = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("04")).findFirst().orElse(null);
//
// if(mapjs!=null){
//
// if(mapjs!=null){
// String dateStr = (String) mapjs.get("ZYSJ");
// if (dateStr != null) {
// jssj = ZonedDateTime.parse(dateStr, formatter);
// }
// }
// }else {
// mapjs = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("09")).findFirst().orElse(null);
// if(mapjs!=null){
// String dateStr = (String) mapjs.get("ZYSJ");
// if (dateStr != null) {
// jssj = ZonedDateTime.parse(dateStr, formatter);
// }
// }
// }
// }
//查询日志表
String kssj =item.getKssj();
String jssj =item.getJssj();
String zwsj ="";
Jswa jswap=new Jswa();
jswap.setKsrq(item.getKssj());
jswap.setJsrq(item.getJssj());
jswap.setJs(item.getJs());
jswap.setJh(item.getJh());
Jswa jswaZwsj = jswaMapper.selectZwsj(jswap);
if(jswaZwsj!=null){
String brzygz = jswaZwsj.getBrzygz();
// 去除所有空白字符(包括空格、制表符、换行符等)
String cleanedRecord = brzygz.replaceAll("\\s+", "");
List<TimePointPair> timePointPairs = extractTimePointPairsBeforeDrilling(cleanedRecord);
if(timePointPairs.size()==0){
timePointPairs=extractTimePeriodsBeforeDrilling(cleanedRecord);
}
//取出结束日期
Map<String, Object> mapjs = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("04")).findFirst().orElse(null);
if(mapjs!=null){
if(mapjs!=null){
String dateStr = (String) mapjs.get("ZYSJ");
if (dateStr != null) {
jssj = ZonedDateTime.parse(dateStr, formatter);
}
}
}else {
mapjs = jhzqList.stream().filter(it -> it.get("ZYMCBM").equals("09")).findFirst().orElse(null);
if(mapjs!=null){
String dateStr = (String) mapjs.get("ZYSJ");
if (dateStr != null) {
jssj = ZonedDateTime.parse(dateStr, formatter);
}
System.out.println("钻进字样前的时间点及其前一个时间点:");
for (TimePointPair pair : timePointPairs) {
System.out.println("前一个时间点:" + pair.getPreviousTime() +
",钻进时间点:" + pair.getDrillingTime() +
",是否跨天:" + pair.isCrossDay());
String formattedTime = pair.getDrillingTime().format(DateTimeFormatter.ISO_LOCAL_TIME);
if( pair.isCrossDay()){
zwsj= DateUtils.parseDateToStr("yyyy-MM-dd",jswaZwsj.getRq()) +" "+formattedTime;
}else {
Calendar calendar = Calendar.getInstance();
calendar.setTime(jswaZwsj.getRq()); // 设置为当前日期
calendar.add(Calendar.DAY_OF_YEAR, -1); // 增加一天
// 获取明天的Date对象
Date tomorrow = calendar.getTime();
zwsj= DateUtils.parseDateToStr("yyyy-MM-dd",tomorrow) +" "+formattedTime;
}
}
}
System.out.println(zwsj);
item.setZwsj(zwsj);
//计算钻进实际周期
if(kssj!=null && zwsj!=null){
if(StringUtils.isNotEmpty(kssj) && StringUtils.isNotEmpty(zwsj) ){
// 解析字符串并转换为 UTC 时间
// 转换为 UTC 时间戳(Instant)
// Instant instant1 = kssj.toInstant();
// Instant instant2 = zwsj.toInstant();
String dateTimeStr1 = kssj.format(outputFormatter2);
String dateTimeStr2 = zwsj.format(outputFormatter2);
// String dateTimeStr1 = kssj.format(outputFormatter2);
// String dateTimeStr2 = zwsj.format(outputFormatter2);
LocalDateTime dateTime1 = LocalDateTime.parse(dateTimeStr1, outputFormatter2);
LocalDateTime dateTime2 = LocalDateTime.parse(dateTimeStr2, outputFormatter2);
LocalDateTime dateTime1 = LocalDateTime.parse(kssj, outputFormatter2);
LocalDateTime dateTime2 = LocalDateTime.parse(zwsj, outputFormatter2);
// 转换为 Instant(假设为 UTC 时区)
Instant instant1 = dateTime1.atZone(ZoneOffset.UTC).toInstant();
......@@ -1094,8 +1143,8 @@ public class DjdcServiceImpl implements DjdcService {
item.setZjzq(Double.parseDouble(df.format(daysDiff)));
//计算异常周期
Jswa jswa =new Jswa();
jswa.setKsrq(kssj.format(outputFormatter));
jswa.setJsrq(zwsj.format(outputFormatter));
jswa.setKsrq(kssj);
jswa.setJsrq(zwsj);
jswa.setJh(item.getJh());
List<Jswa> jswaList = jswaMapper.getList(jswa);
Double zjycsl=0.0;
......@@ -1119,14 +1168,14 @@ public class DjdcServiceImpl implements DjdcService {
}
//计算中完实际周期
if(jssj!=null && zwsj!=null){
if(StringUtils.isNotEmpty(jssj)&& StringUtils.isNotEmpty(zwsj)){
// 转换为 UTC 时间戳(Instant)
String dateTimeStr1 = zwsj.format(outputFormatter2);
String dateTimeStr2 = jssj.format(outputFormatter2);
// String dateTimeStr1 = zwsj.format(outputFormatter2);
// String dateTimeStr2 = jssj.format(outputFormatter2);
LocalDateTime dateTime1 = LocalDateTime.parse(dateTimeStr1, outputFormatter2);
LocalDateTime dateTime2 = LocalDateTime.parse(dateTimeStr2, outputFormatter2);
LocalDateTime dateTime1 = LocalDateTime.parse(zwsj, outputFormatter2);
LocalDateTime dateTime2 = LocalDateTime.parse(jssj, outputFormatter2);
// 转换为 Instant(假设为 UTC 时区)
Instant instant1 = dateTime1.atZone(ZoneOffset.UTC).toInstant();
......@@ -1143,8 +1192,8 @@ public class DjdcServiceImpl implements DjdcService {
item.setZwzq(Double.parseDouble(df.format(daysDiff)));
//计算异常周期
Jswa jswa =new Jswa();
jswa.setKsrq(zwsj.format(outputFormatter));
jswa.setJsrq(jssj.format(outputFormatter));
jswa.setKsrq(zwsj);
jswa.setJsrq(jssj);
jswa.setJh(item.getJh());
List<Jswa> jswaList = jswaMapper.getList(jswa);
Double zjycsl=0.0;
......@@ -1158,7 +1207,6 @@ public class DjdcServiceImpl implements DjdcService {
//中完异常描述
item.setWjycms(String.join(",",jswaList.stream().map(Jswa::getBrzygz).collect(Collectors.toList())));
}
}
......@@ -1170,6 +1218,104 @@ public class DjdcServiceImpl implements DjdcService {
return list;
}
public static List<TimePointPair> extractTimePointPairsBeforeDrilling(String record) {
List<TimePointPair> pairs = new ArrayList<>();
// 匹配所有时间点(格式为H:mm)
Pattern timePattern = Pattern.compile("(\\d+:\\d+)");
Matcher timeMatcher = timePattern.matcher(record);
// 匹配"钻进"前的时间点
Pattern drillingPattern = Pattern.compile("(\\d+:\\d+)(?=钻进)");
Matcher drillingMatcher = drillingPattern.matcher(record);
List<LocalTime> allTimePoints = new ArrayList<>();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("H:mm");
// 提取所有时间点
while (timeMatcher.find()) {
allTimePoints.add(LocalTime.parse(timeMatcher.group(1), formatter));
}
// 查找"钻进"前的时间点及其前一个时间点
while (drillingMatcher.find()) {
LocalTime drillingTime = LocalTime.parse(drillingMatcher.group(1), formatter);
int index = allTimePoints.indexOf(drillingTime);
if (index > 0) {
LocalTime previousTime = allTimePoints.get(index - 1);
pairs.add(new TimePointPair(previousTime, drillingTime));
}
}
return pairs;
}
public static void main(String[] args) {
String record = "13:30-17:00一开钻进-18:00循环钻井液-19:00起钻-20:00下套管准备-23:00下表层套管-1:00固井-3:00侯凝-8:00安装防喷器";
// 去除所有空白字符(包括空格、制表符、换行符等)
String cleanedRecord = record.replaceAll("\\s+", "");
List<TimePointPair> timePointPairs = extractTimePeriodsBeforeDrilling(cleanedRecord);
System.out.println("钻进字样前的时间点及其前一个时间点:");
for (TimePointPair pair : timePointPairs) {
System.out.println("前一个时间点:" + pair.getPreviousTime() +
",钻进时间点:" + pair.getDrillingTime() +
",是否跨天:" + pair.isCrossDay());
}
}
public static List<TimePointPair> extractTimePeriodsBeforeDrilling(String record) {
List<TimePointPair> pairs = new ArrayList<>();
// 匹配所有时间点(格式为H:mm)
Pattern timePattern = Pattern.compile("(\\d+:\\d+)");
Matcher timeMatcher = timePattern.matcher(record);
// 匹配"XX钻进"或"钻进"前的时间点
Pattern drillingPattern = Pattern.compile("(\\d+:\\d+)(?=[^-]*?钻进)");
Matcher drillingMatcher = drillingPattern.matcher(record);
List<LocalTime> allTimePoints = new ArrayList<>();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("H:mm");
// 提取所有时间点
while (timeMatcher.find()) {
allTimePoints.add(LocalTime.parse(timeMatcher.group(1), formatter));
}
// 记录当前匹配的位置
int currentPosition = 0;
// 查找"钻进"前的时间点及其前一个时间点
while (drillingMatcher.find()) {
String timeStr = drillingMatcher.group(1);
LocalTime drillingTime = LocalTime.parse(timeStr, formatter);
// 从当前位置开始查找下一个匹配的时间点
int index = -1;
for (int i = currentPosition; i < allTimePoints.size(); i++) {
if (allTimePoints.get(i).equals(drillingTime)) {
index = i;
currentPosition = i + 1; // 更新当前位置
break;
}
}
if (index > 0) {
LocalTime previousTime = allTimePoints.get(index - 1);
pairs.add(new TimePointPair(previousTime, drillingTime));
}
}
return pairs;
}
@Override
public List<DjZjzhfx> getZjzhfxList(CommonParam param) {
if(StringUtils.isNotEmpty(param.getJh())){
......@@ -1187,99 +1333,111 @@ public class DjdcServiceImpl implements DjdcService {
DecimalFormat df = new DecimalFormat("#.00");
for (DjZjzhfx item:list){
String zjzh = item.getZjzh();
if(StringUtils.isNotEmpty(zjzh)){
Map<String,Object> map=new HashMap<>();
map.put("prompt",zjzh+" 这是一个钻具组合信息,请把这个钻具组合信息拆分成竖表," +
"字段为钻具名称(zjmc)、型号(xh)、长度(cd),最终输出json格式数据,其他内容不输出," +
"输出内容不换行,只要数据,反斜杠不输出,输出格式为:\"{\\\"data\\\":[{\\\"zjmc\\\":\\\"\\***\\\",\\\"xh\\\":\\\"*\\\",\\\"cd\\\":\\\"*\\\"}]}");
Gson gson = new GsonBuilder().setPrettyPrinting().create();
String json = gson.toJson(map);
String url="http://10.68.249.59:33331/api/chat/1";
String result2 = HttpRequest.post(url).body(json).execute().body();
System.out.println(result2);
JSONObject jsonObject = JSON.parseObject(result2);
Object error = jsonObject.get("error");
if(error!=null){
System.out.println("错误信息: " + jsonObject.getString("error"));
continue;
}
// JsonObject elementerror = new Gson().fromJson(result2, JsonObject.class);
// if(StringUtils.isNotEmpty(zjzh)){
// Map<String,Object> map=new HashMap<>();
// map.put("prompt",zjzh+" 这是一个钻具组合信息,请把这个钻具组合信息拆分成竖表," +
// "字段为钻具名称(zjmc)、型号(xh)、长度(cd),最终输出json格式数据,其他内容不输出," +
// "输出内容不换行,只要数据,反斜杠不输出,输出格式为:\"{\\\"data\\\":[{\\\"zjmc\\\":\\\"\\***\\\",\\\"xh\\\":\\\"*\\\",\\\"cd\\\":\\\"*\\\"}]}");
// Gson gson = new GsonBuilder().setPrettyPrinting().create();
// String json = gson.toJson(map);
//
// String url="http://10.68.249.59:33331/api/chat/1";
//
// if (isValidString(elementerror, "error")) {
// String errorMsg = elementerror.get("error").getAsString();
// System.out.println("错误信息: " + errorMsg);
// String result2 = HttpRequest.post(url).body(json).execute().body();
// System.out.println(result2);
// JSONObject jsonObject = JSON.parseObject(result2);
// Object error = jsonObject.get("error");
// if(error!=null){
// System.out.println("错误信息: " + jsonObject.getString("error"));
// continue;
// }
//// JsonObject elementerror = new Gson().fromJson(result2, JsonObject.class);
////
//// if (isValidString(elementerror, "error")) {
//// String errorMsg = elementerror.get("error").getAsString();
//// System.out.println("错误信息: " + errorMsg);
//// continue;
//// }
//
//
// // 解析API响应
//// Gson gsonres = new GsonBuilder().setPrettyPrinting().create();
// JsonObject apiResponse = JsonParser.parseString(result2).getAsJsonObject();
// // 提取message.content字段
//
// JsonObject message = apiResponse.getAsJsonObject("message");
// String content = message.get("content").getAsString();
//
// // 提取content中的JSON部分(去除Markdown代码块标记)
// String jsonContent = extractJsonContent(content);
//
// // 解析并格式化JSON内容
// JsonElement jsonElement = JsonParser.parseString(jsonContent);
// String formattedJson = gson.toJson(jsonElement);
//
// // 输出格式化后的JSON
// System.out.println(formattedJson);
//
// // 示例:处理解析后的数据
// JsonObject dataObject = JsonParser.parseString(jsonContent).getAsJsonObject();
// JsonArray dataArray = dataObject.getAsJsonArray("data");
// String zjzhmx="";
// String tsgj="";
//
// // 遍历数据数组
// for (JsonElement element : dataArray) {
// JsonObject it = element.getAsJsonObject();
// String zjmc = it.get("zjmc").getAsString();
// String xh = it.get("xh").getAsString();
// String cd = it.get("cd").getAsString();
// //判断钻具组合模型
// if( zjmc.contains("单弯螺杆") || zjmc.contains("无磁钻铤")|| zjmc.contains("加重钻杆")|| zjmc.contains("钻杆")){
//
// if(StringUtils.isEmpty(zjzhmx)){
// zjzhmx=(xh+"+"+zjmc);
// }else {
// zjzhmx=zjzhmx+"+"+(xh+"+"+zjmc);
// }
//
// }
// //判断特殊钻具
// if( zjmc.contains("随钻扩眼器") || zjmc.contains("微偏心扩眼器")|| zjmc.contains("水力振荡器")|| zjmc.contains("修壁器")){
//
// if(StringUtils.isEmpty(zjzhmx)){
// tsgj=(xh+"+"+zjmc);
// }else {
// tsgj=tsgj+"+"+(xh+"+"+zjmc);
// }
// }
// }
//
// item.setZjzhmx(zjzhmx);
// item.setTsgj(tsgj);
// }
//查询钻具组合
// 解析API响应
// Gson gsonres = new GsonBuilder().setPrettyPrinting().create();
JsonObject apiResponse = JsonParser.parseString(result2).getAsJsonObject();
// 提取message.content字段
JsonObject message = apiResponse.getAsJsonObject("message");
String content = message.get("content").getAsString();
// 提取content中的JSON部分(去除Markdown代码块标记)
String jsonContent = extractJsonContent(content);
// 解析并格式化JSON内容
JsonElement jsonElement = JsonParser.parseString(jsonContent);
String formattedJson = gson.toJson(jsonElement);
// 输出格式化后的JSON
System.out.println(formattedJson);
// 示例:处理解析后的数据
JsonObject dataObject = JsonParser.parseString(jsonContent).getAsJsonObject();
JsonArray dataArray = dataObject.getAsJsonArray("data");
String zjzhmx="";
String tsgj="";
// 遍历数据数组
for (JsonElement element : dataArray) {
JsonObject it = element.getAsJsonObject();
String zjmc = it.get("zjmc").getAsString();
String xh = it.get("xh").getAsString();
String cd = it.get("cd").getAsString();
//判断钻具组合模型
if( zjmc.contains("单弯螺杆") || zjmc.contains("无磁钻铤")|| zjmc.contains("加重钻杆")|| zjmc.contains("钻杆")){
if(StringUtils.isEmpty(zjzhmx)){
zjzhmx=(xh+"+"+zjmc);
}else {
zjzhmx=zjzhmx+"+"+(xh+"+"+zjmc);
}
}
//判断特殊钻具
if( zjmc.contains("随钻扩眼器") || zjmc.contains("微偏心扩眼器")|| zjmc.contains("水力振荡器")|| zjmc.contains("修壁器")){
if(StringUtils.isEmpty(zjzhmx)){
tsgj=(xh+"+"+zjmc);
}else {
tsgj=tsgj+"+"+(xh+"+"+zjmc);
}
}
}
LjZjzhfx ljZjzhfx =new LjZjzhfx();
ljZjzhfx.setJh(item.getJh());
ljZjzhfx.setKc(item.getKc());
List<LjZjzhfx> zjzhfxList = ljZjzhfxMapper.selectLjZjzhfxList(ljZjzhfx);
if(zjzhfxList.size()>0){
LjZjzhfx ljZjzhfx1 = zjzhfxList.get(0);
item.setTsgj(ljZjzhfx1.getTsgj());
item.setZjzhmx(ljZjzhfx1.getZjzhmx());
}
item.setZjzhmx(zjzhmx);
item.setTsgj(tsgj);
//查询进尺和时效
DjZjzhfx djZjzhfx=djdcInfoMapper.getJshaJc(item.getJh(),item.getKsjs(),item.getJs());
if(djZjzhfx!=null){
Double jc = djZjzhfx.getJc();
Double jcsjhj = djZjzhfx.getJcsjhj();
item.setJc(jc);
item.setJcsjhj(jcsjhj);
if(jcsjhj>0){
double zb =jc/jcsjhj;
item.setZb(Double.parseDouble(df.format(zb)));
}
//查询进尺和时效
DjZjzhfx djZjzhfx=djdcInfoMapper.getJshaJc(item.getJh(),item.getKsjs(),item.getJs());
if(djZjzhfx!=null){
Double jc = djZjzhfx.getJc();
Double jcsjhj = djZjzhfx.getJcsjhj();
item.setJc(jc);
item.setJcsjhj(jcsjhj);
if(jcsjhj>0){
double zb =jc/jcsjhj;
item.setZb(Double.parseDouble(df.format(zb)));
}
}
}
......@@ -1322,8 +1480,9 @@ public class DjdcServiceImpl implements DjdcService {
}
@Override
public List<LjZtzhdf> calZtzhdf(CommonParam param) {
public Map<String,Object> calZtzhdf(CommonParam param) {
Map<String,Object> map = new HashMap<>();
List<LjZtzhdf> ljZtzhdfList=new ArrayList<>();
List<LjSzfxjg> ljSzfxjgList=new ArrayList<>();
if(StringUtils.isNotEmpty(param.getJh())){
......@@ -1354,21 +1513,46 @@ public class DjdcServiceImpl implements DjdcService {
}else {
size=ztslList.size();
}
int ztsl=0;
for(int i =0;i<size;i++){
DjZtfx djZtfx = ztslList.get(i);
SjInfo sjInfo=new SjInfo();
sjInfo.setKc(djZtfx.getKc());
sjInfo.setZtcc(djZtfx.getCc());
sjInfo.setZtxh(djZtfx.getZtxh());
sjInfo.setJc(djZtfx.getJcMax());
sjInfo.setJs(djZtfx.getJxzsMax());
sjInfo.setJc(djZtfx.getJcZw());
sjInfo.setJs(djZtfx.getJxzsZw());
sjInfo.setZb(0.0);
sjInfo.setSl(djZtfx.getZtsl());
sjInfo.setGnmk("钻头分析区块");
sjInfo.setYtzl(djZtfx.getYtzl());
ztsl=djZtfx.getZtsl();
reList.add(sjInfo);
}
//按使用数量排序
if(size==3){
for(int i =3;i<ztslList.size();i++){
DjZtfx djZtfx = ztslList.get(i);
if(ztsl==djZtfx.getZtsl()){
SjInfo sjInfo=new SjInfo();
sjInfo.setKc(djZtfx.getKc());
sjInfo.setZtcc(djZtfx.getCc());
sjInfo.setZtxh(djZtfx.getZtxh());
sjInfo.setJc(djZtfx.getJcZw());
sjInfo.setJs(djZtfx.getJxzsZw());
sjInfo.setZb(0.0);
sjInfo.setSl(djZtfx.getZtsl());
sjInfo.setGnmk("钻头分析区块");
sjInfo.setYtzl(djZtfx.getYtzl());
reList.add(sjInfo);
ztsl=djZtfx.getZtsl();
}
}
}
//按一趟钻率排序
List<DjZtfx> zjlList=collect.stream()
.sorted(Comparator.comparingDouble(DjZtfx::getYtzl).reversed()).collect(Collectors.toList());
if(zjlList.size()>3){
......@@ -1376,25 +1560,47 @@ public class DjdcServiceImpl implements DjdcService {
}else {
size=zjlList.size();
}
Double ytzl=0.0;
for(int i =0;i<size;i++){
DjZtfx djZtfx = zjlList.get(i);
SjInfo sjInfo=new SjInfo();
sjInfo.setKc(djZtfx.getKc());
sjInfo.setZtcc(djZtfx.getCc());
sjInfo.setZtxh(djZtfx.getZtxh());
sjInfo.setJc(djZtfx.getJcMax());
sjInfo.setJs(djZtfx.getJxzsMax());
sjInfo.setJc(djZtfx.getJcZw());
sjInfo.setJs(djZtfx.getJxzsZw());
sjInfo.setZb(0.0);
sjInfo.setSl(djZtfx.getZtsl());
sjInfo.setGnmk("钻头分析区块");
sjInfo.setYtzl(djZtfx.getYtzl());
ytzl=djZtfx.getYtzl();
reList.add(sjInfo);
}
if(size==3){
for(int i =3;i<ztslList.size();i++){
DjZtfx djZtfx = ztslList.get(i);
if( equals(ytzl, djZtfx.getYtzl())){
SjInfo sjInfo=new SjInfo();
sjInfo.setKc(djZtfx.getKc());
sjInfo.setZtcc(djZtfx.getCc());
sjInfo.setZtxh(djZtfx.getZtxh());
sjInfo.setJc(djZtfx.getJcZw());
sjInfo.setJs(djZtfx.getJxzsZw());
sjInfo.setZb(0.0);
sjInfo.setSl(djZtfx.getZtsl());
sjInfo.setGnmk("钻头分析区块");
sjInfo.setYtzl(djZtfx.getYtzl());
reList.add(sjInfo);
ytzl=djZtfx.getYtzl();
}
}
}
List<SjInfo> collect1 = reList.stream().distinct().collect(Collectors.toList());
//计算得分
calculateScores(collect1);
// 按进尺降序排序
List<SjInfo> jcSorted = collect1.stream()
.sorted(Comparator.comparingDouble(SjInfo::getJc).reversed())
......@@ -1409,13 +1615,13 @@ public class DjdcServiceImpl implements DjdcService {
if(jcSorted.size()>=2){
SjInfo sjInfo = jcSorted.get(0);
SjInfo sjInfo2 = jcSorted.get(1);
ljSzfxjg.setFxxy("钻头数量使用最多是"+sjInfo.getZtxh()+"("+sjInfo.getSl()+"只)、一趟钻率("+sjInfo.getYtzl()+"%),其次钻头数量使用最多是"+sjInfo2.getZtxh()+"("+sjInfo2.getSl()+"只),一趟钻率("+sjInfo2.getYtzl()+"%)");
ljSzfxjg.setFxxy("钻头进尺最高是"+sjInfo.getZtxh()+"("+sjInfo.getSl()+"只)、进尺"+sjInfo.getJc()+"、一趟钻率("+sjInfo.getYtzl()+"%),其次钻头进尺最高是"+sjInfo2.getZtxh()+"("+sjInfo2.getSl()+"只),进尺"+sjInfo2.getJc()+"、一趟钻率("+sjInfo2.getYtzl()+"%)");
ljSzfxjg.setZyjy(sjInfo.getZtxh());
ljSzfxjg.setQcyj(sjInfo2.getZtxh());
ljSzfxjg.setTjpf(Double.parseDouble(df.format(sjInfo.getTotalScore())));
}else if(jcSorted.size()==1){
SjInfo sjInfo = jcSorted.get(0);
ljSzfxjg.setFxxy("钻头数量使用最多是"+sjInfo.getZtxh()+"、一趟钻率("+sjInfo.getYtzl()+"%)");
ljSzfxjg.setFxxy("钻头进尺最高是"+sjInfo.getZtxh()+"("+sjInfo.getSl()+"只)、进尺"+sjInfo.getJc()+"、一趟钻率("+sjInfo.getYtzl()+"%)");
ljSzfxjg.setZyjy(sjInfo.getZtxh());
ljSzfxjg.setTjpf(Double.parseDouble(df.format(sjInfo.getTotalScore())));
}
......@@ -1434,13 +1640,13 @@ public class DjdcServiceImpl implements DjdcService {
if(jsSorted.size()>=2){
SjInfo sjInfo = jsSorted.get(0);
SjInfo sjInfo2 = jsSorted.get(1);
ljSzfxjgjs.setFxxy("钻头数量使用最多是"+sjInfo.getZtxh()+"("+sjInfo.getSl()+"只)、一趟钻率("+sjInfo.getYtzl()+"%),其次钻头数量使用最多是"+sjInfo2.getZtxh()+"("+sjInfo2.getSl()+"只),一趟钻率("+sjInfo2.getYtzl()+"%)");
ljSzfxjgjs.setFxxy("钻头机速最快是"+sjInfo.getZtxh()+"("+sjInfo.getSl()+"只)、机械转速为"+sjInfo.getJs()+"、一趟钻率("+sjInfo.getYtzl()+"%),其次钻头数量使用最多是"+sjInfo2.getZtxh()+"("+sjInfo2.getSl()+"只),机械转速为"+sjInfo2.getJs()+"、一趟钻率("+sjInfo2.getYtzl()+"%)");
ljSzfxjgjs.setZyjy(sjInfo.getZtxh());
ljSzfxjgjs.setQcyj(sjInfo2.getZtxh());
ljSzfxjgjs.setTjpf(Double.parseDouble(df.format(sjInfo.getTotalScore())));
}else if(jsSorted.size()==1){
SjInfo sjInfo = jsSorted.get(0);
ljSzfxjgjs.setFxxy("钻头数量使用最多是"+sjInfo.getZtxh()+"、一趟钻率("+sjInfo.getYtzl()+"%)");
ljSzfxjgjs.setFxxy("钻头机速最快是"+sjInfo.getZtxh()+"("+sjInfo.getSl()+"只)、机械转速为"+sjInfo.getJs()+"、一趟钻率("+sjInfo.getYtzl()+"%)");
ljSzfxjgjs.setZyjy(sjInfo.getZtxh());
ljSzfxjgjs.setTjpf(Double.parseDouble(df.format(sjInfo.getTotalScore())));
}
......@@ -1472,22 +1678,23 @@ public class DjdcServiceImpl implements DjdcService {
ljSzfxjgList.add(ljSzfxjgSl);
//钻头关键数据(匹配数据)
List<SjInfo> collect3=new ArrayList<>();
List<Djjc> ztppList = djjcList.stream().filter(dj -> equals(dj.getZtcc(),info.getZtcc() ) && dj.getKc().equals(info.getKc())).collect(Collectors.toList());
ztppList.forEach(ztpp->{
SjInfo sjInfo=new SjInfo();
sjInfo.setKc(ztpp.getKc());
sjInfo.setZtcc(ztpp.getZtcc());
sjInfo.setZtxh(ztpp.getZtxh());
sjInfo.setJc(ztpp.getJc());
sjInfo.setJs(ztpp.getJxzs());
sjInfo.setJc(ztpp.getJc()==null?0.0:ztpp.getJc());
sjInfo.setJs(ztpp.getJxzs() ==null?0.0:ztpp.getJxzs());
sjInfo.setZb(ztpp.getZb());
sjInfo.setSl(1);
sjInfo.setGnmk("钻头关键数据");
collect1.add(sjInfo);
collect3.add(sjInfo);
});
calculateScores(collect1);
calculateScores(collect3);
collect1.addAll(collect3);
for(SjInfo sjInfodf:collect1){
LjZtzhdf ljZtzhdf=new LjZtzhdf();
ljZtzhdf.setKc(sjInfodf.getKc());
......@@ -1502,6 +1709,7 @@ public class DjdcServiceImpl implements DjdcService {
ljZtzhdfList.add(ljZtzhdf);
}
}
}
......@@ -1510,13 +1718,169 @@ public class DjdcServiceImpl implements DjdcService {
ljZtzhdfList=ljZtzhdfList.stream().distinct().collect(Collectors.toList());
int i=ljZtzhdfMapper.batchLjZtzhdf(ljZtzhdfList);
for(LjZtzhdf item:ljZtzhdfList){
LjZtdfzh ljZtdfzh=new LjZtdfzh();
ljZtdfzh.setKc(item.getKc());
ljZtdfzh.setZtxh(item.getZtxh());
ljZtdfzh.setCc(item.getCc());
ljZtdfzh.setJcdf(Double.parseDouble(df.format(item.getJcdf()+(item.getJsdf()*0.25))));
ljZtdfzh.setJsdf(Double.parseDouble(df.format(item.getJsdf()+(item.getJcdf()*0.25))));
ljZtdfzh.setZhdf(Double.parseDouble(df.format((item.getJcdf()*0.5)+(item.getJcdf()*5))));
ljZtdfzhMapper.insertLjZtdfzh(ljZtdfzh);
}
}
if(ljSzfxjgList.size()>0){
int i=ljSzfxjgMapper.batchLjSzfxjg(ljSzfxjgList);
}
return ljZtzhdfList;
map.put("ztzhdf",ljZtzhdfList);
map.put("szfxjg",ljSzfxjgList);
return map ;
}
@Override
public List<LjZtzhdf> getzhzhdfList(CommonParam param) {
return ljZtzhdfMapper.selectLjZtzhdfListByCom(param);
}
@Override
public List<LjSzfxjg> getszfxjgList(CommonParam param) {
return ljSzfxjgMapper.getszfxjgList(param);
}
@Override
public List<LjZtdfzh> getZtzhzzdfList(CommonParam param) {
return ljZtdfzhMapper.getZtzhzzdfList(param);
}
@Override
public int dyAiModelJxZjzh(CommonParam param) {
List<DjZjzhfx> list = djdcInfoMapper.getZjzhfxList(param);
int batchSize = 4;
// 计算批次数
int numBatches = (int) Math.ceil((double) list.size() / batchSize);
List<LjZjzhfx> zjzhfxList=new ArrayList<>();
List<List<DjZjzhfx>> collect = IntStream.range(0, numBatches)
.mapToObj(i -> {
int start = i * batchSize;
int end = Math.min(start + batchSize, list.size());
return list.subList(start, end);
}).collect(Collectors.toList());
for(List<DjZjzhfx> djZjzhfxes:collect){
for(DjZjzhfx item:djZjzhfxes){
String jh = item.getJh();
String kc = item.getKc();
LjZjzhfx ljZjzhfx =new LjZjzhfx();
ljZjzhfx.setJh(jh);
ljZjzhfx.setKc(kc);
List<LjZjzhfx> zjzhfxList1 = ljZjzhfxMapper.selectLjZjzhfxList(ljZjzhfx);
if(zjzhfxList1.size()==0) {
String zjzh = item.getZjzh();
if (StringUtils.isNotEmpty(zjzh)) {
Map<String, Object> map = new HashMap<>();
map.put("prompt", zjzh + " 这是一个钻具组合信息,请把这个钻具组合信息拆分成竖表," +
"字段为钻具名称(zjmc)、型号(xh)、长度(cd),最终输出json格式数据,其他内容不输出," +
"输出内容不换行,只要数据,反斜杠不输出,输出格式为:\"{\\\"data\\\":[{\\\"zjmc\\\":\\\"\\***\\\",\\\"xh\\\":\\\"*\\\",\\\"cd\\\":\\\"*\\\"}]}");
Gson gson = new GsonBuilder().setPrettyPrinting().create();
String json = gson.toJson(map);
String url = "http://10.68.249.59:33331/api/chat/1";
String result2 = HttpRequest.post(url).body(json).execute().body();
System.out.println(result2);
JSONObject jsonObject = JSON.parseObject(result2);
Object error = jsonObject.get("error");
if (error != null) {
System.out.println("错误信息: " + jsonObject.getString("error"));
continue;
}
// 解析API响应
// Gson gsonres = new GsonBuilder().setPrettyPrinting().create();
JsonObject apiResponse = JsonParser.parseString(result2).getAsJsonObject();
// 提取message.content字段
JsonObject message = apiResponse.getAsJsonObject("message");
String content = message.get("content").getAsString();
// 提取content中的JSON部分(去除Markdown代码块标记)
String jsonContent = extractJsonContent(content);
// 解析并格式化JSON内容
JsonReader reader = new JsonReader(new StringReader(jsonContent));
reader.setLenient(true);
JsonElement jsonElement = JsonParser.parseReader(reader);
// JsonElement jsonElement = JsonParser.parseString(jsonContent);
String formattedJson = gson.toJson(jsonElement);
// 输出格式化后的JSON
System.out.println(formattedJson);
// 示例:处理解析后的数据
JsonObject dataObject = JsonParser.parseString(jsonContent).getAsJsonObject();
JsonArray dataArray = dataObject.getAsJsonArray("data");
String zjzhmx = "";
String tsgj = "";
// 遍历数据数组
for (JsonElement element : dataArray) {
JsonObject it = element.getAsJsonObject();
String zjmc = it.get("zjmc").getAsString();
String xh = it.get("xh").getAsString();
String cd = it.get("cd").getAsString();
//判断钻具组合模型
if (zjmc.contains("单弯螺杆") || zjmc.contains("无磁钻铤") || zjmc.contains("加重钻杆") || zjmc.contains("钻杆")) {
if (StringUtils.isEmpty(zjzhmx)) {
zjzhmx = (xh + "+" + zjmc);
} else {
zjzhmx = zjzhmx + "+" + (xh + "+" + zjmc);
}
}
//判断特殊钻具
if (zjmc.contains("随钻扩眼器") || zjmc.contains("微偏心扩眼器") || zjmc.contains("水力振荡器") || zjmc.contains("修壁器")) {
if (StringUtils.isEmpty(zjzhmx)) {
tsgj = (xh + "+" + zjmc);
} else {
tsgj = tsgj + "+" + (xh + "+" + zjmc);
}
}
}
LjZjzhfx zjzhfx=new LjZjzhfx();
zjzhfx.setZjzhmx(zjzhmx);
zjzhfx.setTsgj(tsgj);
zjzhfx.setZjzh(zjzh);
zjzhfx.setJh(jh);
zjzhfx.setKc(kc);
ljZjzhfxMapper.insertLjZjzhfx(zjzhfx);
// zjzhfxList.add(zjzhfx);
}
}
}
try {
Thread.sleep(1000); // 每次循环暂停1秒
} catch (InterruptedException e) {
e.printStackTrace();
}
}
if(zjzhfxList.size()>0){
int i = ljZjzhfxMapper.batchLjZjzhfx(zjzhfxList);
return i;
}else {
return 0;
}
}
......
package com.ruoyi.project.zt.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.zt.mapper.LjZjzhfxMapper;
import com.ruoyi.project.zt.domain.LjZjzhfx;
import com.ruoyi.project.zt.service.ILjZjzhfxService;
/**
* 邻井-钻具组合分析Service业务层处理
*
* @author ruoyi
* @date 2025-07-02
*/
@Service
public class LjZjzhfxServiceImpl implements ILjZjzhfxService
{
@Autowired
private LjZjzhfxMapper ljZjzhfxMapper;
/**
* 查询邻井-钻具组合分析
*
* @param id 邻井-钻具组合分析主键
* @return 邻井-钻具组合分析
*/
@Override
public LjZjzhfx selectLjZjzhfxById(Long id)
{
return ljZjzhfxMapper.selectLjZjzhfxById(id);
}
/**
* 查询邻井-钻具组合分析列表
*
* @param ljZjzhfx 邻井-钻具组合分析
* @return 邻井-钻具组合分析
*/
@Override
public List<LjZjzhfx> selectLjZjzhfxList(LjZjzhfx ljZjzhfx)
{
return ljZjzhfxMapper.selectLjZjzhfxList(ljZjzhfx);
}
/**
* 新增邻井-钻具组合分析
*
* @param ljZjzhfx 邻井-钻具组合分析
* @return 结果
*/
@Override
public int insertLjZjzhfx(LjZjzhfx ljZjzhfx)
{
return ljZjzhfxMapper.insertLjZjzhfx(ljZjzhfx);
}
/**
* 修改邻井-钻具组合分析
*
* @param ljZjzhfx 邻井-钻具组合分析
* @return 结果
*/
@Override
public int updateLjZjzhfx(LjZjzhfx ljZjzhfx)
{
ljZjzhfx.setUpdateTime(DateUtils.getNowDate());
return ljZjzhfxMapper.updateLjZjzhfx(ljZjzhfx);
}
/**
* 批量删除邻井-钻具组合分析
*
* @param ids 需要删除的邻井-钻具组合分析主键
* @return 结果
*/
@Override
public int deleteLjZjzhfxByIds(Long[] ids)
{
return ljZjzhfxMapper.deleteLjZjzhfxByIds(ids);
}
/**
* 删除邻井-钻具组合分析信息
*
* @param id 邻井-钻具组合分析主键
* @return 结果
*/
@Override
public int deleteLjZjzhfxById(Long id)
{
return ljZjzhfxMapper.deleteLjZjzhfxById(id);
}
}
package com.ruoyi.project.zt.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.zt.mapper.LjZtdfzhMapper;
import com.ruoyi.project.zt.domain.LjZtdfzh;
import com.ruoyi.project.zt.service.ILjZtdfzhService;
/**
* 邻井-钻头得分综合Service业务层处理
*
* @author ruoyi
* @date 2025-06-30
*/
@Service
public class LjZtdfzhServiceImpl implements ILjZtdfzhService
{
@Autowired
private LjZtdfzhMapper ljZtdfzhMapper;
/**
* 查询邻井-钻头得分综合
*
* @param id 邻井-钻头得分综合主键
* @return 邻井-钻头得分综合
*/
@Override
public LjZtdfzh selectLjZtdfzhById(Long id)
{
return ljZtdfzhMapper.selectLjZtdfzhById(id);
}
/**
* 查询邻井-钻头得分综合列表
*
* @param ljZtdfzh 邻井-钻头得分综合
* @return 邻井-钻头得分综合
*/
@Override
public List<LjZtdfzh> selectLjZtdfzhList(LjZtdfzh ljZtdfzh)
{
return ljZtdfzhMapper.selectLjZtdfzhList(ljZtdfzh);
}
/**
* 新增邻井-钻头得分综合
*
* @param ljZtdfzh 邻井-钻头得分综合
* @return 结果
*/
@Override
public int insertLjZtdfzh(LjZtdfzh ljZtdfzh)
{
return ljZtdfzhMapper.insertLjZtdfzh(ljZtdfzh);
}
/**
* 修改邻井-钻头得分综合
*
* @param ljZtdfzh 邻井-钻头得分综合
* @return 结果
*/
@Override
public int updateLjZtdfzh(LjZtdfzh ljZtdfzh)
{
return ljZtdfzhMapper.updateLjZtdfzh(ljZtdfzh);
}
/**
* 批量删除邻井-钻头得分综合
*
* @param ids 需要删除的邻井-钻头得分综合主键
* @return 结果
*/
@Override
public int deleteLjZtdfzhByIds(Long[] ids)
{
return ljZtdfzhMapper.deleteLjZtdfzhByIds(ids);
}
/**
* 删除邻井-钻头得分综合信息
*
* @param id 邻井-钻头得分综合主键
* @return 结果
*/
@Override
public int deleteLjZtdfzhById(Long id)
{
return ljZtdfzhMapper.deleteLjZtdfzhById(id);
}
}
......@@ -225,7 +225,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getZqshfxList" resultType="com.ruoyi.project.zt.domain.DjZqsjfx">
select a.jh,c.kc,ksjs,c.js
select a.jh,c.kc,ksjs,c.js,to_char((case when kc ='1' then b.KZRQ1 when kc ='2' then b.KZRQ2 when kc ='3' then b.KZRQ3 when kc ='4' then b.KZRQ4 when kc ='5' then b.KZRQ5 else null end ),'YYYY-MM-DD') || ' ' ||
TO_CHAR(TO_DATE((case when kc ='1' then b.KZSJ1 when kc ='2' then b.KZSJ2 when kc ='3' then b.KZSJ3 when kc ='4' then b.KZSJ4 when kc ='5' then b.KZSJ5 else null end ), 'HH24MI'), 'HH24:MI') || ':00' AS kssj
,to_char((case when kc ='1' then b.KZRQ2 when kc ='2' then (case when KZRQ3 is null or KZRQ3 ='' then WJRQ else KZRQ3 end ) when kc ='3' then (case when KZRQ4 is null or KZRQ4 ='' then WJRQ else KZRQ4 end ) when kc ='4' then (case when KZRQ5 is null or KZRQ5 ='' then WJRQ else KZRQ5 end ) when kc ='5' then b.WJRQ else null end ),'YYYY-MM-DD') || ' ' ||
TO_CHAR(TO_DATE((case when kc ='1' then b.KZSJ2 when kc ='2' then (case when KZRQ3 is null or KZRQ3 ='' then WJSJ else KZSJ3 end ) when kc ='3' then (case when KZRQ4 is null or KZRQ4 ='' then WJSJ else KZSJ4 end ) when kc ='4' then (case when KZRQ5 is null or KZRQ5 ='' then WJSJ else KZSJ5 end ) when kc ='5' then b.WJSJ else null end ), 'HH24MI'), 'HH24:MI') || ':00' AS JSSJ
from JSBA a
left join jsaa b on a.jh = b.jh
left join (
......
......@@ -28,5 +28,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select * from (
select * from JSwA where RJC>0 and jh=#{jh} and js=#{js} ) where ROWNUM=1
</select>
<select id="selectZwsj" resultType="com.ruoyi.project.zt.domain.Jswa">
select *from (
select * from JSwA where 1=1
<if test="jh!=null and jh!=''">
and jh =#{jh}
</if>
<if test="ksrq!=null and ksrq!=''">
and to_char(RQ,'YYYY-MM-DD')>=#{ksrq}
</if>
<if test="jsrq!=null and jsrq!=''">
and to_char(RQ,'YYYY-MM-DD')&lt;=#{jsrq}
</if>
<if test="js!=null ">
and js = #{js}
</if>
) where ROWNUM =1
</select>
</mapper>
\ No newline at end of file
......@@ -50,6 +50,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectLjSzfxjgVo"/>
where id = #{id}
</select>
<select id="getszfxjgList" resultType="com.ruoyi.project.zt.domain.LjSzfxjg">
<include refid="selectLjSzfxjgVo"/>
<where>
<if test="gnmk != null and gnmk != ''"> and gnmk = #{gnmk}</if>
<if test="fxfw != null and fxfw != ''"> and fxfw = #{fxfw}</if>
<if test="fxdx != null and fxdx != ''"> and fxdx = #{fxdx}</if>
<if test="fxxy != null and fxxy != ''"> and fxxy = #{fxxy}</if>
<if test="fxjl != null and fxjl != ''"> and fxjl = #{fxjl}</if>
<if test="scfx != null and scfx != ''"> and scfx = #{scfx}</if>
<if test="yxyj != null and yxyj != ''"> and yxyj = #{yxyj}</if>
<if test="zyjy != null and zyjy != ''"> and zyjy = #{zyjy}</if>
<if test="qcyj != null and qcyj != ''"> and qcyj = #{qcyj}</if>
<if test="tjpf != null "> and tjpf = #{tjpf}</if>
<if test="xxcs != null and xxcs != ''"> and xxcs = #{xxcs}</if>
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
<if test="createdTime != null "> and created_time = #{createdTime}</if>
</where>
</select>
<insert id="insertLjSzfxjg" parameterType="LjSzfxjg" useGeneratedKeys="true" keyProperty="id">
insert into lj_szfxjg
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.zt.mapper.LjZjzhfxMapper">
<resultMap type="LjZjzhfx" id="LjZjzhfxResult">
<result property="id" column="id" />
<result property="jh" column="jh" />
<result property="kc" column="kc" />
<result property="zjzhmx" column="zjzhmx" />
<result property="tsgj" column="tsgj" />
<result property="zjzh" column="zjzh" />
<result property="createdBy" column="created_by" />
<result property="createdTime" column="created_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectLjZjzhfxVo">
select id, jh, kc, zjzhmx, tsgj, zjzh, created_by, created_time, update_by, update_time from lj_zjzhfx
</sql>
<select id="selectLjZjzhfxList" parameterType="LjZjzhfx" resultMap="LjZjzhfxResult">
<include refid="selectLjZjzhfxVo"/>
<where>
<if test="jh != null and jh != ''"> and jh = #{jh}</if>
<if test="kc != null and kc != ''"> and kc = #{kc}</if>
<if test="zjzhmx != null and zjzhmx != ''"> and zjzhmx = #{zjzhmx}</if>
<if test="tsgj != null and tsgj != ''"> and tsgj = #{tsgj}</if>
<if test="zjzh != null and zjzh != ''"> and zjzh = #{zjzh}</if>
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
<if test="createdTime != null "> and created_time = #{createdTime}</if>
</where>
</select>
<select id="selectLjZjzhfxById" parameterType="Long" resultMap="LjZjzhfxResult">
<include refid="selectLjZjzhfxVo"/>
where id = #{id}
</select>
<insert id="insertLjZjzhfx" parameterType="LjZjzhfx" >
insert into lj_zjzhfx
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="jh != null">jh,</if>
<if test="kc != null">kc,</if>
<if test="zjzhmx != null">zjzhmx,</if>
<if test="tsgj != null">tsgj,</if>
<if test="zjzh != null">zjzh,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="jh != null">#{jh},</if>
<if test="kc != null">#{kc},</if>
<if test="zjzhmx != null">#{zjzhmx},</if>
<if test="tsgj != null">#{tsgj},</if>
<if test="zjzh != null">#{zjzh},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<insert id="batchLjZjzhfx">
INSERT ALL
<foreach item="item" index="index" collection="list">
INTO lj_zjzhfx (jh, kc, zjzhmx, tsgj, zjzh)
VALUES (#{item.jh}, #{item.kc}, #{item.zjzhmx}, #{item.tsgj}, #{item.zjzh})
</foreach>
SELECT 1 FROM DUAL
</insert>
<update id="updateLjZjzhfx" parameterType="LjZjzhfx">
update lj_zjzhfx
<trim prefix="SET" suffixOverrides=",">
<if test="jh != null">jh = #{jh},</if>
<if test="kc != null">kc = #{kc},</if>
<if test="zjzhmx != null">zjzhmx = #{zjzhmx},</if>
<if test="tsgj != null">tsgj = #{tsgj},</if>
<if test="zjzh != null">zjzh = #{zjzh},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteLjZjzhfxById" parameterType="Long">
delete from lj_zjzhfx where id = #{id}
</delete>
<delete id="deleteLjZjzhfxByIds" parameterType="String">
delete from lj_zjzhfx where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.zt.mapper.LjZtdfzhMapper">
<resultMap type="LjZtdfzh" id="LjZtdfzhResult">
<result property="id" column="id" />
<result property="kc" column="kc" />
<result property="ztxh" column="ztxh" />
<result property="cc" column="cc" />
<result property="jcdf" column="jcdf" />
<result property="jsdf" column="jsdf" />
<result property="zhdf" column="zhdf" />
</resultMap>
<sql id="selectLjZtdfzhVo">
select id, kc, ztxh, cc, jcdf, jsdf, zhdf from lj_ztdfzh
</sql>
<select id="selectLjZtdfzhList" parameterType="LjZtdfzh" resultMap="LjZtdfzhResult">
<include refid="selectLjZtdfzhVo"/>
<where>
<if test="kc != null and kc != ''"> and kc = #{kc}</if>
<if test="ztxh != null and ztxh != ''"> and ztxh = #{ztxh}</if>
<if test="cc != null "> and cc = #{cc}</if>
<if test="jcdf != null "> and jcdf = #{jcdf}</if>
<if test="jsdf != null "> and jsdf = #{jsdf}</if>
<if test="zhdf != null "> and zhdf = #{zhdf}</if>
</where>
</select>
<select id="selectLjZtdfzhById" parameterType="Long" resultMap="LjZtdfzhResult">
<include refid="selectLjZtdfzhVo"/>
where id = #{id}
</select>
<select id="getZtzhzzdfList" resultType="com.ruoyi.project.zt.domain.LjZtdfzh">
<include refid="selectLjZtdfzhVo"/>
<where>
<if test="kc != null and kc != ''"> and kc = #{kc}</if>
<if test="ztxh != null and ztxh != ''"> and ztxh = #{ztxh}</if>
<if test="cc != null "> and cc = #{cc}</if>
<if test="jcdf != null "> and jcdf = #{jcdf}</if>
<if test="jsdf != null "> and jsdf = #{jsdf}</if>
<if test="zhdf != null "> and zhdf = #{zhdf}</if>
</where>
</select>
<insert id="insertLjZtdfzh" parameterType="LjZtdfzh" useGeneratedKeys="true" keyProperty="id">
insert into lj_ztdfzh
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="kc != null">kc,</if>
<if test="ztxh != null">ztxh,</if>
<if test="cc != null">cc,</if>
<if test="jcdf != null">jcdf,</if>
<if test="jsdf != null">jsdf,</if>
<if test="zhdf != null">zhdf,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="kc != null">#{kc},</if>
<if test="ztxh != null">#{ztxh},</if>
<if test="cc != null">#{cc},</if>
<if test="jcdf != null">#{jcdf},</if>
<if test="jsdf != null">#{jsdf},</if>
<if test="zhdf != null">#{zhdf},</if>
</trim>
</insert>
<update id="updateLjZtdfzh" parameterType="LjZtdfzh">
update lj_ztdfzh
<trim prefix="SET" suffixOverrides=",">
<if test="kc != null">kc = #{kc},</if>
<if test="ztxh != null">ztxh = #{ztxh},</if>
<if test="cc != null">cc = #{cc},</if>
<if test="jcdf != null">jcdf = #{jcdf},</if>
<if test="jsdf != null">jsdf = #{jsdf},</if>
<if test="zhdf != null">zhdf = #{zhdf},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteLjZtdfzhById" parameterType="Long">
delete from lj_ztdfzh where id = #{id}
</delete>
<delete id="deleteLjZtdfzhByIds" parameterType="String">
delete from lj_ztdfzh where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
......@@ -44,6 +44,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectLjZtzhdfVo"/>
where id = #{id}
</select>
<select id="selectLjZtzhdfListByCom" resultMap="LjZtzhdfResult">
<include refid="selectLjZtzhdfVo"/>
<where>
<if test="kc != null and kc != ''"> and kc = #{kc}</if>
<if test="ztxh != null and ztxh != ''"> and ztxh = #{ztxh}</if>
<if test="cc != null "> and cc = #{cc}</if>
<if test="jcdf != null "> and jcdf = #{jcdf}</if>
<if test="jsdf != null "> and jsdf = #{jsdf}</if>
<if test="zbdf != null "> and zbdf = #{zbdf}</if>
<if test="sldf != null "> and sldf = #{sldf}</if>
<if test="zhdf != null "> and zhdf = #{zhdf}</if>
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
<if test="createdTime != null "> and created_time = #{createdTime}</if>
</where>
</select>
<insert id="insertLjZtzhdf" parameterType="LjZtzhdf" useGeneratedKeys="true" keyProperty="id">
insert into lj_ztzhdf
......
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