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
83843d32
Commit
83843d32
authored
Jul 02, 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
84900566
06778e93
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
157 additions
and
67 deletions
+157
-67
ExecuteThreadPoolConfig.java
...s/boot/module/tcm/biz/config/ExecuteThreadPoolConfig.java
+34
-0
TzBaseEnterpriseInfoServiceImpl.java
...tcm/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
+120
-66
RegUnitInfoServiceImpl.java
...dule/tcm/flc/biz/service/impl/RegUnitInfoServiceImpl.java
+3
-1
No files found.
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/config/ExecuteThreadPoolConfig.java
0 → 100644
View file @
83843d32
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tcm
.
biz
.
config
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
java.util.concurrent.ThreadPoolExecutor
;
@Configuration
public
class
ExecuteThreadPoolConfig
{
private
static
final
Integer
CORE_POOL_SIZE
=
Runtime
.
getRuntime
().
availableProcessors
()
+
1
;
private
static
final
Integer
MAX_POOL_SIZE
=
Runtime
.
getRuntime
().
availableProcessors
()
*
2
+
1
;
private
static
final
Integer
TASK_QUEUE_CAPACITY
=
Runtime
.
getRuntime
().
availableProcessors
();
private
static
final
Integer
TASK_KEEP_ALIVE_TIME
=
60
*
3
;
@Bean
(
name
=
"tcmTaskExecutor"
)
public
ThreadPoolTaskExecutor
executeThreadPoolConfig
()
{
ThreadPoolTaskExecutor
executor
=
new
ThreadPoolTaskExecutor
();
executor
.
setCorePoolSize
(
CORE_POOL_SIZE
);
executor
.
setMaxPoolSize
(
MAX_POOL_SIZE
);
executor
.
setQueueCapacity
(
TASK_QUEUE_CAPACITY
);
executor
.
setThreadNamePrefix
(
"tcmTaskExecutor-"
);
// 设置线程保持活跃的时间(默认:60 * 3)
executor
.
setKeepAliveSeconds
(
TASK_KEEP_ALIVE_TIME
);
// 设置任务拒绝策略 通过主线程知行
executor
.
setRejectedExecutionHandler
(
new
ThreadPoolExecutor
.
CallerRunsPolicy
());
executor
.
initialize
();
return
executor
;
}
}
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 @
83843d32
...
@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.alibaba.fastjson.TypeReference
;
import
com.alibaba.fastjson.TypeReference
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
...
@@ -15,6 +16,7 @@ import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
...
@@ -15,6 +16,7 @@ import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
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.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RequestContextWrapper
;
import
com.yeejoin.amos.boot.module.common.api.dto.UserPermissionDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.UserPermissionDto
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.BaseUnitLicenceDto
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.BaseUnitLicenceDto
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.EquEnterDto
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.EquEnterDto
;
...
@@ -52,6 +54,8 @@ import org.redisson.api.RLock;
...
@@ -52,6 +54,8 @@ import org.redisson.api.RLock;
import
org.redisson.api.RedissonClient
;
import
org.redisson.api.RedissonClient
;
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.beans.factory.annotation.Qualifier
;
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
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
...
@@ -63,6 +67,8 @@ import org.typroject.tyboot.core.restful.exception.instance.TooManyRequests;
...
@@ -63,6 +67,8 @@ import org.typroject.tyboot.core.restful.exception.instance.TooManyRequests;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.Callable
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -124,6 +130,10 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -124,6 +130,10 @@ public class TzBaseEnterpriseInfoServiceImpl
private
static
final
Map
<
String
,
String
>
JYJC_CERT_MAP
=
new
HashMap
<>();
private
static
final
Map
<
String
,
String
>
JYJC_CERT_MAP
=
new
HashMap
<>();
@Autowired
@Qualifier
(
"tcmTaskExecutor"
)
private
ThreadPoolTaskExecutor
threadPoolTaskExecutor
;
/**
/**
* 公司类型下的资质类型map:key为登录人的公司类型、value为包含的资质枚举
* 公司类型下的资质类型map:key为登录人的公司类型、value为包含的资质枚举
*/
*/
...
@@ -1055,33 +1065,45 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -1055,33 +1065,45 @@ public class TzBaseEnterpriseInfoServiceImpl
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
@Override
public
TzBaseEnterpriseInfoDto
updateCompanyInfoById
(
Map
<
String
,
Object
>
map
,
ReginParams
reginParams
2
)
{
public
TzBaseEnterpriseInfoDto
updateCompanyInfoById
(
Map
<
String
,
Object
>
map
,
ReginParams
reginParams
)
{
log
.
info
(
"根据ID修改企业信息 => {}, 更新人 => {}"
,
map
,
RequestContext
.
getExeUserId
());
log
.
info
(
"根据ID修改企业信息 => {}, 更新人 => {}"
,
map
,
RequestContext
.
getExeUserId
());
try
{
TzBaseEnterpriseInfo
tzBaseEnterpriseInfo
=
new
TzBaseEnterpriseInfo
();
TzBaseEnterpriseInfo
tzBaseEnterpriseInfo
=
new
TzBaseEnterpriseInfo
();
tzBaseEnterpriseInfo
.
setSequenceNbr
(
Long
.
valueOf
(
map
.
get
(
"sequenceNbr"
).
toString
()));
tzBaseEnterpriseInfo
.
setSequenceNbr
(
Long
.
valueOf
(
map
.
get
(
"sequenceNbr"
).
toString
()));
tzBaseEnterpriseInfo
=
tzBaseEnterpriseInfoService
.
getById
(
tzBaseEnterpriseInfo
.
getSequenceNbr
());
tzBaseEnterpriseInfo
=
tzBaseEnterpriseInfoService
.
getById
(
tzBaseEnterpriseInfo
.
getSequenceNbr
());
String
superviseOrgCode
=
ObjectUtils
.
isEmpty
(
map
.
get
(
"superviseOrgCode"
))
?
null
:
String
.
valueOf
(
map
.
get
(
"superviseOrgCode"
));
if
(!
tzBaseEnterpriseInfo
.
getSuperviseCode
().
equals
(
superviseOrgCode
))
{
System
.
out
.
println
(
"监管单位变更"
);
}
//修改基本信息
//修改基本信息
tzBaseEnterpriseInfo
.
setEquipCategory
(
JSON
.
toJSONString
(
map
.
get
(
"equipCategory"
)));
tzBaseEnterpriseInfo
.
setEquipCategory
(
JSON
.
toJSONString
(
map
.
get
(
"equipCategory"
)));
Map
<
String
,
String
>
map1
=
(
Map
<
String
,
String
>)
map
.
get
(
"longitudeLatitude"
);
Map
<
String
,
String
>
locationMap
=
(
Map
<
String
,
String
>)
map
.
get
(
"longitudeLatitude"
);
tzBaseEnterpriseInfo
.
setAddress
(
ObjectUtils
.
isEmpty
(
map1
.
get
(
"address"
))
?
null
:
map1
.
get
(
"address"
));
if
(
locationMap
!=
null
)
{
tzBaseEnterpriseInfo
.
setLongitude
(
ObjectUtils
.
isEmpty
(
map1
.
get
(
"longitude"
))
?
null
:
String
.
valueOf
(
map1
.
get
(
"longitude"
)));
tzBaseEnterpriseInfo
.
setAddress
(
locationMap
.
get
(
"address"
));
tzBaseEnterpriseInfo
.
setLatitude
(
ObjectUtils
.
isEmpty
(
map1
.
get
(
"latitude"
))
?
null
:
String
.
valueOf
(
map1
.
get
(
"latitude"
)));
tzBaseEnterpriseInfo
.
setLongitude
(
locationMap
.
get
(
"longitude"
));
tzBaseEnterpriseInfo
.
setLatitude
(
locationMap
.
get
(
"latitude"
));
}
tzBaseEnterpriseInfo
.
setUseContact
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"useContact"
))
?
null
:
String
.
valueOf
(
map
.
get
(
"useContact"
)));
tzBaseEnterpriseInfo
.
setUseContact
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"useContact"
))
?
null
:
String
.
valueOf
(
map
.
get
(
"useContact"
)));
tzBaseEnterpriseInfo
.
setContactPhone
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"contactPhone"
))
?
null
:
String
.
valueOf
(
map
.
get
(
"contactPhone"
)));
tzBaseEnterpriseInfo
.
setContactPhone
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"contactPhone"
))
?
null
:
String
.
valueOf
(
map
.
get
(
"contactPhone"
)));
tzBaseEnterpriseInfo
.
setUnitBusinessLicense
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"unitBusinessLicense"
))
?
null
:
JSON
.
toJSONString
(
map
.
get
(
"unitBusinessLicense"
)));
tzBaseEnterpriseInfo
.
setUnitBusinessLicense
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"unitBusinessLicense"
))
?
null
:
JSON
.
toJSONString
(
map
.
get
(
"unitBusinessLicense"
)));
tzBaseEnterpriseInfo
.
setIndustrySupervisor
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"industrySupervisor"
))
?
null
:
String
.
valueOf
(
map
.
get
(
"industrySupervisor"
)));
tzBaseEnterpriseInfo
.
setIndustrySupervisor
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"industrySupervisor"
))
?
null
:
String
.
valueOf
(
map
.
get
(
"industrySupervisor"
)));
tzBaseEnterpriseInfo
.
setSuperviseOrgCode
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"superviseOrgCode"
))
?
null
:
String
.
valueOf
(
map
.
get
(
"superviseOrgCode"
))
);
tzBaseEnterpriseInfo
.
setSuperviseOrgCode
(
superviseOrgCode
);
tzBaseEnterpriseInfo
.
setSuperviseOrgName
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"superviseOrgName"
))
?
null
:
String
.
valueOf
(
map
.
get
(
"superviseOrgName"
)));
tzBaseEnterpriseInfo
.
setSuperviseOrgName
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"superviseOrgName"
))
?
null
:
String
.
valueOf
(
map
.
get
(
"superviseOrgName"
)));
tzBaseEnterpriseInfo
.
setOtherAccessories
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"otherAccessories"
))
?
null
:
JSON
.
toJSONString
(
map
.
get
(
"otherAccessories"
)));
tzBaseEnterpriseInfo
.
setOtherAccessories
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"otherAccessories"
))
?
null
:
JSON
.
toJSONString
(
map
.
get
(
"otherAccessories"
)));
tzBaseEnterpriseInfo
.
setLegalPerson
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"legalPerson"
))
?
null
:
(
String
)
map
.
get
(
"legalPerson"
));
tzBaseEnterpriseInfo
.
setLegalPerson
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"legalPerson"
))
?
null
:
(
String
)
map
.
get
(
"legalPerson"
));
String
officeRegion
=
null
;
String
officeRegion
=
null
;
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"officeRegion"
))){
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"officeRegion"
))){
List
list
=
(
List
<
Object
>)
map
.
get
(
"officeRegion"
);
List
<?>
list
=
(
List
<?
>)
map
.
get
(
"officeRegion"
);
officeRegion
=
list
.
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
"#"
)).
toString
();
officeRegion
=
list
.
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
"#"
)).
toString
();
}
}
tzBaseEnterpriseInfo
.
setOfficeRegion
(
officeRegion
);
tzBaseEnterpriseInfo
.
setOfficeRegion
(
officeRegion
);
tzBaseEnterpriseInfo
.
setOfficeAddress
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"officeAddress"
))
?
null
:
(
String
)
map
.
get
(
"officeAddress"
));
tzBaseEnterpriseInfo
.
setOfficeAddress
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"officeAddress"
))
?
null
:
(
String
)
map
.
get
(
"officeAddress"
));
// 修改事业单位信息
// 修改事业单位信息
if
(
map
.
containsKey
(
"regUnitMessage"
))
{
TzsBaseInstitutionDto
baseInstitutionDto
=
JSON
.
toJavaObject
(
JSON
.
parseObject
(
JSON
.
toJSONString
(
map
.
get
(
"regUnitMessage"
))),
TzsBaseInstitutionDto
.
class
);
TzsBaseInstitutionDto
baseInstitutionDto
=
JSON
.
toJavaObject
(
JSON
.
parseObject
(
JSON
.
toJSONString
(
map
.
get
(
"regUnitMessage"
))),
TzsBaseInstitutionDto
.
class
);
if
(!
ValidationUtil
.
isEmpty
(
baseInstitutionDto
))
{
if
(!
ValidationUtil
.
isEmpty
(
baseInstitutionDto
))
{
TzsBaseInstitution
baseInstitution
=
new
TzsBaseInstitution
();
TzsBaseInstitution
baseInstitution
=
new
TzsBaseInstitution
();
...
@@ -1094,6 +1116,8 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -1094,6 +1116,8 @@ public class TzBaseEnterpriseInfoServiceImpl
tzsBaseInstitutionService
.
saveOrUpdate
(
baseInstitution
);
tzsBaseInstitutionService
.
saveOrUpdate
(
baseInstitution
);
}
}
}
// 修改tz_flc_reg_unit_info表信息
// 修改tz_flc_reg_unit_info表信息
LambdaQueryWrapper
<
RegUnitInfo
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
RegUnitInfo
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
RegUnitInfo:
:
getUnitCode
,
tzBaseEnterpriseInfo
.
getUseCode
());
queryWrapper
.
eq
(
RegUnitInfo:
:
getUnitCode
,
tzBaseEnterpriseInfo
.
getUseCode
());
...
@@ -1109,7 +1133,6 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -1109,7 +1133,6 @@ public class TzBaseEnterpriseInfoServiceImpl
regUnitInfo
.
setName
(
tzBaseEnterpriseInfo
.
getUseUnit
());
regUnitInfo
.
setName
(
tzBaseEnterpriseInfo
.
getUseUnit
());
regUnitInfo
.
setUnitCode
(
tzBaseEnterpriseInfo
.
getUseCode
());
regUnitInfo
.
setUnitCode
(
tzBaseEnterpriseInfo
.
getUseCode
());
regUnitInfo
.
setManagementUnit
(
tzBaseEnterpriseInfo
.
getGoverningBody
());
regUnitInfo
.
setManagementUnit
(
tzBaseEnterpriseInfo
.
getGoverningBody
());
// regUnitInfo.setManagementUnitId(tzBaseEnterpriseInfo.getGoverningBody());
regUnitInfo
.
setProvince
(
tzBaseEnterpriseInfo
.
getProvince
());
regUnitInfo
.
setProvince
(
tzBaseEnterpriseInfo
.
getProvince
());
regUnitInfo
.
setCity
(
tzBaseEnterpriseInfo
.
getCity
());
regUnitInfo
.
setCity
(
tzBaseEnterpriseInfo
.
getCity
());
regUnitInfo
.
setDistrict
(
tzBaseEnterpriseInfo
.
getDistrict
());
regUnitInfo
.
setDistrict
(
tzBaseEnterpriseInfo
.
getDistrict
());
...
@@ -1122,49 +1145,7 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -1122,49 +1145,7 @@ public class TzBaseEnterpriseInfoServiceImpl
regUnitInfoService
.
saveOrUpdate
(
regUnitInfo
);
regUnitInfoService
.
saveOrUpdate
(
regUnitInfo
);
// -- 20250627 调整为监管单位不能修改工商信息和资质
// -- 20250627 调整为监管单位不能修改工商信息和资质
//修改工商信息
// RegUnitIc regUnitIc = new RegUnitIc();
// RegUnitIcDto regUnitIcDto = JSON.parseObject(JSON.toJSONString(map.get("regUnitIcDto")), new TypeReference<RegUnitIcDto>() {
// });
// if (!ValidationUtil.isEmpty(regUnitIcDto.getSequenceNbr())) {
// List<String> addressList = (List<String>) map.get("registerAddressList");
// tzBaseEnterpriseInfo.setProvince(addressList.get(0));
// tzBaseEnterpriseInfo.setCity(addressList.get(1));
// tzBaseEnterpriseInfo.setDistrict(addressList.get(2));
// tzBaseEnterpriseInfo.setCommunity(ObjectUtils.isEmpty(map.get("community")) ? null : String.valueOf(map.get("community")));
// tzBaseEnterpriseInfo.setStreet(ObjectUtils.isEmpty(map.get("street")) ? null : String.valueOf(map.get("street")));
// // tzBaseEnterpriseInfo.setAddress(ObjectUtils.isEmpty(map.get("regAddress")) ? null : String.valueOf(map.get("regAddress")));
// tzBaseEnterpriseInfo.setLegalPerson(ObjectUtils.isEmpty(map.get("legalPerson")) ? null : String.valueOf(map.get("legalPerson")));
// regUnitIc.setIndustryName(ObjectUtils.isEmpty(map.get("industryName")) ? null : String.valueOf(map.get("industryName")));
// DataDictionary regOrganCodeDict = iDataDictionaryService.getByCode(String.valueOf(map.get("registeredOrganCode")),"DJJG");
// regUnitIc.setRegisteredOrgan(ObjectUtils.isEmpty(regOrganCodeDict) ? null : String.valueOf(regOrganCodeDict.getName()));
// regUnitIc.setRegisteredOrganCode(ObjectUtils.isEmpty(map.get("registeredOrganCode")) ? null : String.valueOf(map.get("registeredOrganCode")));
// Date approvedDate;
// try {
// approvedDate = DateUtils.dateParse(String.valueOf(map.get("approvedDate")), "yyyy-MM-dd");
// } catch (ParseException e) {
// throw new RuntimeException(e);
// }
// regUnitIc.setBusinessStateCode(ObjectUtils.isEmpty(map.get("businessState")) ? null : String.valueOf(map.get("businessState")));
// DataDictionary businessStateDict = iDataDictionaryService.getByCode(String.valueOf(map.get("businessState")),"jyzt");
// regUnitIc.setBusinessState(ObjectUtils.isEmpty(businessStateDict) ? null : businessStateDict.getName());
// regUnitIc.setApprovedDate(ObjectUtils.isEmpty(map.get("approvedDate")) ? null : approvedDate);
//
// regUnitIcService.update(regUnitIc, new QueryWrapper<RegUnitIc>().eq("unit_code", regUnitIcDto.getUnitCode()));
// }
//许可信息先登录人选择的身份删除相应的许可信息,原因前端列表对数据可增减
// String useCode = tzBaseEnterpriseInfo.getUseCode();
// String certTypeCodes = Arrays.stream(unitTypes).map(e -> COMPANY_TYPE_CERT_TYPE_MAP.getOrDefault(e, "")).collect(Collectors.joining(","));
// if (useCode != null && !certTypeCodes.isEmpty()) {
// LambdaQueryWrapper<BaseUnitLicence> wrapper = new LambdaQueryWrapper<>();
// wrapper.eq(BaseUnitLicence::getUnitCode, useCode);
// wrapper.and(w -> Arrays.stream(certTypeCodes.split(","))
// .forEach(certTypeCode -> w.or().likeRight(BaseUnitLicence::getCertTypeCode, certTypeCode)));
// baseUnitLicenceService.remove(wrapper);
// }
// //报错许可许可信息
// saveLicenceData(map);
// 企业信息变更-同步修改企业下人员绑定设备类型
// 企业信息变更-同步修改企业下人员绑定设备类型
ArrayList
<
String
>
newData
=
new
ArrayList
<>();
ArrayList
<
String
>
newData
=
new
ArrayList
<>();
JSONArray
objects
=
JSON
.
parseArray
(
tzBaseEnterpriseInfo
.
getEquipCategory
());
JSONArray
objects
=
JSON
.
parseArray
(
tzBaseEnterpriseInfo
.
getEquipCategory
());
...
@@ -1173,30 +1154,36 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -1173,30 +1154,36 @@ public class TzBaseEnterpriseInfoServiceImpl
tzBaseEnterpriseInfo
.
setAppId
(
regUnitInfo
.
getAppId
());
tzBaseEnterpriseInfo
.
setAppId
(
regUnitInfo
.
getAppId
());
tzBaseEnterpriseInfo
.
setUnitType
(
String
.
join
(
"#"
,
unitTypes
));
tzBaseEnterpriseInfo
.
setUnitType
(
String
.
join
(
"#"
,
unitTypes
));
boolean
b
=
tzBaseEnterpriseInfoService
.
updateById
(
tzBaseEnterpriseInfo
);
boolean
updateResult
=
tzBaseEnterpriseInfoService
.
updateById
(
tzBaseEnterpriseInfo
);
if
(
b
)
{
if
(
updateResult
)
{
CompanyModel
updateModel
;
log
.
info
(
"更新企业信息, 单位类型 => {}"
,
tzBaseEnterpriseInfo
.
getUseUnitCode
())
;
try
{
String
useCode
=
String
.
valueOf
(
map
.
get
(
"useCode"
));
updateModel
=
Privilege
.
companyClient
.
queryByCompanyCode
(
String
.
valueOf
(
map
.
get
(
"useCode"
))
).
getResult
();
CompanyModel
updateModel
=
Privilege
.
companyClient
.
queryByCompanyCode
(
useCode
).
getResult
();
HashMap
<
String
,
Object
>
parentMessage
=
(
HashMap
<
String
,
Object
>)
Privilege
.
companyClient
.
queryByOrgcode
(
String
.
valueOf
(
map
.
get
(
"superviseOrgCode"
))).
getResult
();
HashMap
<
String
,
Object
>
parentMessage
=
(
HashMap
<
String
,
Object
>)
Privilege
.
companyClient
.
queryByOrgcode
(
String
.
valueOf
(
map
.
get
(
"superviseOrgCode"
))).
getResult
();
// 目前平台返回key为compnay(存在拼写错误)
// 目前平台返回key为compnay(存在拼写错误)
CompanyModel
parentModel
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
parentMessage
.
get
(
"compnay"
)),
CompanyModel
.
class
);
CompanyModel
parentModel
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
parentMessage
.
get
(
"compnay"
)),
CompanyModel
.
class
);
updateModel
.
setParentId
(
parentModel
.
getSequenceNbr
());
updateModel
.
setParentId
(
parentModel
.
getSequenceNbr
());
// 更新单位的上下级
updateModel
.
setCompanyType
(
regUnitInfo
.
getUnitType
());
// 更新单位类型
updateModel
.
setCompanyType
(
regUnitInfo
.
getUnitType
());
// 更新单位类型
updateCompanyInfo
(
tzBaseEnterpriseInfo
,
updateModel
);
Privilege
.
companyClient
.
update
(
updateModel
,
updateModel
.
getSequenceNbr
());
log
.
info
(
"更新企业信息, 单位 => {}"
,
tzBaseEnterpriseInfo
.
getUseUnitCode
());
}
catch
(
Exception
e
)
{
throw
new
BadRequest
(
"操作失败!"
);
}
updateUnit
(
map
,
regUnitInfo
,
agencyUserModel
,
updateModel
);
updateUnit
(
map
,
regUnitInfo
,
agencyUserModel
,
updateModel
);
updateUserInfo
(
newData
,
String
.
valueOf
(
map
.
get
(
"useCode"
)));
log
.
info
(
"更新企业信息, 注册用户 => {}"
,
tzBaseEnterpriseInfo
.
getUseUnitCode
());
updateUserInfo
(
newData
,
useCode
);
// 同步平台并且刷新历史数据
asyncPlatformAndRefreshHistoricalData
(
useCode
);
TzBaseEnterpriseInfoDto
tzBaseEnterpriseInfoDto
=
new
TzBaseEnterpriseInfoDto
();
TzBaseEnterpriseInfoDto
tzBaseEnterpriseInfoDto
=
new
TzBaseEnterpriseInfoDto
();
BeanUtils
.
copyProperties
(
tzBaseEnterpriseInfo
,
tzBaseEnterpriseInfoDto
);
BeanUtils
.
copyProperties
(
tzBaseEnterpriseInfo
,
tzBaseEnterpriseInfoDto
);
// 更新完成后清理缓存
redisUtil
.
del
(
RedisKey
.
buildReginRoleKey
(
agencyUserModel
.
getUserId
()));
redisUtil
.
del
(
RedisKey
.
buildReginRoleKey
(
agencyUserModel
.
getUserId
()));
return
tzBaseEnterpriseInfoDto
;
return
tzBaseEnterpriseInfoDto
;
}
else
{
}
else
{
return
null
;
return
null
;
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"更新企业信息失败: "
,
e
);
throw
new
BadRequest
(
"更新企业信息失败!"
);
}
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
@@ -1205,6 +1192,21 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -1205,6 +1192,21 @@ public class TzBaseEnterpriseInfoServiceImpl
return
userInfoService
.
personalInfoUpdateById
((
Map
<
String
,
Object
>)
map
.
get
(
"raw"
));
return
userInfoService
.
personalInfoUpdateById
((
Map
<
String
,
Object
>)
map
.
get
(
"raw"
));
}
}
private
void
updateCompanyInfo
(
TzBaseEnterpriseInfo
tzBaseEnterpriseInfo
,
CompanyModel
updateModel
)
{
FeignClientResult
<
CompanyModel
>
companyResult
=
Privilege
.
companyClient
.
update
(
updateModel
,
updateModel
.
getSequenceNbr
());
if
(
companyResult
==
null
||
companyResult
.
getStatus
()
!=
200
)
{
log
.
error
(
"更新单位错误: {}"
,
companyResult
);
throw
new
BadRequest
(
"更新单位失败!"
);
}
String
orgCode
=
Optional
.
ofNullable
(
companyResult
.
getResult
()).
map
(
CompanyModel:
:
getOrgCode
).
orElse
(
null
);
updateModel
.
setOrgCode
(
orgCode
);
// 更新企业的org_code
UpdateWrapper
<
TzBaseEnterpriseInfo
>
updateWrapper
=
new
UpdateWrapper
<>();
updateWrapper
.
set
(
"org_code"
,
orgCode
);
updateWrapper
.
eq
(
"sequence_nbr"
,
tzBaseEnterpriseInfo
.
getSequenceNbr
());
tzBaseEnterpriseInfoService
.
update
(
updateWrapper
);
}
private
void
handleUnitType
(
Map
<
String
,
Object
>
map
,
RegUnitInfo
regUnitInfo
,
AgencyUserModel
agencyUserModel
)
{
private
void
handleUnitType
(
Map
<
String
,
Object
>
map
,
RegUnitInfo
regUnitInfo
,
AgencyUserModel
agencyUserModel
)
{
Object
unitTypeCodesObj
=
map
.
get
(
"unitTypeCodes"
);
Object
unitTypeCodesObj
=
map
.
get
(
"unitTypeCodes"
);
if
(!(
unitTypeCodesObj
instanceof
List
<?>))
{
if
(!(
unitTypeCodesObj
instanceof
List
<?>))
{
...
@@ -1237,10 +1239,11 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -1237,10 +1239,11 @@ public class TzBaseEnterpriseInfoServiceImpl
regUnitInfo
.
setUnitTypeCode
(
unitTypeCodesStr
);
regUnitInfo
.
setUnitTypeCode
(
unitTypeCodesStr
);
// 省内充装单位1231:生成对接数据账号
// 省内充装单位1231:生成对接数据账号
final
String
FILLING_UNIT_TYPE
=
RegUnitInfoServiceImpl
.
FILLING_UNIT_TYPE
;
// final String FILLING_UNIT_TYPE = RegUnitInfoServiceImpl.FILLING_UNIT_TYPE;
if
(
unitTypeCodes
.
contains
(
FILLING_UNIT_TYPE
)
// 20250701 改为全部企业类型生成对接数据账号@tianbo
&&
(
ValidationUtil
.
isEmpty
(
regUnitInfo
.
getIsNationwide
())
||
"0"
.
equals
(
regUnitInfo
.
getIsNationwide
())))
{
// if (unitTypeCodes.contains(FILLING_UNIT_TYPE)
// && (ValidationUtil.isEmpty(regUnitInfo.getIsNationwide()) || "0".equals(regUnitInfo.getIsNationwide()))) {
if
(
ValidationUtil
.
isEmpty
(
regUnitInfo
.
getIsNationwide
())
||
"0"
.
equals
(
regUnitInfo
.
getIsNationwide
()))
{
if
(
ValidationUtil
.
isEmpty
(
regUnitInfo
.
getAppId
()))
{
if
(
ValidationUtil
.
isEmpty
(
regUnitInfo
.
getAppId
()))
{
String
appId
=
DesUtil
.
encode
(
regUnitInfo
.
getAdminUserId
(),
RegUnitInfoServiceImpl
.
SECRETKEY
);
String
appId
=
DesUtil
.
encode
(
regUnitInfo
.
getAdminUserId
(),
RegUnitInfoServiceImpl
.
SECRETKEY
);
...
@@ -1307,4 +1310,55 @@ public class TzBaseEnterpriseInfoServiceImpl
...
@@ -1307,4 +1310,55 @@ public class TzBaseEnterpriseInfoServiceImpl
throw
new
BadRequest
(
"单位更新失败"
);
throw
new
BadRequest
(
"单位更新失败"
);
}
}
}
}
/**
* 同步平台并且刷新历史数据
*
*
* @param useCode useCode
* @author yangyang
* @date 2025/7/1 14:50
*/
private
void
asyncPlatformAndRefreshHistoricalData
(
String
useCode
)
{
// 同步平台ORG_CODE
LambdaQueryWrapper
<
TzsUserInfo
>
lambda
=
new
QueryWrapper
<
TzsUserInfo
>().
lambda
();
lambda
.
eq
(
TzsUserInfo:
:
getUnitCode
,
useCode
);
lambda
.
isNotNull
(
TzsUserInfo:
:
getAmosUserId
);
List
<
TzsUserInfo
>
tzsUserInfos
=
tzsUserInfoMapper
.
selectList
(
lambda
);
// 异步刷新历史数据
String
token
=
RequestContext
.
getToken
();
String
appKey
=
RequestContext
.
getAppKey
();
String
product
=
RequestContext
.
getProduct
();
threadPoolTaskExecutor
.
execute
(()
->
{
RequestContext
.
setToken
(
token
);
RequestContext
.
setAppKey
(
appKey
);
RequestContext
.
setProduct
(
product
);
try
{
// 刷新平台的企业下面用户的super_org_code
if
(!
ValidationUtil
.
isEmpty
(
tzsUserInfos
))
{
String
userIds
=
tzsUserInfos
.
stream
().
map
(
TzsUserInfo:
:
getAmosUserId
).
collect
(
Collectors
.
joining
(
","
));
FeignClientResult
<
List
<
AgencyUserModel
>>
agencyUserClientResult
=
Privilege
.
agencyUserClient
.
queryByIds
(
userIds
,
false
);
if
(
agencyUserClientResult
!=
null
&&
agencyUserClientResult
.
getResult
()
!=
null
)
{
List
<
AgencyUserModel
>
agencyUserModels
=
agencyUserClientResult
.
getResult
();
for
(
AgencyUserModel
userModel
:
agencyUserModels
)
{
// 更新, 刷新企业下用户的super_org_code
try
{
Privilege
.
agencyUserClient
.
update
(
userModel
,
userModel
.
getUserId
());
}
catch
(
Exception
e
)
{
log
.
error
(
"更新用户 {} 的 super_org_code 失败"
,
userModel
.
getUserId
(),
e
);
}
}
}
}
// todo 调用刷新历史数据接口
}
catch
(
Exception
e
)
{
log
.
error
(
"异步刷新企业用户信息发生异常"
,
e
);
}
finally
{
RequestContext
.
clean
();
}
});
}
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/flc/biz/service/impl/RegUnitInfoServiceImpl.java
View file @
83843d32
...
@@ -819,7 +819,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
...
@@ -819,7 +819,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
String
adminUserId
=
userResult
.
getResult
().
getUserId
();
String
adminUserId
=
userResult
.
getResult
().
getUserId
();
// 省内充装单位1231:生成对接数据账号
// 省内充装单位1231:生成对接数据账号
if
(
Arrays
.
asList
(
units
).
contains
(
FILLING_UNIT_TYPE
)
&&
(
ValidationUtil
.
isEmpty
(
regUnitInfo
.
getIsNationwide
())
||
"0"
.
equals
(
regUnitInfo
.
getIsNationwide
())))
{
// if (Arrays.asList(units).contains(FILLING_UNIT_TYPE) && (ValidationUtil.isEmpty(regUnitInfo.getIsNationwide()) || "0".equals(regUnitInfo.getIsNationwide()))) {
// 20250701 改为全部企业类型生成对接数据账号@tianbo
if
(
ValidationUtil
.
isEmpty
(
regUnitInfo
.
getIsNationwide
())
||
"0"
.
equals
(
regUnitInfo
.
getIsNationwide
()))
{
AgencyUserModel
shadowUser
=
new
AgencyUserModel
();
AgencyUserModel
shadowUser
=
new
AgencyUserModel
();
shadowUser
.
setUserId
(
adminUserId
);
shadowUser
.
setUserId
(
adminUserId
);
String
appId
=
DesUtil
.
encode
(
adminUserId
,
SECRETKEY
);
String
appId
=
DesUtil
.
encode
(
adminUserId
,
SECRETKEY
);
...
...
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