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
fda64552
Commit
fda64552
authored
Jan 12, 2022
by
tangwei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_ccs' of
http://172.16.10.76/moa/amos-boot-biz
into develop_ccs
parents
df154c53
a2bbd1eb
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
73 additions
and
33 deletions
+73
-33
ControllerAop.java
...a/com/yeejoin/amos/boot/biz/common/aop/ControllerAop.java
+7
-1
CarController.java
...ava/com/yeejoin/equipmanage/controller/CarController.java
+9
-12
EquipmentDetailController.java
...oin/equipmanage/controller/EquipmentDetailController.java
+5
-2
ApplicationRunnerImpl.java
...ejoin/equipmanage/service/impl/ApplicationRunnerImpl.java
+18
-1
CarServiceImpl.java
.../com/yeejoin/equipmanage/service/impl/CarServiceImpl.java
+2
-2
EquipmentSpecificSerivceImpl.java
...quipmanage/service/impl/EquipmentSpecificSerivceImpl.java
+1
-1
FireFightingSystemServiceImpl.java
...uipmanage/service/impl/FireFightingSystemServiceImpl.java
+10
-8
SourcesStatisticsImpl.java
...ejoin/equipmanage/service/impl/SourcesStatisticsImpl.java
+17
-5
StockServiceImpl.java
...om/yeejoin/equipmanage/service/impl/StockServiceImpl.java
+4
-1
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/aop/ControllerAop.java
View file @
fda64552
...
...
@@ -15,6 +15,7 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.annotation.AfterReturning
;
import
org.aspectj.lang.annotation.Aspect
;
...
...
@@ -68,7 +69,12 @@ public class ControllerAop {
public
void
doBefore
(
JoinPoint
joinPoint
)
{
PermissionInterceptorContext
.
clean
();
ServletRequestAttributes
attributes
=
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
HttpServletRequest
request
=
attributes
.
getRequest
();
HttpServletRequest
request
=
null
;
if
(
ObjectUtils
.
isNotEmpty
(
attributes
)){
request
=
attributes
.
getRequest
();
}
else
{
return
;
}
// 不需要添加请求头的接口
String
[]
url
=
new
String
[]{
"/api/user/save/curCompany"
,
"/jcs/command/lookHtmlText"
,
"/jcs/common/duty-person/findByDutyAreaId"
,
"/tzs/wechatBack"
,
"/tzs/elevator/getElevatorInfo"
};
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/CarController.java
View file @
fda64552
...
...
@@ -11,6 +11,7 @@ import java.util.stream.Collectors;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
com.yeejoin.equipmanage.common.utils.*
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
@@ -62,12 +63,6 @@ import com.yeejoin.equipmanage.common.enums.IndustryEnum;
import
com.yeejoin.equipmanage.common.enums.OnBoardEquipmentEnum
;
import
com.yeejoin.equipmanage.common.enums.SystemDicTypeEum
;
import
com.yeejoin.equipmanage.common.enums.TrueOrFalseEnum
;
import
com.yeejoin.equipmanage.common.utils.CommonResponseUtil
;
import
com.yeejoin.equipmanage.common.utils.DateUtils
;
import
com.yeejoin.equipmanage.common.utils.NameUtils
;
import
com.yeejoin.equipmanage.common.utils.ParsePropertyUtil
;
import
com.yeejoin.equipmanage.common.utils.QRCodeUtil
;
import
com.yeejoin.equipmanage.common.utils.StringUtil
;
import
com.yeejoin.equipmanage.common.vo.CarForUE4VO
;
import
com.yeejoin.equipmanage.common.vo.CarInfosResponse
;
import
com.yeejoin.equipmanage.common.vo.EquipStateOnCarVo
;
...
...
@@ -244,18 +239,17 @@ public class CarController extends AbstractBaseController {
});
}
Car
car2
=
iCarService
.
saveOne
(
car
);
refreshCount
(
car
.
getBizOrgCode
());
CarController
controllerProxy
=
SpringUtils
.
getBean
(
CarController
.
class
);
controllerProxy
.
refreshCount
(
car
.
getBizOrgCode
());
return
car2
;
}
@Async
public
void
refreshCount
(
String
bizOrgCode
)
{
// 刷新分类数量缓存
iCarService
.
refreshStaData
();
try
{
// 刷新分类树缓存
fireFightingSystemServiceImpl
.
refreshCarTypeAndCount
(
bizOrgCode
);
}
catch
(
Exception
e
)
{
}
}
@Async
public
void
refreshCount
(
List
<
Car
>
list
)
{
...
...
@@ -327,6 +321,8 @@ public class CarController extends AbstractBaseController {
// saveFile(carInstance);视频图片文件后期统一处理
EquipmentSpecificSerivceImpl
.
registerMqttTopic
(
car
.
getIotCode
(),
equipmentIotMqttReceiveConfig
);
Car
car1
=
iCarService
.
updateOneById
(
car
);
CarController
controllerProxy
=
SpringUtils
.
getBean
(
CarController
.
class
);
controllerProxy
.
refreshCount
(
car
.
getBizOrgCode
());
refreshCount
(
car
.
getBizOrgCode
());
return
car1
;
}
...
...
@@ -1105,7 +1101,8 @@ public class CarController extends AbstractBaseController {
});
boolean
flag
=
iCarService
.
removeOneByIds
(
idList
);
if
(
flag
)
{
refreshCount
(
cars
)
;
CarController
controllerProxy
=
SpringUtils
.
getBean
(
CarController
.
class
);
controllerProxy
.
refreshCount
(
cars
);
}
return
flag
;
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EquipmentDetailController.java
View file @
fda64552
...
...
@@ -10,6 +10,7 @@ import com.yeejoin.equipmanage.common.entity.vo.EquipmentDetailDownloadVO;
import
com.yeejoin.equipmanage.common.enums.ExcelEnums
;
import
com.yeejoin.equipmanage.common.utils.ExcelUtils
;
import
com.yeejoin.equipmanage.common.utils.NameUtils
;
import
com.yeejoin.equipmanage.common.utils.SpringUtils
;
import
com.yeejoin.equipmanage.common.utils.StringUtil
;
import
com.yeejoin.equipmanage.common.vo.EquipmentDate
;
import
com.yeejoin.equipmanage.dto.ExcelDto
;
...
...
@@ -155,7 +156,8 @@ public class EquipmentDetailController extends AbstractBaseController {
if
(
syncSwitch
)
{
equipmentSpecificSerivce
.
equipSpecificDataSync
(
equipmentId
);
}
refreshCount
(
vo
.
getBizOrgCode
());
EquipmentDetailController
controllerProxy
=
SpringUtils
.
getBean
(
EquipmentDetailController
.
class
);
controllerProxy
.
refreshCount
(
vo
.
getBizOrgCode
());
return
date
;
}
...
...
@@ -263,7 +265,8 @@ public class EquipmentDetailController extends AbstractBaseController {
if
(
syncSwitch
)
{
equipmentSpecificSerivce
.
equipSpecificDataSync
(
bean
.
getEquipmentId
());
}
refreshCount
(
vo
.
getBizOrgCode
());
EquipmentDetailController
controllerProxy
=
SpringUtils
.
getBean
(
EquipmentDetailController
.
class
);
controllerProxy
.
refreshCount
(
vo
.
getBizOrgCode
());
return
equipmentDate
;
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/ApplicationRunnerImpl.java
View file @
fda64552
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.equipmanage.common.enums.ConfigPageTopicEnum
;
import
com.yeejoin.equipmanage.listener.IntegratePageDataListener
;
import
com.yeejoin.equipmanage.service.IMaintenanceResourceDataService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.ApplicationArguments
;
import
org.springframework.boot.ApplicationRunner
;
import
org.springframework.stereotype.Component
;
...
...
@@ -29,9 +31,24 @@ public class ApplicationRunnerImpl implements ApplicationRunner {
@Autowired
IntegratePageDataListener
integratePageDataListener
;
@Autowired
RedisUtils
redisUtils
;
@Value
(
"${redis_car_type_count}"
)
private
String
carTypeAndCount
;
@Value
(
"${redis_equip_type_count}"
)
private
String
equipTypeAndCount
;
@Override
public
void
run
(
ApplicationArguments
args
)
throws
Exception
{
// 清空装备分类树缓存
redisUtils
.
getAndDeletePatternKeys
(
carTypeAndCount
+
"*"
);
// 清空车辆分类树缓存
redisUtils
.
getAndDeletePatternKeys
(
equipTypeAndCount
+
"*"
);
// 清空单位分类数量统计缓存
redisUtils
.
getAndDeletePatternKeys
(
SourcesStatisticsImpl
.
PREFIX_CATEGORY_COUNT
+
"*"
);
maintenanceResourceDataService
.
subscribeTopic
();
emqKeeper
.
getMqttClient
().
subscribe
(
ConfigPageTopicEnum
.
INTEGRATE
.
getTopic
(),
2
,
integratePageDataListener
);
emqKeeper
.
getMqttClient
().
subscribe
(
ConfigPageTopicEnum
.
INTEGRATE
.
getTopic
(),
2
,
integratePageDataListener
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/CarServiceImpl.java
View file @
fda64552
...
...
@@ -1620,10 +1620,10 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarS
@Override
public
void
refreshStaData
()
{
List
<
Map
<
String
,
Object
>>
result
=
this
.
baseMapper
.
queryCompanyCarStaData
();
result
.
forEach
(
m
->
redisUtils
.
set
((
buildKey
(
m
)),
m
.
get
(
"total"
),
86400
));
result
.
forEach
(
m
->
redisUtils
.
set
((
buildKey
(
m
)),
m
.
get
(
"total"
),
86400
));
}
private
String
buildKey
(
Map
<
String
,
Object
>
row
)
{
return
row
.
get
(
"bizOrgCode"
).
toString
()
+
"_"
+
SourceTypeEnum
.
CAR
.
getCode
()
+
"_"
+
row
.
get
(
"categoryCode"
).
toString
();
return
SourcesStatisticsImpl
.
PREFIX_CATEGORY_COUNT
+
row
.
get
(
"bizOrgCode"
).
toString
()
+
"_"
+
SourceTypeEnum
.
CAR
.
getCode
()
+
"_"
+
row
.
get
(
"categoryCode"
).
toString
();
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificSerivceImpl.java
View file @
fda64552
...
...
@@ -1595,7 +1595,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
}
private
String
buildKey
(
Map
<
String
,
Object
>
row
)
{
return
row
.
get
(
"bizOrgCode"
).
toString
()
+
"_"
+
SourceTypeEnum
.
EQUIPMENT
.
getCode
()
+
"_"
+
row
.
get
(
"categoryCode"
).
toString
();
return
SourcesStatisticsImpl
.
PREFIX_CATEGORY_COUNT
+
row
.
get
(
"bizOrgCode"
).
toString
()
+
"_"
+
SourceTypeEnum
.
EQUIPMENT
.
getCode
()
+
"_"
+
row
.
get
(
"categoryCode"
).
toString
();
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java
View file @
fda64552
...
...
@@ -1010,16 +1010,17 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
return
Collections
.
singletonList
(
parentNode
);
}
public
Object
getEquipmentTypeAndCount
(
String
bizOrgCode
)
throws
Exception
{
@Override
public
Object
getEquipmentTypeAndCount
(
String
bizOrgCode
)
{
if
(
redisUtils
.
hasKey
(
equipTypeAndCount
+
bizOrgCode
))
{
List
<
EquipmentCategory
>
typeList
=
JSONArray
.
parseArray
(
return
JSONArray
.
parseArray
(
JSONArray
.
toJSONString
(
redisUtils
.
get
(
equipTypeAndCount
+
bizOrgCode
)),
EquipmentCategory
.
class
);
return
typeList
;
}
else
{
return
refreshEquipmentTypeAndCount
(
bizOrgCode
);
}
}
public
Object
refreshEquipmentTypeAndCount
(
String
bizOrgCode
)
throws
Exception
{
@Override
public
Object
refreshEquipmentTypeAndCount
(
String
bizOrgCode
)
{
List
<
EquipmentCategory
>
responseList
=
this
.
typeList
();
if
(
responseList
==
null
||
responseList
.
size
()
<
1
)
{
return
null
;
...
...
@@ -1028,21 +1029,22 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
.
filter
(
i
->
!
i
.
getCode
().
startsWith
(
"2"
)
&&
"2"
.
equals
(
i
.
getIndustryCode
()))
.
collect
(
Collectors
.
toList
());
List
<
EquipmentCategory
>
list
=
typeListTree
(
equipmentTypeList
,
bizOrgCode
,
SourceTypeEnum
.
EQUIPMENT
);
redisUtils
.
set
(
equipTypeAndCount
+
bizOrgCode
,
list
);
redisUtils
.
set
(
equipTypeAndCount
+
bizOrgCode
,
list
,
86400
);
return
list
;
}
public
Object
getCarTypeAndCount
(
String
bizOrgCode
)
throws
Exception
{
@Override
public
Object
getCarTypeAndCount
(
String
bizOrgCode
)
{
if
(
redisUtils
.
hasKey
(
carTypeAndCount
+
bizOrgCode
))
{
List
<
EquipmentCategory
>
typeList
=
JSONArray
.
parseArray
(
JSONArray
.
toJSONString
(
redisUtils
.
get
(
carTypeAndCount
+
bizOrgCode
)),
EquipmentCategory
.
class
);
return
typeList
;
}
else
{
return
refreshCarTypeAndCount
(
bizOrgCode
);
}
}
public
Object
refreshCarTypeAndCount
(
String
bizOrgCode
)
throws
Exception
{
@Override
public
Object
refreshCarTypeAndCount
(
String
bizOrgCode
)
{
List
<
EquipmentCategory
>
responseList
=
this
.
typeList
();
if
(
responseList
==
null
||
responseList
.
size
()
<
1
)
{
return
null
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/SourcesStatisticsImpl.java
View file @
fda64552
...
...
@@ -2,8 +2,6 @@ package com.yeejoin.equipmanage.service.impl;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.equipmanage.common.enums.SourceTypeEnum
;
import
com.yeejoin.equipmanage.service.ICarService
;
import
com.yeejoin.equipmanage.service.IEquipmentDetailService
;
import
com.yeejoin.equipmanage.service.ISourceStatistics
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -21,12 +19,14 @@ public class SourcesStatisticsImpl implements ISourceStatistics {
@Autowired
private
RedisUtils
redisUtil
;
public
static
String
PREFIX_CATEGORY_COUNT
=
"CATEGORY_COUNT_"
;
@Override
public
int
equipCategoryStatistics
(
String
bizOrgCode
,
SourceTypeEnum
sourceType
,
String
categoryCode
)
{
// 计算处通用code,用来上下级匹配如12001010000->1200101
String
treeCode
=
subStringZero
(
categoryCode
);
Set
<
String
>
keys
=
redisUtil
.
getKeys
(
buildKey
(
bizOrgCode
,
sourceType
.
getCode
(),
treeCode
));
Set
<
String
>
keys
=
redisUtil
.
getKeys
(
build
Patten
Key
(
bizOrgCode
,
sourceType
.
getCode
(),
treeCode
));
if
(
keys
.
size
()
>
0
)
{
//求和
return
this
.
sumNumber
(
keys
);
...
...
@@ -43,10 +43,18 @@ public class SourcesStatisticsImpl implements ISourceStatistics {
}
}
}
return
this
.
sumNumber
(
keys
);
return
this
.
sumNumber
AndInitRedis
(
bizOrgCode
,
sourceType
,
treeCode
,
keys
);
}
}
private
int
sumNumberAndInitRedis
(
String
bizOrgCode
,
SourceTypeEnum
sourceType
,
String
treeCode
,
Set
<
String
>
keys
)
{
int
result
=
this
.
sumNumber
(
keys
);
if
(
result
==
0
){
redisUtil
.
set
(
buildKey
(
bizOrgCode
,
sourceType
.
getCode
(),
treeCode
),
0
,
86400
);
}
return
result
;
}
private
int
sumNumber
(
Set
<
String
>
keys
)
{
return
keys
.
stream
().
filter
(
k
->
redisUtil
.
get
(
k
)
!=
null
).
mapToInt
(
k
->
Integer
.
parseInt
(
redisUtil
.
get
(
k
).
toString
())).
sum
();
}
...
...
@@ -57,7 +65,11 @@ public class SourcesStatisticsImpl implements ISourceStatistics {
return
new
StringBuffer
(
String
.
valueOf
(
noZero
)).
reverse
().
toString
();
}
private
String
buildPattenKey
(
String
bizOrgCode
,
String
sourceType
,
String
treeCode
)
{
return
PREFIX_CATEGORY_COUNT
+
bizOrgCode
+
"*_"
+
sourceType
+
"_"
+
treeCode
+
"*"
;
}
private
String
buildKey
(
String
bizOrgCode
,
String
sourceType
,
String
treeCode
)
{
return
bizOrgCode
+
"*_"
+
sourceType
+
"_"
+
treeCode
+
"*"
;
return
PREFIX_CATEGORY_COUNT
+
bizOrgCode
+
"_"
+
sourceType
+
"_"
+
treeCode
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/StockServiceImpl.java
View file @
fda64552
...
...
@@ -11,6 +11,7 @@ import java.util.stream.Collectors;
import
javax.annotation.Resource
;
import
com.yeejoin.equipmanage.common.utils.SpringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
...
...
@@ -395,7 +396,9 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
}
equipmentSpecificMapper
.
insert
(
equipmentSpecific
);
refreshCount
(
equipmentSpecific
.
getBizOrgCode
());
//添加对于装备类型统计数据的刷新
StockServiceImpl
controllerProxy
=
SpringUtils
.
getBean
(
StockServiceImpl
.
class
);
//添加对于装备类型统计数据的刷新
controllerProxy
.
refreshCount
(
equipmentSpecific
.
getBizOrgCode
());
//位置编码不为空入库
if
(
equipmentDetailDownloadVOS
.
get
(
i
)
!=
null
&&
equipmentDetailDownloadVOS
.
get
(
i
).
getWarehouseStructCode
()
!=
null
)
{
QueryWrapper
<
WarehouseStructure
>
warehouseStructureQueryWrapper
=
new
QueryWrapper
<>();
...
...
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