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
f3ba4a66
Commit
f3ba4a66
authored
Jan 12, 2022
by
KeYong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_ccs' of 172.16.10.76:moa/amos-boot-biz into develop_ccs
parents
1f9130a4
5155edcc
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
187 additions
and
14 deletions
+187
-14
EquipTypeAmountPageDTO.java
...equipmanage/common/entity/dto/EquipTypeAmountPageDTO.java
+3
-0
SourceTypeEnum.java
.../com/yeejoin/equipmanage/common/enums/SourceTypeEnum.java
+2
-2
CarController.java
...ava/com/yeejoin/equipmanage/controller/CarController.java
+17
-1
FireFightingSystemController.java
.../equipmanage/controller/FireFightingSystemController.java
+55
-0
CarMapper.java
...c/main/java/com/yeejoin/equipmanage/mapper/CarMapper.java
+2
-0
ICarService.java
...ain/java/com/yeejoin/equipmanage/service/ICarService.java
+7
-0
IFireFightingSystemService.java
...ejoin/equipmanage/service/IFireFightingSystemService.java
+3
-1
CarServiceImpl.java
.../com/yeejoin/equipmanage/service/impl/CarServiceImpl.java
+12
-0
EquipmentSpecificSerivceImpl.java
...quipmanage/service/impl/EquipmentSpecificSerivceImpl.java
+6
-0
FireFightingSystemServiceImpl.java
...uipmanage/service/impl/FireFightingSystemServiceImpl.java
+27
-8
application.properties
...ot-system-equip/src/main/resources/application.properties
+6
-2
CarMapper.xml
...boot-system-equip/src/main/resources/mapper/CarMapper.xml
+39
-0
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+8
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/dto/EquipTypeAmountPageDTO.java
View file @
f3ba4a66
...
...
@@ -57,4 +57,7 @@ public class EquipTypeAmountPageDTO extends BaseDTO<EquipmentSpecific> {
@ApiModelProperty
(
value
=
"队伍id"
)
private
String
teamId
;
@ApiModelProperty
(
value
=
"是否物联"
)
private
String
isIot
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/enums/SourceTypeEnum.java
View file @
f3ba4a66
...
...
@@ -14,8 +14,8 @@ public enum SourceTypeEnum {
* 资源类型枚举
*/
EQUIPMENT
(
"装备"
,
"equipment"
,
"equipmentSpecificSerivceImpl"
,
"refreshStaData"
),
CAR
(
"车辆"
,
"car"
,
"carServiceImpl"
,
"refreshStaData"
)
;
CAR
(
"车辆"
,
"car"
,
"carServiceImpl"
,
"refreshStaData"
)
,
IOT
(
"iot"
,
"car"
,
"carServiceImpl"
,
"iotrefreshStaData"
);
private
String
name
;
private
String
code
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/CarController.java
View file @
f3ba4a66
...
...
@@ -188,6 +188,12 @@ public class CarController extends AbstractBaseController {
@Value
(
"${auth-key-fire-car}"
)
private
String
carAuthKey
;
@Value
(
"${auth-key-fire-iot-equip:fire_iot-equip_info}"
)
private
String
iotAuthKey
;
@Autowired
JcsFeign
jcsFeign
;
@Autowired
...
...
@@ -244,7 +250,8 @@ public class CarController extends AbstractBaseController {
iCarService
.
refreshStaData
();
// 刷新分类树缓存
fireFightingSystemServiceImpl
.
refreshCarTypeAndCount
(
bizOrgCode
);
}
}
@Async
public
void
refreshCount
(
List
<
Car
>
list
)
{
list
.
forEach
(
i
->{
...
...
@@ -1312,4 +1319,13 @@ public class CarController extends AbstractBaseController {
FeignClientResult
<
List
<
OrgMenuDto
>>
menusList
=
jcsFeign
.
getCompanyDeptTreeWithAuth
(
carAuthKey
,
null
);
return
ResponseHelper
.
buildResponse
(
menusList
.
getResult
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/iot/companyTreeByUserAndType"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据登录人及类型获取公司部门树"
,
notes
=
"根据登录人及类型获取公司部门树"
)
public
ResponseModel
<
Object
>
iotcompanyTreeByUserAndType
()
throws
Exception
{
FeignClientResult
<
List
<
OrgMenuDto
>>
menusList
=
jcsFeign
.
getCompanyDeptTreeWithAuth
(
iotAuthKey
,
null
);
return
ResponseHelper
.
buildResponse
(
menusList
.
getResult
());
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/FireFightingSystemController.java
View file @
f3ba4a66
...
...
@@ -303,7 +303,47 @@ public class FireFightingSystemController extends AbstractBaseController {
@PostMapping
(
value
=
"/iot/getEquipTypeAmount"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"九大类下装备,通过code截取"
,
notes
=
"九大类下装备信息列表"
)
public
IPage
<
EquipTypeImgAmountVO
>
iotgetEquipTypeAmount
(
@RequestBody
EquipTypeAmountPageDTO
equipTypeAmountPage
)
{
equipTypeAmountPage
.
setIsIot
(
"1"
);
String
[]
result
=
hierarchy
.
split
(
","
);
Map
<
Integer
,
Integer
>
map
=
new
HashMap
<>();
for
(
int
i
=
0
;
i
<
result
.
length
;
i
++)
{
map
.
put
(
i
,
Integer
.
valueOf
(
result
[
i
]));
}
if
(
StringUtil
.
isNotEmpty
(
equipTypeAmountPage
.
getEquipmentClassificationCode
()))
{
QueryWrapper
<
EquipmentCategory
>
equipmentCategoryQueryWrapper
=
new
QueryWrapper
<>();
equipmentCategoryQueryWrapper
.
eq
(
"code"
,
equipTypeAmountPage
.
getEquipmentClassificationCode
());
equipmentCategoryQueryWrapper
.
eq
(
"industry_code"
,
equipTypeAmountPage
.
getIndustryCode
());
EquipmentCategory
equipmentCategory
=
equipmentCategoryService
.
getOne
(
equipmentCategoryQueryWrapper
);
if
(
equipmentCategory
==
null
)
{
throw
new
RuntimeException
(
"装备定义code有误"
);
}
int
inhierarchy
=
1
;
for
(
int
i
=
0
;
i
<
result
.
length
+
1
;
i
++)
{
//进来先判断是否默认就是空,如果为空第一层
if
(
equipmentCategory
.
getParentId
()
==
null
)
{
//判断是否是最下面的子节点
if
(
i
>=
4
)
{
inhierarchy
=
8
;
}
else
{
inhierarchy
=
map
.
get
(
i
);
}
break
;
}
else
{
//查找到循环几次为空
equipmentCategory
=
equipmentCategoryService
.
getById
(
equipmentCategory
.
getParentId
());
}
}
return
fireFightingSystemService
.
getColaCategoryAmountList
(
inhierarchy
,
equipTypeAmountPage
.
getEquipmentClassificationCode
().
substring
(
0
,
inhierarchy
),
equipTypeAmountPage
);
}
else
{
return
fireFightingSystemService
.
getColaCategoryAmountList
(
0
,
null
,
equipTypeAmountPage
);
}
}
...
...
@@ -720,4 +760,19 @@ public class FireFightingSystemController extends AbstractBaseController {
public
Object
getCarTypeAndCount
(
@RequestParam
(
required
=
false
)
String
bizOrgCode
)
throws
Exception
{
return
fireFightingSystemService
.
getCarTypeAndCount
(
bizOrgCode
);
}
/**
* 获取物联设备类型和统计值
* @throws Exception
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"获取物联设备类型和统计值"
,
notes
=
"获取物联设备类型和统计值"
)
@GetMapping
(
value
=
"iot/getEquipmentTypeAndCount/tree"
)
public
Object
iotgetEquipmentTypeAndCount
(
@RequestParam
(
required
=
false
)
String
bizOrgCode
)
throws
Exception
{
return
fireFightingSystemService
.
iotgetEquipmentTypeAndCount
(
bizOrgCode
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/CarMapper.java
View file @
f3ba4a66
...
...
@@ -73,4 +73,6 @@ public interface CarMapper extends BaseMapper<Car> {
List
<
CarFusionDto
>
selectCarAndCarProperty
();
List
<
Map
<
String
,
Object
>>
queryCompanyCarStaData
();
List
<
Map
<
String
,
Object
>>
queryCompanyIotStaData
();
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/ICarService.java
View file @
f3ba4a66
...
...
@@ -178,4 +178,11 @@ public interface ICarService extends IService<Car> {
* 更新redis 统计数据
*/
void
refreshStaData
();
/**
* iot装备更新redis 统计数据
*/
void
iotrefreshStaData
();
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IFireFightingSystemService.java
View file @
f3ba4a66
...
...
@@ -221,7 +221,9 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
* @throws Exception
*/
Object
getCarTypeAndCount
(
String
bizOrgCode
)
throws
Exception
;
Object
iotgetEquipmentTypeAndCount
(
String
bizOrgCode
)
throws
Exception
;
public
Object
refreshEquipmentTypeAndCount
(
String
bizOrgCode
)
throws
Exception
;
public
Object
refreshCarTypeAndCount
(
String
bizOrgCode
)
throws
Exception
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/CarServiceImpl.java
View file @
f3ba4a66
...
...
@@ -1621,9 +1621,21 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarS
public
void
refreshStaData
()
{
List
<
Map
<
String
,
Object
>>
result
=
this
.
baseMapper
.
queryCompanyCarStaData
();
result
.
forEach
(
m
->
redisUtils
.
set
((
buildKey
(
m
)),
m
.
get
(
"total"
),
86400
));
iotrefreshStaData
();
}
@Override
public
void
iotrefreshStaData
()
{
List
<
Map
<
String
,
Object
>>
result
=
this
.
baseMapper
.
queryCompanyIotStaData
();
result
.
forEach
(
m
->
redisUtils
.
set
((
iotbuildKey
(
m
)),
m
.
get
(
"total"
),
86400
));
}
private
String
buildKey
(
Map
<
String
,
Object
>
row
)
{
return
SourcesStatisticsImpl
.
PREFIX_CATEGORY_COUNT
+
row
.
get
(
"bizOrgCode"
).
toString
()
+
"_"
+
SourceTypeEnum
.
CAR
.
getCode
()
+
"_"
+
row
.
get
(
"categoryCode"
).
toString
();
}
private
String
iotbuildKey
(
Map
<
String
,
Object
>
row
)
{
return
SourcesStatisticsImpl
.
PREFIX_CATEGORY_COUNT
+
row
.
get
(
"bizOrgCode"
).
toString
()
+
"_"
+
SourceTypeEnum
.
IOT
.
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 @
f3ba4a66
...
...
@@ -112,6 +112,10 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Autowired
private
IVideoService
videoService
;
@Autowired
private
ICarService
carService
;
@Value
(
"${systemctl.dict.iot-core-param}"
)
private
String
iotCoreParam
;
...
...
@@ -1592,6 +1596,8 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
public
void
refreshStaData
()
{
List
<
Map
<
String
,
Object
>>
result
=
this
.
baseMapper
.
queryCompanyStaData
();
result
.
forEach
(
m
->
redisUtils
.
set
((
buildKey
(
m
)),
m
.
get
(
"total"
),
86400
));
carService
.
iotrefreshStaData
();
}
private
String
buildKey
(
Map
<
String
,
Object
>
row
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java
View file @
f3ba4a66
...
...
@@ -16,6 +16,7 @@ import java.util.Optional;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
com.yeejoin.equipmanage.common.vo.*
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
@@ -67,14 +68,6 @@ import com.yeejoin.equipmanage.common.enums.SourceTypeEnum;
import
com.yeejoin.equipmanage.common.enums.SystemTypeEnum
;
import
com.yeejoin.equipmanage.common.enums.TrueOrFalseEnum
;
import
com.yeejoin.equipmanage.common.utils.StringUtil
;
import
com.yeejoin.equipmanage.common.vo.AlarmDataVO
;
import
com.yeejoin.equipmanage.common.vo.EquipmentManageVo
;
import
com.yeejoin.equipmanage.common.vo.FileUploadVo
;
import
com.yeejoin.equipmanage.common.vo.FireFightingSystem3dVo
;
import
com.yeejoin.equipmanage.common.vo.FireFightingSystemTreeVo
;
import
com.yeejoin.equipmanage.common.vo.FireFightingSystemTypeTreeVo
;
import
com.yeejoin.equipmanage.common.vo.FireFightingSystemVo
;
import
com.yeejoin.equipmanage.common.vo.SpeIndexVo
;
import
com.yeejoin.equipmanage.mapper.BuildingMapper
;
import
com.yeejoin.equipmanage.mapper.EquipmentManageMapper
;
import
com.yeejoin.equipmanage.mapper.FireFightingSystemMapper
;
...
...
@@ -1043,6 +1036,32 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
return
refreshCarTypeAndCount
(
bizOrgCode
);
}
}
@Override
public
Object
iotgetEquipmentTypeAndCount
(
String
bizOrgCode
)
throws
Exception
{
if
(
redisUtils
.
hasKey
(
"iotTypeAndCount"
+
bizOrgCode
))
{
return
JSONArray
.
parseArray
(
JSONArray
.
toJSONString
(
redisUtils
.
get
(
"iotTypeAndCount"
+
bizOrgCode
)),
EquipmentCategory
.
class
);
}
else
{
return
iotrefreshEquipmentTypeAndCount
(
bizOrgCode
);
}
}
public
Object
iotrefreshEquipmentTypeAndCount
(
String
bizOrgCode
)
{
List
<
EquipmentCategory
>
responseList
=
this
.
typeList
();
if
(
responseList
==
null
||
responseList
.
size
()
<
1
)
{
return
null
;
}
List
<
EquipmentCategory
>
list
=
typeListTree
(
responseList
,
bizOrgCode
,
SourceTypeEnum
.
IOT
);
redisUtils
.
set
(
"iotTypeAndCount"
+
bizOrgCode
,
list
,
86400
);
return
list
;
}
@Override
public
Object
refreshCarTypeAndCount
(
String
bizOrgCode
)
{
List
<
EquipmentCategory
>
responseList
=
this
.
typeList
();
...
...
amos-boot-system-equip/src/main/resources/application.properties
View file @
f3ba4a66
...
...
@@ -103,4 +103,8 @@ auth-key-fire-building=fire_building_info
redis_car_type_count
=
carTypeAndCount
redis_equip_type_count
=
equipTypeAndCount
\ No newline at end of file
redis_equip_type_count
=
equipTypeAndCount
# 权限标识-物联装备
auth-key-fire-iot-equip
=
fire_iot-equip_info
\ No newline at end of file
amos-boot-system-equip/src/main/resources/mapper/CarMapper.xml
View file @
f3ba4a66
...
...
@@ -619,4 +619,43 @@
and s.biz_org_code
<![CDATA[<>]]>
''
GROUP BY s.biz_org_code ,c.code
</select>
<select
id=
"queryCompanyIotStaData"
resultType=
"java.util.Map"
>
SELECT
s.biz_org_code as bizOrgCode,
c.code as categoryCode,
count(1) as total
FROM
`wl_car` s,
wl_equipment e,
wl_equipment_category c
where
e.is_iot=1
and s.equipment_id = e.`id`
and e.category_id = c.id
and s.biz_org_code is not null
GROUP BY s.biz_org_code ,c.code
UNION
SELECT
s.biz_org_code as bizOrgCode,
c.code as categoryCode,
count(1) as total
FROM
`wl_equipment_specific` s,
wl_equipment e,
wl_equipment_category c
where
e.is_iot=1
and s.equipment_code = e.`code`
and e.category_id = c.id
and s.biz_org_code is not null
GROUP BY s.biz_org_code ,c.code
</select>
</mapper>
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
f3ba4a66
...
...
@@ -611,6 +611,11 @@
<if
test=
"codeHead!=null and codeHead!='' and codeHead!=' '"
>
and LEFT (wle.CODE, #{hierarchy}) = #{codeHead}
</if>
<if
test=
"equipTypeAmountPage.isIot!=null"
>
and wle.is_iot=1
</if>
<if
test=
"equipTypeAmountPage.industryCode!=null"
>
and wec.industry_code = #{equipTypeAmountPage.industryCode}
</if>
...
...
@@ -713,6 +718,9 @@
<if
test=
"equipTypeAmountPage.industryCode!=null"
>
and wec.industry_code = #{equipTypeAmountPage.industryCode}
</if>
<if
test=
"equipTypeAmountPage.isIot!=null"
>
and wle.is_iot=1
</if>
<if
test=
"equipTypeAmountPage.equipmentName!=null and equipTypeAmountPage.equipmentName!=''"
>
And wlc.`NAME` LIKE CONCAT('%',#{equipTypeAmountPage.equipmentName},'%')
</if>
...
...
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