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
eb4886e5
Commit
eb4886e5
authored
Jan 16, 2026
by
tianbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(equipment): 添加根据前缀生成监管码功能
- 新增根据前缀生成监管码的接口和实现方法 - 修复地址拼接时出现null字符串的问题 - 在设备变更注册时为新装置生成监管码 - 完善变更注册流程中的证书管理和设备状态更新
parent
4be9240e
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
126 additions
and
8 deletions
+126
-8
CommonEquipDataProcessService.java
...biz/edit/process/equip/CommonEquipDataProcessService.java
+1
-1
TzsServiceFeignClient.java
.../amos/boot/module/jg/biz/feign/TzsServiceFeignClient.java
+9
-0
IdxBizJgProjectContraptionServiceImplService.java
...ce/impl/IdxBizJgProjectContraptionServiceImplService.java
+2
-2
JgCertificateReplenishServiceImpl.java
...g/biz/service/impl/JgCertificateReplenishServiceImpl.java
+1
-1
JgChangeRegistrationUnitServiceImpl.java
...biz/service/impl/JgChangeRegistrationUnitServiceImpl.java
+56
-4
IEquipmentCategoryService.java
...oot/module/ymt/api/service/IEquipmentCategoryService.java
+2
-0
EquipmentCategoryController.java
...odule/ymt/biz/controller/EquipmentCategoryController.java
+11
-0
EquipmentCategoryServiceImpl.java
...le/ymt/biz/service/impl/EquipmentCategoryServiceImpl.java
+44
-0
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/process/equip/CommonEquipDataProcessService.java
View file @
eb4886e5
...
...
@@ -1064,7 +1064,7 @@ public class CommonEquipDataProcessService {
record
.
setDataSourceName
(
EquipSourceEnum
.
getDataSourceName
(
record
.
getDataSource
()));
record
.
setFullAddress
(
Stream
.
of
(
record
.
getProvinceName
(),
record
.
getCityName
(),
record
.
getCountyName
(),
record
.
getStreetName
(),
record
.
getAddress
())
.
map
(
value
->
value
==
null
?
""
:
value
)
.
map
(
value
->
value
==
null
||
"null"
.
equals
(
value
)
?
""
:
value
)
.
collect
(
Collectors
.
joining
())
);
BeanUtil
.
copyProperties
(
record
,
item
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/feign/TzsServiceFeignClient.java
View file @
eb4886e5
...
...
@@ -35,6 +35,15 @@ public interface TzsServiceFeignClient {
ResponseModel
<
List
<
Map
<
String
,
String
>>>
createCodeBatch
(
@RequestBody
Map
<
String
,
Object
>
map
);
/**
* 根据前缀创建监管码
*
* @param map 请求体
* @return
*/
@RequestMapping
(
value
=
"/equipment-category/createSupervisoryCodeWithPrefix"
,
method
=
RequestMethod
.
POST
)
ResponseModel
<
String
>
createSupervisoryCodeWithPrefix
(
@RequestBody
Map
<
String
,
Object
>
map
);
/**
* 创建监管码及96333
*
* @param paramMap 请求体
...
...
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/IdxBizJgProjectContraptionServiceImplService.java
View file @
eb4886e5
...
...
@@ -184,7 +184,7 @@ public class IdxBizJgProjectContraptionServiceImplService extends BaseEntityServ
record
.
setDataSourceName
(
EquipSourceEnum
.
getDataSourceName
(
record
.
getDataSource
()));
record
.
setFullAddress
(
Stream
.
of
(
record
.
getProvinceName
(),
record
.
getCityName
(),
record
.
getCountyName
(),
record
.
getStreetName
(),
record
.
getAddress
())
.
map
(
value
->
value
==
null
?
""
:
value
)
.
map
(
value
->
value
==
null
||
"null"
.
equals
(
value
)
?
""
:
value
)
.
collect
(
Collectors
.
joining
())
);
});
...
...
@@ -409,7 +409,7 @@ public class IdxBizJgProjectContraptionServiceImplService extends BaseEntityServ
record
.
setDataQualityScore
(
commonService
.
castDataQualityScore2Name
(
record
.
getDataQualityScore
(),
record
.
getIsIntoManagement
()));
record
.
setFullAddress
(
Stream
.
of
(
record
.
getProvinceName
(),
record
.
getCityName
(),
record
.
getCountyName
(),
record
.
getStreetName
(),
record
.
getAddress
())
.
map
(
value
->
value
==
null
?
""
:
value
)
.
map
(
value
->
value
==
null
||
"null"
.
equals
(
value
)
?
""
:
value
)
.
collect
(
Collectors
.
joining
())
);
record
.
setCompanyType
(
companyType2
);
...
...
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/JgCertificateReplenishServiceImpl.java
View file @
eb4886e5
...
...
@@ -925,7 +925,7 @@ public class JgCertificateReplenishServiceImpl extends BaseService<JgCertificate
record
.
setRecord
(
record
.
getSequenceNbr
());
record
.
setFullAddress
(
Stream
.
of
(
record
.
getProvinceName
(),
record
.
getCityName
(),
record
.
getCountyName
(),
record
.
getStreetName
(),
record
.
getAddress
())
.
map
(
value
->
value
==
null
?
""
:
value
)
.
map
(
value
->
value
==
null
||
"null"
.
equals
(
value
)
?
""
:
value
)
.
collect
(
Collectors
.
joining
())
);
});
...
...
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/JgChangeRegistrationUnitServiceImpl.java
View file @
eb4886e5
...
...
@@ -181,7 +181,8 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
private
IdxBizJgRegisterInfoServiceImpl
idxBizJgRegisterInfoService
;
@Autowired
private
IdxBizJgFactoryInfoServiceImpl
idxBizJgFactoryInfoService
;
@Autowired
private
IdxBizJgOtherInfoServiceImpl
idxBizJgOtherInfoService
;
@Autowired
ICommonService
commonService
;
...
...
@@ -2112,6 +2113,9 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
throw
new
BadRequest
(
"数据异常,请联系管理员"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
BadRequest
(
"数据异常,请联系管理员"
);
}
finally
{
if
(
lock
.
isHeldByCurrentThread
())
{
lock
.
unlock
();
...
...
@@ -2538,6 +2542,15 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
);
registerInfos
.
addAll
(
batchResults
);
}
// 对应设备的其他信息
List
<
IdxBizJgOtherInfo
>
otherInfos
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
targetEqIdList
.
size
();
i
+=
ONE_BATCH_SIZE
)
{
List
<
String
>
batch
=
targetEqIdList
.
subList
(
i
,
Math
.
min
(
i
+
ONE_BATCH_SIZE
,
targetEqIdList
.
size
()));
List
<
IdxBizJgOtherInfo
>
batchResults
=
idxBizJgOtherInfoService
.
list
(
new
LambdaQueryWrapper
<
IdxBizJgOtherInfo
>().
in
(
IdxBizJgOtherInfo:
:
getRecord
,
batch
)
);
otherInfos
.
addAll
(
batchResults
);
}
// 没有报废的管道设备,直接将装置和证都变更到新单位;有部分报废的管道需给新单位新建管道
if
(!
ValidationUtil
.
isEmpty
(
useInfosForScrap
))
{
// 有部分报废的管道
...
...
@@ -2556,10 +2569,19 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
newProjectContraption
.
setIsIntoManagement
(
true
);
newProjectContraption
.
setIsFirstMerge
(
false
);
newProjectContraption
.
setProjectContraptionParentId
(
null
);
newProjectContraption
.
setDataSource
(
"jg"
);
newProjectContraption
.
setUseDate
(
DateUtils
.
getDateNowShortStr
());
// 为新装置生成设备代码
// 为新装置生成设备代码
和监管码
String
equCode
=
jgUseRegistrationService
.
getEquCode
(
registerInfos
.
get
(
0
),
registrationUnit
.
getReceiveCompanyCode
());
newProjectContraption
.
setEquCode
(
equCode
);
String
prefix
=
oldProjectContraption
.
getSupervisoryCode
().
substring
(
0
,
1
);
String
categoryCode
=
oldProjectContraption
.
getEquCategory
();
Map
<
String
,
Object
>
equCodeMap
=
new
HashMap
<>();
equCodeMap
.
put
(
"prefix"
,
prefix
);
equCodeMap
.
put
(
"categoryCode"
,
categoryCode
);
String
supervisoryCode
=
tzsServiceFeignClient
.
createSupervisoryCodeWithPrefix
(
equCodeMap
).
getResult
();
newProjectContraption
.
setSupervisoryCode
(
supervisoryCode
);
projectContraptionService
.
save
(
newProjectContraption
);
// 2.1 把非报废管道关联到新装置
...
...
@@ -2568,7 +2590,10 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
useInfoBatches
.
add
(
useInfosForNotScrap
.
subList
(
i
,
Math
.
min
(
i
+
ONE_BATCH_SIZE
,
useInfosForNotScrap
.
size
())));
}
for
(
List
<
IdxBizJgUseInfo
>
batch
:
useInfoBatches
)
{
batch
.
forEach
(
useInfo
->
useInfo
.
setProjectContraptionId
(
String
.
valueOf
(
newProjectContraption
.
getSequenceNbr
())));
batch
.
forEach
(
useInfo
->
{
useInfo
.
setProjectContraptionId
(
String
.
valueOf
(
newProjectContraption
.
getSequenceNbr
()));
useInfo
.
setEquState
(
String
.
valueOf
(
EquipmentEnum
.
ZAIYONG
.
getCode
()));
});
idxBizJgUseInfoService
.
updateBatchById
(
batch
);
}
...
...
@@ -2581,7 +2606,18 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
batch
.
forEach
(
registerInfo
->
registerInfo
.
setEquCode
(
equCode
));
idxBizJgRegisterInfoService
.
updateBatchById
(
batch
);
}
// 2.3 更新新装置下管道的监管码
List
<
List
<
IdxBizJgOtherInfo
>>
otherInfoBatches
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
otherInfos
.
size
();
i
+=
ONE_BATCH_SIZE
)
{
otherInfoBatches
.
add
(
otherInfos
.
subList
(
i
,
Math
.
min
(
i
+
ONE_BATCH_SIZE
,
otherInfos
.
size
())));
}
for
(
List
<
IdxBizJgOtherInfo
>
batch
:
otherInfoBatches
)
{
batch
.
forEach
(
otherInfo
->
otherInfo
.
setSupervisoryCode
(
supervisoryCode
));
idxBizJgOtherInfoService
.
updateBatchById
(
batch
);
}
// 重新计算新老装置长度
pipelineDataChangeService
.
updatePipelineLength
(
String
.
valueOf
(
oldProjectContraption
.
getSequenceNbr
()));
pipelineDataChangeService
.
updatePipelineLength
(
String
.
valueOf
(
newProjectContraption
.
getSequenceNbr
()));
targetProjectContraption
=
newProjectContraption
;
...
...
@@ -2599,7 +2635,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
List
<
String
>
batch
=
eqIdList
.
subList
(
i
,
Math
.
min
(
i
+
ONE_BATCH_SIZE
,
eqIdList
.
size
()));
idxBizJgRegisterInfoService
.
lambdaUpdate
()
.
setSql
(
"
USE_ORG_CODE
= NULL"
)
.
setSql
(
"
\"USE_ORG_CODE\"
= NULL"
)
.
in
(
IdxBizJgRegisterInfo:
:
getRecord
,
batch
)
.
update
();
...
...
@@ -2624,8 +2660,24 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
registrationManage
=
new
JgUseRegistrationManage
();
registrationManage
.
setSequenceNbr
(
sequence
.
nextId
());
registrationManage
.
setUseRegistrationCode
(
useRegistrationCode
);
registrationManage
.
setRegDate
(
new
Date
());
registrationManage
.
setCreateDate
(
new
Date
());
registrationManage
.
setRegistrationType
(
"0"
);
registrationManage
.
setRegType
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getName
());
registrationManage
.
setCertificateStatus
(
CertificateStatusEnum
.
YIDENGJI
.
getName
());
registrationManage
.
setApplyNo
(
registration
.
getApplyNo
());
registrationManage
.
setManageType
(
"unit"
);
registrationManage
.
setEquList
(
idxBizJgProjectContraption
.
getEquListName
());
registrationManage
.
setEquListCode
(
idxBizJgProjectContraption
.
getEquList
());
registrationManage
.
setEquCategory
(
idxBizJgProjectContraption
.
getEquCategoryName
());
registrationManage
.
setEquCategoryCode
(
idxBizJgProjectContraption
.
getEquCategory
());
registrationManage
.
setEquDefine
(
idxBizJgProjectContraption
.
getEquDefineName
());
registrationManage
.
setEquDefineCode
(
idxBizJgProjectContraption
.
getEquDefine
());
registrationManage
.
setEquUseAddress
(
Stream
.
of
(
idxBizJgProjectContraption
.
getProvinceName
(),
idxBizJgProjectContraption
.
getCityName
(),
idxBizJgProjectContraption
.
getCountyName
(),
idxBizJgProjectContraption
.
getStreetName
(),
idxBizJgProjectContraption
.
getAddress
())
.
map
(
value
->
value
==
null
||
"null"
.
equals
(
value
)
?
""
:
value
)
.
collect
(
Collectors
.
joining
()));
registrationManage
.
setSuperviseOrgCode
(
idxBizJgProjectContraption
.
getOrgCode
());
registrationManage
.
setSuperviseOrgName
(
idxBizJgProjectContraption
.
getOrgName
());
}
else
{
//获取使用登记证
LambdaQueryWrapper
<
JgUseRegistrationManage
>
useRegistrationManageWrapper
=
new
LambdaQueryWrapper
<>();
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/service/IEquipmentCategoryService.java
View file @
eb4886e5
...
...
@@ -56,4 +56,6 @@ public interface IEquipmentCategoryService {
JSONObject
batchHandlerCode96333
();
String
handleError96333Code
();
String
createSupervisoryCodeWithPrefix
(
Map
<
String
,
Object
>
map
);
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-biz/src/main/java/com/yeejoin/amos/boot/module/ymt/biz/controller/EquipmentCategoryController.java
View file @
eb4886e5
...
...
@@ -287,6 +287,17 @@ public class EquipmentCategoryController extends BaseController {
return
ResponseHelper
.
buildResponse
(
equipmentCategoryService
.
createSupervisoryCodeBatch
(
map
));
}
/**
* 根据前缀生成监管码
*
* @return 监管码
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/createSupervisoryCodeWithPrefix"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"根据前缀生成监管码"
,
notes
=
"根据前缀生成监管码"
)
public
ResponseModel
<
String
>
createSupervisoryCodeWithPrefix
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
equipmentCategoryService
.
createSupervisoryCodeWithPrefix
(
map
));
}
/**
* 修改数据状态是否显示编辑按钮
...
...
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 @
eb4886e5
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ymt
.
biz
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.map.MapUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
...
@@ -771,6 +772,39 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
return
list
;
}
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRES_NEW
)
public
synchronized
String
createSupervisoryCodeWithPrefix
(
Map
<
String
,
Object
>
map
)
{
RLock
lock
=
redissonClient
.
getLock
(
LOCK_KEY
);
String
supervisorCode
;
try
{
lock
.
lock
();
// 获取锁
log
.
info
(
"加锁成功"
);
String
prefix
=
MapUtil
.
getStr
(
map
,
"prefix"
);
String
categoryCode
=
MapUtil
.
getStr
(
map
,
"categoryCode"
);
supervisorCode
=
this
.
createSupervisorCodeWithPrefix
(
prefix
,
categoryCode
);
log
.
info
(
"生成码成功"
);
SupervisoryCodeInfo
supervisoryCodeInfo
=
new
SupervisoryCodeInfo
();
SupervisoryCodeInfo
selectOne
=
supervisoryCodeInfoMapper
.
selectOne
(
new
QueryWrapper
<
SupervisoryCodeInfo
>().
eq
(
"supervisory_code"
,
supervisorCode
.
toString
()));
// 将生成的码添加到码表中,码的使用状态为初始状态
String
equState
=
EquipmentCategoryEnum
.
CSZT
.
getCode
();
supervisoryCodeInfo
.
setCreateStatus
(
"1"
);
supervisoryCodeInfo
.
setSupervisoryCode
(
supervisorCode
);
supervisoryCodeInfo
.
setStatus
(
equState
);
if
(
ObjectUtils
.
isEmpty
(
selectOne
))
{
supervisoryCodeInfoMapper
.
insert
(
supervisoryCodeInfo
);
}
else
{
supervisoryCodeInfoMapper
.
update
(
selectOne
,
new
QueryWrapper
<
SupervisoryCodeInfo
>().
eq
(
"supervisory_code"
,
selectOne
.
getSupervisoryCode
()));
}
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
finally
{
lock
.
unlock
();
// 释放锁
log
.
info
(
"释放锁"
);
}
return
supervisorCode
;
}
/**
* 具体生成监管码和电梯96333识别码逻辑
*/
...
...
@@ -933,6 +967,16 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
/**
* 根据前缀生成监管码
* @param division 监管码前缀(A,B,C,D....X等)
* @param equipCategory 设备类别
* @return 监管码
*/
public
String
createSupervisorCodeWithPrefix
(
String
division
,
String
equipCategory
)
{
return
generateCodeService
.
createSupervisoryCode
(
division
+
equipCategory
);
}
/**
* 生成监管码
*
* @param city 行政区划市
...
...
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