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
5a51e359
Commit
5a51e359
authored
Dec 13, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.压力管道批量模式,使用登记开发提交联调作废
parent
9add810f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
7 deletions
+60
-7
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+60
-7
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 @
5a51e359
...
...
@@ -15,9 +15,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity
;
import
com.yeejoin.amos.boot.biz.common.service.IDataDictionaryService
;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
...
...
@@ -218,8 +220,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
@Autowired
IdxBizJgProjectInspectionMapper
projectInspectionMapper
;
@Autowired
private
DataDictionaryServiceImpl
dataDictionaryServiceImpl
;
@Autowired
private
IdxBizJgProjectContraptionMapper
idxBizJgProjectContraptionMapper
;
/**
...
...
@@ -1011,6 +1015,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
}
List
<
Map
<
String
,
Object
>>
equipmentLists
=
(
List
<
Map
<
String
,
Object
>>)
mapData
.
get
(
"equipmentLists"
);
String
inspectConclusionName
=
getInspectConclusionName
(
mapData
);
if
(!
CollectionUtils
.
isEmpty
(
equipmentLists
))
{
for
(
int
i
=
0
;
i
<
equipmentLists
.
size
();
i
++)
{
Map
<
String
,
Object
>
equipment
=
equipmentLists
.
get
(
i
);
...
...
@@ -1023,6 +1028,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
lambdaReg
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
equId
);
IdxBizJgRegisterInfo
registerInfo
=
idxBizJgRegisterInfoMapper
.
selectOne
(
lambdaReg
);
// 压力管道:[更新的原始引用]更新检验日期-nextInspectDate、检验结论-inspectConclusion、检验机构名称-inspectOrgName
equipment
.
put
(
"nextInspectDate"
,
mapData
.
getOrDefault
(
"nextInspectDate"
,
""
));
equipment
.
put
(
"inspectOrgName"
,
mapData
.
getOrDefault
(
"inspectOrgName"
,
""
));
equipment
.
put
(
"inspectConclusion"
,
inspectConclusionName
);
// 更新设备信息 && 生成使用登记证编号 && 同步es
processMapData
(
sequenceNbr
,
mapData
,
jgUseRegistration
,
jgRegistrationHistory
,
registerInfo
,
taskV2Model
,
jsonObject
,
flag
,
useRegistrationCode
);
// 查询设备制造信息
...
...
@@ -1049,11 +1058,36 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 生成一条tzs_jg_certificate_change_record记录
generateCertificateChangeRecord
(
jgUseRegistration
,
registerInfo
,
changeRecordId
,
taskV2Model
,
flag
);
// 更新历史表:下次检验日期、检验机构名称、检验结论在压力管道、气瓶时更新子表单的数据
jgRegistrationHistory
.
setChangeData
(
JSON
.
toJSONString
(
mapData
));
jgRegistrationHistoryService
.
updateById
(
jgRegistrationHistory
);
// 装置表写入使用登记证编号、将装置名称写入到使用登记表
updateRegAndProjectContrapt
(
jgUseRegistration
);
}
this
.
getBaseMapper
().
updateById
(
jgUseRegistration
);
commonServiceImpl
.
saveExecuteFlowData2Redis
(
jgUseRegistration
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
jgUseRegistration
));
}
private
void
updateRegAndProjectContrapt
(
JgUseRegistration
jgUseRegistration
)
{
if
(!
StringUtils
.
isEmpty
(
jgUseRegistration
.
getProjectContraptionId
())){
IdxBizJgProjectContraption
jgProjectContraption
=
jgProjectContraptionService
.
getById
(
jgUseRegistration
.
getProjectContraptionId
());
jgUseRegistration
.
setProjectContraption
(
jgProjectContraption
.
getProjectContraption
());
jgProjectContraption
.
setUseRegistrationCode
(
jgUseRegistration
.
getUseRegistrationCode
());
jgProjectContraptionService
.
updateById
(
jgProjectContraption
);
}
}
private
String
getInspectConclusionName
(
JSONObject
mapData
)
{
if
(
!
ObjectUtils
.
isEmpty
(
mapData
.
get
(
"inspectConclusion"
)))
{
String
code
=
mapData
.
get
(
"inspectConclusion"
).
toString
();
DataDictionary
conclusionDict
=
dataDictionaryServiceImpl
.
getByCode
(
code
,
"JYJL"
);
if
(
conclusionDict
!=
null
)
{
return
conclusionDict
.
getName
();
}
}
return
""
;
}
private
void
savePieLineProjectInspectData
(
JgUseRegistration
jgUseRegistration
,
IdxBizJgRegisterInfo
registerInfo
,
JSONObject
mapData
)
{
// 单位办理的压力管道,在完成审批时,将检验信息写入到装置检验信息表
if
(
"unit"
.
equals
(
jgUseRegistration
.
getManageType
())
&&
registerInfo
.
getEquList
().
equals
(
EquipmentClassifityEnum
.
YLGD
.
getCode
())){
...
...
@@ -1067,7 +1101,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
else
{
inspectionDetectionInfo
.
setProjectContraptionId
(
jgUseRegistration
.
getProjectContraptionId
());
inspectionDetectionInfo
.
setRecDate
(
new
Date
());
inspectionDetectionInfo
.
setSequenceNbr
(
sequence
.
nextId
()
+
""
);
// 使用登记创建新增的检验信息id设置为使用登记的主键id,在作废时级联作废
inspectionDetectionInfo
.
setSequenceNbr
(
jgUseRegistration
.
getSequenceNbr
()
+
""
);
projectInspectionMapper
.
insert
(
inspectionDetectionInfo
);
}
}
...
...
@@ -2357,7 +2392,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 安全管理部门
exportParamsMap
.
put
(
"orgBranchName"
,
String
.
valueOf
(
jsonObject
.
get
(
"orgBranchCode"
)).
split
(
"_"
)[
1
]);
// 安全管理员
exportParamsMap
.
put
(
"safetyManager"
,
String
.
valueOf
(
jsonObject
.
get
(
"safetyManager"
)).
split
(
"_"
)[
1
]
);
exportParamsMap
.
put
(
"safetyManager"
,
String
.
valueOf
(
jsonObject
.
get
(
"safetyManager"
)).
contains
(
"_"
)
?
String
.
valueOf
(
jsonObject
.
get
(
"safetyManager"
)).
split
(
"_"
)[
1
]
:
String
.
valueOf
(
jsonObject
.
get
(
"safetyManager"
))
);
// 联系电话
exportParamsMap
.
put
(
"phone"
,
ValidationUtil
.
isEmpty
(
result
.
getMobile
())
?
""
:
result
.
getMobile
());
// 经办人
...
...
@@ -2416,7 +2451,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
String
[]
fieldNames
=
{
"productName"
,
"pipelineNumber"
,
"deviceLevel"
,
"designUnitName"
,
"uscUnitName"
,
"uscDate"
,
"useDate"
,
"nominalDiameter"
,
"wallThickness"
,
"pipeLength"
,
"pressure"
,
"temperature"
,
"medium"
,
"inspectConclusion"
,
"inspectOrgName"
,
"nextInspectDate"
,
"
inspectConclusion"
,
"
remarks"
};
"medium"
,
"inspectConclusion"
,
"inspectOrgName"
,
"nextInspectDate"
,
"remarks"
};
// 填充有效数据
for
(
int
curr
=
0
;
curr
<
equData
.
size
();
curr
++)
{
JSONObject
obj
=
(
JSONObject
)
equData
.
get
(
curr
);
...
...
@@ -2655,6 +2690,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
private
void
clearUseInfoOfEquip
(
JgUseRegistration
jgUseRegistration
)
{
List
<
JgUseRegistrationEq
>
eqList
=
getJgUseRegistrationEqs
(
jgUseRegistration
);
// 0.压力管道 清空装置表的使用登记证编号、删除装置的检验信息
this
.
rollBackForPieLine
(
jgUseRegistration
);
eqList
.
forEach
(
e
->
{
String
record
=
e
.
getEquId
();
Boolean
flag
=
Boolean
.
FALSE
;
...
...
@@ -2688,6 +2725,18 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
}
private
void
rollBackForPieLine
(
JgUseRegistration
jgUseRegistration
)
{
if
(!
StringUtils
.
isEmpty
(
jgUseRegistration
.
getProjectContraptionId
())){
// 清除使用登记证编号
LambdaUpdateWrapper
<
IdxBizJgProjectContraption
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
BaseEntity:
:
getSequenceNbr
,
jgUseRegistration
.
getProjectContraptionId
());
updateWrapper
.
set
(
IdxBizJgProjectContraption:
:
getUseRegistrationCode
,
null
);
idxBizJgProjectContraptionMapper
.
update
(
null
,
updateWrapper
);
// 删除改装置的检验信息【只有是在使用登记页面新增的才会删除,使用登记终审通过时,插入的检验信息id为使用登记的主键】
projectInspectionMapper
.
deleteById
(
jgUseRegistration
.
getSequenceNbr
());
}
}
private
void
dealHisRegEquipData
(
JgUseRegistration
jgUseRegistration
,
String
record
)
{
// 历史登记时处理
if
(
"1"
.
equals
(
jgUseRegistration
.
getRegType
())){
...
...
@@ -3654,17 +3703,21 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
public
IPage
<
IdxBizJgProjectContraption
>
getJgProjectContraptionPage
(
String
useUnitCreditCode
,
Page
<
IdxBizJgProjectContraption
>
page
)
{
// 兼容个人业务
if
(
useUnitCreditCode
.
contains
(
"_"
)){
useUnitCreditCode
=
useUnitCreditCode
.
split
(
"_"
)[
1
];
}
// 查询流程中的装置
List
<
JgUseRegistration
>
flowIngPros
=
this
.
list
(
new
LambdaQueryWrapper
<
JgUseRegistration
>().
notIn
(
JgUseRegistration:
:
getStatus
,
NOT_FLOWING_STATE
).
select
(
BaseEntity:
:
getSequenceNbr
,
JgUseRegistration:
:
getProjectContraptionId
));
Set
<
String
>
proIds
=
flowIngPros
.
stream
().
map
(
JgUseRegistration:
:
getProjectContraptionId
).
collect
(
toSet
());
proIds
.
remove
(
null
);
proIds
.
remove
(
""
);
// 查询已纳管且使用登记证编号
不
为空或者null且非流程中的装置
// 查询已纳管且使用登记证编号为空或者null且非流程中的装置
LambdaQueryWrapper
<
IdxBizJgProjectContraption
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
IdxBizJgProjectContraption:
:
getUseUnitCreditCode
,
useUnitCreditCode
);
wrapper
.
eq
(
IdxBizJgProjectContraption:
:
getIsIntoManagement
,
true
);
wrapper
.
notIn
(!
proIds
.
isEmpty
(),
BaseEntity:
:
getSequenceNbr
,
proIds
);
wrapper
.
last
(
"and
use_registration_code <> ''
"
);
wrapper
.
last
(
"and
(length(use_registration_code) = 0 or use_registration_code is null)
"
);
return
jgProjectContraptionService
.
page
(
page
,
wrapper
);
}
...
...
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