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
32ec6a48
Commit
32ec6a48
authored
Aug 28, 2025
by
tianbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(tcm): 优化监管机构数据同步和设备信息更新逻辑
- 重构了设备类别服务接口和实现类,增加了按监管机构代码前缀查询设备的功能- 优化了监管机构数据同步时设备信息更新的逻辑,提高了数据更新效率 - 修正了设备类别 DTO 中监管机构代码字段的注解,支持 keyword 类型查询
parent
3d9582f9
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
115 additions
and
50 deletions
+115
-50
TZSCommonConstant.java
...os/boot/module/common/api/constant/TZSCommonConstant.java
+10
-0
ESEquipmentCategory.java
.../amos/boot/module/common/api/dao/ESEquipmentCategory.java
+5
-0
ESEquipmentCategoryDto.java
...os/boot/module/common/api/dto/ESEquipmentCategoryDto.java
+8
-5
EquipChangeDataUpdateServiceImpl.java
.../edit/process/equip/EquipChangeDataUpdateServiceImpl.java
+1
-1
DataDockServiceImpl.java
.../boot/module/jg/biz/service/impl/DataDockServiceImpl.java
+1
-1
DataHandlerServiceImpl.java
...ot/module/jg/biz/service/impl/DataHandlerServiceImpl.java
+3
-3
IdxBizJgRegisterInfoServiceImpl.java
.../jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
+1
-1
JgInstallationNoticeServiceImpl.java
.../jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
+1
-1
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+1
-1
JgVehicleInformationServiceImpl.java
.../jg/biz/service/impl/JgVehicleInformationServiceImpl.java
+1
-1
PlatformOpMethodTypeEnum.java
...s/boot/module/tcm/api/enums/PlatformOpMethodTypeEnum.java
+1
-1
TzBaseEnterpriseInfoMapper.java
...oot/module/tcm/api/mapper/TzBaseEnterpriseInfoMapper.java
+2
-0
IEquipmentCategoryService.java
...oot/module/tcm/api/service/IEquipmentCategoryService.java
+1
-1
TzBaseEnterpriseInfoMapper.xml
.../src/main/resources/mapper/TzBaseEnterpriseInfoMapper.xml
+10
-0
PlatformUserTopicMessage.java
...oot/module/tcm/biz/listener/PlatformUserTopicMessage.java
+4
-2
EquipmentCategoryServiceImpl.java
...le/tcm/biz/service/impl/EquipmentCategoryServiceImpl.java
+7
-4
TzBaseEnterpriseInfoServiceImpl.java
...tcm/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
+58
-28
No files found.
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/constant/TZSCommonConstant.java
View file @
32ec6a48
...
@@ -20,4 +20,14 @@ public class TZSCommonConstant {
...
@@ -20,4 +20,14 @@ public class TZSCommonConstant {
public
static
final
String
STREET
=
"STREET"
;
public
static
final
String
STREET
=
"STREET"
;
public
static
final
String
PLATFORM_FEIGN_RESULT_KEY_COMPANY
=
"compnay"
;
public
static
final
String
PLATFORM_FEIGN_RESULT_KEY_COMPANY
=
"compnay"
;
public
static
final
String
REGULATOR_UNIT_TREE
=
"REGULATOR_UNIT_TREE"
;
/**
* 接收机构redis缓存key前置
*/
public
static
final
String
PREFIX_NOTICE_RECEIVE_UNIT_TREE
=
"NOTICE_RECEIVE_UNIT_TREE"
;
// 管辖机构redis缓存key
public
static
final
String
REGULATOR_UNIT_TREE_ALL
=
"REGULATOR_UNIT_TREE_ALL"
;
// 行政审批局redis缓存key
public
static
final
String
ADMINISTRATION_UNIT_TREE
=
"ADMINISTRATION_UNIT_TREE"
;
}
}
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dao/ESEquipmentCategory.java
View file @
32ec6a48
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.common.api.dao;
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.common.api.dao;
import
com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto
;
import
org.springframework.data.elasticsearch.annotations.Query
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
...
@@ -10,4 +11,8 @@ import java.util.List;
...
@@ -10,4 +11,8 @@ import java.util.List;
@Repository
@Repository
public
interface
ESEquipmentCategory
extends
PagingAndSortingRepository
<
ESEquipmentCategoryDto
,
String
>
{
public
interface
ESEquipmentCategory
extends
PagingAndSortingRepository
<
ESEquipmentCategoryDto
,
String
>
{
List
<
ESEquipmentCategoryDto
>
findAllByProjectContraptionId
(
String
PROJECT_CONTRAPTION_ID
);
List
<
ESEquipmentCategoryDto
>
findAllByProjectContraptionId
(
String
PROJECT_CONTRAPTION_ID
);
@Query
(
"{\"prefix\": {\"ORG_BRANCH_CODE.keyword\": \"?0\"}}"
)
List
<
ESEquipmentCategoryDto
>
findByOrgBranchCodeKeywordStartingWith
(
String
orgBranchCodePrefix
);
}
}
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/ESEquipmentCategoryDto.java
View file @
32ec6a48
...
@@ -3,9 +3,7 @@ package com.yeejoin.amos.boot.module.common.api.dto;
...
@@ -3,9 +3,7 @@ package com.yeejoin.amos.boot.module.common.api.dto;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.elasticsearch.annotations.Document
;
import
org.springframework.data.elasticsearch.annotations.*
;
import
org.springframework.data.elasticsearch.annotations.Field
;
import
org.springframework.data.elasticsearch.annotations.FieldType
;
/**
/**
* @Author cpp
* @Author cpp
...
@@ -23,8 +21,13 @@ public class ESEquipmentCategoryDto {
...
@@ -23,8 +21,13 @@ public class ESEquipmentCategoryDto {
@Field
(
type
=
FieldType
.
Text
)
@Field
(
type
=
FieldType
.
Text
)
private
String
ORG_BRANCH_NAME
;
private
String
ORG_BRANCH_NAME
;
@Field
(
type
=
FieldType
.
Text
)
@MultiField
(
private
String
ORG_BRANCH_CODE
;
mainField
=
@Field
(
type
=
FieldType
.
Text
,
name
=
"ORG_BRANCH_CODE"
),
otherFields
=
{
@InnerField
(
suffix
=
"keyword"
,
type
=
FieldType
.
Keyword
)
}
)
private
String
orgBranchCode
;
@Field
(
type
=
FieldType
.
Text
)
@Field
(
type
=
FieldType
.
Text
)
private
String
USE_UNIT_NAME
;
private
String
USE_UNIT_NAME
;
...
...
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 @
32ec6a48
...
@@ -382,7 +382,7 @@ public class EquipChangeDataUpdateServiceImpl {
...
@@ -382,7 +382,7 @@ public class EquipChangeDataUpdateServiceImpl {
if
(
optional
.
isPresent
())
{
if
(
optional
.
isPresent
())
{
ESEquipmentCategoryDto
esEquipmentCategoryDto
=
optional
.
get
();
ESEquipmentCategoryDto
esEquipmentCategoryDto
=
optional
.
get
();
if
(
equipSupervisionInfoChangeDataDto
.
getOrgBranchCode
()
!=
null
)
{
if
(
equipSupervisionInfoChangeDataDto
.
getOrgBranchCode
()
!=
null
)
{
esEquipmentCategoryDto
.
setO
RG_BRANCH_CODE
(
equipSupervisionInfoChangeDataDto
.
getOrgBranchCode
());
esEquipmentCategoryDto
.
setO
rgBranchCode
(
equipSupervisionInfoChangeDataDto
.
getOrgBranchCode
());
esEquipmentCategoryDto
.
setORG_BRANCH_NAME
(
equipSupervisionInfoChangeDataDto
.
getOrgBranchName
());
esEquipmentCategoryDto
.
setORG_BRANCH_NAME
(
equipSupervisionInfoChangeDataDto
.
getOrgBranchName
());
esEquipmentCategory
.
save
(
esEquipmentCategoryDto
);
esEquipmentCategory
.
save
(
esEquipmentCategoryDto
);
}
}
...
...
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/DataDockServiceImpl.java
View file @
32ec6a48
...
@@ -2234,7 +2234,7 @@ public class DataDockServiceImpl {
...
@@ -2234,7 +2234,7 @@ public class DataDockServiceImpl {
esEquipmentDto
.
setUSE_PLACE
(
paramsDto
.
getProvinceName
()
+
"/"
+
paramsDto
.
getCityName
()
+
"/"
+
paramsDto
.
getCountyName
()
+
"/"
+
paramsDto
.
getStreetName
());
esEquipmentDto
.
setUSE_PLACE
(
paramsDto
.
getProvinceName
()
+
"/"
+
paramsDto
.
getCityName
()
+
"/"
+
paramsDto
.
getCountyName
()
+
"/"
+
paramsDto
.
getStreetName
());
esEquipmentDto
.
setUSE_PLACE_CODE
(
paramsDto
.
getProvince
()
+
"#"
+
paramsDto
.
getCity
()
+
"#"
+
paramsDto
.
getCounty
()
+
"#"
+
paramsDto
.
getStreet
());
esEquipmentDto
.
setUSE_PLACE_CODE
(
paramsDto
.
getProvince
()
+
"#"
+
paramsDto
.
getCity
()
+
"#"
+
paramsDto
.
getCounty
()
+
"#"
+
paramsDto
.
getStreet
());
esEquipmentDto
.
setUSE_SITE_CODE
(
paramsDto
.
getUsePlace
());
esEquipmentDto
.
setUSE_SITE_CODE
(
paramsDto
.
getUsePlace
());
esEquipmentDto
.
setO
RG_BRANCH_CODE
(
paramsDto
.
getOrgBranchCode
());
esEquipmentDto
.
setO
rgBranchCode
(
paramsDto
.
getOrgBranchCode
());
esEquipmentDto
.
setORG_BRANCH_NAME
(
paramsDto
.
getOrgBranchName
());
esEquipmentDto
.
setORG_BRANCH_NAME
(
paramsDto
.
getOrgBranchName
());
esEquipmentDto
.
setEQU_STATE
(
1
);
esEquipmentDto
.
setEQU_STATE
(
1
);
esEquipmentDto
.
setEQU_CODE
(
paramsDto
.
getEquCode
());
esEquipmentDto
.
setEQU_CODE
(
paramsDto
.
getEquCode
());
...
...
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/DataHandlerServiceImpl.java
View file @
32ec6a48
...
@@ -2036,7 +2036,7 @@ public class DataHandlerServiceImpl {
...
@@ -2036,7 +2036,7 @@ public class DataHandlerServiceImpl {
}
}
List
<
Map
<
String
,
Object
>>
updateList
=
esResults
.
stream
()
List
<
Map
<
String
,
Object
>>
updateList
=
esResults
.
stream
()
.
filter
(
dto
->
StringUtils
.
isNotEmpty
(
dto
.
getO
RG_BRANCH_CODE
())
.
filter
(
dto
->
StringUtils
.
isNotEmpty
(
dto
.
getO
rgBranchCode
())
&&
StringUtils
.
isNotEmpty
(
dto
.
getSEQUENCE_NBR
())
&&
StringUtils
.
isNotEmpty
(
dto
.
getSEQUENCE_NBR
())
)
)
.
map
(
this
::
buildUpdateMap
)
.
map
(
this
::
buildUpdateMap
)
...
@@ -2061,9 +2061,9 @@ public class DataHandlerServiceImpl {
...
@@ -2061,9 +2061,9 @@ public class DataHandlerServiceImpl {
private
Map
<
String
,
Object
>
buildUpdateMap
(
ESEquipmentCategoryDto
dto
)
{
private
Map
<
String
,
Object
>
buildUpdateMap
(
ESEquipmentCategoryDto
dto
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"record"
,
dto
.
getSEQUENCE_NBR
());
map
.
put
(
"record"
,
dto
.
getSEQUENCE_NBR
());
map
.
put
(
"orgBranchCode"
,
dto
.
getO
RG_BRANCH_CODE
());
map
.
put
(
"orgBranchCode"
,
dto
.
getO
rgBranchCode
());
map
.
put
(
"orgBranchName"
,
dto
.
getORG_BRANCH_NAME
());
map
.
put
(
"orgBranchName"
,
dto
.
getORG_BRANCH_NAME
());
log
.
info
(
"==========>record,{},orgBranchCode,{},orgBranchName,{}"
,
dto
.
getSEQUENCE_NBR
(),
dto
.
getO
RG_BRANCH_CODE
(),
dto
.
getORG_BRANCH_NAME
());
log
.
info
(
"==========>record,{},orgBranchCode,{},orgBranchName,{}"
,
dto
.
getSEQUENCE_NBR
(),
dto
.
getO
rgBranchCode
(),
dto
.
getORG_BRANCH_NAME
());
return
map
;
return
map
;
}
}
...
...
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/IdxBizJgRegisterInfoServiceImpl.java
View file @
32ec6a48
...
@@ -4472,7 +4472,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -4472,7 +4472,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
esEquipmentDto
.
setEQU_LIST
(
equipInfoDto
.
getEquList
());
esEquipmentDto
.
setEQU_LIST
(
equipInfoDto
.
getEquList
());
esEquipmentDto
.
setEQU_DEFINE_CODE
(
equipInfoDto
.
getEquDefineCode
());
esEquipmentDto
.
setEQU_DEFINE_CODE
(
equipInfoDto
.
getEquDefineCode
());
esEquipmentDto
.
setSUPERVISORY_CODE
(
otherInfo
.
getSupervisoryCode
());
esEquipmentDto
.
setSUPERVISORY_CODE
(
otherInfo
.
getSupervisoryCode
());
esEquipmentDto
.
setO
RG_BRANCH_CODE
(
orgBranchCode
);
esEquipmentDto
.
setO
rgBranchCode
(
orgBranchCode
);
esEquipmentDto
.
setORG_BRANCH_NAME
(
orgBranchName
);
esEquipmentDto
.
setORG_BRANCH_NAME
(
orgBranchName
);
esEquipmentDto
.
setEQU_DEFINE
(
equipInfoDto
.
getEquDefine
());
esEquipmentDto
.
setEQU_DEFINE
(
equipInfoDto
.
getEquDefine
());
esEquipmentDto
.
setINFORMATION_SITUATION
(
otherInfo
.
getInformationSituation
());
esEquipmentDto
.
setINFORMATION_SITUATION
(
otherInfo
.
getInformationSituation
());
...
...
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/JgInstallationNoticeServiceImpl.java
View file @
32ec6a48
...
@@ -1969,7 +1969,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
...
@@ -1969,7 +1969,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
ESEquipmentCategoryDto
esEquipmentCategoryDto
=
optional
.
get
();
ESEquipmentCategoryDto
esEquipmentCategoryDto
=
optional
.
get
();
esEquipmentCategoryDto
.
setUSE_UNIT_CREDIT_CODE
(
null
);
esEquipmentCategoryDto
.
setUSE_UNIT_CREDIT_CODE
(
null
);
esEquipmentCategoryDto
.
setUSE_UNIT_NAME
(
null
);
esEquipmentCategoryDto
.
setUSE_UNIT_NAME
(
null
);
esEquipmentCategoryDto
.
setO
RG_BRANCH_CODE
(
null
);
esEquipmentCategoryDto
.
setO
rgBranchCode
(
null
);
esEquipmentCategoryDto
.
setORG_BRANCH_NAME
(
null
);
esEquipmentCategoryDto
.
setORG_BRANCH_NAME
(
null
);
esEquipmentCategoryDto
.
setSUPERVISORY_CODE
(
null
);
esEquipmentCategoryDto
.
setSUPERVISORY_CODE
(
null
);
esEquipmentCategoryDto
.
setCODE96333
(
null
);
esEquipmentCategoryDto
.
setCODE96333
(
null
);
...
...
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 @
32ec6a48
...
@@ -3826,7 +3826,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -3826,7 +3826,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
esEquipmentCategoryDto
.
setUSE_ORG_CODE
(
null
);
esEquipmentCategoryDto
.
setUSE_ORG_CODE
(
null
);
//esEquipmentCategoryDto.setSTATUS(null);
//esEquipmentCategoryDto.setSTATUS(null);
esEquipmentCategoryDto
.
setEQU_STATE
(
null
);
esEquipmentCategoryDto
.
setEQU_STATE
(
null
);
esEquipmentCategoryDto
.
setO
RG_BRANCH_CODE
(
null
);
esEquipmentCategoryDto
.
setO
rgBranchCode
(
null
);
esEquipmentCategoryDto
.
setORG_BRANCH_NAME
(
null
);
esEquipmentCategoryDto
.
setORG_BRANCH_NAME
(
null
);
if
(
jgConstructionInfo
!=
null
)
{
if
(
jgConstructionInfo
!=
null
)
{
esEquipmentCategoryDto
.
setUSC_UNIT_NAME
(
jgConstructionInfo
.
getUscUnitName
());
esEquipmentCategoryDto
.
setUSC_UNIT_NAME
(
jgConstructionInfo
.
getUscUnitName
());
...
...
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/JgVehicleInformationServiceImpl.java
View file @
32ec6a48
...
@@ -1608,7 +1608,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
...
@@ -1608,7 +1608,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
esEquipmentCategoryDto
.
setUSE_ORG_CODE
(
null
);
esEquipmentCategoryDto
.
setUSE_ORG_CODE
(
null
);
esEquipmentCategoryDto
.
setSTATUS
(
null
);
esEquipmentCategoryDto
.
setSTATUS
(
null
);
esEquipmentCategoryDto
.
setEQU_STATE
(
null
);
esEquipmentCategoryDto
.
setEQU_STATE
(
null
);
esEquipmentCategoryDto
.
setO
RG_BRANCH_CODE
(
null
);
esEquipmentCategoryDto
.
setO
rgBranchCode
(
null
);
esEquipmentCategoryDto
.
setORG_BRANCH_NAME
(
null
);
esEquipmentCategoryDto
.
setORG_BRANCH_NAME
(
null
);
esEquipmentCategory
.
save
(
esEquipmentCategoryDto
);
esEquipmentCategory
.
save
(
esEquipmentCategoryDto
);
}
}
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/api/enums/PlatformOpMethodTypeEnum.java
View file @
32ec6a48
...
@@ -11,7 +11,7 @@ import lombok.Getter;
...
@@ -11,7 +11,7 @@ import lombok.Getter;
@AllArgsConstructor
@AllArgsConstructor
public
enum
PlatformOpMethodTypeEnum
{
public
enum
PlatformOpMethodTypeEnum
{
CREATE
(
"create"
,
"创建"
),
INSERT
(
"insert"
,
"插入"
),
INSERT
(
"insert"
,
"插入"
),
UPDATE
(
"update"
,
"更新"
),
UPDATE
(
"update"
,
"更新"
),
DELETE
(
"delete"
,
"删除"
);
DELETE
(
"delete"
,
"删除"
);
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/api/mapper/TzBaseEnterpriseInfoMapper.java
View file @
32ec6a48
...
@@ -99,4 +99,6 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI
...
@@ -99,4 +99,6 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI
void
updateRedundantSupervisionOrgCodeUnit
(
String
newOrgName
,
String
newOrgCode
,
String
oldOrgCode
);
void
updateRedundantSupervisionOrgCodeUnit
(
String
newOrgName
,
String
newOrgCode
,
String
oldOrgCode
);
void
updateRedundantSupervisionOrgCodeStatistics
(
String
newOrgCode
,
String
oldOrgCode
);
void
updateRedundantSupervisionOrgCodeStatistics
(
String
newOrgCode
,
String
oldOrgCode
);
void
updateEquipmentSupervisionOrgCode
(
String
newOrgCode
,
String
newSupervisionName
,
List
<
String
>
equipmentList
);
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/api/service/IEquipmentCategoryService.java
View file @
32ec6a48
...
@@ -50,5 +50,5 @@ public interface IEquipmentCategoryService {
...
@@ -50,5 +50,5 @@ public interface IEquipmentCategoryService {
*/
*/
List
<
Map
<
String
,
Object
>>
unitEquipTree
();
List
<
Map
<
String
,
Object
>>
unitEquipTree
();
void
deleteRegulatorUnitTree
();
void
delete
All
RegulatorUnitTree
();
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/resources/mapper/TzBaseEnterpriseInfoMapper.xml
View file @
32ec6a48
...
@@ -421,4 +421,14 @@
...
@@ -421,4 +421,14 @@
set supervisory_unit_org_code = replace(supervisory_unit_org_code, #{oldOrgCode}, #{newOrgCode})
set supervisory_unit_org_code = replace(supervisory_unit_org_code, #{oldOrgCode}, #{newOrgCode})
where supervisory_unit_org_code like concat(#{oldOrgCode}, '%');
where supervisory_unit_org_code like concat(#{oldOrgCode}, '%');
</update>
</update>
<update
id=
"updateEquipmentSupervisionOrgCode"
>
update idx_biz_jg_supervision_info
set "ORG_BRANCH_CODE" = #{newOrgCode},
"ORG_BRANCH_NAME" = #{newSupervisionName}
where "RECORD" in
<foreach
collection =
'equipmentList'
item=
'record'
open=
"("
close=
")"
separator=
","
>
#{record}
</foreach>
</update>
</mapper>
</mapper>
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/listener/PlatformUserTopicMessage.java
View file @
32ec6a48
...
@@ -79,6 +79,7 @@ public class PlatformUserTopicMessage extends EmqxListener {
...
@@ -79,6 +79,7 @@ public class PlatformUserTopicMessage extends EmqxListener {
}
}
protected
void
processOrgCodeUpdateMessage
(
MqttMessage
message
)
{
protected
void
processOrgCodeUpdateMessage
(
MqttMessage
message
)
{
log
.
info
(
"平台推送组织架构层级变动消息开始: "
+
message
);
try
{
try
{
if
(
ValidationUtil
.
isEmpty
(
message
))
{
if
(
ValidationUtil
.
isEmpty
(
message
))
{
return
;
return
;
...
@@ -88,9 +89,10 @@ public class PlatformUserTopicMessage extends EmqxListener {
...
@@ -88,9 +89,10 @@ public class PlatformUserTopicMessage extends EmqxListener {
String
oldOrgCode
=
jsonObject
.
getString
(
"oldOrgCode"
);
String
oldOrgCode
=
jsonObject
.
getString
(
"oldOrgCode"
);
tzBaseEnterpriseInfoService
.
refreshCompanyOrgCode
(
jsonObject
,
newOrgCode
,
oldOrgCode
);
tzBaseEnterpriseInfoService
.
refreshCompanyOrgCode
(
jsonObject
,
newOrgCode
,
oldOrgCode
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
info
(
"
平台同步
消息失败:{}"
,
e
.
getMessage
());
log
.
info
(
"
处理平台推送组织架构层级变动
消息失败:{}"
,
e
.
getMessage
());
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
log
.
info
(
"平台推送组织架构层级变动消息结束"
);
}
}
protected
void
processOpMessage
(
MqttMessage
message
)
{
protected
void
processOpMessage
(
MqttMessage
message
)
{
...
@@ -116,7 +118,7 @@ public class PlatformUserTopicMessage extends EmqxListener {
...
@@ -116,7 +118,7 @@ public class PlatformUserTopicMessage extends EmqxListener {
if
(!
ValidationUtil
.
isEmpty
(
dataResult
)
&&
StringUtils
.
isNotEmpty
(
path
))
{
if
(!
ValidationUtil
.
isEmpty
(
dataResult
)
&&
StringUtils
.
isNotEmpty
(
path
))
{
if
(
path
.
contains
(
"company"
))
{
if
(
path
.
contains
(
"company"
))
{
if
(
"监管机构"
.
equals
(
dataResult
.
get
(
"companyType"
)))
{
if
(
"监管机构"
.
equals
(
dataResult
.
get
(
"companyType"
)))
{
equipmentCategoryService
.
deleteRegulatorUnitTree
();
equipmentCategoryService
.
delete
All
RegulatorUnitTree
();
}
}
tzBaseEnterpriseInfoService
.
refreshCompanyInfo
(
dataResult
,
method
);
tzBaseEnterpriseInfoService
.
refreshCompanyInfo
(
dataResult
,
method
);
}
else
if
(
path
.
contains
(
"agencyuser"
))
{
}
else
if
(
path
.
contains
(
"agencyuser"
))
{
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/service/impl/EquipmentCategoryServiceImpl.java
View file @
32ec6a48
...
@@ -70,6 +70,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
...
@@ -70,6 +70,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
com
.
alibaba
.
fastjson
.
JSON
.
toJSONString
;
import
static
com
.
alibaba
.
fastjson
.
JSON
.
toJSONString
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
constant
.
TZSCommonConstant
.*;
/**
/**
* 装备分类服务实现类
* 装备分类服务实现类
...
@@ -87,8 +88,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -87,8 +88,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
final
static
String
NOT_CREATE
=
"0"
;
final
static
String
NOT_CREATE
=
"0"
;
@Autowired
@Autowired
private
static
final
String
TABLENAME
=
"tableName"
;
private
static
final
String
TABLENAME
=
"tableName"
;
//管辖机构redis缓存key
private
static
final
String
REGULATOR_UNIT_TREE
=
"REGULATOR_UNIT_TREE"
;
//行政区划redis缓存key
//行政区划redis缓存key
private
static
final
String
PROVINCE
=
"PROVINCE"
;
private
static
final
String
PROVINCE
=
"PROVINCE"
;
private
static
final
String
CITY
=
"CITY"
;
private
static
final
String
CITY
=
"CITY"
;
...
@@ -310,8 +310,11 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -310,8 +310,11 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
/**
/**
* 删除缓存中管辖机构树
* 删除缓存中管辖机构树
*/
*/
public
void
deleteRegulatorUnitTree
()
{
public
void
deleteAllRegulatorUnitTree
()
{
redisUtils
.
del
(
REGULATOR_UNIT_TREE
);
redisUtils
.
getAndDeletePatternKeys
(
REGULATOR_UNIT_TREE
+
"*"
);
redisUtils
.
getAndDeletePatternKeys
(
PREFIX_NOTICE_RECEIVE_UNIT_TREE
+
"*"
);
redisUtils
.
getAndDeletePatternKeys
(
REGULATOR_UNIT_TREE_ALL
);
redisUtils
.
getAndDeletePatternKeys
(
ADMINISTRATION_UNIT_TREE
);
}
}
/**
/**
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
View file @
32ec6a48
...
@@ -1416,6 +1416,7 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -1416,6 +1416,7 @@ public class TzBaseEnterpriseInfoServiceImpl
// 如果消息中的单位是企业
// 如果消息中的单位是企业
if
(!
companyBo
.
getCompanyType
().
equals
(
"监管机构"
))
{
if
(!
companyBo
.
getCompanyType
().
equals
(
"监管机构"
))
{
switch
(
Objects
.
requireNonNull
(
PlatformOpMethodTypeEnum
.
getEnumByCode
(
method
)))
{
switch
(
Objects
.
requireNonNull
(
PlatformOpMethodTypeEnum
.
getEnumByCode
(
method
)))
{
case
CREATE:
case
INSERT:
case
INSERT:
case
DELETE:
case
DELETE:
// 暂无操作
// 暂无操作
...
@@ -1453,6 +1454,7 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -1453,6 +1454,7 @@ public class TzBaseEnterpriseInfoServiceImpl
@Transactional
@Transactional
@Async
@Async
public
void
refreshCompanyOrgCode
(
JSONObject
dataResult
,
String
newOrgCode
,
String
oldOrgCode
)
{
public
void
refreshCompanyOrgCode
(
JSONObject
dataResult
,
String
newOrgCode
,
String
oldOrgCode
)
{
log
.
info
(
"开始刷新单位orgCode:{}"
,
dataResult
);
try
{
try
{
if
(!
ValidationUtil
.
isEmpty
(
newOrgCode
)
&&
!
ValidationUtil
.
isEmpty
(
oldOrgCode
)
&&
!
newOrgCode
.
equals
(
oldOrgCode
))
{
if
(!
ValidationUtil
.
isEmpty
(
newOrgCode
)
&&
!
ValidationUtil
.
isEmpty
(
oldOrgCode
)
&&
!
newOrgCode
.
equals
(
oldOrgCode
))
{
JSONObject
newModel
=
(
JSONObject
)
dataResult
.
get
(
"newModel"
);
JSONObject
newModel
=
(
JSONObject
)
dataResult
.
get
(
"newModel"
);
...
@@ -1465,7 +1467,7 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -1465,7 +1467,7 @@ public class TzBaseEnterpriseInfoServiceImpl
// 3.2 更新业务表统计表冗余的监管单位orgCode
// 3.2 更新业务表统计表冗余的监管单位orgCode
tzBaseEnterpriseInfoMapper
.
updateRedundantSupervisionOrgCodeStatistics
(
newOrgCode
,
oldOrgCode
);
tzBaseEnterpriseInfoMapper
.
updateRedundantSupervisionOrgCodeStatistics
(
newOrgCode
,
oldOrgCode
);
// 4. 更新idx_biz_view_jg_all es设备信息
// 4. 更新idx_biz_view_jg_all es设备信息
updateEquipmentJgAllEs
(
newOrgCode
,
oldOrgCode
,
equipmentRecordList
);
updateEquipmentJgAllEs
(
newOrgCode
,
oldOrgCode
,
equipmentRecordList
,
newModel
.
getString
(
"companyName"
)
);
// 5. 发送数据刷新事件 - 内存分页处理
// 5. 发送数据刷新事件 - 内存分页处理
// 处理企业数据
// 处理企业数据
publishDataRefreshEvents
(
companySeqList
,
DataRefreshEvent
.
DataType
.
enterprise
,
1000
);
publishDataRefreshEvents
(
companySeqList
,
DataRefreshEvent
.
DataType
.
enterprise
,
1000
);
...
@@ -1476,33 +1478,61 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -1476,33 +1478,61 @@ public class TzBaseEnterpriseInfoServiceImpl
willInfo
(
"refreshCompanyOrgCode"
,
dataResult
,
"orgCodeUpdate"
,
e
);
willInfo
(
"refreshCompanyOrgCode"
,
dataResult
,
"orgCodeUpdate"
,
e
);
log
.
error
(
"刷新单位orgCode发生异常"
,
e
);
log
.
error
(
"刷新单位orgCode发生异常"
,
e
);
}
}
log
.
info
(
"刷新单位orgCode结束"
);
}
}
private
void
updateEquipmentJgAllEs
(
String
newOrgCode
,
String
oldOrgCode
,
List
<
String
>
equipmentRecordList
)
{
private
void
updateEquipmentJgAllEs
(
String
newOrgCode
,
String
oldOrgCode
,
List
<
String
>
equipmentRecordList
,
String
supervisionName
)
{
if
(
ValidationUtil
.
isEmpty
(
equipmentRecordList
))
{
log
.
info
(
"开始更新idx_biz_view_jg_all es设备属地监管部门信息,新orgCode{}, 旧orgCode:{}"
,
newOrgCode
,
oldOrgCode
);
return
;
if
(!
ValidationUtil
.
isEmpty
(
equipmentRecordList
))
{
int
batchSize
=
1000
;
for
(
int
i
=
0
;
i
<
equipmentRecordList
.
size
();
i
+=
batchSize
)
{
int
endIndex
=
Math
.
min
(
i
+
batchSize
,
equipmentRecordList
.
size
());
List
<
String
>
subList
=
equipmentRecordList
.
subList
(
i
,
endIndex
);
Iterable
<
ESEquipmentCategoryDto
>
equipmentCategoryIterator
=
esEquipmentCategory
.
findAllById
(
subList
);
List
<
ESEquipmentCategoryDto
>
updatedCategories
=
new
ArrayList
<>();
equipmentCategoryIterator
.
forEach
(
equipmentCategory
->
{
if
(
ValidationUtil
.
isEmpty
(
equipmentCategory
.
getOrgBranchCode
()))
{
equipmentCategory
.
setOrgBranchCode
(
newOrgCode
);
// 补偿旧数据es属地监管部门为空,则用数据库中设备属地监管部门更新
}
else
{
equipmentCategory
.
setOrgBranchCode
(
equipmentCategory
.
getOrgBranchCode
().
replace
(
oldOrgCode
,
newOrgCode
));
}
updatedCategories
.
add
(
equipmentCategory
);
});
if
(!
updatedCategories
.
isEmpty
())
{
esEquipmentCategory
.
saveAll
(
updatedCategories
);
}
}
}
}
int
batchSize
=
1000
;
// 根据旧属地监管部门orgCode查找es对应设备,更新数据库中设备属地字段
for
(
int
i
=
0
;
i
<
equipmentRecordList
.
size
();
i
+=
batchSize
)
{
List
<
ESEquipmentCategoryDto
>
esEquipmentCategoryList
=
esEquipmentCategory
.
findByOrgBranchCodeKeywordStartingWith
(
oldOrgCode
);
int
endIndex
=
Math
.
min
(
i
+
batchSize
,
equipmentRecordList
.
size
());
if
(!
ValidationUtil
.
isEmpty
(
esEquipmentCategoryList
))
{
List
<
String
>
subList
=
equipmentRecordList
.
subList
(
i
,
endIndex
);
List
<
String
>
esRecordList
=
Lists
.
newArrayList
();
List
<
ESEquipmentCategoryDto
>
updatedEsDtoList
=
ValidationUtil
.
isEmpty
(
equipmentRecordList
)
?
esEquipmentCategoryList
:
esEquipmentCategoryList
.
stream
().
filter
(
esDto
->
!
equipmentRecordList
.
contains
(
esDto
.
getSEQUENCE_NBR
())).
collect
(
Collectors
.
toList
());
Iterable
<
ESEquipmentCategoryDto
>
equipmentCategoryIterator
=
esEquipmentCategory
.
findAllById
(
subList
);
log
.
info
(
"开始更新es设备有属地监管部门,数据库无属地监管部门的设备信息。需更新数据{}条"
,
updatedEsDtoList
.
size
());
List
<
ESEquipmentCategoryDto
>
updatedCategories
=
new
ArrayList
<>();
if
(!
ValidationUtil
.
isEmpty
(
updatedEsDtoList
))
{
updatedEsDtoList
.
forEach
(
esDto
->
{
equipmentCategoryIterator
.
forEach
(
equipmentCategory
->
{
esDto
.
setOrgBranchCode
(
esDto
.
getOrgBranchCode
().
replace
(
oldOrgCode
,
newOrgCode
));
if
(
ValidationUtil
.
isEmpty
(
equipmentCategory
.
getORG_BRANCH_CODE
()))
{
esDto
.
setORG_BRANCH_NAME
(
supervisionName
);
equipmentCategory
.
setORG_BRANCH_CODE
(
newOrgCode
);
// 补偿旧数据es属地监管部门为空,则用数据库中设备属地监管部门更新
esRecordList
.
add
(
esDto
.
getSEQUENCE_NBR
());
}
else
{
});
equipmentCategory
.
setORG_BRANCH_CODE
(
equipmentCategory
.
getORG_BRANCH_CODE
().
replace
(
oldOrgCode
,
newOrgCode
));
int
batchSize
=
1000
;
for
(
int
i
=
0
;
i
<
updatedEsDtoList
.
size
();
i
+=
batchSize
)
{
int
endIndex
=
Math
.
min
(
i
+
batchSize
,
updatedEsDtoList
.
size
());
List
<
ESEquipmentCategoryDto
>
subList
=
updatedEsDtoList
.
subList
(
i
,
endIndex
);
esEquipmentCategory
.
saveAll
(
subList
);
}
for
(
int
i
=
0
;
i
<
esRecordList
.
size
();
i
+=
batchSize
)
{
int
endIndex
=
Math
.
min
(
i
+
batchSize
,
esRecordList
.
size
());
List
<
String
>
subList
=
esRecordList
.
subList
(
i
,
endIndex
);
tzBaseEnterpriseInfoMapper
.
updateEquipmentSupervisionOrgCode
(
newOrgCode
,
supervisionName
,
subList
);
}
}
updatedCategories
.
add
(
equipmentCategory
);
});
if
(!
updatedCategories
.
isEmpty
())
{
esEquipmentCategory
.
saveAll
(
updatedCategories
);
}
}
log
.
info
(
"更新数据库设备有属地监管部门,数据库无属地监管部门的设备结束"
);
}
}
log
.
info
(
"更新idx_biz_view_jg_all es设备属地监管部门信息结束"
);
}
}
/**
/**
...
@@ -1533,12 +1563,12 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -1533,12 +1563,12 @@ public class TzBaseEnterpriseInfoServiceImpl
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
}
}
}
// 休眠50毫秒再发送
// 休眠50毫秒再发送
try
{
try
{
Thread
.
sleep
(
50
);
Thread
.
sleep
(
100
);
}
catch
(
InterruptedException
e
)
{
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
}
}
}
});
});
...
...
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