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
b1f4454d
Commit
b1f4454d
authored
May 16, 2024
by
韩桐桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):汇总表经办人查询换成从平台查询
parent
ec9a6476
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+16
-15
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/JgUseRegistrationServiceImpl.java
View file @
b1f4454d
...
...
@@ -44,6 +44,7 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
...
...
@@ -185,10 +186,11 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
try
{
zip
.
putNextEntry
(
new
ZipEntry
(
filePrefix
+
"第"
+
(
i
+
1
)
+
"页"
+
".pdf"
));
IOUtils
.
write
(
futures
.
get
(
i
).
join
(),
zip
);
zip
.
closeEntry
();
}
catch
(
IOException
e
)
{
log
.
error
(
"打包zip失败:"
+
e
.
getMessage
());
throw
new
BadRequest
(
"打包zip失败"
);
}
finally
{
zip
.
closeEntry
();
}
}
response
.
setCharacterEncoding
(
"UTF-8"
);
...
...
@@ -1568,13 +1570,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
jgRegistrationHistory
.
getChangeData
());
JSONArray
equipmentLists
=
(
JSONArray
)
jsonObject
.
get
(
"equipmentLists"
);
total
=
equipmentLists
.
size
();
AgencyUserModel
result
=
new
AgencyUserModel
();
JgUseRegistration
jgUseRegistration
=
jgUseRegistrationMapper
.
selectOne
(
new
QueryWrapper
<
JgUseRegistration
>().
lambda
()
.
eq
(
JgUseRegistration:
:
getSequenceNbr
,
sequenceNbr
));
TzsUserInfo
tzsUserInfo
=
new
TzsUserInfo
();
if
(!
ValidationUtil
.
isEmpty
(
jgUseRegistration
.
getCreateUserId
()))
{
tzsUserInfo
=
userInfoMapper
.
selectOne
(
new
QueryWrapper
<
TzsUserInfo
>().
lambda
()
.
eq
(
TzsUserInfo:
:
getIsDelete
,
false
)
.
eq
(
TzsUserInfo:
:
getAmosUserId
,
jgUseRegistration
.
getCreateUserId
()));
result
=
Privilege
.
agencyUserClient
.
queryByUserId
(
jgUseRegistration
.
getCreateUserId
()).
getResult
();
}
if
(
"8300"
.
equals
(
category
))
{
// 压力管道基本信息汇总表
// 模板
...
...
@@ -1586,7 +1587,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 总页数
int
page
=
(
int
)
Math
.
ceil
(
total
/
size
);
// 异步获取数据
List
<
CompletableFuture
<
byte
[]>>
futures
=
pressurePipeDataPreparation
(
page
,
jsonObject
,
size
,
total
,
equipmentLists
,
wordPath
,
filePrefix
,
tzsUserInfo
);
List
<
CompletableFuture
<
byte
[]>>
futures
=
pressurePipeDataPreparation
(
page
,
jsonObject
,
size
,
total
,
equipmentLists
,
wordPath
,
filePrefix
,
result
);
// byte[]压缩zip
toZipFile
(
response
,
futures
,
filePrefix
,
customFileName
);
}
else
if
(
"2300"
.
equals
(
category
))
{
// 气瓶基本信息汇总表
...
...
@@ -1599,7 +1600,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 总页数
int
page
=
(
int
)
Math
.
ceil
(
total
/
size
);
// 异步获取数据
List
<
CompletableFuture
<
byte
[]>>
futures
=
cylinderDataPreparation
(
page
,
jsonObject
,
size
,
total
,
equipmentLists
,
wordPath
,
filePrefix
,
tzsUserInfo
);
List
<
CompletableFuture
<
byte
[]>>
futures
=
cylinderDataPreparation
(
page
,
jsonObject
,
size
,
total
,
equipmentLists
,
wordPath
,
filePrefix
,
result
);
// byte[]压缩zip
toZipFile
(
response
,
futures
,
filePrefix
,
customFileName
);
}
...
...
@@ -1610,7 +1611,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
*
* @return
*/
private
List
<
CompletableFuture
<
byte
[]>>
cylinderDataPreparation
(
int
page
,
JSONObject
jsonObject
,
int
size
,
double
total
,
JSONArray
equipmentLists
,
String
wordPath
,
String
filePrefix
,
TzsUserInfo
tzsUserInfo
)
{
private
List
<
CompletableFuture
<
byte
[]>>
cylinderDataPreparation
(
int
page
,
JSONObject
jsonObject
,
int
size
,
double
total
,
JSONArray
equipmentLists
,
String
wordPath
,
String
filePrefix
,
AgencyUserModel
result
)
{
List
<
CompletableFuture
<
byte
[]>>
futures
=
IntStream
.
rangeClosed
(
1
,
page
)
.
mapToObj
(
current
->
CompletableFuture
.
supplyAsync
(()
->
{
Map
<
String
,
Object
>
exportParamsMap
=
new
HashMap
<>();
...
...
@@ -1623,11 +1624,11 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 使用单位
exportParamsMap
.
put
(
"useUnitName"
,
jsonObject
.
get
(
"useUnitName"
));
// 联系电话
exportParamsMap
.
put
(
"phone"
,
ValidationUtil
.
isEmpty
(
tzsUserInfo
.
getPhone
())
?
""
:
tzsUserInfo
.
getPhon
e
());
exportParamsMap
.
put
(
"phone"
,
ValidationUtil
.
isEmpty
(
result
.
getMobile
())
?
""
:
result
.
getMobil
e
());
// 经办人
exportParamsMap
.
put
(
"agent"
,
ValidationUtil
.
isEmpty
(
tzsUserInfo
.
getName
())
?
""
:
tzsUserInfo
.
get
Name
());
exportParamsMap
.
put
(
"agent"
,
ValidationUtil
.
isEmpty
(
result
.
getRealName
())
?
""
:
result
.
getReal
Name
());
// 电子邮箱
exportParamsMap
.
put
(
"email"
,
ValidationUtil
.
isEmpty
(
tzsUserInfo
.
getEmail
())
?
""
:
tzsUserInfo
.
getEmail
());
exportParamsMap
.
put
(
"email"
,
ValidationUtil
.
isEmpty
(
result
.
getEmail
())
?
""
:
result
.
getEmail
());
// 数据分页
int
start
=
(
current
-
1
)
*
size
;
int
end
=
((
current
-
1
)
*
size
+
size
)
<
total
?
(
current
-
1
)
*
size
+
size
:
(
int
)
total
;
...
...
@@ -1646,7 +1647,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
*
* @return
*/
private
List
<
CompletableFuture
<
byte
[]>>
pressurePipeDataPreparation
(
int
page
,
JSONObject
jsonObject
,
int
size
,
double
total
,
JSONArray
equipmentLists
,
String
wordPath
,
String
filePrefix
,
TzsUserInfo
tzsUserInfo
)
{
private
List
<
CompletableFuture
<
byte
[]>>
pressurePipeDataPreparation
(
int
page
,
JSONObject
jsonObject
,
int
size
,
double
total
,
JSONArray
equipmentLists
,
String
wordPath
,
String
filePrefix
,
AgencyUserModel
result
)
{
List
<
CompletableFuture
<
byte
[]>>
futures
=
IntStream
.
rangeClosed
(
1
,
page
)
.
mapToObj
(
current
->
CompletableFuture
.
supplyAsync
(()
->
{
Map
<
String
,
Object
>
exportParamsMap
=
new
HashMap
<>();
...
...
@@ -1667,11 +1668,11 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 安全管理员
exportParamsMap
.
put
(
"safetyManager"
,
String
.
valueOf
(
jsonObject
.
get
(
"safetyManager"
)).
split
(
"_"
)[
1
]);
// 联系电话
exportParamsMap
.
put
(
"phone"
,
ValidationUtil
.
isEmpty
(
tzsUserInfo
.
getPhone
())
?
""
:
tzsUserInfo
.
getPhon
e
());
exportParamsMap
.
put
(
"phone"
,
ValidationUtil
.
isEmpty
(
result
.
getMobile
())
?
""
:
result
.
getMobil
e
());
// 经办人
exportParamsMap
.
put
(
"agent"
,
ValidationUtil
.
isEmpty
(
tzsUserInfo
.
getName
())
?
""
:
tzsUserInfo
.
get
Name
());
exportParamsMap
.
put
(
"agent"
,
ValidationUtil
.
isEmpty
(
result
.
getRealName
())
?
""
:
result
.
getReal
Name
());
// 电子邮箱
exportParamsMap
.
put
(
"email"
,
ValidationUtil
.
isEmpty
(
tzsUserInfo
.
getEmail
())
?
""
:
tzsUserInfo
.
getEmail
());
exportParamsMap
.
put
(
"email"
,
ValidationUtil
.
isEmpty
(
result
.
getEmail
())
?
""
:
result
.
getEmail
());
// 数据分页
int
start
=
(
current
-
1
)
*
size
;
int
end
=
((
current
-
1
)
*
size
+
size
)
<
total
?
(
current
-
1
)
*
size
+
size
:
(
int
)
total
;
...
...
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