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
aba00f44
Commit
aba00f44
authored
Jul 28, 2025
by
jiang'yun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
85457d64
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
34 deletions
+76
-34
src/main/java/com/ruoyi/project/zjsgfa/controller/SjDjjcController.java
+76
-34
src/main/resources/static/excel/sjdrmb.xlsx
+0
-0
No files found.
src/main/java/com/ruoyi/project/zjsgfa/controller/SjDjjcController.java
View file @
aba00f44
...
...
@@ -9,8 +9,10 @@ import java.util.List;
import
java.util.UUID
;
import
javax.servlet.http.HttpServletResponse
;
import
com.ruoyi.common.constant.Constants
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.framework.config.RuoYiConfig
;
import
com.ruoyi.framework.config.ServerConfig
;
import
com.ruoyi.project.zjsgfa.domain.*
;
import
com.ruoyi.project.zjsgfa.domain.Vo.DrillingFluidConstant
;
import
com.ruoyi.project.zjsgfa.mapper.*
;
...
...
@@ -97,6 +99,9 @@ public class SjDjjcController extends BaseController
@Autowired
private
SjGztzMapper
sjGztzMapper
;
@Autowired
private
ServerConfig
serverConfig
;
...
...
@@ -1232,40 +1237,77 @@ public class SjDjjcController extends BaseController
// List<XSSFPicture> pictures = getPictures(sheet);
//
// // 遍历图片并处理
// for (XSSFPicture picture : pictures) {
// // 获取锚点信息(位置)
// XSSFClientAnchor anchor = picture.getClientAnchor();
// XSSFPictureData pictureData = picture.getPictureData();
// String ext = pictureData.suggestFileExtension();
// String filePath = RuoYiConfig.getUploadPath()+"/gztz/";
// //判断是否为井位图
// if(isPictureInRow(anchor, 0, 40)){
// SjGztz sjGztz=new SjGztz();
// sjGztz.setJh(jh);
// sjGztz.setGzlx("井位图");
// String fileName = UUID.randomUUID().toString();
// String lj = filePath + fileName + "." + ext;
// sjGztz.setLj(lj);
// FileOutputStream fos = new FileOutputStream(new File(filePath+fileName+"." + ext));
// fos.write(pictureData.getData());
// fos.close();
// sjGztzList.add(sjGztz);
// }else if(isPictureInRow(anchor, 41, 81)){
// SjGztz sjGztz=new SjGztz();
// sjGztz.setJh(jh);
// sjGztz.setGzlx("地震刨面图");
// String fileName = UUID.randomUUID().toString();
// String lj = filePath + fileName + "." + ext;
// sjGztz.setLj(lj);
// FileOutputStream fos = new FileOutputStream(new File(filePath+fileName+"." + ext));
// fos.write(pictureData.getData());
// fos.close();
// sjGztzList.add(sjGztz);
// }
// }
List
<
XSSFPicture
>
pictures
=
getPictures
(
sheet
);
// 遍历图片并处理
for
(
XSSFPicture
picture
:
pictures
)
{
// 获取锚点信息(位置)
XSSFClientAnchor
anchor
=
picture
.
getClientAnchor
();
XSSFPictureData
pictureData
=
picture
.
getPictureData
();
String
ext
=
pictureData
.
suggestFileExtension
();
String
filePath
=
RuoYiConfig
.
getUploadPath
()+
"/gztz/"
;
//判断是否为井位图
if
(
isPictureInRow
(
anchor
,
0
,
0
)){
SjGztz
sjGztz
=
new
SjGztz
();
sjGztz
.
setJh
(
jh
);
sjGztz
.
setGzlx
(
"井位图"
);
String
fileName
=
UUID
.
randomUUID
().
toString
();
String
lj
=
filePath
+
fileName
+
"."
+
ext
;
File
desc
=
new
File
(
lj
);
if
(!
desc
.
exists
())
{
if
(!
desc
.
getParentFile
().
exists
())
{
desc
.
getParentFile
().
mkdirs
();
}
}
sjGztz
.
setLj
(
Constants
.
RESOURCE_PREFIX
+
"/upload/gztz/"
+
fileName
+
"."
+
ext
);
FileOutputStream
fos
=
new
FileOutputStream
(
new
File
(
filePath
+
fileName
+
"."
+
ext
));
fos
.
write
(
pictureData
.
getData
());
fos
.
close
();
sjGztzList
.
add
(
sjGztz
);
}
else
if
(
isPictureInRow
(
anchor
,
1
,
1
)){
SjGztz
sjGztz
=
new
SjGztz
();
sjGztz
.
setJh
(
jh
);
sjGztz
.
setGzlx
(
"地震刨面图"
);
String
fileName
=
UUID
.
randomUUID
().
toString
();
String
lj
=
filePath
+
fileName
+
"."
+
ext
;
File
desc
=
new
File
(
lj
);
if
(!
desc
.
exists
())
{
if
(!
desc
.
getParentFile
().
exists
())
{
desc
.
getParentFile
().
mkdirs
();
}
}
sjGztz
.
setLj
(
Constants
.
RESOURCE_PREFIX
+
"/upload/gztz/"
+
fileName
+
"."
+
ext
);
FileOutputStream
fos
=
new
FileOutputStream
(
new
File
(
filePath
+
fileName
+
"."
+
ext
));
fos
.
write
(
pictureData
.
getData
());
fos
.
close
();
sjGztzList
.
add
(
sjGztz
);
}
else
if
(
isPictureInRow
(
anchor
,
2
,
2
)){
SjGztz
sjGztz
=
new
SjGztz
();
sjGztz
.
setJh
(
jh
);
sjGztz
.
setGzlx
(
"三压力刨面图"
);
String
fileName
=
UUID
.
randomUUID
().
toString
();
String
lj
=
filePath
+
fileName
+
"."
+
ext
;
File
desc
=
new
File
(
lj
);
if
(!
desc
.
exists
())
{
if
(!
desc
.
getParentFile
().
exists
())
{
desc
.
getParentFile
().
mkdirs
();
}
}
sjGztz
.
setLj
(
Constants
.
RESOURCE_PREFIX
+
"/upload/gztz/"
+
fileName
+
"."
+
ext
);
FileOutputStream
fos
=
new
FileOutputStream
(
new
File
(
filePath
+
fileName
+
"."
+
ext
));
fos
.
write
(
pictureData
.
getData
());
fos
.
close
();
sjGztzList
.
add
(
sjGztz
);
}
}
if
(
sjGztzList
.
size
()>
0
){
sjGztzMapper
.
deleteSjGztzByJh
(
jh
);
sjGztzMapper
.
insertSjGztzBatch
(
sjGztzList
);
...
...
src/main/resources/static/excel/sjdrmb.xlsx
View file @
aba00f44
No preview for this file type
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