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
01800257
Commit
01800257
authored
Jul 25, 2024
by
王果
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
移装告知打印告知单
parent
4abf062d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
21 deletions
+45
-21
JgTransferNoticeServiceImpl.java
...dule/jg/biz/service/impl/JgTransferNoticeServiceImpl.java
+45
-21
No files found.
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/JgTransferNoticeServiceImpl.java
View file @
01800257
...
...
@@ -17,9 +17,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import
com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.*
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNotice
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNoticeEq
;
import
com.yeejoin.amos.boot.module.jg.api.entity.*
;
import
com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgRegistrationHistoryMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgTransferNoticeEqMapper
;
...
...
@@ -285,30 +283,56 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
* @return pdf文件路径
*/
@Override
// public void generateTransferNoticeReport(Long sequenceNbr, HttpServletResponse response) {
// if (Objects.isNull(sequenceNbr)) {
// throw new IllegalArgumentException("参数不能为空");
// }
//
// JgTransferNotice jgTransferNotice = this.getById(sequenceNbr);
// List<Map<String, Object>> informationList = jgTransferNoticeMapper.queryEquipInformation(sequenceNbr);
// if (Objects.isNull(jgTransferNotice) || CollectionUtils.isEmpty(informationList)) {
// throw new IllegalArgumentException("移装告知单不存在");
// }
//
// Map<String, Object> placeholders = jgInstallationNoticeService.fullFillTemplateObj(informationList, BusinessTypeEnum.JG_ADVICE_REMOVAL.getName().substring(0, 2));
//
// String tempFileName = "移装告知单_" + System.currentTimeMillis() + "_temp";
// // String url = WordTemplateUtils.templateToPdf(tempFileName, "installation-notification-report.ftl", placeholders);
// //
// // // 更新到数据库
// // jgTransferNotice.setNoticeReportUrl(url);
// // this.updateById(jgTransferNotice);
//
// WordTemplateUtils.templateToPdfDownload(tempFileName, "installation-notification-report.ftl", placeholders, response);
// }
public
void
generateTransferNoticeReport
(
Long
sequenceNbr
,
HttpServletResponse
response
)
{
if
(
Objects
.
isNull
(
sequenceNbr
))
{
throw
new
IllegalArgumentException
(
"参数不能为空"
);
}
JgTransferNotice
jgTransferNotice
=
this
.
getById
(
sequenceNbr
);
List
<
Map
<
String
,
Object
>>
informationList
=
jgTransferNoticeMapper
.
queryEquipInformation
(
sequenceNbr
);
if
(
Objects
.
isNull
(
jgTransferNotice
)
||
CollectionUtils
.
isEmpty
(
informationList
))
{
throw
new
IllegalArgumentException
(
"移装告知单不存在"
);
}
Map
<
String
,
Object
>
placeholders
=
jgInstallationNoticeService
.
fullFillTemplateObj
(
informationList
,
BusinessTypeEnum
.
JG_ADVICE_REMOVAL
.
getName
().
substring
(
0
,
2
));
JgTransferNotice
notice
=
this
.
getById
(
sequenceNbr
);
List
<
JgTransferNoticeEq
>
equList
=
jgTransferNoticeEqService
.
lambdaQuery
().
eq
(
JgTransferNoticeEq:
:
getEquipTransferId
,
notice
.
getSequenceNbr
()).
list
();
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
ArrayList
<
Map
<
String
,
Object
>>
maps
=
new
ArrayList
<>();
equList
.
forEach
(
equ
->{
List
<
Map
<
String
,
Object
>>
informationList
=
this
.
getBaseMapper
().
queryEquipInformation
(
equ
.
getSequenceNbr
());
if
(
Objects
.
isNull
(
notice
)
||
CollectionUtils
.
isEmpty
(
informationList
))
{
throw
new
IllegalArgumentException
(
"移装告知单不存在"
);
}
Map
<
String
,
Object
>
placeholders
=
jgInstallationNoticeService
.
fullFillTemplateObj
(
informationList
,
BusinessTypeEnum
.
JG_ADVICE_REMOVAL
.
getName
().
substring
(
0
,
2
));
maps
.
add
(
placeholders
);
});
String
tempFileName
=
"移装告知单_"
+
System
.
currentTimeMillis
()
+
"_temp"
;
//
String url = WordTemplateUtils.templateToPdf(tempFileName, "installation-notification-report.ftl", placeholders);
//
//
// 更新到数据库
// jgTransfer
Notice.setNoticeReportUrl(url);
// this.updateById(jgTransfer
Notice);
WordTemplateUtils
.
templateToPdfDownload
(
tempFileName
,
"installation-notification-report.ftl"
,
placeholders
,
response
);
//
String url = WordTemplateUtils.templateToPdf(tempFileName, "installation-notification-report.ftl", placeholders);
//
//
// 更新到数据库
// jgInstallation
Notice.setNoticeReportUrl(url);
// this.updateById(jgInstallation
Notice);
map
.
put
(
"equipBasicInfoList"
,
maps
);
WordTemplateUtils
.
templateToPdfDownload
(
tempFileName
,
"installation-notification-report.ftl"
,
map
,
response
);
}
/**
* 更新移装告知
*
...
...
@@ -547,7 +571,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
BeanUtils
.
copyProperties
(
obj
,
taskMessageDto
);
dto
.
setModel
(
taskMessageDto
);
//摘要 按原有规则组装
dto
.
setTaskContent
(
String
.
format
(
"来自%s
【%s】的业务办理,【申请单号:%s】"
,
obj
.
getEquList
(),
StringUtils
.
isEmpty
(
obj
.
getSupervisoryCode
())
?
""
:
obj
.
getSupervisoryCode
(),
obj
.
getApplyNo
()));
dto
.
setTaskContent
(
String
.
format
(
"来自%s
的业务办理,【申请单号:%s】"
,
obj
.
getEquList
(),
obj
.
getApplyNo
()));
//申请单号
dto
.
setTaskCode
(
obj
.
getApplyNo
());
//业务类型枚举code值
...
...
@@ -640,7 +664,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
taskModelDto
.
setStartDate
(
item
.
getCreateDate
());
taskModelDto
.
setNextExecuteUser
(
item
.
getNextExecuteIds
());
taskModelDto
.
setTaskContent
(
String
.
format
(
"来自%s
【%s】的业务办理,【申请单号:%s】"
,
item
.
getEquList
(),
StringUtils
.
isEmpty
(
item
.
getSupervisoryCode
())
?
""
:
item
.
getSupervisoryCode
(),
item
.
getApplyNo
()));
taskModelDto
.
setTaskContent
(
String
.
format
(
"来自%s
的业务办理,【申请单号:%s】"
,
item
.
getEquList
(),
item
.
getApplyNo
()));
TaskMessageDto
taskMessageDto
=
new
TaskMessageDto
();
BeanUtils
.
copyProperties
(
item
,
taskMessageDto
);
taskModelDto
.
setModel
(
taskMessageDto
);
...
...
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