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
df01b2b9
Commit
df01b2b9
authored
Oct 10, 2025
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jyjc): 报检规则4.0开发
1.增加日志打印计时
parent
df0593d0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
11 deletions
+31
-11
DocGenerateService.java
.../jyjc/biz/file/inspectapp/service/DocGenerateService.java
+1
-7
DocUpdateService.java
...le/jyjc/biz/file/inspectapp/service/DocUpdateService.java
+2
-1
GenericDocGeneratorStrategy.java
...file/inspectapp/strategy/GenericDocGeneratorStrategy.java
+10
-1
PipelineDocGeneratorStrategy.java
...ile/inspectapp/strategy/PipelineDocGeneratorStrategy.java
+10
-1
JyjcInspectionApplicationServiceImpl.java
...iz/service/impl/JyjcInspectionApplicationServiceImpl.java
+8
-1
No files found.
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/file/inspectapp/service/DocGenerateService.java
View file @
df01b2b9
...
...
@@ -7,7 +7,6 @@ import com.yeejoin.amos.boot.module.jyjc.biz.file.inspectapp.factory.support.Doc
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StopWatch
;
@Service
@RequiredArgsConstructor
...
...
@@ -20,13 +19,8 @@ public class DocGenerateService {
public
String
generateDoc
(
String
appSeq
)
{
StopWatch
stopWatch
=
new
StopWatch
();
stopWatch
.
start
();
DocGenerationRequest
docGenerationRequest
=
defaultDocGenerateAdapter
.
prepareRequest
(
appSeq
);
DocGenerator
docGenerator
=
docGeneratorFactory
.
getGenerator
(
docGenerationRequest
);
String
path
=
docGenerator
.
generate
(
appSeq
);
stopWatch
.
stop
();
log
.
info
(
"生成报检申请表耗时:{}秒"
,
stopWatch
.
getTotalTimeMillis
());
return
path
;
return
docGenerator
.
generate
(
appSeq
);
}
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/file/inspectapp/service/DocUpdateService.java
View file @
df01b2b9
...
...
@@ -23,11 +23,12 @@ public class DocUpdateService {
@Async
@Transactional
(
propagation
=
Propagation
.
REQUIRES_NEW
)
public
void
genDocAndUpdate
(
String
appSeq
)
{
log
.
info
(
"
开始异步生成报检申请表
"
);
log
.
info
(
"
异步生成报检申请表开始
"
);
String
filePath
=
docGenerateService
.
generateDoc
(
appSeq
);
LambdaUpdateWrapper
<
JyjcInspectionApplication
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
set
(
JyjcInspectionApplication:
:
getInspectAppUrl
,
filePath
);
updateWrapper
.
eq
(
BaseEntity:
:
getSequenceNbr
,
appSeq
);
repository
.
update
(
null
,
updateWrapper
);
log
.
info
(
"异步生成报检申请表结束"
);
}
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/file/inspectapp/strategy/GenericDocGeneratorStrategy.java
View file @
df01b2b9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jyjc
.
biz
.
file
.
inspectapp
.
strategy
;
import
cn.hutool.core.date.StopWatch
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.module.common.api.enums.EquipmentClassifityEnum
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplication
;
...
...
@@ -21,6 +22,7 @@ import java.io.File;
import
java.nio.file.Files
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
@Service
...
...
@@ -45,12 +47,19 @@ public class GenericDocGeneratorStrategy implements SupportableDocGenerator {
@Override
public
String
generate
(
String
appSeq
)
{
StopWatch
stopWatch
=
new
StopWatch
();
stopWatch
.
start
(
"1.组织数据"
);
Map
<
String
,
Object
>
params
=
appDocCmService
.
getBaseInFo
(
appSeq
);
JyjcInspectionApplication
inspectionApplication
=
jyjcInspectionApplicationService
.
getBaseMapper
().
selectById
(
appSeq
);
params
.
put
(
"numberOfEquip"
,
inspectionApplication
.
getNumberOfEquip
());
setEquipExcelData
(
inspectionApplication
,
params
);
stopWatch
.
stop
();
stopWatch
.
start
(
"2.文件生成及上传"
);
this
.
setRequestContext
();
return
this
.
generatePdfAndUpload
(
params
);
String
path
=
this
.
generatePdfAndUpload
(
params
);
stopWatch
.
stop
();
log
.
info
(
"生成台套气瓶申请表耗时:{}"
,
stopWatch
.
prettyPrint
(
TimeUnit
.
SECONDS
));
return
path
;
}
private
void
setRequestContext
()
{
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/file/inspectapp/strategy/PipelineDocGeneratorStrategy.java
View file @
df01b2b9
...
...
@@ -13,12 +13,14 @@ import com.yeejoin.amos.component.robot.AmosRequestContext;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
cn.hutool.core.date.StopWatch
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
java.io.File
;
import
java.nio.file.Files
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
@Service
@Slf4j
...
...
@@ -40,11 +42,18 @@ public class PipelineDocGeneratorStrategy implements SupportableDocGenerator {
@Override
public
String
generate
(
String
appSeq
)
{
StopWatch
stopWatch
=
new
StopWatch
();
stopWatch
.
start
(
"1.组织数据"
);
Map
<
String
,
Object
>
params
=
appDocCmService
.
getBaseInFo
(
appSeq
);
JyjcInspectionApplication
inspectionApplication
=
jyjcInspectionApplicationService
.
getBaseMapper
().
selectById
(
appSeq
);
this
.
setPipelineInfo
(
params
,
inspectionApplication
);
stopWatch
.
stop
();
stopWatch
.
start
(
"2.文件生成及上传"
);
this
.
setRequestContext
();
return
this
.
generatePdfAndUpload
(
params
);
String
path
=
this
.
generatePdfAndUpload
(
params
);
stopWatch
.
stop
();
log
.
info
(
"生成管道报检申请表耗时:{}"
,
stopWatch
.
prettyPrint
(
TimeUnit
.
SECONDS
));
return
path
;
}
private
void
setRequestContext
()
{
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/JyjcInspectionApplicationServiceImpl.java
View file @
df01b2b9
...
...
@@ -88,6 +88,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.support.TransactionSynchronization
;
import
org.springframework.transaction.support.TransactionSynchronizationManager
;
import
org.springframework.util.StopWatch
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
...
...
@@ -1934,8 +1935,13 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
}
public
String
genDocPath
(
String
appSeq
)
{
StopWatch
watch
=
new
StopWatch
();
watch
.
start
();
DocGenerationRequest
docGenerationRequest
=
defaultDocGenerateAdapter
.
prepareRequest
(
appSeq
);
DocGenerator
docGenerator
=
docGeneratorFactory
.
getGenerator
(
docGenerationRequest
);
return
docGenerator
.
generate
(
appSeq
);
String
path
=
docGenerator
.
generate
(
appSeq
);
watch
.
stop
();
log
.
info
(
"生成报检申请表耗时:{}秒"
,
watch
.
getTotalTimeSeconds
());
return
path
;
}
}
\ 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