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
f717b20e
Commit
f717b20e
authored
Jun 21, 2025
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):使用登记暂存功能
parent
5532efce
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
126 additions
and
53 deletions
+126
-53
JgUseRegistrationMapper.java
...os/boot/module/jg/api/mapper/JgUseRegistrationMapper.java
+1
-1
JgUseRegistrationMapper.xml
...api/src/main/resources/mapper/JgUseRegistrationMapper.xml
+1
-5
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+3
-0
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+121
-47
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/mapper/JgUseRegistrationMapper.java
View file @
f717b20e
...
...
@@ -53,7 +53,7 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
List
<
Map
<
String
,
Object
>>
getDetailById
(
@Param
(
"id"
)
Long
id
);
String
getEquType
(
@Param
(
"
record"
)
String
record
);
String
getEquType
(
@Param
(
"
code"
)
String
code
);
Map
<
String
,
Object
>
getMaintenanceDetail
(
@Param
(
"id"
)
String
id
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgUseRegistrationMapper.xml
View file @
f717b20e
...
...
@@ -647,11 +647,7 @@
GROUP BY re.equip_transfer_id
</select>
<select
id=
"getEquType"
resultType=
"java.lang.String"
>
SELECT ec.name
from idx_biz_jg_register_info jri
LEFT JOIN tz_equipment_category ec
on ec.code = jri.EQU_LIST
where jri.RECORD = #{record}
select name from tz_equipment_category where code=#{code}
</select>
<select
id=
"getInstallDetail"
resultType=
"java.util.Map"
>
...
...
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/CommonServiceImpl.java
View file @
f717b20e
...
...
@@ -167,6 +167,7 @@ public class CommonServiceImpl implements ICommonService {
private
static
final
String
basic
=
"basic"
;
private
static
final
String
useRegFormUpload
=
"useRegFormUpload"
;
public
static
final
String
HISTORY_EQU_TYPE
=
"historyEquType"
;
public
static
final
String
HISTORY_SUBMIT_TYPE
=
"historySubmitType"
;
public
static
final
String
SECOND
=
"second"
;
// 业务通用发起——告知单详情
public
static
final
String
notice
=
"notice"
;
...
...
@@ -1385,9 +1386,11 @@ public class CommonServiceImpl implements ICommonService {
})
public
Object
invokeBusinessType
(
Map
<
String
,
Object
>
map
)
{
String
historyEquType
=
(
String
)
map
.
get
(
HISTORY_EQU_TYPE
);
String
historySubmitType
=
(
String
)
map
.
get
(
HISTORY_SUBMIT_TYPE
);
JSONObject
jsonObject
=
new
JSONObject
((
Map
<
String
,
Object
>)
map
.
get
(
SECOND
));
Map
<
String
,
Object
>
useRegFormUploadObj
=
(
Map
<
String
,
Object
>)
map
.
get
(
useRegFormUpload
);
String
uploadMode
=
String
.
valueOf
(
useRegFormUploadObj
.
get
(
"uploadMode"
));
jsonObject
.
put
(
"historySubmitType"
,
historySubmitType
);
Map
<
String
,
Function
<
JSONObject
,
Object
>>
handlerMap
=
new
HashMap
<>();
handlerMap
.
put
(
"unit"
,
jgUseRegistrationServiceImpl:
:
handleUnitHistoryEquip
);
...
...
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 @
f717b20e
...
...
@@ -592,7 +592,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"otherAccessories"
)))
{
jgUseRegistration
.
setOtherAccessories
(
JSONObject
.
toJSONString
(
map
.
get
(
"otherAccessories"
)));
}
String
equType
=
this
.
baseMapper
.
getEquType
(
String
.
valueOf
(
map
.
get
(
"
equipId
"
)));
String
equType
=
this
.
baseMapper
.
getEquType
(
String
.
valueOf
(
map
.
get
(
"
EQU_LIST_CODE
"
)));
if
(
map
.
containsKey
(
"receiveOrgCode"
))
{
// 接收单位信息
String
[]
splitMaintenanceUnitCode
=
String
.
valueOf
(
map
.
getString
(
"receiveOrgCode"
)).
split
(
"_"
);
...
...
@@ -676,7 +676,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
LambdaQueryWrapper
<
JgUseRegistrationEq
>
lambda
=
new
QueryWrapper
<
JgUseRegistrationEq
>().
lambda
();
lambda
.
eq
(
JgUseRegistrationEq:
:
getEquipTransferId
,
jgUseRegistration
.
getSequenceNbr
());
JgUseRegistrationEq
jgUseRegistrationEq
=
new
JgUseRegistrationEq
();
jgUseRegistrationEq
.
setEquId
(
map
.
get
(
"equipId"
).
toString
(
));
jgUseRegistrationEq
.
setEquId
(
Objects
.
toString
(
map
.
get
(
"equipId"
),
null
));
jgRelationEquipMapper
.
update
(
jgUseRegistrationEq
,
lambda
);
// 历史设备登记生成的 编辑时更新使用登记证管理表
updateRegistrationManage
(
Long
.
valueOf
(
String
.
valueOf
(
map
.
get
(
"sequenceNbr"
))));
...
...
@@ -813,7 +813,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
.
select
(
IdxBizJgUseInfo:
:
getRecord
)
.
in
(
IdxBizJgUseInfo:
:
getProjectContraptionId
,
Arrays
.
asList
(
data
.
getOriginProjectContraptionIds
().
split
(
","
)))
.
list
();
records
=
useInfoRecords
.
stream
().
map
(
IdxBizJgUseInfo:
:
getRecord
).
collect
(
Collectors
.
toList
());
records
=
useInfoRecords
.
stream
().
map
(
IdxBizJgUseInfo:
:
getRecord
).
collect
(
toList
());
}
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
DEFINITION_KEY
)
.
delDataForCheckEquipRepeatUsed
(
records
,
data
.
getUseUnitCreditCode
());
...
...
@@ -841,7 +841,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
CompanyBo
company
=
reginParams
.
getCompany
();
String
equListCode
=
String
.
valueOf
(
map
.
get
(
"EQU_LIST_CODE"
));
List
<
Map
<
String
,
Object
>>
equipmentLists
=
(
List
<
Map
<
String
,
Object
>>)
map
.
get
(
"equipmentLists"
);
if
(
CollectionUtils
.
isEmpty
(
equipmentLists
))
{
if
(
!
ObjectUtils
.
isEmpty
(
map
.
get
(
"submit"
))
&&
CollectionUtils
.
isEmpty
(
equipmentLists
))
{
throw
new
BadRequest
(
"请选择设备信息!"
);
}
...
...
@@ -853,7 +853,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
.
eq
(
JgUseRegistration:
:
getIsDelete
,
false
)
.
eq
(
JgUseRegistration:
:
getStatus
,
"已完成"
)
).
stream
().
anyMatch
(
v
->
!
ObjectUtils
.
isEmpty
(
v
.
getUseRegistrationCode
())
&&
v
.
getUseRegistrationCode
().
contains
(
"瓶30"
));
if
(
hasExistingCertificate
&&
map
.
get
(
"isAddEquip"
).
equals
(
"0"
))
{
if
(
!
ObjectUtils
.
isEmpty
(
map
.
get
(
"submit"
))
&&
hasExistingCertificate
&&
map
.
get
(
"isAddEquip"
).
equals
(
"0"
))
{
throw
new
BadRequest
(
"该企业已存在气瓶证书,请选择增补功能进行登记!"
);
}
}
...
...
@@ -864,10 +864,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
.
eq
(
IdxBizJgUseInfo:
:
getProjectContraptionId
,
map
.
get
(
"projectContraptionId"
))
.
list
().
stream
()
.
map
(
IdxBizJgUseInfo:
:
getRecord
)
.
collect
(
Collectors
.
toSet
())
.
collect
(
toSet
())
:
Collections
.
emptySet
();
if
(
EquipmentClassifityEnum
.
YLGD
.
getCode
().
equals
(
equListCode
))
{
if
(
EquipmentClassifityEnum
.
YLGD
.
getCode
().
equals
(
equListCode
)
&&
!
CollectionUtils
.
isEmpty
(
equipmentLists
)
)
{
equipmentLists
.
forEach
(
equip
->
{
if
((
equip
.
get
(
"inspectReportNo"
)
==
null
||
equip
.
get
(
"inspectReportNo"
).
toString
().
isEmpty
())
||
(
equip
.
get
(
"inspectOrgCode"
)
==
null
||
equip
.
get
(
"inspectOrgCode"
).
toString
().
isEmpty
()))
{
...
...
@@ -876,9 +876,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
});
}
List
<
Map
<
String
,
Object
>>
filteredEquipmentLists
=
equipmentLists
.
stream
()
.
filter
(
equipment
->
!
excludedRecords
.
contains
(
equipment
.
get
(
"record"
)))
.
collect
(
Collectors
.
toList
());
List
<
Map
<
String
,
Object
>>
filteredEquipmentLists
=
Optional
.
ofNullable
(
equipmentLists
)
.
orElse
(
Collections
.
emptyList
())
.
stream
()
.
filter
(
equipment
->
{
Object
record
=
equipment
.
get
(
"record"
);
return
!
excludedRecords
.
contains
(
record
);
})
.
collect
(
toList
());
// 提交时进行校验设备是否在流程中使用(并发及同时打开多个相同的页面时才会出现此种情况)
checkForRepeatUsedEquip
(
map
,
filteredEquipmentLists
,
company
);
...
...
@@ -976,12 +981,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
jgRelationEquipMapper
.
delete
(
new
QueryWrapper
<
JgUseRegistrationEq
>().
lambda
().
eq
(
JgUseRegistrationEq:
:
getEquipTransferId
,
useRegistration
.
getSequenceNbr
()));
}
// 更新关联气瓶信息
List
<
JgUseRegistrationEq
>
equipList
=
equipmentLists
.
stream
()
List
<
JgUseRegistrationEq
>
equipList
=
Optional
.
ofNullable
(
equipmentLists
)
.
orElse
(
Collections
.
emptyList
())
.
stream
()
.
map
(
x
->
new
JgUseRegistrationEq
()
.
setEquId
(
String
.
valueOf
(
x
.
get
(
"record"
)))
.
setOriginProjectContraptionId
(
String
.
valueOf
(
x
.
get
(
"projectContraptionId"
)))
.
setEquipTransferId
(
String
.
valueOf
(
useRegistration
.
getSequenceNbr
())))
.
collect
(
Collectors
.
toList
());
.
collect
(
toList
());
// 保存关联设备信息
jgUseRegistrationEqService
.
saveBatch
(
equipList
);
...
...
@@ -1266,10 +1273,11 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 单位办理的压力管道,在完成审批时,将检验信息写入到装置检验信息表
// savePieLineProjectInspectData(jgUseRegistration, registerInfo, mapData);
// 生成证书管理表
Optional
.
ofNullable
(
registerInfo
).
ifPresent
(
info
->
{
generateRegistrationManage
(
jgUseRegistration
,
registerInfo
,
flag
.
get
(),
useRegistrationManageSeq
);
// 生成一条tzs_jg_certificate_change_record记录
generateCertificateChangeRecord
(
jgUseRegistration
,
registerInfo
,
changeRecordId
,
taskV2Model
,
flag
.
get
());
});
// 更新历史表:下次检验日期、检验机构名称、检验结论在压力管道、气瓶时更新子表单的数据
jgRegistrationHistory
.
setChangeData
(
JSON
.
toJSONString
(
mapData
));
jgRegistrationHistoryService
.
updateById
(
jgRegistrationHistory
);
...
...
@@ -1673,12 +1681,11 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
processMapData
(
sequenceNbr
,
mapData
,
jgUseRegistration
,
jgRegistrationHistory
,
registerInfo
,
otherInfo
,
taskV2Model
,
jsonObject
,
Boolean
.
FALSE
,
null
,
mapData
,
Boolean
.
FALSE
);
Optional
.
ofNullable
(
registerInfo
).
ifPresent
(
info
->
{
// 生成证书管理表记录
generateRegistrationManage
(
jgUseRegistration
,
registerInfo
,
Boolean
.
FALSE
,
null
);
// 生成一条使用登记证变更记录
generateCertificateChangeRecord
(
jgUseRegistration
,
registerInfo
,
changeRecordId
,
taskV2Model
,
Boolean
.
FALSE
);
// 查询设备制造信息
LambdaQueryWrapper
<
IdxBizJgFactoryInfo
>
factoryInfoWrapper
=
new
LambdaQueryWrapper
<>();
factoryInfoWrapper
.
eq
(
IdxBizJgFactoryInfo:
:
getRecord
,
equId
);
...
...
@@ -1690,6 +1697,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
changeRecordEq
.
setEquId
(
registerInfo
.
getRecord
());
//设备主键
changeRecordEq
.
setProductCode
(
idxBizJgFactoryInfo
.
getFactoryNum
());
certificateChangeRecordEqService
.
save
(
changeRecordEq
);
});
eventPublisher
.
publish
(
new
EquipCreateOrEditEvent
(
this
,
BusinessTypeEnum
.
JG_USAGE_REGISTRATION
.
name
(),
Sets
.
newHashSet
(
registerInfo
.
getRecord
()),
EquipCreateOrEditEvent
.
EquipType
.
equip
));
}
this
.
getBaseMapper
().
updateById
(
jgUseRegistration
);
...
...
@@ -1890,12 +1898,16 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
public
void
updateEsData2
(
String
usePlace
,
JSONObject
dataMap
,
IdxBizJgOtherInfo
otherInfo
,
IdxBizJgUseInfo
useInfo
,
JgUseRegistration
jgUseRegistration
,
JSONObject
jsonObject
)
{
if
(
otherInfo
!=
null
){
// 更新es
HashMap
<
String
,
Map
<
String
,
Object
>>
objMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
param
=
new
HashMap
<>();
// 属地监管部门拆分
String
orgBranch
=
(
String
)
dataMap
.
getOrDefault
(
"orgBranchCode"
,
"_"
);
String
[]
split
=
orgBranch
.
split
(
"_"
);
Object
orgBranchObj
=
dataMap
.
get
(
"orgBranchCode"
);
String
orgBranch
=
orgBranchObj
!=
null
?
orgBranchObj
.
toString
()
:
"_"
;
String
[]
split
=
orgBranch
.
split
(
"_"
,
2
);
String
branchCode
=
split
.
length
>
0
?
split
[
0
]
:
null
;
String
branchName
=
split
.
length
>
1
?
split
[
1
]
:
null
;
param
.
put
(
"SUPERVISORY_CODE"
,
otherInfo
.
getSupervisoryCode
());
param
.
put
(
"CODE96333"
,
otherInfo
.
getCode96333
());
param
.
put
(
"USE_UNIT_CREDIT_CODE"
,
dataMap
.
get
(
"useUnitCreditCode"
));
...
...
@@ -1910,8 +1922,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
param
.
put
(
"IS_INTO_MANAGEMENT"
,
true
);
param
.
put
(
"USE_PLACE_CODE"
,
jsonObject
.
get
(
"province"
)
+
"#"
+
jsonObject
.
get
(
"city"
)
+
"#"
+
jsonObject
.
get
(
"county"
)
+
"#"
+
jsonObject
.
get
(
"factoryUseSiteStreet"
));
param
.
put
(
"USE_SITE_CODE"
,
String
.
valueOf
(
jsonObject
.
get
(
"usePlace"
)));
param
.
put
(
"ORG_BRANCH_CODE"
,
split
[
0
]
);
param
.
put
(
"ORG_BRANCH_NAME"
,
split
[
1
]
);
param
.
put
(
"ORG_BRANCH_CODE"
,
branchCode
);
param
.
put
(
"ORG_BRANCH_NAME"
,
branchName
);
param
.
put
(
"USC_UNIT_CREDIT_CODE"
,
""
);
param
.
put
(
"USC_UNIT_NAME"
,
dataMap
.
getString
(
"uscUnitName"
));
param
.
put
(
"EQU_CODE"
,
dataMap
.
get
(
"equCode"
));
...
...
@@ -1920,6 +1932,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
objMap
.
put
((
String
)
dataMap
.
get
(
"equipId"
),
param
);
tzsServiceFeignClient
.
commonUpdateEsDataByIds
(
objMap
);
}
}
private
Long
castDate2TimeStr
(
String
nextInspectDate
)
{
if
(
nextInspectDate
!=
null
){
...
...
@@ -1969,7 +1982,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
taskMessageDto
.
setEquipId
(
equId
);
taskMessageDto
.
setEQU_LIST_CODE
(
this
.
getEquipListCode
(
equId
));
// dto.setTaskContent("来自" + this.getBaseMapper().getEquType(equId) + "【" + (ObjectUtils.isEmpty(jgUseRegistration.getSupervisoryCode()) ? "无" : jgUseRegistration.getSupervisoryCode()) + "】的业务办理," + "【申请单号:" + jgUseRegistration.getApplyNo() + "】");
dto
.
setTaskContent
(
"来自"
+
this
.
getBaseMapper
().
getEquType
(
equId
)
+
"的业务办理,"
+
"【申请单号:"
+
jgUseRegistration
.
getApplyNo
()
+
"】"
);
dto
.
setTaskContent
(
"来自"
+
this
.
getBaseMapper
().
getEquType
(
this
.
getEquipListCode
(
equId
)
)
+
"的业务办理,"
+
"【申请单号:"
+
jgUseRegistration
.
getApplyNo
()
+
"】"
);
}
dto
.
setModel
(
taskMessageDto
);
dto
.
setNextExecuteUser
(
workflowResultDto
.
getNextExecutorRoleIds
());
...
...
@@ -2286,7 +2299,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
}
else
{
List
<
Map
<
String
,
Object
>>
equipmentLists
=
(
List
<
Map
<
String
,
Object
>>)
jsonObject
.
get
(
"equipmentLists"
);
List
<
String
>
records
=
equipmentLists
.
stream
().
map
(
v
->
(
String
)
v
.
get
(
"record"
)).
collect
(
toList
());
List
<
String
>
records
=
Optional
.
ofNullable
(
equipmentLists
)
.
orElse
(
Collections
.
emptyList
())
.
stream
().
map
(
v
->
(
String
)
v
.
get
(
"record"
)).
collect
(
toList
());
if
(
record
==
null
||
record
.
isEmpty
())
{
record
=
records
.
stream
().
findFirst
().
orElse
(
null
);
}
...
...
@@ -2297,7 +2312,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
jsonObject
.
remove
(
"equipmentLists"
);
List
<
DictionarieValueModel
>
fillingMedium
=
Systemctl
.
dictionarieClient
.
dictValues
(
"FILLING_MEDIUM"
).
getResult
();
Map
<
String
,
Object
>
fillingMediumMap
=
fillingMedium
.
stream
().
collect
(
Collectors
.
toMap
(
DictionarieValueModel:
:
getDictDataKey
,
DictionarieValueModel:
:
getDictDataValue
));
List
<
Map
<
String
,
Object
>>
result
=
jgUseRegistrationMapper
.
queryForUnitVesselEquipment
(
records
);
List
<
Map
<
String
,
Object
>>
result
=
CollectionUtils
.
isEmpty
(
records
)
?
Collections
.
emptyList
()
:
jgUseRegistrationMapper
.
queryForUnitVesselEquipment
(
records
);
result
.
forEach
(
i
->
{
i
.
put
(
"chargingMedium"
,
fillingMediumMap
.
get
(
i
.
get
(
"chargingMedium"
)));
i
.
put
(
"productPhoto"
,
JSONArray
.
parseArray
((
String
)
i
.
get
(
"productPhoto"
)));
...
...
@@ -2652,7 +2669,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
.
flatMap
(
List:
:
stream
)
.
peek
(
map
->
map
.
put
(
"productName"
,
map
.
get
(
"pipeName"
)))
.
filter
(
map
->
result
.
add
(
JSONObject
.
toJSONString
(
map
)))
.
collect
(
Collectors
.
toList
());
.
collect
(
toList
());
}
public
List
<
Map
<
String
,
Object
>>
getEquipInfoList
(
List
<
Long
>
useRegistrationSeqs
,
String
category
,
Set
<
String
>
projectContraptionIdList
)
{
...
...
@@ -2848,7 +2865,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 设备数据填充
this
.
fillInCylinderEquData
(
exportParamsMap
,
equData
,
size
,
recordInformationMap
);
return
commonService
.
generateSummaryOfCylinderInfo
(
exportParamsMap
,
wordPath
,
filePrefix
);
})).
collect
(
Collectors
.
toList
());
})).
collect
(
toList
());
CompletableFuture
.
allOf
(
futures
.
toArray
(
new
CompletableFuture
[
page
])).
join
();
return
futures
;
}
...
...
@@ -2927,7 +2944,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 设备数据填充
this
.
pressurePipeEquData
(
currentExportParamsMap
,
equData
,
current
,
size
);
return
commonService
.
generateSummaryOfCylinderInfo
(
currentExportParamsMap
,
wordPath
,
filePrefix
);
})).
collect
(
Collectors
.
toList
());
})).
collect
(
toList
());
CompletableFuture
.
allOf
(
futures
.
toArray
(
new
CompletableFuture
[
page
])).
join
();
return
futures
;
}
...
...
@@ -3126,6 +3143,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
*/
public
void
createCode
(
JSONObject
dataMap
,
JgUseRegistration
jgUseRegistration
,
IdxBizJgRegisterInfo
registerInfo
,
IdxBizJgUseInfo
useInfo
,
IdxBizJgOtherInfo
otherInfo
)
{
if
(
otherInfo
!=
null
){
if
(
ObjectUtils
.
isEmpty
(
otherInfo
.
getSupervisoryCode
()))
{
// 生成监管码、96333码
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
...
...
@@ -3137,7 +3155,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
if
(
"1"
.
equals
(
otherInfo
.
getCode96333Type
()))
{
map
.
put
(
"code96333"
,
otherInfo
.
getCode96333
());
}
ResponseModel
<
Map
<
String
,
Object
>>
code
=
tzsServiceFeignClient
.
createCode
(
map
);
Map
<
String
,
Object
>
cleanedMap
=
map
.
entrySet
().
stream
()
.
filter
(
entry
->
{
Object
value
=
entry
.
getValue
();
return
value
!=
null
&&
!
"null"
.
equalsIgnoreCase
(
String
.
valueOf
(
value
).
trim
());
})
.
collect
(
Collectors
.
toMap
(
Map
.
Entry
::
getKey
,
Map
.
Entry
::
getValue
));
if
(
cleanedMap
.
size
()
>=
3
)
{
ResponseModel
<
Map
<
String
,
Object
>>
code
=
tzsServiceFeignClient
.
createCode
(
cleanedMap
);
Map
<
String
,
Object
>
result
=
code
.
getResult
();
if
(!
ObjectUtils
.
isEmpty
(
result
))
{
otherInfo
.
setSupervisoryCode
(
String
.
valueOf
(
result
.
get
(
"superviseCode"
)));
...
...
@@ -3148,12 +3173,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 更新使用登记业务表
jgUseRegistration
.
setSupervisoryCode
(
String
.
valueOf
(
result
.
get
(
"superviseCode"
)));
}
}
}
else
{
jgUseRegistration
.
setSupervisoryCode
(
otherInfo
.
getSupervisoryCode
());
}
otherInfo
.
setClaimStatus
(
"已认领"
);
otherInfoMapper
.
updateById
(
otherInfo
);
}
}
private
void
processElseDataByStatus
(
String
flowStatus
,
JgUseRegistration
jgUseRegistration
)
{
switch
(
flowStatus
)
{
...
...
@@ -3927,15 +3954,27 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
public
List
<
Map
<
String
,
Object
>>
handleHistoryEquip
(
JSONObject
map
)
{
try
{
// 使用登记证编号
String
useRegistrationCode
=
String
.
valueOf
(
map
.
get
(
"useOrgCode"
)).
trim
();
String
equipId
=
String
.
valueOf
(
map
.
get
(
"equipId"
));
String
useRegistrationCode
=
Optional
.
ofNullable
(
Objects
.
toString
(
map
.
get
(
"useOrgCode"
),
null
))
.
map
(
String:
:
trim
)
.
filter
(
s
->
!
"null"
.
equalsIgnoreCase
(
s
))
.
filter
(
s
->
!
""
.
equalsIgnoreCase
(
s
))
.
orElse
(
null
);
String
equipId
=
Optional
.
ofNullable
(
Objects
.
toString
(
map
.
get
(
"equipId"
),
null
))
.
map
(
String:
:
trim
)
.
filter
(
s
->
!
"null"
.
equalsIgnoreCase
(
s
))
.
orElse
(
null
);
if
(
equipId
==
null
)
{
throw
new
BadRequest
(
"请选择设备后进行暂存!"
);
}
//校验使用登记证编号的唯一性
Boolean
used
=
commonServiceImpl
.
useRegistrationCertificateAccountUnique
(
useRegistrationCode
,
equipId
);
if
(
used
)
{
if
(
useRegistrationCode
!=
null
)
{
if
(
Boolean
.
TRUE
.
equals
(
commonServiceImpl
.
useRegistrationCertificateAccountUnique
(
useRegistrationCode
,
equipId
)))
{
throw
new
BadRequest
(
"使用登记证编号已存在!"
);
}
//使用登记证编号判断是否使用未来系统生成编号
idxBizJgRegisterInfoService
.
checkUseRegistrationCode
(
useRegistrationCode
,
"set"
);
}
// 场车设备校验车牌号的唯一性
if
(
EquipmentClassifityEnum
.
CC
.
getCode
().
equals
(
map
.
get
(
"EQU_LIST_CODE"
)))
{
...
...
@@ -3965,13 +4004,13 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
jgUseRegistration
.
setReceiveOrgName
(
splitMaintenanceUnitCode
[
1
]);
jgUseRegistration
.
setReceiveCompanyOrgCode
(
commonService
.
getOneCompany
(
jgUseRegistration
.
getReceiveCompanyCode
()).
getOrgCode
());
}
if
(
map
.
containsKey
(
"orgBranchCode"
))
{
if
(
map
.
containsKey
(
"orgBranchCode"
)
&&
!
ObjectUtils
.
isEmpty
(
map
.
get
(
"orgBranchCode"
))
)
{
// 监察处置机构代码
String
[]
splitOrgBranchCode
=
String
.
valueOf
(
map
.
getString
(
"orgBranchCode"
)).
split
(
"_"
);
jgUseRegistration
.
setSupervisionOrgCode
(
splitOrgBranchCode
[
0
]);
}
// 安全管理员
if
(
map
.
containsKey
(
"safetyManager"
))
{
if
(
map
.
containsKey
(
"safetyManager"
)
&&
!
ObjectUtils
.
isEmpty
(
map
.
get
(
"safetyManager"
))
)
{
String
[]
data
=
String
.
valueOf
(
map
.
getString
(
"safetyManager"
)).
split
(
"_"
);
map
.
put
(
"safetyManagerId"
,
data
[
0
]);
map
.
put
(
"safetyManagerName"
,
data
[
1
]);
...
...
@@ -3983,6 +4022,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
company
.
getCompanyCode
().
split
(
"_"
)[
1
]
:
company
.
getCompanyCode
());
jgUseRegistration
.
setCreateUserId
(
reginParams
.
getUserModel
().
getUserId
());
jgUseRegistration
.
setCreateUserName
(
reginParams
.
getUserModel
().
getUserName
());
jgUseRegistration
.
setManageType
(
"set"
);
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"inspectUnitCreditCode"
)))
{
jgUseRegistration
.
setInspectUnitCreditCode
(
map
.
get
(
"inspectUnitCreditCode"
).
toString
());
}
...
...
@@ -4055,14 +4095,19 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
else
{
// 业务管理设备信息保存
JgUseRegistrationEq
jgRelationEquip
=
new
JgUseRegistrationEq
();
jgRelationEquip
.
setEquId
(
map
.
get
(
"equipId"
).
toString
());
jgRelationEquip
.
setEquId
(
Objects
.
toString
(
map
.
get
(
"equipId"
),
null
));
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
SYDJ
.
getCode
(),
1
);
if
(!
ObjectUtils
.
isEmpty
(
listResponseModel
))
{
jgUseRegistration
.
setApplyNo
(
listResponseModel
.
getResult
().
get
(
0
));
}
jgUseRegistration
.
setAuditPassDate
(
new
Date
());
jgUseRegistration
.
setAuditStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
jgUseRegistration
.
setStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
Object
submitType
=
map
.
get
(
"historySubmitType"
);
String
status
=
"temp"
.
equals
(
submitType
)
?
FlowStatusEnum
.
TO_BE_SUBMITTED
.
getName
()
:
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
();
jgUseRegistration
.
setStatus
(
status
);
jgUseRegistration
.
setUseRegistrationCode
(
ValidationUtil
.
isEmpty
(
map
.
get
(
"useOrgCode"
))
?
""
:
String
.
valueOf
(
map
.
get
(
"useOrgCode"
)));
jgUseRegistration
.
setRegType
(
"1"
);
//历史登记
this
.
save
(
jgUseRegistration
);
...
...
@@ -4070,23 +4115,27 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
jgRelationEquipMapper
.
insert
(
jgRelationEquip
);
// 暂存历史表
updateHistory
(
map
,
map
.
get
(
"equipId"
).
toString
(
),
String
.
valueOf
(
jgUseRegistration
.
getSequenceNbr
()),
jgUseRegistration
.
getSupervisoryCode
());
updateHistory
(
map
,
Objects
.
toString
(
map
.
get
(
"equipId"
),
null
),
String
.
valueOf
(
jgUseRegistration
.
getSequenceNbr
()),
jgUseRegistration
.
getSupervisoryCode
());
//监督管理信息
LambdaQueryWrapper
<
IdxBizJgSupervisionInfo
>
lambdaSup
=
new
QueryWrapper
<
IdxBizJgSupervisionInfo
>().
lambda
();
lambdaSup
.
eq
(
IdxBizJgSupervisionInfo:
:
getRecord
,
jgRelationEquip
.
getEquId
());
IdxBizJgSupervisionInfo
supervisionInfo
=
idxBizJgSupervisionInfoMapper
.
selectOne
(
lambdaSup
);
if
(
supervisionInfo
!=
null
&&
!
ObjectUtils
.
isEmpty
(
map
.
get
(
"orgBranchCode"
))){
supervisionInfo
.
setOrgBranchCode
(
String
.
valueOf
(
map
.
get
(
"orgBranchCode"
)).
split
(
"_"
)[
0
]);
supervisionInfo
.
setOrgBranchName
(
String
.
valueOf
(
map
.
get
(
"orgBranchCode"
)).
split
(
"_"
)[
1
]);
idxBizJgSupervisionInfoMapper
.
updateById
(
supervisionInfo
);
}
// 注册信息
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>
lambdaReg
=
new
QueryWrapper
<
IdxBizJgRegisterInfo
>().
lambda
();
lambdaReg
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
jgRelationEquip
.
getEquId
());
IdxBizJgRegisterInfo
registerInfo
=
idxBizJgRegisterInfoMapper
.
selectOne
(
lambdaReg
);
String
equCode
=
""
;
if
(
registerInfo
!=
null
){
registerInfo
.
setUseOrgCode
(
jgUseRegistration
.
getUseRegistrationCode
());
registerInfo
.
setEquCodeType
(
String
.
valueOf
(
map
.
get
(
"equCodeType"
)));
String
equCode
=
ObjectUtils
.
isEmpty
(
map
.
get
(
"equCode"
))
?
this
.
getEquCode
(
registerInfo
,
jgUseRegistration
.
getReceiveCompanyCode
())
:
String
.
valueOf
(
map
.
get
(
"equCode"
));
equCode
=
ObjectUtils
.
isEmpty
(
map
.
get
(
"equCode"
))
?
this
.
getEquCode
(
registerInfo
,
jgUseRegistration
.
getReceiveCompanyCode
())
:
String
.
valueOf
(
map
.
get
(
"equCode"
));
registerInfo
.
setEquCode
(
equCode
);
// 设备代码
registerInfo
.
setEquPrice
(
String
.
valueOf
(
map
.
get
(
"equPrice"
)));
registerInfo
.
setProductPhoto
(
JSONObject
.
toJSONString
(
map
.
get
(
"productPhoto"
)));
...
...
@@ -4096,11 +4145,13 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
registerInfo
.
setCarNumber
((
String
)
map
.
get
(
carNumber
));
}
idxBizJgRegisterInfoMapper
.
updateById
(
registerInfo
);
}
// 设计信息
LambdaQueryWrapper
<
IdxBizJgDesignInfo
>
lambdaDes
=
new
QueryWrapper
<
IdxBizJgDesignInfo
>().
lambda
();
lambdaDes
.
eq
(
IdxBizJgDesignInfo:
:
getRecord
,
jgRelationEquip
.
getEquId
());
IdxBizJgDesignInfo
designInfo
=
idxBizJgDesignInfoService
.
getOne
(
lambdaDes
);
if
(
designInfo
!=
null
){
designInfo
.
setDesignUnitCreditCode
(
MapUtil
.
getStr
(
map
,
"designUnitCreditCode"
));
designInfo
.
setDesignUnitName
(
MapUtil
.
getStr
(
map
,
"designUnitName"
));
designInfo
.
setDesignLicenseNum
(
MapUtil
.
getStr
(
map
,
"designLicenseNum"
));
...
...
@@ -4113,12 +4164,13 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
designInfo
.
setDesignStandard
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"designStandard"
))
?
null
:
JSONObject
.
toJSONString
(
map
.
get
(
"designStandard"
)));
designInfo
.
setOtherAccessoriesDes
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"otherAccessoriesDes"
))
?
null
:
JSONObject
.
toJSONString
(
map
.
get
(
"otherAccessoriesDes"
)));
idxBizJgDesignInfoMapper
.
updateById
(
designInfo
);
}
// 制造信息
LambdaQueryWrapper
<
IdxBizJgFactoryInfo
>
factoryInfoWrapper
=
new
LambdaQueryWrapper
<>();
factoryInfoWrapper
.
eq
(
IdxBizJgFactoryInfo:
:
getRecord
,
jgRelationEquip
.
getEquId
());
IdxBizJgFactoryInfo
idxBizJgFactoryInfo
=
idxBizJgFactoryInfoService
.
getOne
(
factoryInfoWrapper
);
if
(
idxBizJgFactoryInfo
!=
null
){
idxBizJgFactoryInfo
.
setProduceUnitCreditCode
(
MapUtil
.
getStr
(
map
,
"produceUnitCreditCode"
));
idxBizJgFactoryInfo
.
setProduceUnitName
(
MapUtil
.
getStr
(
map
,
"produceUnitName"
));
idxBizJgFactoryInfo
.
setFactoryNum
(
MapUtil
.
getStr
(
map
,
"factoryNum"
));
...
...
@@ -4133,11 +4185,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
idxBizJgFactoryInfo
.
setFactSupervisionInspectionReport
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"factSupervisionInspectionReport"
))
?
null
:
JSONObject
.
toJSONString
(
map
.
get
(
"factSupervisionInspectionReport"
)));
idxBizJgFactoryInfo
.
setBoilerEnergyEfficiencyCertificate
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"boilerEnergyEfficiencyCertificate"
))
?
null
:
JSONObject
.
toJSONString
(
map
.
get
(
"boilerEnergyEfficiencyCertificate"
)));
idxBizJgFactoryInfoMapper
.
updateById
(
idxBizJgFactoryInfo
);
}
// 使用信息
LambdaQueryWrapper
<
IdxBizJgUseInfo
>
lambda
=
new
QueryWrapper
<
IdxBizJgUseInfo
>().
lambda
();
lambda
.
eq
(
IdxBizJgUseInfo:
:
getRecord
,
String
.
valueOf
(
map
.
get
(
"equipId"
)));
IdxBizJgUseInfo
useInfo
=
useInfoMapper
.
selectOne
(
lambda
);
String
usePlace
=
""
;
if
(
useInfo
!=
null
){
useInfo
.
setIsIntoManagement
(
Boolean
.
TRUE
);
useInfo
.
setUseUnitCreditCode
(
String
.
valueOf
(
map
.
get
(
"useUnitCreditCode"
)));
useInfo
.
setUseUnitName
(
String
.
valueOf
(
map
.
get
(
"useUnitName"
)));
...
...
@@ -4151,10 +4206,28 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
useInfo
.
setStreetName
(
useStreetName
);
useInfo
.
setAddress
(
String
.
valueOf
(
map
.
get
(
"address"
)));
useInfo
.
setIsNotXiXian
(
String
.
valueOf
(
map
.
get
(
"isXixian"
)));
useInfo
.
setEstateUnitCreditCode
(
String
.
valueOf
(
map
.
get
(
"estateUnitName"
)).
split
(
"_"
)[
0
]);
useInfo
.
setEstateUnitName
(
String
.
valueOf
(
map
.
get
(
"estateUnitName"
)).
split
(
"_"
)[
1
]);
useInfo
.
setEstateUnitCreditCode
(
Optional
.
ofNullable
(
map
.
get
(
"estateUnitName"
))
.
map
(
Object:
:
toString
)
.
filter
(
s
->
s
.
contains
(
"_"
))
.
map
(
s
->
s
.
split
(
"_"
,
2
))
.
filter
(
parts
->
parts
.
length
==
2
)
.
map
(
parts
->
parts
[
0
])
.
orElse
(
null
));
useInfo
.
setEstateUnitName
(
Optional
.
ofNullable
(
map
.
get
(
"estateUnitName"
))
.
map
(
Object:
:
toString
)
.
filter
(
s
->
s
.
contains
(
"_"
))
.
map
(
s
->
s
.
split
(
"_"
,
2
))
.
filter
(
parts
->
parts
.
length
==
2
)
.
map
(
parts
->
parts
[
1
])
.
orElse
(
null
));
useInfo
.
setPhone
(
String
.
valueOf
(
map
.
get
(
"phone"
)));
useInfo
.
setSafetyManager
(
String
.
valueOf
(
map
.
get
(
"safetyManager"
)).
split
(
"_"
)[
1
]);
useInfo
.
setSafetyManager
(
String
.
valueOf
(
Optional
.
ofNullable
(
map
.
get
(
"safetyManager"
))
.
map
(
Object:
:
toString
)
.
filter
(
s
->
s
.
contains
(
"_"
))
.
map
(
s
->
s
.
split
(
"_"
,
2
))
.
filter
(
parts
->
parts
.
length
==
2
)
.
map
(
parts
->
parts
[
0
])
.
orElse
(
null
)));
useInfo
.
setUseDate
(
String
.
valueOf
(
map
.
get
(
"useDate"
)));
useInfo
.
setLongitudeLatitude
(
JSON
.
toJSONString
(
map
.
get
(
"longitudeLatitude"
)));
useInfo
.
setUsePlace
((
String
)
map
.
get
(
"usePlace"
));
...
...
@@ -4164,8 +4237,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
useInfo
.
setORegUnit
(
String
.
valueOf
(
map
.
get
(
"oRegUnit"
)));
// 历史平台登记,将设备状态改为在用
useInfo
.
setEquState
(
EquimentEnum
.
ZAIYONG
.
getCode
().
toString
());
String
usePlace
=
useInfo
.
getProvinceName
()
+
"/"
+
useInfo
.
getCityName
()
+
"/"
+
useInfo
.
getCountyName
()
+
"/"
+
useInfo
.
getStreetName
();
usePlace
=
useInfo
.
getProvinceName
()
+
"/"
+
useInfo
.
getCityName
()
+
"/"
+
useInfo
.
getCountyName
()
+
"/"
+
useInfo
.
getStreetName
();
useInfoMapper
.
updateById
(
useInfo
);
}
LambdaQueryWrapper
<
IdxBizJgOtherInfo
>
otherLambda
=
new
QueryWrapper
<
IdxBizJgOtherInfo
>().
lambda
();
otherLambda
.
eq
(
IdxBizJgOtherInfo:
:
getRecord
,
map
.
get
(
"equipId"
));
...
...
@@ -4191,7 +4265,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
this
.
createCode
(
map
,
jgUseRegistration
,
registerInfo
,
useInfo
,
otherInfo
);
map
.
put
(
"equCode"
,
equCode
);
// 更新es
this
.
updateEsData2
(
usePlace
,
map
,
otherInfo
,
useInfo
,
jgUseRegistration
,
map
);
this
.
updateEsData2
(
usePlace
,
map
,
otherInfo
,
useInfo
,
jgUseRegistration
,
map
);
this
.
updateById
(
jgUseRegistration
);
// 设备安装信息更新
...
...
@@ -4203,7 +4277,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
// 历史设备 生成证书管理表记录 & 生成安装 维保等操作记录
if
(
registerInfo
!=
null
){
this
.
historyEquGenManageRelated
(
map
,
jgUseRegistration
,
registerInfo
,
idxBizJgFactoryInfo
);
}
String
routePath
=
this
.
buildTaskModel
(
jgUseRegistration
,
map
,
reginParams
);
jgResumeInfoService
.
createWithModel
(
JgResumeInfoDto
.
builder
()
.
applyNo
(
jgUseRegistration
.
getApplyNo
())
...
...
@@ -4334,11 +4410,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
private
void
historyEquGenManageRelated
(
JSONObject
map
,
JgUseRegistration
jgUseRegistration
,
IdxBizJgRegisterInfo
registerInfo
,
IdxBizJgFactoryInfo
idxBizJgFactoryInfo
)
{
Optional
.
ofNullable
(
registerInfo
).
ifPresent
(
info
->
{
// 生成证书管理表记录
generateRegistrationManage
(
jgUseRegistration
,
registerInfo
,
Boolean
.
FALSE
,
null
);
// 使用登记证变更记录 -> 使用登记记录
long
jgUseRegSeq
=
sequence
.
nextId
();
generateCertificateChangeRecord
(
jgUseRegistration
,
registerInfo
,
jgUseRegSeq
,
new
TaskV2Model
(),
Boolean
.
FALSE
);
...
...
@@ -4361,7 +4435,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
changeRecordEq1
.
setProductCode
(
idxBizJgFactoryInfo
.
getFactoryNum
());
certificateChangeRecordEqService
.
save
(
changeRecordEq1
);
}
});
// 使用登记证变更记录 -> 维保备案记录,历史登记不写维保记录日志,测试说的
/*if (!ValidationUtil.isEmpty(map.get("meUnitName"))) {
long jgMaintenanceSeq = sequence.nextId();//登记证记录主键
...
...
@@ -4692,7 +4766,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 查询设备列表
List
<
String
>
uniqueContraptionList
=
Stream
.
concat
(
Arrays
.
stream
(
originProjectContraptionIds
),
Stream
.
of
(
projectContraptionSeq
))
.
distinct
()
.
collect
(
Collectors
.
toList
());
.
collect
(
toList
());
List
<
Map
<
String
,
Object
>>
equList
=
this
.
getBaseMapper
()
.
selectPieLineListByOfCanReg
(
uniqueContraptionList
);
// 检验报告数据格式化 转json
...
...
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