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
4e86d2f6
Commit
4e86d2f6
authored
May 12, 2025
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(大编辑):代码重构
1.冲突处理
parent
e066ad18
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
13 deletions
+14
-13
EquipChangeDataUpdateService.java
...ule/jg/biz/service/impl/EquipChangeDataUpdateService.java
+5
-5
PieLineDataChangeServiceImpl.java
...ule/jg/biz/service/impl/PieLineDataChangeServiceImpl.java
+9
-8
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/EquipChangeDataUpdateService.java
View file @
4e86d2f6
...
@@ -61,7 +61,7 @@ public class EquipChangeDataUpdateService {
...
@@ -61,7 +61,7 @@ public class EquipChangeDataUpdateService {
public
void
updateDesignChangeData
(
String
record
,
EquipDesignChangeDataDto
equipDesignChangeDataDto
)
{
public
void
updateDesignChangeData
(
String
record
,
EquipDesignChangeDataDto
equipDesignChangeDataDto
)
{
LambdaUpdateWrapper
<
IdxBizJgDesignInfo
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
LambdaUpdateWrapper
<
IdxBizJgDesignInfo
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
IdxBizJgDesignInfo:
:
getRecord
,
record
);
updateWrapper
.
eq
(
IdxBizJgDesignInfo:
:
getRecord
,
record
);
updateWrapper
.
set
(
IdxBizJgDesignInfo:
:
getDesignDate
,
StringUtils
.
isNotEmpty
(
equipDesignChangeDataDto
.
getDesignDate
())
?
DateUtil
.
parse
(
equipDesignChangeDataDto
.
getDesignDate
(),
"yyyy-MM-dd"
)
:
null
);
updateWrapper
.
set
(
IdxBizJgDesignInfo:
:
getDesignDate
,
equipDesignChangeDataDto
.
getDesignDate
()
);
updateWrapper
.
set
(
IdxBizJgDesignInfo:
:
getDesignDoc
,
equipDesignChangeDataDto
.
getDesignDoc
());
updateWrapper
.
set
(
IdxBizJgDesignInfo:
:
getDesignDoc
,
equipDesignChangeDataDto
.
getDesignDoc
());
updateWrapper
.
set
(
IdxBizJgDesignInfo:
:
getDesignUnitCreditCode
,
equipDesignChangeDataDto
.
getDesignUnitCreditCode
());
updateWrapper
.
set
(
IdxBizJgDesignInfo:
:
getDesignUnitCreditCode
,
equipDesignChangeDataDto
.
getDesignUnitCreditCode
());
updateWrapper
.
set
(
IdxBizJgDesignInfo:
:
getDesignUnitName
,
equipDesignChangeDataDto
.
getDesignUnitName
());
updateWrapper
.
set
(
IdxBizJgDesignInfo:
:
getDesignUnitName
,
equipDesignChangeDataDto
.
getDesignUnitName
());
...
@@ -72,7 +72,7 @@ public class EquipChangeDataUpdateService {
...
@@ -72,7 +72,7 @@ public class EquipChangeDataUpdateService {
updateWrapper
.
set
(
IdxBizJgDesignInfo:
:
getAppraisalDate
,
equipDesignChangeDataDto
.
getAppraisalDate
());
updateWrapper
.
set
(
IdxBizJgDesignInfo:
:
getAppraisalDate
,
equipDesignChangeDataDto
.
getAppraisalDate
());
updateWrapper
.
set
(
IdxBizJgDesignInfo:
:
getDrawingDo
,
equipDesignChangeDataDto
.
getDrawingDo
());
updateWrapper
.
set
(
IdxBizJgDesignInfo:
:
getDrawingDo
,
equipDesignChangeDataDto
.
getDrawingDo
());
updateWrapper
.
set
(
IdxBizJgDesignInfo:
:
getDesignStandard
,
equipDesignChangeDataDto
.
getDesignStandard
());
updateWrapper
.
set
(
IdxBizJgDesignInfo:
:
getDesignStandard
,
equipDesignChangeDataDto
.
getDesignStandard
());
updateWrapper
.
set
(
equipDesignChangeDataDto
.
getDesignIsComplete
()
!=
null
,
IdxBizJgDesignInfo:
:
getDesignIsComplete
,
equipDesignChangeDataDto
.
getDesignIsComplete
());
updateWrapper
.
set
(
equipDesignChangeDataDto
.
getDesignIsComplete
()
!=
null
,
IdxBizJgDesignInfo:
:
getDesignIsComplete
,
equipDesignChangeDataDto
.
getDesignIsComplete
());
idxBizJgDesignInfoMapper
.
update
(
null
,
updateWrapper
);
idxBizJgDesignInfoMapper
.
update
(
null
,
updateWrapper
);
}
}
...
@@ -146,10 +146,10 @@ public class EquipChangeDataUpdateService {
...
@@ -146,10 +146,10 @@ public class EquipChangeDataUpdateService {
public
void
updateRegisterEsDataPieLine
(
ProjectContraptionChangeDataDto
registerChangeDataDto
)
{
public
void
updateRegisterEsDataPieLine
(
ProjectContraptionChangeDataDto
registerChangeDataDto
)
{
// es 数据更新
// es 数据更新
List
<
ESEquipmentCategoryDto
>
pieLines
=
esEquipmentCategory
.
findAllByProjectContraptionId
(
registerChangeDataDto
.
getProjectContraptionId
());
List
<
ESEquipmentCategoryDto
>
pieLines
=
esEquipmentCategory
.
findAllByProjectContraptionId
(
registerChangeDataDto
.
getProjectContraptionId
());
for
(
ESEquipmentCategoryDto
esEquipmentCategoryDto
:
pieLines
)
{
for
(
ESEquipmentCategoryDto
esEquipmentCategoryDto
:
pieLines
)
{
esEquipmentCategoryDto
.
setPROJECT_CONTRAPTION
(
registerChangeDataDto
.
getProjectContraption
());
esEquipmentCategoryDto
.
setPROJECT_CONTRAPTION
(
registerChangeDataDto
.
getProjectContraption
());
}
}
if
(!
pieLines
.
isEmpty
())
{
if
(!
pieLines
.
isEmpty
())
{
esEquipmentCategory
.
saveAll
(
pieLines
);
esEquipmentCategory
.
saveAll
(
pieLines
);
}
}
}
}
...
@@ -159,7 +159,7 @@ public class EquipChangeDataUpdateService {
...
@@ -159,7 +159,7 @@ public class EquipChangeDataUpdateService {
}
}
public
void
updateTechParamByRecord
(
String
tableName
,
String
record
,
List
<
ChangeDataDto
>
changeDataDtos
)
{
public
void
updateTechParamByRecord
(
String
tableName
,
String
record
,
List
<
FieldChangeMeta
>
changeDataDtos
)
{
List
<
DynamicColumnDto
>
columns
=
changeDataDtos
.
stream
().
map
(
c
->
{
List
<
DynamicColumnDto
>
columns
=
changeDataDtos
.
stream
().
map
(
c
->
{
DynamicColumnDto
columnDto
=
new
DynamicColumnDto
();
DynamicColumnDto
columnDto
=
new
DynamicColumnDto
();
columnDto
.
setColumnName
(
String
.
format
(
"\"%s\""
,
StrUtil
.
toUnderlineCase
(
c
.
getColumnKey
()).
toUpperCase
()));
columnDto
.
setColumnName
(
String
.
format
(
"\"%s\""
,
StrUtil
.
toUnderlineCase
(
c
.
getColumnKey
()).
toUpperCase
()));
...
...
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/PieLineDataChangeServiceImpl.java
View file @
4e86d2f6
...
@@ -3,10 +3,11 @@ package com.yeejoin.amos.boot.module.jg.biz.service.impl;
...
@@ -3,10 +3,11 @@ package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.module.jg.api.dto.
ChangeDataDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.
FieldChangeMeta
;
import
com.yeejoin.amos.boot.module.jg.api.dto.PieLineDesignChangeDataDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.PieLineDesignChangeDataDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.PipelineChangeItemDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.PipelineChangeItemDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.ProjectContraptionChangeDataDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.ProjectContraptionChangeDataDto
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.process.equip.CommonEquipDataProcessService
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -27,12 +28,12 @@ public class PieLineDataChangeServiceImpl {
...
@@ -27,12 +28,12 @@ public class PieLineDataChangeServiceImpl {
this
.
equipChangeDataUpdateService
=
equipChangeDataUpdateService
;
this
.
equipChangeDataUpdateService
=
equipChangeDataUpdateService
;
}
}
public
void
update
(
ProjectContraptionChangeDataDto
projectContraptionChangeDataDtoNew
,
List
<
ChangeDataDto
>
allChangeColumns
)
{
public
void
update
(
ProjectContraptionChangeDataDto
projectContraptionChangeDataDtoNew
,
List
<
FieldChangeMeta
>
allChangeColumns
)
{
// 原有对象行转列
// 原有对象行转列
ProjectContraptionChangeDataDto
projectContraptionChangeDataDtoOld
=
getOldProjectContratData
(
projectContraptionChangeDataDtoNew
);
ProjectContraptionChangeDataDto
projectContraptionChangeDataDtoOld
=
getOldProjectContratData
(
projectContraptionChangeDataDtoNew
);
List
<
ChangeDataDto
>
newProjectContraptionChangeData
=
commonEquipDataProcessService
.
convertBeanField2Column2
(
projectContraptionChangeDataDtoNew
,
projectContraptionChangeDataDtoNew
.
getProjectContraptionId
());
List
<
FieldChangeMeta
>
newProjectContraptionChangeData
=
commonEquipDataProcessService
.
convertBeanField2Column2
(
projectContraptionChangeDataDtoNew
,
projectContraptionChangeDataDtoNew
.
getProjectContraptionId
());
// 新对象构造行转列
// 新对象构造行转列
List
<
ChangeDataDto
>
oldProjectContraptionChangeData
=
commonEquipDataProcessService
.
convertBeanField2Column2
(
projectContraptionChangeDataDtoOld
,
projectContraptionChangeDataDtoNew
.
getProjectContraptionId
());
List
<
FieldChangeMeta
>
oldProjectContraptionChangeData
=
commonEquipDataProcessService
.
convertBeanField2Column2
(
projectContraptionChangeDataDtoOld
,
projectContraptionChangeDataDtoNew
.
getProjectContraptionId
());
// 数据比对记录变化字段列表
// 数据比对记录变化字段列表
allChangeColumns
.
addAll
(
commonEquipDataProcessService
.
mergeChangeFields
(
newProjectContraptionChangeData
,
oldProjectContraptionChangeData
));
allChangeColumns
.
addAll
(
commonEquipDataProcessService
.
mergeChangeFields
(
newProjectContraptionChangeData
,
oldProjectContraptionChangeData
));
// 数据入库
// 数据入库
...
@@ -52,14 +53,14 @@ public class PieLineDataChangeServiceImpl {
...
@@ -52,14 +53,14 @@ public class PieLineDataChangeServiceImpl {
return
BeanUtil
.
copyProperties
(
projectContraption
,
ProjectContraptionChangeDataDto
.
class
);
return
BeanUtil
.
copyProperties
(
projectContraption
,
ProjectContraptionChangeDataDto
.
class
);
}
}
public
void
saveDesignForPieLine
(
String
record
,
List
<
ChangeDataDto
>
allChangeColumns
,
PipelineChangeItemDto
pipelineChangeItemDto
)
{
public
void
saveDesignForPieLine
(
String
record
,
List
<
FieldChangeMeta
>
allChangeColumns
,
PipelineChangeItemDto
pipelineChangeItemDto
)
{
// 1.记录变化的数据对象
// 1.记录变化的数据对象
PieLineDesignChangeDataDto
pieLineDesignChangeDataDto
=
BeanUtil
.
copyProperties
(
pipelineChangeItemDto
,
PieLineDesignChangeDataDto
.
class
);
PieLineDesignChangeDataDto
pieLineDesignChangeDataDto
=
BeanUtil
.
copyProperties
(
pipelineChangeItemDto
,
PieLineDesignChangeDataDto
.
class
);
// 构造新对象行转列
// 构造新对象行转列
List
<
ChangeDataDto
>
designInfoNew
=
commonEquipDataProcessService
.
buildDesignInfoNew
(
pieLineDesignChangeDataDto
,
record
);
List
<
FieldChangeMeta
>
designInfoNew
=
commonEquipDataProcessService
.
buildDesignInfoNew
(
pieLineDesignChangeDataDto
,
record
);
// 老数据查询行转列
// 老数据查询行转列
List
<
ChangeDataDto
>
designInfoOld
=
commonEquipDataProcessService
.
buildDesignInfoOld
(
record
);
List
<
FieldChangeMeta
>
designInfoOld
=
commonEquipDataProcessService
.
buildDesignInfoOld
(
record
);
allChangeColumns
.
addAll
(
c
ommonEquipDataProcessService
.
mergeChangeFields
(
designInfoNew
,
designInfoOld
));
allChangeColumns
.
addAll
(
C
ommonEquipDataProcessService
.
mergeChangeFields
(
designInfoNew
,
designInfoOld
));
// 2.更新管道的设计单位名称
// 2.更新管道的设计单位名称
equipChangeDataUpdateService
.
updatePieLineDesignData
(
record
,
pieLineDesignChangeDataDto
);
equipChangeDataUpdateService
.
updatePieLineDesignData
(
record
,
pieLineDesignChangeDataDto
);
}
}
...
...
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