Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zjsgfa_mysql
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jiangyun
zjsgfa_mysql
Commits
6ae78efc
Commit
6ae78efc
authored
Aug 05, 2025
by
jiang'yun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
894c397f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
462 additions
and
25 deletions
+462
-25
src/main/java/com/ruoyi/framework/util/ImageCompressor.java
+66
-0
src/main/java/com/ruoyi/framework/util/RichTextProcessor.java
+36
-0
src/main/java/com/ruoyi/project/zjsgfa/controller/SjDcfxDzfcController.java
+1
-1
src/main/java/com/ruoyi/project/zjsgfa/controller/SjLjjwController.java
+17
-0
src/main/java/com/ruoyi/project/zjsgfa/service/ISjLjjwService.java
+5
-0
src/main/java/com/ruoyi/project/zjsgfa/service/impl/JcxxHseServiceImpl.java
+30
-2
src/main/java/com/ruoyi/project/zjsgfa/service/impl/JcxxJkzpServiceImpl.java
+95
-2
src/main/java/com/ruoyi/project/zjsgfa/service/impl/SjDjjcServiceImpl.java
+14
-14
src/main/java/com/ruoyi/project/zjsgfa/service/impl/SjHseServiceImpl.java
+29
-2
src/main/java/com/ruoyi/project/zjsgfa/service/impl/SjJkzpServiceImpl.java
+93
-2
src/main/java/com/ruoyi/project/zjsgfa/service/impl/SjLjjwServiceImpl.java
+10
-0
src/main/java/com/ruoyi/project/zt/controller/DjdcController.java
+10
-1
src/main/java/com/ruoyi/project/zt/domain/DjZqsjfx.java
+5
-0
src/main/java/com/ruoyi/project/zt/domain/TimePointPair.java
+16
-0
src/main/java/com/ruoyi/project/zt/mapper/DjdcInfoMapper.java
+3
-0
src/main/java/com/ruoyi/project/zt/mapper/JsaaMapper.java
+2
-0
src/main/java/com/ruoyi/project/zt/service/DjdcService.java
+1
-0
src/main/java/com/ruoyi/project/zt/service/impl/DjdcServiceImpl.java
+0
-0
src/main/java/com/ruoyi/project/zt/service/impl/JsaaServiceImpl.java
+1
-1
src/main/resources/mybatis/zt/DjdcInfoMapper.xml
+28
-0
No files found.
src/main/java/com/ruoyi/framework/util/ImageCompressor.java
0 → 100644
View file @
6ae78efc
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
)
};
}
}
src/main/java/com/ruoyi/framework/util/RichTextProcessor.java
0 → 100644
View file @
6ae78efc
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
();
}
}
src/main/java/com/ruoyi/project/zjsgfa/controller/SjDcfxDzfcController.java
View file @
6ae78efc
...
@@ -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
);
}
}
...
...
src/main/java/com/ruoyi/project/zjsgfa/controller/SjLjjwController.java
View file @
6ae78efc
...
@@ -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
));
}
}
}
src/main/java/com/ruoyi/project/zjsgfa/service/ISjLjjwService.java
View file @
6ae78efc
...
@@ -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
);
}
}
src/main/java/com/ruoyi/project/zjsgfa/service/impl/JcxxHseServiceImpl.java
View file @
6ae78efc
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
;
}
}
/**
/**
...
...
src/main/java/com/ruoyi/project/zjsgfa/service/impl/JcxxJkzpServiceImpl.java
View file @
6ae78efc
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
;
}
}
/**
/**
...
...
src/main/java/com/ruoyi/project/zjsgfa/service/impl/SjDjjcServiceImpl.java
View file @
6ae78efc
...
@@ -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
);
...
...
src/main/java/com/ruoyi/project/zjsgfa/service/impl/SjHseServiceImpl.java
View file @
6ae78efc
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
;
}
}
/**
/**
...
...
src/main/java/com/ruoyi/project/zjsgfa/service/impl/SjJkzpServiceImpl.java
View file @
6ae78efc
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
;
}
}
/**
/**
...
...
src/main/java/com/ruoyi/project/zjsgfa/service/impl/SjLjjwServiceImpl.java
View file @
6ae78efc
...
@@ -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
);
}
}
}
src/main/java/com/ruoyi/project/zt/controller/DjdcController.java
View file @
6ae78efc
...
@@ -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
.
getDzfcList
2
(
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
;
}
}
...
...
src/main/java/com/ruoyi/project/zt/domain/DjZqsjfx.java
View file @
6ae78efc
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
;
/**
/**
* 井筒名
* 井筒名
*/
*/
...
...
src/main/java/com/ruoyi/project/zt/domain/TimePointPair.java
View file @
6ae78efc
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
;
...
...
src/main/java/com/ruoyi/project/zt/mapper/DjdcInfoMapper.java
View file @
6ae78efc
...
@@ -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
);
}
}
src/main/java/com/ruoyi/project/zt/mapper/JsaaMapper.java
View file @
6ae78efc
...
@@ -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
{
{
...
...
src/main/java/com/ruoyi/project/zt/service/DjdcService.java
View file @
6ae78efc
...
@@ -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
);
}
}
src/main/java/com/ruoyi/project/zt/service/impl/DjdcServiceImpl.java
View file @
6ae78efc
This diff is collapsed.
Click to expand it.
src/main/java/com/ruoyi/project/zt/service/impl/JsaaServiceImpl.java
View file @
6ae78efc
...
@@ -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 结果
*/
*/
...
...
src/main/resources/mybatis/zt/DjdcInfoMapper.xml
View file @
6ae78efc
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment