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
b83789cc
Commit
b83789cc
authored
Dec 25, 2021
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.权限调整
parent
ce9f2b33
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
596 additions
and
435 deletions
+596
-435
OrgMenuDto.java
...java/com/yeejoin/amos/boot/biz/common/dto/OrgMenuDto.java
+81
-0
ExcelUtil.java
.../yeejoin/amos/boot/module/common/api/excel/ExcelUtil.java
+1
-1
OrgUsrDto.java
...in/java/com/yeejoin/equipmanage/common/dto/OrgUsrDto.java
+47
-0
OrgUsrController.java
...s/boot/module/common/biz/controller/OrgUsrController.java
+32
-1
pom.xml
...e/amos-boot-module-biz/amos-boot-module-equip-biz/pom.xml
+0
-5
AreaController.java
...va/com/yeejoin/equipmanage/controller/AreaController.java
+6
-15
EquipmentDetailController.java
...oin/equipmanage/controller/EquipmentDetailController.java
+52
-77
FireFightingSystemController.java
.../equipmanage/controller/FireFightingSystemController.java
+26
-61
VideoController.java
...a/com/yeejoin/equipmanage/controller/VideoController.java
+7
-10
FeignConfiguration.java
...ava/com/yeejoin/equipmanage/fegin/FeignConfiguration.java
+17
-10
FeignErrorDecoder.java
...java/com/yeejoin/equipmanage/fegin/FeignErrorDecoder.java
+25
-0
JcsFeign.java
...src/main/java/com/yeejoin/equipmanage/fegin/JcsFeign.java
+57
-49
VideoFeignClient.java
.../java/com/yeejoin/equipmanage/fegin/VideoFeignClient.java
+20
-0
FeignBasicAuthRequestInterceptor.java
.../equipmanage/remote/FeignBasicAuthRequestInterceptor.java
+3
-1
IAreaService.java
...in/java/com/yeejoin/equipmanage/service/IAreaService.java
+5
-10
IEquipmentDetailService.java
.../yeejoin/equipmanage/service/IEquipmentDetailService.java
+3
-0
IFireFightingSystemService.java
...ejoin/equipmanage/service/IFireFightingSystemService.java
+34
-14
IVideoService.java
...n/java/com/yeejoin/equipmanage/service/IVideoService.java
+3
-0
AreaServiceImpl.java
...com/yeejoin/equipmanage/service/impl/AreaServiceImpl.java
+19
-17
EquipmentDetailServiceImpl.java
.../equipmanage/service/impl/EquipmentDetailServiceImpl.java
+14
-2
FireFightingSystemServiceImpl.java
...uipmanage/service/impl/FireFightingSystemServiceImpl.java
+37
-58
JCSRemoteService.java
...om/yeejoin/equipmanage/service/impl/JCSRemoteService.java
+44
-0
VideoServiceImpl.java
...om/yeejoin/equipmanage/service/impl/VideoServiceImpl.java
+43
-65
application.properties
...ot-system-equip/src/main/resources/application.properties
+20
-39
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/dto/OrgMenuDto.java
0 → 100644
View file @
b83789cc
package
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
org.springframework.util.ObjectUtils
;
import
java.util.List
;
/**
* @author fengwang
* @date 2021-06-19.
*/
@Data
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"OrgMenuVo"
,
description
=
"树菜单"
)
public
class
OrgMenuDto
{
private
Long
key
;
private
Long
value
;
private
String
title
;
private
String
name
;
private
Long
parentId
;
private
Boolean
leaf
=
true
;
private
Boolean
isLeaf
=
true
;
private
List
<
OrgMenuDto
>
children
;
private
String
bizOrgType
;
private
String
bizOrgCode
;
public
Boolean
getLeaf
()
{
return
ObjectUtils
.
isEmpty
(
children
);
}
public
Boolean
getIsLeaf
()
{
return
ObjectUtils
.
isEmpty
(
children
);
}
public
Long
getValue
()
{
return
key
;
}
public
String
getName
()
{
return
title
;
}
public
OrgMenuDto
(
Long
key
,
String
title
,
Long
parentId
,
String
bizOrgType
,
boolean
leaf
,
String
bizOrgCode
)
{
super
();
this
.
key
=
key
;
this
.
title
=
title
;
this
.
parentId
=
parentId
;
this
.
bizOrgType
=
bizOrgType
;
this
.
leaf
=
leaf
;
this
.
bizOrgCode
=
bizOrgCode
;
}
public
OrgMenuDto
(
Long
key
,
String
title
,
Long
parentId
,
String
bizOrgType
,
boolean
leaf
)
{
super
();
this
.
key
=
key
;
this
.
title
=
title
;
this
.
parentId
=
parentId
;
this
.
bizOrgType
=
bizOrgType
;
this
.
leaf
=
leaf
;
}
public
OrgMenuDto
(
Long
key
,
String
title
,
Long
parentId
,
String
bizOrgType
)
{
this
.
key
=
key
;
this
.
title
=
title
;
this
.
parentId
=
parentId
;
this
.
bizOrgType
=
bizOrgType
;
}
public
OrgMenuDto
()
{
// TODO Auto-generated constructor stub
}
public
OrgMenuDto
(
Long
key
,
Long
value
,
String
title
,
String
name
,
List
<
OrgMenuDto
>
children
)
{
this
.
key
=
key
;
this
.
value
=
value
;
this
.
title
=
title
;
this
.
name
=
name
;
this
.
children
=
children
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/excel/ExcelUtil.java
View file @
b83789cc
...
...
@@ -45,7 +45,7 @@ public class ExcelUtil {
* @param model 导出的头
* @param flag true模板填充下拉 false 不填充
*/
public
static
void
createTemplate
(
HttpServletResponse
response
,
String
fileName
,
String
sheetName
,
public
static
void
createTemplate
(
HttpServletResponse
response
,
String
fileName
,
String
sheetName
,
List
<?
extends
Object
>
data
,
Class
<?>
model
,
DataSources
dataDictionaryMapper
,
boolean
flag
)
{
HorizontalCellStyleStrategy
horizontalCellStyleStrategy
=
setMyCellStyle
();
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/dto/OrgUsrDto.java
0 → 100644
View file @
b83789cc
package
com
.
yeejoin
.
equipmanage
.
common
.
dto
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* 机构/部门/人员表
*
* @author tb
* @date 2021-06-18
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"OrgUsrDto"
,
description
=
"机构/部门/人员表"
)
public
class
OrgUsrDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"唯一编号"
)
private
String
code
;
@ApiModelProperty
(
value
=
"机构/部门名称"
)
private
String
bizOrgName
;
@ApiModelProperty
(
value
=
"机构编码"
)
private
String
bizOrgCode
;
@ApiModelProperty
(
value
=
"amos中公司/部门ID"
)
private
String
amosOrgId
;
@ApiModelProperty
(
value
=
"amos中公司/部门编码"
)
private
String
amosOrgCode
;
@ApiModelProperty
(
value
=
"机构类型(部门:DEPARTMENT,单位:COMPANY,人员:PERSON)"
)
private
String
bizOrgType
;
@ApiModelProperty
(
value
=
"归属机构/部门/人员"
)
private
String
parentId
;
@ApiModelProperty
(
value
=
"省市区code,用逗号分隔"
)
private
String
pczCode
;
@ApiModelProperty
(
value
=
"省市区名称,用逗号分隔"
)
private
String
pczName
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/OrgUsrController.java
View file @
b83789cc
...
...
@@ -599,6 +599,7 @@ public class OrgUsrController extends BaseController {
/**
* 根据机构类型和登陆人bizOrgCode获取列表不分页
*
* @param orgTypes 机构类型(逗号分割)
* @return list不分页
*/
...
...
@@ -606,11 +607,40 @@ public class OrgUsrController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据机构类型(逗号分割),机构编码获取列表不分页"
,
notes
=
"根据机构类型(逗号分割),机构编码获取列表不分页"
)
@GetMapping
(
value
=
"/amos/getListByBizOrgTypesCode"
)
public
ResponseModel
<
List
<
OrgUsr
>>
getListByBizOrgTypeCode
(
@RequestParam
(
required
=
false
)
String
orgTypes
){
public
ResponseModel
<
List
<
OrgUsr
>>
getListByBizOrgTypeCode
(
@RequestParam
(
required
=
false
)
String
orgTypes
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
String
bizOrgCode
=
personIdentity
.
getBizOrgCode
();
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
getListByBizOrgTypeCode
(
orgTypes
,
bizOrgCode
));
}
@PersonIdentify
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据机构类型(逗号分割),机构编码获取列表不分页"
,
notes
=
"根据机构类型(逗号分割),机构编码获取列表不分页"
)
@GetMapping
(
value
=
"/{authKey}/listWithAuth"
)
public
ResponseModel
<
List
<
OrgUsr
>>
getListWithAuth
(
@RequestParam
(
required
=
false
)
String
orgTypes
,
@PathVariable
String
authKey
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
String
bizOrgCode
=
personIdentity
.
getBizOrgCode
();
// TODO 伪代码 tianbo 上下文类 set authKey
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
getListByBizOrgTypeCode
(
orgTypes
,
bizOrgCode
));
}
@PersonIdentify
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{authKey}/treeWithAuth"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据权限查询公司部门树"
,
notes
=
"根据权限查询公司部门树"
)
public
ResponseModel
<
List
<
OrgMenuDto
>>
getCompanyTreeWithAuth
(
@RequestParam
(
required
=
false
)
String
orgType
,
@PathVariable
String
authKey
)
{
// 获取登陆人角色
ReginParams
reginParams
=
getSelectedOrgInfo
();
// TODO 伪代码 tianbo 上下文类 set authKey
List
<
OrgMenuDto
>
menus
=
iOrgUsrService
.
companyTreeByUserAndType
(
reginParams
,
orgType
);
return
ResponseHelper
.
buildResponse
(
menus
);
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/pom.xml
View file @
b83789cc
...
...
@@ -18,11 +18,6 @@
<version>
${amos-biz-boot.version}
</version>
</dependency>
<dependency>
<groupId>
com.amosframework.boot
</groupId>
<artifactId>
amos-boot-module-common-biz
</artifactId>
<version>
${amos-biz-boot.version}
</version>
</dependency>
<dependency>
<groupId>
com.yeejoin
</groupId>
<artifactId>
visual-feign-morphic
</artifactId>
<version>
1.6.3-SNAPSHOT
</version>
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/AreaController.java
View file @
b83789cc
...
...
@@ -3,12 +3,10 @@ package com.yeejoin.equipmanage.controller;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto
;
import
com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto
;
import
com.yeejoin.equipmanage.common.dto.AreaDto
;
import
com.yeejoin.equipmanage.common.entity.Area
;
import
com.yeejoin.equipmanage.common.vo.AreaResquest
;
import
com.yeejoin.equipmanage.common.vo.AreaTreeVo
;
import
com.yeejoin.equipmanage.common.vo.UnitAreaTreeVo
;
import
com.yeejoin.equipmanage.service.IAreaService
;
import
io.swagger.annotations.Api
;
...
...
@@ -50,29 +48,22 @@ public class AreaController extends AbstractBaseController {
* 获取公司部门区域树
* @return list
*/
@PersonIdentify
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据登陆人获取单位区域树"
,
notes
=
"根据登陆人获取单位区域树"
)
@GetMapping
(
value
=
"/tree"
)
public
List
<
UnitAreaTreeVo
>
getSystemTree
(){
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
String
bizOrgCode
=
personIdentity
.
getBizOrgCode
();
return
iAreaService
.
getAreaTreeListVo
(
bizOrgCode
);
return
iAreaService
.
getAreaTreeListVo
();
}
/**
* 获取
人员
部门树
* 获取
公司
部门树
* @return list
*/
@PersonIdentify
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据登陆人
、机构类型获取人员部门树"
,
notes
=
"根据登陆人、机构类型获取人员部门
树"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据登陆人
获取公司树"
,
notes
=
"根据登陆人获取公司
树"
)
@GetMapping
(
value
=
"/companyTreeByUserAndType"
)
public
List
<
OrgMenuDto
>
companyTreeByUserAndType
(
@RequestParam
(
required
=
false
)
String
type
){
// 获取登陆人角色
ReginParams
reginParams
=
getSelectedOrgInfo
();
return
iAreaService
.
companyTreeByUserAndType
(
reginParams
,
type
);
public
List
<
OrgMenuDto
>
getCompanyTree
(){
return
iAreaService
.
companyDeptTree
();
}
/**
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EquipmentDetailController.java
View file @
b83789cc
package
com
.
yeejoin
.
equipmanage
.
controller
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.http.MediaType
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
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
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.equipmanage.common.entity.EquProperty
;
import
com.yeejoin.equipmanage.common.entity.EquipmentDetail
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecific
;
import
com.yeejoin.equipmanage.common.entity.StockDetail
;
import
com.yeejoin.equipmanage.common.entity.WarehouseStructure
;
import
com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto
;
import
com.yeejoin.equipmanage.common.entity.*
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentDetailDownloadVO
;
import
com.yeejoin.equipmanage.common.enums.ExcelEnums
;
import
com.yeejoin.equipmanage.common.utils.ExcelUtils
;
...
...
@@ -48,18 +17,29 @@ import com.yeejoin.equipmanage.fegin.JcsFeign;
import
com.yeejoin.equipmanage.mapper.EquipmentDetailMapper
;
import
com.yeejoin.equipmanage.mapper.ManufacturerInfoMapper
;
import
com.yeejoin.equipmanage.mapper.StockDetailMapper
;
import
com.yeejoin.equipmanage.service.IEquipmentDetailService
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificIndexSerivce
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce
;
import
com.yeejoin.equipmanage.service.IExcelService
;
import
com.yeejoin.equipmanage.service.IStockService
;
import
com.yeejoin.equipmanage.service.ISyncDataService
;
import
com.yeejoin.equipmanage.service.IWarehouseStructureService
;
import
com.yeejoin.equipmanage.service.*
;
import
com.yeejoin.equipmanage.utils.ExcelUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.http.MediaType
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
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
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
/**
* @author wujiang
...
...
@@ -82,16 +62,11 @@ public class EquipmentDetailController extends AbstractBaseController {
@Autowired
private
ManufacturerInfoMapper
manufacturerInfoMapper
;
@Autowired
OrgUsrServiceImpl
iOrgUsrService
;
@Autowired
private
IEquipmentSpecificIndexSerivce
equipmentSpecificIndexSerivce
;
@Autowired
IEquipmentSpecificSerivce
equipmentSpecificSerivce
;
@Autowired
private
IEquipmentDetailService
equipmentDetailService
;
@Autowired
private
IExcelService
excelService
;
...
...
@@ -101,7 +76,7 @@ public class EquipmentDetailController extends AbstractBaseController {
@Autowired
private
IWarehouseStructureService
warehouseStructureService
;
@Autowired
private
ISyncDataService
syncDataService
;
...
...
@@ -141,16 +116,16 @@ public class EquipmentDetailController extends AbstractBaseController {
// throw new BadRequest("设备物联编码重复");
// }
String
sysCode
=
vo
.
getCode
();
if
(
StringUtils
.
isNotEmpty
(
sysCode
)
&&
StringUtils
.
isNotEmpty
(
sysCode
.
trim
())){
if
(
StringUtils
.
isNotEmpty
(
sysCode
)
&&
StringUtils
.
isNotEmpty
(
sysCode
.
trim
()))
{
int
code
=
equipmentSpecificSerivce
.
count
(
new
QueryWrapper
<
EquipmentSpecific
>().
eq
(
"code"
,
sysCode
.
trim
()));
if
(
code
!=
0
)
{
if
(
code
!=
0
)
{
throw
new
BadRequest
(
"设备编码填写重复,请重新输入!"
);
}
}
String
iot
=
vo
.
getIotCode
();
if
(
StringUtils
.
isNotEmpty
(
iot
)
&&
StringUtils
.
isNotEmpty
(
iot
.
trim
())){
if
(
StringUtils
.
isNotEmpty
(
iot
)
&&
StringUtils
.
isNotEmpty
(
iot
.
trim
()))
{
int
iot_code
=
equipmentSpecificSerivce
.
count
(
new
QueryWrapper
<
EquipmentSpecific
>().
eq
(
"iot_code"
,
iot
.
trim
()));
if
(
iot_code
!=
0
)
{
if
(
iot_code
!=
0
)
{
throw
new
BadRequest
(
"物联编码填写重复,请重新输入!"
);
}
}
...
...
@@ -197,14 +172,14 @@ public class EquipmentDetailController extends AbstractBaseController {
equipmentSpecific
.
setFullqrCode
(
"01#"
+
equipmentSpecific
.
getQrCode
());
EquipmentDetail
equipmentDetail
=
iEquipmentDetailService
.
getOneById
(
equipmentSpecific
.
getEquipmentDetailId
());
StockDetail
stockDetail
=
null
;
if
(
stockDetailId
!=
null
)
{
if
(
stockDetailId
!=
null
)
{
//解决灭火药剂,有多个货位状态问题
stockDetail
=
stockDetailMapper
.
selectById
(
stockDetailId
);
equipmentSpecific
.
setStockDetail
(
stockDetail
);
}
else
{
}
else
{
//消防装备默认分支
List
<
StockDetail
>
stockDetails
=
stockDetailMapper
.
selectList
(
new
LambdaQueryWrapper
<
StockDetail
>().
eq
(
StockDetail:
:
getEquipmentSpecificId
,
id
));
if
(!
stockDetails
.
isEmpty
())
{
List
<
StockDetail
>
stockDetails
=
stockDetailMapper
.
selectList
(
new
LambdaQueryWrapper
<
StockDetail
>().
eq
(
StockDetail:
:
getEquipmentSpecificId
,
id
));
if
(!
stockDetails
.
isEmpty
())
{
stockDetail
=
stockDetails
.
get
(
0
);
equipmentSpecific
.
setStockDetail
(
stockDetail
);
}
...
...
@@ -229,16 +204,16 @@ public class EquipmentDetailController extends AbstractBaseController {
public
EquipmentDate
updateByIdEquipmentDetail
(
HttpServletRequest
request
,
@RequestBody
EquipmentDate
equipmentDate
)
{
EquipmentSpecific
vo
=
equipmentDate
.
getEquipmentSpecific
();
String
sysCode
=
vo
.
getCode
();
if
(
StringUtils
.
isNotEmpty
(
sysCode
)
&&
StringUtils
.
isNotEmpty
(
sysCode
.
trim
())){
int
code
=
equipmentSpecificSerivce
.
count
(
new
QueryWrapper
<
EquipmentSpecific
>().
eq
(
"code"
,
vo
.
getCode
()).
ne
(
"id"
,
vo
.
getId
()));
if
(
code
>
0
){
if
(
StringUtils
.
isNotEmpty
(
sysCode
)
&&
StringUtils
.
isNotEmpty
(
sysCode
.
trim
()))
{
int
code
=
equipmentSpecificSerivce
.
count
(
new
QueryWrapper
<
EquipmentSpecific
>().
eq
(
"code"
,
vo
.
getCode
()).
ne
(
"id"
,
vo
.
getId
()));
if
(
code
>
0
)
{
throw
new
BadRequest
(
"设备编码重复"
);
}
}
String
iot
=
vo
.
getIotCode
();
if
(
StringUtils
.
isNotEmpty
(
iot
)
&&
StringUtils
.
isNotEmpty
(
iot
.
trim
())){
int
iotCode
=
equipmentSpecificSerivce
.
count
(
new
QueryWrapper
<
EquipmentSpecific
>().
eq
(
"iot_code"
,
vo
.
getIotCode
()).
ne
(
"id"
,
vo
.
getId
()));
if
(
iotCode
>
0
){
if
(
StringUtils
.
isNotEmpty
(
iot
)
&&
StringUtils
.
isNotEmpty
(
iot
.
trim
()))
{
int
iotCode
=
equipmentSpecificSerivce
.
count
(
new
QueryWrapper
<
EquipmentSpecific
>().
eq
(
"iot_code"
,
vo
.
getIotCode
()).
ne
(
"id"
,
vo
.
getId
()));
if
(
iotCode
>
0
)
{
throw
new
BadRequest
(
"设备物联编码重复"
);
}
}
...
...
@@ -255,7 +230,7 @@ public class EquipmentDetailController extends AbstractBaseController {
if
(!
ObjectUtils
.
isEmpty
(
bean
))
{
equipmentSpecific
.
setEquipmentCode
(
bean
.
getCode
());
}
Long
warehouseStructureId
=
ObjectUtils
.
isEmpty
(
equipmentSpecific
.
getStockDetail
())
?
null
:
equipmentSpecific
.
getStockDetail
().
getWarehouseStructureId
();
Long
warehouseStructureId
=
ObjectUtils
.
isEmpty
(
equipmentSpecific
.
getStockDetail
())
?
null
:
equipmentSpecific
.
getStockDetail
().
getWarehouseStructureId
();
if
(
warehouseStructureId
!=
null
)
{
WarehouseStructure
warehouseStructure
=
warehouseStructureService
.
getById
(
warehouseStructureId
);
if
(!
ObjectUtils
.
isEmpty
(
warehouseStructure
))
{
...
...
@@ -486,8 +461,9 @@ public class EquipmentDetailController extends AbstractBaseController {
/**
* 下载模板
*
@Since 2021-3-10
*
* @return
* @Since 2021-3-10
*/
@GetMapping
(
value
=
"/downTemplate"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
...
...
@@ -501,8 +477,8 @@ public class EquipmentDetailController extends AbstractBaseController {
// 判读机场服务是否在线
ExcelEnums
excelEnums
;
ResponseModel
<
String
[]>
result
=
jcsFeign
.
getEquipmentInfo
(
getAppKey
(),
getProduct
(),
getToken
(),
null
,
"getCompany"
);
if
(
200
==
result
.
getStatus
())
{
excelEnums
=
ExcelEnums
.
getByKey
(
ExcelEnums
.
XFZB
.
getType
());
if
(
200
==
result
.
getStatus
())
{
excelEnums
=
ExcelEnums
.
getByKey
(
ExcelEnums
.
XFZB
.
getType
());
ExcelDto
excelDto
=
new
ExcelDto
(
excelEnums
.
getFileName
(),
excelEnums
.
getSheetName
(),
excelEnums
.
getClassUrl
(),
excelEnums
.
getType
());
String
url
=
excelDto
.
getClassUrl
();
Class
<?>
clz
=
Class
.
forName
(
url
);
...
...
@@ -511,7 +487,7 @@ public class EquipmentDetailController extends AbstractBaseController {
}
}
catch
(
Exception
e
)
{
ExcelEnums
excelEnums
=
ExcelEnums
.
getByKey
(
ExcelEnums
.
XFZBSINGLE
.
getType
());
ExcelEnums
excelEnums
=
ExcelEnums
.
getByKey
(
ExcelEnums
.
XFZBSINGLE
.
getType
());
ExcelDto
excelDto
=
new
ExcelDto
(
excelEnums
.
getFileName
(),
excelEnums
.
getSheetName
(),
excelEnums
.
getClassUrl
(),
excelEnums
.
getType
());
String
url
=
excelDto
.
getClassUrl
();
Class
<?>
clz
=
Class
.
forName
(
url
);
...
...
@@ -522,13 +498,14 @@ public class EquipmentDetailController extends AbstractBaseController {
/**
* 单个设备信息导入
*
@Since 2021-3-10
*
* @return
* @Since 2021-3-10
*/
@PostMapping
(
value
=
"/uploadListByTemplate"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"单个设备信息导入"
,
notes
=
"单个设备信息导入"
)
public
ResponseModel
<
Object
>
uploadListByTemplate
(
MultipartFile
file
,
@RequestParam
(
value
=
"type"
)
String
type
)
throws
Exception
{
public
ResponseModel
<
Object
>
uploadListByTemplate
(
MultipartFile
file
,
@RequestParam
(
value
=
"type"
)
String
type
)
throws
Exception
{
// try {
// InputStream inputStream = null;
// Workbook workbook = null;
...
...
@@ -544,13 +521,13 @@ public class EquipmentDetailController extends AbstractBaseController {
// throw new BadRequest("请使用指定模板进行上传");
// }
// List<EquipmentDetailDownloadTemplateVO> equipmentDetailDownloadS = ExcelUtils.importExcel(file, 1, 1, EquipmentDetailDownloadTemplateVO.class);
// List<EquipmentDetailDownloadTemplateVO> equipmentDetailDownloadS = ExcelUtils.importExcel(file, 1, 1, EquipmentDetailDownloadTemplateVO.class);
ExcelEnums
excelEnums
=
ExcelEnums
.
getByKey
(
type
);
ExcelEnums
excelEnums
=
ExcelEnums
.
getByKey
(
type
);
ExcelDto
excelDto
=
new
ExcelDto
(
excelEnums
.
getFileName
(),
excelEnums
.
getSheetName
(),
excelEnums
.
getClassUrl
(),
excelEnums
.
getType
());
excelService
.
commonUpload
(
file
,
excelDto
,
getSelectedOrgInfo
(),
getUserInfo
());
// return iStockService.uploadListByTemplate(equipmentDetailDownloadS, getSelectedOrgInfo(), getUserInfo());
excelService
.
commonUpload
(
file
,
excelDto
,
getSelectedOrgInfo
(),
getUserInfo
());
// return iStockService.uploadListByTemplate(equipmentDetailDownloadS, getSelectedOrgInfo(), getUserInfo());
return
ResponseHelper
.
buildResponse
(
null
);
}
...
...
@@ -590,20 +567,18 @@ public class EquipmentDetailController extends AbstractBaseController {
//
// return ;
// }
/**
* 消防装备单位部门树
*
* @param
* @return
*/
@PersonIdentify
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/companyTreeByUserAndType"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"消防装备单位部门树"
,
notes
=
"消防装备单位部门树"
)
public
ResponseModel
<
List
<
OrgMenuDto
>>
companyTreeByUserAndType
(
@RequestParam
(
required
=
false
)
String
type
)
{
// 获取登陆人角色
ReginParams
reginParams
=
getSelectedOrgInfo
();
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
companyTreeByUserAndType
(
reginParams
,
type
));
public
ResponseModel
<
List
<
OrgMenuDto
>>
companyTreeByUserAndType
()
{
return
ResponseHelper
.
buildResponse
(
iEquipmentDetailService
.
companyDeptTree
());
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/FireFightingSystemController.java
View file @
b83789cc
package
com
.
yeejoin
.
equipmanage
.
controller
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
import
com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto
;
import
com.yeejoin.equipmanage.common.vo.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto
;
import
com.yeejoin.amos.feign.morphic.model.ResourceDTO
;
import
com.yeejoin.equipmanage.common.entity.EquProperty
;
import
com.yeejoin.equipmanage.common.entity.Equipment
;
import
com.yeejoin.equipmanage.common.entity.EquipmentCategory
;
import
com.yeejoin.equipmanage.common.entity.EquipmentIndex
;
import
com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity
;
import
com.yeejoin.equipmanage.common.entity.ManufacturerInfo
;
import
com.yeejoin.equipmanage.common.entity.*
;
import
com.yeejoin.equipmanage.common.entity.dto.EquipTypeAmountPageDTO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipCountBySystemVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipTypeImgAmountVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquiplistSpecificBySystemVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentAlarmBySystemIdOrSourceIdVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO
;
import
com.yeejoin.equipmanage.common.entity.vo.PointTreeVo
;
import
com.yeejoin.equipmanage.common.entity.vo.*
;
import
com.yeejoin.equipmanage.common.utils.CommonResponseUtil
;
import
com.yeejoin.equipmanage.common.utils.StringUtil
;
import
com.yeejoin.equipmanage.common.vo.*
;
import
com.yeejoin.equipmanage.mapper.EquipmentSpecificIndexMapper
;
import
com.yeejoin.equipmanage.mapper.FireFightingSystemMapper
;
import
com.yeejoin.equipmanage.remote.RemoteSecurityService
;
import
com.yeejoin.equipmanage.service.IBuilldService
;
import
com.yeejoin.equipmanage.service.IEquipmentCategoryService
;
import
com.yeejoin.equipmanage.service.IEquipmentIndexService
;
import
com.yeejoin.equipmanage.service.IEquipmentService
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificIndexSerivce
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce
;
import
com.yeejoin.equipmanage.service.IFireFightingSystemService
;
import
com.yeejoin.equipmanage.service.IManufacturerInfoService
;
import
com.yeejoin.equipmanage.service.IUploadFileService
;
import
com.yeejoin.equipmanage.service.*
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
/**
* @author zjw
...
...
@@ -459,7 +425,7 @@ public class FireFightingSystemController extends AbstractBaseController {
Map
<
String
,
String
>
map1
=
new
HashMap
<>();
if
(
fireFightingSystem
!=
null
)
{
list1
.
add
(
new
AlarmDataVO
(
"责任人"
,
fireFightingSystem
.
getChargePersonName
(),
false
));
FireFightingSystemVo
fireFightingSystemVo
=
fireFightingSystemMapper
.
getFightingSysInfo
(
fireFightingSystem
.
getCode
(),
fireFightingSystem
.
getId
());
FireFightingSystemVo
fireFightingSystemVo
=
fireFightingSystemMapper
.
getFightingSysInfo
(
fireFightingSystem
.
getCode
(),
fireFightingSystem
.
getId
());
map1
.
put
(
"value"
,
"异常"
.
equals
(
fireFightingSystemVo
.
getStatus
())
?
"false"
:
"true"
);
}
else
{
list1
.
add
(
new
AlarmDataVO
(
"责任人"
,
":"
,
false
));
...
...
@@ -544,13 +510,13 @@ public class FireFightingSystemController extends AbstractBaseController {
/**
* 获取公司部门系统树
*
* @return list
*/
@PersonIdentify
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据登陆人获取公司部门系统树"
,
notes
=
"根据登陆人获取公司部门系统树"
)
@GetMapping
(
value
=
"/companySystemTreeByUser"
)
public
List
<
FireFightingSystemTreeVo
>
getSystemTree
(){
public
List
<
FireFightingSystemTreeVo
>
getSystemTree
()
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
String
bizOrgCode
=
personIdentity
.
getBizOrgCode
();
...
...
@@ -559,26 +525,25 @@ public class FireFightingSystemController extends AbstractBaseController {
/**
* 获取人员部门树
*
* @return list
*/
@PersonIdentify
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据登陆人
、机构类型获取人员部门树"
,
notes
=
"根据登陆人、机构类型获取人员
部门树"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据登陆人
获取公司部门树"
,
notes
=
"根据登陆人获取公司
部门树"
)
@GetMapping
(
value
=
"/companyTreeByUserAndType"
)
public
List
<
OrgMenuDto
>
companyTreeByUserAndType
(
@RequestParam
(
required
=
false
)
String
type
){
// 获取登陆人角色
ReginParams
reginParams
=
getSelectedOrgInfo
();
return
fireFightingSystemService
.
companyTreeByUserAndType
(
reginParams
,
type
);
public
List
<
OrgMenuDto
>
companyTreeByUserAndType
(
@RequestParam
(
required
=
false
)
String
type
)
{
return
fireFightingSystemService
.
companyTreeByUserAndType
(
type
);
}
/**
* 获取系统分类树
*
* @return list
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取系统分类树"
,
notes
=
"获取系统分类树"
)
@GetMapping
(
value
=
"/systemTypeTree"
)
public
List
<
FireFightingSystemTypeTreeVo
>
systemTypeTree
(){
public
List
<
FireFightingSystemTypeTreeVo
>
systemTypeTree
()
{
return
fireFightingSystemService
.
systemTypeTree
();
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/VideoController.java
View file @
b83789cc
...
...
@@ -3,7 +3,7 @@ package com.yeejoin.equipmanage.controller;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.
module.common.api.service.IOrgUsrService
;
import
com.yeejoin.amos.boot.
biz.common.dto.OrgMenuDto
;
import
com.yeejoin.equipmanage.common.entity.Video
;
import
com.yeejoin.equipmanage.common.entity.dto.VideoDTO
;
import
com.yeejoin.equipmanage.common.entity.dto.VideoSaveDto
;
...
...
@@ -47,8 +47,6 @@ public class VideoController extends AbstractBaseController {
@Autowired
private
IExcelService
excelService
;
@Autowired
private
IOrgUsrService
orgUsrService
;
/**
* 新增
...
...
@@ -276,11 +274,10 @@ public class VideoController extends AbstractBaseController {
return
flvUrl
;
}
// @PersonIdentify
// @TycloudOperation(ApiLevel = UserType.AGENCY)
// @RequestMapping(value = "/companyTreeByUserAndType", method = RequestMethod.GET)
// @ApiOperation(httpMethod = "GET", value = "根据登录人及类型获取公司部门树", notes = "根据登录人及类型获取公司部门树")
// public List<OrgMenuDto> companyTreeByUserAndType(@RequestParam(required = false) String type) {
// return orgUsrService.companyTreeByUserAndType(getUserInfo(), type);
// }
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/companyTreeByUserAndType"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据登录人及类型获取公司部门树"
,
notes
=
"根据登录人及类型获取公司部门树"
)
public
List
<
OrgMenuDto
>
companyTreeByUserAndType
(
@RequestParam
String
type
)
{
return
videoService
.
companyTreeByUserAndType
(
type
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/fegin/FeignConfiguration.java
View file @
b83789cc
...
...
@@ -11,14 +11,21 @@ import org.springframework.context.annotation.Bean;
public
class
FeignConfiguration
{
@Autowired
private
ObjectFactory
<
HttpMessageConverters
>
messageConverters
;
@Bean
public
Encoder
feignFormEncoder
()
{
return
new
SpringFormEncoder
(
new
SpringEncoder
(
messageConverters
));
}
@Bean
public
FeignBasicAuthRequestInterceptor
basicAuthRequestInterceptor
()
{
return
new
FeignBasicAuthRequestInterceptor
();
}
@Autowired
private
ObjectFactory
<
HttpMessageConverters
>
messageConverters
;
@Bean
public
Encoder
feignFormEncoder
()
{
return
new
SpringFormEncoder
(
new
SpringEncoder
(
messageConverters
));
}
@Bean
public
FeignBasicAuthRequestInterceptor
basicAuthRequestInterceptor
()
{
return
new
FeignBasicAuthRequestInterceptor
();
}
@Bean
public
FeignErrorDecoder
errorDecoder
(){
return
new
FeignErrorDecoder
();
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/fegin/FeignErrorDecoder.java
0 → 100644
View file @
b83789cc
package
com
.
yeejoin
.
equipmanage
.
fegin
;
import
feign.Response
;
import
feign.Util
;
import
feign.codec.ErrorDecoder
;
import
java.io.IOException
;
/**
* @author DELL
*/
public
class
FeignErrorDecoder
implements
ErrorDecoder
{
@Override
public
Exception
decode
(
String
s
,
Response
response
)
{
String
msg
=
null
;
try
{
msg
=
Util
.
toString
(
response
.
body
().
asReader
());
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
throw
new
RuntimeException
(
msg
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/fegin/JcsFeign.java
View file @
b83789cc
package
com
.
yeejoin
.
equipmanage
.
fegin
;
import
java.util.List
;
import
java.util.Map
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.equipmanage.common.dto.*
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestHeader
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig
;
import
com.yeejoin.equipmanage.common.dto.MenuFromDto
;
import
com.yeejoin.equipmanage.common.dto.UserDto
;
import
com.yeejoin.equipmanage.common.dto.WaterResourceDto
;
import
com.yeejoin.equipmanage.common.dto.WaterResourceTypeDto
;
import
java.util.List
;
import
java.util.Map
;
/**
* @ProjectName: EquipManageRoot
* @Package: com.yeejoin.equipmanage.fegin
* @ClassName: JcsFeign
* @Author: Jianqiang Gao
* @Description: JcsFeign
* @Date: 2021/7/20 10:39
* @Version: 1.0
* @author DELL
*/
@FeignClient
(
name
=
"${jcs.fegin.name}"
,
configuration
=
{
MultipartSupportConfig
.
class
})
@FeignClient
(
name
=
"${jcs.fegin.name}"
,
path
=
"jcs"
,
configuration
=
{
FeignConfiguration
.
class
})
public
interface
JcsFeign
{
@RequestMapping
(
value
=
"/
jcs/
water-resource/select_list"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
@RequestMapping
(
value
=
"/water-resource/select_list"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
ResponseModel
<
List
<
WaterResourceDto
>>
selectList
(
@RequestHeader
(
"appKey"
)
String
appKey
,
@RequestHeader
(
"appKey"
)
String
appKey
,
@RequestHeader
(
"product"
)
String
product
,
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
,
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
,
@RequestParam
(
value
=
"sequenceNbr"
,
required
=
false
)
Long
sequenceNbr
,
@RequestParam
(
value
=
"belongFightingSystemId"
,
required
=
false
)
Long
belongFightingSystemId
,
@RequestParam
(
value
=
"belongFightingSystemId"
,
required
=
false
)
Long
belongFightingSystemId
,
@RequestParam
(
value
=
"belongBuildingId"
,
required
=
false
)
Long
belongBuildingId
,
@RequestParam
(
value
=
"belongBuilding"
,
required
=
false
)
String
belongBuilding
,
@RequestParam
(
value
=
"belongBuilding"
,
required
=
false
)
String
belongBuilding
,
@RequestParam
(
value
=
"resourceType"
,
required
=
false
)
String
resourceType
);
@RequestMapping
(
value
=
"/
jcs/
water-resource/page"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
@RequestMapping
(
value
=
"/water-resource/page"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
ResponseModel
<
Page
<
WaterResourceDto
>>
queryForPage
(
@RequestHeader
(
"appKey"
)
String
appKey
,
@RequestHeader
(
"appKey"
)
String
appKey
,
@RequestHeader
(
"product"
)
String
product
,
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
value
=
"name"
)
String
name
,
@RequestParam
(
value
=
"belongBuildingId"
)
List
<
Long
>
belongBuildingId
,
@RequestParam
(
value
=
"belongFightingSystemId"
)
Long
belongFightingSystemId
,
@RequestParam
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
,
@RequestParam
(
value
=
"classifyId"
)
String
classifyId
@RequestParam
(
value
=
"belongFightingSystemId"
)
Long
belongFightingSystemId
,
@RequestParam
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
,
@RequestParam
(
value
=
"classifyId"
)
String
classifyId
);
@RequestMapping
(
value
=
"/
jcs/
equip/fireSystem_waterResource/list"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
@RequestMapping
(
value
=
"/equip/fireSystem_waterResource/list"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
ResponseModel
<
List
<
MenuFromDto
>>
getFireSystemWaterResourceList
(
@RequestHeader
(
"appKey"
)
String
appKey
,
@RequestHeader
(
"appKey"
)
String
appKey
,
@RequestHeader
(
"product"
)
String
product
,
@RequestHeader
(
"token"
)
String
token
);
@RequestMapping
(
value
=
"/
jcs/
water-resource/resource_type_list"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
@RequestMapping
(
value
=
"/water-resource/resource_type_list"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
ResponseModel
<
List
<
WaterResourceTypeDto
>>
selectResourceTypeList
(
@RequestHeader
(
"appKey"
)
String
appKey
,
@RequestHeader
(
"appKey"
)
String
appKey
,
@RequestHeader
(
"product"
)
String
product
,
@RequestHeader
(
"token"
)
String
token
);
@RequestMapping
(
value
=
"/
jcs/
common/maintenance-company/companyList"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
@RequestMapping
(
value
=
"/common/maintenance-company/companyList"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
selectCompanyList
(
@RequestHeader
(
"appKey"
)
String
appKey
,
@RequestHeader
(
"appKey"
)
String
appKey
,
@RequestHeader
(
"product"
)
String
product
,
@RequestHeader
(
"token"
)
String
token
);
@RequestMapping
(
value
=
"/
jcs/
org-usr/{userId}/userInfo"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
@RequestMapping
(
value
=
"/org-usr/{userId}/userInfo"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
ResponseModel
<
List
<
UserDto
>>
getUserInfo
(
@RequestHeader
(
"appKey"
)
String
appKey
,
@RequestHeader
(
"product"
)
String
product
,
@RequestHeader
(
"token"
)
String
token
,
@PathVariable
(
value
=
"userId"
)
String
userId
);
@PathVariable
(
value
=
"userId"
)
String
userId
);
@RequestMapping
(
value
=
"/
jcs/
excel/exportForEquipment"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
@RequestMapping
(
value
=
"/excel/exportForEquipment"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
ResponseModel
<
String
[]>
getEquipmentInfo
(
@RequestHeader
(
"appKey"
)
String
appKey
,
@RequestHeader
(
"product"
)
String
product
,
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"type"
,
required
=
false
)
String
type
,
@RequestParam
(
value
=
"method"
,
required
=
false
)
String
method
);
/**
*
* <pre>
* 根据值班区域ID查询当前值班人
* </pre>
...
...
@@ -102,27 +89,48 @@ public interface JcsFeign {
* @param dutyAreaId
* @return
*/
@RequestMapping
(
value
=
"/
jcs/
common/duty-person/findByDutyAreaId/{dutyAreaId}"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
@RequestMapping
(
value
=
"/common/duty-person/findByDutyAreaId/{dutyAreaId}"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
ResponseModel
<
Object
>
findByDutyAreaId
(
@PathVariable
(
value
=
"dutyAreaId"
)
Long
dutyAreaId
);
/**
* 获取机场单位
*/
@RequestMapping
(
value
=
"/
jcs/
org-usr/getUnit/{id}"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
@RequestMapping
(
value
=
"/org-usr/getUnit/{id}"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
ResponseModel
<
JSONObject
>
getUnitById
(
@RequestHeader
(
"appKey"
)
String
appKey
,
@RequestHeader
(
"product"
)
String
product
,
@RequestHeader
(
"token"
)
String
token
,
@PathVariable
(
value
=
"id"
)
String
id
);
@PathVariable
(
value
=
"id"
)
String
id
);
/**
* 获取机场人员
*
* @return
*/
@RequestMapping
(
value
=
"/
jcs/
org-person/getPersonByUserId/{userId}"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
@RequestMapping
(
value
=
"/org-person/getPersonByUserId/{userId}"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
ResponseModel
<
JSONObject
>
getPersonByUserId
(
@RequestHeader
(
"appKey"
)
String
appKey
,
@RequestHeader
(
"product"
)
String
product
,
@RequestHeader
(
"token"
)
String
token
,
@PathVariable
(
value
=
"userId"
)
String
userId
);
@PathVariable
(
value
=
"userId"
)
String
userId
);
/**
* 查询有权限的公司部门部门树
*
* @param authKey 权限key
* @param orgType 树类型null,公司部门树,COMPANY: 公司树 DEPARTMENT部门树
* @return ResponseModel<OrgUsrDto>
*/
@GetMapping
(
value
=
"/org-usr/{authKey}/treeWithAuth"
)
FeignClientResult
<
List
<
OrgMenuDto
>>
getCompanyDeptTreeWithAuth
(
@PathVariable
String
authKey
,
@RequestParam
(
required
=
false
)
String
orgType
);
/**
* 查询有权限的公司部门列表
*
* @param authKey 权限key
* @param orgTypes(多个逗号分隔) 为空默认查询公司和部门,COMPANY: 公司树 DEPARTMENT部门树
* @return ResponseModel<OrgUsrDto>
*/
@GetMapping
(
value
=
"/org-usr/{authKey}/listWithAuth"
)
FeignClientResult
<
List
<
OrgUsrDto
>>
getCompanyDeptListWithAuth
(
@PathVariable
String
authKey
,
@RequestParam
(
required
=
false
)
String
orgTypes
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/fegin/VideoFeignClient.java
0 → 100644
View file @
b83789cc
package
com
.
yeejoin
.
equipmanage
.
fegin
;
import
com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
/**
* @description:
* @author: tw
* @createDate: 2021/10/20
*/
@FeignClient
(
name
=
"${video.fegin.name:video}"
,
path
=
"video"
,
configuration
=
{
MultipartSupportConfig
.
class
})
public
interface
VideoFeignClient
{
@RequestMapping
(
value
=
"/video-original/url/video/{indexCode}"
,
method
=
RequestMethod
.
GET
)
ResponseModel
<
String
>
videoUrlByIndexCode
(
@PathVariable
(
"indexCode"
)
String
indexCode
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/remote/FeignBasicAuthRequestInterceptor.java
View file @
b83789cc
...
...
@@ -12,7 +12,8 @@ import feign.RequestInterceptor;
import
feign.RequestTemplate
;
public
class
FeignBasicAuthRequestInterceptor
implements
RequestInterceptor
{
public
FeignBasicAuthRequestInterceptor
()
{
public
FeignBasicAuthRequestInterceptor
()
{
}
...
...
@@ -32,6 +33,7 @@ public class FeignBasicAuthRequestInterceptor implements RequestInterceptor {
template
.
header
(
"token"
,
authToken
);
template
.
header
(
"appKey"
,
request
.
getHeader
(
"appKey"
));
template
.
header
(
"product"
,
request
.
getHeader
(
"product"
));
template
.
header
(
"clientType"
,
"feignClient"
);
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IAreaService.java
View file @
b83789cc
...
...
@@ -3,12 +3,10 @@ package com.yeejoin.equipmanage.service;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto
;
import
com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto
;
import
com.yeejoin.equipmanage.common.dto.AreaDto
;
import
com.yeejoin.equipmanage.common.entity.Area
;
import
com.yeejoin.equipmanage.common.vo.AreaResquest
;
import
com.yeejoin.equipmanage.common.vo.AreaTreeVo
;
import
com.yeejoin.equipmanage.common.vo.UnitAreaTreeVo
;
import
java.util.List
;
...
...
@@ -39,19 +37,16 @@ public interface IAreaService extends IService<Area> {
/**
* 根据bizOrgCode获取单位区域树
* @param bizOrgCode 登陆人的机构编码
* @return list
*/
List
<
UnitAreaTreeVo
>
getAreaTreeListVo
(
String
bizOrgCode
);
List
<
UnitAreaTreeVo
>
getAreaTreeListVo
();
/**
* 根据登录人及类型获取公司部门树
* @param reginParams 公司及部门信息
* @param type 默认查询公司及部门,公司:COMPANY,部门:DEPARTMENT
* @return
* 根据登录人公司树
* @return List<OrgMenuDto>
*/
List
<
OrgMenuDto
>
company
TreeByUserAndType
(
ReginParams
reginParams
,
String
type
);
List
<
OrgMenuDto
>
company
DeptTree
(
);
Object
saveArea
(
AreaResquest
areaResquest
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IEquipmentDetailService.java
View file @
b83789cc
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.equipmanage.service;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto
;
import
com.yeejoin.equipmanage.common.entity.EquProperty
;
import
com.yeejoin.equipmanage.common.entity.EquipmentDetail
;
...
...
@@ -33,4 +34,6 @@ public interface IEquipmentDetailService extends IService<EquipmentDetail> {
String
getPref
(
String
id
);
String
checkDelete
(
List
<
Long
>
ids
);
List
<
OrgMenuDto
>
companyDeptTree
();
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IFireFightingSystemService.java
View file @
b83789cc
...
...
@@ -2,8 +2,7 @@ package com.yeejoin.equipmanage.service;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto
;
import
com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto
;
import
com.yeejoin.amos.feign.morphic.model.ResourceDTO
;
import
com.yeejoin.equipmanage.common.datasync.entity.FireFightingSystem
;
import
com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity
;
...
...
@@ -18,6 +17,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
/**
* 根据系统id查询设备列表
*
* @param systemId
* @return
*/
...
...
@@ -25,6 +25,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
/**
* 获取系列列表
*
* @param equimentName
* @param equimentCode
* @param construction
...
...
@@ -36,8 +37,10 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
Map
<
String
,
Object
>
queryEquipmenInfoAndCount
(
String
equimentName
,
String
equimentCode
,
String
construction
,
String
maintenance
,
String
bizOrgCode
,
String
formGroupId
,
int
current
,
int
pageSize
);
FireFightingSystemEntity
getOneById
(
Long
id
);
/**
* 根据系统id查询分组设备数量
*
* @param systemId
* @return
*/
...
...
@@ -45,20 +48,23 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
/**
* 保存
*
* @param vo
* @return
*/
String
save
(
FireFightingSystemVo
vo
);
String
save
(
FireFightingSystemVo
vo
);
/**
* 修改
*
* @param vo
* @return
*/
String
update
(
FireFightingSystemVo
vo
);
String
update
(
FireFightingSystemVo
vo
);
/**
* 创建画布
*
* @param model 模型
* @return RiskSourceScene
*/
...
...
@@ -66,6 +72,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
/**
* 更新画布
*
* @param resourceDTO 参数
*/
ResourceDTO
updateMorphic
(
ResourceDTO
resourceDTO
);
...
...
@@ -73,36 +80,41 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
/**
* 获得点位区域树
*
* @param orgCode
* @return
*/
List
<
PointTreeVo
>
getPointTree
(
String
systemId
,
String
orgCode
);
List
<
PointTreeVo
>
getPointTree
(
String
systemId
,
String
orgCode
);
/**
* 装备点性能指标接口
*
* @return
*/
List
<
SpeIndexVo
>
getSpeIndex
(
Long
id
);
/**
* 列表查询
*
* @return List<FireFightingSystemEntity>
*/
List
<
FireFightingSystemEntity
>
getList
();
/**
* 获取详情
*
* @param id
* @return
*/
List
<
AlarmDataVO
>
getSystemById
(
Long
id
);
IPage
<
EquipmentAlarmBySystemIdOrSourceIdVO
>
getEquipmentAlarmBySystemIdOrSourceIdVO
(
IPage
<
EquipmentAlarmBySystemIdOrSourceIdVO
>
page
,
Long
sourceId
,
Long
systemId
,
Integer
confirmType
,
String
createDate
,
String
type
);
IPage
<
EquipmentAlarmBySystemIdOrSourceIdVO
>
getEquipmentAlarmBySystemIdOrSourceIdVO
(
IPage
<
EquipmentAlarmBySystemIdOrSourceIdVO
>
page
,
Long
sourceId
,
Long
systemId
,
Integer
confirmType
,
String
createDate
,
String
type
);
/**
* 删除装备系统
*
* @param id
* @return
*/
...
...
@@ -110,6 +122,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
/**
* 删除画布
*
* @param id
* @return
*/
...
...
@@ -119,12 +132,14 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
/**
* 获取消防系统在装备分类的定义
*
* @return List<EquipmentManageVo>
*/
List
<
EquipmentManageVo
>
getSystemCategory
();
/**
* 根据具体条件,获取消防系统详情
*
* @param fireFightingSystemVo
* @return
*/
...
...
@@ -132,6 +147,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
/**
* 通过codes的数组,获取消防系统集合
*
* @param idsArr
* @return
*/
...
...
@@ -141,21 +157,24 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
/**
* 按照code查询详情
*
* @param systemCode 系统编号
* @return FireFightingSystemEntity
*/
FireFightingSystemEntity
getDetailByCode
(
String
systemCode
);
/**
* 集成页面系统数据
*
* @param systemCode 系统code
* @param isUpdate 自动
* @return
Map<String,
Object>
* @param isUpdate
自动
* @return
Map<String,
Object>
*/
Map
<
String
,
Object
>
integrationPageSysData
(
String
systemCode
,
Boolean
isUpdate
);
Map
<
String
,
Object
>
integrationPageSysData
(
String
systemCode
,
Boolean
isUpdate
);
/**
* 根据bizOrgCode获取消防系统树
*
* @param bizOrgCode 登陆人的机构编码
* @return list
*/
...
...
@@ -163,14 +182,15 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
/**
* 根据登录人及类型获取公司部门树
*
@param reginParams 公司及部门信息
* @param type
默认查询公司及部门,公司:COMPANY,部门:DEPARTMENT
*
* @param type 默认查询公司及部门,公司:COMPANY,部门:DEPARTMENT
* @return
*/
List
<
OrgMenuDto
>
companyTreeByUserAndType
(
ReginParams
reginParams
,
String
type
);
List
<
OrgMenuDto
>
companyTreeByUserAndType
(
String
type
);
/**
* 获取消防系统类型树
*
* @return
*/
List
<
FireFightingSystemTypeTreeVo
>
systemTypeTree
();
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IVideoService.java
View file @
b83789cc
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.equipmanage.service;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto
;
import
com.yeejoin.equipmanage.common.entity.Video
;
import
com.yeejoin.equipmanage.common.entity.dto.VideoDTO
;
import
com.yeejoin.equipmanage.common.entity.dto.VideoSaveDto
;
...
...
@@ -76,4 +77,6 @@ public interface IVideoService extends IService<Video> {
* @return
*/
String
getVideoUrl
(
String
videoId
,
String
presetIndex
,
String
defaultUrl
,
String
code
);
List
<
OrgMenuDto
>
companyTreeByUserAndType
(
String
type
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/AreaServiceImpl.java
View file @
b83789cc
...
...
@@ -5,21 +5,18 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService
;
import
com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
com.yeejoin.equipmanage.common.dto.AreaDto
;
import
com.yeejoin.equipmanage.common.dto.OrgUsrDto
;
import
com.yeejoin.equipmanage.common.entity.Area
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecific
;
import
com.yeejoin.equipmanage.common.entity.SourceFile
;
import
com.yeejoin.equipmanage.common.utils.StringUtil
;
import
com.yeejoin.equipmanage.common.utils.TreeNodeUtil
;
import
com.yeejoin.equipmanage.common.vo.AreaResquest
;
import
com.yeejoin.equipmanage.common.vo.AreaTreeVo
;
import
com.yeejoin.equipmanage.common.vo.UnitAreaTreeVo
;
import
com.yeejoin.equipmanage.context.SpringContextHolder
;
import
com.yeejoin.equipmanage.event.SynAreaRiskEvent
;
...
...
@@ -60,12 +57,16 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IA
@Autowired
private
AreaMapper
areaMapper
;
@Autowired
private
IOrgUsrService
iOrgUsrService
;
@Value
(
"${systemctl.dict.area-type}"
)
private
String
areaType
;
@Autowired
JCSRemoteService
jcsRemoteService
;
@Value
(
"${auth-key-area:area_info}"
)
private
String
authKey
;
// @Override
// public List<UnitAreaTreeVo> getAreaTreeVo() {
// List<UnitAreaTreeVo> areaTreeList = new ArrayList<>();
...
...
@@ -92,7 +93,7 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IA
public
List
<
UnitAreaTreeVo
>
getAreaTreeVoById
(
long
id
,
String
bizOrgCode
)
{
List
<
UnitAreaTreeVo
>
listTree
=
new
ArrayList
<>();
if
(
id
==
-
1
)
{
listTree
=
getAreaTreeListVo
(
bizOrgCode
);
listTree
=
getAreaTreeListVo
();
}
else
{
listTree
=
getChildrenz
(
id
);
}
...
...
@@ -215,10 +216,10 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IA
}
@Override
public
List
<
UnitAreaTreeVo
>
getAreaTreeListVo
(
String
bizOrgCode
)
{
public
List
<
UnitAreaTreeVo
>
getAreaTreeListVo
()
{
// 获取公司部门list
List
<
OrgUsr
>
orgUsrLists
=
iOrgUsrService
.
getListByBizOrgTypeCode
(
"COMPANY,DEPARTMENT"
,
bizOrgCode
);
List
<
UnitAreaTreeVo
>
areaTreeList
=
org
Usr
Lists
.
stream
()
List
<
OrgUsr
Dto
>
orgCompanyLists
=
jcsRemoteService
.
getCompanyDeptListWithAuth
(
authKey
,
"COMPANY"
);
List
<
UnitAreaTreeVo
>
areaTreeList
=
org
Company
Lists
.
stream
()
.
map
(
key
->
{
UnitAreaTreeVo
vo
=
new
UnitAreaTreeVo
();
vo
.
setId
((
key
.
getSequenceNbr
()));
...
...
@@ -226,13 +227,14 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IA
vo
.
setType
(
key
.
getBizOrgType
());
vo
.
setBizOrgCode
(
key
.
getBizOrgCode
());
vo
.
setBizOrgName
(
key
.
getBizOrgName
());
vo
.
setParentId
(
Long
.
valueOf
(
key
.
getParentId
())
);
vo
.
setParentId
(
StringUtil
.
isNotEmpty
(
key
.
getParentId
())
?
Long
.
valueOf
(
key
.
getParentId
())
:
null
);
return
vo
;
}).
collect
(
Collectors
.
toList
());
// 根据bizOrgCode获取区域list
List
<
String
>
bizOrgCodes
=
areaTreeList
.
stream
().
map
(
UnitAreaTreeVo:
:
getBizOrgCode
).
collect
(
Collectors
.
toList
());
LambdaQueryWrapper
<
Area
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
likeRight
(
Area:
:
getBizOrgCode
,
bizOrgCode
);
wrapper
.
in
(
Area:
:
getBizOrgCode
,
bizOrgCodes
);
List
<
Area
>
areaEntityList
=
this
.
baseMapper
.
selectList
(
wrapper
);
List
<
UnitAreaTreeVo
>
systemList
=
areaEntityList
.
stream
()
.
map
(
key
->
{
...
...
@@ -248,14 +250,14 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IA
areaTreeList
.
addAll
(
systemList
);
return
areaTreeList
.
stream
()
.
filter
(
d
->
bizOrgCode
.
equals
(
d
.
getBizOrgCode
())
&&
!
"area"
.
equals
(
d
.
getType
()))
.
filter
(
d
->
!
"area"
.
equals
(
d
.
getType
()))
.
peek
((
m
)
->
m
.
setChildren
(
getAreaChildren
(
m
,
areaTreeList
)))
.
collect
(
Collectors
.
toList
());
}
@Override
public
List
<
OrgMenuDto
>
company
TreeByUserAndType
(
ReginParams
reginParams
,
String
type
)
{
return
iOrgUsrService
.
companyTreeByUserAndType
(
reginParams
,
type
);
public
List
<
OrgMenuDto
>
company
DeptTree
(
)
{
return
jcsRemoteService
.
getCompanyDeptTreeWithAuth
(
authKey
,
"COMPANY"
);
}
/**
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentDetailServiceImpl.java
View file @
b83789cc
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto
;
import
com.yeejoin.equipmanage.common.entity.*
;
import
com.yeejoin.equipmanage.common.enums.BillContentEnum
;
import
com.yeejoin.equipmanage.common.enums.FileTypeEnum
;
...
...
@@ -64,9 +65,15 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe
@Autowired
private
IEquipmentSpecificIndexSerivce
equipmentSpecificIndexSerivce
;
@Autowired
JCSRemoteService
jcsRemoteService
;
@Value
(
"${fileserver_domain}"
)
private
String
fileServer
;
@Value
(
"${auth-key-fire-equip:fire_equip_info}"
)
private
String
authKey
;
@Autowired
private
ISystemDicService
iSystemDicService
;
...
...
@@ -81,7 +88,7 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe
private
List
<
UploadFile
>
fillFileList
(
List
<
UploadFile
>
list
,
Long
id
,
String
type
)
{
if
(
list
==
null
)
{
return
new
ArrayList
<
UploadFile
>();
return
new
ArrayList
<>();
}
list
.
forEach
(
item
->
{
if
(
item
.
getUrl
().
contains
(
fileServer
))
{
...
...
@@ -175,7 +182,7 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe
specificIndex
.
setValue
(
p
.
getValue
());
return
specificIndex
;
}).
collect
(
Collectors
.
toList
());
if
(!
equipmentSpecificIndexs
.
isEmpty
())
{
if
(!
equipmentSpecificIndexs
.
isEmpty
())
{
equipmentSpecificIndexSerivce
.
updateIndexValueBatchByUniqueKey
(
equipmentSpecificId
,
equipmentSpecificIndexs
);
}
}
...
...
@@ -272,4 +279,9 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe
}
return
res
;
}
@Override
public
List
<
OrgMenuDto
>
companyDeptTree
()
{
return
jcsRemoteService
.
getCompanyDeptTreeWithAuth
(
authKey
,
null
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java
View file @
b83789cc
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
import
java.net.Inet4Address
;
import
java.net.InetAddress
;
import
java.net.NetworkInterface
;
import
java.net.SocketException
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService
;
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
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
...
@@ -33,6 +8,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.google.common.base.Joiner
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.utils.FeignUtil
;
...
...
@@ -43,37 +19,36 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
com.yeejoin.equipmanage.common.datasync.entity.FireFightingSystem
;
import
com.yeejoin.equipmanage.common.entity.DynamicFormGroup
;
import
com.yeejoin.equipmanage.common.entity.DynamicFormInstance
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecific
;
import
com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity
;
import
com.yeejoin.equipmanage.common.entity.SourceScene
;
import
com.yeejoin.equipmanage.common.dto.OrgUsrDto
;
import
com.yeejoin.equipmanage.common.entity.*
;
import
com.yeejoin.equipmanage.common.entity.dto.EquipTypeAmountPageDTO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipCountBySystemVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipTypeImgAmountVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquiplistSpecificBySystemVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentAlarmBySystemIdOrSourceIdVO
;
import
com.yeejoin.equipmanage.common.entity.vo.PointTreeVo
;
import
com.yeejoin.equipmanage.common.entity.vo.*
;
import
com.yeejoin.equipmanage.common.enums.EquipmentRiskTypeEnum
;
import
com.yeejoin.equipmanage.common.enums.EquipmentSpeIndexEnum
;
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.mapper.BuildingMapper
;
import
com.yeejoin.equipmanage.mapper.EquipmentManageMapper
;
import
com.yeejoin.equipmanage.mapper.FireFightingSystemMapper
;
import
com.yeejoin.equipmanage.mapper.FormInstanceMapper
;
import
com.yeejoin.equipmanage.mapper.SourceSceneMapper
;
import
com.yeejoin.equipmanage.common.vo.*
;
import
com.yeejoin.equipmanage.mapper.*
;
import
com.yeejoin.equipmanage.remote.RemoteSecurityService
;
import
com.yeejoin.equipmanage.service.EquipmentManageService
;
import
com.yeejoin.equipmanage.service.IEqDynamicFormGroupService
;
import
com.yeejoin.equipmanage.service.IEqDynamicFormInstanceService
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce
;
import
com.yeejoin.equipmanage.service.IFireFightingSystemService
;
import
com.yeejoin.equipmanage.service.IRiskSourceSceneService
;
import
com.yeejoin.equipmanage.service.ISourceSceneService
;
import
com.yeejoin.equipmanage.service.ISyncDataService
;
import
com.yeejoin.equipmanage.service.MqttSendGateway
;
import
com.yeejoin.equipmanage.service.*
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.net.Inet4Address
;
import
java.net.InetAddress
;
import
java.net.NetworkInterface
;
import
java.net.SocketException
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Service
...
...
@@ -136,11 +111,14 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
MqttSendGateway
mqttSendGateway
;
@Autowired
private
IOrgUsrService
iOrgUsr
Service
;
private
JCSRemoteService
jcsRemote
Service
;
@Value
(
"${systemctl.sync.switch}"
)
private
Boolean
syncSwitch
;
@Value
(
"${auth-key-fire-system:fire_system_info}"
)
private
String
authKey
;
@Override
public
List
<
EquipCountBySystemVO
>
getEquipCountBySystemId
(
Long
systemId
)
{
return
this
.
baseMapper
.
getEquipCountBySystemId
(
systemId
);
...
...
@@ -789,7 +767,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
data
=
saveIntegrationPageSysData
(
systemCode
);
}
else
{
if
(
redisUtils
.
hasKey
(
systemCode
))
{
data
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
systemCode
).
toString
(),
Map
.
class
);
data
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
systemCode
).
toString
(),
Map
.
class
);
}
else
{
data
=
saveIntegrationPageSysData
(
systemCode
);
}
...
...
@@ -840,7 +818,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Override
public
List
<
FireFightingSystemTreeVo
>
getSystemTreeByOrgCode
(
String
bizOrgCode
)
{
// 获取公司部门list
List
<
OrgUsr
>
orgUsrLists
=
iOrgUsrService
.
getListByBizOrgTypeCode
(
"COMPANY,DEPARTMENT"
,
bizOrgCode
);
List
<
OrgUsr
Dto
>
orgUsrLists
=
jcsRemoteService
.
getCompanyDeptListWithAuth
(
"COMPANY,DEPARTMENT"
,
bizOrgCode
);
List
<
FireFightingSystemTreeVo
>
fireFightingSystemTreeList
=
orgUsrLists
.
stream
()
.
map
(
key
->
{
FireFightingSystemTreeVo
vo
=
new
FireFightingSystemTreeVo
();
...
...
@@ -853,8 +831,9 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}).
collect
(
Collectors
.
toList
());
// 根据bizOrgCode获取系统list
List
<
String
>
bizOrgCodes
=
fireFightingSystemTreeList
.
stream
().
map
(
FireFightingSystemTreeVo:
:
getBizOrgCode
).
collect
(
Collectors
.
toList
());
LambdaQueryWrapper
<
FireFightingSystemEntity
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
likeRight
(
FireFightingSystemEntity:
:
getBizOrgCode
,
bizOrgCode
);
wrapper
.
in
(
FireFightingSystemEntity:
:
getBizOrgCode
,
bizOrgCodes
);
List
<
FireFightingSystemEntity
>
fireFightingSystemEntityList
=
this
.
baseMapper
.
selectList
(
wrapper
);
List
<
FireFightingSystemTreeVo
>
systemList
=
fireFightingSystemEntityList
.
stream
()
.
map
(
key
->
{
...
...
@@ -869,7 +848,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
// 组装公司部门树
fireFightingSystemTreeList
.
addAll
(
systemList
);
return
fireFightingSystemTreeList
.
stream
()
.
filter
(
d
->
bizOrgCode
.
equals
(
d
.
getBizOrgCode
())
&&
!
"system"
.
equals
(
d
.
getType
()))
.
filter
(
d
->
!
"system"
.
equals
(
d
.
getType
()))
.
peek
((
m
)
->
m
.
setChildren
(
getChildren
(
m
,
fireFightingSystemTreeList
)))
.
collect
(
Collectors
.
toList
());
}
...
...
@@ -880,14 +859,14 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
&&
d
.
getBizOrgCode
().
equals
(
root
.
getBizOrgCode
())
&&
!
"system"
.
equals
(
root
.
getType
())
&&
!
d
.
getId
().
equals
(
root
.
getId
()))
)
)
.
peek
(
m
->
m
.
setChildren
(
getChildren
(
m
,
all
)))
.
collect
(
Collectors
.
toList
());
}
@Override
public
List
<
OrgMenuDto
>
companyTreeByUserAndType
(
ReginParams
reginParams
,
String
type
)
{
return
iOrgUsrService
.
companyTreeByUserAndType
(
reginParams
,
type
);
public
List
<
OrgMenuDto
>
companyTreeByUserAndType
(
String
type
)
{
return
jcsRemoteService
.
getCompanyDeptTreeWithAuth
(
authKey
,
type
);
}
@Override
...
...
@@ -895,7 +874,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
// 获取所有系统list
LambdaQueryWrapper
<
DynamicFormGroup
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
DynamicFormGroup:
:
getGroupType
,
"fireSystem"
);
wrapper
.
eq
(
DynamicFormGroup:
:
getParentId
,
0
);
wrapper
.
eq
(
DynamicFormGroup:
:
getParentId
,
0
);
List
<
DynamicFormGroup
>
list
=
iEqDynamicFormGroupService
.
list
(
wrapper
);
List
<
FireFightingSystemTypeTreeVo
>
childrenList
=
list
.
stream
().
map
(
item
->
{
FireFightingSystemTypeTreeVo
vo
=
new
FireFightingSystemTypeTreeVo
();
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/JCSRemoteService.java
0 → 100644
View file @
b83789cc
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
import
com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.equipmanage.common.dto.OrgUsrDto
;
import
com.yeejoin.equipmanage.fegin.JcsFeign
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @author DELL
*/
@Service
public
class
JCSRemoteService
{
@Autowired
JcsFeign
jcsFeignClient
;
/**
* 公司部门树
* @param authKey 权限key
* @param orgType 树类型null,公司部门树,COMPANY: 公司树 DEPARTMENT部门树
* @return List<OrgMenuDto>
*/
public
List
<
OrgMenuDto
>
getCompanyDeptTreeWithAuth
(
String
authKey
,
String
orgType
)
{
FeignClientResult
<
List
<
OrgMenuDto
>>
feignClientResult
=
jcsFeignClient
.
getCompanyDeptTreeWithAuth
(
authKey
,
orgType
);
return
feignClientResult
.
getResult
();
}
/**
*
* 查询有权限的公司部门列表
* @param authKey 权限key
* @param orgTypes(多个逗号分隔) 为空默认查询公司和部门,COMPANY: 公司树 DEPARTMENT部门树
* @return List<OrgUsrDto>
*/
public
List
<
OrgUsrDto
>
getCompanyDeptListWithAuth
(
String
authKey
,
String
orgTypes
)
{
FeignClientResult
<
List
<
OrgUsrDto
>>
feignClientResult
=
jcsFeignClient
.
getCompanyDeptListWithAuth
(
authKey
,
orgTypes
);
return
feignClientResult
.
getResult
();
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/VideoServiceImpl.java
View file @
b83789cc
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.boot.module.common.api.feign.VideoFeignClient
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yeejoin.equipmanage.common.entity.EquipmentCategory
;
import
com.yeejoin.equipmanage.common.entity.EquipmentIndex
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecific
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex
;
import
com.yeejoin.equipmanage.common.entity.Video
;
import
com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific
;
import
com.yeejoin.equipmanage.common.entity.VideoImportantEquipment
;
import
com.yeejoin.equipmanage.common.entity.VideoSource
;
import
com.yeejoin.equipmanage.common.entity.WarehouseStructure
;
import
com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto
;
import
com.yeejoin.equipmanage.common.entity.*
;
import
com.yeejoin.equipmanage.common.entity.dto.VideoDTO
;
import
com.yeejoin.equipmanage.common.entity.dto.VideoSaveDto
;
import
com.yeejoin.equipmanage.common.entity.vo.BuildingListVO
;
import
com.yeejoin.equipmanage.common.entity.vo.BuildingVideoListVO
;
import
com.yeejoin.equipmanage.common.entity.vo.BuildingVideoVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentCategoryTypeTreeVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo
;
import
com.yeejoin.equipmanage.common.entity.vo.PageSecurityVideoVO
;
import
com.yeejoin.equipmanage.common.entity.vo.PageVideoVO
;
import
com.yeejoin.equipmanage.common.entity.vo.VideoDownloadVO
;
import
com.yeejoin.equipmanage.common.entity.vo.VideoListVo
;
import
com.yeejoin.equipmanage.common.entity.vo.*
;
import
com.yeejoin.equipmanage.common.enums.EquipmentSpeIndexEnum
;
import
com.yeejoin.equipmanage.common.enums.IndustryEnum
;
import
com.yeejoin.equipmanage.common.utils.HttpContentTypeUtil
;
import
com.yeejoin.equipmanage.common.utils.StringUtil
;
import
com.yeejoin.equipmanage.fegin.VideoFeignClient
;
import
com.yeejoin.equipmanage.mapper.VideoMapper
;
import
com.yeejoin.equipmanage.service.IBuilldService
;
import
com.yeejoin.equipmanage.service.IEquipmentCategoryService
;
import
com.yeejoin.equipmanage.service.IEquipmentIndexService
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificIndexService
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce
;
import
com.yeejoin.equipmanage.service.IVideoEquipmentSpecificService
;
import
com.yeejoin.equipmanage.service.IVideoImportantEquipmentService
;
import
com.yeejoin.equipmanage.service.IVideoService
;
import
com.yeejoin.equipmanage.service.IVideoSourceService
;
import
com.yeejoin.equipmanage.service.IWarehouseStructureService
;
import
com.yeejoin.equipmanage.service.*
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.*
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
/**
* @author ZeHua Li
...
...
@@ -102,8 +70,7 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
@Autowired
VideoMapper
videoMapper
;
@Autowired
VideoFeignClient
videoFeignClient
;
...
...
@@ -117,6 +84,12 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
@Value
(
"${dcs.client-id}"
)
private
String
clientId
;
@Autowired
JCSRemoteService
jcsRemoteService
;
@Value
(
"${auth-key-fire-video:fire_video_info}"
)
private
String
authKey
;
@Transactional
@Override
public
Video
saveVideo
(
VideoSaveDto
videoSave
)
{
...
...
@@ -530,18 +503,23 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
}
return
getFlvUrlByVideoIdOrPresetIndex
(
videoId
,
presetIndex
);
}
private
String
getVideoUrl
(
String
code
){
String
url
=
""
;
try
{
ResponseModel
<
String
>
da
=
videoFeignClient
.
videoUrlByIndexCode
(
code
);
if
(!
ObjectUtils
.
isEmpty
(
da
)){
url
=
da
.
getResult
().
substring
(
da
.
getResult
().
indexOf
(
"openUrl"
));
}
}
catch
(
Exception
e
)
{
log
.
error
(
"视频服务调用失败"
,
e
.
getMessage
());
}
return
url
;
@Override
public
List
<
OrgMenuDto
>
companyTreeByUserAndType
(
String
type
)
{
return
jcsRemoteService
.
getCompanyDeptTreeWithAuth
(
authKey
,
type
);
}
private
String
getVideoUrl
(
String
code
)
{
String
url
=
""
;
try
{
ResponseModel
<
String
>
da
=
videoFeignClient
.
videoUrlByIndexCode
(
code
);
if
(!
ObjectUtils
.
isEmpty
(
da
))
{
url
=
da
.
getResult
().
substring
(
da
.
getResult
().
indexOf
(
"openUrl"
));
}
}
catch
(
Exception
e
)
{
log
.
error
(
"视频服务调用失败"
,
e
.
getMessage
());
}
return
url
;
}
public
String
getFlvUrlByVideoIdOrPresetIndex
(
String
videoId
,
String
presetIndex
)
{
...
...
amos-boot-system-equip/src/main/resources/application.properties
View file @
b83789cc
spring.application.name
=
AMOS-EQUIPMANAGE
spring.application.name
=
AMOS-EQUIPMANAGE
server.servlet.context-path
=
/equip
server.port
=
8100
server.port
=
8100
#server.servlet.context-path=/case
spring.profiles.active
=
dev
spring.profiles.active
=
dev
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
#mybatis mapper file
mybatis.mapper-locations
=
classpath:mapper/*.xml
...
...
@@ -17,61 +17,41 @@ pagehelper.helper-dialect=mysql
pagehelper.params
=
count=countSql
pagehelper.reasonable
=
false
pagehelper.support-methods-arguments
=
true
#liquibase
spring.liquibase.change-log
=
classpath:/changelog/changelog-master.xml
spring.liquibase.enabled
=
true
spring.liquibase.change-log
=
classpath:/changelog/changelog-master.xml
spring.liquibase.enabled
=
true
#\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u5927\u5C0F
spring.servlet.multipart.maxFileSize
=
100MB
spring.servlet.multipart.maxRequestSize
=
100MB
#saveUserRedis\u8FC7\u671F\u65F6\u95F428\u5929
#redis_region_time_second=2419200
patrol.fegin.name
=
AMOS-PATROL
maintenance.feign.name
=
AMOS-MAINTENANCE-API
precontrol.feign.name
=
JEPCC-PRECONTROL-SERVER
patrol.fegin.name
=
AMOS-PATROL
maintenance.feign.name
=
AMOS-MAINTENANCE-API
precontrol.feign.name
=
JEPCC-PRECONTROL-SERVER
security.privilege.name
=
AMOS-API-PRIVILEGE
security.systemctl.name
=
AMOS-API-SYSTEMCTL
#jpush
Push.fegin.name
=
AppMessagePushService
dutyMode.fegin.name
=
AMOS-DUTYMODE
riskSource.feign.name
=
AMOS-AUTOSYS
equipManage.name
=
AMOS-EQUIPMANAGE
iot.vehicle.track
=
AMOS-API-IOT
jcs.fegin.name
=
JCS
jcs.fegin.name
=
JCS-SHG
video.fegin.name
=
VIDEO
#项目初始化画布id
morphic.projectSeq
=
1390314016458514433
#wl_equipment_category 表id (取火灾报警系统id)
equipment.fire.systemid
=
1302870628873932802
equipment.type
=
2
equipment.hierarchy
=
1,2,4,6
#装备查询根据装备类型编码过滤,4为过滤掉车相关数据,多个的话,添加方式为4,5
equipment.filter.code
=
4
#wl_equipment_category 编码 92040000 为消防行业 火灾系统分类编码
equip.system.alarm.code
=
92040000
#wl_equipment_category 编码 50000000 为安防行业 摄像头分类编码
equip.security.code
=
50000000
## redis失效时间
redis.cache.failure.time
=
10800
#平台字典配置项
systemctl.dict.iot-core-param
=
IOT_CORE_PARAM
systemctl.dict.area-type
=
AREA_TYPE
...
...
@@ -79,16 +59,13 @@ systemctl.dict.allow-operation=ALLOW_OPERATION
systemctl.dict.build-type
=
BUILD_TYPE
systemctl.dict.build-use-type
=
BUILD_USE_TYPE
systemctl.dict.building-structure-type
=
BUILDING_STRUCTURE_TYPE
equip.dict.car-state
=
CarState
equip.dict.name-key
=
FireCar_GDLongitude,FireCar_GDLatitude
#Project application topic
mqtt.vehicle.topic
=
${equipManage.name}.vehicle.state
equip.point.equipmentdata.topic
=
${equipManage.name}.equipment.state
equip.index.topic
=
${equipManage.name}.equipment.index.state
equip.iot.monitor.topic
=
team/station/monitor/matrix
# 接口地址
equip.scene.detail.url
=
${server.servlet.context-path}/scene/%s/detail/list
equip.point.equipmentdata.url
=
${server.servlet.context-path}/equipSpecific/getAll?id=
...
...
@@ -98,17 +75,21 @@ equip.point.equipmentDetail.url=${server.servlet.context-path}/equipSpecific/get
firefightingsystem.detail.url
=
${server.servlet.context-path}/fire-fighting-system/getSystemById?id=
#组态获取分页接口地址
firefightingsystem.equip.alarms.url
=
${server.servlet.context-path}/fire-fighting-system/getEquipmentAlarmBySystemIdOrSourceIdVO
building.detail
=
${server.servlet.context-path}/building/findByInstanceId
building.floor.detail
=
${server.servlet.context-path}/building/getBuildDetaliByFloorId?instanceId=
dcs.client-id
=
fire_system
dcs.grant-type
=
client_credentials
dcs.scope
=
all
dcs.token-key
=
dcs_token_key
dcs.client.secret
=
fire_system
dcs.x.hw.id
=
NR_REST_APP
dcs.x.hw.appKey
=
s+YkvQhwilx91TRJHhNDmw==
\ No newline at end of file
dcs.x.hw.appKey
=
s+YkvQhwilx91TRJHhNDmw==
# 权限标识-物联区域
auth-key-area
=
area_info;
# 权限标识-消防系统
auth-key-fire-system
=
fire_system_info;
# 权限标识-消防装备
auth-key-fire-equip
=
fire_equip_info;
# 权限标识-消防视频
auth-key-fire-video
=
fire_video_info;
\ No newline at end of file
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