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
48143440
Commit
48143440
authored
Oct 09, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.摄像头表代码生成
parent
fa7bfdc1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
329 additions
and
251 deletions
+329
-251
VideoConstant.java
...yeejoin/amos/boot/biz/common/constants/VideoConstant.java
+18
-0
CommonVideoDto.java
.../com/yeejoin/amos/boot/biz/common/dto/CommonVideoDto.java
+21
-0
CommonVideoEnum.java
...m/yeejoin/amos/boot/biz/common/enums/CommonVideoEnum.java
+52
-0
IBaseEnterpriseVideoService.java
...odule/common/api/service/IBaseEnterpriseVideoService.java
+3
-0
IDataDictionaryService.java
...oot/module/common/api/service/IDataDictionaryService.java
+0
-21
DataDictionaryController.java
...odule/common/biz/controller/DataDictionaryController.java
+0
-0
FirefightersContractController.java
...common/biz/controller/FirefightersContractController.java
+1
-1
FirefightersPostController.java
...ule/common/biz/controller/FirefightersPostController.java
+1
-1
FirefightersThoughtController.java
.../common/biz/controller/FirefightersThoughtController.java
+1
-1
IDutyCarService.java
.../amos/boot/module/common/biz/service/IDutyCarService.java
+0
-24
IDutyCommonService.java
...os/boot/module/common/biz/service/IDutyCommonService.java
+0
-82
IDutyPersonService.java
...os/boot/module/common/biz/service/IDutyPersonService.java
+0
-26
BaseEnterpriseVideoServiceImpl.java
...mmon/biz/service/impl/BaseEnterpriseVideoServiceImpl.java
+107
-7
DataDictionaryServiceImpl.java
...le/common/biz/service/impl/DataDictionaryServiceImpl.java
+0
-86
FireTeamServiceImpl.java
...t/module/common/biz/service/impl/FireTeamServiceImpl.java
+1
-1
UnitVideoDto.java
...oin/amos/boot/module/statistics/api/dto/UnitVideoDto.java
+19
-0
TreeNodeVo.java
...eejoin/amos/boot/module/statistics/api/vo/TreeNodeVo.java
+36
-0
AmosStatisticsApplication.java
...main/java/com/yeejoin/amos/AmosStatisticsApplication.java
+2
-1
VideoController.java
...boot/module/statistcs/biz/controller/VideoController.java
+63
-0
StCommonServiceImpl.java
...odule/statistcs/biz/service/impl/StCommonServiceImpl.java
+4
-0
VideoServiceImpl.java
...t/module/statistcs/biz/service/impl/VideoServiceImpl.java
+0
-0
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/constants/VideoConstant.java
0 → 100644
View file @
48143440
package
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
constants
;
/**
* @author Administrator
*/
public
class
VideoConstant
{
public
static
final
String
CODE_200
=
"200"
;
public
static
final
String
CODE_10001
=
"10001"
;
public
static
final
String
CODE_10005
=
"10005"
;
public
static
final
String
CODE_10017
=
"10017"
;
public
static
final
String
CODE_10030
=
"10030"
;
public
static
final
String
CODE_49999
=
"49999"
;
public
static
final
String
CODE_201
=
"201"
;
public
static
final
String
CODE_401
=
"401"
;
public
static
final
String
CODE_403
=
"403"
;
public
static
final
String
CODE_404
=
"404"
;
public
static
final
String
CODE_20001
=
"20001"
;
}
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/dto/CommonVideoDto.java
0 → 100644
View file @
48143440
package
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"CommonVideoDto"
,
description
=
"通用视频信息"
)
public
class
CommonVideoDto
{
private
String
key
;
private
String
url
;
private
String
type
;
private
String
title
;
private
String
thumb
;
private
String
parent
;
}
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/enums/CommonVideoEnum.java
0 → 100644
View file @
48143440
package
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
enums
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
/**
*
* <pre>
* 通用视频协议枚举
* </pre>
*
*/
@Getter
@AllArgsConstructor
public
enum
CommonVideoEnum
{
HLS
(
"2"
,
"hls"
),
IMG
(
"3"
,
"img"
);
private
String
code
;
private
String
name
;
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
static
CommonVideoEnum
getEnum
(
String
code
)
{
for
(
CommonVideoEnum
status
:
CommonVideoEnum
.
values
())
{
if
(
status
.
getCode
().
equals
(
code
))
{
return
status
;
}
}
return
null
;
}
}
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IBaseEnterpriseVideoService.java
View file @
48143440
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yeejoin.amos.boot.module.common.api.entity.BaseEnterpriseVideo
;
/**
* 单位下摄像头表接口类
*
...
...
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IDataDictionaryService.java
deleted
100644 → 0
View file @
fa7bfdc1
//package com.yeejoin.amos.boot.module.common.api.service;
//
//import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
//
//import java.util.List;
//
///**
// * 数据字典 服务类
// *
// * @author tb
// * @date 2021-06-07
// */
//public interface IDataDictionaryService {
//
//
// Object getFireChemical(String type) throws Exception;
//
// Object gwmcDataDictionary(String type) throws Exception;
//
// List<MenuFrom> getGWMCDataDictionary(String type) throws Exception;
//}
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/DataDictionaryController.java
deleted
100644 → 0
View file @
fa7bfdc1
This diff is collapsed.
Click to expand it.
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/FirefightersContractController.java
View file @
48143440
...
...
@@ -60,7 +60,7 @@ public class FirefightersContractController extends BaseController {
SourceFileServiceImpl
sourceFileService
;
@Autowired
RedisUtils
redisUtils
;
@Value
(
"${redis.cache.failure.time}"
)
@Value
(
"${redis.cache.failure.time
:10800
}"
)
private
long
time
;
/**
* 新增消防员合同
...
...
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/FirefightersPostController.java
View file @
48143440
...
...
@@ -63,7 +63,7 @@ public class FirefightersPostController extends BaseController {
@Autowired
RedisUtils
redisUtils
;
@Value
(
"${redis.cache.failure.time}"
)
@Value
(
"${redis.cache.failure.time
:10800
}"
)
private
long
time
;
/**
...
...
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/FirefightersThoughtController.java
View file @
48143440
...
...
@@ -56,7 +56,7 @@ public class FirefightersThoughtController extends BaseController {
RedisUtils
redisUtils
;
@Autowired
SourceFileServiceImpl
sourceFileService
;
@Value
(
"${redis.cache.failure.time}"
)
@Value
(
"${redis.cache.failure.time
:10800
}"
)
private
long
time
;
/**
* 新增消防员思想谈话记录
...
...
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/IDutyCarService.java
deleted
100644 → 0
View file @
fa7bfdc1
//package com.yeejoin.amos.boot.module.common.biz.service;
//
//import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
//
///**
// * @author DELL
// */
//public interface IDutyCarService extends IDutyCommonService {
//
// /**
// * 值班信息保存
// * @param dutyCarDto 对象
// * @return List<DutyCarDto>
// */
// DutyCarDto save(DutyCarDto dutyCarDto);
//
// /**
// * 更新
// * @param instanceId 实例id
// * @param dutyCarDto 业务对象
// * @return List<DutyCarDto>
// */
// DutyCarDto update(Long instanceId, DutyCarDto dutyCarDto);
//}
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/IDutyCommonService.java
deleted
100644 → 0
View file @
fa7bfdc1
//package com.yeejoin.amos.boot.module.common.biz.service;
//
//import com.baomidou.mybatisplus.core.metadata.IPage;
//
//import java.text.ParseException;
//import java.util.List;
//import java.util.Map;
//
///**
// * @author DELL
// */
//public interface IDutyCommonService {
// /**
// * 分页查询
// *
// * @param current 当前页
// * @param size 页大小
// * @param beginDate 开始日期
// * @param endDate 结束日期
// * @return IPage<Map < String, Object>>
// */
// IPage<Map<String, Object>> pageList(int current, int size, String beginDate, String endDate) throws ParseException;
//
// /**
// * 值班明细
// *
// * @param beginDate 开始日期
// * @param endDate 结束日期
// * @return ResponseModel
// */
// List<Map<String, Object>> statisticsDay(String beginDate, String endDate) throws ParseException;
//
// /**
// * 不分页查询
// *
// * @param beginDate 开始日期
// * @param endDate 结束日期
// * @return ResponseModel
// */
// List<Map<String, Object>> list(String beginDate, String endDate) throws ParseException;
//
// /**
// * 获取表单参数
// *
// * @return String
// */
// String getGroupCode();
//
// List downloadList(String beginDate, String endDate) throws ParseException;
//
// /**
// * 值班数据入库
// *
// * @param dataList 数据
// */
// void saveImportData(List<Map<String, Object>> dataList);
//
// /**
// * 删除值班数据
// *
// * @param instanceId 实例id
// * @return Boolean
// */
// Boolean deleteDutyData(Long instanceId);
//
// /**
// * 查询指定条件的值班人信息
// *
// * @param dutyDay 查询条件
// * @param shiftId 班次
// * @param postType 岗位
// * @return List<Map < String, Object>>
// */
// List<Map<String, Object>> dayDutyPersonList(String dutyDay, Long shiftId, String postType);
//
// /**
// * 查询当前值班人信息
// *
// * @return List<Map < String, Object>>
// */
// List<Map<String, Object>> listOnDutyPerson();
//}
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/IDutyPersonService.java
deleted
100644 → 0
View file @
fa7bfdc1
//package com.yeejoin.amos.boot.module.common.biz.service;
//
//import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
//
///**
// * @author DELL
// */
//public interface IDutyPersonService extends IDutyCommonService {
// /**
// * 保存
// *
// * @param dutyPersonDto 业务对象
// * @return List<DutyPersonDto>
// */
// DutyPersonDto save(DutyPersonDto dutyPersonDto);
//
//
// /**
// * 更新
// *
// * @param instanceId 实例id
// * @param dutyPersonDto 业务对象
// * @return List<DutyCarDto>
// */
// DutyPersonDto update(Long instanceId, DutyPersonDto dutyPersonDto);
//}
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/BaseEnterpriseVideoServiceImpl.java
View file @
48143440
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
import
cn.hutool.http.HttpUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.dto.CommonVideoDto
;
import
com.yeejoin.amos.boot.biz.common.enums.CommonVideoEnum
;
import
com.yeejoin.amos.boot.module.common.api.entity.BaseEnterpriseVideo
;
import
com.yeejoin.amos.boot.module.common.api.mapper.BaseEnterpriseVideoMapper
;
import
com.yeejoin.amos.boot.module.common.api.service.IBaseEnterpriseVideoService
;
import
com.yeejoin.amos.boot.module.common.api.dto.BaseEnterpriseVideoDto
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
static
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
constants
.
VideoConstant
.*;
import
static
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
constants
.
VideoConstant
.
CODE_200
;
/**
* 单位下摄像头表服务实现类
*
...
...
@@ -16,18 +29,104 @@ import java.util.List;
* @date 2024-10-09
*/
@Service
@Slf4j
public
class
BaseEnterpriseVideoServiceImpl
extends
BaseService
<
BaseEnterpriseVideoDto
,
BaseEnterpriseVideo
,
BaseEnterpriseVideoMapper
>
implements
IBaseEnterpriseVideoService
{
@Value
(
"${cylinder.video.default.image.url:/upload/tzs/cylinder/no-connect.png}"
)
private
String
defaultVideoUrl
;
public
List
<
CommonVideoDto
>
getUnitVideoUrl
(
String
useUnitCode
)
{
List
<
CommonVideoDto
>
result
=
new
ArrayList
<
CommonVideoDto
>();
LambdaQueryWrapper
<
BaseEnterpriseVideo
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
BaseEnterpriseVideo:
:
getUseUnitCode
,
useUnitCode
);
BaseEnterpriseVideo
cylinderUnitVideo
=
this
.
getBaseMapper
().
selectOne
(
wrapper
);
if
(
null
!=
cylinderUnitVideo
)
{
HashMap
<
String
,
Object
>
requestInfo
=
new
HashMap
<>();
requestInfo
.
put
(
"appKey"
,
cylinderUnitVideo
.
getAppKey
());
requestInfo
.
put
(
"appSecret"
,
cylinderUnitVideo
.
getAppSecret
());
String
channelNos
=
cylinderUnitVideo
.
getChannelNo
();
List
<
CommonVideoDto
>
channelNoList
=
JSONObject
.
parseArray
(
channelNos
,
CommonVideoDto
.
class
);
try
{
String
accessTokenData
=
HttpUtil
.
post
(
cylinderUnitVideo
.
getTokenUrl
(),
requestInfo
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
accessTokenData
);
String
msg
=
jsonObject
.
get
(
"msg"
).
toString
();
String
code
=
jsonObject
.
get
(
"code"
).
toString
();
if
(
CODE_10001
.
equals
(
code
)
||
CODE_10005
.
equals
(
code
)
||
CODE_10017
.
equals
(
code
)
||
CODE_10030
.
equals
(
code
)
||
CODE_49999
.
equals
(
code
))
{
String
errorMsg
=
"code:"
+
code
+
"msg:"
+
msg
+
"appKey:"
+
cylinderUnitVideo
.
getAppKey
()
+
"appSecret:"
+
cylinderUnitVideo
.
getAppSecret
();
log
.
info
(
"视频token获取失败errorMsg:{}"
,
errorMsg
);
this
.
setDefaultVideoIfConnectFailed
(
channelNoList
,
result
);
return
result
;
}
if
(
CODE_200
.
equals
(
code
))
{
String
data
=
jsonObject
.
get
(
"data"
).
toString
();
JSONObject
objTokenJson
=
JSON
.
parseObject
(
data
);
String
accessToken
=
objTokenJson
.
get
(
"accessToken"
).
toString
();
System
.
out
.
println
(
accessToken
);
for
(
CommonVideoDto
channelNo
:
channelNoList
)
{
HashMap
<
String
,
Object
>
requestVideosInfo
=
new
HashMap
<>();
requestVideosInfo
.
put
(
"accessToken"
,
accessToken
);
requestVideosInfo
.
put
(
"deviceSerial"
,
cylinderUnitVideo
.
getDeviceSerial
());
requestVideosInfo
.
put
(
"channelNo"
,
channelNo
.
getKey
());
requestVideosInfo
.
put
(
"protocol"
,
cylinderUnitVideo
.
getProtocol
());
requestVideosInfo
.
put
(
"expireTime"
,
cylinderUnitVideo
.
getExpireTime
());
String
videoData
=
HttpUtil
.
post
(
cylinderUnitVideo
.
getUrl
(),
requestVideosInfo
);
JSONObject
videoJsonObject
=
JSON
.
parseObject
(
videoData
);
String
msgVideo
=
videoJsonObject
.
get
(
"msg"
).
toString
();
String
codeVideo
=
videoJsonObject
.
get
(
"code"
).
toString
();
if
(
CODE_201
.
equals
(
codeVideo
)
||
CODE_401
.
equals
(
codeVideo
)
||
CODE_403
.
equals
(
codeVideo
)
||
CODE_404
.
equals
(
codeVideo
)
||
CODE_20001
.
equals
(
codeVideo
))
{
String
errorMsg
=
"code:"
+
codeVideo
+
"msg:"
+
msgVideo
+
"appKey:"
+
cylinderUnitVideo
.
getAppKey
()
+
"appSecret:"
+
cylinderUnitVideo
.
getAppSecret
()
+
"accessToken:"
+
accessToken
;
log
.
info
(
"视频地址获取失败errorMsg:{}"
,
errorMsg
);
this
.
setDefaultChannelData
(
result
,
channelNo
);
continue
;
}
if
(
CODE_200
.
equals
(
codeVideo
))
{
String
dataS
=
videoJsonObject
.
get
(
"data"
).
toString
();
JSONObject
dd
=
JSON
.
parseObject
(
dataS
);
String
url
=
dd
.
get
(
"url"
).
toString
();
CommonVideoDto
commonVideoDto
=
new
CommonVideoDto
();
commonVideoDto
.
setUrl
(
url
);
commonVideoDto
.
setKey
(
channelNo
.
getKey
());
commonVideoDto
.
setType
(
CommonVideoEnum
.
getEnum
(
cylinderUnitVideo
.
getProtocol
()).
getName
());
commonVideoDto
.
setTitle
(
channelNo
.
getTitle
());
commonVideoDto
.
setThumb
(
channelNo
.
getThumb
());
result
.
add
(
commonVideoDto
);
}
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
this
.
setDefaultVideoIfConnectFailed
(
channelNoList
,
result
);
}
}
return
result
;
}
/**
* 分页查询
* 通道连接不上时,返回通道的默认图片
*
* @param result 返回连接的总通道
* @param channelNo 未连接的通道
*/
public
Page
<
BaseEnterpriseVideoDto
>
queryForBaseEnterpriseVideoPage
(
Page
<
BaseEnterpriseVideoDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
private
void
setDefaultChannelData
(
List
<
CommonVideoDto
>
result
,
CommonVideoDto
channelNo
)
{
CommonVideoDto
commonVideoDto
=
new
CommonVideoDto
();
commonVideoDto
.
setUrl
(
channelNo
.
getThumb
());
commonVideoDto
.
setKey
(
channelNo
.
getKey
());
commonVideoDto
.
setType
(
CommonVideoEnum
.
IMG
.
getName
());
commonVideoDto
.
setTitle
(
channelNo
.
getTitle
());
commonVideoDto
.
setThumb
(
channelNo
.
getThumb
());
result
.
add
(
commonVideoDto
);
}
/**
* 列表查询 示例
* 连接不上时返回的气通道信息
*
* @param commonVideoDtos 当前气瓶单位的所有通道
* @param result 返回的结果集合
*/
public
List
<
BaseEnterpriseVideoDto
>
queryForBaseEnterpriseVideoList
()
{
return
this
.
queryForList
(
""
,
false
);
private
void
setDefaultVideoIfConnectFailed
(
List
<
CommonVideoDto
>
commonVideoDtos
,
List
<
CommonVideoDto
>
result
)
{
// 先情况防止数据重复
result
.
clear
();
// 每个通道设备默认值
commonVideoDtos
.
forEach
(
channelNo
->
this
.
setDefaultChannelData
(
result
,
channelNo
));
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/DataDictionaryServiceImpl.java
deleted
100644 → 0
View file @
fa7bfdc1
//package com.yeejoin.amos.boot.module.common.biz.service.impl;
//
//
//import com.alibaba.fastjson.JSON;
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.yeejoin.amos.boot.biz.common.utils.*;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.stereotype.Service;
//import org.typroject.tyboot.core.rdbms.service.BaseService;
//
//import com.yeejoin.amos.boot.module.common.api.dto.DataDictionaryDto;
//import com.yeejoin.amos.boot.module.common.api.entity.DataDictionary;
//import com.yeejoin.amos.boot.module.common.api.mapper.DataDictionaryMapper;
//import com.yeejoin.amos.boot.module.common.api.service.IDataDictionaryService;
//import org.typroject.tyboot.core.restful.utils.ResponseHelper;
//
//import java.util.Collection;
//import java.util.List;
//
///**
// * 数据字典 服务实现类
// *
// * @author tb
// * @date 2021-06-07
// */
//@Service
//public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, DataDictionary, DataDictionaryMapper> implements IDataDictionaryService {
// @Autowired
// RedisUtils redisUtils;
//
// @Value("${redis.cache.failure.time}")
// private long time;
//
//
// @Override
// public Object getFireChemical(String type) throws Exception {
// QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
// queryWrapper.eq("type", type);
// queryWrapper.orderByAsc("sort_num");
//
// if (redisUtils.hasKey(RedisKey.DATA_DICTIONARY_CODE + type)) {
// Object obj = redisUtils.get(RedisKey.DATA_DICTIONARY_CODE + type);
// return obj;
// } else {
// Collection<DataDictionary> list = this.list(queryWrapper);
// List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getCode", 0,
// "getName", "getParent", null);
// MenuFrom Me = new MenuFrom("-1", "-1", "-1", "危化品库", "危化品库", "危化品库", "-1", null);
// Me.setIsLeaf(false);
// Me.setChildren(menus);
// redisUtils.set(RedisKey.DATA_DICTIONARY_CODE + type, JSON.toJSON(Me), time);
// return Me;
// }
// }
//
// @Override
// public Object gwmcDataDictionary(String type) throws Exception {
// QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
// queryWrapper.eq("type", type);
// queryWrapper.orderByAsc("sort_num");
//
// if (redisUtils.hasKey(RedisKey.DATA_DICTIONARY_CODE + type)) {
// Object obj = redisUtils.get(RedisKey.DATA_DICTIONARY_CODE + type);
// return obj;
// } else {
// Collection<DataDictionary> list = this.list(queryWrapper);
// List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName"
// , "getParent", null);
// redisUtils.set(RedisKey.DATA_DICTIONARY_CODE + type, JSON.toJSON(menus), time);
// return menus;
// }
// }
//
// public List<MenuFrom> getGWMCDataDictionary(String type) throws Exception {
// QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
// queryWrapper.eq("type", type);
// queryWrapper.orderByAsc("sort_num");
//
// Collection<DataDictionary> list = this.list(queryWrapper);
// List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getCode", 0, "getName"
// , "getParent", null);
// return menus;
//
// }
//}
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FireTeamServiceImpl.java
View file @
48143440
...
...
@@ -66,7 +66,7 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
@Autowired
private
RedisUtils
redisUtils
;
@Value
(
"${fire-rescue}"
)
@Value
(
"${fire-rescue
:1432549862557130753
}"
)
private
String
fireRescueId
;
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/dto/UnitVideoDto.java
0 → 100644
View file @
48143440
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistics
.
api
.
dto
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
lombok.Data
;
/**
* @author Administrator
*/
@Data
public
class
UnitVideoDto
extends
BaseDto
{
private
String
id
;
private
String
name
;
private
String
code
;
private
Long
countNum
;
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/vo/TreeNodeVo.java
0 → 100644
View file @
48143440
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistics
.
api
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiParam
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author Administrator
* 树节点
*/
@Data
@ApiModel
(
value
=
"树节点"
)
public
class
TreeNodeVo
{
@ApiParam
(
value
=
"节点唯一标识"
)
private
String
id
;
@ApiParam
(
value
=
"节点名称"
)
private
String
name
;
@ApiParam
(
value
=
"节点类型"
)
private
String
nodeType
;
@ApiParam
(
value
=
"父id"
)
private
String
parentId
;
@ApiParam
(
value
=
"节点code"
)
private
String
code
;
@ApiParam
(
value
=
"字节点"
)
private
List
<
TreeNodeVo
>
children
=
new
ArrayList
<>();
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/AmosStatisticsApplication.java
View file @
48143440
...
...
@@ -30,9 +30,10 @@ import java.net.UnknownHostException;
@EnableDiscoveryClient
@EnableFeignClients
@EnableSwagger2WebMvc
@MapperScan
({
"org.typroject.tyboot.demo.face.orm.dao*"
,
"org.typroject.tyboot.face.*.orm.dao*"
,
"org.typroject.tyboot.core.auth.face.orm.dao*"
,
"org.typroject.tyboot.component.*.face.orm.dao*"
,
"com.yeejoin.amos.boot.module.**.api.mapper"
,
"com.yeejoin.amos.boot.module.**.api.service"
,
"com.yeejoin.amos.boot.module.**.api.mapper"
,
"com.yeejoin.amos.boot.biz.common.dao.mapper"
})
@ComponentScan
(
basePackages
=
{
"org.typroject"
,
"com.yeejoin.amos"
})
public
class
AmosStatisticsApplication
{
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/controller/VideoController.java
0 → 100644
View file @
48143440
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistcs
.
biz
.
controller
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
com.yeejoin.amos.boot.biz.common.dto.CommonVideoDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto
;
import
com.yeejoin.amos.boot.module.statistcs.biz.service.impl.VideoServiceImpl
;
import
com.yeejoin.amos.boot.module.statistics.api.vo.TreeNodeVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.FieldError
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.List
;
/**
* @author suhuiguang
*/
@RestController
@Api
(
tags
=
"摄像头相关api"
)
@RequestMapping
(
"/video"
)
public
class
VideoController
{
private
VideoServiceImpl
videoService
;
public
VideoController
(
VideoServiceImpl
videoService
)
{
this
.
videoService
=
videoService
;
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"区域、单位、摄像头3级树接口"
,
httpMethod
=
"POST"
)
@PostMapping
(
value
=
"/tree"
)
public
ResponseModel
<
List
<
TreeNodeVo
>>
getVideoTree
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
if
(!
fieldErrors
.
isEmpty
())
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
());
}
List
<
TreeNodeVo
>
re
=
videoService
.
getVideoTree
(
dpFilterParamDto
);
return
ResponseHelper
.
buildResponse
(
re
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"查询指定区域下的单位列表接口,带摄像头数量统计-不分页"
,
httpMethod
=
"GET"
)
@GetMapping
(
value
=
"/countByUnit"
)
public
ResponseModel
<
List
<?
extends
BaseDto
>>
getUnitList
(
@RequestParam
(
value
=
"code"
)
String
regionCode
)
{
List
<?
extends
BaseDto
>
re
=
videoService
.
getUnitList
(
regionCode
);
return
ResponseHelper
.
buildResponse
(
re
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"查询指定单位下的摄像头列表接口-不分页"
,
httpMethod
=
"GET"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
CommonVideoDto
>>
getVideoList
(
@RequestParam
(
value
=
"code"
)
String
useUnitCode
)
{
List
<
CommonVideoDto
>
re
=
videoService
.
getVideoList
(
useUnitCode
);
return
ResponseHelper
.
buildResponse
(
re
);
}
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/StCommonServiceImpl.java
View file @
48143440
...
...
@@ -99,6 +99,10 @@ public class StCommonServiceImpl {
initReginCode
();
}
public
List
<
RegionModel
>
getRegionModels
(){
return
regionModels
;
}
private
void
initReginCode
()
{
Collection
<
RegionModel
>
result
=
Systemctl
.
regionClient
.
queryForTree
(
null
).
getResult
();
result
.
forEach
(
r
->
{
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/VideoServiceImpl.java
0 → 100644
View file @
48143440
This diff is collapsed.
Click to expand it.
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