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
668db2bc
Commit
668db2bc
authored
Jun 27, 2023
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
一码通监管码不生成优化修改
parent
96900acb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
63 deletions
+23
-63
IEquipmentCategoryService.java
...oot/module/tzs/api/service/IEquipmentCategoryService.java
+0
-3
AmosMqttListener.java
...n/amos/boot/module/tzs/biz/listener/AmosMqttListener.java
+1
-1
EquipmentCategoryServiceImpl.java
...le/tzs/biz/service/impl/EquipmentCategoryServiceImpl.java
+22
-59
No files found.
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/service/IEquipmentCategoryService.java
View file @
668db2bc
...
@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.tzs.api.service;
...
@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.tzs.api.service;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.CategoryOtherInfo
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.CategoryOtherInfo
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.EquipmentCategoryData
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.LinkedHashMap
;
import
java.util.LinkedHashMap
;
...
@@ -41,8 +40,6 @@ public interface IEquipmentCategoryService {
...
@@ -41,8 +40,6 @@ public interface IEquipmentCategoryService {
void
createEquipmentCategoryData
();
void
createEquipmentCategoryData
();
EquipmentCategoryData
updateEquipmentCategoryData
(
String
id
);
List
<
String
>
deleteBatch
(
Map
<
String
,
Object
>
map
);
List
<
String
>
deleteBatch
(
Map
<
String
,
Object
>
map
);
ResponseModel
submit
(
Map
<
String
,
Object
>
map
);
ResponseModel
submit
(
Map
<
String
,
Object
>
map
);
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/listener/AmosMqttListener.java
View file @
668db2bc
...
@@ -31,6 +31,6 @@ public class AmosMqttListener extends EmqxListener {
...
@@ -31,6 +31,6 @@ public class AmosMqttListener extends EmqxListener {
// 更新ES
// 更新ES
equipmentCategoryService
.
checkEsData
(
id
);
equipmentCategoryService
.
checkEsData
(
id
);
// 更新一码通总览数据统计表
// 更新一码通总览数据统计表
equipmentCategoryService
.
updateEquipmentCategoryData
(
id
);
//
equipmentCategoryService.updateEquipmentCategoryData(id);
}
}
}
}
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 @
668db2bc
...
@@ -482,7 +482,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -482,7 +482,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
Map
<
String
,
String
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
String
>
resultMap
=
new
HashMap
<>();
StringBuilder
supervisorCode
=
new
StringBuilder
();
StringBuilder
supervisorCode
=
new
StringBuilder
();
StringBuilder
elevatorCode
=
new
StringBuilder
();
StringBuilder
elevatorCode
=
new
StringBuilder
();
// CategoryOtherInfo otherInfo;
CategoryOtherInfo
categoryOtherInfo
=
new
CategoryOtherInfo
();
CategoryOtherInfo
categoryOtherInfo
=
new
CategoryOtherInfo
();
String
prefix
;
String
prefix
;
//判断是否需要生成96333电梯码
//判断是否需要生成96333电梯码
...
@@ -509,42 +508,25 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -509,42 +508,25 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
supervisorCode
=
new
StringBuilder
(
supervisionCode
);
supervisorCode
=
new
StringBuilder
(
supervisionCode
);
}
}
//
// if (!ObjectUtils.isEmpty(record)) {
// //查询对应record对应数据
// otherInfo = categoryOtherInfoMapper.selectOne(new QueryWrapper<CategoryOtherInfo>().eq("RECORD", record));
// if (!ObjectUtils.isEmpty(otherInfo)) {
// //判断原数据是否存在监管码,存在则用原监管码即可,不存在则生成
// if (!ObjectUtils.isEmpty(otherInfo.getSupervisoryCode())) {
// supervisorCode = new StringBuilder(otherInfo.getSupervisoryCode());
// } else {
// String supervisor = createSupervisorCode(city, county, equipCategory);
// supervisorCode.append(supervisor);
// }
// //判断是否是否需要生成96333电梯码、这个record对应的otherInfo不为空
// if (equipCategory.startsWith("3") && !XIAN.equals(city)) {
// if (!ObjectUtils.isEmpty(otherInfo.getCode())) {
// elevatorCode.append(new StringBuilder(otherInfo.getCode()));
// } else {
// //如果存在未使用的电梯码则启用未使用的否则创建
// String elevator = ObjectUtils.isEmpty(categoryOtherInfo) ? createElevatorCode(city, county) : categoryOtherInfo.getCode();
// elevatorCode.append(elevator);
// }
// }
// }
// } else { // 监管系统申请监管码
// String supervisor = createSupervisorCode(city, county, equipCategory);
// supervisorCode.append(supervisor);
// if (equipCategory.startsWith("3") && !XIAN.equals(city)) {
// //如果存在未使用的电梯码则启用未使用的否则创建
// String elevator = ObjectUtils.isEmpty(categoryOtherInfo) ? createElevatorCode(city, county) : categoryOtherInfo.getCode();
// elevatorCode.append(elevator);
// }
// }
if
(
ObjectUtils
.
isEmpty
(
supervisorCode
)
&&
ObjectUtils
.
isEmpty
(
elevatorCode
))
{
if
(
ObjectUtils
.
isEmpty
(
supervisorCode
)
&&
ObjectUtils
.
isEmpty
(
elevatorCode
))
{
return
new
HashMap
<>();
return
new
HashMap
<>();
}
}
SupervisoryCodeInfo
supervisoryCodeInfo
=
new
SupervisoryCodeInfo
();
SupervisoryCodeInfo
selectOne
=
supervisoryCodeInfoMapper
.
selectOne
(
new
QueryWrapper
<
SupervisoryCodeInfo
>().
eq
(
"supervisory_code"
,
supervisionCode
));
//将生成的码添加到码表中,码的使用状态为初始状态
String
equState
=
EquipmentCategoryEnum
.
CSZT
.
getCode
();
supervisoryCodeInfo
.
setCode96333
(
String
.
valueOf
(
elevatorCode
));
supervisoryCodeInfo
.
setCreateStatus
(
resultMap
.
get
(
"creatStatus"
));
supervisoryCodeInfo
.
setSupervisoryCode
(
String
.
valueOf
(
supervisorCode
));
supervisoryCodeInfo
.
setStatus
(
equState
);
if
(
ObjectUtils
.
isEmpty
(
selectOne
)){
supervisoryCodeInfoMapper
.
insert
(
supervisoryCodeInfo
);
}
else
{
selectOne
.
setCode96333
(
String
.
valueOf
(
elevatorCode
));
supervisoryCodeInfoMapper
.
update
(
selectOne
,
new
QueryWrapper
<
SupervisoryCodeInfo
>().
eq
(
"supervisory_code"
,
selectOne
.
getSupervisoryCode
()));
}
resultMap
.
put
(
"superviseCode"
,
ObjectUtils
.
isEmpty
(
supervisorCode
)
?
null
:
supervisorCode
.
toString
());
resultMap
.
put
(
"superviseCode"
,
ObjectUtils
.
isEmpty
(
supervisorCode
)
?
null
:
supervisorCode
.
toString
());
resultMap
.
put
(
"code96333"
,
ObjectUtils
.
isEmpty
(
elevatorCode
)
?
null
:
elevatorCode
.
toString
());
resultMap
.
put
(
"code96333"
,
ObjectUtils
.
isEmpty
(
elevatorCode
)
?
null
:
elevatorCode
.
toString
());
resultMap
.
put
(
"qrCode"
,
ObjectUtils
.
isEmpty
(
supervisorCode
)
?
null
:
supervisorCode
.
toString
());
resultMap
.
put
(
"qrCode"
,
ObjectUtils
.
isEmpty
(
supervisorCode
)
?
null
:
supervisorCode
.
toString
());
...
@@ -934,12 +916,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -934,12 +916,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
}
@Override
private
EquipmentCategoryData
updateEquipmentCategoryData
(
String
unitCode
)
{
public
EquipmentCategoryData
updateEquipmentCategoryData
(
String
record
)
{
String
unitCode
=
equipmentCategoryMapper
.
getUnitCodeByRecord
(
record
);
if
(
ObjectUtils
.
isEmpty
(
unitCode
)){
return
new
EquipmentCategoryData
();
}
List
<
String
>
unitCodeList
=
new
ArrayList
<>();
List
<
String
>
unitCodeList
=
new
ArrayList
<>();
unitCodeList
.
add
(
unitCode
);
unitCodeList
.
add
(
unitCode
);
List
<
EquipmentCategoryData
>
equipmentCategoryData
=
getCategoryData
(
unitCodeList
);
List
<
EquipmentCategoryData
>
equipmentCategoryData
=
getCategoryData
(
unitCodeList
);
...
@@ -985,9 +962,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -985,9 +962,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
}
@Override
@Override
@Transactional
public
ResponseModel
submit
(
Map
<
String
,
Object
>
map
)
{
public
ResponseModel
submit
(
Map
<
String
,
Object
>
map
)
{
SupervisoryCodeInfo
supervisoryCodeInfo
=
new
SupervisoryCodeInfo
();
SupervisoryCodeInfo
supervisoryCodeInfo
=
new
SupervisoryCodeInfo
();
ResponseModel
responseModel
=
new
ResponseModel
();
ResponseModel
responseModel
=
new
ResponseModel
();
LinkedHashMap
useInfoFrom
=
(
LinkedHashMap
)
map
.
get
(
USE_INFO_FROM_ID
);
String
unitCode
=
String
.
valueOf
(
useInfoFrom
.
get
(
"USE_UNIT_CREDIT_CODE"
));
try
{
try
{
LinkedHashMap
superviseMap
=
(
LinkedHashMap
)
map
.
get
(
"data"
);
LinkedHashMap
superviseMap
=
(
LinkedHashMap
)
map
.
get
(
"data"
);
String
claimStatus
=
String
.
valueOf
(
superviseMap
.
get
(
"claimStatus"
));
String
claimStatus
=
String
.
valueOf
(
superviseMap
.
get
(
"claimStatus"
));
...
@@ -1004,20 +984,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -1004,20 +984,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
//生成码
//生成码
codeMap
=
creatCode
(
city
,
county
,
equCategory
,
code96333
,
supervisionCode
);
codeMap
=
creatCode
(
city
,
county
,
equCategory
,
code96333
,
supervisionCode
);
log
.
info
(
"已生成对应监管码或96333电梯识别码"
);
log
.
info
(
"已生成对应监管码或96333电梯识别码"
);
SupervisoryCodeInfo
selectOne
=
supervisoryCodeInfoMapper
.
selectOne
(
new
QueryWrapper
<
SupervisoryCodeInfo
>().
eq
(
"supervisory_code"
,
supervisionCode
));
//将生成的码添加到码表中,码的使用状态为初始状态
String
equState
=
EquipmentCategoryEnum
.
CSZT
.
getCode
();
supervisoryCodeInfo
.
setCode96333
(
codeMap
.
get
(
"code96333"
));
supervisoryCodeInfo
.
setCreateStatus
(
codeMap
.
get
(
"creatStatus"
));
supervisoryCodeInfo
.
setSupervisoryCode
(
codeMap
.
get
(
"superviseCode"
));
supervisoryCodeInfo
.
setStatus
(
ObjectUtils
.
isEmpty
(
selectOne
)
?
equState
:
selectOne
.
getStatus
());
if
(
ObjectUtils
.
isEmpty
(
selectOne
)){
supervisoryCodeInfoMapper
.
insert
(
supervisoryCodeInfo
);
}
else
{
selectOne
.
setCode96333
(
codeMap
.
get
(
"code96333"
));
supervisoryCodeInfoMapper
.
update
(
selectOne
,
new
QueryWrapper
<
SupervisoryCodeInfo
>().
eq
(
"supervisory_code"
,
selectOne
.
getSupervisoryCode
()));
}
//删除map中的冗余数据,添加对应监管码和96333码调用idx多表单页提交接口吧保存数据
//删除map中的冗余数据,添加对应监管码和96333码调用idx多表单页提交接口吧保存数据
map
.
remove
(
"data"
);
map
.
remove
(
"data"
);
LinkedHashMap
supervisionMap
=
(
LinkedHashMap
)
map
.
get
(
SUPERVISION_FROM_ID
);
LinkedHashMap
supervisionMap
=
(
LinkedHashMap
)
map
.
get
(
SUPERVISION_FROM_ID
);
...
@@ -1029,16 +995,13 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -1029,16 +995,13 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
idxFeignService
.
batchUpdate
(
null
,
null
,
map
);
idxFeignService
.
batchUpdate
(
null
,
null
,
map
);
if
(!
ObjectUtils
.
isEmpty
(
responseModel
)
&&
"200"
.
equals
(
String
.
valueOf
(
responseModel
.
getStatus
())))
{
if
(!
ObjectUtils
.
isEmpty
(
responseModel
)
&&
"200"
.
equals
(
String
.
valueOf
(
responseModel
.
getStatus
())))
{
supervisoryCodeInfo
.
setStatus
(
EquipmentCategoryEnum
.
YSY
.
getCode
());
supervisoryCodeInfo
.
setStatus
(
EquipmentCategoryEnum
.
YSY
.
getCode
());
//todo 更新总览数据
// LinkedHashMap useInfoFrom = (LinkedHashMap) map.get("USE_INFO_FROM_ID");
}
else
{
}
else
{
supervisoryCodeInfo
.
setStatus
(
EquipmentCategoryEnum
.
BF
.
getCode
());
supervisoryCodeInfo
.
setStatus
(
EquipmentCategoryEnum
.
BF
.
getCode
());
}
}
}
else
if
(
EquipmentCategoryEnum
.
DRL
.
getName
().
equals
(
claimStatus
))
{
}
else
if
(
EquipmentCategoryEnum
.
DRL
.
getName
().
equals
(
claimStatus
))
{
map
.
remove
(
"data"
);
map
.
remove
(
"data"
);
LinkedHashMap
supervisionMap
=
(
LinkedHashMap
)
map
.
get
(
SUPERVISION_FROM_ID
);
LinkedHashMap
supervisionMap
=
(
LinkedHashMap
)
map
.
get
(
SUPERVISION_FROM_ID
);
supervisionMap
.
put
(
"CODE96333"
,
code96333
);
supervisionMap
.
put
(
"CODE96333"
,
"null"
.
equals
(
code96333
)
?
null
:
code96333
);
map
.
put
(
SUPERVISION_FROM_ID
,
supervisionMap
);
map
.
put
(
SUPERVISION_FROM_ID
,
supervisionMap
);
//根据操作状态判断是调用新增还是修改接口
//根据操作状态判断是调用新增还是修改接口
responseModel
=
"save"
.
equals
(
operateType
)
?
idxFeignService
.
batchSubmit
(
null
,
null
,
null
,
null
,
map
)
:
responseModel
=
"save"
.
equals
(
operateType
)
?
idxFeignService
.
batchSubmit
(
null
,
null
,
null
,
null
,
map
)
:
...
@@ -1049,13 +1012,13 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -1049,13 +1012,13 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
supervisoryCodeInfo
.
setStatus
(
EquipmentCategoryEnum
.
BF
.
getCode
());
supervisoryCodeInfo
.
setStatus
(
EquipmentCategoryEnum
.
BF
.
getCode
());
e
.
printStackTrace
();
ResponseModel
<
Object
>
response
=
new
ResponseModel
();
ResponseModel
<
Object
>
response
=
new
ResponseModel
();
response
.
setResult
(
null
);
response
.
setResult
(
null
);
response
.
setMessage
(
"操作失败,请检查数据输入后重新提交"
);
response
.
setMessage
(
"操作失败,请检查数据输入后重新提交"
);
response
.
setStatus
(
HttpStatus
.
BAD_REQUEST
.
value
());
response
.
setStatus
(
HttpStatus
.
BAD_REQUEST
.
value
());
return
response
;
return
response
;
}
finally
{
}
finally
{
updateEquipmentCategoryData
(
unitCode
);
supervisoryCodeInfoMapper
.
update
(
supervisoryCodeInfo
,
new
QueryWrapper
<
SupervisoryCodeInfo
>().
eq
(
"supervisory_code"
,
supervisoryCodeInfo
.
getSupervisoryCode
()));
supervisoryCodeInfoMapper
.
update
(
supervisoryCodeInfo
,
new
QueryWrapper
<
SupervisoryCodeInfo
>().
eq
(
"supervisory_code"
,
supervisoryCodeInfo
.
getSupervisoryCode
()));
}
}
return
responseModel
;
return
responseModel
;
...
...
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