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
5d64406c
Commit
5d64406c
authored
Jul 19, 2023
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
一码通码生成重复问题修改
parent
430b48d6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
10 deletions
+27
-10
EquipmentCategoryServiceImpl.java
...le/tzs/biz/service/impl/EquipmentCategoryServiceImpl.java
+14
-10
SpringConfiguration.java
...n/amos/boot/module/tzs/biz/utils/SpringConfiguration.java
+13
-0
No files found.
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/EquipmentCategoryServiceImpl.java
View file @
5d64406c
...
...
@@ -41,6 +41,7 @@ import org.elasticsearch.index.query.BoolQueryBuilder;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.elasticsearch.search.sort.SortOrder
;
import
org.springframework.aop.framework.AopContext
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.io.Resource
;
...
...
@@ -48,6 +49,7 @@ import org.springframework.http.HttpStatus;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.Assert
;
import
org.springframework.util.ObjectUtils
;
...
...
@@ -262,10 +264,8 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
}
//生成码
Map
<
String
,
String
>
codeMap
;
synchronized
(
EquipmentCategoryServiceImpl
.
class
)
{
codeMap
=
creatCode
(
city
,
county
,
equipCategory
,
null
,
null
);
}
EquipmentCategoryServiceImpl
categoryService
=
(
EquipmentCategoryServiceImpl
)
AopContext
.
currentProxy
();
Map
<
String
,
String
>
codeMap
=
categoryService
.
creatCode
(
city
,
county
,
equipCategory
,
null
,
null
);
if
(
ObjectUtils
.
isEmpty
(
codeMap
))
{
return
new
HashMap
<>();
}
...
...
@@ -283,7 +283,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
elevatorCode
=
EquipmentCategoryEnum
.
BF
.
getCode
().
equals
(
equInfoDto
.
getEquState
())
?
null
:
codeMap
.
get
(
"code96333"
);
List
<
CategoryOtherInfo
>
categoryOtherInfo
=
categoryOtherInfoMapper
.
selectList
(
new
QueryWrapper
<
CategoryOtherInfo
>().
eq
(
"SUPERVISORY_CODE"
,
supervisorCode
));
if
(
categoryOtherInfo
.
size
()
>
0
)
{
// categoryOtherInfoMapper.updateCode(supervisorCode, equState);
supervisoryCodeInfoMapper
.
update
(
supervisoryCodeInfo
,
new
QueryWrapper
<
SupervisoryCodeInfo
>().
eq
(
"supervisory_code"
,
supervisoryCodeInfo
.
getSupervisoryCode
()));
}
else
{
supervisoryCodeInfo
.
setStatus
(
equState
);
...
...
@@ -482,7 +481,8 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
/**
* 具体生成监管码和电梯96333识别码逻辑
*/
private
synchronized
Map
<
String
,
String
>
creatCode
(
String
city
,
String
county
,
String
equipCategory
,
String
code96333
,
String
supervisionCode
)
{
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRES_NEW
)
public
synchronized
Map
<
String
,
String
>
creatCode
(
String
city
,
String
county
,
String
equipCategory
,
String
code96333
,
String
supervisionCode
)
{
Map
<
String
,
String
>
resultMap
=
new
HashMap
<>();
StringBuilder
supervisorCode
=
new
StringBuilder
();
StringBuilder
elevatorCode
=
new
StringBuilder
();
...
...
@@ -551,7 +551,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
* @param county 行政区划区
* @return 监管码
*/
p
rivate
String
createSupervisorCode
(
String
city
,
String
county
,
String
equipCategory
)
{
p
ublic
String
createSupervisorCode
(
String
city
,
String
county
,
String
equipCategory
)
{
StringBuilder
supervisorCode
=
new
StringBuilder
();
//生成监管码前缀
Map
<
String
,
Object
>
divisionMap
=
equipmentCategoryMapper
.
getAdministrativeDivision
(
EquipmentCategoryEnum
.
XZQH
.
getCode
(),
county
);
...
...
@@ -585,7 +585,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
* @param county 行政区划区
* @return 96333电梯识别码
*/
p
rivate
String
createElevatorCode
(
String
city
,
String
county
)
{
p
ublic
String
createElevatorCode
(
String
city
,
String
county
)
{
StringBuilder
elevatorCode
=
new
StringBuilder
();
//生成生成96333电梯码前缀
Map
<
String
,
Object
>
elevatorMap
=
equipmentCategoryMapper
.
getAdministrativeDivision
(
EquipmentCategoryEnum
.
XZQHDT
.
getCode
(),
county
);
...
...
@@ -1034,8 +1034,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
String
county
=
String
.
valueOf
(
superviseMap
.
get
(
"county"
));
String
equCategory
=
String
.
valueOf
(
superviseMap
.
get
(
"equCategory"
));
String
supervisionCode
=
String
.
valueOf
(
superviseMap
.
get
(
"supervisionCode"
));
EquipmentCategoryServiceImpl
categoryService
=
(
EquipmentCategoryServiceImpl
)
AopContext
.
currentProxy
();
// EquipmentCategoryServiceImpl categoryService = SpringUtils.getBean(EquipmentCategoryServiceImpl.class);
//生成码
codeMap
=
creatCode
(
city
,
county
,
equCategory
,
code96333
,
supervisionCode
);
codeMap
=
c
ategoryService
.
c
reatCode
(
city
,
county
,
equCategory
,
code96333
,
supervisionCode
);
log
.
info
(
"已生成对应监管码或96333电梯识别码"
);
//删除map中的冗余数据,添加对应监管码和96333码调用idx多表单页提交接口吧保存数据
map
.
remove
(
"data"
);
...
...
@@ -1075,8 +1077,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
response
.
setStatus
(
HttpStatus
.
BAD_REQUEST
.
value
());
return
response
;
}
finally
{
log
.
info
(
"已生成对应监管码"
+
supervisionMap
.
get
(
"SUPERVISORY_CODE"
));
log
.
info
(
"已生成对应96333电梯识别码"
+
supervisionMap
.
get
(
"CODE96333"
));
updateEquipmentCategoryData
(
unitCode
,
orgBranchCode
);
supervisoryCodeInfoMapper
.
update
(
supervisoryCodeInfo
,
new
QueryWrapper
<
SupervisoryCodeInfo
>().
eq
(
"supervisory_code"
,
supervis
oryCodeInfo
.
getSupervisoryCode
(
)));
supervisoryCodeInfoMapper
.
update
(
supervisoryCodeInfo
,
new
QueryWrapper
<
SupervisoryCodeInfo
>().
eq
(
"supervisory_code"
,
supervis
ionMap
.
get
(
"SUPERVISORY_CODE"
)));
}
return
responseModel
;
}
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/utils/SpringConfiguration.java
0 → 100644
View file @
5d64406c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
utils
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.EnableAspectJAutoProxy
;
@Configuration
@ComponentScan
(
"com.yeejoin.amos.boot.module.tzs.biz.service.impl"
)
@EnableAspectJAutoProxy
(
exposeProxy
=
true
)
//开启spring注解aop配置的支持
public
class
SpringConfiguration
{
}
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