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
5073faf2
Commit
5073faf2
authored
May 07, 2025
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(使用登记大编辑):
1.使用登记台套类编辑开发
parent
53a509b5
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
1385 additions
and
400 deletions
+1385
-400
BaseChangeDataDto.java
...eejoin/amos/boot/module/jg/api/dto/BaseChangeDataDto.java
+1
-1
FieldChangeMeta.java
.../yeejoin/amos/boot/module/jg/api/dto/FieldChangeMeta.java
+1
-2
IBaseChangeData.java
.../yeejoin/amos/boot/module/jg/api/dto/IBaseChangeData.java
+4
-0
UseRegisterChangeDataDto.java
...amos/boot/module/jg/api/dto/UseRegisterChangeDataDto.java
+86
-0
CommonMapper.java
.../yeejoin/amos/boot/module/jg/api/mapper/CommonMapper.java
+3
-0
CommonMapper.xml
...-module-jg-api/src/main/resources/mapper/CommonMapper.xml
+3
-0
BaseBizDataChangeEvent.java
...boot/module/jg/biz/edit/event/BaseBizDataChangeEvent.java
+3
-3
UseRegisterChangeEventHandler.java
...biz/edit/event/handler/UseRegisterChangeEventHandler.java
+1
-1
ChangeLogInsertListener.java
...e/jg/biz/edit/event/listener/ChangeLogInsertListener.java
+8
-8
RelationBizApplyUpdateListener.java
...z/edit/event/listener/RelationBizApplyUpdateListener.java
+2
-2
DefaultBizDataChangeHandler.java
.../jg/biz/edit/process/biz/DefaultBizDataChangeHandler.java
+9
-5
UseRegisterUpdateService.java
...ule/jg/biz/edit/process/biz/UseRegisterUpdateService.java
+0
-189
InstallNoticeDataChangeHandler.java
...ess/biz/installNotice/InstallNoticeDataChangeHandler.java
+14
-3
IBizDataChangeHandleStrategy.java
...it/process/biz/strategy/IBizDataChangeHandleStrategy.java
+20
-2
UseRegisterDataChangeHandler.java
...process/biz/useRegister/UseRegisterDataChangeHandler.java
+44
-12
UseRegisterUpdateService.java
...dit/process/biz/useRegister/UseRegisterUpdateService.java
+852
-0
BatchCylinderEquipChangeProcess.java
...z/edit/process/equip/BatchCylinderEquipChangeProcess.java
+2
-2
BatchEquipDataChangeProcess.java
...g/biz/edit/process/equip/BatchEquipDataChangeProcess.java
+4
-4
BatchProjectEquipChangeProcess.java
...iz/edit/process/equip/BatchProjectEquipChangeProcess.java
+2
-2
CommonEquipDataProcessService.java
...biz/edit/process/equip/CommonEquipDataProcessService.java
+164
-100
EquipChangeDataUpdateServiceImpl.java
.../edit/process/equip/EquipChangeDataUpdateServiceImpl.java
+2
-2
PieLineDataChangeServiceImpl.java
.../biz/edit/process/equip/PieLineDataChangeServiceImpl.java
+9
-9
SingleEquipChangeProcess.java
...e/jg/biz/edit/process/equip/SingleEquipChangeProcess.java
+2
-2
SingleProjectEquipChangeProcess.java
...z/edit/process/equip/SingleProjectEquipChangeProcess.java
+3
-3
IEquipChangeDataProcessStrategy.java
...ocess/equip/strategy/IEquipChangeDataProcessStrategy.java
+2
-2
ReflectiveFieldAccessor.java
...oot/module/jg/biz/edit/utils/ReflectiveFieldAccessor.java
+23
-0
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+40
-31
SingleManageEquipEditHandleImpl.java
.../jg/biz/service/impl/SingleManageEquipEditHandleImpl.java
+5
-5
IdxBizJgConstructionInfo.java
.../boot/module/ymt/api/entity/IdxBizJgConstructionInfo.java
+9
-10
IdxBizJgInspectionDetectionInfo.java
...odule/ymt/api/entity/IdxBizJgInspectionDetectionInfo.java
+4
-0
IdxBizJgRegisterInfo.java
...amos/boot/module/ymt/api/entity/IdxBizJgRegisterInfo.java
+5
-0
IdxBizJgSupervisionInfo.java
...s/boot/module/ymt/api/entity/IdxBizJgSupervisionInfo.java
+6
-0
IdxBizJgUseInfo.java
...join/amos/boot/module/ymt/api/entity/IdxBizJgUseInfo.java
+30
-0
InspectionDetectionInfoServiceImpl.java
.../biz/service/impl/InspectionDetectionInfoServiceImpl.java
+22
-0
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/dto/BaseChangeDataDto.java
View file @
5073faf2
...
@@ -5,7 +5,7 @@ import lombok.Data;
...
@@ -5,7 +5,7 @@ import lombok.Data;
import
java.io.Serializable
;
import
java.io.Serializable
;
@Data
@Data
public
class
BaseChangeDataDto
implements
Serializable
{
public
class
BaseChangeDataDto
implements
Serializable
,
IBaseChangeData
{
private
String
changeId
;
private
String
changeId
;
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/dto/
ChangeDataDto
.java
→
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/dto/
FieldChangeMeta
.java
View file @
5073faf2
...
@@ -2,13 +2,12 @@ package com.yeejoin.amos.boot.module.jg.api.dto;
...
@@ -2,13 +2,12 @@ package com.yeejoin.amos.boot.module.jg.api.dto;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.io.Serializable
;
@Data
@Data
@ApiModel
(
value
=
"变化的数据"
)
@ApiModel
(
value
=
"变化的数据"
)
public
class
ChangeDataDto
implements
Serializable
{
public
class
FieldChangeMeta
implements
Serializable
{
/**
/**
* 必须字段-字段key
* 必须字段-字段key
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/dto/IBaseChangeData.java
0 → 100644
View file @
5073faf2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
dto
;
public
interface
IBaseChangeData
{
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/dto/UseRegisterChangeDataDto.java
0 → 100644
View file @
5073faf2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
dto
;
import
cn.hutool.json.JSON
;
import
com.yeejoin.amos.boot.biz.common.annotation.FieldDisplayDefine
;
import
com.yeejoin.amos.boot.biz.common.annotation.Group
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
@Group
(
value
=
"biz_use_registration"
)
public
class
UseRegisterChangeDataDto
extends
BaseChangeDataDto
{
@FieldDisplayDefine
(
value
=
"单据编号"
,
isExist
=
false
)
private
String
applyNo
;
@FieldDisplayDefine
(
value
=
"使用地点市编码"
)
private
String
city
;
@FieldDisplayDefine
(
value
=
"使用地点区县编码"
)
private
String
county
;
@FieldDisplayDefine
(
value
=
"使用地点街道(镇)编码"
)
private
String
factoryUseSiteStreet
;
@FieldDisplayDefine
(
value
=
"详细使用地点"
)
private
String
address
;
@FieldDisplayDefine
(
value
=
"是否西咸"
)
private
String
isXixian
;
@FieldDisplayDefine
(
value
=
"使用登记证编号"
)
private
String
useRegistrationCode
;
@FieldDisplayDefine
(
value
=
"接收机构"
)
private
String
receiveCompanyCode
;
@FieldDisplayDefine
(
value
=
"使用场所"
)
private
String
usePlace
;
@FieldDisplayDefine
(
value
=
"单位内部编号"
)
private
String
useInnerCode
;
@FieldDisplayDefine
(
value
=
"安全管理员,格式:id_name"
)
private
String
safetyManager
;
@FieldDisplayDefine
(
value
=
"产权单位,格式:code_name"
)
private
String
estateUnitName
;
@FieldDisplayDefine
(
value
=
"原登记机关"
)
private
String
oRegUnit
;
@FieldDisplayDefine
(
value
=
"原登记日期"
)
private
String
oRegDate
;
@FieldDisplayDefine
(
value
=
"投用日期"
)
private
String
useDate
;
@FieldDisplayDefine
(
value
=
"是否增补-气瓶"
)
private
String
isAddEquip
;
@FieldDisplayDefine
(
value
=
"气瓶分类"
)
private
String
cylinderCategory
;
@FieldDisplayDefine
(
value
=
"使用登记表附件"
,
type
=
JSON
.
class
)
private
String
useRegistrationFormFile
;
@FieldDisplayDefine
(
value
=
"经纬度"
,
type
=
JSON
.
class
)
private
String
longitudeLatitude
;
@FieldDisplayDefine
(
value
=
"地图起始标点"
,
type
=
JSON
.
class
)
private
String
startLatitudeLongitude
;
@FieldDisplayDefine
(
value
=
"地图结束标点"
,
type
=
JSON
.
class
)
private
String
endLatitudeLongitude
;
@FieldDisplayDefine
(
value
=
"其他附件"
,
type
=
JSON
.
class
)
private
String
otherAccessories
;
@FieldDisplayDefine
(
value
=
"原使用登记证附件"
,
type
=
JSON
.
class
)
private
String
oldUseRegistrationTable
;
@FieldDisplayDefine
(
value
=
"原使用登记证附件"
,
type
=
JSON
.
class
)
private
String
oldUseRegistrationCertificate
;
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/CommonMapper.java
View file @
5073faf2
...
@@ -45,6 +45,9 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
...
@@ -45,6 +45,9 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
String
getOrgCodeByCompanyCode
(
String
companyCode
);
String
getOrgCodeByCompanyCode
(
String
companyCode
);
String
geCompanyCodeByOrgCode
(
@Param
(
"orgCode"
)
String
orgCode
);
String
getCompanyNameByOrgCode
(
String
orgCode
);
String
getCompanyNameByOrgCode
(
String
orgCode
);
String
selectBusinessData
(
String
tableName
,
String
instanceId
);
String
selectBusinessData
(
String
tableName
,
String
instanceId
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/CommonMapper.xml
View file @
5073faf2
...
@@ -92,6 +92,9 @@
...
@@ -92,6 +92,9 @@
<select
id=
"getCompanyNameByOrgCode"
resultType=
"java.lang.String"
>
<select
id=
"getCompanyNameByOrgCode"
resultType=
"java.lang.String"
>
select company_name from privilege_company where org_code = #{orgCode} limit 1
select company_name from privilege_company where org_code = #{orgCode} limit 1
</select>
</select>
<select
id=
"geCompanyCodeByOrgCode"
resultType=
"java.lang.String"
>
select company_code from privilege_company where org_code = #{orgCode} limit 1
</select>
<select
id=
"selectBusinessData"
resultType=
"java.lang.String"
>
<select
id=
"selectBusinessData"
resultType=
"java.lang.String"
>
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/event/BaseBizDataChangeEvent.java
View file @
5073faf2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
edit
.
event
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
edit
.
event
;
import
com.yeejoin.amos.boot.module.jg.api.dto.BizRelationDataDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.BizRelationDataDto
;
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.biz.edit.core.EventPublisherMapping
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.core.EventPublisherMapping
;
import
lombok.Getter
;
import
lombok.Getter
;
import
org.springframework.context.ApplicationEvent
;
import
org.springframework.context.ApplicationEvent
;
...
@@ -16,7 +16,7 @@ import java.util.List;
...
@@ -16,7 +16,7 @@ import java.util.List;
@EventPublisherMapping
@EventPublisherMapping
public
class
BaseBizDataChangeEvent
extends
ApplicationEvent
{
public
class
BaseBizDataChangeEvent
extends
ApplicationEvent
{
private
List
<
ChangeDataDto
>
data
;
private
List
<
FieldChangeMeta
>
data
;
private
RequestContextModel
requestContext
;
private
RequestContextModel
requestContext
;
...
@@ -26,7 +26,7 @@ public class BaseBizDataChangeEvent extends ApplicationEvent {
...
@@ -26,7 +26,7 @@ public class BaseBizDataChangeEvent extends ApplicationEvent {
private
BizRelationDataDto
bizRelationData
;
private
BizRelationDataDto
bizRelationData
;
public
BaseBizDataChangeEvent
(
Object
source
,
BizRelationDataDto
bizRelationData
,
List
<
ChangeDataDto
>
data
,
RequestContextModel
requestContext
)
{
public
BaseBizDataChangeEvent
(
Object
source
,
BizRelationDataDto
bizRelationData
,
List
<
FieldChangeMeta
>
data
,
RequestContextModel
requestContext
)
{
super
(
source
);
super
(
source
);
this
.
data
=
data
;
this
.
data
=
data
;
this
.
bizRelationData
=
bizRelationData
;
this
.
bizRelationData
=
bizRelationData
;
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/event/handler/UseRegisterChangeEventHandler.java
View file @
5073faf2
...
@@ -9,7 +9,7 @@ import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration;
...
@@ -9,7 +9,7 @@ import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration;
import
com.yeejoin.amos.boot.module.jg.biz.edit.event.BaseBizDataChangeEvent
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.event.BaseBizDataChangeEvent
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgBizChangeLogServiceImpl
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgBizChangeLogServiceImpl
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationServiceImpl
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationServiceImpl
;
import
com.yeejoin.amos.boot.module.jg.biz.
service.impl
.UseRegisterUpdateService
;
import
com.yeejoin.amos.boot.module.jg.biz.
edit.process.biz.useRegister
.UseRegisterUpdateService
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/listener/ChangeLogInsertListener.java
→
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/
event/
listener/ChangeLogInsertListener.java
View file @
5073faf2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
edit
.
listener
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
edit
.
event
.
listener
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
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.ESDataChangeLogDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.ESDataChangeLogDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgBizChangeLog
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgBizChangeLog
;
import
com.yeejoin.amos.boot.module.jg.biz.dao.ESDataChangeLogDao
;
import
com.yeejoin.amos.boot.module.jg.biz.dao.ESDataChangeLogDao
;
...
@@ -44,7 +44,7 @@ public class ChangeLogInsertListener {
...
@@ -44,7 +44,7 @@ public class ChangeLogInsertListener {
bizTypeTableMap
.
put
(
"singleManageEquipEdit"
,
"idx_biz_jg_use_info"
);
bizTypeTableMap
.
put
(
"singleManageEquipEdit"
,
"idx_biz_jg_use_info"
);
}
}
@Value
(
"${change.
data
.deal.thread.number:1}"
)
@Value
(
"${change.
log
.deal.thread.number:1}"
)
private
int
threadNumber
;
private
int
threadNumber
;
private
final
ESDataChangeLogDao
esDataChangeLogDao
;
private
final
ESDataChangeLogDao
esDataChangeLogDao
;
...
@@ -58,7 +58,7 @@ public class ChangeLogInsertListener {
...
@@ -58,7 +58,7 @@ public class ChangeLogInsertListener {
@TransactionalEventListener
(
value
=
BaseBizDataChangeEvent
.
class
)
@TransactionalEventListener
(
value
=
BaseBizDataChangeEvent
.
class
)
@Async
@Async
public
void
handleTransactionalEvent
(
BaseBizDataChangeEvent
event
)
{
public
void
handleTransactionalEvent
(
BaseBizDataChangeEvent
event
)
{
log
.
info
(
"
收到用户
变更业务数据消息:{}"
,
JSONObject
.
toJSONString
(
event
));
log
.
info
(
"
日志处理器,收到
变更业务数据消息:{}"
,
JSONObject
.
toJSONString
(
event
));
queue
.
add
(
event
);
queue
.
add
(
event
);
}
}
...
@@ -80,18 +80,18 @@ public class ChangeLogInsertListener {
...
@@ -80,18 +80,18 @@ public class ChangeLogInsertListener {
}
}
private
void
processEvent
(
BaseBizDataChangeEvent
event
)
{
private
void
processEvent
(
BaseBizDataChangeEvent
event
)
{
List
<
ChangeDataDto
>
changeDataDto
s
=
event
.
getData
();
List
<
FieldChangeMeta
>
fieldChangeMeta
s
=
event
.
getData
();
RequestContextModel
requestContextModel
=
event
.
getRequestContext
();
RequestContextModel
requestContextModel
=
event
.
getRequestContext
();
Date
date
=
new
Date
();
Date
date
=
new
Date
();
// 1.主表保存
// 1.主表保存
JgBizChangeLog
changeLog
=
saveLog
(
event
);
JgBizChangeLog
changeLog
=
saveLog
(
event
);
// 2.子表字段保存
// 2.子表字段保存
List
<
ESDataChangeLogDto
>
logs
=
saveColumnsChange2Es
(
changeDataDto
s
,
requestContextModel
,
date
,
changeLog
);
List
<
ESDataChangeLogDto
>
logs
=
saveColumnsChange2Es
(
fieldChangeMeta
s
,
requestContextModel
,
date
,
changeLog
);
log
.
info
(
"es 操作日志数据入库成功:{}条"
,
logs
.
size
());
log
.
info
(
"es 操作日志数据入库成功:{}条"
,
logs
.
size
());
}
}
private
List
<
ESDataChangeLogDto
>
saveColumnsChange2Es
(
List
<
ChangeDataDto
>
changeDataDto
s
,
RequestContextModel
requestContextModel
,
Date
date
,
JgBizChangeLog
changeLog
)
{
private
List
<
ESDataChangeLogDto
>
saveColumnsChange2Es
(
List
<
FieldChangeMeta
>
fieldChangeMeta
s
,
RequestContextModel
requestContextModel
,
Date
date
,
JgBizChangeLog
changeLog
)
{
List
<
ESDataChangeLogDto
>
logs
=
changeDataDto
s
.
parallelStream
().
map
(
changeDataDto
->
{
List
<
ESDataChangeLogDto
>
logs
=
fieldChangeMeta
s
.
parallelStream
().
map
(
changeDataDto
->
{
ESDataChangeLogDto
changeLogDto
=
new
ESDataChangeLogDto
();
ESDataChangeLogDto
changeLogDto
=
new
ESDataChangeLogDto
();
changeLogDto
.
setColumnKey
(
changeDataDto
.
getColumnKey
());
changeLogDto
.
setColumnKey
(
changeDataDto
.
getColumnKey
());
changeLogDto
.
setColumnKeyLabel
(
changeDataDto
.
getColumnLabel
());
changeLogDto
.
setColumnKeyLabel
(
changeDataDto
.
getColumnLabel
());
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/listener/RelationBizApplyUpdateListener.java
→
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/
event/
listener/RelationBizApplyUpdateListener.java
View file @
5073faf2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
edit
.
listener
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
edit
.
event
.
listener
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.event.BaseBizDataChangeEvent
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.event.BaseBizDataChangeEvent
;
...
@@ -38,7 +38,7 @@ public class RelationBizApplyUpdateListener {
...
@@ -38,7 +38,7 @@ public class RelationBizApplyUpdateListener {
@TransactionalEventListener
(
value
=
BaseBizDataChangeEvent
.
class
)
@TransactionalEventListener
(
value
=
BaseBizDataChangeEvent
.
class
)
@Async
@Async
public
void
handleTransactionalEvent
(
BaseBizDataChangeEvent
event
)
{
public
void
handleTransactionalEvent
(
BaseBizDataChangeEvent
event
)
{
log
.
info
(
"
收到用户
变更业务数据消息:{}"
,
JSONObject
.
toJSONString
(
event
));
log
.
info
(
"
业务处理器,收到
变更业务数据消息:{}"
,
JSONObject
.
toJSONString
(
event
));
queue
.
add
(
event
);
queue
.
add
(
event
);
}
}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/process/biz/DefaultBizDataChangeHandler.java
View file @
5073faf2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
edit
.
process
.
biz
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
edit
.
process
.
biz
;
import
com.yeejoin.amos.boot.module.jg.api.dto.BizRelationDataDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.BizRelationDataDto
;
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.biz.context.EquipDataProcessStrategyContext
;
import
com.yeejoin.amos.boot.module.jg.biz.context.EquipDataProcessStrategyContext
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.core.IEventPublisher
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.core.IEventPublisher
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.event.BaseBizDataChangeEvent
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.event.BaseBizDataChangeEvent
;
...
@@ -25,15 +25,19 @@ public abstract class DefaultBizDataChangeHandler<U extends BaseBizDataChangeEve
...
@@ -25,15 +25,19 @@ public abstract class DefaultBizDataChangeHandler<U extends BaseBizDataChangeEve
public
final
void
doSave
(
String
applyNo
,
ModelType
model
,
Map
<
String
,
Object
>
changeData
)
{
public
final
void
doSave
(
String
applyNo
,
ModelType
model
,
Map
<
String
,
Object
>
changeData
)
{
if
(
beforeCheck
(
applyNo
,
model
,
changeData
))
{
if
(
beforeCheck
(
applyNo
,
model
,
changeData
))
{
IEquipChangeDataProcessStrategy
dataProcessor
=
EquipDataProcessStrategyContext
.
getStrategy
(
model
);
IEquipChangeDataProcessStrategy
dataProcessor
=
EquipDataProcessStrategyContext
.
getStrategy
(
model
);
List
<
ChangeDataDto
>
allChangeColumns
=
dataProcessor
.
handle
(
changeData
,
applyNo
);
List
<
FieldChangeMeta
>
allChangeColumns
=
dataProcessor
.
handle
(
changeData
,
applyNo
);
List
<
ChangeDataDto
>
bizEditColumns
=
bizDataSave
(
applyNo
,
model
,
changeData
);
List
<
FieldChangeMeta
>
bizEditColumns
=
updBizData
(
applyNo
,
model
,
changeData
);
allChangeColumns
.
addAll
(
bizEditColumns
);
allChangeColumns
.
addAll
(
bizEditColumns
);
// 发送数据变更实践
if
(
bizIsFinished
(
applyNo
,
model
,
changeData
)){
List
<
FieldChangeMeta
>
equipColumns
=
updEqDataIfBizFin
(
applyNo
,
model
,
changeData
);
allChangeColumns
.
addAll
(
equipColumns
);
}
// 发送数据变更消息
publish2OtherBiz
(
allChangeColumns
,
applyNo
);
publish2OtherBiz
(
allChangeColumns
,
applyNo
);
}
}
}
}
private
void
publish2OtherBiz
(
List
<
ChangeDataDto
>
allChangeColumns
,
String
applyNo
)
{
private
void
publish2OtherBiz
(
List
<
FieldChangeMeta
>
allChangeColumns
,
String
applyNo
)
{
BizRelationDataDto
bizRelationDataDto
=
new
BizRelationDataDto
();
BizRelationDataDto
bizRelationDataDto
=
new
BizRelationDataDto
();
bizRelationDataDto
.
setBizId
(
applyNo
);
bizRelationDataDto
.
setBizId
(
applyNo
);
bizRelationDataDto
.
setBizType
(
canHandleBizType
());
bizRelationDataDto
.
setBizType
(
canHandleBizType
());
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/process/biz/UseRegisterUpdateService.java
deleted
100644 → 0
View file @
53a509b5
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration
;
import
com.yeejoin.amos.boot.module.jg.api.enums.CylinderTypeEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.InformationManageTypeEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgRegisterInfoMapper
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
lombok.Getter
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
static
java
.
util
.
stream
.
Collectors
.
toList
;
@Service
@RequiredArgsConstructor
@Getter
public
class
UseRegisterUpdateService
{
private
final
IdxBizJgRegisterInfoMapper
idxBizJgRegisterInfoMapper
;
private
final
JgUseRegistrationServiceImpl
useRegistrationService
;
private
final
JgRegistrationHistoryServiceImpl
jgRegistrationHistoryService
;
private
final
CommonServiceImpl
commonService
;
private
final
IdxBizJgProjectContraptionServiceImpl
idxBizJgProjectContraptionService
;
private
final
JgUseRegistrationEqServiceImpl
useRegistrationEqService
;
public
void
updateHisData
(
String
applyNo
)
{
JgUseRegistration
jgUseRegistration
=
useRegistrationService
.
getOne
(
new
LambdaQueryWrapper
<
JgUseRegistration
>().
eq
(
JgUseRegistration:
:
getApplyNo
,
applyNo
));
// 构建更新json数据
JSONObject
hisData
=
this
.
buildLastDetailData
(
jgUseRegistration
);
// 更新数据
useRegistrationService
.
updateHistory
(
hisData
,
null
,
jgUseRegistration
.
getSequenceNbr
().
toString
(),
jgUseRegistration
.
getSupervisoryCode
());
}
public
JSONObject
buildLastDetailData
(
JgUseRegistration
jgUseRegistration
)
{
JgRegistrationHistory
jgRegistrationHistory
=
getJgRegistrationHistory
(
jgUseRegistration
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
jgRegistrationHistory
.
getChangeData
());
jsonObject
.
put
(
"receiveOrgCode"
,
jgUseRegistration
.
getReceiveCompanyCode
()
+
"_"
+
jgUseRegistration
.
getReceiveOrgName
());
jsonObject
.
put
(
"status"
,
jgUseRegistration
.
getStatus
());
jsonObject
.
put
(
"applyNo"
,
jgUseRegistration
.
getApplyNo
());
jsonObject
.
remove
(
"submit"
);
jsonObject
.
remove
(
"instanceId"
);
if
(!
ObjectUtils
.
isEmpty
(
jsonObject
.
get
(
"factoryUseSiteStreet"
)))
{
jsonObject
.
put
(
"factoryUseSiteStreet"
,
String
.
valueOf
(
Long
.
valueOf
(
jsonObject
.
get
(
"factoryUseSiteStreet"
).
toString
())));
}
if
(!
"unit"
.
equals
(
jgUseRegistration
.
getManageType
()))
{
// 台套逻辑
String
record
=
useRegistrationService
.
setDefaultRecord
(
jgUseRegistration
,
null
);
// 更新 设计、制造、基本信息json
useRegistrationService
.
fillLastEquipBaseInfo
(
jsonObject
,
record
);
// 补充"车牌号"字段
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>
wrapper
=
new
QueryWrapper
<
IdxBizJgRegisterInfo
>().
lambda
().
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
record
);
IdxBizJgRegisterInfo
idxBizJgRegisterInfo
=
idxBizJgRegisterInfoMapper
.
selectOne
(
wrapper
);
jsonObject
.
put
(
"carNumber"
,
idxBizJgRegisterInfo
.
getCarNumber
());
jsonObject
.
put
(
"regType"
,
jgUseRegistration
.
getRegType
());
}
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
());
jsonObject
.
remove
(
"equipmentLists"
);
if
(
CylinderTypeEnum
.
CYLINDER
.
getCode
().
equals
(
jsonObject
.
get
(
"EQU_CATEGORY_CODE"
)))
{
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
=
useRegistrationService
.
getBaseMapper
().
queryForUnitVesselEquipment
(
records
);
result
.
forEach
(
i
->
{
i
.
put
(
"chargingMedium"
,
fillingMediumMap
.
get
(
i
.
get
(
"chargingMedium"
)));
i
.
put
(
"productPhoto"
,
JSONArray
.
parseArray
((
String
)
i
.
get
(
"productPhoto"
)));
i
.
put
(
"cylinderStampAttachment"
,
JSONArray
.
parseArray
((
String
)
i
.
get
(
"cylinderStampAttachment"
)));
i
.
put
(
"informationSituation"
,
InformationManageTypeEnum
.
getName
((
String
)
i
.
get
(
"informationSituation"
)));
});
jsonObject
.
put
(
"equipmentLists"
,
result
);
}
else
{
// 管道逻辑 更新装置、管道有关数据
IdxBizJgProjectContraption
projectContraption
=
idxBizJgProjectContraptionService
.
getById
(
jgUseRegistration
.
getProjectContraptionId
());
jsonObject
.
put
(
"pipelineLength"
,
projectContraption
.
getPipelineLength
());
jsonObject
.
put
(
"projectContraption"
,
projectContraption
.
getProjectContraption
());
jsonObject
.
put
(
"projectContraptionNo"
,
projectContraption
.
getProjectContraptionNo
());
List
<
Map
<
String
,
Object
>>
equList
=
useRegistrationService
.
getBaseMapper
().
queryForUnitPipelineEquipment
(
records
);
// 检验报告数据格式化 转json
equList
.
stream
().
filter
(
e
->
e
.
get
(
"inspectReport"
)
!=
null
).
forEach
(
item
->
item
.
put
(
"inspectReport"
,
JSON
.
parse
(
item
.
get
(
"inspectReport"
).
toString
())));
jsonObject
.
put
(
"equipmentLists"
,
equList
);
}
}
jsonObject
.
put
(
"useRegistrationCode"
,
jgUseRegistration
.
getUseRegistrationCode
());
// 转化 附件 字段
this
.
convertStringToJsonObject
(
jsonObject
,
JgUseRegistrationServiceImpl
.
jsonFields
);
return
jsonObject
;
}
public
JSONObject
getLastDetailDataForEdit
(
JgUseRegistration
jgUseRegistration
)
{
JgRegistrationHistory
jgRegistrationHistory
=
getJgRegistrationHistory
(
jgUseRegistration
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
jgRegistrationHistory
.
getChangeData
());
jsonObject
.
put
(
"receiveOrgCode"
,
jgUseRegistration
.
getReceiveCompanyCode
()
+
"_"
+
jgUseRegistration
.
getReceiveOrgName
());
jsonObject
.
put
(
"status"
,
jgUseRegistration
.
getStatus
());
jsonObject
.
put
(
"applyNo"
,
jgUseRegistration
.
getApplyNo
());
jsonObject
.
remove
(
"submit"
);
jsonObject
.
remove
(
"instanceId"
);
if
(!
ObjectUtils
.
isEmpty
(
jsonObject
.
get
(
"factoryUseSiteStreet"
)))
{
jsonObject
.
put
(
"factoryUseSiteStreet"
,
String
.
valueOf
(
Long
.
valueOf
(
jsonObject
.
get
(
"factoryUseSiteStreet"
).
toString
())));
}
if
(!
"unit"
.
equals
(
jgUseRegistration
.
getManageType
()))
{
// 台套逻辑
String
record
=
useRegistrationService
.
setDefaultRecord
(
jgUseRegistration
,
null
);
// 更新 设计、制造、基本信息json
useRegistrationService
.
fillLastEquipBaseInfo
(
jsonObject
,
record
);
// 补充"车牌号"字段
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>
wrapper
=
new
QueryWrapper
<
IdxBizJgRegisterInfo
>().
lambda
().
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
record
);
IdxBizJgRegisterInfo
idxBizJgRegisterInfo
=
idxBizJgRegisterInfoMapper
.
selectOne
(
wrapper
);
jsonObject
.
put
(
"carNumber"
,
idxBizJgRegisterInfo
.
getCarNumber
());
jsonObject
.
put
(
"regType"
,
jgUseRegistration
.
getRegType
());
}
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
());
jsonObject
.
remove
(
"equipmentLists"
);
if
(
CylinderTypeEnum
.
CYLINDER
.
getCode
().
equals
(
jsonObject
.
get
(
"EQU_CATEGORY_CODE"
)))
{
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
=
useRegistrationService
.
getBaseMapper
().
queryForUnitVesselEquipment
(
records
);
result
.
forEach
(
i
->
{
i
.
put
(
"chargingMedium"
,
fillingMediumMap
.
get
(
i
.
get
(
"chargingMedium"
)));
i
.
put
(
"productPhoto"
,
JSONArray
.
parseArray
((
String
)
i
.
get
(
"productPhoto"
)));
i
.
put
(
"cylinderStampAttachment"
,
JSONArray
.
parseArray
((
String
)
i
.
get
(
"cylinderStampAttachment"
)));
i
.
put
(
"informationSituation"
,
InformationManageTypeEnum
.
getName
((
String
)
i
.
get
(
"informationSituation"
)));
});
jsonObject
.
put
(
"tableData"
,
result
);
}
else
{
// 管道逻辑 更新装置、管道有关数据
IdxBizJgProjectContraption
projectContraption
=
idxBizJgProjectContraptionService
.
getById
(
jgUseRegistration
.
getProjectContraptionId
());
jsonObject
.
put
(
"pipelineLength"
,
projectContraption
.
getPipelineLength
());
jsonObject
.
put
(
"projectContraption"
,
projectContraption
.
getProjectContraption
());
jsonObject
.
put
(
"projectContraptionNo"
,
projectContraption
.
getProjectContraptionNo
());
List
<
Map
<
String
,
Object
>>
equList
=
useRegistrationService
.
getBaseMapper
().
queryForUnitPipelineEquipment
(
records
);
// 检验报告数据格式化 转json
equList
.
stream
().
filter
(
e
->
e
.
get
(
"inspectReport"
)
!=
null
).
forEach
(
item
->
item
.
put
(
"inspectReport"
,
JSON
.
parse
(
item
.
get
(
"inspectReport"
).
toString
())));
jsonObject
.
put
(
"tableData"
,
equList
);
}
}
jsonObject
.
put
(
"useRegistrationCode"
,
jgUseRegistration
.
getUseRegistrationCode
());
return
jsonObject
;
}
public
JgRegistrationHistory
getJgRegistrationHistory
(
JgUseRegistration
jgUseRegistration
)
{
LambdaQueryWrapper
<
JgRegistrationHistory
>
lambda
=
new
QueryWrapper
<
JgRegistrationHistory
>().
lambda
();
lambda
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
jgUseRegistration
.
getSequenceNbr
());
lambda
.
eq
(
JgRegistrationHistory:
:
getIsDelete
,
false
);
return
jgRegistrationHistoryService
.
getBaseMapper
().
selectOne
(
lambda
);
}
public
void
convertStringToJsonObject
(
Object
obj
,
String
[]
jsonFields
)
{
if
(
obj
instanceof
JSONObject
)
{
JSONObject
jsonObject
=
(
JSONObject
)
obj
;
for
(
String
field
:
jsonFields
)
{
if
(
jsonObject
.
get
(
field
)
!=
null
&&
jsonObject
.
get
(
field
)
instanceof
String
)
{
jsonObject
.
put
(
field
,
JSON
.
parse
(
JSONObject
.
toJSONString
(
jsonObject
.
get
(
field
))));
}
}
}
else
if
(
obj
instanceof
Map
)
{
Map
<
String
,
Object
>
map
=
(
Map
<
String
,
Object
>)
obj
;
for
(
String
field
:
jsonFields
)
{
if
(
map
.
containsKey
(
field
)
&&
map
.
get
(
field
)
instanceof
String
)
{
map
.
put
(
field
,
JSON
.
parse
((
String
)
map
.
get
(
field
)));
}
}
}
else
{
// 处理其他类型
System
.
out
.
println
(
"Unsupported Object Type"
);
}
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/process/biz/InstallNoticeDataChangeHandler.java
→
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/process/biz/
installNotice/
InstallNoticeDataChangeHandler.java
View file @
5073faf2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
edit
.
process
.
biz
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
edit
.
process
.
biz
.
installNotice
;
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.biz.edit.core.RouterEventPublisher
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.core.RouterEventPublisher
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.event.BaseBizDataChangeEvent
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.event.BaseBizDataChangeEvent
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.process.biz.DefaultBizDataChangeHandler
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.Collections
;
import
java.util.Collections
;
...
@@ -27,7 +28,7 @@ public class InstallNoticeDataChangeHandler extends DefaultBizDataChangeHandler<
...
@@ -27,7 +28,7 @@ public class InstallNoticeDataChangeHandler extends DefaultBizDataChangeHandler<
}
}
@Override
@Override
public
List
<
ChangeDataDto
>
bizDataSave
(
String
applyNo
,
ModelType
model
,
Map
<
String
,
Object
>
changeData
)
{
public
List
<
FieldChangeMeta
>
updBizData
(
String
applyNo
,
ModelType
model
,
Map
<
String
,
Object
>
changeData
)
{
return
Collections
.
emptyList
();
return
Collections
.
emptyList
();
}
}
...
@@ -40,4 +41,14 @@ public class InstallNoticeDataChangeHandler extends DefaultBizDataChangeHandler<
...
@@ -40,4 +41,14 @@ public class InstallNoticeDataChangeHandler extends DefaultBizDataChangeHandler<
public
Set
<
String
>
getEqs
(
String
applyNo
)
{
public
Set
<
String
>
getEqs
(
String
applyNo
)
{
return
Collections
.
emptySet
();
return
Collections
.
emptySet
();
}
}
@Override
public
List
<
FieldChangeMeta
>
updEqDataIfBizFin
(
String
applyNo
,
ModelType
model
,
Map
<
String
,
Object
>
changeData
)
{
return
Collections
.
emptyList
();
}
@Override
public
Boolean
bizIsFinished
(
String
applyNo
,
ModelType
model
,
Map
<
String
,
Object
>
changeData
)
{
return
null
;
}
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/process/biz/strategy/IBizDataChangeHandleStrategy.java
View file @
5073faf2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
edit
.
process
.
biz
.
strategy
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
edit
.
process
.
biz
.
strategy
;
import
com.yeejoin.amos.boot.module.jg.api.dto.
ChangeDataDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.
FieldChangeMeta
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -31,7 +31,7 @@ public interface IBizDataChangeHandleStrategy {
...
@@ -31,7 +31,7 @@ public interface IBizDataChangeHandleStrategy {
* @param model @see ModelType
* @param model @see ModelType
* @param changeData 变更数据
* @param changeData 变更数据
*/
*/
List
<
ChangeDataDto
>
bizDataSave
(
String
applyNo
,
ModelType
model
,
Map
<
String
,
Object
>
changeData
);
List
<
FieldChangeMeta
>
updBizData
(
String
applyNo
,
ModelType
model
,
Map
<
String
,
Object
>
changeData
);
/**
/**
...
@@ -64,4 +64,22 @@ public interface IBizDataChangeHandleStrategy {
...
@@ -64,4 +64,22 @@ public interface IBizDataChangeHandleStrategy {
* @return 设备record或者证数组
* @return 设备record或者证数组
*/
*/
Set
<
String
>
getEqs
(
String
applyNo
);
Set
<
String
>
getEqs
(
String
applyNo
);
/**
* 在业务单位状态为已完成时进行设备/装置信息的更新
* @param applyNo 单据编号
* @param model 类型
* @param changeData 数据
* @return 更新的字段
*/
List
<
FieldChangeMeta
>
updEqDataIfBizFin
(
String
applyNo
,
ModelType
model
,
Map
<
String
,
Object
>
changeData
);
/**
* 单据是否已经审核完成
* @param applyNo 单据编号
* @param model 类型
* @param changeData 数据
* @return true-完成;false-未完成
*/
Boolean
bizIsFinished
(
String
applyNo
,
ModelType
model
,
Map
<
String
,
Object
>
changeData
);
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/process/biz/UseRegisterDataChangeHandler.java
→
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/process/biz/
useRegister/
UseRegisterDataChangeHandler.java
View file @
5073faf2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
edit
.
process
.
biz
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
edit
.
process
.
biz
.
useRegister
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
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.UseRegisterChangeDataDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.core.RouterEventPublisher
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.core.RouterEventPublisher
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.event.BaseBizDataChangeEvent
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.event.BaseBizDataChangeEvent
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.process.biz.DefaultBizDataChangeHandler
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.process.equip.CommonEquipDataProcessService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationServiceImpl
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationServiceImpl
;
import
com.yeejoin.amos.boot.module.
jg.biz.service.impl.UseRegisterUpdateService
;
import
com.yeejoin.amos.boot.module.
ymt.api.enums.FlowStatusEnum
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
import
java.util.*
;
...
@@ -19,6 +22,7 @@ public class UseRegisterDataChangeHandler extends DefaultBizDataChangeHandler<Ba
...
@@ -19,6 +22,7 @@ public class UseRegisterDataChangeHandler extends DefaultBizDataChangeHandler<Ba
private
final
UseRegisterUpdateService
useRegisterUpdateService
;
private
final
UseRegisterUpdateService
useRegisterUpdateService
;
protected
UseRegisterDataChangeHandler
(
RouterEventPublisher
routerEventPublisher
,
UseRegisterUpdateService
useRegisterUpdateService
)
{
protected
UseRegisterDataChangeHandler
(
RouterEventPublisher
routerEventPublisher
,
UseRegisterUpdateService
useRegisterUpdateService
)
{
super
(
routerEventPublisher
);
super
(
routerEventPublisher
);
this
.
useRegisterUpdateService
=
useRegisterUpdateService
;
this
.
useRegisterUpdateService
=
useRegisterUpdateService
;
...
@@ -39,21 +43,36 @@ public class UseRegisterDataChangeHandler extends DefaultBizDataChangeHandler<Ba
...
@@ -39,21 +43,36 @@ public class UseRegisterDataChangeHandler extends DefaultBizDataChangeHandler<Ba
* @param changeData 前端不支持分组-目前为平铺数据结构
* @param changeData 前端不支持分组-目前为平铺数据结构
*/
*/
@Override
@Override
public
List
<
ChangeDataDto
>
bizDataSave
(
String
applyNo
,
ModelType
model
,
Map
<
String
,
Object
>
changeData
)
{
public
List
<
FieldChangeMeta
>
updBizData
(
String
applyNo
,
ModelType
model
,
Map
<
String
,
Object
>
changeData
)
{
List
<
ChangeDataDto
>
bizEditColumns
=
new
ArrayList
<
ChangeDataDto
>();
List
<
FieldChangeMeta
>
bizEditColumns
=
new
ArrayList
<
>();
// 单据信息的保存、与设备相关、证相关字段的更新
// 单据信息的保存、与设备相关、证相关字段的更新
// 1.根据任务状态进行单据数据的处理
JgUseRegistration
useRegistration
=
useRegisterUpdateService
.
getJgUseRegistrationService
().
getOne
(
new
LambdaQueryWrapper
<
JgUseRegistration
>().
eq
(
JgUseRegistration:
:
getApplyNo
,
applyNo
));
// 1.1 流程中,更新业务相关字段、更新设备
// 1.构建单据字段级变化流水
// 1.2 已完成,更新业务相关字段、证相关、批量方式的设备公共字段信息
buildBizFieldChangeLogs
(
changeData
,
useRegistration
,
bizEditColumns
);
// 选择是台套、还是单位办理的方式,进行分类数据的解析
// 2.更新单据及根据单据状态构建设备字段级变化流水
// 更新历史的JSON的数据
this
.
updateBizInfo
(
changeData
);
// 3.更新历史的JSON的数据
this
.
updateHistoryJson
(
applyNo
);
this
.
updateHistoryJson
(
applyNo
);
return
bizEditColumns
;
return
bizEditColumns
;
}
}
private
void
updateBizInfo
(
Map
<
String
,
Object
>
changeData
)
{
useRegisterUpdateService
.
updateBizInfo
(
changeData
);
}
private
void
buildBizFieldChangeLogs
(
Map
<
String
,
Object
>
changeData
,
JgUseRegistration
useRegistration
,
List
<
FieldChangeMeta
>
bizEditColumns
)
{
UseRegisterChangeDataDto
newChangeData
=
CommonEquipDataProcessService
.
castMap2Bean
(
changeData
,
UseRegisterChangeDataDto
.
class
);
newChangeData
.
setApplyNo
(
useRegistration
.
getApplyNo
());
Map
<
String
,
Object
>
oldData
=
useRegisterUpdateService
.
getJgUseRegistrationService
().
getDetail
(
null
,
useRegistration
.
getSequenceNbr
(),
null
);
UseRegisterChangeDataDto
oldChangeData
=
CommonEquipDataProcessService
.
castMap2Bean
(
oldData
,
UseRegisterChangeDataDto
.
class
);
List
<
FieldChangeMeta
>
oldFields
=
CommonEquipDataProcessService
.
convertBeanField2Column2
(
newChangeData
,
useRegistration
.
getApplyNo
());
List
<
FieldChangeMeta
>
newFields
=
CommonEquipDataProcessService
.
convertBeanField2Column2
(
oldChangeData
,
useRegistration
.
getApplyNo
());
bizEditColumns
.
addAll
(
CommonEquipDataProcessService
.
mergeChangeFields
(
newFields
,
oldFields
));
}
@Override
@Override
public
Boolean
beforeCheck
(
String
applyNo
,
ModelType
model
,
Map
<
String
,
Object
>
changeData
)
{
public
Boolean
beforeCheck
(
String
applyNo
,
ModelType
model
,
Map
<
String
,
Object
>
changeData
)
{
return
true
;
return
useRegisterUpdateService
.
beforeCheck
(
changeData
,
applyNo
)
;
}
}
@Override
@Override
...
@@ -61,6 +80,18 @@ public class UseRegisterDataChangeHandler extends DefaultBizDataChangeHandler<Ba
...
@@ -61,6 +80,18 @@ public class UseRegisterDataChangeHandler extends DefaultBizDataChangeHandler<Ba
return
Collections
.
emptySet
();
return
Collections
.
emptySet
();
}
}
@Override
public
List
<
FieldChangeMeta
>
updEqDataIfBizFin
(
String
applyNo
,
ModelType
model
,
Map
<
String
,
Object
>
changeData
)
{
// 更新设备/装置的使用信息
return
useRegisterUpdateService
.
updEqData
(
applyNo
,
new
JSONObject
(
changeData
));
}
@Override
public
Boolean
bizIsFinished
(
String
applyNo
,
ModelType
model
,
Map
<
String
,
Object
>
changeData
)
{
JgUseRegistration
useRegistration
=
useRegisterUpdateService
.
getJgUseRegistrationService
().
getOne
(
new
LambdaQueryWrapper
<
JgUseRegistration
>().
eq
(
JgUseRegistration:
:
getApplyNo
,
applyNo
));
return
useRegistration
.
getStatus
().
equals
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
}
private
void
updateHistoryJson
(
String
applyNo
)
{
private
void
updateHistoryJson
(
String
applyNo
)
{
useRegisterUpdateService
.
updateHisData
(
applyNo
);
useRegisterUpdateService
.
updateHisData
(
applyNo
);
}
}
...
@@ -69,10 +100,11 @@ public class UseRegisterDataChangeHandler extends DefaultBizDataChangeHandler<Ba
...
@@ -69,10 +100,11 @@ public class UseRegisterDataChangeHandler extends DefaultBizDataChangeHandler<Ba
@Override
@Override
public
Map
<
String
,
?>
getDetail
(
String
applyNo
,
String
bizId
)
{
public
Map
<
String
,
?>
getDetail
(
String
applyNo
,
String
bizId
)
{
Map
<
String
,
Object
>
detail
=
new
HashMap
<>();
Map
<
String
,
Object
>
detail
=
new
HashMap
<>();
JgUseRegistration
useRegistration
=
useRegisterUpdateService
.
getUseRegistrationService
().
getOne
(
new
LambdaQueryWrapper
<
JgUseRegistration
>().
eq
(
JgUseRegistration:
:
getApplyNo
,
applyNo
));
JgUseRegistration
useRegistration
=
useRegisterUpdateService
.
get
Jg
UseRegistrationService
().
getOne
(
new
LambdaQueryWrapper
<
JgUseRegistration
>().
eq
(
JgUseRegistration:
:
getApplyNo
,
applyNo
));
JSONObject
lastDetailDataForEdit
=
useRegisterUpdateService
.
getLastDetailDataForEdit
(
useRegistration
);
JSONObject
lastDetailDataForEdit
=
useRegisterUpdateService
.
getLastDetailDataForEdit
(
useRegistration
);
BeanUtil
.
copyProperties
(
lastDetailDataForEdit
,
detail
);
BeanUtil
.
copyProperties
(
lastDetailDataForEdit
,
detail
);
BeanUtil
.
copyProperties
(
useRegistration
,
detail
);
BeanUtil
.
copyProperties
(
useRegistration
,
detail
);
detail
.
put
(
"equipId"
,
lastDetailDataForEdit
.
getString
(
"equipId"
));
// 转化 附件 字段
// 转化 附件 字段
useRegisterUpdateService
.
convertStringToJsonObject
(
detail
,
JgUseRegistrationServiceImpl
.
jsonFields
);
useRegisterUpdateService
.
convertStringToJsonObject
(
detail
,
JgUseRegistrationServiceImpl
.
jsonFields
);
return
detail
;
return
detail
;
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/process/biz/useRegister/UseRegisterUpdateService.java
0 → 100644
View file @
5073faf2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
edit
.
process
.
biz
.
useRegister
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.map.MapBuilder
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
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.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.jg.api.dto.FieldChangeMeta
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationEq
;
import
com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.CylinderTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.process.equip.CommonEquipDataProcessService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.IdxBizJgProjectContraptionServiceImpl
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationServiceImpl
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.*
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.InformationManageTypeEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgRegisterInfoMapper
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
lombok.Getter
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
javax.annotation.PostConstruct
;
import
java.text.ParseException
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
.
JgUseRegistrationServiceImpl
.
carNumber
;
import
static
java
.
util
.
stream
.
Collectors
.
toList
;
@Service
@RequiredArgsConstructor
@Getter
@Slf4j
public
class
UseRegisterUpdateService
{
private
final
IdxBizJgRegisterInfoMapper
idxBizJgRegisterInfoMapper
;
private
final
IdxBizJgProjectContraptionServiceImpl
idxBizJgProjectContraptionService
;
private
final
RedisUtils
redisUtils
;
private
final
JgUseRegistrationServiceImpl
jgUseRegistrationService
;
private
final
Map
<
String
,
Function
<
JSONObject
,
Boolean
>>
bizHandlers
=
new
ConcurrentHashMap
<>();
private
final
CommonEquipDataProcessService
commonEquipDataProcessService
;
private
final
CommonMapper
commonMapper
;
@PostConstruct
public
void
init
()
{
// 新增台套登记
bizHandlers
.
put
(
"0-set"
,
this
::
handleUseRegistrationEdit
);
bizHandlers
.
put
(
"-set"
,
this
::
handleUseRegistrationEdit
);
// 新增单位登记
bizHandlers
.
put
(
"0-unit"
,
this
::
handleUnitUseRegistrationEdit
);
// 历史有证台套登记
bizHandlers
.
put
(
"1-set"
,
this
::
handleHistoryEquipEdit
);
// 历史无证台套登记
bizHandlers
.
put
(
"2-set"
,
this
::
handleUseRegistrationEdit
);
// 历史无证单位登记
bizHandlers
.
put
(
"2-unit"
,
this
::
handleUnitUseRegistrationEdit
);
}
public
void
updateHisData
(
String
applyNo
)
{
JgUseRegistration
jgUseRegistration
=
jgUseRegistrationService
.
getOne
(
new
LambdaQueryWrapper
<
JgUseRegistration
>().
eq
(
JgUseRegistration:
:
getApplyNo
,
applyNo
));
// 构建更新json数据
JSONObject
hisData
=
this
.
buildLastDetailData
(
jgUseRegistration
);
// 更新数据
jgUseRegistrationService
.
updateHistory
(
hisData
,
null
,
jgUseRegistration
.
getSequenceNbr
().
toString
(),
jgUseRegistration
.
getSupervisoryCode
());
}
public
JSONObject
buildLastDetailData
(
JgUseRegistration
jgUseRegistration
)
{
JgRegistrationHistory
jgRegistrationHistory
=
getJgRegistrationHistory
(
jgUseRegistration
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
jgRegistrationHistory
.
getChangeData
());
jsonObject
.
put
(
"receiveOrgCode"
,
jgUseRegistration
.
getReceiveCompanyCode
()
+
"_"
+
jgUseRegistration
.
getReceiveOrgName
());
jsonObject
.
put
(
"status"
,
jgUseRegistration
.
getStatus
());
jsonObject
.
put
(
"applyNo"
,
jgUseRegistration
.
getApplyNo
());
jsonObject
.
remove
(
"submit"
);
jsonObject
.
remove
(
"instanceId"
);
if
(!
ObjectUtils
.
isEmpty
(
jsonObject
.
get
(
"factoryUseSiteStreet"
)))
{
jsonObject
.
put
(
"factoryUseSiteStreet"
,
String
.
valueOf
(
Long
.
valueOf
(
jsonObject
.
get
(
"factoryUseSiteStreet"
).
toString
())));
}
if
(!
"unit"
.
equals
(
jgUseRegistration
.
getManageType
()))
{
// 台套逻辑
String
record
=
jgUseRegistrationService
.
setDefaultRecord
(
jgUseRegistration
,
null
);
// 更新 设计、制造、基本信息json
jgUseRegistrationService
.
fillLastEquipBaseInfo
(
jsonObject
,
record
);
// 补充"车牌号"字段
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>
wrapper
=
new
QueryWrapper
<
IdxBizJgRegisterInfo
>().
lambda
().
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
record
);
IdxBizJgRegisterInfo
idxBizJgRegisterInfo
=
idxBizJgRegisterInfoMapper
.
selectOne
(
wrapper
);
jsonObject
.
put
(
"carNumber"
,
idxBizJgRegisterInfo
.
getCarNumber
());
jsonObject
.
put
(
"regType"
,
jgUseRegistration
.
getRegType
());
}
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
());
jsonObject
.
remove
(
"equipmentLists"
);
if
(
CylinderTypeEnum
.
CYLINDER
.
getCode
().
equals
(
jsonObject
.
get
(
"EQU_CATEGORY_CODE"
)))
{
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
=
jgUseRegistrationService
.
getBaseMapper
().
queryForUnitVesselEquipment
(
records
);
result
.
forEach
(
i
->
{
i
.
put
(
"chargingMedium"
,
fillingMediumMap
.
get
(
i
.
get
(
"chargingMedium"
)));
i
.
put
(
"productPhoto"
,
JSONArray
.
parseArray
((
String
)
i
.
get
(
"productPhoto"
)));
i
.
put
(
"cylinderStampAttachment"
,
JSONArray
.
parseArray
((
String
)
i
.
get
(
"cylinderStampAttachment"
)));
i
.
put
(
"informationSituation"
,
InformationManageTypeEnum
.
getName
((
String
)
i
.
get
(
"informationSituation"
)));
});
jsonObject
.
put
(
"equipmentLists"
,
result
);
}
else
{
// 管道逻辑 更新装置、管道有关数据
IdxBizJgProjectContraption
projectContraption
=
idxBizJgProjectContraptionService
.
getById
(
jgUseRegistration
.
getProjectContraptionId
());
jsonObject
.
put
(
"pipelineLength"
,
projectContraption
.
getPipelineLength
());
jsonObject
.
put
(
"projectContraption"
,
projectContraption
.
getProjectContraption
());
jsonObject
.
put
(
"projectContraptionNo"
,
projectContraption
.
getProjectContraptionNo
());
List
<
Map
<
String
,
Object
>>
equList
=
jgUseRegistrationService
.
getBaseMapper
().
queryForUnitPipelineEquipment
(
records
);
// 检验报告数据格式化 转json
equList
.
stream
().
filter
(
e
->
e
.
get
(
"inspectReport"
)
!=
null
).
forEach
(
item
->
item
.
put
(
"inspectReport"
,
JSON
.
parse
(
item
.
get
(
"inspectReport"
).
toString
())));
jsonObject
.
put
(
"equipmentLists"
,
equList
);
}
}
jsonObject
.
put
(
"useRegistrationCode"
,
jgUseRegistration
.
getUseRegistrationCode
());
// 转化 附件 字段
this
.
convertStringToJsonObject
(
jsonObject
,
JgUseRegistrationServiceImpl
.
jsonFields
);
return
jsonObject
;
}
public
JSONObject
getLastDetailDataForEdit
(
JgUseRegistration
jgUseRegistration
)
{
JgRegistrationHistory
jgRegistrationHistory
=
getJgRegistrationHistory
(
jgUseRegistration
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
jgRegistrationHistory
.
getChangeData
());
jsonObject
.
put
(
"receiveOrgCode"
,
jgUseRegistration
.
getReceiveCompanyCode
()
+
"_"
+
jgUseRegistration
.
getReceiveOrgName
());
jsonObject
.
put
(
"status"
,
jgUseRegistration
.
getStatus
());
jsonObject
.
put
(
"applyNo"
,
jgUseRegistration
.
getApplyNo
());
jsonObject
.
remove
(
"submit"
);
jsonObject
.
remove
(
"instanceId"
);
if
(!
ObjectUtils
.
isEmpty
(
jsonObject
.
get
(
"factoryUseSiteStreet"
)))
{
jsonObject
.
put
(
"factoryUseSiteStreet"
,
String
.
valueOf
(
Long
.
valueOf
(
jsonObject
.
get
(
"factoryUseSiteStreet"
).
toString
())));
}
if
(!
"unit"
.
equals
(
jgUseRegistration
.
getManageType
()))
{
// 台套逻辑
String
record
=
jgUseRegistrationService
.
setDefaultRecord
(
jgUseRegistration
,
null
);
// 更新 设计、制造、基本信息json
jgUseRegistrationService
.
fillLastEquipBaseInfo
(
jsonObject
,
record
);
// 补充"车牌号"字段
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>
wrapper
=
new
QueryWrapper
<
IdxBizJgRegisterInfo
>().
lambda
().
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
record
);
IdxBizJgRegisterInfo
idxBizJgRegisterInfo
=
idxBizJgRegisterInfoMapper
.
selectOne
(
wrapper
);
jsonObject
.
put
(
"carNumber"
,
idxBizJgRegisterInfo
.
getCarNumber
());
jsonObject
.
put
(
"regType"
,
jgUseRegistration
.
getRegType
());
}
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
());
jsonObject
.
remove
(
"equipmentLists"
);
if
(
CylinderTypeEnum
.
CYLINDER
.
getCode
().
equals
(
jsonObject
.
get
(
"EQU_CATEGORY_CODE"
)))
{
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
=
jgUseRegistrationService
.
getBaseMapper
().
queryForUnitVesselEquipment
(
records
);
result
.
forEach
(
i
->
{
i
.
put
(
"chargingMedium"
,
fillingMediumMap
.
get
(
i
.
get
(
"chargingMedium"
)));
i
.
put
(
"productPhoto"
,
JSONArray
.
parseArray
((
String
)
i
.
get
(
"productPhoto"
)));
i
.
put
(
"cylinderStampAttachment"
,
JSONArray
.
parseArray
((
String
)
i
.
get
(
"cylinderStampAttachment"
)));
i
.
put
(
"informationSituation"
,
InformationManageTypeEnum
.
getName
((
String
)
i
.
get
(
"informationSituation"
)));
});
jsonObject
.
put
(
"tableData"
,
result
);
}
else
{
// 管道逻辑 更新装置、管道有关数据
IdxBizJgProjectContraption
projectContraption
=
idxBizJgProjectContraptionService
.
getById
(
jgUseRegistration
.
getProjectContraptionId
());
jsonObject
.
put
(
"pipelineLength"
,
projectContraption
.
getPipelineLength
());
jsonObject
.
put
(
"projectContraption"
,
projectContraption
.
getProjectContraption
());
jsonObject
.
put
(
"projectContraptionNo"
,
projectContraption
.
getProjectContraptionNo
());
List
<
Map
<
String
,
Object
>>
equList
=
jgUseRegistrationService
.
getBaseMapper
().
queryForUnitPipelineEquipment
(
records
);
// 检验报告数据格式化 转json
equList
.
stream
().
filter
(
e
->
e
.
get
(
"inspectReport"
)
!=
null
).
forEach
(
item
->
item
.
put
(
"inspectReport"
,
JSON
.
parse
(
item
.
get
(
"inspectReport"
).
toString
())));
jsonObject
.
put
(
"tableData"
,
equList
);
}
}
jsonObject
.
put
(
"useRegistrationCode"
,
jgUseRegistration
.
getUseRegistrationCode
());
return
jsonObject
;
}
public
JgRegistrationHistory
getJgRegistrationHistory
(
JgUseRegistration
jgUseRegistration
)
{
LambdaQueryWrapper
<
JgRegistrationHistory
>
lambda
=
new
QueryWrapper
<
JgRegistrationHistory
>().
lambda
();
lambda
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
jgUseRegistration
.
getSequenceNbr
());
lambda
.
eq
(
JgRegistrationHistory:
:
getIsDelete
,
false
);
return
jgUseRegistrationService
.
getJgRegistrationHistoryService
().
getBaseMapper
().
selectOne
(
lambda
);
}
public
void
convertStringToJsonObject
(
Object
obj
,
String
[]
jsonFields
)
{
if
(
obj
instanceof
JSONObject
)
{
JSONObject
jsonObject
=
(
JSONObject
)
obj
;
for
(
String
field
:
jsonFields
)
{
if
(
jsonObject
.
get
(
field
)
!=
null
&&
jsonObject
.
get
(
field
)
instanceof
String
)
{
jsonObject
.
put
(
field
,
JSON
.
parse
(
JSONObject
.
toJSONString
(
jsonObject
.
get
(
field
))));
}
}
}
else
if
(
obj
instanceof
Map
)
{
Map
<
String
,
Object
>
map
=
(
Map
<
String
,
Object
>)
obj
;
for
(
String
field
:
jsonFields
)
{
if
(
map
.
containsKey
(
field
)
&&
map
.
get
(
field
)
instanceof
String
)
{
map
.
put
(
field
,
JSON
.
parse
((
String
)
map
.
get
(
field
)));
}
}
}
else
{
// 处理其他类型
System
.
out
.
println
(
"Unsupported Object Type"
);
}
}
public
Boolean
handleUnitUseRegistrationEdit
(
JSONObject
map
)
{
JgUseRegistration
useRegistration
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
map
),
JgUseRegistration
.
class
);
List
<
Map
<
String
,
Object
>>
equipmentLists
=
(
List
<
Map
<
String
,
Object
>>)
map
.
get
(
"equipmentLists"
);
useRegistration
.
setRegDate
(
new
Date
());
useRegistration
.
setCreateDate
(
new
Date
());
useRegistration
.
setCylinderCategory
(
map
.
getString
(
"cylinderCategory"
));
//气瓶分类
// 接收单位信息
Optional
.
ofNullable
(
useRegistration
.
getReceiveOrgCode
())
.
filter
(
code
->
code
.
contains
(
"_"
))
.
map
(
code
->
code
.
split
(
"_"
))
.
ifPresent
(
splitReceiveOrgCode
->
{
CompanyModel
result
=
Privilege
.
companyClient
.
queryByCompanyCode
(
splitReceiveOrgCode
[
0
]).
getResult
();
useRegistration
.
setReceiveOrgCode
(
splitReceiveOrgCode
[
0
]);
useRegistration
.
setReceiveCompanyOrgCode
(
splitReceiveOrgCode
[
0
]);
useRegistration
.
setReceiveCompanyCode
(
result
.
getCompanyCode
());
useRegistration
.
setReceiveOrgName
(
splitReceiveOrgCode
[
1
]);
});
// 安全管理员
Optional
.
ofNullable
(
map
.
getString
(
"safetyManager"
))
.
filter
(
manager
->
manager
.
contains
(
"_"
))
.
map
(
manager
->
manager
.
split
(
"_"
))
.
ifPresent
(
data
->
{
map
.
put
(
"safetyManagerId"
,
data
[
0
]);
map
.
put
(
"safetyManagerName"
,
data
[
1
]);
});
// 其他附件
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"otherAccessories"
)))
{
useRegistration
.
setOtherAccessories
(
JSONObject
.
toJSONString
(
map
.
get
(
"otherAccessories"
)));
}
if
(
map
.
containsKey
(
"orgBranchCode"
))
{
// 监察处置机构代码
String
[]
splitOrgBranchCode
=
String
.
valueOf
(
map
.
getString
(
"orgBranchCode"
)).
split
(
"_"
);
useRegistration
.
setSupervisionOrgCode
(
splitOrgBranchCode
[
0
]);
}
// 使用地点
Map
<
String
,
List
<
LinkedHashMap
>>
locationMap
=
MapBuilder
.<
String
,
List
<
LinkedHashMap
>>
create
()
.
put
(
"city"
,
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
"CITY"
))
.
put
(
"county"
,
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
"REGION"
))
.
put
(
"factoryUseSiteStreet"
,
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
"STREET"
))
.
build
();
String
fullAddress
=
locationMap
.
entrySet
().
stream
()
.
map
(
entry
->
{
String
mapKey
=
String
.
valueOf
(
map
.
get
(
entry
.
getKey
()));
List
<
LinkedHashMap
>
locations
=
entry
.
getValue
();
return
(!
ObjectUtils
.
isEmpty
(
mapKey
)
&&
!
ObjectUtils
.
isEmpty
(
locations
))
?
locations
.
stream
()
.
filter
(
item
->
mapKey
.
equals
(
String
.
valueOf
(
item
.
get
(
"regionCode"
))))
.
map
(
item
->
String
.
valueOf
(
item
.
get
(
"regionName"
)))
.
findFirst
()
.
orElse
(
""
)
:
""
;
})
.
collect
(
Collectors
.
joining
());
// 具体地址
useRegistration
.
setUseAddress
(
"陕西省"
+
fullAddress
+
map
.
get
(
"address"
));
useRegistration
.
setOriginProjectContraptionIds
((
String
)
map
.
get
(
"originProjectContraptionIds"
));
// 使用登记表
Optional
.
ofNullable
(
map
.
get
(
"useRegistrationFormFile"
))
.
map
(
JSONObject:
:
toJSONString
)
.
ifPresent
(
useRegistration:
:
setUseRegistrationFormFile
);
Map
<
String
,
Object
>
useRegistrationFormUrlMap
=
jgUseRegistrationService
.
getCommonService
().
getRegistrationFormUrl
(
"unit"
,
map
);
Optional
.
ofNullable
(
useRegistrationFormUrlMap
)
.
ifPresent
(
item
->
useRegistration
.
setUseRegistrationFormUrl
(
String
.
valueOf
(
item
.
get
(
"useRegistrationFormUrl"
))));
jgUseRegistrationService
.
updateById
(
useRegistration
);
// 删除设备关联表记录
jgUseRegistrationService
.
getJgUseRegistrationEqService
().
getBaseMapper
().
delete
(
new
QueryWrapper
<
JgUseRegistrationEq
>().
lambda
().
eq
(
JgUseRegistrationEq:
:
getEquipTransferId
,
useRegistration
.
getSequenceNbr
()));
// 更新关联气瓶信息
List
<
JgUseRegistrationEq
>
equipList
=
equipmentLists
.
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
());
// 保存关联设备信息
jgUseRegistrationService
.
getJgUseRegistrationEqService
().
saveBatch
(
equipList
);
return
null
;
}
public
Boolean
beforeCheck
(
Map
<
String
,
Object
>
map
,
String
applyNo
)
{
JgUseRegistration
useRegistration
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
map
),
JgUseRegistration
.
class
);
// 新增登记单位办理校验
if
(
useRegistration
.
getManageType
().
equals
(
"unit"
))
{
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
))
{
throw
new
BadRequest
(
"请选择设备信息!"
);
}
if
(
CylinderTypeEnum
.
CYLINDER
.
getCode
().
equals
(
map
.
get
(
"EQU_CATEGORY_CODE"
)))
{
boolean
hasExistingCertificate
=
jgUseRegistrationService
.
getBaseMapper
().
selectList
(
new
LambdaQueryWrapper
<
JgUseRegistration
>()
.
eq
(
JgUseRegistration:
:
getUseUnitCreditCode
,
useRegistration
.
getUseUnitCreditCode
())
.
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"
))
{
throw
new
BadRequest
(
"该企业已存在气瓶证书,请选择增补功能进行登记!"
);
}
}
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
(
"检验信息不能为空,请完善检验信息后进行登记!"
);
}
});
}
}
// 历史登记台套(无按照单位办理业务)
if
(
useRegistration
.
getRegType
().
equals
(
"1"
))
{
// 使用登记证编号
String
useRegistrationCode
=
String
.
valueOf
(
map
.
get
(
"useOrgCode"
)).
trim
();
String
equipId
=
String
.
valueOf
(
map
.
get
(
"equipId"
));
//校验使用登记证编号的唯一性
Boolean
used
=
jgUseRegistrationService
.
getCommonService
().
useRegistrationCertificateAccountUnique
(
useRegistrationCode
,
equipId
);
if
(
used
)
{
throw
new
BadRequest
(
"使用登记证编号已存在!"
);
}
//使用登记证编号判断是否使用未来系统生成编号
jgUseRegistrationService
.
getIdxBizJgRegisterInfoService
().
checkUseRegistrationCode
(
useRegistrationCode
,
"set"
);
// 场车设备校验车牌号的唯一性
if
(
EquipmentClassifityEnum
.
CC
.
getCode
().
equals
(
map
.
get
(
"EQU_LIST_CODE"
)))
{
String
carNum
=
String
.
valueOf
(
map
.
get
(
carNumber
));
if
(!
"无"
.
equals
(
carNum
))
{
Integer
count
=
idxBizJgRegisterInfoMapper
.
checkCarNumberUniquenessWithHisCC
(
carNumber
,
equipId
);
if
(
count
>
0
)
{
throw
new
BadRequest
(
"车牌号已存在,请重新输入!"
);
}
}
}
}
return
true
;
}
public
Boolean
handleUseRegistrationEdit
(
JSONObject
map
)
{
// 使用登记信息
JgUseRegistration
jgUseRegistration
=
new
JgUseRegistration
();
jgUseRegistration
.
setRecDate
(
new
Date
());
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"otherAccessories"
)))
{
jgUseRegistration
.
setOtherAccessories
(
JSONObject
.
toJSONString
(
map
.
get
(
"otherAccessories"
)));
}
// if (map.containsKey("receiveOrgCode")) {
// // 接收单位信息
// String[] splitMaintenanceUnitCode = String.valueOf(map.getString("receiveOrgCode")).split("_");
// jgUseRegistration.setReceiveCompanyCode(splitMaintenanceUnitCode[0]);
// jgUseRegistration.setReceiveOrgName(splitMaintenanceUnitCode[1]);
// jgUseRegistration.setReceiveCompanyOrgCode(jgUseRegistrationService.commonServiceImpl.getOneCompany(jgUseRegistration.getReceiveCompanyCode()).getOrgCode());
// }
if
(
map
.
containsKey
(
"orgBranchCode"
))
{
// 监察处置机构代码
String
[]
splitOrgBranchCode
=
String
.
valueOf
(
map
.
getString
(
"orgBranchCode"
)).
split
(
"_"
);
jgUseRegistration
.
setSupervisionOrgCode
(
splitOrgBranchCode
[
0
]);
}
// 安全管理员
if
(
map
.
containsKey
(
"safetyManager"
))
{
String
[]
data
=
String
.
valueOf
(
map
.
getString
(
"safetyManager"
)).
split
(
"_"
);
map
.
put
(
"safetyManagerId"
,
data
[
0
]);
map
.
put
(
"safetyManagerName"
,
data
[
1
]);
}
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"inspectUnitCreditCode"
)))
{
jgUseRegistration
.
setInspectUnitCreditCode
(
map
.
get
(
"inspectUnitCreditCode"
).
toString
());
}
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"inspectOrgName"
)))
{
jgUseRegistration
.
setInspectUnitName
(
map
.
get
(
"inspectOrgName"
).
toString
());
}
// 是否西咸
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"isXixian"
)))
{
jgUseRegistration
.
setIsXixian
(
String
.
valueOf
(
map
.
get
(
"isXixian"
)));
}
// 使用地点
// 市
List
<
LinkedHashMap
>
city
=
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
"CITY"
);
// 区
List
<
LinkedHashMap
>
region
=
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
"REGION"
);
// 街道
List
<
LinkedHashMap
>
street
=
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
"STREET"
);
jgUseRegistration
.
setUseAddress
(
"陕西省"
);
// 城市
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"city"
))
&&
!
ObjectUtils
.
isEmpty
(
city
))
{
city
.
forEach
(
item
->
{
if
(
String
.
valueOf
(
item
.
get
(
"regionCode"
)).
equals
(
String
.
valueOf
(
map
.
get
(
"city"
))))
{
jgUseRegistration
.
setUseAddress
(
jgUseRegistration
.
getUseAddress
()
+
item
.
get
(
"regionName"
));
}
});
}
// 区县
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"county"
))
&&
!
ObjectUtils
.
isEmpty
(
city
))
{
region
.
forEach
(
item
->
{
if
(
String
.
valueOf
(
item
.
get
(
"regionCode"
)).
equals
(
String
.
valueOf
(
map
.
get
(
"county"
))))
{
jgUseRegistration
.
setUseAddress
(
jgUseRegistration
.
getUseAddress
()
+
item
.
get
(
"regionName"
));
}
});
}
// 街道
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"factoryUseSiteStreet"
))
&&
!
ObjectUtils
.
isEmpty
(
city
))
{
street
.
forEach
(
item
->
{
if
(
String
.
valueOf
(
item
.
get
(
"regionCode"
)).
equals
(
String
.
valueOf
(
map
.
get
(
"factoryUseSiteStreet"
))))
{
jgUseRegistration
.
setUseAddress
(
jgUseRegistration
.
getUseAddress
()
+
item
.
get
(
"regionName"
));
}
});
}
jgUseRegistration
.
setUseAddress
(
jgUseRegistration
.
getUseAddress
()
+
map
.
get
(
"address"
));
Optional
.
ofNullable
(
map
.
get
(
"useRegistrationFormFile"
))
.
map
(
JSONObject:
:
toJSONString
)
.
ifPresent
(
jgUseRegistration:
:
setUseRegistrationFormFile
);
Map
<
String
,
Object
>
useRegistrationFormUrlMap
=
jgUseRegistrationService
.
getCommonService
().
getRegistrationFormUrl
(
"set"
,
map
);
Optional
.
ofNullable
(
useRegistrationFormUrlMap
)
.
ifPresent
(
item
->
jgUseRegistration
.
setUseRegistrationFormUrl
(
String
.
valueOf
(
item
.
get
(
"useRegistrationFormUrl"
))));
jgUseRegistration
.
setSequenceNbr
(
Long
.
valueOf
(
String
.
valueOf
(
map
.
get
(
"sequenceNbr"
))));
jgUseRegistrationService
.
getBaseMapper
().
updateById
(
jgUseRegistration
);
// 更新设备关联表
LambdaQueryWrapper
<
JgUseRegistrationEq
>
lambda
=
new
QueryWrapper
<
JgUseRegistrationEq
>().
lambda
();
lambda
.
eq
(
JgUseRegistrationEq:
:
getEquipTransferId
,
jgUseRegistration
.
getSequenceNbr
());
JgUseRegistrationEq
jgUseRegistrationEq
=
new
JgUseRegistrationEq
();
jgUseRegistrationEq
.
setEquId
(
map
.
get
(
"equipId"
).
toString
());
jgUseRegistrationService
.
getJgUseRegistrationEqService
().
update
(
jgUseRegistrationEq
,
lambda
);
// 更新历史数据-主要是业务字段(如管理员等没在主表存储)
jgUseRegistrationService
.
updateHistory
(
map
,
map
.
get
(
"equipId"
).
toString
(),
String
.
valueOf
(
jgUseRegistration
.
getSequenceNbr
()),
jgUseRegistration
.
getSupervisoryCode
());
// 历史有证设备登记生成的 编辑时更新使用登记证管理表
jgUseRegistrationService
.
updateRegistrationManage
(
Long
.
valueOf
(
String
.
valueOf
(
map
.
get
(
"sequenceNbr"
))));
return
null
;
}
/**
* 历史台套登记
*
* @param map 提交参数
*/
public
Boolean
handleHistoryEquipEdit
(
JSONObject
map
)
{
// 使用登记证编号
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
CompanyBo
company
=
reginParams
.
getCompany
();
// 使用登记信息
JgUseRegistration
jgUseRegistration
=
new
JgUseRegistration
();
jgUseRegistration
.
setRegDate
(
new
Date
());
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"otherAccessories"
)))
{
jgUseRegistration
.
setOtherAccessories
(
JSONObject
.
toJSONString
(
map
.
get
(
"otherAccessories"
)));
}
if
(
map
.
containsKey
(
"receiveOrgCode"
))
{
// 接收单位信息
String
[]
splitMaintenanceUnitCode
=
String
.
valueOf
(
map
.
getString
(
"receiveOrgCode"
)).
split
(
"_"
);
jgUseRegistration
.
setReceiveCompanyCode
(
splitMaintenanceUnitCode
[
0
]);
jgUseRegistration
.
setReceiveOrgName
(
splitMaintenanceUnitCode
[
1
]);
jgUseRegistration
.
setReceiveCompanyOrgCode
(
jgUseRegistrationService
.
getCommonService
().
getOneCompany
(
jgUseRegistration
.
getReceiveCompanyCode
()).
getOrgCode
());
}
if
(
map
.
containsKey
(
"orgBranchCode"
))
{
// 监察处置机构代码
String
[]
splitOrgBranchCode
=
String
.
valueOf
(
map
.
getString
(
"orgBranchCode"
)).
split
(
"_"
);
jgUseRegistration
.
setSupervisionOrgCode
(
splitOrgBranchCode
[
0
]);
}
// 安全管理员
if
(
map
.
containsKey
(
"safetyManager"
))
{
String
[]
data
=
String
.
valueOf
(
map
.
getString
(
"safetyManager"
)).
split
(
"_"
);
map
.
put
(
"safetyManagerId"
,
data
[
0
]);
map
.
put
(
"safetyManagerName"
,
data
[
1
]);
}
// 使用单位提交
jgUseRegistration
.
setUseUnitName
(
CompanyTypeEnum
.
INDIVIDUAL
.
getName
().
equals
(
company
.
getCompanyType
())
?
company
.
getCompanyName
().
split
(
"_"
)[
1
]
:
company
.
getCompanyName
());
jgUseRegistration
.
setUseUnitCreditCode
(
CompanyTypeEnum
.
INDIVIDUAL
.
getName
().
equals
(
company
.
getCompanyType
())
?
company
.
getCompanyCode
().
split
(
"_"
)[
1
]
:
company
.
getCompanyCode
());
jgUseRegistration
.
setCreateUserId
(
reginParams
.
getUserModel
().
getUserId
());
jgUseRegistration
.
setCreateUserName
(
reginParams
.
getUserModel
().
getUserName
());
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"inspectUnitCreditCode"
)))
{
jgUseRegistration
.
setInspectUnitCreditCode
(
map
.
get
(
"inspectUnitCreditCode"
).
toString
());
}
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"inspectOrgName"
)))
{
jgUseRegistration
.
setInspectUnitName
(
map
.
get
(
"inspectOrgName"
).
toString
());
}
// 是否西咸
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"isXixian"
)))
{
jgUseRegistration
.
setIsXixian
(
String
.
valueOf
(
map
.
get
(
"isXixian"
)));
}
// 使用地点
String
useCityName
=
""
;
String
useCountyName
=
""
;
String
useStreetName
=
""
;
// 市
List
<
LinkedHashMap
>
city
=
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
"CITY"
);
// 区
List
<
LinkedHashMap
>
region
=
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
"REGION"
);
// 街道
List
<
LinkedHashMap
>
street
=
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
"STREET"
);
jgUseRegistration
.
setUseAddress
(
"陕西省"
);
// 城市
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"city"
))
&&
!
ObjectUtils
.
isEmpty
(
city
))
{
JSONObject
finalMap
=
map
;
AtomicReference
<
String
>
atomicUseCity
=
new
AtomicReference
<>(
useCityName
);
city
.
forEach
(
item
->
{
if
(
String
.
valueOf
(
item
.
get
(
"regionCode"
)).
equals
(
String
.
valueOf
(
finalMap
.
get
(
"city"
))))
{
atomicUseCity
.
set
(
""
+
item
.
get
(
"regionName"
));
jgUseRegistration
.
setUseAddress
(
jgUseRegistration
.
getUseAddress
()
+
item
.
get
(
"regionName"
));
}
});
useCityName
=
atomicUseCity
.
get
();
}
// 区县
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"county"
))
&&
!
ObjectUtils
.
isEmpty
(
city
))
{
JSONObject
finalMap1
=
map
;
AtomicReference
<
String
>
atomicUseCounty
=
new
AtomicReference
<>(
useCountyName
);
region
.
forEach
(
item
->
{
if
(
String
.
valueOf
(
item
.
get
(
"regionCode"
)).
equals
(
String
.
valueOf
(
finalMap1
.
get
(
"county"
))))
{
atomicUseCounty
.
set
(
""
+
item
.
get
(
"regionName"
));
jgUseRegistration
.
setUseAddress
(
jgUseRegistration
.
getUseAddress
()
+
item
.
get
(
"regionName"
));
}
});
useCountyName
=
atomicUseCounty
.
get
();
}
// 街道
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"factoryUseSiteStreet"
))
&&
!
ObjectUtils
.
isEmpty
(
city
))
{
JSONObject
finalMap2
=
map
;
AtomicReference
<
String
>
atomicUseStreet
=
new
AtomicReference
<>(
useStreetName
);
street
.
forEach
(
item
->
{
if
(
String
.
valueOf
(
item
.
get
(
"regionCode"
)).
equals
(
String
.
valueOf
(
finalMap2
.
get
(
"factoryUseSiteStreet"
))))
{
atomicUseStreet
.
set
(
""
+
item
.
get
(
"regionName"
));
jgUseRegistration
.
setUseAddress
(
jgUseRegistration
.
getUseAddress
()
+
item
.
get
(
"regionName"
));
}
});
useStreetName
=
atomicUseStreet
.
get
();
}
jgUseRegistration
.
setUseAddress
(
jgUseRegistration
.
getUseAddress
()
+
map
.
get
(
"address"
));
if
(
map
.
containsKey
(
"edit"
)
&&
"1"
.
equals
(
String
.
valueOf
(
map
.
get
(
"edit"
))))
{
jgUseRegistration
.
setUseUnitCreditCode
(
null
);
jgUseRegistration
.
setSequenceNbr
(
Long
.
valueOf
(
String
.
valueOf
(
map
.
get
(
"sequenceNbr"
))));
jgUseRegistrationService
.
getBaseMapper
().
updateById
(
jgUseRegistration
);
// 更新设备关联表
LambdaQueryWrapper
<
JgUseRegistrationEq
>
lambda
=
new
QueryWrapper
<
JgUseRegistrationEq
>().
lambda
();
lambda
.
eq
(
JgUseRegistrationEq:
:
getEquipTransferId
,
jgUseRegistration
.
getSequenceNbr
());
JgUseRegistrationEq
jgUseRegistrationEq
=
new
JgUseRegistrationEq
();
jgUseRegistrationEq
.
setEquId
(
map
.
get
(
"equipId"
).
toString
());
jgUseRegistrationService
.
getJgUseRegistrationEqService
().
update
(
jgUseRegistrationEq
,
lambda
);
}
else
{
// 业务管理设备信息保存
// JgUseRegistrationEq jgRelationEquip = new JgUseRegistrationEq();
// jgRelationEquip.setEquId(map.get("equipId").toString());
// 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());
// jgUseRegistration.setUseRegistrationCode(ValidationUtil.isEmpty(map.get("useOrgCode")) ? "" : String.valueOf(map.get("useOrgCode")));
// jgUseRegistration.setRegType("1");//历史登记
// this.save(jgUseRegistration);
// jgRelationEquip.setEquipTransferId(jgUseRegistration.getSequenceNbr().toString());
// jgRelationEquipMapper.insert(jgRelationEquip);
//
// // 暂存历史表
// updateHistory(map, map.get("equipId").toString(), String.valueOf(jgUseRegistration.getSequenceNbr()), jgUseRegistration.getSupervisoryCode());
//
// //监督管理信息
// LambdaQueryWrapper<IdxBizJgSupervisionInfo> lambdaSup = new QueryWrapper<IdxBizJgSupervisionInfo>().lambda();
// lambdaSup.eq(IdxBizJgSupervisionInfo::getRecord, jgRelationEquip.getEquId());
// IdxBizJgSupervisionInfo supervisionInfo = idxBizJgSupervisionInfoMapper.selectOne(lambdaSup);
// 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);
// 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"));
// registerInfo.setEquCode(equCode);// 设备代码
// registerInfo.setEquPrice(String.valueOf(map.get("equPrice")));
// registerInfo.setProductPhoto(JSONObject.toJSONString(map.get("productPhoto")));
// registerInfo.setOtherAccessoriesReg(JSONObject.toJSONString(map.get("otherAccessoriesReg")));
// registerInfo.setInstallationIsComplete(map.getOrDefault("installationIsComplete", "1").toString());
// if (EquipmentClassifityEnum.CC.getCode().equals(map.get("EQU_LIST_CODE"))) {
// 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);
// designInfo.setDesignUnitCreditCode(MapUtil.getStr(map, "designUnitCreditCode"));
// designInfo.setDesignUnitName(MapUtil.getStr(map, "designUnitName"));
// designInfo.setDesignLicenseNum(MapUtil.getStr(map, "designLicenseNum"));
// designInfo.setDesignUseDate(MapUtil.getStr(map, "designUseDate"));
// designInfo.setDesignDate(!StringUtils.isEmpty(map.get("designDate")) ? DateUtil.parse(String.valueOf(map.get("designDate")), "yyyy-MM-dd") : null);
// designInfo.setDrawingDo(ObjectUtils.isEmpty(map.get("drawingDo")) ? null : String.valueOf(map.get("drawingDo")));
// designInfo.setAppraisalUnit(ObjectUtils.isEmpty(map.get("appraisalUnit")) ? null : String.valueOf(map.get("appraisalUnit")));
// designInfo.setAppraisalDate(ObjectUtils.isEmpty(map.get("appraisalDate")) ? null : String.valueOf(map.get("appraisalDate")));
// designInfo.setDesignDoc(JSONObject.toJSONString(map.get("designDoc")));
// 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);
// idxBizJgFactoryInfo.setProduceUnitCreditCode(MapUtil.getStr(map, "produceUnitCreditCode"));
// idxBizJgFactoryInfo.setProduceUnitName(MapUtil.getStr(map, "produceUnitName"));
// idxBizJgFactoryInfo.setFactoryNum(MapUtil.getStr(map, "factoryNum"));
// idxBizJgFactoryInfo.setProduceLicenseNum(MapUtil.getStr(map, "produceLicenseNum"));
// idxBizJgFactoryInfo.setProduceDate(!StringUtils.isEmpty(map.get("produceDate")) ? DateUtil.parse(String.valueOf(map.get("produceDate")), "yyyy-MM-dd") : null);
// idxBizJgFactoryInfo.setImported(ObjectUtils.isEmpty(map.get("imported")) ? null : String.valueOf(map.get("imported")));
// idxBizJgFactoryInfo.setProduceCountry(ObjectUtils.isEmpty(map.get("produceCountry")) ? null : String.valueOf(map.get("produceCountry")));
// idxBizJgFactoryInfo.setOtherAccessoriesFact(ObjectUtils.isEmpty(map.get("otherAccessoriesFact")) ? null : JSONObject.toJSONString(map.get("otherAccessoriesFact")));
// idxBizJgFactoryInfo.setProductQualityYieldProve(JSONObject.toJSONString(map.get("productQualityYieldProve")));
// idxBizJgFactoryInfo.setInsUseMaintainExplain(ObjectUtils.isEmpty(map.get("insUseMaintainExplain")) ? null : JSONObject.toJSONString(map.get("insUseMaintainExplain")));
// idxBizJgFactoryInfo.setFactoryStandard(ObjectUtils.isEmpty(map.get("factoryStandard")) ? null : JSONObject.toJSONString(map.get("factoryStandard")));
// 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);
// useInfo.setIsIntoManagement(Boolean.TRUE);
// useInfo.setUseUnitCreditCode(String.valueOf(map.get("useUnitCreditCode")));
// useInfo.setUseUnitName(String.valueOf(map.get("useUnitName")));
// useInfo.setProvince("610000");
// useInfo.setProvinceName("陕西省");
// useInfo.setCity(String.valueOf(map.get("city")));
// useInfo.setCityName(useCityName);
// useInfo.setCounty(String.valueOf(map.get("county")));
// useInfo.setCountyName(useCountyName);
// useInfo.setFactoryUseSiteStreet(String.valueOf(map.get("factoryUseSiteStreet")));
// 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.setPhone(String.valueOf(map.get("phone")));
// useInfo.setSafetyManager(String.valueOf(map.get("safetyManager")).split("_")[1]);
// useInfo.setUseDate(String.valueOf(map.get("useDate")));
// useInfo.setLongitudeLatitude(JSON.toJSONString(map.get("longitudeLatitude")));
// useInfo.setUsePlace((String) map.get("usePlace"));
// useInfo.setOldUseRegistrationTable(JSON.toJSONString(map.get("oldUseRegistrationTable")));
// useInfo.setOldUseRegistrationCertificate(JSON.toJSONString(map.get("oldUseRegistrationCertificate")));
// useInfo.setORegDate(String.valueOf(map.get("oRegDate")));
// useInfo.setORegUnit(String.valueOf(map.get("oRegUnit")));
// // 历史平台登记,将设备状态改为在用
// useInfo.setEquState(EquimentEnum.ZAIYONG.getCode().toString());
// String 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"));
// IdxBizJgOtherInfo otherInfo = otherInfoMapper.selectOne(otherLambda);
//
// // 检验检测【一对多,暂时只取最新一条数据】
// IdxBizJgInspectionDetectionInfo inspectionDetectionInfo = iIdxBizJgInspectionDetectionInfoService.queryNewestDetailByRecord(String.valueOf(map.get("equipId")));
// if (ObjectUtils.isEmpty(inspectionDetectionInfo.getSequenceNbr())) {
// inspectionDetectionInfo.setRecord((String) map.get("equipId"));
// }
// inspectionDetectionInfo.setInspectOrgCode(MapUtil.getStr(map, "inspectOrgCode"));
// inspectionDetectionInfo.setInspectOrgName(MapUtil.getStr(map, "inspectOrgName"));
// inspectionDetectionInfo.setInspectConclusion(MapUtil.getStr(map, "inspectConclusion"));
// inspectionDetectionInfo.setInspectType(MapUtil.getStr(map, "inspectType"));
// inspectionDetectionInfo.setInspectDate(!StringUtils.isEmpty(map.get("inspectDate")) ? DateUtil.parse(String.valueOf(map.get("inspectDate")), "yyyy-MM-dd") : null);
// inspectionDetectionInfo.setInspectStaff(MapUtil.getStr(map, "inspectStaff"));
// inspectionDetectionInfo.setNextInspectDate(!StringUtils.isEmpty(map.get("nextInspectDate")) ? DateUtil.parse(String.valueOf(map.get("nextInspectDate")), "yyyy-MM-dd") : null);
// inspectionDetectionInfo.setInspectReport(JSONObject.toJSONString(map.get("inspectReport")));
// inspectionDetectionInfo.setInspectReportNo(String.valueOf(map.get("inspectReportNo")));
// iIdxBizJgInspectionDetectionInfoService.saveOrUpdateData(inspectionDetectionInfo);
//
// // 生成监管码 96333码
// this.createCode(map, jgUseRegistration, registerInfo, useInfo, otherInfo);
// map.put("equCode", equCode);
// // 更新es
// this.updateEsData2(usePlace, map, otherInfo, useInfo, jgUseRegistration, map);
// this.updateById(jgUseRegistration);
//
// // 设备安装信息更新
// this.historyEquUpdateInstallInfo(map);
//
// // 设备维保信息更新,只有电梯
// if ("3000".equals(map.get("equList")) || "3000".equals(map.get("equListCode"))) {
// this.historyEquUpdateMaintenanceInfo(map);
// }
//
// // 历史设备 生成证书管理表记录 & 生成安装 维保等操作记录
// this.historyEquGenManageRelated(map, jgUseRegistration, registerInfo, idxBizJgFactoryInfo);
}
return
null
;
}
public
void
updateBizInfo
(
Map
<
String
,
Object
>
changeData
)
{
JgUseRegistration
useRegistration
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
changeData
),
JgUseRegistration
.
class
);
String
actionKey
=
StringUtils
.
isEmpty
(
useRegistration
.
getRegType
())
?
""
:
useRegistration
.
getRegType
()
+
"-"
+
useRegistration
.
getManageType
();
Function
<
JSONObject
,
Boolean
>
h
=
bizHandlers
.
getOrDefault
(
actionKey
,
this
::
handleUseRegistrationEdit
);
h
.
apply
((
new
JSONObject
(
changeData
)));
}
public
List
<
FieldChangeMeta
>
updEqData
(
String
applyNo
,
JSONObject
data
)
{
JgUseRegistration
jgUseRegistration
=
jgUseRegistrationService
.
getOne
(
new
LambdaQueryWrapper
<
JgUseRegistration
>().
eq
(
JgUseRegistration:
:
getApplyNo
,
applyNo
));
String
useOrgCode
=
jgUseRegistration
.
getUseRegistrationCode
();
JSONObject
hisData
=
jgUseRegistrationService
.
getHisData
(
jgUseRegistration
);
// todo 多线程时大量数据加载到内存,内存可能会爆 需要优化服务内只存一份
// 市
List
<
LinkedHashMap
>
city
=
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
"CITY"
);
// 区
List
<
LinkedHashMap
>
region
=
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
"REGION"
);
// 街道
List
<
LinkedHashMap
>
street
=
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
"STREET"
);
IdxBizJgUseInfo
useInfoOld
=
jgUseRegistrationService
.
getUseInfoMapper
().
selectOne
(
new
LambdaQueryWrapper
<
IdxBizJgUseInfo
>().
eq
(
IdxBizJgUseInfo:
:
getRecord
,
data
.
getString
(
"equipId"
)));
IdxBizJgUseInfo
useInfoNew
=
BeanUtil
.
copyProperties
(
useInfoOld
,
IdxBizJgUseInfo
.
class
);
BeanUtil
.
copyProperties
(
hisData
,
useInfoNew
);
useInfoNew
.
setIsNotXiXian
(
hisData
.
getString
(
"isXixian"
));
// 城市
if
(!
ObjectUtils
.
isEmpty
(
hisData
.
get
(
"city"
))
&&
!
ObjectUtils
.
isEmpty
(
city
))
{
city
.
forEach
(
item
->
{
if
(
String
.
valueOf
(
item
.
get
(
"regionCode"
)).
equals
(
String
.
valueOf
(
hisData
.
get
(
"city"
))))
{
useInfoNew
.
setCityName
(
String
.
valueOf
(
item
.
get
(
"regionName"
)));
}
});
}
// 区县
if
(!
ObjectUtils
.
isEmpty
(
hisData
.
get
(
"county"
))
&&
!
ObjectUtils
.
isEmpty
(
region
))
{
region
.
forEach
(
item
->
{
if
(
String
.
valueOf
(
item
.
get
(
"regionCode"
)).
equals
(
String
.
valueOf
(
hisData
.
get
(
"county"
))))
{
useInfoNew
.
setCountyName
(
String
.
valueOf
(
item
.
get
(
"regionName"
)));
}
});
}
// 街道
if
(!
ObjectUtils
.
isEmpty
(
hisData
.
get
(
"factoryUseSiteStreet"
))
&&
!
ObjectUtils
.
isEmpty
(
street
))
{
street
.
forEach
(
item
->
{
if
(
String
.
valueOf
(
item
.
get
(
"regionCode"
)).
equals
(
String
.
valueOf
(
hisData
.
get
(
"factoryUseSiteStreet"
))))
{
useInfoNew
.
setStreetName
(
String
.
valueOf
(
item
.
get
(
"regionName"
)));
}
});
}
// 安全管理员名称
useInfoNew
.
setSafetyManager
(
hisData
.
getString
(
"safetyManagerName"
));
useInfoNew
.
setProvince
(
"610000"
);
useInfoNew
.
setProvinceName
(
"陕西省"
);
// 产权单位信息
if
(
hisData
.
containsKey
(
"estateUnitName"
))
{
String
[]
estateUnit
=
String
.
valueOf
(
hisData
.
getString
(
"estateUnitName"
)).
split
(
"_"
);
useInfoNew
.
setEstateUnitCreditCode
(
estateUnit
[
0
]);
useInfoNew
.
setEstateUnitName
(
estateUnit
[
1
]);
}
// 更新使用信息及日志比较生成
List
<
FieldChangeMeta
>
useInfoFieldChangeMetas
=
commonEquipDataProcessService
.
simpleTrackAndUpdate
(
jgUseRegistrationService
.
getUseInfoMapper
(),
useInfoOld
,
useInfoNew
,
useInfoNew
.
getRecord
(),
"record"
,
useInfoNew
.
getRecord
());
List
<
FieldChangeMeta
>
fieldChangeMetas
=
new
ArrayList
<>(
useInfoFieldChangeMetas
);
// todo 更新检验检测信息 原有业务系统要改造在审核完成时更新json时 把jySeq写上
IdxBizJgInspectionDetectionInfo
inspectionDetectionInfoOld
=
jgUseRegistrationService
.
getInspectionDetectionInfoService
().
getById
(
hisData
.
getLong
(
"jySeq"
));
if
(
inspectionDetectionInfoOld
==
null
){
inspectionDetectionInfoOld
=
jgUseRegistrationService
.
getInspectionDetectionInfoService
().
queryNewestDetailByRecord
(
useInfoNew
.
getRecord
());
}
IdxBizJgInspectionDetectionInfo
inspectionDetectionInfoNew
=
BeanUtil
.
copyProperties
(
inspectionDetectionInfoOld
,
IdxBizJgInspectionDetectionInfo
.
class
);
BeanUtil
.
copyProperties
(
hisData
,
inspectionDetectionInfoNew
);
List
<
FieldChangeMeta
>
inspectionFieldChangeMetas
=
commonEquipDataProcessService
.
simpleTrackAndUpdate
(
jgUseRegistrationService
.
getInspectionDetectionInfoService
().
getBaseMapper
(),
inspectionDetectionInfoOld
,
inspectionDetectionInfoNew
,
useInfoNew
.
getRecord
(),
"SEQUENCE_NBR"
,
inspectionDetectionInfoOld
.
getSequenceNbr
());
fieldChangeMetas
.
addAll
(
inspectionFieldChangeMetas
);
// 更新注册登记信息表
IdxBizJgRegisterInfo
registerInfoOld
=
jgUseRegistrationService
.
getIdxBizJgRegisterInfoService
().
getOne
(
new
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>().
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
data
.
getString
(
"equipId"
)));
IdxBizJgRegisterInfo
registerInfoNew
=
BeanUtil
.
copyProperties
(
registerInfoOld
,
IdxBizJgRegisterInfo
.
class
);
registerInfoNew
.
setCylinderCategory
(
hisData
.
getString
(
"cylinderCategory"
));
registerInfoNew
.
setUseOrgCode
(
useOrgCode
);
List
<
FieldChangeMeta
>
registerInfoFieldChangeMetas
=
commonEquipDataProcessService
.
simpleTrackAndUpdate
(
jgUseRegistrationService
.
getIdxBizJgRegisterInfoService
().
getBaseMapper
(),
registerInfoOld
,
registerInfoNew
,
useInfoNew
.
getRecord
(),
"record"
,
useInfoNew
.
getRecord
());
fieldChangeMetas
.
addAll
(
registerInfoFieldChangeMetas
);
// 更新设备监管部门
if
(
hisData
.
containsKey
(
"orgBranchCode"
)
&&
!
ObjectUtils
.
isEmpty
(
hisData
.
get
(
"orgBranchCode"
)))
{
IdxBizJgSupervisionInfo
idxBizJgSupervisionInfoOld
=
jgUseRegistrationService
.
getIdxBizJgSupervisionInfoMapper
().
selectOne
(
new
LambdaQueryWrapper
<
IdxBizJgSupervisionInfo
>().
eq
(
IdxBizJgSupervisionInfo:
:
getRecord
,
data
.
getString
(
"equipId"
)));
IdxBizJgSupervisionInfo
idxBizJgSupervisionInfNew
=
BeanUtil
.
copyProperties
(
idxBizJgSupervisionInfoOld
,
IdxBizJgSupervisionInfo
.
class
);
String
[]
orgBranch
=
String
.
valueOf
(
hisData
.
getString
(
"orgBranchCode"
)).
split
(
"_"
);
idxBizJgSupervisionInfNew
.
setOrgBranchCode
(
orgBranch
[
0
]);
idxBizJgSupervisionInfNew
.
setOrgBranchName
(
orgBranch
[
1
]);
idxBizJgSupervisionInfNew
.
setCompanyOrgBranchCode
(
commonMapper
.
geCompanyCodeByOrgCode
(
orgBranch
[
0
]));
List
<
FieldChangeMeta
>
supervisionInfoFieldChangeMetas
=
commonEquipDataProcessService
.
simpleTrackAndUpdate
(
jgUseRegistrationService
.
getIdxBizJgSupervisionInfoMapper
(),
idxBizJgSupervisionInfoOld
,
idxBizJgSupervisionInfNew
,
useInfoNew
.
getRecord
(),
"record"
,
useInfoNew
.
getRecord
());
fieldChangeMetas
.
addAll
(
supervisionInfoFieldChangeMetas
);
}
if
(
"2"
.
equals
(
jgUseRegistration
.
getRegType
())
&&
"3000"
.
equals
(
hisData
.
getString
(
"equList"
)))
{
IdxBizJgMaintenanceRecordInfo
idxBizJgMaintenanceRecordInfoOld
=
jgUseRegistrationService
.
getIdxBizJgMaintenanceRecordInfoService
().
queryNewestDetailByRecord
(
useInfoNew
.
getRecord
());
// 电梯处理维保信息
IdxBizJgMaintenanceRecordInfo
idxBizJgMaintenanceRecordInfoNew
=
new
IdxBizJgMaintenanceRecordInfo
();
BeanUtil
.
copyProperties
(
idxBizJgMaintenanceRecordInfoOld
,
idxBizJgMaintenanceRecordInfoNew
);
BeanUtil
.
copyProperties
(
jgUseRegistrationService
.
buildIdxBizJgMaintenanceRecordInfo
(
hisData
),
idxBizJgMaintenanceRecordInfoNew
);
idxBizJgMaintenanceRecordInfoNew
.
setSequenceNbr
(
idxBizJgMaintenanceRecordInfoOld
.
getSequenceNbr
());
idxBizJgMaintenanceRecordInfoNew
.
setRecord
(
idxBizJgMaintenanceRecordInfoOld
.
getRecord
());
List
<
FieldChangeMeta
>
supervisionInfoFieldChangeMetas
=
commonEquipDataProcessService
.
simpleTrackAndUpdate
(
jgUseRegistrationService
.
getIdxBizJgMaintenanceRecordInfoService
().
getBaseMapper
(),
idxBizJgMaintenanceRecordInfoOld
,
idxBizJgMaintenanceRecordInfoNew
,
useInfoNew
.
getRecord
(),
"SEQUENCE_NBR"
,
idxBizJgMaintenanceRecordInfoOld
.
getSequenceNbr
());
fieldChangeMetas
.
addAll
(
supervisionInfoFieldChangeMetas
);
jgUseRegistrationService
.
historyEquUpdateMaintenanceInfo
(
hisData
);
}
// 历史无证可编辑安装信息
if
(
"2"
.
equals
(
jgUseRegistration
.
getRegType
()))
{
IdxBizJgConstructionInfo
constructionInfoOld
=
jgUseRegistrationService
.
getIdxBizJgConstructionInfoService
().
queryNewestDetailByRecord
(
String
.
valueOf
(
hisData
.
get
(
"equipId"
)));
IdxBizJgConstructionInfo
constructionInfoNew
=
BeanUtil
.
copyProperties
(
constructionInfoOld
,
IdxBizJgConstructionInfo
.
class
);
if
(!
ValidationUtil
.
isEmpty
(
constructionInfoOld
.
getSequenceNbr
()))
{
constructionInfoNew
.
setUscUnitName
(
ValidationUtil
.
isEmpty
(
hisData
.
get
(
"uscUnitName"
))
?
null
:
String
.
valueOf
(
hisData
.
get
(
"uscUnitName"
)));
constructionInfoNew
.
setConstructionLeaderName
(
ValidationUtil
.
isEmpty
(
hisData
.
get
(
"installLeaderId"
))
?
null
:
String
.
valueOf
(
hisData
.
get
(
"installLeaderId"
)));
constructionInfoNew
.
setConstructionLeaderPhone
(
ValidationUtil
.
isEmpty
(
hisData
.
get
(
"installLeaderPhone"
))
?
null
:
String
.
valueOf
(
hisData
.
get
(
"installLeaderPhone"
)));
constructionInfoNew
.
setProxyStatementAttachment
(
ValidationUtil
.
isEmpty
(
hisData
.
get
(
"proxyStatementAttachmentList"
))
?
null
:
JSONObject
.
toJSONString
(
hisData
.
get
(
"proxyStatementAttachmentList"
)));
constructionInfoNew
.
setConstructionContractAttachment
(
ValidationUtil
.
isEmpty
(
hisData
.
get
(
"installContractAttachment"
))
?
null
:
JSONObject
.
toJSONString
(
hisData
.
get
(
"installContractAttachment"
)));
constructionInfoNew
.
setConstructionOtherAccessories
(
ValidationUtil
.
isEmpty
(
hisData
.
get
(
"insOtherAccessories"
))
?
null
:
JSONObject
.
toJSONString
(
hisData
.
get
(
"insOtherAccessories"
)));
try
{
constructionInfoNew
.
setUscDate
(
ValidationUtil
.
isEmpty
(
hisData
.
get
(
"installStartDate"
))
?
null
:
DateUtils
.
dateParse
((
String
)
hisData
.
get
(
"installStartDate"
),
DateUtils
.
DATE_PATTERN
));
}
catch
(
ParseException
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
BadRequest
(
"安装日期时间转化错误"
);
}
List
<
FieldChangeMeta
>
constructionInfoFieldChangeMetas
=
commonEquipDataProcessService
.
simpleTrackAndUpdate
(
jgUseRegistrationService
.
getIdxBizJgConstructionInfoService
().
getBaseMapper
(),
constructionInfoOld
,
constructionInfoNew
,
useInfoNew
.
getRecord
(),
"SEQUENCE_NBR"
,
constructionInfoOld
.
getSequenceNbr
());
fieldChangeMetas
.
addAll
(
constructionInfoFieldChangeMetas
);
}
}
return
fieldChangeMetas
;
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/process/equip/BatchCylinderEquipChangeProcess.java
View file @
5073faf2
...
@@ -28,10 +28,10 @@ public class BatchCylinderEquipChangeProcess implements IEquipChangeDataProcessS
...
@@ -28,10 +28,10 @@ public class BatchCylinderEquipChangeProcess implements IEquipChangeDataProcessS
@Override
@Override
public
List
<
ChangeDataDto
>
handle
(
Map
<
String
,
Object
>
changeData
,
String
defaultChangeId
)
{
public
List
<
FieldChangeMeta
>
handle
(
Map
<
String
,
Object
>
changeData
,
String
defaultChangeId
)
{
JSONObject
data
=
(
JSONObject
)
changeData
;
JSONObject
data
=
(
JSONObject
)
changeData
;
JSONArray
equips
=
data
.
getJSONArray
(
RequestChangeData
.
multiDataKey
);
JSONArray
equips
=
data
.
getJSONArray
(
RequestChangeData
.
multiDataKey
);
List
<
ChangeDataDto
>
allChangeColumns
=
new
ArrayList
<>();
List
<
FieldChangeMeta
>
allChangeColumns
=
new
ArrayList
<>();
List
<
MultiChangeItemData
>
items
=
equips
.
toJavaList
(
MultiChangeItemData
.
class
);
List
<
MultiChangeItemData
>
items
=
equips
.
toJavaList
(
MultiChangeItemData
.
class
);
// 校验
// 校验
items
.
forEach
(
item
->
{
items
.
forEach
(
item
->
{
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/process/equip/BatchEquipChangeProcess.java
→
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/process/equip/BatchEquip
Data
ChangeProcess.java
View file @
5073faf2
...
@@ -17,21 +17,21 @@ import java.util.Map;
...
@@ -17,21 +17,21 @@ import java.util.Map;
* 批量维护设备-策略实现类
* 批量维护设备-策略实现类
*/
*/
@Component
@Component
public
class
BatchEquipData
Equip
ChangeProcess
implements
IEquipChangeDataProcessStrategy
{
public
class
BatchEquipDataChangeProcess
implements
IEquipChangeDataProcessStrategy
{
private
final
CommonEquipDataProcessService
commonEquipDataProcessService
;
private
final
CommonEquipDataProcessService
commonEquipDataProcessService
;
public
BatchEquipData
Equip
ChangeProcess
(
CommonEquipDataProcessService
commonEquipDataProcessService
)
{
public
BatchEquipDataChangeProcess
(
CommonEquipDataProcessService
commonEquipDataProcessService
)
{
this
.
commonEquipDataProcessService
=
commonEquipDataProcessService
;
this
.
commonEquipDataProcessService
=
commonEquipDataProcessService
;
}
}
@Override
@Override
public
List
<
ChangeDataDto
>
handle
(
Map
<
String
,
Object
>
changeData
,
String
defaultChangeId
)
{
public
List
<
FieldChangeMeta
>
handle
(
Map
<
String
,
Object
>
changeData
,
String
defaultChangeId
)
{
JSONObject
data
=
(
JSONObject
)
changeData
;
JSONObject
data
=
(
JSONObject
)
changeData
;
JSONArray
equips
=
data
.
getJSONArray
(
RequestChangeData
.
multiDataKey
);
JSONArray
equips
=
data
.
getJSONArray
(
RequestChangeData
.
multiDataKey
);
List
<
ChangeDataDto
>
allChangeColumns
=
new
ArrayList
<>();
List
<
FieldChangeMeta
>
allChangeColumns
=
new
ArrayList
<>();
List
<
MultiChangeItemData
>
items
=
equips
.
toJavaList
(
MultiChangeItemData
.
class
);
List
<
MultiChangeItemData
>
items
=
equips
.
toJavaList
(
MultiChangeItemData
.
class
);
// 校验
// 校验
items
.
forEach
(
item
->
{
items
.
forEach
(
item
->
{
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/process/equip/BatchProjectEquipChangeProcess.java
View file @
5073faf2
...
@@ -29,10 +29,10 @@ public class BatchProjectEquipChangeProcess implements IEquipChangeDataProcessSt
...
@@ -29,10 +29,10 @@ public class BatchProjectEquipChangeProcess implements IEquipChangeDataProcessSt
@Override
@Override
public
List
<
ChangeDataDto
>
handle
(
Map
<
String
,
Object
>
changeData
,
String
defaultChangeId
)
{
public
List
<
FieldChangeMeta
>
handle
(
Map
<
String
,
Object
>
changeData
,
String
defaultChangeId
)
{
JSONObject
data
=
(
JSONObject
)
changeData
;
JSONObject
data
=
(
JSONObject
)
changeData
;
JSONArray
projectContraptions
=
data
.
getJSONArray
(
RequestChangeData
.
multiDataKey
);
JSONArray
projectContraptions
=
data
.
getJSONArray
(
RequestChangeData
.
multiDataKey
);
List
<
ChangeDataDto
>
allChangeColumns
=
new
ArrayList
<>();
List
<
FieldChangeMeta
>
allChangeColumns
=
new
ArrayList
<>();
// 装置列表
// 装置列表
List
<
ProjectContraptionChangeItem
>
projectContraptionsJavaList
=
projectContraptions
.
toJavaList
(
ProjectContraptionChangeItem
.
class
);
List
<
ProjectContraptionChangeItem
>
projectContraptionsJavaList
=
projectContraptions
.
toJavaList
(
ProjectContraptionChangeItem
.
class
);
// 入库前校验
// 入库前校验
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/process/equip/CommonEquipDataProcessService.java
View file @
5073faf2
...
@@ -6,7 +6,10 @@ import cn.hutool.core.date.DateUtil;
...
@@ -6,7 +6,10 @@ import cn.hutool.core.date.DateUtil;
import
cn.hutool.core.text.CharSequenceUtil
;
import
cn.hutool.core.text.CharSequenceUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.biz.common.annotation.FieldDisplayDefine
;
import
com.yeejoin.amos.boot.biz.common.annotation.FieldDisplayDefine
;
import
com.yeejoin.amos.boot.biz.common.annotation.Group
;
import
com.yeejoin.amos.boot.biz.common.annotation.Group
;
import
com.yeejoin.amos.boot.module.jg.api.dto.*
;
import
com.yeejoin.amos.boot.module.jg.api.dto.*
;
...
@@ -30,6 +33,7 @@ import java.util.function.Function;
...
@@ -30,6 +33,7 @@ import java.util.function.Function;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
edit
.
core
.
SubClassFinder
.
getAllSubClasses
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
edit
.
core
.
SubClassFinder
.
getAllSubClasses
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
edit
.
utils
.
ReflectiveFieldAccessor
.
getAllFields
;
@Component
@Component
@RequiredArgsConstructor
@RequiredArgsConstructor
...
@@ -67,7 +71,6 @@ public class CommonEquipDataProcessService {
...
@@ -67,7 +71,6 @@ public class CommonEquipDataProcessService {
private
final
IdxBizJgOtherInfoMapper
idxBizJgOtherInfoMapper
;
private
final
IdxBizJgOtherInfoMapper
idxBizJgOtherInfoMapper
;
@PostConstruct
@PostConstruct
public
void
init
()
{
public
void
init
()
{
Set
<
Class
<?
extends
BaseChangeDataDto
>>
subClasses
=
getAllSubClasses
();
Set
<
Class
<?
extends
BaseChangeDataDto
>>
subClasses
=
getAllSubClasses
();
...
@@ -83,7 +86,7 @@ public class CommonEquipDataProcessService {
...
@@ -83,7 +86,7 @@ public class CommonEquipDataProcessService {
}
}
}
}
public
<
T
extends
BaseChangeDataDto
>
T
castMap2Bean
(
Map
<
String
,
Object
>
map
,
Class
<
T
>
clazz
)
{
public
static
<
T
extends
BaseChangeDataDto
>
T
castMap2Bean
(
Map
<
String
,
Object
>
map
,
Class
<
T
>
clazz
)
{
try
{
try
{
T
t
=
clazz
.
newInstance
();
T
t
=
clazz
.
newInstance
();
BeanUtil
.
copyProperties
(
JSON
.
parse
(
JSONObject
.
toJSONString
(
map
)),
t
,
true
);
BeanUtil
.
copyProperties
(
JSON
.
parse
(
JSONObject
.
toJSONString
(
map
)),
t
,
true
);
...
@@ -113,46 +116,46 @@ public class CommonEquipDataProcessService {
...
@@ -113,46 +116,46 @@ public class CommonEquipDataProcessService {
}
}
public
void
buildChangeFields
(
String
record
,
EquipDesignChangeDataDto
equipDesignChangeDataDto
,
EquipFactoryChangeDataDto
equipFactoryChangeDataDto
,
EquipRegisterChangeDataDto
registerChangeDataDto
,
EquipOtherInfoChangeDataDto
otherInfoChangeDataDto
,
EquipUseInfoChangeDataDto
useInfoChangeDataDto
,
List
<
ChangeDataDto
>
allChangeColumns
)
{
public
void
buildChangeFields
(
String
record
,
EquipDesignChangeDataDto
equipDesignChangeDataDto
,
EquipFactoryChangeDataDto
equipFactoryChangeDataDto
,
EquipRegisterChangeDataDto
registerChangeDataDto
,
EquipOtherInfoChangeDataDto
otherInfoChangeDataDto
,
EquipUseInfoChangeDataDto
useInfoChangeDataDto
,
List
<
FieldChangeMeta
>
allChangeColumns
)
{
// 构造新对象行转列
// 构造新对象行转列
List
<
ChangeDataDto
>
designInfoNew
=
this
.
buildDesignInfoNew
(
equipDesignChangeDataDto
,
record
);
List
<
FieldChangeMeta
>
designInfoNew
=
this
.
buildDesignInfoNew
(
equipDesignChangeDataDto
,
record
);
List
<
ChangeDataDto
>
factoryInfoNew
=
this
.
buildFactoryInfoNew
(
equipFactoryChangeDataDto
,
record
);
List
<
FieldChangeMeta
>
factoryInfoNew
=
this
.
buildFactoryInfoNew
(
equipFactoryChangeDataDto
,
record
);
List
<
ChangeDataDto
>
registerInfoNew
=
this
.
buildRegisterInfoNew
(
registerChangeDataDto
,
record
);
List
<
FieldChangeMeta
>
registerInfoNew
=
this
.
buildRegisterInfoNew
(
registerChangeDataDto
,
record
);
if
(
useInfoChangeDataDto
!=
null
)
{
if
(
useInfoChangeDataDto
!=
null
)
{
List
<
ChangeDataDto
>
useInfoNew
=
this
.
convertBeanField2Column2
(
useInfoChangeDataDto
,
record
);
List
<
FieldChangeMeta
>
useInfoNew
=
convertBeanField2Column2
(
useInfoChangeDataDto
,
record
);
List
<
ChangeDataDto
>
useInfoOld
=
this
.
buildUseInfoOld
(
record
);
List
<
FieldChangeMeta
>
useInfoOld
=
this
.
buildUseInfoOld
(
record
);
allChangeColumns
.
addAll
(
this
.
mergeChangeFields
(
useInfoNew
,
useInfoOld
));
allChangeColumns
.
addAll
(
mergeChangeFields
(
useInfoNew
,
useInfoOld
));
}
}
if
(
otherInfoChangeDataDto
!=
null
)
{
if
(
otherInfoChangeDataDto
!=
null
)
{
List
<
ChangeDataDto
>
otherInfoNew
=
this
.
convertBeanField2Column2
(
otherInfoChangeDataDto
,
record
);
List
<
FieldChangeMeta
>
otherInfoNew
=
convertBeanField2Column2
(
otherInfoChangeDataDto
,
record
);
List
<
ChangeDataDto
>
otherInfoOld
=
this
.
buildOtherInfoOld
(
record
);
List
<
FieldChangeMeta
>
otherInfoOld
=
this
.
buildOtherInfoOld
(
record
);
allChangeColumns
.
addAll
(
this
.
mergeChangeFields
(
otherInfoNew
,
otherInfoOld
));
allChangeColumns
.
addAll
(
mergeChangeFields
(
otherInfoNew
,
otherInfoOld
));
}
}
// 老数据查询行转列
// 老数据查询行转列
List
<
ChangeDataDto
>
designInfoOld
=
this
.
buildDesignInfoOld
(
record
);
List
<
FieldChangeMeta
>
designInfoOld
=
this
.
buildDesignInfoOld
(
record
);
List
<
ChangeDataDto
>
factoryInfoOld
=
this
.
buildFactoryInfoOld
(
record
);
List
<
FieldChangeMeta
>
factoryInfoOld
=
this
.
buildFactoryInfoOld
(
record
);
List
<
ChangeDataDto
>
registerInfoOld
=
this
.
buildRegisterInfoOld
(
record
);
List
<
FieldChangeMeta
>
registerInfoOld
=
this
.
buildRegisterInfoOld
(
record
);
allChangeColumns
.
addAll
(
this
.
mergeChangeFields
(
designInfoNew
,
designInfoOld
));
allChangeColumns
.
addAll
(
mergeChangeFields
(
designInfoNew
,
designInfoOld
));
allChangeColumns
.
addAll
(
this
.
mergeChangeFields
(
factoryInfoNew
,
factoryInfoOld
));
allChangeColumns
.
addAll
(
mergeChangeFields
(
factoryInfoNew
,
factoryInfoOld
));
allChangeColumns
.
addAll
(
this
.
mergeChangeFields
(
registerInfoNew
,
registerInfoOld
));
allChangeColumns
.
addAll
(
mergeChangeFields
(
registerInfoNew
,
registerInfoOld
));
}
}
public
void
buildChangeFields
(
String
record
,
EquipDesignChangeDataDto
equipDesignChangeDataDto
,
EquipFactoryChangeDataDto
equipFactoryChangeDataDto
,
EquipRegisterChangeDataDto
registerChangeDataDto
,
EquipUseInfoChangeDataDto
useInfoChangeDataDto
,
List
<
ChangeDataDto
>
allChangeColumns
)
{
public
void
buildChangeFields
(
String
record
,
EquipDesignChangeDataDto
equipDesignChangeDataDto
,
EquipFactoryChangeDataDto
equipFactoryChangeDataDto
,
EquipRegisterChangeDataDto
registerChangeDataDto
,
EquipUseInfoChangeDataDto
useInfoChangeDataDto
,
List
<
FieldChangeMeta
>
allChangeColumns
)
{
// 构造新对象行转列
// 构造新对象行转列
List
<
ChangeDataDto
>
designInfoNew
=
this
.
convertBeanField2Column2
(
equipDesignChangeDataDto
,
record
);
List
<
FieldChangeMeta
>
designInfoNew
=
convertBeanField2Column2
(
equipDesignChangeDataDto
,
record
);
List
<
ChangeDataDto
>
factoryInfoNew
=
this
.
convertBeanField2Column2
(
equipFactoryChangeDataDto
,
record
);
List
<
FieldChangeMeta
>
factoryInfoNew
=
convertBeanField2Column2
(
equipFactoryChangeDataDto
,
record
);
List
<
ChangeDataDto
>
registerInfoNew
=
this
.
convertBeanField2Column2
(
registerChangeDataDto
,
record
);
List
<
FieldChangeMeta
>
registerInfoNew
=
convertBeanField2Column2
(
registerChangeDataDto
,
record
);
List
<
ChangeDataDto
>
useInfoChangeNew
=
this
.
convertBeanField2Column2
(
useInfoChangeDataDto
,
record
);
List
<
FieldChangeMeta
>
useInfoChangeNew
=
convertBeanField2Column2
(
useInfoChangeDataDto
,
record
);
// 老数据查询行转列
// 老数据查询行转列
List
<
ChangeDataDto
>
designInfoOld
=
this
.
buildDesignInfoOld
(
record
);
List
<
FieldChangeMeta
>
designInfoOld
=
this
.
buildDesignInfoOld
(
record
);
List
<
ChangeDataDto
>
factoryInfoOld
=
this
.
buildFactoryInfoOld
(
record
);
List
<
FieldChangeMeta
>
factoryInfoOld
=
this
.
buildFactoryInfoOld
(
record
);
List
<
ChangeDataDto
>
registerInfoOld
=
this
.
buildRegisterInfoOld
(
record
);
List
<
FieldChangeMeta
>
registerInfoOld
=
this
.
buildRegisterInfoOld
(
record
);
List
<
ChangeDataDto
>
useInfoOld
=
this
.
buildUseInfoOld
(
record
);
List
<
FieldChangeMeta
>
useInfoOld
=
this
.
buildUseInfoOld
(
record
);
allChangeColumns
.
addAll
(
this
.
mergeChangeFields
(
designInfoNew
,
designInfoOld
));
allChangeColumns
.
addAll
(
mergeChangeFields
(
designInfoNew
,
designInfoOld
));
allChangeColumns
.
addAll
(
this
.
mergeChangeFields
(
factoryInfoNew
,
factoryInfoOld
));
allChangeColumns
.
addAll
(
mergeChangeFields
(
factoryInfoNew
,
factoryInfoOld
));
allChangeColumns
.
addAll
(
this
.
mergeChangeFields
(
registerInfoNew
,
registerInfoOld
));
allChangeColumns
.
addAll
(
mergeChangeFields
(
registerInfoNew
,
registerInfoOld
));
allChangeColumns
.
addAll
(
this
.
mergeChangeFields
(
useInfoChangeNew
,
useInfoOld
));
allChangeColumns
.
addAll
(
mergeChangeFields
(
useInfoChangeNew
,
useInfoOld
));
}
}
/**
/**
...
@@ -201,8 +204,8 @@ public class CommonEquipDataProcessService {
...
@@ -201,8 +204,8 @@ public class CommonEquipDataProcessService {
}
}
public
List
<
ChangeDataDto
>
mergeChangeFields
(
List
<
ChangeDataDto
>
changeDataNew
,
List
<
ChangeDataDto
>
changeDataOld
)
{
public
static
List
<
FieldChangeMeta
>
mergeChangeFields
(
List
<
FieldChangeMeta
>
changeDataNew
,
List
<
FieldChangeMeta
>
changeDataOld
)
{
Map
<
String
,
ChangeDataDto
>
oldKv
=
changeDataOld
.
stream
().
collect
(
Collectors
.
toMap
(
ChangeDataDto
:
:
getColumnKey
,
Function
.
identity
()));
Map
<
String
,
FieldChangeMeta
>
oldKv
=
changeDataOld
.
stream
().
collect
(
Collectors
.
toMap
(
FieldChangeMeta
:
:
getColumnKey
,
Function
.
identity
()));
changeDataNew
.
forEach
(
o
->
{
changeDataNew
.
forEach
(
o
->
{
// 正常不会出现此情况,old数据 大于等于 new 数据的key
// 正常不会出现此情况,old数据 大于等于 new 数据的key
if
(
oldKv
.
get
(
o
.
getColumnKey
())
!=
null
)
{
if
(
oldKv
.
get
(
o
.
getColumnKey
())
!=
null
)
{
...
@@ -275,7 +278,7 @@ public class CommonEquipDataProcessService {
...
@@ -275,7 +278,7 @@ public class CommonEquipDataProcessService {
}
}
void
updateTechParamInfo
(
EquipRegisterChangeDataDto
equipRegisterChangeDataDto
,
String
record
,
Map
<
String
,
Object
>
changeData
,
List
<
ChangeDataDto
>
allChange
)
{
void
updateTechParamInfo
(
EquipRegisterChangeDataDto
equipRegisterChangeDataDto
,
String
record
,
Map
<
String
,
Object
>
changeData
,
List
<
FieldChangeMeta
>
allChange
)
{
EquipmentClassifityEnum
equipmentClassifityEnum
=
EquipmentClassifityEnum
.
getOne
(
equipRegisterChangeDataDto
.
getEquList
());
EquipmentClassifityEnum
equipmentClassifityEnum
=
EquipmentClassifityEnum
.
getOne
(
equipRegisterChangeDataDto
.
getEquList
());
switch
(
Objects
.
requireNonNull
(
equipmentClassifityEnum
))
{
switch
(
Objects
.
requireNonNull
(
equipmentClassifityEnum
))
{
case
GL:
case
GL:
...
@@ -283,10 +286,10 @@ public class CommonEquipDataProcessService {
...
@@ -283,10 +286,10 @@ public class CommonEquipDataProcessService {
TechParamsBoilerChangeFieldDto
newBoiler
=
getTechParamsBoilerChangeField
(
changeData
);
TechParamsBoilerChangeFieldDto
newBoiler
=
getTechParamsBoilerChangeField
(
changeData
);
TechParamsBoilerChangeFieldDto
oldBoiler
=
getTechParamsBoilerChangeField
(
record
);
TechParamsBoilerChangeFieldDto
oldBoiler
=
getTechParamsBoilerChangeField
(
record
);
// 字段行转列
// 字段行转列
List
<
ChangeDataDto
>
boilerChangeDataNew
=
this
.
convertBeanField2Column2
(
newBoiler
,
record
);
List
<
FieldChangeMeta
>
boilerChangeDataNew
=
convertBeanField2Column2
(
newBoiler
,
record
);
List
<
ChangeDataDto
>
boilerChangeDataOld
=
this
.
convertBeanField2Column2
(
oldBoiler
,
record
);
List
<
FieldChangeMeta
>
boilerChangeDataOld
=
convertBeanField2Column2
(
oldBoiler
,
record
);
// 比对
// 比对
List
<
ChangeDataDto
>
boilerChangeFields
=
this
.
mergeChangeFields
(
boilerChangeDataNew
,
boilerChangeDataOld
);
List
<
FieldChangeMeta
>
boilerChangeFields
=
mergeChangeFields
(
boilerChangeDataNew
,
boilerChangeDataOld
);
// 业务处理
// 业务处理
equipChangeDataUpdateServiceImpl
.
updateTechParamByRecord
(
this
.
buildTableName
(
TechParamsBoilerChangeFieldDto
.
class
),
record
,
boilerChangeFields
);
equipChangeDataUpdateServiceImpl
.
updateTechParamByRecord
(
this
.
buildTableName
(
TechParamsBoilerChangeFieldDto
.
class
),
record
,
boilerChangeFields
);
// 日志数据记录
// 日志数据记录
...
@@ -299,10 +302,10 @@ public class CommonEquipDataProcessService {
...
@@ -299,10 +302,10 @@ public class CommonEquipDataProcessService {
IdxBizJgTechParamsVessel
techParamsVessel
=
iIdxBizJgTechParamsVesselService
.
getOneData
(
record
);
IdxBizJgTechParamsVessel
techParamsVessel
=
iIdxBizJgTechParamsVesselService
.
getOneData
(
record
);
TechParamsVesselChangeFieldDto
oldVessel
=
BeanUtil
.
copyProperties
(
techParamsVessel
,
TechParamsVesselChangeFieldDto
.
class
);
TechParamsVesselChangeFieldDto
oldVessel
=
BeanUtil
.
copyProperties
(
techParamsVessel
,
TechParamsVesselChangeFieldDto
.
class
);
// 字段行转列
// 字段行转列
List
<
ChangeDataDto
>
newVesselChangeData
=
this
.
convertBeanField2Column2
(
newVessel
,
record
);
List
<
FieldChangeMeta
>
newVesselChangeData
=
convertBeanField2Column2
(
newVessel
,
record
);
List
<
ChangeDataDto
>
oldVesselChangeData
=
this
.
convertBeanField2Column2
(
oldVessel
,
record
);
List
<
FieldChangeMeta
>
oldVesselChangeData
=
convertBeanField2Column2
(
oldVessel
,
record
);
// 比对
// 比对
List
<
ChangeDataDto
>
vesselChangeFields
=
this
.
mergeChangeFields
(
newVesselChangeData
,
oldVesselChangeData
);
List
<
FieldChangeMeta
>
vesselChangeFields
=
mergeChangeFields
(
newVesselChangeData
,
oldVesselChangeData
);
// 业务处理
// 业务处理
equipChangeDataUpdateServiceImpl
.
updateTechParamByRecord
(
this
.
buildTableName
(
TechParamsVesselChangeFieldDto
.
class
),
record
,
vesselChangeFields
);
equipChangeDataUpdateServiceImpl
.
updateTechParamByRecord
(
this
.
buildTableName
(
TechParamsVesselChangeFieldDto
.
class
),
record
,
vesselChangeFields
);
// 日志数据记录
// 日志数据记录
...
@@ -316,10 +319,10 @@ public class CommonEquipDataProcessService {
...
@@ -316,10 +319,10 @@ public class CommonEquipDataProcessService {
IdxBizJgTechParamsElevator
techParamsElevator
=
iIdxBizJgTechParamsElevatorService
.
getOneData
(
record
);
IdxBizJgTechParamsElevator
techParamsElevator
=
iIdxBizJgTechParamsElevatorService
.
getOneData
(
record
);
TechParamsElevatorChangeFieldDto
oldElevator
=
BeanUtil
.
copyProperties
(
techParamsElevator
,
TechParamsElevatorChangeFieldDto
.
class
);
TechParamsElevatorChangeFieldDto
oldElevator
=
BeanUtil
.
copyProperties
(
techParamsElevator
,
TechParamsElevatorChangeFieldDto
.
class
);
// 字段行转列
// 字段行转列
List
<
ChangeDataDto
>
newElevatorChangeData
=
this
.
convertBeanField2Column2
(
newElevator
,
record
);
List
<
FieldChangeMeta
>
newElevatorChangeData
=
convertBeanField2Column2
(
newElevator
,
record
);
List
<
ChangeDataDto
>
oldElevatorChangeData
=
this
.
convertBeanField2Column2
(
oldElevator
,
record
);
List
<
FieldChangeMeta
>
oldElevatorChangeData
=
convertBeanField2Column2
(
oldElevator
,
record
);
// 比对
// 比对
List
<
ChangeDataDto
>
elevatorChangeFields
=
this
.
mergeChangeFields
(
newElevatorChangeData
,
oldElevatorChangeData
);
List
<
FieldChangeMeta
>
elevatorChangeFields
=
mergeChangeFields
(
newElevatorChangeData
,
oldElevatorChangeData
);
// 业务处理
// 业务处理
equipChangeDataUpdateServiceImpl
.
updateTechParamByRecord
(
this
.
buildTableName
(
TechParamsElevatorChangeFieldDto
.
class
),
record
,
elevatorChangeFields
);
equipChangeDataUpdateServiceImpl
.
updateTechParamByRecord
(
this
.
buildTableName
(
TechParamsElevatorChangeFieldDto
.
class
),
record
,
elevatorChangeFields
);
// 日志数据记录
// 日志数据记录
...
@@ -334,10 +337,10 @@ public class CommonEquipDataProcessService {
...
@@ -334,10 +337,10 @@ public class CommonEquipDataProcessService {
// 技术参数对象转换为全部技术参数 ,其他无用字段去掉
// 技术参数对象转换为全部技术参数 ,其他无用字段去掉
TechParamsLiftingChangeFieldDto
oldLifting
=
BeanUtil
.
copyProperties
(
techParamsLifting
,
TechParamsLiftingChangeFieldDto
.
class
);
TechParamsLiftingChangeFieldDto
oldLifting
=
BeanUtil
.
copyProperties
(
techParamsLifting
,
TechParamsLiftingChangeFieldDto
.
class
);
// 字段行转列
// 字段行转列
List
<
ChangeDataDto
>
newLiftingChangeData
=
this
.
convertBeanField2Column2
(
newLifting
,
record
);
List
<
FieldChangeMeta
>
newLiftingChangeData
=
convertBeanField2Column2
(
newLifting
,
record
);
List
<
ChangeDataDto
>
oldLiftingChangeData
=
this
.
convertBeanField2Column2
(
oldLifting
,
record
);
List
<
FieldChangeMeta
>
oldLiftingChangeData
=
convertBeanField2Column2
(
oldLifting
,
record
);
// 比对
// 比对
List
<
ChangeDataDto
>
liftingChangeFields
=
this
.
mergeChangeFields
(
newLiftingChangeData
,
oldLiftingChangeData
);
List
<
FieldChangeMeta
>
liftingChangeFields
=
mergeChangeFields
(
newLiftingChangeData
,
oldLiftingChangeData
);
// 业务处理
// 业务处理
equipChangeDataUpdateServiceImpl
.
updateTechParamByRecord
(
this
.
buildTableName
(
TechParamsLiftingChangeFieldDto
.
class
),
record
,
liftingChangeFields
);
equipChangeDataUpdateServiceImpl
.
updateTechParamByRecord
(
this
.
buildTableName
(
TechParamsLiftingChangeFieldDto
.
class
),
record
,
liftingChangeFields
);
// 日志数据记录
// 日志数据记录
...
@@ -351,10 +354,10 @@ public class CommonEquipDataProcessService {
...
@@ -351,10 +354,10 @@ public class CommonEquipDataProcessService {
IdxBizJgTechParamsVehicle
techParamsVehicle
=
iIdxBizJgTechParamsVehicleService
.
getOneData
(
record
);
IdxBizJgTechParamsVehicle
techParamsVehicle
=
iIdxBizJgTechParamsVehicleService
.
getOneData
(
record
);
TechParamsVehicleChangeFieldDto
oldVehicle
=
BeanUtil
.
copyProperties
(
techParamsVehicle
,
TechParamsVehicleChangeFieldDto
.
class
);
TechParamsVehicleChangeFieldDto
oldVehicle
=
BeanUtil
.
copyProperties
(
techParamsVehicle
,
TechParamsVehicleChangeFieldDto
.
class
);
// 字段行转列
// 字段行转列
List
<
ChangeDataDto
>
newVehicleChangeData
=
this
.
convertBeanField2Column2
(
newVehicle
,
record
);
List
<
FieldChangeMeta
>
newVehicleChangeData
=
convertBeanField2Column2
(
newVehicle
,
record
);
List
<
ChangeDataDto
>
oldVehicleChangeData
=
this
.
convertBeanField2Column2
(
oldVehicle
,
record
);
List
<
FieldChangeMeta
>
oldVehicleChangeData
=
convertBeanField2Column2
(
oldVehicle
,
record
);
// 比对
// 比对
List
<
ChangeDataDto
>
vehicleChangeFields
=
this
.
mergeChangeFields
(
newVehicleChangeData
,
oldVehicleChangeData
);
List
<
FieldChangeMeta
>
vehicleChangeFields
=
mergeChangeFields
(
newVehicleChangeData
,
oldVehicleChangeData
);
// 业务处理
// 业务处理
equipChangeDataUpdateServiceImpl
.
updateTechParamByRecord
(
this
.
buildTableName
(
TechParamsVehicleChangeFieldDto
.
class
),
record
,
vehicleChangeFields
);
equipChangeDataUpdateServiceImpl
.
updateTechParamByRecord
(
this
.
buildTableName
(
TechParamsVehicleChangeFieldDto
.
class
),
record
,
vehicleChangeFields
);
// 日志数据记录
// 日志数据记录
...
@@ -369,10 +372,10 @@ public class CommonEquipDataProcessService {
...
@@ -369,10 +372,10 @@ public class CommonEquipDataProcessService {
// 技术参数对象转换为全部技术参数 ,其他无用字段去掉
// 技术参数对象转换为全部技术参数 ,其他无用字段去掉
TechParamsRidesChangeFieldDto
oldRides
=
BeanUtil
.
copyProperties
(
techParamsRides
,
TechParamsRidesChangeFieldDto
.
class
);
TechParamsRidesChangeFieldDto
oldRides
=
BeanUtil
.
copyProperties
(
techParamsRides
,
TechParamsRidesChangeFieldDto
.
class
);
// 字段行转列
// 字段行转列
List
<
ChangeDataDto
>
newRidesChangeData
=
this
.
convertBeanField2Column2
(
newRides
,
record
);
List
<
FieldChangeMeta
>
newRidesChangeData
=
convertBeanField2Column2
(
newRides
,
record
);
List
<
ChangeDataDto
>
oldRidesChangeData
=
this
.
convertBeanField2Column2
(
oldRides
,
record
);
List
<
FieldChangeMeta
>
oldRidesChangeData
=
convertBeanField2Column2
(
oldRides
,
record
);
// 比对
// 比对
List
<
ChangeDataDto
>
ridesChangeFields
=
this
.
mergeChangeFields
(
newRidesChangeData
,
oldRidesChangeData
);
List
<
FieldChangeMeta
>
ridesChangeFields
=
mergeChangeFields
(
newRidesChangeData
,
oldRidesChangeData
);
// 业务处理
// 业务处理
equipChangeDataUpdateServiceImpl
.
updateTechParamByRecord
(
this
.
buildTableName
(
TechParamsRidesChangeFieldDto
.
class
),
record
,
ridesChangeFields
);
equipChangeDataUpdateServiceImpl
.
updateTechParamByRecord
(
this
.
buildTableName
(
TechParamsRidesChangeFieldDto
.
class
),
record
,
ridesChangeFields
);
// 日志数据记录
// 日志数据记录
...
@@ -393,10 +396,10 @@ public class CommonEquipDataProcessService {
...
@@ -393,10 +396,10 @@ public class CommonEquipDataProcessService {
// 技术参数对象转换为全部技术参数 ,其他无用字段去掉
// 技术参数对象转换为全部技术参数 ,其他无用字段去掉
TechParamsRopewayChangeFieldDto
oldRopeway
=
BeanUtil
.
copyProperties
(
techParamsRopeway
,
TechParamsRopewayChangeFieldDto
.
class
);
TechParamsRopewayChangeFieldDto
oldRopeway
=
BeanUtil
.
copyProperties
(
techParamsRopeway
,
TechParamsRopewayChangeFieldDto
.
class
);
// 字段行转列
// 字段行转列
List
<
ChangeDataDto
>
newRopewayChangeData
=
this
.
convertBeanField2Column2
(
newRopeway
,
record
);
List
<
FieldChangeMeta
>
newRopewayChangeData
=
convertBeanField2Column2
(
newRopeway
,
record
);
List
<
ChangeDataDto
>
oldRopewayChangeData
=
this
.
convertBeanField2Column2
(
oldRopeway
,
record
);
List
<
FieldChangeMeta
>
oldRopewayChangeData
=
convertBeanField2Column2
(
oldRopeway
,
record
);
// 比对
// 比对
List
<
ChangeDataDto
>
ropewayChangeFields
=
this
.
mergeChangeFields
(
newRopewayChangeData
,
oldRopewayChangeData
);
List
<
FieldChangeMeta
>
ropewayChangeFields
=
mergeChangeFields
(
newRopewayChangeData
,
oldRopewayChangeData
);
// 业务处理
// 业务处理
equipChangeDataUpdateServiceImpl
.
updateTechParamByRecord
(
this
.
buildTableName
(
TechParamsRopewayChangeFieldDto
.
class
),
record
,
ropewayChangeFields
);
equipChangeDataUpdateServiceImpl
.
updateTechParamByRecord
(
this
.
buildTableName
(
TechParamsRopewayChangeFieldDto
.
class
),
record
,
ropewayChangeFields
);
// 日志数据记录
// 日志数据记录
...
@@ -407,23 +410,23 @@ public class CommonEquipDataProcessService {
...
@@ -407,23 +410,23 @@ public class CommonEquipDataProcessService {
}
}
}
}
public
void
savePieLineTechParam
(
String
record
,
List
<
ChangeDataDto
>
allChange
,
TechParamsPipelineChangeFieldDto
newPipeline
)
{
public
void
savePieLineTechParam
(
String
record
,
List
<
FieldChangeMeta
>
allChange
,
TechParamsPipelineChangeFieldDto
newPipeline
)
{
IdxBizJgTechParamsPipeline
techParamsPipeline
=
iIdxBizJgTechParamsPipelineService
.
getOneData
(
record
);
IdxBizJgTechParamsPipeline
techParamsPipeline
=
iIdxBizJgTechParamsPipelineService
.
getOneData
(
record
);
// 技术参数对象转换为全部技术参数 ,其他无用字段去掉
// 技术参数对象转换为全部技术参数 ,其他无用字段去掉
TechParamsPipelineChangeFieldDto
oldPipeline
=
BeanUtil
.
copyProperties
(
techParamsPipeline
,
TechParamsPipelineChangeFieldDto
.
class
);
TechParamsPipelineChangeFieldDto
oldPipeline
=
BeanUtil
.
copyProperties
(
techParamsPipeline
,
TechParamsPipelineChangeFieldDto
.
class
);
// 字段行转列
// 字段行转列
List
<
ChangeDataDto
>
newPipelineChangeData
=
this
.
convertBeanField2Column2
(
newPipeline
,
record
);
List
<
FieldChangeMeta
>
newPipelineChangeData
=
convertBeanField2Column2
(
newPipeline
,
record
);
List
<
ChangeDataDto
>
oldPipelineChangeData
=
this
.
convertBeanField2Column2
(
oldPipeline
,
record
);
List
<
FieldChangeMeta
>
oldPipelineChangeData
=
convertBeanField2Column2
(
oldPipeline
,
record
);
// 比对
// 比对
List
<
ChangeDataDto
>
pipelineChangeFields
=
this
.
mergeChangeFields
(
newPipelineChangeData
,
oldPipelineChangeData
);
List
<
FieldChangeMeta
>
pipelineChangeFields
=
mergeChangeFields
(
newPipelineChangeData
,
oldPipelineChangeData
);
// 业务处理
// 业务处理
equipChangeDataUpdateServiceImpl
.
updateTechParamByRecord
(
this
.
buildTableName
(
TechParamsPipelineChangeFieldDto
.
class
),
record
,
pipelineChangeFields
);
equipChangeDataUpdateServiceImpl
.
updateTechParamByRecord
(
this
.
buildTableName
(
TechParamsPipelineChangeFieldDto
.
class
),
record
,
pipelineChangeFields
);
// 日志数据记录
// 日志数据记录
allChange
.
addAll
(
pipelineChangeFields
);
allChange
.
addAll
(
pipelineChangeFields
);
}
}
public
List
<
ChangeDataDto
>
convertBeanField2Column2
(
Object
beanData
,
String
changeId
)
{
public
static
List
<
FieldChangeMeta
>
convertBeanField2Column2
(
Object
beanData
,
String
changeId
)
{
List
<
ChangeDataDto
>
changeData
=
new
ArrayList
<>();
List
<
FieldChangeMeta
>
changeData
=
new
ArrayList
<>();
Group
group
=
beanData
.
getClass
().
getAnnotation
(
Group
.
class
);
Group
group
=
beanData
.
getClass
().
getAnnotation
(
Group
.
class
);
Field
[]
fields
=
beanData
.
getClass
().
getDeclaredFields
();
Field
[]
fields
=
beanData
.
getClass
().
getDeclaredFields
();
for
(
Field
field
:
fields
)
{
for
(
Field
field
:
fields
)
{
...
@@ -432,22 +435,22 @@ public class CommonEquipDataProcessService {
...
@@ -432,22 +435,22 @@ public class CommonEquipDataProcessService {
try
{
try
{
if
(
displayDefine
!=
null
&&
displayDefine
.
isExist
())
{
if
(
displayDefine
!=
null
&&
displayDefine
.
isExist
())
{
String
fieldName
=
displayDefine
.
value
();
String
fieldName
=
displayDefine
.
value
();
ChangeDataDto
changeDataDto
=
new
ChangeDataDto
();
FieldChangeMeta
fieldChangeMeta
=
new
FieldChangeMeta
();
changeDataDto
.
setColumnKey
(
field
.
getName
());
fieldChangeMeta
.
setColumnKey
(
field
.
getName
());
changeDataDto
.
setColumnFamily
(
group
.
value
());
fieldChangeMeta
.
setColumnFamily
(
group
.
value
());
changeDataDto
.
setColumnLabel
(
fieldName
);
fieldChangeMeta
.
setColumnLabel
(
fieldName
);
changeDataDto
.
setChangeId
(
changeId
);
fieldChangeMeta
.
setChangeId
(
changeId
);
Object
oV
=
field
.
get
(
beanData
);
Object
oV
=
field
.
get
(
beanData
);
if
(
oV
instanceof
String
)
{
if
(
oV
instanceof
String
)
{
String
value
=
(
String
)
field
.
get
(
beanData
);
String
value
=
(
String
)
field
.
get
(
beanData
);
changeDataDto
.
setColumnNewValue
(
value
);
fieldChangeMeta
.
setColumnNewValue
(
value
);
changeDataDto
.
setColumnOldValue
(
value
);
fieldChangeMeta
.
setColumnOldValue
(
value
);
}
else
if
(
oV
instanceof
Number
)
{
}
else
if
(
oV
instanceof
Number
)
{
String
value
=
String
.
valueOf
(
field
.
get
(
beanData
));
String
value
=
String
.
valueOf
(
field
.
get
(
beanData
));
changeDataDto
.
setColumnNewValue
(
value
);
fieldChangeMeta
.
setColumnNewValue
(
value
);
changeDataDto
.
setColumnOldValue
(
value
);
fieldChangeMeta
.
setColumnOldValue
(
value
);
}
}
changeData
.
add
(
changeDataDto
);
changeData
.
add
(
fieldChangeMeta
);
}
}
}
catch
(
IllegalAccessException
e
)
{
}
catch
(
IllegalAccessException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
...
@@ -456,46 +459,46 @@ public class CommonEquipDataProcessService {
...
@@ -456,46 +459,46 @@ public class CommonEquipDataProcessService {
return
changeData
;
return
changeData
;
}
}
public
List
<
ChangeDataDto
>
buildDesignInfoNew
(
Object
changeDataDto
,
String
record
)
{
public
List
<
FieldChangeMeta
>
buildDesignInfoNew
(
Object
changeDataDto
,
String
record
)
{
return
this
.
convertBeanField2Column2
(
changeDataDto
,
record
);
return
convertBeanField2Column2
(
changeDataDto
,
record
);
}
}
private
List
<
ChangeDataDto
>
buildFactoryInfoNew
(
EquipFactoryChangeDataDto
changeDataDto
,
String
record
)
{
private
List
<
FieldChangeMeta
>
buildFactoryInfoNew
(
EquipFactoryChangeDataDto
changeDataDto
,
String
record
)
{
return
this
.
convertBeanField2Column2
(
changeDataDto
,
record
);
return
convertBeanField2Column2
(
changeDataDto
,
record
);
}
}
private
List
<
ChangeDataDto
>
buildRegisterInfoNew
(
EquipRegisterChangeDataDto
changeDataDto
,
String
record
)
{
private
List
<
FieldChangeMeta
>
buildRegisterInfoNew
(
EquipRegisterChangeDataDto
changeDataDto
,
String
record
)
{
return
this
.
convertBeanField2Column2
(
changeDataDto
,
record
);
return
convertBeanField2Column2
(
changeDataDto
,
record
);
}
}
public
List
<
ChangeDataDto
>
buildDesignInfoOld
(
String
record
)
{
public
List
<
FieldChangeMeta
>
buildDesignInfoOld
(
String
record
)
{
EquipDesignChangeDataDto
changeDataDto
=
new
EquipDesignChangeDataDto
();
EquipDesignChangeDataDto
changeDataDto
=
new
EquipDesignChangeDataDto
();
IdxBizJgDesignInfo
designInfo
=
idxBizJgDesignInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
IdxBizJgDesignInfo
>().
eq
(
IdxBizJgDesignInfo:
:
getRecord
,
record
));
IdxBizJgDesignInfo
designInfo
=
idxBizJgDesignInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
IdxBizJgDesignInfo
>().
eq
(
IdxBizJgDesignInfo:
:
getRecord
,
record
));
BeanUtil
.
copyProperties
(
designInfo
,
changeDataDto
);
BeanUtil
.
copyProperties
(
designInfo
,
changeDataDto
);
changeDataDto
.
setDesignDate
(
DateUtil
.
formatDate
(
designInfo
.
getDesignDate
()));
changeDataDto
.
setDesignDate
(
DateUtil
.
formatDate
(
designInfo
.
getDesignDate
()));
return
this
.
convertBeanField2Column2
(
changeDataDto
,
record
);
return
convertBeanField2Column2
(
changeDataDto
,
record
);
}
}
private
List
<
ChangeDataDto
>
buildFactoryInfoOld
(
String
record
)
{
private
List
<
FieldChangeMeta
>
buildFactoryInfoOld
(
String
record
)
{
EquipFactoryChangeDataDto
changeDataDto
=
new
EquipFactoryChangeDataDto
();
EquipFactoryChangeDataDto
changeDataDto
=
new
EquipFactoryChangeDataDto
();
IdxBizJgFactoryInfo
factoryInfo
=
jgFactoryInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
IdxBizJgFactoryInfo
>().
eq
(
IdxBizJgFactoryInfo:
:
getRecord
,
record
));
IdxBizJgFactoryInfo
factoryInfo
=
jgFactoryInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
IdxBizJgFactoryInfo
>().
eq
(
IdxBizJgFactoryInfo:
:
getRecord
,
record
));
BeanUtil
.
copyProperties
(
factoryInfo
,
changeDataDto
);
BeanUtil
.
copyProperties
(
factoryInfo
,
changeDataDto
);
changeDataDto
.
setProduceDate
(
DateUtil
.
formatDate
(
factoryInfo
.
getProduceDate
()));
changeDataDto
.
setProduceDate
(
DateUtil
.
formatDate
(
factoryInfo
.
getProduceDate
()));
return
this
.
convertBeanField2Column2
(
changeDataDto
,
record
);
return
convertBeanField2Column2
(
changeDataDto
,
record
);
}
}
private
List
<
ChangeDataDto
>
buildRegisterInfoOld
(
String
record
)
{
private
List
<
FieldChangeMeta
>
buildRegisterInfoOld
(
String
record
)
{
EquipRegisterChangeDataDto
changeDataDto
=
new
EquipRegisterChangeDataDto
();
EquipRegisterChangeDataDto
changeDataDto
=
new
EquipRegisterChangeDataDto
();
IdxBizJgRegisterInfo
registerInfo
=
idxBizJgRegisterInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>().
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
record
));
IdxBizJgRegisterInfo
registerInfo
=
idxBizJgRegisterInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>().
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
record
));
BeanUtil
.
copyProperties
(
registerInfo
,
changeDataDto
);
BeanUtil
.
copyProperties
(
registerInfo
,
changeDataDto
);
return
this
.
convertBeanField2Column2
(
changeDataDto
,
record
);
return
convertBeanField2Column2
(
changeDataDto
,
record
);
}
}
private
List
<
ChangeDataDto
>
buildUseInfoOld
(
String
record
)
{
private
List
<
FieldChangeMeta
>
buildUseInfoOld
(
String
record
)
{
EquipUseInfoChangeDataDto
changeDataDto
=
new
EquipUseInfoChangeDataDto
();
EquipUseInfoChangeDataDto
changeDataDto
=
new
EquipUseInfoChangeDataDto
();
IdxBizJgUseInfo
useInfo
=
idxBizJgUseInfoService
.
getOneData
(
record
);
IdxBizJgUseInfo
useInfo
=
idxBizJgUseInfoService
.
getOneData
(
record
);
BeanUtil
.
copyProperties
(
useInfo
,
changeDataDto
);
BeanUtil
.
copyProperties
(
useInfo
,
changeDataDto
);
return
this
.
convertBeanField2Column2
(
changeDataDto
,
record
);
return
convertBeanField2Column2
(
changeDataDto
,
record
);
}
}
...
@@ -547,34 +550,95 @@ public class CommonEquipDataProcessService {
...
@@ -547,34 +550,95 @@ public class CommonEquipDataProcessService {
}
}
public
void
buildInspectChangeFields
(
String
record
,
EquipInspectChangeDataDto
inspectChangeDataDto
,
List
<
ChangeDataDto
>
allChangeColumns
)
{
public
void
buildInspectChangeFields
(
String
record
,
EquipInspectChangeDataDto
inspectChangeDataDto
,
List
<
FieldChangeMeta
>
allChangeColumns
)
{
if
(
StringUtils
.
isNotEmpty
(
inspectChangeDataDto
.
getJySeq
()))
{
if
(
StringUtils
.
isNotEmpty
(
inspectChangeDataDto
.
getJySeq
()))
{
Map
<
String
,
Object
>
oldData
=
jgUseRegistrationService
.
getInspectDetail
(
inspectChangeDataDto
.
getJySeq
());
Map
<
String
,
Object
>
oldData
=
jgUseRegistrationService
.
getInspectDetail
(
inspectChangeDataDto
.
getJySeq
());
EquipInspectChangeDataDto
inspectChangeDataOld
=
new
EquipInspectChangeDataDto
();
EquipInspectChangeDataDto
inspectChangeDataOld
=
new
EquipInspectChangeDataDto
();
BeanUtil
.
copyProperties
(
oldData
,
inspectChangeDataOld
);
BeanUtil
.
copyProperties
(
oldData
,
inspectChangeDataOld
);
List
<
ChangeDataDto
>
newChangeFields
=
this
.
convertBeanField2Column2
(
inspectChangeDataDto
,
record
);
List
<
FieldChangeMeta
>
newChangeFields
=
convertBeanField2Column2
(
inspectChangeDataDto
,
record
);
List
<
ChangeDataDto
>
oldChangeFields
=
this
.
convertBeanField2Column2
(
inspectChangeDataOld
,
record
);
List
<
FieldChangeMeta
>
oldChangeFields
=
convertBeanField2Column2
(
inspectChangeDataOld
,
record
);
allChangeColumns
.
addAll
(
this
.
mergeChangeFields
(
newChangeFields
,
oldChangeFields
));
allChangeColumns
.
addAll
(
mergeChangeFields
(
newChangeFields
,
oldChangeFields
));
}
else
{
}
else
{
List
<
ChangeDataDto
>
newChangeFields
=
this
.
convertBeanField2Column2
(
inspectChangeDataDto
,
record
);
List
<
FieldChangeMeta
>
newChangeFields
=
convertBeanField2Column2
(
inspectChangeDataDto
,
record
);
allChangeColumns
.
addAll
(
newChangeFields
);
allChangeColumns
.
addAll
(
newChangeFields
);
}
}
}
}
private
static
List
<
Field
>
getAllFields
(
Class
<?>
clazz
)
{
List
<
Field
>
fields
=
new
ArrayList
<>();
while
(
clazz
!=
null
&&
clazz
!=
Object
.
class
)
{
fields
.
addAll
(
Arrays
.
asList
(
clazz
.
getDeclaredFields
()));
clazz
=
clazz
.
getSuperclass
();
// 递归向上获取父类
}
return
fields
;
}
private
List
<
ChangeDataDto
>
buildOtherInfoOld
(
String
record
)
{
private
List
<
FieldChangeMeta
>
buildOtherInfoOld
(
String
record
)
{
EquipOtherInfoChangeDataDto
changeDataDto
=
new
EquipOtherInfoChangeDataDto
();
EquipOtherInfoChangeDataDto
changeDataDto
=
new
EquipOtherInfoChangeDataDto
();
IdxBizJgOtherInfo
otherInfo
=
idxBizJgOtherInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
IdxBizJgOtherInfo
>().
eq
(
IdxBizJgOtherInfo:
:
getRecord
,
record
));
IdxBizJgOtherInfo
otherInfo
=
idxBizJgOtherInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
IdxBizJgOtherInfo
>().
eq
(
IdxBizJgOtherInfo:
:
getRecord
,
record
));
BeanUtil
.
copyProperties
(
otherInfo
,
changeDataDto
);
BeanUtil
.
copyProperties
(
otherInfo
,
changeDataDto
);
return
this
.
convertBeanField2Column2
(
changeDataDto
,
record
);
return
convertBeanField2Column2
(
changeDataDto
,
record
);
}
}
/**
* 简化版字段对比更新工具
* 要求:对象字段名与数据库列名一致(驼峰转下划线自动处理)
*
* @param mapper MyBatis-Plus 的 Mapper 实例(直接传入)
* @param oldObj 旧对象(必须有id字段)
* @param newObj 新对象(必须与旧对象同一类型)
*/
public
<
T
>
List
<
FieldChangeMeta
>
simpleTrackAndUpdate
(
BaseMapper
<
T
>
mapper
,
T
oldObj
,
T
newObj
,
String
changeId
,
String
whereKey
,
String
whereValue
)
{
List
<
FieldChangeMeta
>
changeData
=
new
ArrayList
<>();
// 基础校验
if
(
oldObj
==
null
||
newObj
==
null
)
{
throw
new
IllegalArgumentException
(
"新旧对象不能为空"
);
}
if
(!
oldObj
.
getClass
().
equals
(
newObj
.
getClass
()))
{
throw
new
IllegalArgumentException
(
"对象类型不一致"
);
}
Group
group
=
newObj
.
getClass
().
getAnnotation
(
Group
.
class
);
Class
<?>
clazz
=
oldObj
.
getClass
();
UpdateWrapper
<
T
>
wrapper
=
new
UpdateWrapper
<>();
// 遍历所有字段(包含父类)
for
(
Field
field
:
getAllFields
(
clazz
))
{
try
{
field
.
setAccessible
(
true
);
Object
oldVal
=
field
.
get
(
oldObj
);
Object
newVal
=
field
.
get
(
newObj
);
FieldDisplayDefine
displayDefine
=
field
.
getAnnotation
(
FieldDisplayDefine
.
class
);
TableField
tableField
=
field
.
getAnnotation
(
TableField
.
class
);
// 对比逻辑
if
(!
Objects
.
equals
(
oldVal
,
newVal
))
{
if
(
displayDefine
!=
null
&&
displayDefine
.
isExist
())
{
String
columnName
=
tableField
.
value
();
wrapper
.
set
(
columnName
,
newVal
);
String
fieldName
=
displayDefine
.
value
();
FieldChangeMeta
fieldChangeMeta
=
new
FieldChangeMeta
();
fieldChangeMeta
.
setColumnKey
(
field
.
getName
());
fieldChangeMeta
.
setColumnFamily
(
group
.
value
());
fieldChangeMeta
.
setColumnLabel
(
fieldName
);
fieldChangeMeta
.
setChangeId
(
changeId
);
if
(
newVal
instanceof
String
)
{
fieldChangeMeta
.
setColumnOldValue
((
String
)
oldVal
);
fieldChangeMeta
.
setColumnNewValue
((
String
)
newVal
);
}
else
if
(
newVal
instanceof
Number
)
{
fieldChangeMeta
.
setColumnOldValue
(
String
.
valueOf
(
oldVal
));
fieldChangeMeta
.
setColumnNewValue
(
String
.
valueOf
(
newVal
));
}
else
if
(
newVal
instanceof
Date
)
{
fieldChangeMeta
.
setColumnOldValue
(
DateUtil
.
formatDate
((
Date
)
oldVal
));
fieldChangeMeta
.
setColumnNewValue
(
DateUtil
.
formatDate
((
Date
)
newVal
));
}
else
if
(
newVal
instanceof
Boolean
)
{
fieldChangeMeta
.
setColumnOldValue
(
Boolean
.
toString
((
Boolean
)
oldVal
));
fieldChangeMeta
.
setColumnNewValue
(
Boolean
.
toString
((
Boolean
)
newVal
));
}
changeData
.
add
(
fieldChangeMeta
);
}
}
}
catch
(
IllegalAccessException
e
)
{
System
.
err
.
println
(
"字段访问失败: "
+
field
.
getName
());
}
}
// 执行更新
if
(!
changeData
.
isEmpty
())
{
wrapper
.
eq
(
whereKey
,
whereValue
);
mapper
.
update
(
null
,
wrapper
);
}
return
changeData
;
}
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/process/equip/EquipChangeDataUpdateServiceImpl.java
View file @
5073faf2
...
@@ -167,8 +167,8 @@ public class EquipChangeDataUpdateServiceImpl {
...
@@ -167,8 +167,8 @@ public class EquipChangeDataUpdateServiceImpl {
}
}
public
void
updateTechParamByRecord
(
String
tableName
,
String
record
,
List
<
ChangeDataDto
>
changeDataDto
s
)
{
public
void
updateTechParamByRecord
(
String
tableName
,
String
record
,
List
<
FieldChangeMeta
>
fieldChangeMeta
s
)
{
List
<
DynamicColumnDto
>
columns
=
changeDataDto
s
.
stream
().
map
(
c
->
{
List
<
DynamicColumnDto
>
columns
=
fieldChangeMeta
s
.
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
()));
columnDto
.
setColumnValue
(
c
.
getColumnNewValue
());
columnDto
.
setColumnValue
(
c
.
getColumnNewValue
());
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/process/equip/PieLineDataChangeServiceImpl.java
View file @
5073faf2
...
@@ -3,7 +3,7 @@ package com.yeejoin.amos.boot.module.jg.biz.edit.process.equip;
...
@@ -3,7 +3,7 @@ package com.yeejoin.amos.boot.module.jg.biz.edit.process.equip;
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
;
...
@@ -28,12 +28,12 @@ public class PieLineDataChangeServiceImpl {
...
@@ -28,12 +28,12 @@ public class PieLineDataChangeServiceImpl {
this
.
equipChangeDataUpdateServiceImpl
=
equipChangeDataUpdateServiceImpl
;
this
.
equipChangeDataUpdateServiceImpl
=
equipChangeDataUpdateServiceImpl
;
}
}
public
void
update
(
ProjectContraptionChangeDataDto
projectContraptionChangeDataDtoNew
,
List
<
ChangeDataDto
>
allChangeColumns
)
{
public
void
update
(
ProjectContraptionChangeDataDto
projectContraptionChangeDataDtoNew
,
List
<
FieldChangeMeta
>
allChangeColumns
)
{
// 原有对象行转列
// 原有对象行转列
ProjectContraptionChangeDataDto
projectContraptionChangeDataDtoOld
=
getOldProjectContraptionData
(
projectContraptionChangeDataDtoNew
);
ProjectContraptionChangeDataDto
projectContraptionChangeDataDtoOld
=
getOldProjectContraptionData
(
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
));
// 数据入库
// 数据入库
...
@@ -53,13 +53,13 @@ public class PieLineDataChangeServiceImpl {
...
@@ -53,13 +53,13 @@ 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
.
convertBeanField2Column2
(
pieLineDesignChangeDataDto
,
record
);
List
<
FieldChangeMeta
>
designInfoNew
=
commonEquipDataProcessService
.
convertBeanField2Column2
(
pieLineDesignChangeDataDto
,
record
);
// 老数据查询行转列
// 老数据查询行转列
List
<
ChangeDataDto
>
designInfoOld
=
commonEquipDataProcessService
.
buildDesignInfoOld
(
record
);
List
<
FieldChangeMeta
>
designInfoOld
=
commonEquipDataProcessService
.
buildDesignInfoOld
(
record
);
allChangeColumns
.
addAll
(
commonEquipDataProcessService
.
mergeChangeFields
(
designInfoNew
,
designInfoOld
));
allChangeColumns
.
addAll
(
commonEquipDataProcessService
.
mergeChangeFields
(
designInfoNew
,
designInfoOld
));
// 2.更新管道的设计单位名称
// 2.更新管道的设计单位名称
equipChangeDataUpdateServiceImpl
.
updatePieLineDesignData
(
record
,
pieLineDesignChangeDataDto
);
equipChangeDataUpdateServiceImpl
.
updatePieLineDesignData
(
record
,
pieLineDesignChangeDataDto
);
...
@@ -69,13 +69,13 @@ public class PieLineDataChangeServiceImpl {
...
@@ -69,13 +69,13 @@ public class PieLineDataChangeServiceImpl {
equipChangeDataUpdateServiceImpl
.
updateRegisterEsDataPieLine
(
projectContraptionChangeDataDto
);
equipChangeDataUpdateServiceImpl
.
updateRegisterEsDataPieLine
(
projectContraptionChangeDataDto
);
}
}
public
void
deletePieLineBatch
(
List
<
PipelineChangeItemDto
>
deletedPieLines
,
List
<
ChangeDataDto
>
allChangeColumns
,
String
applyNo
)
{
public
void
deletePieLineBatch
(
List
<
PipelineChangeItemDto
>
deletedPieLines
,
List
<
FieldChangeMeta
>
allChangeColumns
,
String
applyNo
)
{
// todo 构建日志 allChangeColumns afterData = null
// todo 构建日志 allChangeColumns afterData = null
// todo 数据库管道删除
// todo 数据库管道删除
// todo es管道删除
// todo es管道删除
}
}
void
newPieLine
(
String
projectContraptionId
,
PipelineChangeItemDto
it
,
List
<
ChangeDataDto
>
allChangeColumns
,
String
applyNo
)
{
void
newPieLine
(
String
projectContraptionId
,
PipelineChangeItemDto
it
,
List
<
FieldChangeMeta
>
allChangeColumns
,
String
applyNo
)
{
// todo 创建管道的设备几张表
// todo 创建管道的设备几张表
// todo 创建道的es
// todo 创建道的es
// todo 构建变更流水 beforeData = null
// todo 构建变更流水 beforeData = null
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/process/equip/SingleEquipChangeProcess.java
View file @
5073faf2
...
@@ -39,9 +39,9 @@ public class SingleEquipChangeProcess implements IEquipChangeDataProcessStrategy
...
@@ -39,9 +39,9 @@ public class SingleEquipChangeProcess implements IEquipChangeDataProcessStrategy
@Override
@Override
public
List
<
ChangeDataDto
>
handle
(
Map
<
String
,
Object
>
changeData
,
String
defaultChangeId
)
{
public
List
<
FieldChangeMeta
>
handle
(
Map
<
String
,
Object
>
changeData
,
String
defaultChangeId
)
{
String
record
=
this
.
getRecord
(
defaultChangeId
);
String
record
=
this
.
getRecord
(
defaultChangeId
);
List
<
ChangeDataDto
>
allChangeColumns
=
new
ArrayList
<>();
List
<
FieldChangeMeta
>
allChangeColumns
=
new
ArrayList
<>();
// 新数据解析
// 新数据解析
EquipRegisterChangeDataDto
registerChangeDataDto
=
commonEquipDataProcessService
.
castMap2Bean
(
changeData
,
EquipRegisterChangeDataDto
.
class
);
EquipRegisterChangeDataDto
registerChangeDataDto
=
commonEquipDataProcessService
.
castMap2Bean
(
changeData
,
EquipRegisterChangeDataDto
.
class
);
EquipFactoryChangeDataDto
factoryChangeDataDto
=
commonEquipDataProcessService
.
castMap2Bean
(
changeData
,
EquipFactoryChangeDataDto
.
class
);
EquipFactoryChangeDataDto
factoryChangeDataDto
=
commonEquipDataProcessService
.
castMap2Bean
(
changeData
,
EquipFactoryChangeDataDto
.
class
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/process/equip/SingleProjectEquipChangeProcess.java
View file @
5073faf2
...
@@ -4,7 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
...
@@ -4,7 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import
cn.hutool.core.text.CharSequenceUtil
;
import
cn.hutool.core.text.CharSequenceUtil
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
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.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.api.dto.TechParamsPipelineChangeFieldDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.TechParamsPipelineChangeFieldDto
;
...
@@ -34,13 +34,13 @@ public class SingleProjectEquipChangeProcess implements IEquipChangeDataProcessS
...
@@ -34,13 +34,13 @@ public class SingleProjectEquipChangeProcess implements IEquipChangeDataProcessS
@Override
@Override
public
List
<
ChangeDataDto
>
handle
(
Map
<
String
,
Object
>
changeData
,
String
defaultChangeId
)
{
public
List
<
FieldChangeMeta
>
handle
(
Map
<
String
,
Object
>
changeData
,
String
defaultChangeId
)
{
JSONObject
data
=
(
JSONObject
)
changeData
;
JSONObject
data
=
(
JSONObject
)
changeData
;
// 新增编辑的管道------------------tableData
// 新增编辑的管道------------------tableData
JSONArray
insertOrEditPieLines
=
data
.
getJSONArray
(
RequestChangeData
.
multiDataKey
);
JSONArray
insertOrEditPieLines
=
data
.
getJSONArray
(
RequestChangeData
.
multiDataKey
);
// 删除的管道---------------------deleteData
// 删除的管道---------------------deleteData
JSONArray
deletedPieLines
=
data
.
getJSONArray
(
RequestChangeData
.
deletedDataKey
);
JSONArray
deletedPieLines
=
data
.
getJSONArray
(
RequestChangeData
.
deletedDataKey
);
List
<
ChangeDataDto
>
allChangeColumns
=
new
ArrayList
<>();
List
<
FieldChangeMeta
>
allChangeColumns
=
new
ArrayList
<>();
List
<
PipelineChangeItemDto
>
items
=
insertOrEditPieLines
.
toJavaList
(
PipelineChangeItemDto
.
class
);
List
<
PipelineChangeItemDto
>
items
=
insertOrEditPieLines
.
toJavaList
(
PipelineChangeItemDto
.
class
);
// 1.设备技术参数入库前校验,约束:同一个装置下的管道编号不能重复
// 1.设备技术参数入库前校验,约束:同一个装置下的管道编号不能重复
if
(
items
.
size
()
!=
items
.
stream
().
map
(
TechParamsPipelineChangeFieldDto:
:
getPipelineNumber
).
distinct
().
count
())
{
if
(
items
.
size
()
!=
items
.
stream
().
map
(
TechParamsPipelineChangeFieldDto:
:
getPipelineNumber
).
distinct
().
count
())
{
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/process/equip/strategy/IEquipChangeDataProcessStrategy.java
View file @
5073faf2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
edit
.
process
.
equip
.
strategy
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
edit
.
process
.
equip
.
strategy
;
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.biz.edit.process.biz.strategy.IBizDataChangeHandleStrategy
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.process.biz.strategy.IBizDataChangeHandleStrategy
;
import
java.util.List
;
import
java.util.List
;
...
@@ -14,7 +14,7 @@ public interface IEquipChangeDataProcessStrategy {
...
@@ -14,7 +14,7 @@ public interface IEquipChangeDataProcessStrategy {
/**
/**
* 处理
* 处理
*/
*/
List
<
ChangeDataDto
>
handle
(
Map
<
String
,
Object
>
changeData
,
String
defaultChangeId
);
List
<
FieldChangeMeta
>
handle
(
Map
<
String
,
Object
>
changeData
,
String
defaultChangeId
);
/**
/**
* 可处理类型
* 可处理类型
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/utils/ReflectiveFieldAccessor.java
0 → 100644
View file @
5073faf2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
edit
.
utils
;
import
java.lang.reflect.Field
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
public
class
ReflectiveFieldAccessor
{
private
static
final
Map
<
Class
<?>,
List
<
Field
>>
fieldCache
=
new
ConcurrentHashMap
<>();
public
static
List
<
Field
>
getAllFields
(
Class
<?>
clazz
)
{
return
fieldCache
.
computeIfAbsent
(
clazz
,
k
->
{
Class
<?>
clazz1
=
clazz
;
List
<
Field
>
fields
=
new
ArrayList
<>();
while
(
clazz1
!=
null
&&
clazz1
!=
Object
.
class
)
{
fields
.
addAll
(
Arrays
.
asList
(
clazz1
.
getDeclaredFields
()));
clazz1
=
clazz1
.
getSuperclass
();
// 递归向上获取父类
}
return
Collections
.
unmodifiableList
(
fields
);
});
}
}
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 @
5073faf2
...
@@ -63,6 +63,7 @@ import com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO;
...
@@ -63,6 +63,7 @@ import com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO;
import
com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO
;
import
com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO
;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
lombok.Getter
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.compress.utils.Lists
;
import
org.apache.commons.compress.utils.Lists
;
...
@@ -121,6 +122,7 @@ import static java.util.stream.Collectors.toSet;
...
@@ -121,6 +122,7 @@ import static java.util.stream.Collectors.toSet;
*/
*/
@Service
@Service
@Slf4j
@Slf4j
@Getter
public
class
JgUseRegistrationServiceImpl
extends
BaseService
<
JgUseRegistrationDto
,
JgUseRegistration
,
JgUseRegistrationMapper
>
implements
IJgUseRegistrationService
,
ICompensateFlowDataOfRedis
<
JgUseRegistration
>,
ApplicationContextAware
{
public
class
JgUseRegistrationServiceImpl
extends
BaseService
<
JgUseRegistrationDto
,
JgUseRegistration
,
JgUseRegistrationMapper
>
implements
IJgUseRegistrationService
,
ICompensateFlowDataOfRedis
<
JgUseRegistration
>,
ApplicationContextAware
{
private
static
final
String
DEFINITION_KEY
=
"useRegistration"
;
private
static
final
String
DEFINITION_KEY
=
"useRegistration"
;
...
@@ -139,7 +141,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -139,7 +141,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
@Autowired
@Autowired
TzsServiceFeignClient
tzsServiceFeignClient
;
TzsServiceFeignClient
tzsServiceFeignClient
;
@Autowired
@Autowired
JgRegistrationHistoryServiceImpl
jgRegistrationHistoryService
;
private
JgRegistrationHistoryServiceImpl
jgRegistrationHistoryService
;
@Autowired
@Autowired
IdxBizJgRegisterInfoMapper
idxBizJgRegisterInfoMapper
;
IdxBizJgRegisterInfoMapper
idxBizJgRegisterInfoMapper
;
@Autowired
@Autowired
...
@@ -149,7 +151,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -149,7 +151,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
@Autowired
@Autowired
ICommonService
commonService
;
ICommonService
commonService
;
@Autowired
@Autowired
CommonServiceImpl
commonServiceImpl
;
private
CommonServiceImpl
commonServiceImpl
;
@Autowired
@Autowired
CmWorkflowServiceImpl
cmWorkflowService
;
CmWorkflowServiceImpl
cmWorkflowService
;
@Autowired
@Autowired
...
@@ -186,7 +188,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -186,7 +188,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
@Autowired
@Autowired
private
IdxBizJgRegisterInfoServiceImpl
idxBizJgRegisterInfoService
;
private
IdxBizJgRegisterInfoServiceImpl
idxBizJgRegisterInfoService
;
@Autowired
@Autowired
pr
ivate
IdxBizJgUseInfoServiceImpl
idxBizJgUseInfoService
;
pr
otected
IdxBizJgUseInfoServiceImpl
idxBizJgUseInfoService
;
@Autowired
@Autowired
private
IdxBizJgFactoryInfoServiceImpl
idxBizJgFactoryInfoService
;
private
IdxBizJgFactoryInfoServiceImpl
idxBizJgFactoryInfoService
;
@Autowired
@Autowired
...
@@ -242,6 +244,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -242,6 +244,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
@Autowired
@Autowired
private
CommonMapper
commonMapper
;
private
CommonMapper
commonMapper
;
@Autowired
private
IdxBizJgInspectionDetectionInfoServiceImpl
inspectionDetectionInfoService
;
/**
/**
* @param auditPassDate 通过时间
* @param auditPassDate 通过时间
...
@@ -419,7 +424,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -419,7 +424,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
}
}
}
p
rivate
void
updateOrCreateInspectionDetection
(
Map
<
String
,
Object
>
equipment
,
JgUseRegistration
jgUseRegistration
,
IdxBizJgRegisterInfo
registerInfo
)
{
p
ublic
void
updateOrCreateInspectionDetection
(
Map
<
String
,
Object
>
equipment
,
JgUseRegistration
jgUseRegistration
,
IdxBizJgRegisterInfo
registerInfo
)
{
InspectionDetectionInfo
inspectionDetectionInfo
=
new
InspectionDetectionInfo
();
InspectionDetectionInfo
inspectionDetectionInfo
=
new
InspectionDetectionInfo
();
BeanUtil
.
copyProperties
(
equipment
,
inspectionDetectionInfo
);
BeanUtil
.
copyProperties
(
equipment
,
inspectionDetectionInfo
);
if
(
"unit"
.
equals
(
jgUseRegistration
.
getManageType
())){
if
(
"unit"
.
equals
(
jgUseRegistration
.
getManageType
())){
...
@@ -1377,7 +1382,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -1377,7 +1382,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
*
*
* @param sequenceNbr 使用登记业务表seq
* @param sequenceNbr 使用登记业务表seq
*/
*/
p
rivate
void
updateRegistrationManage
(
Long
sequenceNbr
)
{
p
ublic
void
updateRegistrationManage
(
Long
sequenceNbr
)
{
JgUseRegistration
jgUseRegistration
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
JgUseRegistration
jgUseRegistration
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
LambdaQueryWrapper
<
JgUseRegistrationManage
>
queryWrapper
=
new
LambdaQueryWrapper
<
JgUseRegistrationManage
>()
LambdaQueryWrapper
<
JgUseRegistrationManage
>
queryWrapper
=
new
LambdaQueryWrapper
<
JgUseRegistrationManage
>()
...
@@ -3834,7 +3839,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -3834,7 +3839,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
designInfo
.
setOtherAccessoriesDes
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"otherAccessoriesDes"
))
?
null
:
JSONObject
.
toJSONString
(
map
.
get
(
"otherAccessoriesDes"
)));
designInfo
.
setOtherAccessoriesDes
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"otherAccessoriesDes"
))
?
null
:
JSONObject
.
toJSONString
(
map
.
get
(
"otherAccessoriesDes"
)));
idxBizJgDesignInfoMapper
.
updateById
(
designInfo
);
idxBizJgDesignInfoMapper
.
updateById
(
designInfo
);
// 制造信息
// 制造信息
LambdaQueryWrapper
<
IdxBizJgFactoryInfo
>
factoryInfoWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
IdxBizJgFactoryInfo
>
factoryInfoWrapper
=
new
LambdaQueryWrapper
<>();
factoryInfoWrapper
.
eq
(
IdxBizJgFactoryInfo:
:
getRecord
,
jgRelationEquip
.
getEquId
());
factoryInfoWrapper
.
eq
(
IdxBizJgFactoryInfo:
:
getRecord
,
jgRelationEquip
.
getEquId
());
...
@@ -3950,9 +3954,37 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -3950,9 +3954,37 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
}
/**
/**
* 历史设备登记-》更新安装信息
*/
private
void
historyEquUpdateInstallInfo
(
JSONObject
map
)
{
IdxBizJgConstructionInfo
constructionInfo
=
idxBizJgConstructionInfoService
.
queryNewestDetailByRecord
(
String
.
valueOf
(
map
.
get
(
"equipId"
)));
if
(!
ValidationUtil
.
isEmpty
(
constructionInfo
.
getSequenceNbr
()))
{
constructionInfo
.
setUscUnitName
(
ValidationUtil
.
isEmpty
(
map
.
get
(
"uscUnitName"
))
?
null
:
String
.
valueOf
(
map
.
get
(
"uscUnitName"
)));
constructionInfo
.
setConstructionLeaderName
(
ValidationUtil
.
isEmpty
(
map
.
get
(
"installLeaderId"
))
?
null
:
String
.
valueOf
(
map
.
get
(
"installLeaderId"
)));
constructionInfo
.
setConstructionLeaderPhone
(
ValidationUtil
.
isEmpty
(
map
.
get
(
"installLeaderPhone"
))
?
null
:
String
.
valueOf
(
map
.
get
(
"installLeaderPhone"
)));
constructionInfo
.
setProxyStatementAttachment
(
ValidationUtil
.
isEmpty
(
map
.
get
(
"proxyStatementAttachmentList"
))
?
null
:
JSONObject
.
toJSONString
(
map
.
get
(
"proxyStatementAttachmentList"
)));
constructionInfo
.
setConstructionContractAttachment
(
ValidationUtil
.
isEmpty
(
map
.
get
(
"installContractAttachment"
))
?
null
:
JSONObject
.
toJSONString
(
map
.
get
(
"installContractAttachment"
)));
constructionInfo
.
setConstructionOtherAccessories
(
ValidationUtil
.
isEmpty
(
map
.
get
(
"insOtherAccessories"
))
?
null
:
JSONObject
.
toJSONString
(
map
.
get
(
"insOtherAccessories"
)));
try
{
constructionInfo
.
setUscDate
(
ValidationUtil
.
isEmpty
(
map
.
get
(
"installStartDate"
))
?
null
:
DateUtils
.
dateParse
((
String
)
map
.
get
(
"installStartDate"
),
DateUtils
.
DATE_PATTERN
));
}
catch
(
ParseException
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
BadRequest
(
"安装日期时间转化错误"
);
}
idxBizJgConstructionInfoService
.
getBaseMapper
().
updateById
(
constructionInfo
);
}
}
/**
* 历史设备登记-》更新维保信息
* 历史设备登记-》更新维保信息
*/
*/
private
void
historyEquUpdateMaintenanceInfo
(
JSONObject
map
)
{
public
void
historyEquUpdateMaintenanceInfo
(
JSONObject
map
)
{
IdxBizJgMaintenanceRecordInfo
info
=
buildIdxBizJgMaintenanceRecordInfo
(
map
);
idxBizJgMaintenanceRecordInfoService
.
save
(
info
);
}
public
IdxBizJgMaintenanceRecordInfo
buildIdxBizJgMaintenanceRecordInfo
(
JSONObject
map
)
{
IdxBizJgMaintenanceRecordInfo
info
=
new
IdxBizJgMaintenanceRecordInfo
();
IdxBizJgMaintenanceRecordInfo
info
=
new
IdxBizJgMaintenanceRecordInfo
();
info
.
setRecord
(
String
.
valueOf
(
map
.
get
(
"equipId"
)));
info
.
setRecord
(
String
.
valueOf
(
map
.
get
(
"equipId"
)));
String
meUnitName
=
String
.
valueOf
(
map
.
get
(
"meUnitName"
));
String
meUnitName
=
String
.
valueOf
(
map
.
get
(
"meUnitName"
));
...
@@ -3974,30 +4006,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -3974,30 +4006,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
log
.
info
(
"date转化失败"
);
log
.
info
(
"date转化失败"
);
}
}
info
.
setRepairInform
(
ValidationUtil
.
isEmpty
(
map
.
get
(
"maintenanceContract"
))
?
null
:
JSONObject
.
toJSONString
(
map
.
get
(
"maintenanceContract"
)));
info
.
setRepairInform
(
ValidationUtil
.
isEmpty
(
map
.
get
(
"maintenanceContract"
))
?
null
:
JSONObject
.
toJSONString
(
map
.
get
(
"maintenanceContract"
)));
idxBizJgMaintenanceRecordInfoService
.
save
(
info
);
return
info
;
}
/**
* 历史设备登记-》更新安装信息
*/
private
void
historyEquUpdateInstallInfo
(
JSONObject
map
)
{
IdxBizJgConstructionInfo
constructionInfo
=
idxBizJgConstructionInfoService
.
queryNewestDetailByRecord
(
String
.
valueOf
(
map
.
get
(
"equipId"
)));
if
(!
ValidationUtil
.
isEmpty
(
constructionInfo
.
getSequenceNbr
()))
{
constructionInfo
.
setUscUnitName
(
ValidationUtil
.
isEmpty
(
map
.
get
(
"uscUnitName"
))
?
null
:
String
.
valueOf
(
map
.
get
(
"uscUnitName"
)));
constructionInfo
.
setConstructionLeaderName
(
ValidationUtil
.
isEmpty
(
map
.
get
(
"installLeaderId"
))
?
null
:
String
.
valueOf
(
map
.
get
(
"installLeaderId"
)));
constructionInfo
.
setConstructionLeaderPhone
(
ValidationUtil
.
isEmpty
(
map
.
get
(
"installLeaderPhone"
))
?
null
:
String
.
valueOf
(
map
.
get
(
"installLeaderPhone"
)));
constructionInfo
.
setProxyStatementAttachment
(
ValidationUtil
.
isEmpty
(
map
.
get
(
"proxyStatementAttachmentList"
))
?
null
:
JSONObject
.
toJSONString
(
map
.
get
(
"proxyStatementAttachmentList"
)));
constructionInfo
.
setConstructionContractAttachment
(
ValidationUtil
.
isEmpty
(
map
.
get
(
"installContractAttachment"
))
?
null
:
JSONObject
.
toJSONString
(
map
.
get
(
"installContractAttachment"
)));
constructionInfo
.
setConstructionOtherAccessories
(
ValidationUtil
.
isEmpty
(
map
.
get
(
"insOtherAccessories"
))
?
null
:
JSONObject
.
toJSONString
(
map
.
get
(
"insOtherAccessories"
)));
try
{
constructionInfo
.
setUscDate
(
ValidationUtil
.
isEmpty
(
map
.
get
(
"installStartDate"
))
?
null
:
DateUtils
.
dateParse
((
String
)
map
.
get
(
"installStartDate"
),
DateUtils
.
DATE_PATTERN
));
}
catch
(
ParseException
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
BadRequest
(
"安装日期时间转化错误"
);
}
idxBizJgConstructionInfoService
.
getBaseMapper
().
updateById
(
constructionInfo
);
}
}
}
private
void
historyEquGenManageRelated
(
JSONObject
map
,
JgUseRegistration
jgUseRegistration
,
IdxBizJgRegisterInfo
registerInfo
,
IdxBizJgFactoryInfo
idxBizJgFactoryInfo
)
{
private
void
historyEquGenManageRelated
(
JSONObject
map
,
JgUseRegistration
jgUseRegistration
,
IdxBizJgRegisterInfo
registerInfo
,
IdxBizJgFactoryInfo
idxBizJgFactoryInfo
)
{
...
...
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/SingleManageEquipEditHandleImpl.java
View file @
5073faf2
...
@@ -49,7 +49,7 @@ public class SingleManageEquipEditHandleImpl {
...
@@ -49,7 +49,7 @@ public class SingleManageEquipEditHandleImpl {
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
doSave
(
String
record
,
Map
<
String
,
Object
>
changeData
)
{
public
void
doSave
(
String
record
,
Map
<
String
,
Object
>
changeData
)
{
List
<
ChangeDataDto
>
allChangeColumns
=
this
.
update
(
record
,
changeData
);
List
<
FieldChangeMeta
>
allChangeColumns
=
this
.
update
(
record
,
changeData
);
// 记录流水
// 记录流水
if
(!
allChangeColumns
.
isEmpty
())
{
if
(!
allChangeColumns
.
isEmpty
())
{
// 更新历史的JSON的数据
// 更新历史的JSON的数据
...
@@ -59,7 +59,7 @@ public class SingleManageEquipEditHandleImpl {
...
@@ -59,7 +59,7 @@ public class SingleManageEquipEditHandleImpl {
}
}
}
}
private
void
publishEvent2Logger
(
String
record
,
List
<
ChangeDataDto
>
allChangeColumns
)
{
private
void
publishEvent2Logger
(
String
record
,
List
<
FieldChangeMeta
>
allChangeColumns
)
{
BizRelationDataDto
relationDataDto
=
new
BizRelationDataDto
();
BizRelationDataDto
relationDataDto
=
new
BizRelationDataDto
();
relationDataDto
.
setBizId
(
record
);
relationDataDto
.
setBizId
(
record
);
relationDataDto
.
setBizType
(
BIZ_TYPE
);
relationDataDto
.
setBizType
(
BIZ_TYPE
);
...
@@ -68,8 +68,8 @@ public class SingleManageEquipEditHandleImpl {
...
@@ -68,8 +68,8 @@ public class SingleManageEquipEditHandleImpl {
}
}
private
List
<
ChangeDataDto
>
update
(
String
record
,
Map
<
String
,
Object
>
changeData
)
{
private
List
<
FieldChangeMeta
>
update
(
String
record
,
Map
<
String
,
Object
>
changeData
)
{
List
<
ChangeDataDto
>
allChangeColumns
=
new
ArrayList
<>();
List
<
FieldChangeMeta
>
allChangeColumns
=
new
ArrayList
<>();
// 新数据解析
// 新数据解析
EquipRegisterChangeDataDto
registerChangeDataDto
=
commonEquipDataProcessService
.
castMap2Bean
(
changeData
,
EquipRegisterChangeDataDto
.
class
);
EquipRegisterChangeDataDto
registerChangeDataDto
=
commonEquipDataProcessService
.
castMap2Bean
(
changeData
,
EquipRegisterChangeDataDto
.
class
);
EquipFactoryChangeDataDto
factoryChangeDataDto
=
commonEquipDataProcessService
.
castMap2Bean
(
changeData
,
EquipFactoryChangeDataDto
.
class
);
EquipFactoryChangeDataDto
factoryChangeDataDto
=
commonEquipDataProcessService
.
castMap2Bean
(
changeData
,
EquipFactoryChangeDataDto
.
class
);
...
@@ -89,7 +89,7 @@ public class SingleManageEquipEditHandleImpl {
...
@@ -89,7 +89,7 @@ public class SingleManageEquipEditHandleImpl {
}
}
private
void
buildLogData
(
List
<
ChangeDataDto
>
allChangeColumns
)
{
private
void
buildLogData
(
List
<
FieldChangeMeta
>
allChangeColumns
)
{
allChangeColumns
.
forEach
(
column
->
{
allChangeColumns
.
forEach
(
column
->
{
column
.
setBizType
(
"监管端编辑设备信息"
);
column
.
setBizType
(
"监管端编辑设备信息"
);
});
});
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/entity/IdxBizJgConstructionInfo.java
View file @
5073faf2
...
@@ -2,11 +2,11 @@ package com.yeejoin.amos.boot.module.ymt.api.entity;
...
@@ -2,11 +2,11 @@ package com.yeejoin.amos.boot.module.ymt.api.entity;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
import
java.util.Date
;
/**
/**
...
@@ -21,54 +21,53 @@ import java.util.Date;
...
@@ -21,54 +21,53 @@ import java.util.Date;
@TableName
(
"idx_biz_jg_construction_info"
)
@TableName
(
"idx_biz_jg_construction_info"
)
public
class
IdxBizJgConstructionInfo
extends
TzsBaseEntity
{
public
class
IdxBizJgConstructionInfo
extends
TzsBaseEntity
{
/**
/**
*
*
*/
*/
@TableField
(
"\"RECORD\""
)
@TableField
(
"\"RECORD\""
)
private
String
record
;
private
String
record
;
/**
/**
*
*
*/
*/
@TableField
(
"\"INSTANCE_ID\""
)
@TableField
(
"\"INSTANCE_ID\""
)
private
String
instanceId
;
private
String
instanceId
;
/**
/**
*
*
*/
*/
@TableField
(
"\"STATUS\""
)
@TableField
(
"\"STATUS\""
)
private
String
status
;
private
String
status
;
/**
/**
*
*
*/
*/
@TableField
(
"\"CONSTRUCTION_TYPE\""
)
@TableField
(
"\"CONSTRUCTION_TYPE\""
)
private
String
constructionType
;
private
String
constructionType
;
/**
/**
*
*
*/
*/
@TableField
(
"\"USC_UNIT_CREDIT_CODE\""
)
@TableField
(
"\"USC_UNIT_CREDIT_CODE\""
)
private
String
uscUnitCreditCode
;
private
String
uscUnitCreditCode
;
/**
/**
* 施工单位名称
* 施工单位名称
*/
*/
@TableField
(
"\"USC_UNIT_NAME\""
)
@TableField
(
"\"USC_UNIT_NAME\""
)
private
String
uscUnitName
;
private
String
uscUnitName
;
/**
/**
* 施工时间
* 施工时间
*/
*/
@TableField
(
"\"USC_DATE\""
)
@TableField
(
"\"USC_DATE\""
)
private
Date
uscDate
;
private
Date
uscDate
;
/**
/**
*
*
*/
*/
@TableField
(
"\"SEQUENCE_CODE\""
)
@TableField
(
"\"SEQUENCE_CODE\""
)
private
String
sequenceCode
;
private
String
sequenceCode
;
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/entity/IdxBizJgInspectionDetectionInfo.java
View file @
5073faf2
...
@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.ymt.api.entity;
...
@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.ymt.api.entity;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.annotation.FieldDisplayDefine
;
import
com.yeejoin.amos.boot.biz.common.annotation.Group
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -19,6 +21,7 @@ import java.util.Date;
...
@@ -19,6 +21,7 @@ import java.util.Date;
@EqualsAndHashCode
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"idx_biz_jg_inspection_detection_info"
)
@TableName
(
"idx_biz_jg_inspection_detection_info"
)
@Group
(
"idx_biz_jg_inspection_detection_info"
)
public
class
IdxBizJgInspectionDetectionInfo
extends
TzsBaseEntity
{
public
class
IdxBizJgInspectionDetectionInfo
extends
TzsBaseEntity
{
...
@@ -99,6 +102,7 @@ public class IdxBizJgInspectionDetectionInfo extends TzsBaseEntity {
...
@@ -99,6 +102,7 @@ public class IdxBizJgInspectionDetectionInfo extends TzsBaseEntity {
*
*
*/
*/
@TableField
(
"\"NEXT_INSPECT_DATE\""
)
@TableField
(
"\"NEXT_INSPECT_DATE\""
)
@FieldDisplayDefine
(
value
=
"下次检验日期"
)
private
Date
nextInspectDate
;
private
Date
nextInspectDate
;
/**
/**
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/entity/IdxBizJgRegisterInfo.java
View file @
5073faf2
...
@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.ymt.api.entity;
...
@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.ymt.api.entity;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.annotation.FieldDisplayDefine
;
import
com.yeejoin.amos.boot.biz.common.annotation.Group
;
import
com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
...
@@ -17,6 +19,7 @@ import lombok.experimental.Accessors;
...
@@ -17,6 +19,7 @@ import lombok.experimental.Accessors;
@EqualsAndHashCode
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"idx_biz_jg_register_info"
)
@TableName
(
"idx_biz_jg_register_info"
)
@Group
(
value
=
"idx_biz_jg_register_info"
)
public
class
IdxBizJgRegisterInfo
extends
TzsBaseEntity
{
public
class
IdxBizJgRegisterInfo
extends
TzsBaseEntity
{
...
@@ -57,6 +60,7 @@ public class IdxBizJgRegisterInfo extends TzsBaseEntity {
...
@@ -57,6 +60,7 @@ public class IdxBizJgRegisterInfo extends TzsBaseEntity {
*
*
*/
*/
@TableField
(
"\"USE_ORG_CODE\""
)
@TableField
(
"\"USE_ORG_CODE\""
)
@FieldDisplayDefine
(
value
=
"使用登记证编号"
)
private
String
useOrgCode
;
private
String
useOrgCode
;
/**
/**
...
@@ -207,6 +211,7 @@ public class IdxBizJgRegisterInfo extends TzsBaseEntity {
...
@@ -207,6 +211,7 @@ public class IdxBizJgRegisterInfo extends TzsBaseEntity {
* 2:其他
* 2:其他
*/
*/
@TableField
(
"\"CYLINDER_CATEGORY\""
)
@TableField
(
"\"CYLINDER_CATEGORY\""
)
@FieldDisplayDefine
(
value
=
"气瓶类别"
)
private
String
cylinderCategory
;
private
String
cylinderCategory
;
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/entity/IdxBizJgSupervisionInfo.java
View file @
5073faf2
...
@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.ymt.api.entity;
...
@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.ymt.api.entity;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.annotation.FieldDisplayDefine
;
import
com.yeejoin.amos.boot.biz.common.annotation.Group
;
import
com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
...
@@ -17,6 +19,7 @@ import lombok.experimental.Accessors;
...
@@ -17,6 +19,7 @@ import lombok.experimental.Accessors;
@EqualsAndHashCode
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"idx_biz_jg_supervision_info"
)
@TableName
(
"idx_biz_jg_supervision_info"
)
@Group
(
"idx_biz_jg_supervision_info"
)
public
class
IdxBizJgSupervisionInfo
extends
TzsBaseEntity
{
public
class
IdxBizJgSupervisionInfo
extends
TzsBaseEntity
{
...
@@ -44,6 +47,7 @@ public class IdxBizJgSupervisionInfo extends TzsBaseEntity {
...
@@ -44,6 +47,7 @@ public class IdxBizJgSupervisionInfo extends TzsBaseEntity {
/**
/**
*
*
*/
*/
@FieldDisplayDefine
(
value
=
"管辖分局组织机构代码"
)
@TableField
(
"\"ORG_BRANCH_CODE\""
)
@TableField
(
"\"ORG_BRANCH_CODE\""
)
private
String
orgBranchCode
;
private
String
orgBranchCode
;
/**
/**
...
@@ -51,12 +55,14 @@ public class IdxBizJgSupervisionInfo extends TzsBaseEntity {
...
@@ -51,12 +55,14 @@ public class IdxBizJgSupervisionInfo extends TzsBaseEntity {
* */
* */
@TableField
(
value
=
"\"COMPANY_ORG_BRANCH_CODE\""
)
@TableField
(
value
=
"\"COMPANY_ORG_BRANCH_CODE\""
)
@FieldDisplayDefine
(
value
=
"公司/组织机构代码"
)
private
String
companyOrgBranchCode
;
private
String
companyOrgBranchCode
;
/**
/**
*
*
*/
*/
@TableField
(
"\"ORG_BRANCH_NAME\""
)
@TableField
(
"\"ORG_BRANCH_NAME\""
)
@FieldDisplayDefine
(
value
=
"管辖分局名称"
)
private
String
orgBranchName
;
private
String
orgBranchName
;
/**
/**
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/entity/IdxBizJgUseInfo.java
View file @
5073faf2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ymt
.
api
.
entity
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ymt
.
api
.
entity
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.annotation.FieldDisplayDefine
;
import
com.yeejoin.amos.boot.biz.common.annotation.Group
;
import
com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
import
org.elasticsearch.common.recycler.Recycler
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -19,6 +23,7 @@ import java.util.Date;
...
@@ -19,6 +23,7 @@ import java.util.Date;
@EqualsAndHashCode
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"idx_biz_jg_use_info"
)
@TableName
(
"idx_biz_jg_use_info"
)
@Group
(
value
=
"idx_biz_jg_use_info"
)
public
class
IdxBizJgUseInfo
extends
TzsBaseEntity
{
public
class
IdxBizJgUseInfo
extends
TzsBaseEntity
{
...
@@ -44,24 +49,28 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
...
@@ -44,24 +49,28 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
*
*
*/
*/
@TableField
(
"\"USE_UNIT_CREDIT_CODE\""
)
@TableField
(
"\"USE_UNIT_CREDIT_CODE\""
)
@FieldDisplayDefine
(
value
=
"使用单位统一信用代码"
)
private
String
useUnitCreditCode
;
private
String
useUnitCreditCode
;
/**
/**
*
*
*/
*/
@TableField
(
"\"USE_UNIT_NAME\""
)
@TableField
(
"\"USE_UNIT_NAME\""
)
@FieldDisplayDefine
(
value
=
"使用单位名称"
)
private
String
useUnitName
;
private
String
useUnitName
;
/**
/**
*
*
*/
*/
@TableField
(
"\"ESTATE_UNIT_CREDIT_CODE\""
)
@TableField
(
"\"ESTATE_UNIT_CREDIT_CODE\""
)
@FieldDisplayDefine
(
value
=
"产权单位统一信用代码"
)
private
String
estateUnitCreditCode
;
private
String
estateUnitCreditCode
;
/**
/**
*
*
*/
*/
@TableField
(
"\"ESTATE_UNIT_NAME\""
)
@TableField
(
"\"ESTATE_UNIT_NAME\""
)
@FieldDisplayDefine
(
value
=
"产权单位名称"
)
private
String
estateUnitName
;
private
String
estateUnitName
;
/**
/**
...
@@ -80,12 +89,14 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
...
@@ -80,12 +89,14 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
*
*
*/
*/
@TableField
(
"\"USE_INNER_CODE\""
)
@TableField
(
"\"USE_INNER_CODE\""
)
@FieldDisplayDefine
(
value
=
"使用内部编号"
)
private
String
useInnerCode
;
private
String
useInnerCode
;
/**
/**
*
*
*/
*/
@TableField
(
"\"USE_DATE\""
)
@TableField
(
"\"USE_DATE\""
)
@FieldDisplayDefine
(
value
=
"投用日期"
)
private
String
useDate
;
private
String
useDate
;
/**
/**
...
@@ -98,42 +109,49 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
...
@@ -98,42 +109,49 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
*
*
*/
*/
@TableField
(
"\"PROVINCE\""
)
@TableField
(
"\"PROVINCE\""
)
@FieldDisplayDefine
(
value
=
"省份行政区划"
)
private
String
province
;
private
String
province
;
/**
/**
*
*
*/
*/
@TableField
(
"\"CITY\""
)
@TableField
(
"\"CITY\""
)
@FieldDisplayDefine
(
value
=
"地市行政区划"
)
private
String
city
;
private
String
city
;
/**
/**
*
*
*/
*/
@TableField
(
"\"COUNTY\""
)
@TableField
(
"\"COUNTY\""
)
@FieldDisplayDefine
(
value
=
"区县行政区划"
)
private
String
county
;
private
String
county
;
/**
/**
*
*
*/
*/
@TableField
(
"\"FACTORY_USE_SITE_STREET\""
)
@TableField
(
"\"FACTORY_USE_SITE_STREET\""
)
@FieldDisplayDefine
(
value
=
"街道行政区划"
)
private
String
factoryUseSiteStreet
;
private
String
factoryUseSiteStreet
;
/**
/**
*
*
*/
*/
@TableField
(
"\"ADDRESS\""
)
@TableField
(
"\"ADDRESS\""
)
@FieldDisplayDefine
(
value
=
"详细地址"
)
private
String
address
;
private
String
address
;
/**
/**
*
*
*/
*/
@TableField
(
"\"LONGITUDE_LATITUDE\""
)
@TableField
(
"\"LONGITUDE_LATITUDE\""
)
@FieldDisplayDefine
(
value
=
"经纬度"
,
type
=
JSON
.
class
)
private
String
longitudeLatitude
;
private
String
longitudeLatitude
;
/**
/**
*
*
*/
*/
@TableField
(
"\"USE_PLACE\""
)
@TableField
(
"\"USE_PLACE\""
)
@FieldDisplayDefine
(
value
=
"使用场所"
)
private
String
usePlace
;
private
String
usePlace
;
/**
/**
...
@@ -151,12 +169,14 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
...
@@ -151,12 +169,14 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
/**
/**
*
*
*/
*/
@FieldDisplayDefine
(
value
=
"安管理员名称"
)
@TableField
(
"\"SAFETY_MANAGER\""
)
@TableField
(
"\"SAFETY_MANAGER\""
)
private
String
safetyManager
;
private
String
safetyManager
;
/**
/**
*
*
*/
*/
@FieldDisplayDefine
(
value
=
"安管理员电话"
)
@TableField
(
"\"PHONE\""
)
@TableField
(
"\"PHONE\""
)
private
String
phone
;
private
String
phone
;
...
@@ -220,6 +240,7 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
...
@@ -220,6 +240,7 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
* 是否西咸
* 是否西咸
*/
*/
@TableField
(
"\"IS_NOT_XIXIAN\""
)
@TableField
(
"\"IS_NOT_XIXIAN\""
)
@FieldDisplayDefine
(
value
=
"是否西咸"
)
private
String
isNotXiXian
;
private
String
isNotXiXian
;
...
@@ -230,6 +251,7 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
...
@@ -230,6 +251,7 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
*
*
*/
*/
@TableField
(
"\"SAFETY_MANAGER_ID\""
)
@TableField
(
"\"SAFETY_MANAGER_ID\""
)
@FieldDisplayDefine
(
value
=
"安全管理员id"
)
private
String
safetyManagerId
;
private
String
safetyManagerId
;
...
@@ -237,6 +259,7 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
...
@@ -237,6 +259,7 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
* 是否是否纳管:true - 已纳管 false-未纳管
* 是否是否纳管:true - 已纳管 false-未纳管
*/
*/
@TableField
(
"\"IS_INTO_MANAGEMENT\""
)
@TableField
(
"\"IS_INTO_MANAGEMENT\""
)
@FieldDisplayDefine
(
value
=
"是否已纳管"
)
private
Boolean
isIntoManagement
;
private
Boolean
isIntoManagement
;
...
@@ -244,6 +267,7 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
...
@@ -244,6 +267,7 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
* 工程装置名称(工业管道使用)
* 工程装置名称(工业管道使用)
*/
*/
@TableField
(
"\"PROJECT_CONTRAPTION\""
)
@TableField
(
"\"PROJECT_CONTRAPTION\""
)
@FieldDisplayDefine
(
value
=
"工程装置名称(工业管道使用)"
)
private
String
projectContraption
;
private
String
projectContraption
;
...
@@ -251,6 +275,7 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
...
@@ -251,6 +275,7 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
* 历史设备-原使用登记证附件
* 历史设备-原使用登记证附件
*/
*/
@TableField
(
"\"OLD_USE_REGISTRATION_CERTIFICATE\""
)
@TableField
(
"\"OLD_USE_REGISTRATION_CERTIFICATE\""
)
@FieldDisplayDefine
(
value
=
"原使用登记证附件"
)
private
String
oldUseRegistrationCertificate
;
private
String
oldUseRegistrationCertificate
;
...
@@ -258,6 +283,7 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
...
@@ -258,6 +283,7 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
* 历史设备-原使用登记表附件
* 历史设备-原使用登记表附件
*/
*/
@TableField
(
"\"OLD_USE_REGISTRATION_TABLE\""
)
@TableField
(
"\"OLD_USE_REGISTRATION_TABLE\""
)
@FieldDisplayDefine
(
value
=
"原使用登记表附件"
)
private
String
oldUseRegistrationTable
;
private
String
oldUseRegistrationTable
;
...
@@ -265,6 +291,7 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
...
@@ -265,6 +291,7 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
* 历史设备-原登记机关
* 历史设备-原登记机关
*/
*/
@TableField
(
"\"O_REG_UNIT\""
)
@TableField
(
"\"O_REG_UNIT\""
)
@FieldDisplayDefine
(
value
=
"原登记机关"
)
private
String
oRegUnit
;
private
String
oRegUnit
;
...
@@ -272,6 +299,7 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
...
@@ -272,6 +299,7 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
* 历史设备-原登记日期
* 历史设备-原登记日期
*/
*/
@TableField
(
"\"O_REG_DATE\""
)
@TableField
(
"\"O_REG_DATE\""
)
@FieldDisplayDefine
(
value
=
"原登记日期"
)
private
String
oRegDate
;
private
String
oRegDate
;
...
@@ -279,11 +307,13 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
...
@@ -279,11 +307,13 @@ public class IdxBizJgUseInfo extends TzsBaseEntity {
* 工程装置ID
* 工程装置ID
*/
*/
@TableField
(
"\"PROJECT_CONTRAPTION_ID\""
)
@TableField
(
"\"PROJECT_CONTRAPTION_ID\""
)
@FieldDisplayDefine
(
value
=
"工程装置ID"
)
private
String
projectContraptionId
;
private
String
projectContraptionId
;
/**
/**
* 备注
* 备注
*/
*/
@TableField
(
"\"REMARK\""
)
@TableField
(
"\"REMARK\""
)
@FieldDisplayDefine
(
value
=
"备注"
)
private
String
remark
;
private
String
remark
;
}
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-biz/src/main/java/com/yeejoin/amos/boot/module/ymt/biz/service/impl/InspectionDetectionInfoServiceImpl.java
View file @
5073faf2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ymt
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ymt
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.InspectionDetectionInfoModel
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.InspectionDetectionInfoModel
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.InspectionDetectionInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.InspectionDetectionInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.InspectionDetectionInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.InspectionDetectionInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.service.InspectionDetectionInfoService
;
import
com.yeejoin.amos.boot.module.ymt.api.service.InspectionDetectionInfoService
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Optional
;
/**
/**
* 安全追溯-检验检测信息表
* 安全追溯-检验检测信息表
...
@@ -33,4 +42,16 @@ public class InspectionDetectionInfoServiceImpl extends BaseService<InspectionDe
...
@@ -33,4 +42,16 @@ public class InspectionDetectionInfoServiceImpl extends BaseService<InspectionDe
inspectionDetectionInfoDto
.
setSuperviseCode
(
superviseCode
);
inspectionDetectionInfoDto
.
setSuperviseCode
(
superviseCode
);
return
inspectionDetectionInfoDto
;
return
inspectionDetectionInfoDto
;
}
}
public
Map
<
String
,
Object
>
getNewInspectionDetailByRecord
(
String
record
)
{
IdxBizJgInspectionDetectionInfo
info
=
this
.
getBaseMapper
().
queryNewestDetailByRecord
(
record
);
if
(
info
==
null
)
return
Collections
.
emptyMap
();
Map
<
String
,
Object
>
result
=
new
HashMap
<>(
Bean
.
BeantoMap
(
info
));
result
.
put
(
"inspectReport"
,
JSON
.
parseArray
(
info
.
getInspectReport
()));
result
.
put
(
"inspectConclusionCode"
,
info
.
getInspectConclusion
());
result
.
put
(
"inspectConclusion"
,
Optional
.
ofNullable
(
dataDictionaryServiceImpl
.
getByCode
(
info
.
getInspectConclusion
(),
"JYJL"
))
.
map
(
DataDictionary:
:
getName
).
orElse
(
""
));
result
.
put
(
"jySeq"
,
info
.
getSequenceNbr
());
return
result
;
}
}
}
\ No newline at end of file
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