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
aae401e6
Commit
aae401e6
authored
Mar 12, 2025
by
韩桐桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug:27554 改造变更登记后清除安改维单位信息
parent
a81b7999
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
1 deletion
+58
-1
JgChangeRegistrationReformServiceImpl.java
...z/service/impl/JgChangeRegistrationReformServiceImpl.java
+58
-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/service/impl/JgChangeRegistrationReformServiceImpl.java
View file @
aae401e6
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.map.MapBuilder
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
...
...
@@ -83,7 +84,14 @@ import static java.util.stream.Collectors.toSet;
@Service
@Slf4j
public
class
JgChangeRegistrationReformServiceImpl
extends
BaseService
<
JgChangeRegistrationReformDto
,
JgChangeRegistrationReform
,
JgChangeRegistrationReformMapper
>
implements
IJgChangeRegistrationReformService
,
ICompensateFlowDataOfRedis
<
JgChangeRegistrationReform
>
{
/**
* 安改维单位名称
*/
public
static
final
String
USC_UNIT_NAME
=
"USC_UNIT_NAME"
;
/**
* 安改维单位统一信用代码
*/
public
static
final
String
USC_UNIT_CREDIT_CODE
=
"USC_UNIT_CREDIT_CODE"
;
private
final
List
<
String
>
NOT_FLOWING_STATE
=
Arrays
.
asList
(
"使用单位待提交"
,
"一级受理已驳回"
,
"使用单位已撤回"
,
"已作废"
,
"已完成"
);
private
final
static
String
BUSINESS_TYPE
=
"改造登记"
;
...
...
@@ -610,6 +618,8 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
List
<
IdxBizJgTechParamsPipeline
>
paramsPipelines
=
updatePieLineTechAndInspection
(
jgChangeRegistrationReform
);
// 2.按照装置生成证流水
saveCertFlowBatch
(
jgChangeRegistrationReform
,
paramsPipelines
,
taskV2Model
);
// 3.清除设备及装置的安改维单位信息
this
.
clearUscWithEquipAndCon
(
jgChangeRegistrationReform
);
}
}
...
...
@@ -618,6 +628,31 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
this
.
getBaseMapper
().
updateById
(
jgChangeRegistrationReform
);
}
/**
* 审批通过后删除安改维单位信息
*
* @param reform
*/
private
void
clearUscWithEquipAndCon
(
JgChangeRegistrationReform
reform
)
{
// 装置表
jgProjectContraptionService
.
lambdaUpdate
()
.
eq
(
IdxBizJgProjectContraption:
:
getSequenceNbr
,
reform
.
getProjectContraptionId
())
.
set
(
IdxBizJgProjectContraption:
:
getUscUnitCreditCode
,
null
)
.
set
(
IdxBizJgProjectContraption:
:
getUscUnitName
,
null
)
.
update
();
// es
List
<
JgChangeRegistrationReformEq
>
reformEqs
=
jgChangeRegistrationReformEqMapper
.
selectList
(
new
LambdaQueryWrapper
<
JgChangeRegistrationReformEq
>().
eq
(
JgChangeRegistrationReformEq:
:
getEquipTransferId
,
reform
.
getSequenceNbr
()));
reformEqs
.
forEach
(
reformEq
->
{
Map
<
String
,
Map
<
String
,
Object
>>
resultMap
=
MapBuilder
.<
String
,
Map
<
String
,
Object
>>
create
()
.
put
(
reformEq
.
getEquId
(),
MapBuilder
.<
String
,
Object
>
create
()
.
put
(
USC_UNIT_NAME
,
null
)
.
put
(
USC_UNIT_CREDIT_CODE
,
null
)
.
build
())
.
build
();
tzsServiceFeignClient
.
commonUpdateEsDataByIds
(
resultMap
);
});
}
private
void
saveCertFlowBatch
(
JgChangeRegistrationReform
jgChangeRegistrationReform
,
List
<
IdxBizJgTechParamsPipeline
>
paramsPipelines
,
TaskV2Model
taskV2Model
)
{
// 1.更新使用登记证信息
JgUseRegistrationManage
jgUseRegistrationManage
=
jgUseRegistrationManageService
.
lambdaQuery
()
...
...
@@ -1536,6 +1571,14 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
case
YLGD:
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
oldTechInfo
);
JSONArray
piePines
=
jsonObject
.
getJSONArray
(
"equipmentLists"
);
// 装置和设备es中的安改维单位信息恢复
String
uscUnitCreditCode
=
jsonObject
.
getString
(
USC_UNIT_CREDIT_CODE
);
String
uscUnitName
=
jsonObject
.
getString
(
USC_UNIT_NAME
);
jgProjectContraptionService
.
lambdaUpdate
()
.
eq
(
IdxBizJgProjectContraption:
:
getSequenceNbr
,
jgChangeRegistrationReform
.
getProjectContraptionId
())
.
set
(
IdxBizJgProjectContraption:
:
getUscUnitCreditCode
,
uscUnitCreditCode
)
.
set
(
IdxBizJgProjectContraption:
:
getUscUnitName
,
uscUnitName
)
.
update
();
for
(
int
i
=
0
;
i
<
piePines
.
size
();
i
++){
JSONObject
item
=
piePines
.
getJSONObject
(
i
);
String
rcd
=
item
.
getString
(
"record"
);
...
...
@@ -1545,6 +1588,14 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
IdxBizJgTechParamsPipeline
pipeline
=
BeanUtil
.
copyProperties
(
item
,
IdxBizJgTechParamsPipeline
.
class
);
pipeline
.
setSequenceNbr
(
sequence
.
nextId
()
+
""
);
iIdxBizJgTechParamsPipelineService
.
save
(
pipeline
);
// es
Map
<
String
,
Map
<
String
,
Object
>>
resultMap
=
MapBuilder
.<
String
,
Map
<
String
,
Object
>>
create
()
.
put
(
rcd
,
MapBuilder
.<
String
,
Object
>
create
()
.
put
(
USC_UNIT_NAME
,
uscUnitName
)
.
put
(
USC_UNIT_CREDIT_CODE
,
uscUnitCreditCode
)
.
build
())
.
build
();
tzsServiceFeignClient
.
commonUpdateEsDataByIds
(
resultMap
);
}
// 检验信息恢复
JSONObject
inspectData
=
jsonObject
.
getJSONObject
(
"inspectData"
);
...
...
@@ -1684,6 +1735,12 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
// 被更新的原行数据
this
.
setOData
(
inspectData
,
inspectionDetectionInfoOld
);
oldData
.
put
(
"inspectData"
,
inspectData
);
// 保存一份安改维单位信息,作废回滚用
IdxBizJgProjectContraption
projectContraption
=
jgProjectContraptionService
.
lambdaQuery
()
.
eq
(
IdxBizJgProjectContraption:
:
getSequenceNbr
,
registrationReform
.
getProjectContraptionId
())
.
one
();
oldData
.
put
(
USC_UNIT_NAME
,
projectContraption
.
getUscUnitName
());
oldData
.
put
(
USC_UNIT_CREDIT_CODE
,
projectContraption
.
getUscUnitCreditCode
());
LambdaUpdateWrapper
<
JgRegistrationHistory
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
registrationReform
.
getApplyNo
());
updateWrapper
.
set
(
JgRegistrationHistory:
:
getOldData
,
JSONObject
.
toJSONString
(
oldData
));
...
...
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