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
279ed546
Commit
279ed546
authored
Jan 20, 2025
by
Lambertliu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):管道使用登记功能Bug修改
parent
1d144cda
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
16 deletions
+37
-16
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+37
-16
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 @
279ed546
...
@@ -88,6 +88,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
...
@@ -88,6 +88,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.ByteArrayOutputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.net.URLEncoder
;
import
java.net.URLEncoder
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
...
@@ -103,7 +105,6 @@ import java.util.stream.IntStream;
...
@@ -103,7 +105,6 @@ import java.util.stream.IntStream;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
import
java.util.zip.ZipEntry
;
import
java.util.zip.ZipEntry
;
import
java.util.zip.ZipOutputStream
;
import
java.util.zip.ZipOutputStream
;
import
static
java
.
util
.
stream
.
Collectors
.
toList
;
import
static
java
.
util
.
stream
.
Collectors
.
toList
;
import
static
java
.
util
.
stream
.
Collectors
.
toSet
;
import
static
java
.
util
.
stream
.
Collectors
.
toSet
;
...
@@ -310,7 +311,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -310,7 +311,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
}
public
void
updateEquipMessage
(
String
currentDocumentId
,
JgUseRegistration
jgUseRegistration
,
JSONObject
map
,
public
void
updateEquipMessage
(
String
currentDocumentId
,
JgUseRegistration
jgUseRegistration
,
JSONObject
map
,
IdxBizJgRegisterInfo
registerInfo
,
IdxBizJgOtherInfo
otherInfo
,
Boolean
flag
,
String
useRegistrationCode
)
{
IdxBizJgRegisterInfo
registerInfo
,
IdxBizJgOtherInfo
otherInfo
,
Boolean
flag
,
String
useRegistrationCode
,
Map
<
String
,
Object
>
equipment
)
{
String
useOrgCode
=
jgUseRegistration
.
getUseRegistrationCode
();
String
useOrgCode
=
jgUseRegistration
.
getUseRegistrationCode
();
// 市
// 市
List
<
LinkedHashMap
>
city
=
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
"CITY"
);
List
<
LinkedHashMap
>
city
=
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
"CITY"
);
...
@@ -371,7 +372,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -371,7 +372,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 更新使用信息
// 更新使用信息
useInfoMapper
.
update
(
useInfo
,
lambda
);
useInfoMapper
.
update
(
useInfo
,
lambda
);
// 更新检验检测信息
// 更新检验检测信息
this
.
updateOrCreateInspectionDetection
(
map
,
jgUseRegistration
,
registerInfo
);
this
.
updateOrCreateInspectionDetection
(
equipment
,
jgUseRegistration
,
registerInfo
);
// 更新注册登记信息表
// 更新注册登记信息表
LambdaUpdateWrapper
<
IdxBizJgRegisterInfo
>
IdxBizJgRegLambda
=
new
UpdateWrapper
<
IdxBizJgRegisterInfo
>().
lambda
();
LambdaUpdateWrapper
<
IdxBizJgRegisterInfo
>
IdxBizJgRegLambda
=
new
UpdateWrapper
<
IdxBizJgRegisterInfo
>().
lambda
();
IdxBizJgRegLambda
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
map
.
get
(
"equipId"
))
IdxBizJgRegLambda
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
map
.
get
(
"equipId"
))
...
@@ -398,20 +399,20 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -398,20 +399,20 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
createCode
(
map
,
jgUseRegistration
,
registerInfo
,
useInfo
,
otherInfo
);
createCode
(
map
,
jgUseRegistration
,
registerInfo
,
useInfo
,
otherInfo
);
}
}
private
void
updateOrCreateInspectionDetection
(
JSONObject
map
,
JgUseRegistration
jgUseRegistration
,
IdxBizJgRegisterInfo
registerInfo
)
{
private
void
updateOrCreateInspectionDetection
(
Map
<
String
,
Object
>
equipment
,
JgUseRegistration
jgUseRegistration
,
IdxBizJgRegisterInfo
registerInfo
)
{
InspectionDetectionInfo
inspectionDetectionInfo
=
new
InspectionDetectionInfo
();
InspectionDetectionInfo
inspectionDetectionInfo
=
new
InspectionDetectionInfo
();
BeanUtil
.
copyProperties
(
map
,
inspectionDetectionInfo
);
BeanUtil
.
copyProperties
(
equipment
,
inspectionDetectionInfo
);
String
record
=
map
.
get
(
"equipI
d"
).
toString
();
String
record
=
equipment
.
get
(
"recor
d"
).
toString
();
if
(
"unit"
.
equals
(
jgUseRegistration
.
getManageType
())
&&
registerInfo
.
getEquList
().
equals
(
EquipmentClassifityEnum
.
YLGD
.
getCode
())){
if
(
"unit"
.
equals
(
jgUseRegistration
.
getManageType
())
&&
registerInfo
.
getEquList
().
equals
(
EquipmentClassifityEnum
.
YLGD
.
getCode
())){
// 压力管道逻辑,根据设备record + 检验报告编号判定唯一一条检验流水,有进行更新,无则进行插入
// 压力管道逻辑,根据设备record + 检验报告编号判定唯一一条检验流水,有进行更新,无则进行插入
inspectionDetectionInfo
.
setInspectConclusion
((
String
)
map
.
get
(
"inspectConclusionCode"
));
inspectionDetectionInfo
.
setInspectConclusion
((
String
)
equipment
.
get
(
"inspectConclusionCode"
));
saveEquipOfPieLineInspectData
(
record
,
inspectionDetectionInfo
);
saveEquipOfPieLineInspectData
(
record
,
inspectionDetectionInfo
);
}
else
{
}
else
{
// 其他逻辑
// 其他逻辑
if
(
map
.
get
(
"jySeq"
)
!=
null
)
{
if
(
equipment
.
get
(
"jySeq"
)
!=
null
)
{
// 更新逻辑
// 更新逻辑
InspectionDetectionInfo
inspectionDetectionInfoDb
=
inspectionDetectionInfoMapper
.
selectById
(
map
.
get
(
"jySeq"
).
toString
());
InspectionDetectionInfo
inspectionDetectionInfoDb
=
inspectionDetectionInfoMapper
.
selectById
(
equipment
.
get
(
"jySeq"
).
toString
());
Bean
.
copyExistPropertis
(
inspectionDetectionInfo
,
inspectionDetectionInfoDb
);
Bean
.
copyExistPropertis
(
inspectionDetectionInfo
,
inspectionDetectionInfoDb
);
inspectionDetectionInfoMapper
.
updateById
(
inspectionDetectionInfoDb
);
inspectionDetectionInfoMapper
.
updateById
(
inspectionDetectionInfoDb
);
}
else
{
}
else
{
...
@@ -779,6 +780,15 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -779,6 +780,15 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
.
collect
(
Collectors
.
toSet
())
.
collect
(
Collectors
.
toSet
())
:
Collections
.
emptySet
();
:
Collections
.
emptySet
();
if
(
EquipmentClassifityEnum
.
YLGD
.
getCode
().
equals
(
equListCode
))
{
equipmentLists
.
forEach
(
equip
->
{
if
((
equip
.
get
(
"inspectReportNo"
)
==
null
||
equip
.
get
(
"inspectReportNo"
).
toString
().
isEmpty
())
||
(
equip
.
get
(
"inspectOrgCode"
)
==
null
||
equip
.
get
(
"inspectOrgCode"
).
toString
().
isEmpty
()))
{
throw
new
BadRequest
(
"检验信息不能为空,请完善检验信息后进行登记!"
);
}
});
}
List
<
Map
<
String
,
Object
>>
filteredEquipmentLists
=
equipmentLists
.
stream
()
List
<
Map
<
String
,
Object
>>
filteredEquipmentLists
=
equipmentLists
.
stream
()
.
filter
(
equipment
->
!
excludedRecords
.
contains
(
equipment
.
get
(
"record"
)))
.
filter
(
equipment
->
!
excludedRecords
.
contains
(
equipment
.
get
(
"record"
)))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
...
@@ -1092,7 +1102,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -1092,7 +1102,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// equipment.put("inspectOrgName", mapData.getOrDefault("inspectOrgName", ""));
// equipment.put("inspectOrgName", mapData.getOrDefault("inspectOrgName", ""));
// equipment.put("inspectConclusion", inspectConclusionName);
// equipment.put("inspectConclusion", inspectConclusionName);
// 更新设备信息 && 生成使用登记证编号 && 同步es
// 更新设备信息 && 生成使用登记证编号 && 同步es
processMapData
(
sequenceNbr
,
mapData
,
jgUseRegistration
,
jgRegistrationHistory
,
registerInfo
,
otherInfo
,
taskV2Model
,
jsonObject
,
flag
,
useRegistrationCode
,
isMerge
);
processMapData
(
sequenceNbr
,
mapData
,
jgUseRegistration
,
jgRegistrationHistory
,
registerInfo
,
otherInfo
,
taskV2Model
,
jsonObject
,
flag
,
useRegistrationCode
,
equipment
,
isMerge
);
// 查询设备制造信息
// 查询设备制造信息
LambdaQueryWrapper
<
IdxBizJgFactoryInfo
>
factoryInfoWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
IdxBizJgFactoryInfo
>
factoryInfoWrapper
=
new
LambdaQueryWrapper
<>();
factoryInfoWrapper
.
eq
(
IdxBizJgFactoryInfo:
:
getRecord
,
equId
);
factoryInfoWrapper
.
eq
(
IdxBizJgFactoryInfo:
:
getRecord
,
equId
);
...
@@ -1175,7 +1186,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -1175,7 +1186,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
contraption
.
setProjectContraptionParentId
(
jgUseRegistration
.
getProjectContraptionId
());
contraption
.
setProjectContraptionParentId
(
jgUseRegistration
.
getProjectContraptionId
());
jgProjectContraptionService
.
updateById
(
contraption
);
jgProjectContraptionService
.
updateById
(
contraption
);
});
});
jgProjectContraption
.
setPipelineLength
((
Double
.
parseDouble
((
String
)
mapData
.
get
(
"pipelineLength"
))));
Object
pipelineLengthObj
=
mapData
.
get
(
"pipelineLength"
);
jgProjectContraption
.
setPipelineLength
(
pipelineLengthObj
instanceof
Number
?
((
Number
)
pipelineLengthObj
).
doubleValue
()
:
Double
.
parseDouble
(
String
.
valueOf
(
pipelineLengthObj
))
);
}
}
// 更新 jgProjectContraption 数据
// 更新 jgProjectContraption 数据
jgProjectContraptionService
.
updateById
(
jgProjectContraption
);
jgProjectContraptionService
.
updateById
(
jgProjectContraption
);
...
@@ -1469,7 +1485,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -1469,7 +1485,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 更新代办
// 更新代办
TaskV2Model
taskV2Model
=
updateAgency
(
jgUseRegistration
);
TaskV2Model
taskV2Model
=
updateAgency
(
jgUseRegistration
);
processMapData
(
sequenceNbr
,
mapData
,
jgUseRegistration
,
jgRegistrationHistory
,
registerInfo
,
otherInfo
,
taskV2Model
,
jsonObject
,
Boolean
.
FALSE
,
null
,
Boolean
.
FALSE
);
processMapData
(
sequenceNbr
,
mapData
,
jgUseRegistration
,
jgRegistrationHistory
,
registerInfo
,
otherInfo
,
taskV2Model
,
jsonObject
,
Boolean
.
FALSE
,
null
,
null
,
Boolean
.
FALSE
);
// 生成证书管理表记录
// 生成证书管理表记录
generateRegistrationManage
(
jgUseRegistration
,
registerInfo
,
Boolean
.
FALSE
,
null
);
generateRegistrationManage
(
jgUseRegistration
,
registerInfo
,
Boolean
.
FALSE
,
null
);
...
@@ -1496,11 +1513,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -1496,11 +1513,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
private
void
processMapData
(
Long
sequenceNbr
,
JSONObject
mapData
,
JgUseRegistration
jgUseRegistration
,
private
void
processMapData
(
Long
sequenceNbr
,
JSONObject
mapData
,
JgUseRegistration
jgUseRegistration
,
JgRegistrationHistory
jgRegistrationHistory
,
IdxBizJgRegisterInfo
registerInfo
,
IdxBizJgOtherInfo
otherInfo
,
JgRegistrationHistory
jgRegistrationHistory
,
IdxBizJgRegisterInfo
registerInfo
,
IdxBizJgOtherInfo
otherInfo
,
TaskV2Model
taskV2Model
,
JSONObject
jsonObject
,
Boolean
flag
,
String
useRegistrationCode
,
Boolean
isMerge
)
{
TaskV2Model
taskV2Model
,
JSONObject
jsonObject
,
Boolean
flag
,
String
useRegistrationCode
,
Map
<
String
,
Object
>
equipment
,
boolean
isMerge
)
{
jgUseRegistration
.
setSupervisoryCode
(
otherInfo
.
getSupervisoryCode
());
jgUseRegistration
.
setSupervisoryCode
(
otherInfo
.
getSupervisoryCode
());
// 更新设备信息
// 更新设备信息
updateEquipMessage
(
String
.
valueOf
(
sequenceNbr
),
jgUseRegistration
,
mapData
,
registerInfo
,
otherInfo
,
flag
,
useRegistrationCode
);
updateEquipMessage
(
String
.
valueOf
(
sequenceNbr
),
jgUseRegistration
,
mapData
,
registerInfo
,
otherInfo
,
flag
,
useRegistrationCode
,
equipment
);
// 生成使用登记证编号
// 生成使用登记证编号
if
(!
ObjectUtils
.
isEmpty
(
jgUseRegistration
.
getSupervisoryCode
()))
{
if
(!
ObjectUtils
.
isEmpty
(
jgUseRegistration
.
getSupervisoryCode
()))
{
if
(
"unit"
.
equals
(
jgUseRegistration
.
getManageType
()))
{
if
(
"unit"
.
equals
(
jgUseRegistration
.
getManageType
()))
{
...
@@ -1513,6 +1531,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -1513,6 +1531,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
LambdaUpdateWrapper
<
IdxBizJgRegisterInfo
>
lambda
=
new
UpdateWrapper
<
IdxBizJgRegisterInfo
>().
lambda
();
LambdaUpdateWrapper
<
IdxBizJgRegisterInfo
>
lambda
=
new
UpdateWrapper
<
IdxBizJgRegisterInfo
>().
lambda
();
lambda
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
registerInfo
.
getRecord
());
lambda
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
registerInfo
.
getRecord
());
lambda
.
set
(
true
,
IdxBizJgRegisterInfo:
:
getUseOrgCode
,
code
);
lambda
.
set
(
true
,
IdxBizJgRegisterInfo:
:
getUseOrgCode
,
code
);
lambda
.
set
(
isMerge
,
IdxBizJgRegisterInfo:
:
getEquCode
,
registerInfo
.
getEquCode
());
// 新增页面选择无设备代码后,在审批通过后自动生成设备代码
// 新增页面选择无设备代码后,在审批通过后自动生成设备代码
this
.
justGenerateEquCode
(
lambda
,
registerInfo
,
jgUseRegistration
.
getReceiveCompanyCode
(),
mapData
,
jgRegistrationHistory
);
this
.
justGenerateEquCode
(
lambda
,
registerInfo
,
jgUseRegistration
.
getReceiveCompanyCode
(),
mapData
,
jgRegistrationHistory
);
idxBizJgRegisterInfoService
.
update
(
lambda
);
idxBizJgRegisterInfoService
.
update
(
lambda
);
...
@@ -1521,6 +1540,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -1521,6 +1540,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
LambdaUpdateWrapper
<
IdxBizJgRegisterInfo
>
lambda
=
new
UpdateWrapper
<
IdxBizJgRegisterInfo
>().
lambda
();
LambdaUpdateWrapper
<
IdxBizJgRegisterInfo
>
lambda
=
new
UpdateWrapper
<
IdxBizJgRegisterInfo
>().
lambda
();
lambda
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
registerInfo
.
getRecord
());
lambda
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
registerInfo
.
getRecord
());
lambda
.
set
(
true
,
IdxBizJgRegisterInfo:
:
getUseOrgCode
,
jgUseRegistration
.
getUseRegistrationCode
());
lambda
.
set
(
true
,
IdxBizJgRegisterInfo:
:
getUseOrgCode
,
jgUseRegistration
.
getUseRegistrationCode
());
lambda
.
set
(
isMerge
,
IdxBizJgRegisterInfo:
:
getEquCode
,
registerInfo
.
getEquCode
());
// 新增页面选择无设备代码后,在审批通过后自动生成设备代码
// 新增页面选择无设备代码后,在审批通过后自动生成设备代码
this
.
justGenerateEquCode
(
lambda
,
registerInfo
,
jgUseRegistration
.
getReceiveCompanyCode
(),
mapData
,
jgRegistrationHistory
);
this
.
justGenerateEquCode
(
lambda
,
registerInfo
,
jgUseRegistration
.
getReceiveCompanyCode
(),
mapData
,
jgRegistrationHistory
);
idxBizJgRegisterInfoService
.
update
(
lambda
);
idxBizJgRegisterInfoService
.
update
(
lambda
);
...
@@ -4022,11 +4042,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -4022,11 +4042,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
List
<
Map
<
String
,
Object
>>
equList
=
this
.
getBaseMapper
()
List
<
Map
<
String
,
Object
>>
equList
=
this
.
getBaseMapper
()
.
selectPieLineListByOfCanReg
(
uniqueContraptionList
);
.
selectPieLineListByOfCanReg
(
uniqueContraptionList
);
// 计算管道长度总和
// 计算管道长度总和
double
totalPipelineLength
=
equList
.
stream
()
double
totalPipelineLength
=
BigDecimal
.
valueOf
(
equList
.
stream
()
.
map
(
map
->
map
.
get
(
"pipeLength"
))
.
map
(
map
->
map
.
get
(
"pipeLength"
))
.
filter
(
Objects:
:
nonNull
)
.
filter
(
Objects:
:
nonNull
)
.
mapToDouble
(
value
->
Double
.
parseDouble
((
String
)
value
))
.
mapToDouble
(
value
->
Double
.
parseDouble
((
String
)
value
))
.
sum
();
.
sum
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
doubleValue
();
MapBuilder
<
String
,
Object
>
resultBuilder
=
MapBuilder
.<
String
,
Object
>
create
()
MapBuilder
<
String
,
Object
>
resultBuilder
=
MapBuilder
.<
String
,
Object
>
create
()
.
put
(
"equipmentLists"
,
equList
)
.
put
(
"equipmentLists"
,
equList
)
.
put
(
"projectContraption"
,
projectContraption
.
getProjectContraption
())
.
put
(
"projectContraption"
,
projectContraption
.
getProjectContraption
())
...
...
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