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
a1e38112
Commit
a1e38112
authored
Dec 26, 2023
by
liufan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加:移装变更登记,导出使用登记证方法
parent
4d74e0dd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
148 additions
and
30 deletions
+148
-30
IJgChangeRegistrationTransferService.java
.../jg/api/service/IJgChangeRegistrationTransferService.java
+2
-0
JgChangeRegistrationTransferController.java
...iz/controller/JgChangeRegistrationTransferController.java
+9
-3
JgChangeRegistrationTransferServiceImpl.java
...service/impl/JgChangeRegistrationTransferServiceImpl.java
+137
-27
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/service/IJgChangeRegistrationTransferService.java
View file @
a1e38112
...
...
@@ -30,4 +30,6 @@ public interface IJgChangeRegistrationTransferService extends IService<JgChangeR
void
flowExecute
(
Long
sequenceNbr
,
String
instanceId
,
String
operate
,
String
comment
,
boolean
update
);
void
revocation
(
String
instanceId
);
void
exportUseRegistrationCertificate
(
String
sequenceNbr
);
}
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 @
a1e38112
...
...
@@ -3,22 +3,21 @@ package com.yeejoin.amos.boot.module.jg.biz.controller;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgChangeRegistrationTransferService
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.List
;
import
java.util.Map
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgChangeRegistrationTransferServiceImpl
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationTransferDto
;
...
...
@@ -145,4 +144,11 @@ public class JgChangeRegistrationTransferController extends BaseController {
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationTransferService
.
queryListForPage
(
page
,
params
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/export"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"导出使用登记证"
,
notes
=
"导出使用登记证"
)
public
void
exportImageZip
(
HttpServletResponse
response
,
@RequestParam
(
"sequenceNbr"
)
String
sequenceNbr
){
jgChangeRegistrationTransferService
.
exportUseRegistrationCertificate
(
sequenceNbr
);
}
}
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 @
a1e38112
...
...
@@ -26,8 +26,11 @@ import com.yeejoin.amos.boot.module.jg.api.service.IJgChangeRegistrationTransfer
import
com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationTransferDto
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgRegistrationHistoryService
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICommonService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgUseInfoService
;
import
com.yeejoin.amos.boot.module.jg.flc.api.fegin.WorkFlowFeignService
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgFactoryInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum
;
...
...
@@ -39,6 +42,7 @@ import com.yeejoin.amos.feign.workflow.Workflow;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO
;
import
com.yeejoin.amos.feign.workflow.model.AjaxResult
;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.elasticsearch.action.search.SearchRequest
;
import
org.elasticsearch.action.search.SearchResponse
;
import
org.elasticsearch.client.RequestOptions
;
...
...
@@ -65,6 +69,7 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.stream.Collectors
;
/**
* 移装变更登记登记服务实现类
...
...
@@ -88,6 +93,8 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
private
IdxBizJgUseInfoServiceImpl
idxBizJgUseInfoService
;
@Autowired
private
IdxBizJgRegisterInfoServiceImpl
idxBizJgRegisterInfoService
;
@Autowired
private
IdxBizJgFactoryInfoServiceImpl
idxBizJgFactoryInfoService
;
@Autowired
...
...
@@ -120,6 +127,8 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
@Autowired
private
IdxBizJgRegisterInfoMapper
idxBizJgRegisterInfoMapper
;
@Autowired
ICommonService
commonService
;
@Autowired
TzsServiceFeignClient
tzsServiceFeignClient
;
...
...
@@ -173,7 +182,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
oldTransferEq
=
jgChangeRegistrationTransferEqService
.
getDetailByEquipTransferId
(
sequenceNbr
);
//查询历史记录表
if
(!
ValidationUtil
.
isEmpty
(
oldTransferEq
))
{
oldHistory
=
jgRegistrationHistoryService
.
getDteailByRecord
(
oldTransferEq
.
getEquId
(),
sequenceNbr
);
oldHistory
=
jgRegistrationHistoryService
.
getDteailByRecord
(
oldTransferEq
.
getEquId
(),
oldTransfer
.
getApplyNo
()
);
useInfo
=
idxBizJgUseInfoService
.
getOneData
(
oldTransferEq
.
getEquId
());
}
}
...
...
@@ -188,6 +197,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
//录入单位统一信用代码
oldTransfer
.
setInputUnitNo
(
company
.
getCompanyCode
());
//登记机构代码
//登记机构公司代码
if
(!
ValidationUtil
.
isEmpty
(
receiveOrgCode
))
{
...
...
@@ -233,31 +243,14 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
}
}
//使用登记编号
X
//使用登记编号
if
(!
ValidationUtil
.
isEmpty
(
dto2
.
get
(
"USE_REGISTRATION_CODE"
)))
{
oldTransfer
.
setUseRegistrationCode
((
String
)
dto2
.
get
(
"USE_REGISTRATION_CODE"
));
}
else
{
//使用登记编号
oldTransfer
.
setUseRegistrationCode
(
idxBizJgRegisterInfoMapper
.
getUseOrgCodeByEquip
(
equId
));
}
//检验机构统一信用代码 X
if
(!
ValidationUtil
.
isEmpty
(
dto2
.
get
(
"INSPECT_UNIT_CREDIT_CODE"
)))
{
oldTransfer
.
setInspectUnitCreditCode
((
String
)
dto2
.
get
(
"INSPECT_UNIT_CREDIT_CODE"
));
}
//检验单位 X
if
(!
ValidationUtil
.
isEmpty
(
dto2
.
get
(
"INSPECT_UNIT_NAME"
)))
{
oldTransfer
.
setInspectUnitName
((
String
)
dto2
.
get
(
"INSPECT_UNIT_NAME"
));
}
//检验结果照片 X
if
(!
ValidationUtil
.
isEmpty
(
dto2
.
get
(
"INSPECT_RESULT_PHOTO"
)))
{
oldTransfer
.
setInspectResultPhoto
((
String
)
dto2
.
get
(
"INSPECT_RESULT_PHOTO"
));
}
//检验结果 X
if
(!
ValidationUtil
.
isEmpty
(
dto2
.
get
(
"INSPECT_RESULT"
)))
{
oldTransfer
.
setInspectResult
((
String
)
dto2
.
get
(
"INSPECT_RESULT"
));
}
//安装单位名称 X
if
(!
ValidationUtil
.
isEmpty
(
dto2
.
get
(
"INSTALL_UNIT_NAME"
)))
{
oldTransfer
.
setSupervisoryCode
((
String
)
dto2
.
get
(
"INSTALL_UNIT_NAME"
));
}
}
//保存【移装变更登记】基本信息
...
...
@@ -271,6 +264,8 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
jgChangeRegistrationTransferEqService
.
saveOrUpdateTransferEqData
(
oldTransferEq
);
//新增历史记录表
//使用登记证编号
oldHistory
.
setUseRegistrationCode
(
oldTransfer
.
getUseRegistrationCode
());
oldHistory
.
setRegistrationClass
(
"移装登记"
);
//保存变更新数据
oldHistory
.
setChangeData
(
JSON
.
toJSONString
(
tableData
));
...
...
@@ -279,9 +274,8 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
//设备监管码
oldHistory
.
setSupervisoryCode
(
supervisoryCode
);
oldHistory
.
setEquId
(
equId
);
oldHistory
.
setCurrentDocumentId
(
oldTransfer
.
get
SequenceNbr
().
toString
());
oldHistory
.
setCurrentDocumentId
(
oldTransfer
.
get
ApplyNo
());
oldHistory
.
setStatus
(
"new"
);
jgRegistrationHistoryService
.
saveOrUpdateHistoryData
(
oldHistory
);
}
catch
(
IOException
e
)
{
...
...
@@ -394,6 +388,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
this
.
update
(
jgTransfer
,
lambda
);
}
/**
* 批量删除
*
...
...
@@ -420,9 +415,16 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
//删除历史表
JgRegistrationHistory
history
=
new
JgRegistrationHistory
();
history
.
setIsDelete
(
true
);
List
<
JgChangeRegistrationTransferDto
>
transferDtos
=
this
.
queryBatchSeq
(
Arrays
.
asList
(
sequenceNbrs
));
if
(!
ValidationUtil
.
isEmpty
(
transferDtos
))
{
List
<
String
>
applyNos
=
transferDtos
.
stream
().
map
(
item
->
item
.
getApplyNo
()).
collect
(
Collectors
.
toList
());
if
(!
ValidationUtil
.
isEmpty
(
applyNos
))
{
LambdaQueryWrapper
<
JgRegistrationHistory
>
historyWapper
=
new
QueryWrapper
<
JgRegistrationHistory
>().
lambda
();
historyWapper
.
in
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
Arrays
.
asList
(
sequenceNbrs
)
);
historyWapper
.
in
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
applyNos
);
jgRegistrationHistoryService
.
updateDate
(
history
,
historyWapper
);
}
}
}
catch
(
Exception
e
)
{
return
false
;
}
...
...
@@ -449,7 +451,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
// 1、未执行完成时查询历史表
// 2、执行完成后查询使用信息表
if
(!
ValidationUtil
.
equals
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
(),
transferById
.
getStatus
()))
{
JgRegistrationHistory
historyData
=
jgRegistrationHistoryService
.
getDteailByRecord
(
equipId
,
transferById
.
get
SequenceNbr
().
toString
());
JgRegistrationHistory
historyData
=
jgRegistrationHistoryService
.
getDteailByRecord
(
equipId
,
transferById
.
get
ApplyNo
());
if
(!
ValidationUtil
.
isEmpty
(
historyData
))
{
JSONObject
newPosition
=
JSON
.
parseObject
(
historyData
.
getChangeData
());
String
record
=
newPosition
.
getString
(
"record"
);
...
...
@@ -652,8 +654,10 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
* @param useRegistrationCode 使用登记编号
*/
public
void
replacementHistoryData
(
String
record
,
String
sequenceNbr
,
String
useRegistrationCode
)
{
JgChangeRegistrationTransfer
transfer
=
this
.
getBaseMapper
().
selectById
(
sequenceNbr
);
if
(!
ValidationUtil
.
isEmpty
(
transfer
))
{
//查询修改后的新数据
JgRegistrationHistory
newData
=
jgRegistrationHistoryService
.
getDteailByRecord
(
record
,
sequenceNbr
);
JgRegistrationHistory
newData
=
jgRegistrationHistoryService
.
getDteailByRecord
(
record
,
transfer
.
getApplyNo
()
);
//查询设备旧数据
IdxBizJgUseInfo
useInfo
=
useInfoService
.
getOneData
(
record
);
...
...
@@ -711,6 +715,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
useInfoService
.
saveOrUpdateData
(
useInfo
);
}
}
}
/**
* 修改各类告知列表,置为废弃
...
...
@@ -770,4 +775,108 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
}
return
null
;
}
/**
* 导出使用登记证
*
* @param sequenceNbr
*/
public
void
exportUseRegistrationCertificate
(
String
sequenceNbr
)
{
Map
<
String
,
Object
>
exportParamsMap
=
new
HashMap
<>();
//查询移装变更详情
JgChangeRegistrationTransfer
transfer
=
this
.
getById
(
sequenceNbr
);
JgChangeRegistrationTransferEq
transferEq
=
jgChangeRegistrationTransferEqService
.
getDetailByEquipTransferId
(
sequenceNbr
);
if
(
ValidationUtil
.
isEmpty
(
transfer
)
||
ValidationUtil
.
isEmpty
(
transferEq
))
{
throw
new
BadRequest
(
"使用登记证导出失败,请稍后重试!"
);
}
//是否废弃
exportParamsMap
.
put
(
"isInvalid"
,
transferEq
.
getIsInvalid
());
JgRegistrationHistory
transferHistory
=
jgRegistrationHistoryService
.
getDteailByRecord
(
transferEq
.
getEquId
(),
transfer
.
getApplyNo
());
//登记机关
exportParamsMap
.
put
(
"receiveOrgName"
,
transfer
.
getReceiveOrgName
());
//使用登记证编号
exportParamsMap
.
put
(
"useRegistrationCode"
,
transfer
.
getUseRegistrationCode
());
//使用单位名称
exportParamsMap
.
put
(
"useUnitName"
,
transfer
.
getUseUnitName
());
//监管码
exportParamsMap
.
put
(
"supervisoryCode"
,
transfer
.
getSupervisoryCode
());
//发证日期(当前时间)
exportParamsMap
.
put
(
"issueData"
,
new
Date
());
//设备使用地址
if
(!
ValidationUtil
.
isEmpty
(
transferHistory
)){
String
fullAddress
=
""
;
JSONObject
newPosition
=
JSON
.
parseObject
(
transferHistory
.
getChangeData
());
String
province
=
newPosition
.
getString
(
"province"
);
String
city
=
newPosition
.
getString
(
"city"
);
String
county
=
newPosition
.
getString
(
"county"
);
String
street
=
newPosition
.
getString
(
"street"
);
String
address
=
newPosition
.
getString
(
"address"
);
// 分割省市区街道字段
if
(!
ObjectUtils
.
isEmpty
(
province
))
{
String
[]
provinceList
=
province
.
split
(
"_"
);
if
(
provinceList
.
length
>
1
)
{
fullAddress
+=
provinceList
[
1
];
}
}
if
(!
ObjectUtils
.
isEmpty
(
city
))
{
String
[]
cityList
=
city
.
split
(
"_"
);
if
(
cityList
.
length
>
1
)
{
fullAddress
+=
cityList
[
1
];
}
}
if
(!
ObjectUtils
.
isEmpty
(
county
))
{
String
[]
countyList
=
county
.
split
(
"_"
);
if
(
countyList
.
length
>
1
)
{
fullAddress
+=
countyList
[
1
];
}
}
if
(!
ObjectUtils
.
isEmpty
(
street
))
{
String
[]
streetList
=
street
.
split
(
"_"
);
if
(
streetList
.
length
>
1
)
{
fullAddress
+=
streetList
[
1
];
}
}
if
(!
ObjectUtils
.
isEmpty
(
address
))
{
fullAddress
+=
address
;
}
exportParamsMap
.
put
(
"fullAddress"
,
fullAddress
);
}
//查询设备注册信息
IdxBizJgRegisterInfo
registerInfo
=
idxBizJgRegisterInfoService
.
getOne
(
new
QueryWrapper
<
IdxBizJgRegisterInfo
>().
eq
(
"RECORD"
,
transferEq
.
getEquId
()));
if
(!
ValidationUtil
.
isEmpty
(
registerInfo
)){
//设备种类、类别、品种
String
equList
=
registerInfo
.
getEquList
();
//设备种类
String
equCategory
=
registerInfo
.
getEquCategory
();
//设备类别
String
equDefine
=
registerInfo
.
getEquDefine
();
//设备品种
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
))
{
exportParamsMap
.
put
(
"equList"
,
categoryList0
.
get
(
0
).
getName
());
}
if
(
CollectionUtils
.
isNotEmpty
(
categoryList1
))
{
exportParamsMap
.
put
(
"equCategory"
,
categoryList1
.
get
(
0
).
getName
());
}
if
(
CollectionUtils
.
isNotEmpty
(
categoryList2
))
{
exportParamsMap
.
put
(
"equDefine"
,
categoryList2
.
get
(
0
).
getName
());
}
//设备代码
exportParamsMap
.
put
(
"equCode"
,
registerInfo
.
getEquCode
());
}
//单位内部编码
IdxBizJgUseInfo
useInfo
=
idxBizJgUseInfoService
.
getOneData
(
transferEq
.
getEquId
());
if
(!
ValidationUtil
.
isEmpty
(
useInfo
)){
exportParamsMap
.
put
(
"useInnerCode"
,
useInfo
.
getUseInnerCode
());
}
IdxBizJgFactoryInfo
factoryInfo
=
idxBizJgFactoryInfoService
.
getOneData
(
transferEq
.
getEquId
());
//产品编号(出厂编号)
if
(!
ValidationUtil
.
isEmpty
(
factoryInfo
)){
exportParamsMap
.
put
(
"factoryNum"
,
factoryInfo
.
getFactoryNum
());
}
}
}
\ 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