Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
2147749d
Commit
2147749d
authored
Mar 25, 2025
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):超设计使用年限功能开发
parent
894b5621
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
114 additions
and
39 deletions
+114
-39
JgOverDesignServiceLife.java
...os/boot/module/jg/api/entity/JgOverDesignServiceLife.java
+6
-0
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+38
-23
JgOverDesignServiceLifeServiceImpl.java
.../biz/service/impl/JgOverDesignServiceLifeServiceImpl.java
+70
-16
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/entity/JgOverDesignServiceLife.java
View file @
2147749d
...
...
@@ -171,4 +171,10 @@ public class JgOverDesignServiceLife extends BaseEntity {
*/
@TableField
(
"use_registration_code"
)
private
String
useRegistrationCode
;
@TableField
(
exist
=
false
)
private
String
equList
;
@TableField
(
exist
=
false
)
private
String
equCategory
;
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/CommonServiceImpl.java
View file @
2147749d
...
...
@@ -2282,8 +2282,8 @@ public class CommonServiceImpl implements ICommonService {
DateTimeFormatter
outputFormatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
);
Pattern
timePattern
=
Pattern
.
compile
(
"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"
);
//如果是历史无证的修改类型为SP_TT并且枚举没有在登记类型中
if
(
Objects
.
isNull
(
RegistrationTypeEnum
.
getNameByType
(
formData
.
getString
(
"type"
)))
&&
"jg_his_black"
.
equals
(
formData
.
getString
(
"dataSource"
)))
{
formData
.
put
(
"type"
,
"SP_TT"
);
if
(
Objects
.
isNull
(
RegistrationTypeEnum
.
getNameByType
(
formData
.
getString
(
"type"
)))
&&
"jg_his_black"
.
equals
(
formData
.
getString
(
"dataSource"
)))
{
formData
.
put
(
"type"
,
"SP_TT"
);
}
//如果是历史无证的修改类型为SP_TT并且枚举没有在登记类型中
...
...
@@ -2588,31 +2588,46 @@ public class CommonServiceImpl implements ICommonService {
File
mergedPdfFile
=
null
;
try
{
List
<
File
>
pdfFiles
=
new
ArrayList
<>();
for
(
JSONObject
formData
:
formDataList
)
{
File
pdfFile
=
wordToPdf
(
fileName
,
wordPath
,
formData
);
pdfFiles
.
add
(
pdfFile
);
generatedFiles
.
add
(
pdfFile
);
List
<
File
>
pdfFiles
=
formDataList
.
stream
()
.
map
(
formData
->
{
File
pdfFile
=
null
;
try
{
pdfFile
=
wordToPdf
(
fileName
,
wordPath
,
formData
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
if
(
pdfFile
!=
null
&&
pdfFile
.
exists
())
{
generatedFiles
.
add
(
pdfFile
);
}
return
pdfFile
;
})
.
filter
(
Objects:
:
nonNull
)
.
collect
(
Collectors
.
toList
());
if
(!
pdfFiles
.
isEmpty
())
{
mergedPdfFile
=
mergePdfFiles
(
pdfFiles
,
fileName
+
"合并.pdf"
);
if
(
mergedPdfFile
.
exists
())
{
generatedFiles
.
add
(
mergedPdfFile
);
}
}
mergedPdfFile
=
mergePdfFiles
(
pdfFiles
,
fileName
+
"合并.pdf"
);
String
uploadedUrl
=
uploadFile
(
mergedPdfFile
,
"useRegistrationFormFiles"
);
return
MapBuilder
.<
String
,
Object
>
create
().
put
(
"useRegistrationFormUrl"
,
uploadedUrl
).
build
(
);
return
Collections
.
singletonMap
(
"useRegistrationFormUrl"
,
uploadedUrl
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
log
.
error
(
"生成或上传文件失败"
,
e
);
throw
new
RuntimeException
(
"文件处理失败"
,
e
);
}
finally
{
for
(
File
file
:
generatedFiles
)
{
try
{
Files
.
deleteIfExists
(
file
.
toPath
());
}
catch
(
Exception
e
)
{
log
.
error
(
"文件找不到,删除失败:{}"
,
e
);
}
}
if
(
mergedPdfFile
!=
null
)
{
try
{
Files
.
deleteIfExists
(
mergedPdfFile
.
toPath
());
}
catch
(
Exception
e
)
{
log
.
error
(
"合并 PDF 文件删除失败:{}"
,
e
);
}
generatedFiles
.
forEach
(
this
::
deleteFileSafely
);
}
}
/**
* 安全删除文件方法
*/
private
void
deleteFileSafely
(
File
file
)
{
if
(
file
!=
null
&&
file
.
exists
())
{
try
{
Files
.
deleteIfExists
(
file
.
toPath
());
}
catch
(
IOException
e
)
{
log
.
error
(
"删除文件失败: {}"
,
file
.
getAbsolutePath
(),
e
);
}
}
}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgOverDesignServiceLifeServiceImpl.java
View file @
2147749d
This diff is collapsed.
Click to expand it.
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