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
6763ef31
Commit
6763ef31
authored
Aug 20, 2025
by
suhuiguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_tzs_register' of…
Merge branch 'develop_tzs_register' of
http://39.100.92.250:5000/moa/amos-boot-biz
into develop_tzs_register
parents
3fb61c16
8851fb12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
129 additions
and
101 deletions
+129
-101
TZSCommonConstant.java
...os/boot/module/common/api/constant/TZSCommonConstant.java
+2
-0
JgCertificateReplenishMapper.xml
...rc/main/resources/mapper/JgCertificateReplenishMapper.xml
+1
-1
JgMaintainNoticeMapper.xml
...-api/src/main/resources/mapper/JgMaintainNoticeMapper.xml
+1
-1
JgTransferNoticeMapper.xml
...-api/src/main/resources/mapper/JgTransferNoticeMapper.xml
+4
-4
TzBaseEnterpriseInfoMapper.java
...oot/module/tcm/api/mapper/TzBaseEnterpriseInfoMapper.java
+3
-1
TzBaseEnterpriseInfoMapper.xml
.../src/main/resources/mapper/TzBaseEnterpriseInfoMapper.xml
+65
-54
HistoryDataDealController.java
.../module/tcm/biz/controller/HistoryDataDealController.java
+9
-8
PlatformUserTopicMessage.java
...oot/module/tcm/biz/listener/PlatformUserTopicMessage.java
+0
-3
HistoryDataDealServiceImpl.java
...dule/tcm/biz/service/impl/HistoryDataDealServiceImpl.java
+20
-6
TzBaseEnterpriseInfoServiceImpl.java
...tcm/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
+7
-2
EquipmentCategoryEnum.java
...amos/boot/module/ymt/api/enums/EquipmentCategoryEnum.java
+2
-9
EquipmentCategoryServiceImpl.java
...le/ymt/biz/service/impl/EquipmentCategoryServiceImpl.java
+15
-12
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 @
6763ef31
...
@@ -18,4 +18,6 @@ public class TZSCommonConstant {
...
@@ -18,4 +18,6 @@ public class TZSCommonConstant {
public
static
final
String
CITY
=
"CITY"
;
public
static
final
String
CITY
=
"CITY"
;
public
static
final
String
REGION
=
"REGION"
;
public
static
final
String
REGION
=
"REGION"
;
public
static
final
String
STREET
=
"STREET"
;
public
static
final
String
STREET
=
"STREET"
;
public
static
final
String
PLATFORM_FEIGN_RESULT_KEY_COMPANY
=
"compnay"
;
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgCertificateReplenishMapper.xml
View file @
6763ef31
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
</if>
</if>
<if
test=
"type == 'supervision'"
>
<if
test=
"type == 'supervision'"
>
AND tjcr.instance_id
<![CDATA[<>]]>
''
AND tjcr.instance_id
<![CDATA[<>]]>
''
AND tjcr.receive_
company
_code = #{companyCode}
AND tjcr.receive_
org
_code = #{companyCode}
</if>
</if>
<if
test=
"type == 'enterprise'"
>
<if
test=
"type == 'enterprise'"
>
AND tjcr.use_unit_code = #{dto.useUnitCode}
AND tjcr.use_unit_code = #{dto.useUnitCode}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgMaintainNoticeMapper.xml
View file @
6763ef31
...
@@ -135,7 +135,7 @@
...
@@ -135,7 +135,7 @@
AND (isn.receive_company_code = #{companyCode} or isn.transfer_to_user_ids like concat('%',#{userId},'%'))
AND (isn.receive_company_code = #{companyCode} or isn.transfer_to_user_ids like concat('%',#{userId},'%'))
</if>
</if>
<if
test=
"type == 'company'"
>
<if
test=
"type == 'company'"
>
AND (isn.install_unit_credit_code = #{
param.useUnitCredit
Code} or isn.transfer_to_user_ids like
AND (isn.install_unit_credit_code = #{
company
Code} or isn.transfer_to_user_ids like
concat('%',#{userId},'%'))
concat('%',#{userId},'%'))
</if>
</if>
<if
test=
"orgCode != null and orgCode != ''"
>
<if
test=
"orgCode != null and orgCode != ''"
>
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgTransferNoticeMapper.xml
View file @
6763ef31
...
@@ -97,19 +97,19 @@
...
@@ -97,19 +97,19 @@
</foreach>
</foreach>
</if>
</if>
<if
test=
"type == 'supervision'"
>
<if
test=
"type == 'supervision'"
>
AND (tjtn.receive_company_code = #{
org
Code} or tjtn.transfer_to_user_ids like
AND (tjtn.receive_company_code = #{
company
Code} or tjtn.transfer_to_user_ids like
concat('%',#{param.transferToUserIds},'%'))
concat('%',#{param.transferToUserIds},'%'))
AND tjtn.instance_id
<![CDATA[<>]]>
''
AND tjtn.instance_id
<![CDATA[<>]]>
''
</if>
</if>
<if
test=
"type == 'company'"
>
<if
test=
"type == 'company'"
>
AND (tjtn.install_unit_credit_code = #{
org
Code} or tjtn.transfer_to_user_ids like
AND (tjtn.install_unit_credit_code = #{
company
Code} or tjtn.transfer_to_user_ids like
concat('%',#{param.transferToUserIds},'%'))
concat('%',#{param.transferToUserIds},'%'))
</if>
</if>
<if
test=
"type == 'testAdmin'"
>
<if
test=
"type == 'testAdmin'"
>
((AND tjtn.receive_company_code = #{
org
Code}
((AND tjtn.receive_company_code = #{
company
Code}
AND tjtn.instance_id
<![CDATA[<>]]>
'')
AND tjtn.instance_id
<![CDATA[<>]]>
'')
or
or
AND tjtn.install_unit_credit_code = #{
org
Code})
AND tjtn.install_unit_credit_code = #{
company
Code})
</if>
</if>
<if
test=
"orgCode != null and orgCode != ''"
>
<if
test=
"orgCode != null and orgCode != ''"
>
AND tjtn.instance_id
<![CDATA[<>]]>
''
AND tjtn.instance_id
<![CDATA[<>]]>
''
...
...
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 @
6763ef31
...
@@ -96,5 +96,7 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI
...
@@ -96,5 +96,7 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI
List
<
String
>
selectCompanyBySupervisionOrgCode
(
String
oldOrgCode
);
List
<
String
>
selectCompanyBySupervisionOrgCode
(
String
oldOrgCode
);
void
updateRedundantSupervisionOrgCode
(
String
newOrgCode
,
String
oldOrgCode
);
void
updateRedundantSupervisionOrgCodeUnit
(
String
newOrgCode
,
String
oldOrgCode
);
void
updateRedundantSupervisionOrgCodeStatistics
(
String
newOrgCode
,
String
oldOrgCode
);
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/resources/mapper/TzBaseEnterpriseInfoMapper.xml
View file @
6763ef31
...
@@ -263,50 +263,13 @@
...
@@ -263,50 +263,13 @@
where supervise_org_code LIKE CONCAT(#{oldOrgCode}, '%')
where supervise_org_code LIKE CONCAT(#{oldOrgCode}, '%')
</select>
</select>
<update
id=
"updateRedundantSupervisionOrgCode"
>
<update
id=
"updateRedundantSupervisionOrgCode
Unit
"
>
update tz_base_enterprise_info
update tz_base_enterprise_info
set supervise_org_code = replace(supervise_org_code, #{oldOrgCode}, #{newOrgCode})
set supervise_org_code = replace(supervise_org_code, #{oldOrgCode}, #{newOrgCode})
where supervise_org_code like concat(#{oldOrgCode}, '%');
where supervise_org_code like concat(#{oldOrgCode}, '%');
update tz_base_enterprise_info
update tz_base_enterprise_info
set org_code = replace(org_code, #{oldOrgCode}, #{newOrgCode})
set org_code = replace(org_code, #{oldOrgCode}, #{newOrgCode})
where org_code like concat(#{oldOrgCode}, '%');
where org_code like concat(#{oldOrgCode}, '%');
--三项制度因为会定时生成统计数据(刚好在层级调整后生成了统计数据,此时再单位层级树再调整会原有,根据该表的唯一约束会提示更新冲突),所以需要特殊处理(如果目标数据存在则不更新,并删除旧的统计数据)
WITH update_data AS (
SELECT
ctid,
REPLACE(supervisory_unit_org_code, #{oldOrgCode}, #{newOrgCode}) AS new_code,
plan_type,
check_date
FROM tzs_three_systems
WHERE supervisory_unit_org_code LIKE concat(#{oldOrgCode}, '%')
),
conflicts AS (
SELECT u.ctid
FROM update_data u
JOIN tzs_three_systems t ON
t.supervisory_unit_org_code = u.new_code
AND t.plan_type = u.plan_type
AND t.check_date = u.check_date
),
updated AS (
UPDATE tzs_three_systems t
SET supervisory_unit_org_code = REPLACE(t.supervisory_unit_org_code, #{oldOrgCode}, #{newOrgCode})
FROM update_data u
WHERE t.ctid = u.ctid
AND t.ctid NOT IN (SELECT ctid FROM conflicts)
RETURNING t.ctid
)
DELETE FROM tzs_three_systems
WHERE supervisory_unit_org_code LIKE concat(#{oldOrgCode}, '%')
AND ctid NOT IN (SELECT ctid FROM updated);
update tzs_two_staffing
set supervisory_unit_orgcode = replace(supervisory_unit_orgcode, #{oldOrgCode}, #{newOrgCode})
where supervisory_unit_orgcode like concat(#{oldOrgCode}, '%');
update biz_jg_equipment_category_data
set org_branch_code = replace(org_branch_code, #{oldOrgCode}, #{newOrgCode})
where org_branch_code like concat(#{oldOrgCode}, '%');
update tzs_jg_vehicle_information
update tzs_jg_vehicle_information
set org_branch_code = replace(org_branch_code, #{oldOrgCode}, #{newOrgCode})
set org_branch_code = replace(org_branch_code, #{oldOrgCode}, #{newOrgCode})
...
@@ -382,22 +345,6 @@
...
@@ -382,22 +345,6 @@
set org_code = replace(org_code, #{oldOrgCode}, #{newOrgCode})
set org_code = replace(org_code, #{oldOrgCode}, #{newOrgCode})
where org_code like concat(#{oldOrgCode}, '%');
where org_code like concat(#{oldOrgCode}, '%');
update tzs_alert_dispatch_statistics
set supervisory_unit_org_code = replace(supervisory_unit_org_code, #{oldOrgCode}, #{newOrgCode})
where supervisory_unit_org_code like concat(#{oldOrgCode}, '%');
update tzs_alert_maintenance_unit_statistics
set supervisory_unit_org_code = replace(supervisory_unit_org_code, #{oldOrgCode}, #{newOrgCode})
where supervisory_unit_org_code like concat(#{oldOrgCode}, '%');
update tzs_alert_rescue_statistics
set supervisory_unit_org_code = replace(supervisory_unit_org_code, #{oldOrgCode}, #{newOrgCode})
where supervisory_unit_org_code like concat(#{oldOrgCode}, '%');
update tzs_alert_statistics
set supervisory_unit_org_code = replace(supervisory_unit_org_code, #{oldOrgCode}, #{newOrgCode})
where supervisory_unit_org_code like concat(#{oldOrgCode}, '%');
update tzs_alert_use_unit_statistics
set supervisory_unit_org_code = replace(supervisory_unit_org_code, #{oldOrgCode}, #{newOrgCode})
where supervisory_unit_org_code like concat(#{oldOrgCode}, '%');
update tzs_feedback_suggestions
update tzs_feedback_suggestions
set supervise_org_code = replace(supervise_org_code, #{oldOrgCode}, #{newOrgCode})
set supervise_org_code = replace(supervise_org_code, #{oldOrgCode}, #{newOrgCode})
where supervise_org_code like concat(#{oldOrgCode}, '%');
where supervise_org_code like concat(#{oldOrgCode}, '%');
...
@@ -409,4 +356,68 @@
...
@@ -409,4 +356,68 @@
set risk_disposal_unit_org_code = replace(risk_disposal_unit_org_code, #{oldOrgCode}, #{newOrgCode})
set risk_disposal_unit_org_code = replace(risk_disposal_unit_org_code, #{oldOrgCode}, #{newOrgCode})
where risk_disposal_unit_org_code like concat(#{oldOrgCode}, '%');
where risk_disposal_unit_org_code like concat(#{oldOrgCode}, '%');
</update>
</update>
<update
id=
"updateRedundantSupervisionOrgCodeStatistics"
>
--三项制度因为会定时生成统计数据(刚好在层级调整后生成了统计数据,此时再单位层级树再调整会原有,根据该表的唯一约束会提示更新冲突),所以需要特殊处理(如果目标数据存在则不更新,并删除旧的统计数据)
WITH potential_updates AS (
SELECT
ctid,
supervisory_unit_org_code AS old_code,
REPLACE(supervisory_unit_org_code, #{oldOrgCode}, #{newOrgCode}) AS new_code,
plan_type,
check_date
FROM tzs_three_systems
WHERE supervisory_unit_org_code LIKE concat (#{oldOrgCode}, '%' )
),
conflict_check AS (
SELECT
pu.*,
EXISTS (
SELECT 1 FROM tzs_three_systems t
WHERE t.supervisory_unit_org_code = pu.new_code
AND t.plan_type = pu.plan_type
AND t.check_date = pu.check_date
) AS has_conflict
FROM potential_updates pu
),
updated AS (
UPDATE tzs_three_systems t
SET supervisory_unit_org_code = cc.new_code
FROM conflict_check cc
WHERE t.ctid = cc.ctid
AND NOT cc.has_conflict
RETURNING t.ctid, cc.old_code
)
DELETE FROM tzs_three_systems t
WHERE EXISTS (
SELECT 1 FROM conflict_check cc
WHERE cc.ctid = t.ctid
AND cc.has_conflict
AND t.supervisory_unit_org_code = cc.old_code
);
update tzs_two_staffing
set supervisory_unit_orgcode = replace(supervisory_unit_orgcode, #{oldOrgCode}, #{newOrgCode})
where supervisory_unit_orgcode like concat(#{oldOrgCode}, '%');
update biz_jg_equipment_category_data
set org_branch_code = replace(org_branch_code, #{oldOrgCode}, #{newOrgCode})
where org_branch_code like concat(#{oldOrgCode}, '%');
update tzs_alert_dispatch_statistics
set supervisory_unit_org_code = replace(supervisory_unit_org_code, #{oldOrgCode}, #{newOrgCode})
where supervisory_unit_org_code like concat(#{oldOrgCode}, '%');
update tzs_alert_maintenance_unit_statistics
set supervisory_unit_org_code = replace(supervisory_unit_org_code, #{oldOrgCode}, #{newOrgCode})
where supervisory_unit_org_code like concat(#{oldOrgCode}, '%');
update tzs_alert_rescue_statistics
set supervisory_unit_org_code = replace(supervisory_unit_org_code, #{oldOrgCode}, #{newOrgCode})
where supervisory_unit_org_code like concat(#{oldOrgCode}, '%');
update tzs_alert_statistics
set supervisory_unit_org_code = replace(supervisory_unit_org_code, #{oldOrgCode}, #{newOrgCode})
where supervisory_unit_org_code like concat(#{oldOrgCode}, '%');
update tzs_alert_use_unit_statistics
set supervisory_unit_org_code = replace(supervisory_unit_org_code, #{oldOrgCode}, #{newOrgCode})
where supervisory_unit_org_code like concat(#{oldOrgCode}, '%');
</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/controller/HistoryDataDealController.java
View file @
6763ef31
...
@@ -3,15 +3,15 @@ package com.yeejoin.amos.boot.module.tcm.biz.controller;
...
@@ -3,15 +3,15 @@ package com.yeejoin.amos.boot.module.tcm.biz.controller;
import
com.yeejoin.amos.boot.module.tcm.biz.service.impl.HistoryDataDealServiceImpl
;
import
com.yeejoin.amos.boot.module.tcm.biz.service.impl.HistoryDataDealServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @author Administrator
* @author Administrator
*/
*/
...
@@ -47,11 +47,12 @@ public class HistoryDataDealController {
...
@@ -47,11 +47,12 @@ public class HistoryDataDealController {
return
ResponseHelper
.
buildResponse
(
historyDataDealService
.
unitOrgCodeUpdate
(
oldOrgCode
,
newOrgCode
));
return
ResponseHelper
.
buildResponse
(
historyDataDealService
.
unitOrgCodeUpdate
(
oldOrgCode
,
newOrgCode
));
}
}
@Deprecated
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@P
u
tMapping
(
value
=
"/handleCompanyHisOrgCode"
)
@P
os
tMapping
(
value
=
"/handleCompanyHisOrgCode"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"监管单位层级调整后,业务表(企业、设备、统计等)冗余的所有旧orgCode替换为新orgCode
"
,
notes
=
"监管单位层级调整后,业务表(企业、设备、统计等)冗余的所有旧orgCode替换为新orgCode
"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"监管单位层级调整后,业务表(企业、设备、统计等)冗余的所有旧orgCode替换为新orgCode
,不更新平台表"
,
notes
=
"监管单位层级调整后,业务表(企业、设备、统计等)冗余的所有旧orgCode替换为新orgCode,不更新平台表
"
)
public
ResponseModel
<
String
>
handleCompanyHisOrgCode
(
@Request
Param
String
newOrgCode
,
@RequestParam
String
oldOrgCode
)
{
public
ResponseModel
<
String
>
handleCompanyHisOrgCode
(
@Request
Body
List
<
Map
<
String
,
Object
>>
orgCodeMap
)
{
return
ResponseHelper
.
buildResponse
(
historyDataDealService
.
handleCompanyHisOrgCode
(
newOrgCode
,
oldOrgCode
));
return
ResponseHelper
.
buildResponse
(
historyDataDealService
.
handleCompanyHisOrgCode
(
orgCodeMap
));
}
}
}
}
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 @
6763ef31
...
@@ -14,7 +14,6 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -14,7 +14,6 @@ import lombok.extern.slf4j.Slf4j;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
...
@@ -79,7 +78,6 @@ public class PlatformUserTopicMessage extends EmqxListener {
...
@@ -79,7 +78,6 @@ public class PlatformUserTopicMessage extends EmqxListener {
log
.
info
(
"平台推送消息同步完成"
);
log
.
info
(
"平台推送消息同步完成"
);
}
}
@Async
protected
void
processOrgCodeUpdateMessage
(
MqttMessage
message
)
{
protected
void
processOrgCodeUpdateMessage
(
MqttMessage
message
)
{
try
{
try
{
if
(
ValidationUtil
.
isEmpty
(
message
))
{
if
(
ValidationUtil
.
isEmpty
(
message
))
{
...
@@ -95,7 +93,6 @@ public class PlatformUserTopicMessage extends EmqxListener {
...
@@ -95,7 +93,6 @@ public class PlatformUserTopicMessage extends EmqxListener {
}
}
}
}
@Async
protected
void
processOpMessage
(
MqttMessage
message
)
{
protected
void
processOpMessage
(
MqttMessage
message
)
{
try
{
try
{
if
(
ValidationUtil
.
isEmpty
(
message
))
{
if
(
ValidationUtil
.
isEmpty
(
message
))
{
...
...
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/HistoryDataDealServiceImpl.java
View file @
6763ef31
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
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.common.api.constant.TZSCommonConstant
;
import
com.yeejoin.amos.boot.module.common.api.entity.TzsUserPermission
;
import
com.yeejoin.amos.boot.module.common.api.entity.TzsUserPermission
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserInfo
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserInfo
;
...
@@ -14,11 +15,9 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -14,11 +15,9 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.StopWatch
;
import
org.springframework.util.StopWatch
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
/**
/**
* @author Administrator
* @author Administrator
...
@@ -135,8 +134,23 @@ public class HistoryDataDealServiceImpl {
...
@@ -135,8 +134,23 @@ public class HistoryDataDealServiceImpl {
* @return
* @return
*/
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
String
handleCompanyHisOrgCode
(
String
newOrgCode
,
String
oldOrgCode
)
{
public
String
handleCompanyHisOrgCode
(
List
<
Map
<
String
,
Object
>>
orgCodeMap
)
{
baseEnterpriseInfoService
.
refreshCompanyOrgCode
(
null
,
newOrgCode
,
oldOrgCode
);
log
.
info
(
"用企业新orgCode替换各个表缓存orgCode开始"
);
if
(
ValidationUtil
.
isEmpty
(
orgCodeMap
))
{
return
"error"
;
}
orgCodeMap
.
forEach
(
map
->
{
String
newOrgCode
=
map
.
get
(
"newOrgCode"
).
toString
();
String
oldOrgCode
=
map
.
get
(
"oldOrgCode"
).
toString
();
//1. 处理平台旧orgCode本身错误数据
@SuppressWarnings
(
"unchecked"
)
HashMap
<
String
,
Object
>
platformCompanyInfo
=
(
HashMap
<
String
,
Object
>)
Privilege
.
companyClient
.
queryByOrgcode
(
oldOrgCode
).
getResult
();
CompanyModel
parentModel
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
platformCompanyInfo
.
get
(
TZSCommonConstant
.
PLATFORM_FEIGN_RESULT_KEY_COMPANY
)),
CompanyModel
.
class
);
parentModel
.
setOrgCode
(
newOrgCode
);
Privilege
.
companyClient
.
update
(
parentModel
,
parentModel
.
getSequenceNbr
());
//2. 处理业务表旧orgCode错误数据
baseEnterpriseInfoService
.
refreshCompanyOrgCode
(
null
,
newOrgCode
,
oldOrgCode
);
});
return
"success"
;
return
"success"
;
}
}
}
}
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 @
6763ef31
...
@@ -53,6 +53,7 @@ import org.springframework.beans.BeanUtils;
...
@@ -53,6 +53,7 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -1393,6 +1394,7 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -1393,6 +1394,7 @@ public class TzBaseEnterpriseInfoServiceImpl
* @date 2025/7/3 14:03
* @date 2025/7/3 14:03
*/
*/
@Override
@Override
@Async
public
void
refreshCompanyInfo
(
JSONObject
dataResult
,
String
method
)
{
public
void
refreshCompanyInfo
(
JSONObject
dataResult
,
String
method
)
{
try
{
try
{
CompanyBo
companyBo
=
JSON
.
parseObject
(
dataResult
.
toJSONString
(),
CompanyBo
.
class
);
CompanyBo
companyBo
=
JSON
.
parseObject
(
dataResult
.
toJSONString
(),
CompanyBo
.
class
);
...
@@ -1443,6 +1445,7 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -1443,6 +1445,7 @@ public class TzBaseEnterpriseInfoServiceImpl
*/
*/
@Override
@Override
@Transactional
@Transactional
@Async
public
void
refreshCompanyOrgCode
(
JSONObject
dataResult
,
String
newOrgCode
,
String
oldOrgCode
)
{
public
void
refreshCompanyOrgCode
(
JSONObject
dataResult
,
String
newOrgCode
,
String
oldOrgCode
)
{
try
{
try
{
if
(!
ValidationUtil
.
isEmpty
(
newOrgCode
)
&&
!
ValidationUtil
.
isEmpty
(
oldOrgCode
)
&&
!
newOrgCode
.
equals
(
oldOrgCode
))
{
if
(!
ValidationUtil
.
isEmpty
(
newOrgCode
)
&&
!
ValidationUtil
.
isEmpty
(
oldOrgCode
)
&&
!
newOrgCode
.
equals
(
oldOrgCode
))
{
...
@@ -1450,8 +1453,10 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -1450,8 +1453,10 @@ public class TzBaseEnterpriseInfoServiceImpl
List
<
String
>
companySeqList
=
tzBaseEnterpriseInfoMapper
.
selectCompanyBySupervisionOrgCode
(
oldOrgCode
);
List
<
String
>
companySeqList
=
tzBaseEnterpriseInfoMapper
.
selectCompanyBySupervisionOrgCode
(
oldOrgCode
);
// 2. 查询旧属地监管部门orgCode对应的所有设备
// 2. 查询旧属地监管部门orgCode对应的所有设备
List
<
String
>
equipmentRecordList
=
tzBaseEnterpriseInfoMapper
.
selectEquipmentBySupervisionOrgCode
(
oldOrgCode
);
List
<
String
>
equipmentRecordList
=
tzBaseEnterpriseInfoMapper
.
selectEquipmentBySupervisionOrgCode
(
oldOrgCode
);
// 3. 更新其他业务表冗余的监管单位orgCode
// 3. 3.1 更新单位及业务表的监管单位orgCode
tzBaseEnterpriseInfoMapper
.
updateRedundantSupervisionOrgCode
(
newOrgCode
,
oldOrgCode
);
tzBaseEnterpriseInfoMapper
.
updateRedundantSupervisionOrgCodeUnit
(
newOrgCode
,
oldOrgCode
);
// 3.2 更新业务表统计表冗余的监管单位orgCode
tzBaseEnterpriseInfoMapper
.
updateRedundantSupervisionOrgCodeStatistics
(
newOrgCode
,
oldOrgCode
);
// 4. 发送数据刷新事件 - 内存分页处理
// 4. 发送数据刷新事件 - 内存分页处理
// 处理企业数据
// 处理企业数据
publishDataRefreshEvents
(
companySeqList
,
DataRefreshEvent
.
DataType
.
enterprise
,
1000
);
publishDataRefreshEvents
(
companySeqList
,
DataRefreshEvent
.
DataType
.
enterprise
,
1000
);
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/enums/EquipmentCategoryEnum.java
View file @
6763ef31
...
@@ -47,8 +47,7 @@ public enum EquipmentCategoryEnum {
...
@@ -47,8 +47,7 @@ public enum EquipmentCategoryEnum {
public
static
Map
<
String
,
String
>
getName
=
new
HashMap
<>();
public
static
Map
<
String
,
String
>
getName
=
new
HashMap
<>();
public
static
Map
<
String
,
String
>
getCode
=
new
HashMap
<>();
public
static
Map
<
String
,
String
>
getCode
=
new
HashMap
<>();
public
static
Map
<
String
,
String
>
getValue
=
new
HashMap
<>();
public
static
Map
<
String
,
String
>
getValue
=
new
HashMap
<>();
public
static
Map
<
String
,
String
>
getCityCode
=
new
HashMap
<>();
public
static
final
Map
<
String
,
String
>
getCityCodeValue
=
new
HashMap
<>();
public
static
final
Map
<
String
,
String
>
getCodeValueMap
=
new
HashMap
<>();
private
static
final
Map
<
String
,
String
>
valueToCodeMap
=
new
HashMap
<>();
private
static
final
Map
<
String
,
String
>
valueToCodeMap
=
new
HashMap
<>();
static
{
static
{
...
@@ -57,9 +56,8 @@ public enum EquipmentCategoryEnum {
...
@@ -57,9 +56,8 @@ public enum EquipmentCategoryEnum {
getCode
.
put
(
e
.
value
,
e
.
code
);
getCode
.
put
(
e
.
value
,
e
.
code
);
getValue
.
put
(
e
.
value
,
e
.
code
);
getValue
.
put
(
e
.
value
,
e
.
code
);
if
(
e
.
cityCode
!=
null
)
{
if
(
e
.
cityCode
!=
null
)
{
getCityCode
.
put
(
e
.
cityCode
,
e
.
cod
e
);
getCityCode
Value
.
put
(
e
.
cityCode
,
e
.
valu
e
);
}
}
getCodeValueMap
.
put
(
e
.
code
,
e
.
value
);
valueToCodeMap
.
put
(
"96333_"
+
e
.
value
,
e
.
getValue
()
+
e
.
getCode
());
valueToCodeMap
.
put
(
"96333_"
+
e
.
value
,
e
.
getValue
()
+
e
.
getCode
());
}
}
}
}
...
@@ -68,9 +66,4 @@ public enum EquipmentCategoryEnum {
...
@@ -68,9 +66,4 @@ public enum EquipmentCategoryEnum {
public
static
String
getCodeByValue
(
String
value
)
{
public
static
String
getCodeByValue
(
String
value
)
{
return
valueToCodeMap
.
get
(
value
);
return
valueToCodeMap
.
get
(
value
);
}
}
// 根据code获取对应的value
public
static
String
getValueByCode
(
String
code
)
{
return
getCodeValueMap
.
get
(
code
);
}
}
}
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/EquipmentCategoryServiceImpl.java
View file @
6763ef31
...
@@ -921,7 +921,8 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -921,7 +921,8 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
if
(
firstAvailableCode
!=
null
)
{
if
(
firstAvailableCode
!=
null
)
{
elevatorCode
.
setLength
(
0
);
elevatorCode
.
setLength
(
0
);
elevatorCode
.
append
(
prefix
).
append
(
firstAvailableCode
);
// firstAvailableCode 不足5位,前面补0
elevatorCode
.
append
(
prefix
).
append
(
String
.
format
(
"%05d"
,
firstAvailableCode
.
longValue
()));
}
else
{
}
else
{
//// 获取补零位长度
//// 获取补零位长度
// String elevatorCode1 = elevatorOtherInfo.getCode().substring(2);
// String elevatorCode1 = elevatorOtherInfo.getCode().substring(2);
...
@@ -2789,33 +2790,34 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -2789,33 +2790,34 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
}
// 对应关系转化
// 对应关系转化
// city
--> EquipmentCategoryEnum.code
--> EquipmentCategoryEnum.value
// city
/county
--> EquipmentCategoryEnum.value
private
String
cityCodeTo96333CodePrefix
(
String
city
,
String
county
,
String
isNotXixian
)
{
private
String
cityCodeTo96333CodePrefix
(
String
city
,
String
county
,
String
isNotXixian
)
{
String
code
=
EquipmentCategoryEnum
.
getCityCode
.
get
(
city
);
String
prefixCode
=
""
;
if
(
StringUtils
.
isEmpty
(
code
))
{
prefixCode
=
EquipmentCategoryEnum
.
getCityCodeValue
.
get
(
city
);
throw
new
RuntimeException
(
"未匹配到对应的cityCode:"
+
city
);
}
// 西咸
// 西咸
if
(
XIAN
.
equals
(
city
)
&&
"0"
.
equals
(
isNotXixian
))
{
if
(
XIAN
.
equals
(
city
)
&&
"0"
.
equals
(
isNotXixian
))
{
return
EquipmentCategoryEnum
.
XXCSM
.
getValue
();
prefixCode
=
EquipmentCategoryEnum
.
XXCSM
.
getValue
();
}
}
// 杨陵
// 杨陵
if
(
YANG_LING
.
equals
(
county
))
{
if
(
YANG_LING
.
equals
(
county
))
{
return
EquipmentCategoryEnum
.
YLCSM
.
getValue
();
prefixCode
=
EquipmentCategoryEnum
.
YLCSM
.
getValue
();
}
}
// 韩城
// 韩城
if
(
HAN_CHENG
.
equals
(
county
))
{
if
(
HAN_CHENG
.
equals
(
county
))
{
return
EquipmentCategoryEnum
.
HCCSM
.
getValue
();
prefixCode
=
EquipmentCategoryEnum
.
HCCSM
.
getValue
();
}
}
// 神木
// 神木
if
(
SHEN_MU
.
equals
(
county
))
{
if
(
SHEN_MU
.
equals
(
county
))
{
return
EquipmentCategoryEnum
.
SMCSM
.
getValue
();
prefixCode
=
EquipmentCategoryEnum
.
SMCSM
.
getValue
();
}
}
// 府谷
// 府谷
if
(
FU_GU
.
equals
(
county
))
{
if
(
FU_GU
.
equals
(
county
))
{
return
EquipmentCategoryEnum
.
FGCSM
.
getValue
();
prefixCode
=
EquipmentCategoryEnum
.
FGCSM
.
getValue
();
}
if
(
StringUtils
.
isEmpty
(
prefixCode
))
{
throw
new
RuntimeException
(
"未匹配到对应的cityCode/countyCode:"
+
city
+
"/"
+
county
);
}
}
return
EquipmentCategoryEnum
.
getValueByCode
(
code
)
;
return
prefixCode
;
}
}
}
}
\ 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