Commit 6ae78efc by jiang'yun

修改

parent 894c397f
package com.ruoyi.framework.util;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.Base64;
public class ImageCompressor {
// 压缩Base64图片
public static String compressBase64Image(String base64Image, float quality, int maxWidth, int maxHeight) {
try {
// 去除Base64前缀
String base64Data = base64Image.replaceAll("data:image/.*?;base64,", "");
// 解码Base64为字节数组
byte[] imageBytes = Base64.getDecoder().decode(base64Data);
// 读取图片
BufferedImage originalImage = ImageIO.read(new ByteArrayInputStream(imageBytes));
// 计算压缩后的尺寸
int[] newDimensions = calculateDimensions(originalImage.getWidth(), originalImage.getHeight(), maxWidth, maxHeight);
int newWidth = newDimensions[0];
int newHeight = newDimensions[1];
// 创建压缩后的图片
BufferedImage resizedImage = new BufferedImage(newWidth, newHeight, BufferedImage.TYPE_INT_RGB);
Graphics2D g = resizedImage.createGraphics();
g.drawImage(originalImage, 0, 0, newWidth, newHeight, null);
g.dispose();
// 压缩图片质量
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
ImageIO.write(resizedImage, "jpg", outputStream);
// 编码为Base64并添加前缀
String compressedBase64 = Base64.getEncoder().encodeToString(outputStream.toByteArray());
return "data:image/jpeg;base64," + compressedBase64;
} catch (IOException e) {
// 处理异常,无法压缩时返回原图
return base64Image;
}
}
// 计算压缩后的尺寸,保持比例
private static int[] calculateDimensions(int originalWidth, int originalHeight, int maxWidth, int maxHeight) {
if (originalWidth <= maxWidth && originalHeight <= maxHeight) {
return new int[]{originalWidth, originalHeight};
}
double widthRatio = (double) maxWidth / originalWidth;
double heightRatio = (double) maxHeight / originalHeight;
double ratio = Math.min(widthRatio, heightRatio);
return new int[]{
(int) (originalWidth * ratio),
(int) (originalHeight * ratio)
};
}
}
package com.ruoyi.framework.util;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class RichTextProcessor {
// 匹配img标签的正则表达式
private static final Pattern IMG_TAG_PATTERN = Pattern.compile("<img[^>]+src\\s*=\\s*['\"]([^'\"]+)['\"][^>]*>");
// 处理富文本,压缩其中的图片
public static String processRichText(String richText, float quality, int maxWidth, int maxHeight) {
if (richText == null || richText.isEmpty()) {
return richText;
}
Matcher matcher = IMG_TAG_PATTERN.matcher(richText);
StringBuffer sb = new StringBuffer();
while (matcher.find()) {
String imgTag = matcher.group(0);
String src = matcher.group(1);
// 只处理Base64图片
if (src.startsWith("data:image/")) {
String compressedSrc = ImageCompressor.compressBase64Image(src, quality, maxWidth, maxHeight);
String compressedImgTag = imgTag.replace(src, compressedSrc);
matcher.appendReplacement(sb, compressedImgTag);
}
}
matcher.appendTail(sb);
return sb.toString();
}
}
...@@ -41,7 +41,7 @@ public class SjDcfxDzfcController extends BaseController ...@@ -41,7 +41,7 @@ public class SjDcfxDzfcController extends BaseController
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(SjDcfxDzfc sjDcfxDzfc) public TableDataInfo list(SjDcfxDzfc sjDcfxDzfc)
{ {
startPage(); // startPage();
List<SjDcfxDzfc> list = sjDcfxDzfcService.selectSjDcfxDzfcList(sjDcfxDzfc); List<SjDcfxDzfc> list = sjDcfxDzfcService.selectSjDcfxDzfcList(sjDcfxDzfc);
return getDataTable(list); return getDataTable(list);
} }
......
...@@ -80,6 +80,12 @@ public class SjLjjwController extends BaseController ...@@ -80,6 +80,12 @@ public class SjLjjwController extends BaseController
return toAjax(sjLjjwService.insertSjLjjw(sjLjjw)); return toAjax(sjLjjwService.insertSjLjjw(sjLjjw));
} }
@PostMapping("/pladd")
public AjaxResult pladd(@RequestBody List<SjLjjw> list)
{
return toAjax(sjLjjwService.insertSjLjjwBatch(list));
}
/** /**
* 修改设计-邻井井位 * 修改设计-邻井井位
*/ */
...@@ -101,4 +107,15 @@ public class SjLjjwController extends BaseController ...@@ -101,4 +107,15 @@ public class SjLjjwController extends BaseController
{ {
return toAjax(sjLjjwService.deleteSjLjjwByIds(ids)); return toAjax(sjLjjwService.deleteSjLjjwByIds(ids));
} }
@PostMapping("/addAll")
public AjaxResult addAll(@RequestBody List<SjLjjw> list)
{
if(list.size()==0){
return AjaxResult.error();
}
sjLjjwService.deleteSjLjjwByJh(list.get(0).getJh());
return toAjax(sjLjjwService.insertSjLjjwBatch(list));
}
} }
...@@ -58,4 +58,9 @@ public interface ISjLjjwService ...@@ -58,4 +58,9 @@ public interface ISjLjjwService
* @return 结果 * @return 结果
*/ */
public int deleteSjLjjwById(Long id); public int deleteSjLjjwById(Long id);
int insertSjLjjwBatch(List<SjLjjw> list);
int deleteSjLjjwByJh(String jh);
} }
package com.ruoyi.project.zjsgfa.service.impl; package com.ruoyi.project.zjsgfa.service.impl;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import cn.hutool.core.codec.Base64; import cn.hutool.core.codec.Base64;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.util.RichTextProcessor;
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.ruoyi.project.zjsgfa.mapper.JcxxHseMapper; import com.ruoyi.project.zjsgfa.mapper.JcxxHseMapper;
...@@ -32,7 +34,18 @@ public class JcxxHseServiceImpl implements IJcxxHseService ...@@ -32,7 +34,18 @@ public class JcxxHseServiceImpl implements IJcxxHseService
@Override @Override
public JcxxHse selectJcxxHseById(Long id) public JcxxHse selectJcxxHseById(Long id)
{ {
return jcxxHseMapper.selectJcxxHseById(id); JcxxHse jcxxHse = jcxxHseMapper.selectJcxxHseById(id);
// 压缩富文本中的图片,设置质量和最大尺寸
String compressedContent = RichTextProcessor.processRichText(
jcxxHse.getHse(), // 你的富文本字段
0.7f, // 质量 0.0-1.0
800, // 最大宽度
600 // 最大高度
);
// 设置压缩后的富文本
jcxxHse.setHse(compressedContent);
return jcxxHse;
} }
/** /**
...@@ -44,7 +57,22 @@ public class JcxxHseServiceImpl implements IJcxxHseService ...@@ -44,7 +57,22 @@ public class JcxxHseServiceImpl implements IJcxxHseService
@Override @Override
public List<JcxxHse> selectJcxxHseList(JcxxHse jcxxHse) public List<JcxxHse> selectJcxxHseList(JcxxHse jcxxHse)
{ {
return jcxxHseMapper.selectJcxxHseList(jcxxHse); List<JcxxHse> list = jcxxHseMapper.selectJcxxHseList(jcxxHse);
list.stream().map(entity -> {
// 压缩富文本中的图片,设置质量和最大尺寸
String compressedContent = RichTextProcessor.processRichText(
entity.getHse(), // 你的富文本字段
0.7f, // 质量 0.0-1.0
800, // 最大宽度
600 // 最大高度
);
// 设置压缩后的富文本
entity.setHse(compressedContent);
return entity;
}).collect(Collectors.toList());
return list;
} }
/** /**
......
package com.ruoyi.project.zjsgfa.service.impl; package com.ruoyi.project.zjsgfa.service.impl;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import cn.hutool.core.codec.Base64; import cn.hutool.core.codec.Base64;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.util.RichTextProcessor;
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.ruoyi.project.zjsgfa.mapper.JcxxJkzpMapper; import com.ruoyi.project.zjsgfa.mapper.JcxxJkzpMapper;
...@@ -32,7 +34,51 @@ public class JcxxJkzpServiceImpl implements IJcxxJkzpService ...@@ -32,7 +34,51 @@ public class JcxxJkzpServiceImpl implements IJcxxJkzpService
@Override @Override
public JcxxJkzp selectJcxxJkzpById(Long id) public JcxxJkzp selectJcxxJkzpById(Long id)
{ {
return jcxxJkzpMapper.selectJcxxJkzpById(id); JcxxJkzp jcxxJkzp = jcxxJkzpMapper.selectJcxxJkzpById(id);
// 压缩富文本中的图片,设置质量和最大尺寸
String compressedContent = RichTextProcessor.processRichText(
jcxxJkzp.getZjkzz(), // 你的富文本字段
0.7f, // 质量 0.0-1.0
800, // 最大宽度
600 // 最大高度
);
// 设置压缩后的富文本
jcxxJkzp.setZjkzz(compressedContent);
String clcb = RichTextProcessor.processRichText(
jcxxJkzp.getClcb(), // 你的富文本字段
0.7f, // 质量 0.0-1.0
800, // 最大宽度
600 // 最大高度
);
// 设置压缩后的富文本
jcxxJkzp.setClcb(clcb);
String jlgh = RichTextProcessor.processRichText(
jcxxJkzp.getJlgh(), // 你的富文本字段
0.7f, // 质量 0.0-1.0
800, // 最大宽度
600 // 最大高度
);
// 设置压缩后的富文本
jcxxJkzp.setJlgh(jlgh);
String syyq = RichTextProcessor.processRichText(
jcxxJkzp.getSyyq(), // 你的富文本字段
0.7f, // 质量 0.0-1.0
800, // 最大宽度
600 // 最大高度
);
// 设置压缩后的富文本
jcxxJkzp.setSyyq(syyq);
return jcxxJkzp;
} }
/** /**
...@@ -44,7 +90,54 @@ public class JcxxJkzpServiceImpl implements IJcxxJkzpService ...@@ -44,7 +90,54 @@ public class JcxxJkzpServiceImpl implements IJcxxJkzpService
@Override @Override
public List<JcxxJkzp> selectJcxxJkzpList(JcxxJkzp jcxxJkzp) public List<JcxxJkzp> selectJcxxJkzpList(JcxxJkzp jcxxJkzp)
{ {
return jcxxJkzpMapper.selectJcxxJkzpList(jcxxJkzp); List<JcxxJkzp> list = jcxxJkzpMapper.selectJcxxJkzpList(jcxxJkzp);
list.stream().map(entity -> {
// 压缩富文本中的图片,设置质量和最大尺寸
String compressedContent = RichTextProcessor.processRichText(
entity.getZjkzz(), // 你的富文本字段
0.7f, // 质量 0.0-1.0
800, // 最大宽度
600 // 最大高度
);
// 设置压缩后的富文本
entity.setZjkzz(compressedContent);
String clcb = RichTextProcessor.processRichText(
entity.getClcb(), // 你的富文本字段
0.7f, // 质量 0.0-1.0
800, // 最大宽度
600 // 最大高度
);
// 设置压缩后的富文本
entity.setClcb(clcb);
String jlgh = RichTextProcessor.processRichText(
entity.getJlgh(), // 你的富文本字段
0.7f, // 质量 0.0-1.0
800, // 最大宽度
600 // 最大高度
);
// 设置压缩后的富文本
entity.setJlgh(jlgh);
String syyq = RichTextProcessor.processRichText(
entity.getSyyq(), // 你的富文本字段
0.7f, // 质量 0.0-1.0
800, // 最大宽度
600 // 最大高度
);
// 设置压缩后的富文本
entity.setSyyq(syyq);
return entity;
}).collect(Collectors.toList());
return list;
} }
/** /**
......
...@@ -137,20 +137,20 @@ public class SjDjjcServiceImpl implements ISjDjjcService ...@@ -137,20 +137,20 @@ public class SjDjjcServiceImpl implements ISjDjjcService
param.setJh(null); param.setJh(null);
//保存邻井 //保存邻井
List<Ljjw> ljjwList = djdcService.getLjjwList(param); // List<Ljjw> ljjwList = djdcService.getLjjwList(param);
List<SjLjjw> sjLjjwList=new ArrayList<>(); // List<SjLjjw> sjLjjwList=new ArrayList<>();
ljjwList.forEach(item->{ // ljjwList.forEach(item->{
SjLjjw sjLjjw=new SjLjjw(); // SjLjjw sjLjjw=new SjLjjw();
BeanUtils.copyProperties(item,sjLjjw); // BeanUtils.copyProperties(item,sjLjjw);
sjLjjw.setJh(jh); // sjLjjw.setJh(jh);
sjLjjw.setLjjh(item.getJh()); // sjLjjw.setLjjh(item.getJh());
sjLjjwList.add(sjLjjw); // sjLjjwList.add(sjLjjw);
}); // });
if(sjLjjwList.size()>0){ // if(sjLjjwList.size()>0){
sjLjjwMapper.deleteSjLjjwByJh(jh); // sjLjjwMapper.deleteSjLjjwByJh(jh);
sjLjjwMapper.insertSjLjjwBatch(sjLjjwList); // sjLjjwMapper.insertSjLjjwBatch(sjLjjwList);
//
} // }
param.setJkhzb(null); param.setJkhzb(null);
param.setJkzzb(null); param.setJkzzb(null);
param.setJdhzb(null); param.setJdhzb(null);
......
package com.ruoyi.project.zjsgfa.service.impl; package com.ruoyi.project.zjsgfa.service.impl;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import cn.hutool.core.codec.Base64; import cn.hutool.core.codec.Base64;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.util.RichTextProcessor;
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.ruoyi.project.zjsgfa.mapper.SjHseMapper; import com.ruoyi.project.zjsgfa.mapper.SjHseMapper;
...@@ -32,7 +34,18 @@ public class SjHseServiceImpl implements ISjHseService ...@@ -32,7 +34,18 @@ public class SjHseServiceImpl implements ISjHseService
@Override @Override
public SjHse selectSjHseById(Long id) public SjHse selectSjHseById(Long id)
{ {
return sjHseMapper.selectSjHseById(id); SjHse sjHse = sjHseMapper.selectSjHseById(id);
// 压缩富文本中的图片,设置质量和最大尺寸
String compressedContent = RichTextProcessor.processRichText(
sjHse.getHse(), // 你的富文本字段
0.7f, // 质量 0.0-1.0
800, // 最大宽度
600 // 最大高度
);
// 设置压缩后的富文本
sjHse.setHse(compressedContent);
return sjHse;
} }
/** /**
...@@ -44,7 +57,21 @@ public class SjHseServiceImpl implements ISjHseService ...@@ -44,7 +57,21 @@ public class SjHseServiceImpl implements ISjHseService
@Override @Override
public List<SjHse> selectSjHseList(SjHse sjHse) public List<SjHse> selectSjHseList(SjHse sjHse)
{ {
return sjHseMapper.selectSjHseList(sjHse); List<SjHse> list = sjHseMapper.selectSjHseList(sjHse);
list.stream().map(entity -> {
// 压缩富文本中的图片,设置质量和最大尺寸
String compressedContent = RichTextProcessor.processRichText(
entity.getHse(), // 你的富文本字段
0.7f, // 质量 0.0-1.0
800, // 最大宽度
600 // 最大高度
);
// 设置压缩后的富文本
entity.setHse(compressedContent);
return entity;
}).collect(Collectors.toList());
return list;
} }
/** /**
......
package com.ruoyi.project.zjsgfa.service.impl; package com.ruoyi.project.zjsgfa.service.impl;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import cn.hutool.core.codec.Base64; import cn.hutool.core.codec.Base64;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.util.RichTextProcessor;
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.ruoyi.project.zjsgfa.mapper.SjJkzpMapper; import com.ruoyi.project.zjsgfa.mapper.SjJkzpMapper;
...@@ -32,7 +34,50 @@ public class SjJkzpServiceImpl implements ISjJkzpService ...@@ -32,7 +34,50 @@ public class SjJkzpServiceImpl implements ISjJkzpService
@Override @Override
public SjJkzp selectSjJkzpById(Long id) public SjJkzp selectSjJkzpById(Long id)
{ {
return sjJkzpMapper.selectSjJkzpById(id); SjJkzp sjJkzp = sjJkzpMapper.selectSjJkzpById(id);
// 压缩富文本中的图片,设置质量和最大尺寸
String compressedContent = RichTextProcessor.processRichText(
sjJkzp.getZjkzz(), // 你的富文本字段
0.7f, // 质量 0.0-1.0
800, // 最大宽度
600 // 最大高度
);
// 设置压缩后的富文本
sjJkzp.setZjkzz(compressedContent);
String clcb = RichTextProcessor.processRichText(
sjJkzp.getClcb(), // 你的富文本字段
0.7f, // 质量 0.0-1.0
800, // 最大宽度
600 // 最大高度
);
// 设置压缩后的富文本
sjJkzp.setClcb(clcb);
String jlgh = RichTextProcessor.processRichText(
sjJkzp.getJlgh(), // 你的富文本字段
0.7f, // 质量 0.0-1.0
800, // 最大宽度
600 // 最大高度
);
// 设置压缩后的富文本
sjJkzp.setJlgh(jlgh);
String syyq = RichTextProcessor.processRichText(
sjJkzp.getSyyq(), // 你的富文本字段
0.7f, // 质量 0.0-1.0
800, // 最大宽度
600 // 最大高度
);
// 设置压缩后的富文本
sjJkzp.setSyyq(syyq);
return sjJkzp;
} }
/** /**
...@@ -44,7 +89,53 @@ public class SjJkzpServiceImpl implements ISjJkzpService ...@@ -44,7 +89,53 @@ public class SjJkzpServiceImpl implements ISjJkzpService
@Override @Override
public List<SjJkzp> selectSjJkzpList(SjJkzp sjJkzp) public List<SjJkzp> selectSjJkzpList(SjJkzp sjJkzp)
{ {
return sjJkzpMapper.selectSjJkzpList(sjJkzp); List<SjJkzp> list = sjJkzpMapper.selectSjJkzpList(sjJkzp);
list.stream().map(entity -> {
// 压缩富文本中的图片,设置质量和最大尺寸
String compressedContent = RichTextProcessor.processRichText(
entity.getZjkzz(), // 你的富文本字段
0.7f, // 质量 0.0-1.0
800, // 最大宽度
600 // 最大高度
);
// 设置压缩后的富文本
entity.setZjkzz(compressedContent);
String clcb = RichTextProcessor.processRichText(
entity.getClcb(), // 你的富文本字段
0.7f, // 质量 0.0-1.0
800, // 最大宽度
600 // 最大高度
);
// 设置压缩后的富文本
entity.setClcb(clcb);
String jlgh = RichTextProcessor.processRichText(
entity.getJlgh(), // 你的富文本字段
0.7f, // 质量 0.0-1.0
800, // 最大宽度
600 // 最大高度
);
// 设置压缩后的富文本
entity.setJlgh(jlgh);
String syyq = RichTextProcessor.processRichText(
entity.getSyyq(), // 你的富文本字段
0.7f, // 质量 0.0-1.0
800, // 最大宽度
600 // 最大高度
);
// 设置压缩后的富文本
entity.setSyyq(syyq);
return entity;
}).collect(Collectors.toList());
return list;
} }
/** /**
......
...@@ -90,4 +90,14 @@ public class SjLjjwServiceImpl implements ISjLjjwService ...@@ -90,4 +90,14 @@ public class SjLjjwServiceImpl implements ISjLjjwService
{ {
return sjLjjwMapper.deleteSjLjjwById(id); return sjLjjwMapper.deleteSjLjjwById(id);
} }
@Override
public int insertSjLjjwBatch(List<SjLjjw> list) {
return sjLjjwMapper.insertSjLjjwBatch(list);
}
@Override
public int deleteSjLjjwByJh(String jh) {
return sjLjjwMapper.deleteSjLjjwByJh(jh);
}
} }
...@@ -239,10 +239,13 @@ public class DjdcController { ...@@ -239,10 +239,13 @@ public class DjdcController {
return AjaxResult.success( djdcService.getZtzhzzdfList(param),map); return AjaxResult.success( djdcService.getZtzhzzdfList(param),map);
case "getDzfcList": case "getDzfcList":
//获取地质分成 //获取地质分成
return AjaxResult.success( djdcService.getDzfcList(param),map); return AjaxResult.success( djdcService.getDzfcList2(param),map);
case "getFdcsList": case "getFdcsList":
//获取分段方案参数 //获取分段方案参数
return AjaxResult.success( djdcService.getFdcsList(param)); return AjaxResult.success( djdcService.getFdcsList(param));
case "getKjsjList":
//获取
return AjaxResult.success( djdcService.getKjsjList(param));
default: default:
return AjaxResult.success(); return AjaxResult.success();
} }
...@@ -308,6 +311,12 @@ public class DjdcController { ...@@ -308,6 +311,12 @@ public class DjdcController {
List<Jsha> fdcsList = djdcService.getFdcsList(param); List<Jsha> fdcsList = djdcService.getFdcsList(param);
exportFdcs(response,fdcsList); exportFdcs(response,fdcsList);
break; break;
case "exportKsjList":
//导出实钻分析结果
List<DjZqsjfx> kjsjList = djdcService.getKjsjList(param);
ExcelUtil<DjZqsjfx> kssjEx = new ExcelUtil<DjZqsjfx>(DjZqsjfx.class);
kssjEx.exportExcel(response, kjsjList, "Sheet1");
break;
default: default:
break; break;
} }
......
package com.ruoyi.project.zt.domain; package com.ruoyi.project.zt.domain;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import lombok.Data; import lombok.Data;
/** /**
...@@ -9,12 +10,16 @@ import lombok.Data; ...@@ -9,12 +10,16 @@ import lombok.Data;
public class DjZqsjfx { public class DjZqsjfx {
//井号 //井号
@Excel(name = "井号")
private String jh; private String jh;
//开钻时间 //开钻时间
@Excel(name = "一开开钻时间")
private String kssj; private String kssj;
//结束时间 //结束时间
private String jssj; private String jssj;
private String zwsj; private String zwsj;
@Excel(name = "日志开钻时间")
private String wasj;
/** /**
* 井筒名 * 井筒名
*/ */
......
package com.ruoyi.project.zt.domain; package com.ruoyi.project.zt.domain;
import lombok.Data;
import java.time.LocalTime; import java.time.LocalTime;
@Data
public class TimePointPair { public class TimePointPair {
private LocalTime previousTime; private LocalTime previousTime;
private LocalTime previousTime2;
private LocalTime drillingTime; private LocalTime drillingTime;
public TimePointPair(LocalTime previousTime, LocalTime drillingTime) { public TimePointPair(LocalTime previousTime, LocalTime drillingTime) {
this.previousTime = previousTime; this.previousTime = previousTime;
this.drillingTime = drillingTime; this.drillingTime = drillingTime;
} }
public TimePointPair(LocalTime previousTime, LocalTime drillingTime,LocalTime previousTime2) {
this.previousTime = previousTime;
this.drillingTime = drillingTime;
this.previousTime2 = previousTime2;
}
public LocalTime getPreviousTime() { public LocalTime getPreviousTime() {
return previousTime; return previousTime;
...@@ -24,6 +33,13 @@ public class TimePointPair { ...@@ -24,6 +33,13 @@ public class TimePointPair {
return drillingTime.isBefore(previousTime); return drillingTime.isBefore(previousTime);
} }
public boolean isCrossDay2() {
if(previousTime2==null){
return false;
}
return previousTime.isBefore(previousTime2);
}
@Override @Override
public String toString() { public String toString() {
return previousTime + " - " + drillingTime; return previousTime + " - " + drillingTime;
......
...@@ -39,4 +39,7 @@ public interface DjdcInfoMapper { ...@@ -39,4 +39,7 @@ public interface DjdcInfoMapper {
List<Jsha> getFdcsList(CommonParam param); List<Jsha> getFdcsList(CommonParam param);
List<DjZqsjfx> getZqshfxList2(CommonParam param);
} }
...@@ -3,6 +3,7 @@ package com.ruoyi.project.zt.mapper; ...@@ -3,6 +3,7 @@ package com.ruoyi.project.zt.mapper;
import com.ruoyi.framework.aspectj.lang.annotation.DataSource; import com.ruoyi.framework.aspectj.lang.annotation.DataSource;
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType; import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
import com.ruoyi.project.zt.domain.Jsaa; import com.ruoyi.project.zt.domain.Jsaa;
import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
...@@ -12,6 +13,7 @@ import java.util.List; ...@@ -12,6 +13,7 @@ import java.util.List;
* @author ruoyi * @author ruoyi
* @date 2025-07-10 * @date 2025-07-10
*/ */
@Mapper
@DataSource(value = DataSourceType.SLAVE) @DataSource(value = DataSourceType.SLAVE)
public interface JsaaMapper public interface JsaaMapper
{ {
......
...@@ -52,4 +52,5 @@ public interface DjdcService { ...@@ -52,4 +52,5 @@ public interface DjdcService {
List<SjDcfxDzfc> getDzfcList2(CommonParam param); List<SjDcfxDzfc> getDzfcList2(CommonParam param);
List<DjZqsjfx> getKjsjList(CommonParam param);
} }
...@@ -9,13 +9,8 @@ import com.google.gson.stream.JsonReader; ...@@ -9,13 +9,8 @@ import com.google.gson.stream.JsonReader;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.framework.aspectj.lang.annotation.DataSource; import com.ruoyi.framework.aspectj.lang.annotation.DataSource;
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType; import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
import com.ruoyi.project.zjsgfa.domain.Dzgzzb; import com.ruoyi.project.zjsgfa.domain.*;
import com.ruoyi.project.zjsgfa.domain.SjDcfxDzfc; import com.ruoyi.project.zjsgfa.mapper.*;
import com.ruoyi.project.zjsgfa.domain.SjDzfc;
import com.ruoyi.project.zjsgfa.domain.Tsyxclxx;
import com.ruoyi.project.zjsgfa.mapper.DzgzzbMapper;
import com.ruoyi.project.zjsgfa.mapper.SjDzfcMapper;
import com.ruoyi.project.zjsgfa.mapper.TsyxclxxMapper;
import com.ruoyi.project.zt.domain.*; import com.ruoyi.project.zt.domain.*;
import com.ruoyi.project.zt.domain.vo.SjInfo; import com.ruoyi.project.zt.domain.vo.SjInfo;
import com.ruoyi.project.zt.mapper.*; import com.ruoyi.project.zt.mapper.*;
...@@ -74,9 +69,16 @@ public class DjdcServiceImpl implements DjdcService { ...@@ -74,9 +69,16 @@ public class DjdcServiceImpl implements DjdcService {
@Autowired @Autowired
private TsyxclxxMapper tsyxclxxMapper; private TsyxclxxMapper tsyxclxxMapper;
@Autowired
private SjLjjwMapper sjLjjwMapper;
@Autowired @Autowired
private JsbaMapper jsbaMapper; private JsbaMapper jsbaMapper;
@Autowired
private SjJygjGdsjgdcsMapper sjJygjGdsjgdcsMapper;
@Override @Override
public List<DjDcInfo> getList(DjDcInfo info) { public List<DjDcInfo> getList(DjDcInfo info) {
return djdcInfoMapper.getList(info); return djdcInfoMapper.getList(info);
...@@ -305,6 +307,7 @@ public class DjdcServiceImpl implements DjdcService { ...@@ -305,6 +307,7 @@ public class DjdcServiceImpl implements DjdcService {
String kssj =item.getKssj(); String kssj =item.getKssj();
String jssj =item.getJssj(); String jssj =item.getJssj();
String zwsj =""; String zwsj ="";
String wasj ="";
Jswa jswap=new Jswa(); Jswa jswap=new Jswa();
jswap.setKsrq(DateUtils.parseDateToStr("yyyy-MM-dd",DateUtils.parseDate(item.getKssj()))); jswap.setKsrq(DateUtils.parseDateToStr("yyyy-MM-dd",DateUtils.parseDate(item.getKssj())));
...@@ -333,7 +336,7 @@ public class DjdcServiceImpl implements DjdcService { ...@@ -333,7 +336,7 @@ public class DjdcServiceImpl implements DjdcService {
}else { }else {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.setTime(jswaZwsj.getRq()); // 设置为当前日期 calendar.setTime(jswaZwsj.getRq()); // 设置为当前日期
calendar.add(Calendar.DAY_OF_YEAR, -1); // 增加一天 calendar.add(Calendar.DAY_OF_YEAR, -1); // 一天
// 获取明天的Date对象 // 获取明天的Date对象
Date tomorrow = calendar.getTime(); Date tomorrow = calendar.getTime();
zwsj= DateUtils.parseDateToStr("yyyy-MM-dd",tomorrow) +" "+formattedTime; zwsj= DateUtils.parseDateToStr("yyyy-MM-dd",tomorrow) +" "+formattedTime;
...@@ -344,6 +347,8 @@ public class DjdcServiceImpl implements DjdcService { ...@@ -344,6 +347,8 @@ public class DjdcServiceImpl implements DjdcService {
System.out.println(zwsj); System.out.println(zwsj);
item.setZwsj(zwsj); item.setZwsj(zwsj);
item.setWasj(wasj);
//计算钻进实际周期 //计算钻进实际周期
if(StringUtils.isNotEmpty(kssj) && StringUtils.isNotEmpty(zwsj) ){ if(StringUtils.isNotEmpty(kssj) && StringUtils.isNotEmpty(zwsj) ){
// 解析字符串并转换为 UTC 时间 // 解析字符串并转换为 UTC 时间
...@@ -472,8 +477,65 @@ public class DjdcServiceImpl implements DjdcService { ...@@ -472,8 +477,65 @@ public class DjdcServiceImpl implements DjdcService {
if (index > 0) { if (index > 0) {
LocalTime previousTime = allTimePoints.get(index - 1); LocalTime previousTime = allTimePoints.get(index - 1);
if(index>2){
LocalTime previousTime2 = allTimePoints.get(index - 2);
pairs.add(new TimePointPair(previousTime, drillingTime,previousTime2));
}else {
pairs.add(new TimePointPair(previousTime, drillingTime)); pairs.add(new TimePointPair(previousTime, drillingTime));
} }
}
}
return pairs;
}
public static List<TimePointPair> extractTimePointPairsBeforeDrilling2(String record) {
List<TimePointPair> pairs = new ArrayList<>();
record=record.replaceAll(":",":");
record=record.replaceAll(",",",");
int zj = record.indexOf("钻进");
if(zj==-1){
return pairs;
}
record=record.substring(0,zj+2);
if(StringUtils.isEmpty(record)){
return pairs;
}
// 匹配所有时间点(格式为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);
if(index>=2){
LocalTime previousTime2 = allTimePoints.get(index - 2);
pairs.add(new TimePointPair(previousTime, drillingTime,previousTime2));
}else {
pairs.add(new TimePointPair(previousTime, drillingTime));
}
}
} }
return pairs; return pairs;
...@@ -534,14 +596,80 @@ public class DjdcServiceImpl implements DjdcService { ...@@ -534,14 +596,80 @@ public class DjdcServiceImpl implements DjdcService {
if (index > 0) { if (index > 0) {
LocalTime previousTime = allTimePoints.get(index - 1); LocalTime previousTime = allTimePoints.get(index - 1);
if(index>2){
LocalTime previousTime2 = allTimePoints.get(index - 2);
pairs.add(new TimePointPair(previousTime, drillingTime,previousTime2));
}else {
pairs.add(new TimePointPair(previousTime, drillingTime)); pairs.add(new TimePointPair(previousTime, drillingTime));
} }
}
}
return pairs;
} }
public static List<TimePointPair> extractTimePeriodsBeforeDrilling2(String record) {
List<TimePointPair> pairs = new ArrayList<>();
record=record.replaceAll(":",":");
record=record.replaceAll(",",",");
int zj = record.indexOf("钻进");
if(zj==-1){
return pairs; return pairs;
}
record=record.substring(0,zj+2);
if(StringUtils.isEmpty(record)){
return pairs;
}
// 匹配所有时间点(格式为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);
if(index>=2){
LocalTime previousTime2 = allTimePoints.get(index - 2);
pairs.add(new TimePointPair(previousTime, drillingTime,previousTime2));
}else {
pairs.add(new TimePointPair(previousTime, drillingTime));
}
}
}
return pairs;
}
@Override @Override
public List<DjZjzhfx> getZjzhfxList(CommonParam param) { public List<DjZjzhfx> getZjzhfxList(CommonParam param) {
...@@ -1432,86 +1560,209 @@ public class DjdcServiceImpl implements DjdcService { ...@@ -1432,86 +1560,209 @@ public class DjdcServiceImpl implements DjdcService {
//查询设计井信息 //查询设计井信息
List<SjDzfc> sjDzfcs = sjDzfcMapper.selectSjDzfcList(sjDzfc); List<SjDzfc> sjDzfcs = sjDzfcMapper.selectSjDzfcList(sjDzfc);
for(SjDzfc item :sjDzfcs){
SjJygjGdsjgdcs sjJygjGdsjgdcs =new SjJygjGdsjgdcs();
sjJygjGdsjgdcs.setJh(param.getJh());
List<SjJygjGdsjgdcs> sjJygjGdsjgdcsList = sjJygjGdsjgdcsMapper.selectSjJygjGdsjgdcsList(sjJygjGdsjgdcs);
List<Tsyxclxx> tsyxclxxes = tsyxclxxMapper.selectTsyxclxxList(new Tsyxclxx());
List<String> jhList=new ArrayList<>();
jhList.addAll(sjDzfcs.stream().map(SjDzfc::getYjjh1).distinct().collect(Collectors.toList()));
jhList.addAll(sjDzfcs.stream().map(SjDzfc::getYjjh2).distinct().collect(Collectors.toList()));
//优先设计
List<LjDcyx> dcyxList =new ArrayList<>();
if(jhList.size()>0){
//根据井号去录井查询岩性
Object[] stringArray = jhList.toArray();
CommonParam commonParam =new CommonParam();
String[] stringArray2 = Arrays.copyOf(stringArray, stringArray.length, String[].class);
commonParam.setJhs(stringArray2);
dcyxList = ljQueryMapper.getDcyxList(commonParam);
}
//其次是邻井
if(dcyxList.size()==0){
//查询临井
SjLjjw sjLjjw =new SjLjjw();
sjLjjw.setJh(param.getJh());
List<SjLjjw> sjLjjwList = sjLjjwMapper.selectSjLjjwList(sjLjjw);
jhList.addAll(sjLjjwList.stream().map(SjLjjw::getLjjh).collect(Collectors.toList()));
Object[] stringArray = jhList.toArray();
CommonParam commonParam =new CommonParam();
String[] stringArray2 = Arrays.copyOf(stringArray, stringArray.length, String[].class);
commonParam.setJhs(stringArray2);
dcyxList = ljQueryMapper.getDcyxList(commonParam);
}
if(dcyxList.size()>0){
for (SjDzfc item : sjDzfcs) {
SjDcfxDzfc ljDzfc =new SjDcfxDzfc(); SjDcfxDzfc ljDzfc =new SjDcfxDzfc();
ljDzfc.setJh( item.getSjjh()); ljDzfc.setJh(param.getJh());
ljDzfc.setCs(item.getSjdcs()); ljDzfc.setCs(item.getSjdcs());
ljDzfc.setDzfc(item.getDcZ()); String dcD = item.getDcD();
if(StringUtils.isNotEmpty(item.getSjyxts())){ if (StringUtils.isEmpty(dcD)) {
ljDzfc.setYxts(item.getSjyxts()); dcD = item.getDcZ();
}else { }
//查询邻井 final String dc=dcD;
CommonParam paramYj=new CommonParam(); ljDzfc.setDzfc(dc);
List<String> lists =new ArrayList<>(); List<String> yxts = dcyxList.stream().filter(dcyx -> dcyx.getDcmc().equals(dc)).map(LjDcyx::getYxmc).filter(StringUtils::isNotEmpty).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
if(StringUtils.isNotEmpty(item.getYjjh1())){ List<String> yqcts = dcyxList.stream().filter(dcyx -> dcyx.getDcmc().equals(dc)).map(LjDcyx::getYqcmc).filter(StringUtils::isNotEmpty).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
lists.add(item.getYjjh1()); if(yxts.size()>0){
ljDzfc.setYxts(String.join( ",",yxts));
List<String> collect = tsyxclxxes.stream().filter(tsyxclxx -> tsyxclxx.getTsyx().indexOf(ljDzfc.getYxts()) != -1).map(Tsyxclxx::getWt).collect(Collectors.toList());
if(collect.size()>0){
ljDzfc.setGzts(String.join( ",",collect));
} }
if(StringUtils.isNotEmpty(item.getYjjh2())){
lists.add(item.getYjjh2());
} }
if(lists.size()>0){ if(yqcts.size()>0){
String[] jhs = lists.toArray(new String[lists.size()]); ljDzfc.setYqsts(String.join( ",",yqcts));
// String[] jhs={item.getYjjh1(),item.getYjjh2()};
paramYj.setJhs(jhs);
List<LjDcyx> dcyxList = ljQueryMapper.getDcyxList(paramYj);
List<LjDcyx> collect = dcyxList.stream().filter(lj -> lj.getJh().equals(item.getYjjh1()) && equals(lj.getDjsd2(), item.getYjdcs1())).collect(Collectors.toList());
List<LjDcyx> colect2 = dcyxList.stream().filter(lj -> lj.getJh().equals(item.getYjjh2()) && equals(lj.getDjsd2(), item.getYjdcs2())).collect(Collectors.toList());
List<String> yxmclist=new ArrayList<>();
List<String> yqsmclist=new ArrayList<>();
if(colect2.size()>0){
List<LjDcyx> ysisNotnull = colect2.stream().filter(it -> StringUtils.isNotEmpty(it.getYxmc())).collect(Collectors.toList());
if(ysisNotnull.size()>0){
yxmclist.addAll(ysisNotnull.stream().map(LjDcyx::getYxmc).distinct().collect(Collectors.toList()));
} }
List<LjDcyx> yqsisNotnull = colect2.stream().filter(it -> StringUtils.isNotEmpty(it.getYqcmc())).collect(Collectors.toList());
if(yqsisNotnull.size()>0){
yqsmclist.addAll(yqsisNotnull.stream().map(LjDcyx::getYqcmc).distinct().collect(Collectors.toList())); //计算斜深
Double sjdcs = item.getSjdcs();
if(sjdcs!=null){
SjJygjGdsjgdcs sjJygjGdsjgdcs1 = sjJygjGdsjgdcsList.stream().filter(it -> equals(sjdcs, it.getCs())).findFirst().orElse(null);
if(sjJygjGdsjgdcs1==null){
//
// // 查找最近的较小值 (小于目标值的最大值)
SjJygjGdsjgdcs jskdmin=sjJygjGdsjgdcsList.stream().filter(it -> it.getCs()<sjdcs).collect(Collectors.toList()).stream().max(Comparator.comparing(SjJygjGdsjgdcs::getCs)).orElse(null);
SjJygjGdsjgdcs jskdmax=sjJygjGdsjgdcsList.stream().filter(it -> it.getCs()>sjdcs).collect(Collectors.toList()).stream().min(Comparator.comparing(SjJygjGdsjgdcs::getCs)).orElse(null);
if(jskdmin!=null && jskdmax!=null){
double jsxs = jsxs(sjdcs, jskdmin.getCs(), jskdmax.getCs(), jskdmin.getJs(), jskdmax.getJs());
ljDzfc.setXs(jsxs);
} }
}else {
ljDzfc.setXs(sjJygjGdsjgdcs1.getJs());
} }
if(collect.size()>0){
List<LjDcyx> ysisNotnull = collect.stream().filter(it -> StringUtils.isNotEmpty(it.getYxmc())).collect(Collectors.toList());
if(ysisNotnull.size()>0){
yxmclist.addAll(ysisNotnull.stream().map(LjDcyx::getYxmc).distinct().collect(Collectors.toList()));
} }
List<LjDcyx> yqsisNotnull = collect.stream().filter(it -> StringUtils.isNotEmpty(it.getYqcmc())).collect(Collectors.toList()); list.add(ljDzfc);
if(yqsisNotnull.size()>0){ }
yqsmclist.addAll(yqsisNotnull.stream().map(LjDcyx::getYqcmc).distinct().collect(Collectors.toList())); }else {
List<Dzgzzb> dzgzzbs = dzgzzbMapper.selectDzgzzbList(new Dzgzzb());
//最后构造
for (SjDzfc item : sjDzfcs) {
String dcD = item.getDcD();
if (StringUtils.isEmpty(dcD)) {
dcD = item.getDcZ();
} }
final String dc=dcD;
SjDcfxDzfc ljDzfc =new SjDcfxDzfc();
ljDzfc.setJh(param.getJh());
ljDzfc.setCs(item.getSjdcs());
ljDzfc.setDzfc(dc);
List<String> collect = dzgzzbs.stream().filter(dzgzzb -> dzgzzb.getDzfc().equals(dc)).map(dzgzzb -> StringUtils.isNotEmpty(dzgzzb.getZyyx()) ? dzgzzb.getZyyx().replaceAll("、", ",") : "").collect(Collectors.toList());
if(collect.size()>0){
ljDzfc.setYxts(String.join( ",",collect));
List<String> tsyx = tsyxclxxes.stream().filter(tsyxclxx -> tsyxclxx.getTsyx().indexOf(ljDzfc.getYxts()) != -1).map(Tsyxclxx::getWt).collect(Collectors.toList());
if(tsyx.size()>0){
ljDzfc.setGzts(String.join( ",",tsyx));
}
}
//计算斜深
Double sjdcs = item.getSjdcs();
if(sjdcs!=null){
SjJygjGdsjgdcs sjJygjGdsjgdcs1 = sjJygjGdsjgdcsList.stream().filter(it -> equals(sjdcs, it.getCs())).findFirst().orElse(null);
if(sjJygjGdsjgdcs1==null){
// // 查找最近的较小值 (小于目标值的最大值)
SjJygjGdsjgdcs jskdmin=sjJygjGdsjgdcsList.stream().filter(it -> it.getCs()<sjdcs).collect(Collectors.toList()).stream().max(Comparator.comparing(SjJygjGdsjgdcs::getCs)).orElse(null);
SjJygjGdsjgdcs jskdmax=sjJygjGdsjgdcsList.stream().filter(it -> it.getCs()>sjdcs).collect(Collectors.toList()).stream().min(Comparator.comparing(SjJygjGdsjgdcs::getCs)).orElse(null);
if(jskdmin!=null && jskdmax!=null){
double jsxs = jsxs(sjdcs, jskdmin.getCs(), jskdmax.getCs(), jskdmin.getJs(), jskdmax.getJs());
ljDzfc.setXs(jsxs);
} }
if(yxmclist.size()>0){
ljDzfc.setYxts(String.join(",",yxmclist));
}else { }else {
//查询构造表 ljDzfc.setXs(sjJygjGdsjgdcs1.getJs());
Dzgzzb dzgzzb= new Dzgzzb();
dzgzzb.setDzfc(item.getDcZ());
List<Dzgzzb> dzgzzbs = dzgzzbMapper.selectDzgzzbList(dzgzzb);
if(dzgzzbs.size()>0){
Dzgzzb dzgzzb1 = dzgzzbs.get(0);
ljDzfc.setYxts(dzgzzb1.getZyyx());
} }
} }
if(yqsmclist.size()>0){ list.add(ljDzfc);
ljDzfc.setYqsts(String.join(",",yqsmclist));
} }
if(StringUtils.isNotEmpty(ljDzfc.getYxts())){
String[] split = ljDzfc.getYxts().split("、");
Tsyxclxx tsyxclxx =new Tsyxclxx();
tsyxclxx.setTsyxs(split);
List<Tsyxclxx> tsyxclxxes = tsyxclxxMapper.selectTsyxclxxList(tsyxclxx);
if(tsyxclxxes.size()>0){
List<String> collect1 = tsyxclxxes.stream().map(Tsyxclxx::getWt).collect(Collectors.toList());
ljDzfc.setGzts(String.join(",",collect1));
} }
return list;
}
@Override
public List<DjZqsjfx> getKjsjList(CommonParam param) {
//查询临井
if(StringUtils.isNotEmpty(param.getJh())){
String[] jhs = param.getJh().split(",");
param.setJhs(jhs);
} }
List<DjZqsjfx> list =djdcInfoMapper.getZqshfxList2(param);
DecimalFormat df = new DecimalFormat("#.00");
DateTimeFormatter formatter = DateTimeFormatter
.ofPattern("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);
for(DjZqsjfx item:list){
String kssj =item.getKssj();
String jssj =item.getJssj();
String zwsj ="";
String wasj ="";
Jswa jswap=new Jswa();
jswap.setKsrq(DateUtils.parseDateToStr("yyyy-MM-dd",DateUtils.parseDate(item.getKssj())));
jswap.setJsrq(DateUtils.parseDateToStr("yyyy-MM-dd",DateUtils.parseDate(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 = extractTimePointPairsBeforeDrilling2(cleanedRecord);
if(timePointPairs.size()==0){
timePointPairs=extractTimePeriodsBeforeDrilling2(cleanedRecord);
} }
for (TimePointPair pair : timePointPairs) {
System.out.println("前一个时间点:" + pair.getPreviousTime2() +
",钻进时间点:" + pair.getPreviousTime() +
",是否跨天:" + pair.isCrossDay2());
String formattedTime = pair.getPreviousTime().format(DateTimeFormatter.ISO_LOCAL_TIME);
if( pair.isCrossDay2()){
wasj= 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();
wasj= DateUtils.parseDateToStr("yyyy-MM-dd",tomorrow) +" "+formattedTime;
} }
list.add(ljDzfc);
} }
}
item.setWasj(wasj);
}
return list; return list;
} }
/**
* 计算斜深
* @param a 层位垂深
* @param a1 轨迹中比层位垂深小的垂深
* @param a2 轨迹中比层位垂深大的垂深
* @param b1 轨迹中比层位垂深小的斜深
* @param b2 轨迹中比层位垂深大的斜深
* @return
*/
public static double jsxs(Double a,Double a1,Double a2, Double b1, Double b2) {
if (a == null || a1 == null || a2 == null || b1 == null || b2 == null) {
return 0.0;
}
double b = b1+(b2-b1)*((a-a1)/(a2-a1));
return b;
}
public static void calculateScores(List<SjInfo> items) { public static void calculateScores(List<SjInfo> items) {
// 按进尺降序排序 // 按进尺降序排序
......
...@@ -41,6 +41,7 @@ public class JsaaServiceImpl implements IJsaaService ...@@ -41,6 +41,7 @@ public class JsaaServiceImpl implements IJsaaService
* @return 基础数据 * @return 基础数据
*/ */
@Override @Override
@DataSource(value = DataSourceType.SLAVE)
public List<Jsaa> selectJsaaList(Jsaa jsaa) public List<Jsaa> selectJsaaList(Jsaa jsaa)
{ {
return jsaaMapper.selectJsaaList(jsaa); return jsaaMapper.selectJsaaList(jsaa);
...@@ -72,7 +73,6 @@ public class JsaaServiceImpl implements IJsaaService ...@@ -72,7 +73,6 @@ public class JsaaServiceImpl implements IJsaaService
/** /**
* 批量删除基础数据 * 批量删除基础数据
*
* @param jhs 需要删除的基础数据主键 * @param jhs 需要删除的基础数据主键
* @return 结果 * @return 结果
*/ */
......
...@@ -586,4 +586,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -586,4 +586,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by kc asc order by kc asc
</select> </select>
<select id="getZqshfxList2" resultType="com.ruoyi.project.zt.domain.DjZqsjfx">
select a.jh,c.ksjs,c.JS,to_char(KZRQ1,'YYYY-MM-DD') || ' ' ||TO_CHAR(TO_DATE(KZSJ1, 'HH24MI'), 'HH24:MI') kssj,to_char(KZRQ2,'YYYY-MM-DD') || ' ' ||TO_CHAR(TO_DATE(KZSJ2, 'HH24MI'), 'HH24:MI') jssj from jsaa a
left join (
select * from (SELECT jh,
0 AS kc,
JS,
LAG(JS, 1, 0) OVER (PARTITION BY jh ORDER BY js) AS ksjs
FROM JSDB jsdb
where jsdb.tgcc like '%导管%'
UNION all
SELECT jh,
ROW_NUMBER() OVER (PARTITION BY jh ORDER BY js) AS kc,
JS,
LAG(JS, 1, 0) OVER (PARTITION BY jh ORDER BY js) AS ksjs
FROM JSDB jsdb
where jsdb.tgcc not like '%导管%'
order by jh)) c on a.jh=c.jh where kc='1'
<if test="jh!=null and jh!=''">
and a. jh =#{jh}
</if>
order by JH
</select>
</mapper> </mapper>
\ No newline at end of file
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