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
c3896f75
Commit
c3896f75
authored
Dec 26, 2023
by
liufan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改:移装变更下载使用登记证时,添加校验
parent
6fbcfbe4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
19 deletions
+35
-19
JgChangeRegistrationTransferController.java
...iz/controller/JgChangeRegistrationTransferController.java
+1
-18
JgChangeRegistrationTransferServiceImpl.java
...service/impl/JgChangeRegistrationTransferServiceImpl.java
+34
-1
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/controller/JgChangeRegistrationTransferController.java
View file @
c3896f75
...
...
@@ -155,25 +155,8 @@ public class JgChangeRegistrationTransferController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/export"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"导出使用登记证"
,
notes
=
"导出使用登记证"
)
public
void
exportImageZip
(
HttpServletResponse
response
,
@RequestParam
(
"sequenceNbr"
)
String
sequenceNbr
)
throws
IOException
{
public
void
exportImageZip
(
HttpServletResponse
response
,
@RequestParam
(
"sequenceNbr"
)
String
sequenceNbr
){
jgChangeRegistrationTransferService
.
exportUseRegistrationCertificate
(
sequenceNbr
,
response
);
// if(ValidationUtil.isEmpty(file)){
// throw new BadRequest("使用登记证导出失败,请稍后重试!");
// }
// FileInputStream in = new FileInputStream(file);
// response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("使用登记证", "UTF-8") + ".pdf");
// response.setHeader("content-Type", "application/msword");
// response.setCharacterEncoding("utf-8");
//
// OutputStream out = new BufferedOutputStream(response.getOutputStream());
// int b = 0;
// byte[] buffer = new byte[2048];
// while ((b = in.read(buffer)) != -1) {
// out.write(buffer, 0, b);
// }
// in.close();
// out.flush();
// out.close();
}
}
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/JgChangeRegistrationTransferServiceImpl.java
View file @
c3896f75
...
...
@@ -842,12 +842,24 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
exportParamsMap
.
put
(
"isInvalid"
,
transferEq
.
getIsInvalid
());
JgRegistrationHistory
transferHistory
=
jgRegistrationHistoryService
.
getDteailByRecord
(
transferEq
.
getEquId
(),
transfer
.
getApplyNo
());
//登记机关
if
(
ValidationUtil
.
isEmpty
(
transfer
.
getReceiveOrgName
())){
throw
new
BadRequest
(
"使用登记证导出失败,登记机关为空!"
);
}
exportParamsMap
.
put
(
"receiveOrgName"
,
transfer
.
getReceiveOrgName
());
//使用登记证编号
if
(
ValidationUtil
.
isEmpty
(
transfer
.
getUseRegistrationCode
())){
throw
new
BadRequest
(
"使用登记证导出失败,使用登记证编号为空!"
);
}
exportParamsMap
.
put
(
"useRegistrationCode"
,
transfer
.
getUseRegistrationCode
());
//使用单位名称
if
(
ValidationUtil
.
isEmpty
(
transfer
.
getUseUnitName
())){
throw
new
BadRequest
(
"使用登记证导出失败,使用单位名称为空!"
);
}
exportParamsMap
.
put
(
"useUnitName"
,
transfer
.
getUseUnitName
());
//监管码
if
(
ValidationUtil
.
isEmpty
(
transfer
.
getSupervisoryCode
())){
throw
new
BadRequest
(
"使用登记证导出失败,监管码为空!"
);
}
exportParamsMap
.
put
(
"supervisoryCode"
,
transfer
.
getSupervisoryCode
());
//发证日期(当前时间)
LocalDate
today
=
LocalDate
.
now
();
...
...
@@ -892,6 +904,9 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
if
(!
ObjectUtils
.
isEmpty
(
address
))
{
fullAddress
+=
address
;
}
if
(
ValidationUtil
.
isEmpty
(
fullAddress
)){
throw
new
BadRequest
(
"使用登记证导出失败,设备使用地址为空!"
);
}
exportParamsMap
.
put
(
"fullAddress"
,
fullAddress
);
}
...
...
@@ -905,27 +920,45 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
List
<
EquipmentCategory
>
categoryList0
=
commonService
.
getEquipmentCategoryList
(
equList
,
null
);
List
<
EquipmentCategory
>
categoryList1
=
commonService
.
getEquipmentCategoryList
(
equCategory
,
null
);
List
<
EquipmentCategory
>
categoryList2
=
commonService
.
getEquipmentCategoryList
(
equDefine
,
null
);
if
(
CollectionUtils
.
isNotEmpty
(
categoryList1
))
{
if
(
CollectionUtils
.
isNotEmpty
(
categoryList0
))
{
if
(
ValidationUtil
.
isEmpty
(
categoryList0
.
get
(
0
).
getName
())){
throw
new
BadRequest
(
"使用登记证导出失败,设备种类为空!"
);
}
exportParamsMap
.
put
(
"equList"
,
categoryList0
.
get
(
0
).
getName
());
}
if
(
CollectionUtils
.
isNotEmpty
(
categoryList1
))
{
if
(
ValidationUtil
.
isEmpty
(
categoryList1
.
get
(
0
).
getName
())){
throw
new
BadRequest
(
"使用登记证导出失败,设备类别为空!"
);
}
exportParamsMap
.
put
(
"equCategory"
,
categoryList1
.
get
(
0
).
getName
());
}
if
(
CollectionUtils
.
isNotEmpty
(
categoryList2
))
{
if
(
ValidationUtil
.
isEmpty
(
categoryList2
.
get
(
0
).
getName
())){
throw
new
BadRequest
(
"使用登记证导出失败,设备品种为空!"
);
}
exportParamsMap
.
put
(
"equDefine"
,
categoryList2
.
get
(
0
).
getName
());
}
//设备代码
if
(
ValidationUtil
.
isEmpty
(
registerInfo
.
getEquCode
())){
throw
new
BadRequest
(
"使用登记证导出失败,设备代码为空!"
);
}
exportParamsMap
.
put
(
"equCode"
,
registerInfo
.
getEquCode
());
}
//单位内部编码
IdxBizJgUseInfo
useInfo
=
idxBizJgUseInfoService
.
getOneData
(
transferEq
.
getEquId
());
if
(!
ValidationUtil
.
isEmpty
(
useInfo
)){
if
(
ValidationUtil
.
isEmpty
(
useInfo
.
getUseInnerCode
())){
throw
new
BadRequest
(
"使用登记证导出失败,设备单位内部编码为空!"
);
}
exportParamsMap
.
put
(
"useInnerCode"
,
useInfo
.
getUseInnerCode
());
}
IdxBizJgFactoryInfo
factoryInfo
=
idxBizJgFactoryInfoService
.
getOneData
(
transferEq
.
getEquId
());
//产品编号(出厂编号)
if
(!
ValidationUtil
.
isEmpty
(
factoryInfo
)){
if
(
ValidationUtil
.
isEmpty
(
factoryInfo
.
getFactoryNum
())){
throw
new
BadRequest
(
"使用登记证导出失败,产品编号为空!"
);
}
exportParamsMap
.
put
(
"factoryNum"
,
factoryInfo
.
getFactoryNum
());
}
//调用生成使用登记证
...
...
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