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
5be02e21
Commit
5be02e21
authored
Jul 01, 2021
by
fupeiyang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of 172.16.10.76:moa/amos-boot-biz into developer
parents
610db93b
18feca27
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
107 additions
and
56 deletions
+107
-56
application.properties
...boot-jcs-system/src/main/resources/application.properties
+6
-3
AircraftController.java
...os/boot/module/jcs/biz/controller/AircraftController.java
+2
-3
DataDictionaryController.java
...t/module/jcs/biz/controller/DataDictionaryController.java
+32
-6
WaterResourceController.java
...ot/module/jcs/biz/controller/WaterResourceController.java
+1
-1
AircraftServiceImpl.java
...boot/module/jcs/biz/service/impl/AircraftServiceImpl.java
+20
-16
AlertSubmittedServiceImpl.java
...odule/jcs/biz/service/impl/AlertSubmittedServiceImpl.java
+14
-0
PowerTransferServiceImpl.java
...module/jcs/biz/service/impl/PowerTransferServiceImpl.java
+32
-27
No files found.
amos-boot-jcs-system/src/main/resources/application.properties
View file @
5be02e21
spring.application.name
=
JCS
spring.application.name
=
JCS
-tb
server.servlet.context-path
=
/jcs
server.port
=
11100
spring.profiles.active
=
dev
...
...
@@ -21,4 +21,7 @@ spring.datasource.hikari.idle-timeout=30000
spring.datasource.hikari.pool-name
=
DatebookHikariCP
spring.datasource.hikari.max-lifetime
=
120000
spring.datasource.hikari.connection-timeout
=
30000
spring.datasource.hikari.connection-test-query
=
SELECT 1
\ No newline at end of file
spring.datasource.hikari.connection-test-query
=
SELECT 1
#mqtt-警情初报消息主题
mqtt.topic.alert.reporting
=
alertReporting
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/AircraftController.java
View file @
5be02e21
...
...
@@ -74,10 +74,9 @@ public class AircraftController extends BaseController {
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/
{ids}
"
)
@DeleteMapping
(
value
=
"/
batch
"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据物理主键批量删除航空器信息"
,
notes
=
"根据物理主键批量删除航空器信息"
)
public
ResponseModel
<
List
<
Long
>>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"ids"
)
String
ids
)
throws
Exception
{
public
ResponseModel
<
List
<
Long
>>
deleteBySequenceNbr
(
@RequestParam
(
value
=
"ids"
)
String
ids
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
aircraftServiceImpl
.
multDeleteAircraft
(
RequestContext
.
getAgencyCode
(),
ids
));
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/DataDictionaryController.java
View file @
5be02e21
...
...
@@ -5,25 +5,31 @@ 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.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.*
;
import
com.yeejoin.amos.boot.biz.common.utils.Menu
;
import
com.yeejoin.amos.boot.biz.common.utils.MenuFrom
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.TreeParser
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.DataDictionary
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormVo
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.DataDictionaryServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.ecCVCDSA
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.PathVariable
;
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.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.HashMap
;
...
...
@@ -167,6 +173,26 @@ public class DataDictionaryController extends BaseController {
return
ResponseHelper
.
buildResponse
(
menus
);
}
}
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/dataDictionary"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据字典类型查询字典2"
,
notes
=
"根据字典类型查询字典2"
)
public
ResponseModel
<
Object
>
getDictionary
(
@RequestParam
String
type
)
throws
Exception
{
QueryWrapper
<
DataDictionary
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"type"
,
type
);
queryWrapper
.
orderByAsc
(
"sort_num"
);
if
(
redisUtils
.
hasKey
(
RedisKey
.
DATA_DICTIONARY_CODE
+
type
))
{
Object
obj
=
redisUtils
.
get
(
RedisKey
.
DATA_DICTIONARY_CODE
+
type
);
return
ResponseHelper
.
buildResponse
(
obj
);
}
else
{
Collection
<
DataDictionary
>
list
=
iDataDictionaryService
.
list
(
queryWrapper
);
List
<
Menu
>
menus
=
TreeParser
.
getTree
(
null
,
list
,
DataDictionary
.
class
.
getName
(),
"getCode"
,
0
,
"getName"
,
"getParent"
);
redisUtils
.
set
(
RedisKey
.
DATA_DICTIONARY_CODE
+
type
,
JSON
.
toJSON
(
menus
),
time
);
return
ResponseHelper
.
buildResponse
(
menus
);
}
}
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/gwmcDataDictionary/FireChemical/{type}"
,
method
=
RequestMethod
.
GET
)
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/WaterResourceController.java
View file @
5be02e21
...
...
@@ -245,7 +245,7 @@ public class WaterResourceController extends BaseController {
WaterResourceDto
waterResourceDto
=
waterResourceServiceImpl
.
queryBySeq
(
sequenceNbr
);
waterResourceDto
.
setRealityImgList
(
StringUtils
.
isEmpty
(
waterResourceDto
.
getRealityImg
())
?
null
:
JSONArray
.
fromObject
(
waterResourceDto
.
getRealityImg
()));
waterResourceDto
.
setOrientationImgList
(
StringUtils
.
isEmpty
(
waterResourceDto
.
get
Orientation
Img
())
?
null
:
waterResourceDto
.
setOrientationImgList
(
StringUtils
.
isEmpty
(
waterResourceDto
.
get
Reality
Img
())
?
null
:
JSONArray
.
fromObject
(
waterResourceDto
.
getOrientationImg
()));
// 查询属性信息
String
resourceType
=
waterResourceDto
.
getResourceType
();
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/AircraftServiceImpl.java
View file @
5be02e21
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.StringUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.DataNotFound
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft
;
...
...
@@ -22,6 +9,21 @@ import com.yeejoin.amos.boot.module.jcs.api.service.IAircraftService;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.FileInfoModel
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.StringUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.annotation.Condition
;
import
org.typroject.tyboot.core.rdbms.annotation.Operator
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.DataNotFound
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* 航空器信息服务实现类
...
...
@@ -64,9 +66,9 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc
*/
public
AircraftDto
updateAircraft
(
String
agencyCode
,
AircraftDto
model
)
throws
Exception
{
AircraftDto
oldModel
=
this
.
queryBySeq
(
model
.
getSequenceNbr
());
if
(
ValidationUtil
.
isEmpty
(
oldModel
))
if
(
ValidationUtil
.
isEmpty
(
oldModel
))
{
throw
new
DataNotFound
(
"找不到指定的航空器信息."
);
}
//删除附件信息
Systemctl
.
fileInfoClient
.
deleteByAlias
(
agencyCode
,
Aircraft
.
class
.
getSimpleName
(),
String
.
valueOf
(
model
.
getSequenceNbr
()),
null
);
...
...
@@ -136,7 +138,9 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc
* @param page
* @return
*/
public
Page
<
AircraftDto
>
queryForAircraftPage
(
Page
<
AircraftDto
>
page
,
Boolean
isDelete
,
String
aircraftModel
,
public
Page
<
AircraftDto
>
queryForAircraftPage
(
Page
<
AircraftDto
>
page
,
Boolean
isDelete
,
@Condition
(
Operator
.
like
)
String
aircraftModel
,
String
engineType
,
String
fuelType
)
{
return
this
.
queryForPage
(
page
,
null
,
false
,
isDelete
,
aircraftModel
,
engineType
,
fuelType
);
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/AlertSubmittedServiceImpl.java
View file @
5be02e21
...
...
@@ -31,12 +31,16 @@ import com.yeejoin.amos.boot.module.jcs.api.vo.PowerTransferCompanyVo;
import
com.yeejoin.amos.boot.module.jcs.api.vo.SchedulingReportingVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.TemplateVo
;
import
com.yeejoin.amos.boot.module.jcs.biz.rule.action.AlertCalledAction
;
import
com.yeejoin.amos.component.rule.config.ClazzUtils
;
import
com.yeejoin.amos.component.rule.config.RuleConfig
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.StringUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
...
...
@@ -82,6 +86,12 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
@Autowired
private
RedisUtils
redisUtils
;
@Autowired
private
EmqKeeper
emqKeeper
;
@Value
(
"${mqtt.topic.alert.reporting}"
)
private
String
topic
;
@Override
public
SchedulingReportingVo
listSchedulingByParam
(
AlertSubmittedDto
queryParam
)
{
SchedulingReportingVo
schedulingReportingVo
=
new
SchedulingReportingVo
();
...
...
@@ -153,11 +163,13 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
Set
<
String
>
mobiles
=
new
HashSet
<>();
HashMap
<
String
,
String
>
smsParams
=
new
HashMap
<>();
String
alertCalledId
=
null
;
// 根据id列表查询所有人员信息
List
<
Long
>
ids
=
StringUtil
.
String2LongList
(
sendIds
);
if
(
object
instanceof
AlertCalledRo
)
{
AlertCalledRo
calledRo
=
(
AlertCalledRo
)
object
;
String
alertSubmittedId
=
calledRo
.
getAlertSubmittedId
();
alertCalledId
=
calledRo
.
getSequenceNbr
();
// 警情初报
if
(
alertSubmittedId
==
null
)
{
...
...
@@ -223,6 +235,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 组织短信内容
// 调用短信发送接口
alertCalledAction
.
sendAlertCalleCmd
(
smsCode
,
mobiles
,
smsParams
);
emqKeeper
.
getMqttClient
().
publish
(
topic
,
alertCalledId
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
}
/**
...
...
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 @
5be02e21
...
...
@@ -29,6 +29,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
...
...
@@ -121,17 +122,19 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
ResponseModel
<
Object
>
result
=
equipFeignService
.
getFireCarListAll
();
if
(!
ObjectUtils
.
isEmpty
(
result
))
{
List
<
Map
<
String
,
Object
>>
fireCarListMapList
=
(
List
<
Map
<
String
,
Object
>>)
result
.
getResult
();
fireCarListMapList
.
stream
().
filter
(
car
->
ObjectUtils
.
isNotEmpty
(
car
.
get
(
"teamId"
))).
forEach
(
car
->
{
FireBrigadeResourceDto
fireCarDto
=
(
FireBrigadeResourceDto
)
Bean
.
mapToBean
(
car
,
FireBrigadeResourceDto
.
class
);
// TODO 后期根据车物联状态来返回,现在为"在位=执勤","其他=出动"
if
(
FireCarStatusEnum
.
onDuty
.
getCode
().
equals
(
fireCarDto
.
getCarState
()))
{
fireCarDto
.
setCarStateDesc
(
FireCarStatusEnum
.
onDuty
.
getName
());
}
else
{
fireCarDto
.
setCarState
(
FireCarStatusEnum
.
out
.
getCode
());
fireCarDto
.
setCarStateDesc
(
FireCarStatusEnum
.
out
.
getName
());
}
fireCarDtoList
.
add
(
fireCarDto
);
});
if
(!
ValidationUtil
.
isEmpty
(
fireCarListMapList
))
{
fireCarListMapList
.
stream
().
filter
(
car
->
ObjectUtils
.
isNotEmpty
(
car
.
get
(
"teamId"
))).
forEach
(
car
->
{
FireBrigadeResourceDto
fireCarDto
=
(
FireBrigadeResourceDto
)
Bean
.
mapToBean
(
car
,
FireBrigadeResourceDto
.
class
);
// TODO 后期根据车物联状态来返回,现在为"在位=执勤","其他=出动"
if
(
FireCarStatusEnum
.
onDuty
.
getCode
().
equals
(
fireCarDto
.
getCarState
()))
{
fireCarDto
.
setCarStateDesc
(
FireCarStatusEnum
.
onDuty
.
getName
());
}
else
{
fireCarDto
.
setCarState
(
FireCarStatusEnum
.
out
.
getCode
());
fireCarDto
.
setCarStateDesc
(
FireCarStatusEnum
.
out
.
getName
());
}
fireCarDtoList
.
add
(
fireCarDto
);
});
}
}
// 2.查询消防队伍列表
...
...
@@ -140,22 +143,24 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
if
(!
CollectionUtils
.
isEmpty
(
fullTimeFireBrigadeList
))
{
Map
<
String
,
List
<
FireBrigadeResourceDto
>>
resultMap
=
fireCarDtoList
.
stream
().
collect
(
Collectors
.
groupingBy
(
FireBrigadeResourceDto:
:
getTeamId
));
fullTimeFireBrigadeList
.
forEach
(
brigade
->
{
if
(!
CollectionUtils
.
isEmpty
(
resultMap
.
get
(
brigade
.
getSequenceNbr
().
toString
())))
{
FireBrigadeResourceDto
fireCarResourceDto
=
new
FireBrigadeResourceDto
();
List
<
FireBrigadeResourceDto
>
fireBrigadeResourceDtoList
=
resultMap
.
get
(
brigade
.
getSequenceNbr
().
toString
());
long
onDutyCarCount
=
fireBrigadeResourceDtoList
.
stream
().
filter
(
car
->
FireCarStatusEnum
.
onDuty
.
getCode
().
equals
(
car
.
getCarState
())).
count
();
long
outCarCount
=
fireBrigadeResourceDtoList
.
size
()
-
onDutyCarCount
;
fireCarResourceDto
.
setId
(
brigade
.
getSequenceNbr
().
toString
());
fireCarResourceDto
.
setType
(
FireBrigadeTypeEnum
.
专职消防队
.
getKey
());
fireCarResourceDto
.
setName
(
brigade
.
getName
());
fireCarResourceDto
.
getChildren
().
addAll
(
fireBrigadeResourceDtoList
);
fireCarResourceDto
.
setOutCount
((
int
)
outCarCount
);
fireCarResourceDto
.
setOnDutyCount
((
int
)
onDutyCarCount
);
fireBrigadeResourceList
.
add
(
fireCarResourceDto
);
}
});
if
(!
ValidationUtil
.
isEmpty
(
fullTimeFireBrigadeList
))
{
fullTimeFireBrigadeList
.
forEach
(
brigade
->
{
if
(!
CollectionUtils
.
isEmpty
(
resultMap
.
get
(
brigade
.
getSequenceNbr
().
toString
())))
{
FireBrigadeResourceDto
fireCarResourceDto
=
new
FireBrigadeResourceDto
();
List
<
FireBrigadeResourceDto
>
fireBrigadeResourceDtoList
=
resultMap
.
get
(
brigade
.
getSequenceNbr
().
toString
());
long
onDutyCarCount
=
fireBrigadeResourceDtoList
.
stream
().
filter
(
car
->
FireCarStatusEnum
.
onDuty
.
getCode
().
equals
(
car
.
getCarState
())).
count
();
long
outCarCount
=
fireBrigadeResourceDtoList
.
size
()
-
onDutyCarCount
;
fireCarResourceDto
.
setId
(
brigade
.
getSequenceNbr
().
toString
());
fireCarResourceDto
.
setType
(
FireBrigadeTypeEnum
.
专职消防队
.
getKey
());
fireCarResourceDto
.
setName
(
brigade
.
getName
());
fireCarResourceDto
.
getChildren
().
addAll
(
fireBrigadeResourceDtoList
);
fireCarResourceDto
.
setOutCount
((
int
)
outCarCount
);
fireCarResourceDto
.
setOnDutyCount
((
int
)
onDutyCarCount
);
fireBrigadeResourceList
.
add
(
fireCarResourceDto
);
}
});
}
}
// 3.消防队伍-监控大队
...
...
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