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
ba76251f
Commit
ba76251f
authored
Dec 14, 2021
by
maoying
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://172.16.10.76/moa/amos-boot-biz
into developer
parents
608886ee
70ed9d94
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
131 additions
and
87 deletions
+131
-87
MetaHandler.java
...in/java/com/yeejoin/amos/boot/biz/config/MetaHandler.java
+12
-10
EquipFeignClient.java
...n/amos/boot/module/common/api/feign/EquipFeignClient.java
+3
-4
DutyPersonShiftMapper.xml
...n-api/src/main/resources/mapper/DutyPersonShiftMapper.xml
+2
-2
DynamicFormInstanceMapper.xml
...i/src/main/resources/mapper/DynamicFormInstanceMapper.xml
+1
-1
OrgUsrMapper.xml
...ule-common-api/src/main/resources/mapper/OrgUsrMapper.xml
+2
-2
ControllerMapper.java
...oin/amos/boot/module/jcs/api/mapper/ControllerMapper.java
+1
-1
CommandController.java
...boot/module/command/biz/controller/CommandController.java
+5
-5
OrgUsrController.java
...s/boot/module/common/biz/controller/OrgUsrController.java
+2
-13
ESOrgUsrService.java
.../boot/module/common/biz/service/impl/ESOrgUsrService.java
+4
-2
OrgUsrServiceImpl.java
...oot/module/common/biz/service/impl/OrgUsrServiceImpl.java
+1
-1
ControllerController.java
.../boot/module/jcs/biz/controller/ControllerController.java
+2
-6
ControllerEquipController.java
.../module/jcs/biz/controller/ControllerEquipController.java
+0
-1
VoiceRecordFileController.java
.../module/jcs/biz/controller/VoiceRecordFileController.java
+13
-13
AlertCalledServiceImpl.java
...t/module/jcs/biz/service/impl/AlertCalledServiceImpl.java
+22
-1
ControllerEquipServiceImpl.java
...dule/jcs/biz/service/impl/ControllerEquipServiceImpl.java
+47
-9
ControllerServiceImpl.java
...ot/module/jcs/biz/service/impl/ControllerServiceImpl.java
+0
-0
PowerTransferServiceImpl.java
...module/jcs/biz/service/impl/PowerTransferServiceImpl.java
+14
-16
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/config/MetaHandler.java
View file @
ba76251f
...
...
@@ -125,15 +125,18 @@ public class MetaHandler implements MetaObjectHandler {
*/
@Override
public
void
updateFill
(
MetaObject
metaObject
)
{
String
userId
=
RequestContext
.
getExeUserId
();
ReginParams
reginParams
=
JSONObject
.
parseObject
(
null
!=
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
userId
,
getToken
()))
?
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
userId
,
getToken
())).
toString
()
:
null
,
ReginParams
.
class
);
if
(
ObjectUtils
.
isEmpty
(
reginParams
))
{
return
;
Class
clazz
=
metaObject
.
getOriginalObject
().
getClass
();
FillCommonUserField
annotation
=
(
FillCommonUserField
)
clazz
.
getAnnotation
(
FillCommonUserField
.
class
);
if
(
annotation
==
null
||
annotation
.
isAutoFill
())
{
String
userId
=
RequestContext
.
getExeUserId
();
ReginParams
reginParams
=
JSONObject
.
parseObject
(
null
!=
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
userId
,
getToken
()))
?
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
userId
,
getToken
())).
toString
()
:
null
,
ReginParams
.
class
);
if
(
ObjectUtils
.
isEmpty
(
reginParams
))
{
return
;
}
AgencyUserModel
agencyUserModel
=
reginParams
.
getUserModel
();
recInfoUpdate
(
metaObject
,
agencyUserModel
);
}
AgencyUserModel
agencyUserModel
=
reginParams
.
getUserModel
();
recInfoUpdate
(
metaObject
,
agencyUserModel
);
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/feign/EquipFeignClient.java
View file @
ba76251f
...
...
@@ -195,10 +195,9 @@ public interface EquipFeignClient {
@RequestMapping
(
value
=
"/monitorView/video/page"
,
method
=
RequestMethod
.
GET
)
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
queryUncheckedVideoList
(
@RequestParam
(
value
=
"viewId"
)
Long
viewId
,
@RequestParam
(
value
=
"videoName"
,
required
=
false
)
String
videoName
,
@RequestParam
(
value
=
"videoCode"
,
required
=
false
)
String
videoCode
,
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
queryVideoPage
(
@RequestParam
(
value
=
"nodeId"
)
Long
nodeId
,
@RequestParam
(
value
=
"nodeType"
,
required
=
false
)
String
nodeType
,
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
);
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/DutyPersonShiftMapper.xml
View file @
ba76251f
...
...
@@ -136,7 +136,7 @@
</select>
<select
id=
'getEquipmentForSpecifyDate'
resultType=
'map'
>
select * from (
SELECT
MAX(
CASE
...
...
@@ -173,7 +173,7 @@
where cd.group_code =#{groupCode} and cds.instance_id is not null and
cd.is_delete=0
group by cd.instance_id
) result group by ${groupByName}
</select>
<select
id=
'getInstanceIdForSpecifyDateAndEquipment'
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/DynamicFormInstanceMapper.xml
View file @
ba76251f
...
...
@@ -409,7 +409,7 @@ FROM
FROM
cb_org_usr
WHERE
biz_org_name = #{departmentName}
biz_org_name = #{departmentName}
and is_delete = 0
)
AND cou.biz_org_type = 'PERSON'
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/OrgUsrMapper.xml
View file @
ba76251f
...
...
@@ -137,8 +137,8 @@
<if
test=
"map.bizOrgCode != null and map.bizOrgCode != '-1'"
>
AND u.biz_org_code like concat(#{map.bizOrgCode}, '%')
</if>
<if
test=
"map.amosOrg
Id != null and map.amosOrgId
!= '-1'"
>
AND u.amos_org_
id like concat(#{map.amosOrgId
}, '%')
<if
test=
"map.amosOrg
Code != null and map.amosOrgCode
!= '-1'"
>
AND u.amos_org_
code like concat('%',#{map.amosOrgCode
}, '%')
</if>
GROUP BY
u.sequence_nbr ,
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/mapper/ControllerMapper.java
View file @
ba76251f
...
...
@@ -17,5 +17,5 @@ import java.util.List;
*/
public
interface
ControllerMapper
extends
BaseMapper
<
Controller
>
{
public
List
<
ControllerDto
>
getCurrentStationController
(
@Param
(
"sequenceNbr"
)
Long
sequenceNbr
);
List
<
ControllerDto
>
getCurrentStationController
(
@Param
(
"sequenceNbr"
)
Long
sequenceNbr
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-command-biz/src/main/java/com/yeejoin/amos/boot/module/command/biz/controller/CommandController.java
View file @
ba76251f
...
...
@@ -351,13 +351,13 @@ public class CommandController extends BaseController {
@ApiOperation
(
value
=
"分页查询视图下的视频列表"
)
@RequestMapping
(
value
=
"monitorView/video/page"
,
method
=
RequestMethod
.
GET
)
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
queryUncheckedVideoList
(
@RequestParam
(
value
=
"viewId"
)
Long
viewId
,
@RequestParam
(
value
=
"videoName"
,
required
=
false
)
String
videoName
,
@RequestParam
(
value
=
"videoCode"
,
required
=
false
)
String
videoCode
,
@RequestParam
(
value
=
"nodeId"
)
Long
nodeId
,
@RequestParam
(
value
=
"nodeType"
,
required
=
false
)
String
nodeType
,
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
throws
Exception
@RequestParam
(
value
=
"size"
)
int
size
)
throws
Exception
{
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
data
=
equipFeignClient
.
query
UncheckedVideoList
(
viewId
,
videoName
,
videoCod
e
,
current
,
size
);
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
data
=
equipFeignClient
.
query
VideoPage
(
nodeId
,
nodeTyp
e
,
current
,
size
);
Page
<
Map
<
String
,
Object
>>
pag
=
data
!=
null
?
data
.
getResult
()
:
null
;
List
<
Map
<
String
,
Object
>>
records
=
pag
!=
null
?
pag
.
getRecords
()
:
null
;
if
(
records
!=
null
&&
records
.
size
()
>
0
)
{
...
...
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 @
ba76251f
...
...
@@ -50,6 +50,7 @@ import javax.servlet.http.HttpServletRequest;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
...
...
@@ -350,18 +351,6 @@ public class OrgUsrController extends BaseController {
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
selectCompanyUsers
(
orgUnitId
));
}
/**
* 根据名称模糊匹配
*
* @param name
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/getList"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据名称模糊匹配"
,
notes
=
"根据名称模糊匹配"
)
public
ResponseModel
<
List
<
ESOrgUsrDto
>>
selectById
(
HttpServletRequest
request
,
String
name
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
eSOrgUsrService
.
queryByKeys
(
name
));
}
/**
* 根据名称模糊匹配
...
...
@@ -372,7 +361,7 @@ public class OrgUsrController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/getdataList/unit"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据名称模糊匹配单位"
,
notes
=
"根据名称模糊匹配单位"
)
public
ResponseModel
<
Lis
t
<
ESOrgUsrDto
>>
selectByIddata
(
HttpServletRequest
request
,
String
name
)
throws
Exception
{
public
ResponseModel
<
Se
t
<
ESOrgUsrDto
>>
selectByIddata
(
HttpServletRequest
request
,
String
name
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
eSOrgUsrService
.
queryByKeys
(
name
));
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/ESOrgUsrService.java
View file @
ba76251f
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
import
java.util.LinkedHashSet
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Set
;
import
javax.annotation.PostConstruct
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
...
...
@@ -125,7 +127,7 @@ public class ESOrgUsrService {
*
*/
@SuppressWarnings
({
"rawtypes"
})
public
Lis
t
<
ESOrgUsrDto
>
queryByKeys
(
String
name
)
public
Se
t
<
ESOrgUsrDto
>
queryByKeys
(
String
name
)
{
//创建builder
FuzzyQueryBuilder
queryBuilder
=
null
;
...
...
@@ -135,7 +137,7 @@ public class ESOrgUsrService {
queryBuilder
=
QueryBuilders
.
fuzzyQuery
(
"bizOrgName"
,
name
);
}
Iterable
<
ESOrgUsrDto
>
search
=
esOrgUsrDtoRepository
.
search
(
queryBuilder
);
List
<
ESOrgUsrDto
>
list
=
new
LinkedLis
t
<>();
Set
<
ESOrgUsrDto
>
list
=
new
LinkedHashSe
t
<>();
search
.
forEach
(
esOrgUsrDto
->{
list
.
add
(
esOrgUsrDto
);
});
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/OrgUsrServiceImpl.java
View file @
ba76251f
...
...
@@ -404,7 +404,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
/* BUG2680 查询部门人员错误 传递参数类型不正确 修改为string 2021-09-14 陈召 开始 */
if
(
req
.
containsKey
(
"amosOrgId"
)
&&
!
ObjectUtils
.
isEmpty
(
req
.
get
(
"amosOrgId"
)))
{
map
.
put
(
"amosOrg
Id"
,
req
.
get
(
"amosOrgId"
));
map
.
put
(
"amosOrg
Code"
,
req
.
get
(
"amosOrgId"
));
//当时给前端给的key名字错了,以为是传Id过来,现在传名字,那就将错就错吧
}
req
.
remove
(
"bizOrgName"
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/ControllerController.java
View file @
ba76251f
...
...
@@ -3,19 +3,14 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.ControllerDto
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Controller
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.ControllerLog
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.ControllerGroupEnum
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.ControllerTypeEnum
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.ControllerEquipServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.ControllerLogServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.ControllerServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
...
...
@@ -41,7 +36,7 @@ public class ControllerController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"更新联动控制器状态"
,
notes
=
"更新联动控制器状态"
)
@PostMapping
(
value
=
"/updateControllerState"
)
public
ResponseModel
<
Object
>
updateControllerState
(
@RequestBody
Controller
[]
controllers
)
{
public
ResponseModel
<
Object
>
updateControllerState
(
@RequestBody
Controller
Dto
[]
controllers
)
{
return
ResponseHelper
.
buildResponse
(
controllerServiceImpl
.
changeControllerState
(
controllers
));
}
...
...
@@ -66,6 +61,7 @@ public class ControllerController extends BaseController {
BeanUtils
.
copyProperties
(
controller
,
controllerDto
);
controllerDto
.
setTypeEnum
(
anEnum
);
controllerDto
.
setTypeDescription
(
anEnum
.
getName
());
controllerDto
.
setState
(
"0"
);
controllerDtos
.
add
(
controllerDto
);
}
});
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/ControllerEquipController.java
View file @
ba76251f
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
controller
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.ControllerEquipDto
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.ControllerEquip
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.ControllerEquipServiceImpl
;
import
io.swagger.annotations.Api
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/VoiceRecordFileController.java
View file @
ba76251f
...
...
@@ -98,19 +98,19 @@ public class VoiceRecordFileController extends BaseController {
page
.
setSize
(
pageSize
);
String
sortParam
=
""
;
String
sortRule
=
""
;
//
if(sort!=null) { // 排序失效
//
String[] date= sort.split(",");
//
if(date[1].equals("ascend")) {
//
sortParam = RedisKey.humpToLine(date[0]);
//
sortRule = "asc";
//
}else {
//
sortParam =RedisKey.humpToLine(date[0]);
//
sortRule = "desc";
//
}
//
}else {
//
sortParam = "tel_start_time";
//
sortRule = "desc";
//
}
if
(
sort
!=
null
)
{
// 排序失效
String
[]
date
=
sort
.
split
(
","
);
if
(
date
[
1
].
equals
(
"ascend"
))
{
sortParam
=
RedisKey
.
humpToLine
(
date
[
0
]);
sortRule
=
"asc"
;
}
else
{
sortParam
=
RedisKey
.
humpToLine
(
date
[
0
]);
sortRule
=
"desc"
;
}
}
else
{
sortParam
=
"tel_start_time"
;
sortRule
=
"desc"
;
}
Page
<
VoiceRecordFileDto
>
pageBean
=
voiceRecordFileService
.
queryRecordListByQueryDto
(
page
,
model
.
getTelStartTimeStr
(),
model
.
getTelEndTimeStr
(),
model
.
getFileType
(),
model
.
getCaller
(),
model
.
getCalled
(),
sortParam
,
sortRule
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/AlertCalledServiceImpl.java
View file @
ba76251f
...
...
@@ -10,6 +10,9 @@ import java.util.function.Function;
import
java.util.stream.Collectors
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESOrgUsrDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.ESOrgUsrService
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
...
...
@@ -121,6 +124,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
@Autowired
private
EmqKeeper
emqKeeper
;
@Autowired
ESOrgUsrService
eSOrgUsrService
;
@Value
(
"${mqtt.topic.command.alert.notice}"
)
private
String
topic
;
...
...
@@ -424,6 +430,17 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
* 同步保存ES
*/
eSAlertCalledService
.
saveAlertCalledToES
(
alertCalled
);
// 事发单位保存进ES
if
(!
ValidationUtil
.
isEmpty
(
alertCalled
.
getUnitInvolved
()))
{
OrgUsr
orgUsr
=
new
OrgUsr
();
orgUsr
.
setSequenceNbr
(-
1L
);
orgUsr
.
setBizOrgName
(
alertCalled
.
getUnitInvolved
());
eSOrgUsrService
.
saveAlertCalledToES
(
orgUsr
);
}
}
// toSendCompletePoliceSituationMatch(alertCalled.getSequenceNbr());
return
alertCalledObjsDto
;
...
...
@@ -599,7 +616,11 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
/*
* if(null == valueCode) { valueCode = alertFormValue.getFieldValue(); }
*/
listdate
.
add
(
new
KeyValueLabel
(
alertFormValue
.
getFieldName
(),
alertFormValue
.
getFieldCode
(),
valueCode
));
if
(
"flightNumber"
.
equals
(
alertFormValue
.
getFieldCode
())
||
"aircraftModel"
.
equals
(
alertFormValue
.
getFieldCode
()))
{
listdate
.
add
(
new
KeyValueLabel
(
alertFormValue
.
getFieldName
(),
alertFormValue
.
getFieldCode
(),
alertFormValue
.
getFieldValueCode
()));
}
else
{
listdate
.
add
(
new
KeyValueLabel
(
alertFormValue
.
getFieldName
(),
alertFormValue
.
getFieldCode
(),
valueCode
));
}
});
map
.
put
(
"data"
,
listdate
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/ControllerEquipServiceImpl.java
View file @
ba76251f
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
import
java.util.List
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.yeejoin.amos.boot.module.common.api.feign.JcsControlServerClient
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.ControllerDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.ControllerEquipDto
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Controller
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.ControllerEquip
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.ControllerLog
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.ControllerEquipMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IControllerEquipService
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.ControllerEquipDto
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.ControllerEquip
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.ControllerEquipMapper
;
import
java.util.Date
;
import
java.util.List
;
/**
* <pre>
...
...
@@ -26,10 +32,17 @@ import com.yeejoin.amos.boot.module.jcs.api.mapper.ControllerEquipMapper;
*/
@Service
public
class
ControllerEquipServiceImpl
extends
BaseService
<
ControllerEquipDto
,
ControllerEquip
,
ControllerEquipMapper
>
implements
IControllerEquipService
{
public
static
final
String
CONTROLLER_STATE_CHANGED_TOPIC
=
"controllerStateChanged"
;
@Autowired
JcsControlServerClient
jcsControlServerClient
;
@Autowired
ControllerLogServiceImpl
controllerLogServiceImpl
;
@Autowired
private
EmqKeeper
emqKeeper
;
public
List
<
ControllerEquipDto
>
queryAllForList
()
{
return
this
.
queryForList
(
""
,
false
);
}
...
...
@@ -38,8 +51,10 @@ public class ControllerEquipServiceImpl extends BaseService<ControllerEquipDto,
* 改变警铃状态 0关闭,1开启
*/
@Async
public
void
changeBell
(
Controller
controller
,
String
type
)
{
public
void
changeBell
(
Controller
Dto
controller
,
String
type
)
{
if
(
controller
==
null
)
return
;
controller
.
setState
(
type
);
saveLog
(
controller
);
List
<
ControllerEquip
>
list
=
getControllerEquips
(
controller
);
list
.
forEach
(
controllerEquip
->
jcsControlServerClient
.
sendBellAction
(
controllerEquip
.
getNum
(),
type
));
}
...
...
@@ -48,8 +63,10 @@ public class ControllerEquipServiceImpl extends BaseService<ControllerEquipDto,
* 改变广播状态 0关闭,1开启
*/
@Async
public
void
changeBroadcast
(
Controller
controller
,
String
type
)
{
public
void
changeBroadcast
(
Controller
Dto
controller
,
String
type
)
{
if
(
controller
==
null
)
return
;
controller
.
setState
(
type
);
saveLog
(
controller
);
List
<
ControllerEquip
>
list
=
getControllerEquips
(
controller
);
list
.
forEach
(
controllerEquip
->
jcsControlServerClient
.
sendFileAction
(
controllerEquip
.
getNum
(),
""
));
}
...
...
@@ -58,14 +75,35 @@ public class ControllerEquipServiceImpl extends BaseService<ControllerEquipDto,
* 改变车库门状态 0关闭,1开启
*/
@Async
public
void
changeDoor
(
Controller
controller
,
String
type
)
{
public
void
changeDoor
(
Controller
Dto
controller
,
String
type
)
{
if
(
controller
==
null
)
return
;
controller
.
setState
(
type
);
saveLog
(
controller
);
List
<
ControllerEquip
>
list
=
getControllerEquips
(
controller
);
list
.
forEach
(
controllerEquip
->
jcsControlServerClient
.
writeStateAction
(
controller
.
getIp
(),
controller
.
getPort
(),
Integer
.
parseInt
(
controllerEquip
.
getNum
()),
type
));
}
private
List
<
ControllerEquip
>
getControllerEquips
(
Controller
controller
)
{
private
List
<
ControllerEquip
>
getControllerEquips
(
Controller
Dto
controller
)
{
LambdaQueryWrapper
<
ControllerEquip
>
wrapper
=
new
LambdaQueryWrapper
<
ControllerEquip
>().
eq
(
ControllerEquip:
:
getControllerSeq
,
controller
.
getSequenceNbr
());
return
list
(
wrapper
);
}
/**
* 保存操作日志
*/
private
void
saveLog
(
ControllerDto
controller
)
{
if
(
controller
==
null
)
return
;
ControllerLog
controllerLog
=
new
ControllerLog
();
controllerLog
.
setControllerSeq
(
controller
.
getSequenceNbr
());
controllerLog
.
setState
(
controller
.
getState
());
controllerLog
.
setExecuteDate
(
new
Date
());
controllerLogServiceImpl
.
save
(
controllerLog
);
// 分发状态变更通知
try
{
String
value
=
new
ObjectMapper
().
writeValueAsString
(
controller
);
emqKeeper
.
getMqttClient
().
publish
(
CONTROLLER_STATE_CHANGED_TOPIC
,
value
.
getBytes
(),
2
,
true
);
}
catch
(
MqttException
|
JsonProcessingException
e
)
{
e
.
printStackTrace
();
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/ControllerServiceImpl.java
View file @
ba76251f
This diff is collapsed.
Click to expand it.
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/PowerTransferServiceImpl.java
View file @
ba76251f
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.function.IntFunction
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyCarService
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.
AircraftDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.
*
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.*
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -35,17 +38,6 @@ import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import
com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient
;
import
com.yeejoin.amos.boot.module.common.api.mapper.DynamicFormInstanceMapper
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.DutyCarServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.CarStatusInfoDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PowerCarCountDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PowerCompanyCountDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyResourcesDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferResourceDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferSimpleDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.ResourceStatisticsDto
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.AlertFeedbackStatusEnum
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.DutyInfoEnum
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.FireBrigadeTypeEnum
;
...
...
@@ -424,8 +416,9 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
List
<
AlertFormValue
>
alertFormValue
=
alertCalledObjsDto
.
getAlertFormValue
();
String
responseLevel
=
""
;
List
<
AlertFormValue
>
list1
=
alertFormValue
.
stream
().
filter
(
formValue
->
formValue
.
getFieldCode
().
equals
(
"responseLevel"
)
).
collect
(
Collectors
.
toList
());;
if
(
list1
.
size
()
>
0
)
{
List
<
AlertFormValue
>
list1
=
alertFormValue
.
stream
().
filter
(
formValue
->
formValue
.
getFieldCode
().
equals
(
"responseLevel"
)).
collect
(
Collectors
.
toList
());
;
if
(
list1
.
size
()
>
0
)
{
responseLevel
=
list1
.
get
(
0
).
getFieldValue
();
}
...
...
@@ -483,12 +476,17 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
powerTransferCompanyDto
.
setPowerTransferCompanyResourcesDtoList
(
resourcesDtoList
);
// 更新车辆状态
equipFeignService
.
updateCarStatus
(
carStatusInfoDtoList
);
// 警情力量调派时,点击【任务派发】后,如果被调派的 力量包含消防车,那么该消防车所在的 大队的警铃、广播自动 启动,消防车所在的车库门自动开启
try
{
List
<
Controller
>
controllers
=
controllerServiceImpl
.
list
(
new
LambdaQueryWrapper
<
Controller
>().
eq
(
Controller:
:
getFireTeamSeq
,
powerTransferCompanyDto
.
getCompanyId
()));
if
(
controllers
.
size
()
>
0
)
{
controllerServiceImpl
.
changeControllerState
(
controllers
.
toArray
(
new
Controller
[
0
]));
ControllerDto
[]
controllerDtos
=
new
ControllerDto
[
controllers
.
size
()];
for
(
int
i
=
0
;
i
<
controllers
.
size
();
i
++)
{
ControllerDto
controllerDto
=
new
ControllerDto
();
BeanUtils
.
copyProperties
(
controllers
.
get
(
i
),
controllerDto
);
controllerDtos
[
i
]
=
controllerDto
;
}
controllerServiceImpl
.
changeControllerState
(
controllerDtos
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
...
...
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