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
be46a8ae
Commit
be46a8ae
authored
Nov 04, 2021
by
kongfm
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
0ec49a2c
2220b979
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
777 additions
and
235 deletions
+777
-235
ExecuteTypeEnum.java
...ejoin/amos/latentdanger/common/enums/ExecuteTypeEnum.java
+9
-0
PointClassify.java
...ava/com/yeejoin/amos/patrol/dao/entity/PointClassify.java
+128
-0
AlertCalledController.java
...boot/module/jcs/biz/controller/AlertCalledController.java
+1
-1
LatentDangerServiceImpl.java
...danger/business/service/impl/LatentDangerServiceImpl.java
+1
-1
AsyncTask.java
...a/com/yeejoin/amos/latentdanger/core/async/AsyncTask.java
+9
-11
PushMsgParam.java
...yeejoin/amos/maintenance/business/param/PushMsgParam.java
+4
-49
MessageServiceImpl.java
...maintenance/business/service/impl/MessageServiceImpl.java
+4
-2
PushFeignServer.java
...a/com/yeejoin/amos/maintenance/feign/PushFeignServer.java
+33
-39
InputItemMapper.java
...join/amos/patrol/business/dao/mapper/InputItemMapper.java
+1
-1
IPointClassifyDao.java
...mos/patrol/business/dao/repository/IPointClassifyDao.java
+19
-1
PointClassifySynDto.java
...yeejoin/amos/patrol/business/dto/PointClassifySynDto.java
+47
-0
CheckServiceImpl.java
...n/amos/patrol/business/service/impl/CheckServiceImpl.java
+26
-26
PlanTaskServiceImpl.java
...mos/patrol/business/service/impl/PlanTaskServiceImpl.java
+3
-2
PointServiceImpl.java
...n/amos/patrol/business/service/impl/PointServiceImpl.java
+66
-2
IPointService.java
...oin/amos/patrol/business/service/intfc/IPointService.java
+3
-0
PointInputItemNewVo.java
.../yeejoin/amos/patrol/business/vo/PointInputItemNewVo.java
+77
-0
PushFeignServer.java
...n/java/com/yeejoin/amos/patrol/feign/PushFeignServer.java
+5
-32
PatrolMqttListener.java
...java/com/yeejoin/amos/patrol/mqtt/PatrolMqttListener.java
+41
-0
PushMsgParam.java
...yeejoin/amos/supervision/business/param/PushMsgParam.java
+5
-0
MessageServiceImpl.java
...supervision/business/service/impl/MessageServiceImpl.java
+4
-2
PushFeignServer.java
...a/com/yeejoin/amos/supervision/feign/PushFeignServer.java
+33
-39
jcs-1.0.0.0.xml
...ystem-jcs/src/main/resources/db/changelog/jcs-1.0.0.0.xml
+49
-2
PatrolApplication.java
...rol/src/main/java/com/yeejoin/amos/PatrolApplication.java
+29
-0
application.properties
...t-system-patrol/src/main/resources/application.properties
+3
-1
patrol-3.0.1.xml
...m-patrol/src/main/resources/db/changelog/patrol-3.0.1.xml
+118
-0
dbTemplate_check.xml
...-patrol/src/main/resources/db/mapper/dbTemplate_check.xml
+9
-0
dbTemplate_input_item.xml
...ol/src/main/resources/db/mapper/dbTemplate_input_item.xml
+3
-2
pointMapper.xml
...ystem-patrol/src/main/resources/db/mapper/pointMapper.xml
+47
-22
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-latentdanger-api/src/main/java/com/yeejoin/amos/latentdanger/common/enums/ExecuteTypeEnum.java
View file @
be46a8ae
...
...
@@ -66,4 +66,13 @@ public enum ExecuteTypeEnum {
}
return
null
;
}
public
static
String
getNameByCode
(
Integer
code
)
{
for
(
ExecuteTypeEnum
e
:
ExecuteTypeEnum
.
values
())
{
if
(
code
.
equals
(
e
.
getCode
()))
{
return
e
.
getName
();
}
}
return
null
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-patrol-api/src/main/java/com/yeejoin/amos/patrol/dao/entity/PointClassify.java
View file @
be46a8ae
...
...
@@ -56,6 +56,61 @@ public class PointClassify extends BasicEntity{
@Column
(
name
=
"inspection_spec_name"
)
private
String
inspectionSpecName
;
/**
* 编号
*/
@Column
(
name
=
"code"
)
private
String
code
;
/**
* 分类名称
*/
@Column
(
name
=
"category_name"
)
private
String
categoryName
;
/**
* 分类id
*/
@Column
(
name
=
"category_code"
)
private
String
categoryCode
;
/**
* 位置
*/
@Column
(
name
=
"address"
)
private
String
address
;
/**
* 数据源code(1 消防装备 2 重点部位 3 自定义)
*/
@Column
(
name
=
"data_source_code"
)
private
String
dataSourceCode
;
/**
* 数据源名称(冗余)
*/
@Column
(
name
=
"data_source_name"
)
private
String
dataSourceName
;
/**
* 是否删除( 0未删除,1已删除 )
*/
@Column
(
name
=
"is_delete"
)
private
byte
isDelete
;
/**
* 建筑id
*/
@Column
(
name
=
"building_id"
)
private
String
buildingId
;
/**
* 建筑名称
*/
@Column
(
name
=
"building_name"
)
private
String
buildingName
;
public
String
getEquipmentId
()
{
return
equipmentId
;
}
...
...
@@ -115,4 +170,76 @@ public class PointClassify extends BasicEntity{
public
void
setOriginalId
(
String
originalId
)
{
this
.
originalId
=
originalId
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getCategoryName
()
{
return
categoryName
;
}
public
void
setCategoryName
(
String
categoryName
)
{
this
.
categoryName
=
categoryName
;
}
public
String
getAddress
()
{
return
address
;
}
public
void
setAddress
(
String
address
)
{
this
.
address
=
address
;
}
public
String
getDataSourceCode
()
{
return
dataSourceCode
;
}
public
void
setDataSourceCode
(
String
dataSourceCode
)
{
this
.
dataSourceCode
=
dataSourceCode
;
}
public
String
getDataSourceName
()
{
return
dataSourceName
;
}
public
void
setDataSourceName
(
String
dataSourceName
)
{
this
.
dataSourceName
=
dataSourceName
;
}
public
byte
getIsDelete
()
{
return
isDelete
;
}
public
void
setIsDelete
(
byte
isDelete
)
{
this
.
isDelete
=
isDelete
;
}
public
String
getBuildingId
()
{
return
buildingId
;
}
public
void
setBuildingId
(
String
buildingId
)
{
this
.
buildingId
=
buildingId
;
}
public
String
getBuildingName
()
{
return
buildingName
;
}
public
void
setBuildingName
(
String
buildingName
)
{
this
.
buildingName
=
buildingName
;
}
public
String
getCategoryCode
()
{
return
categoryCode
;
}
public
void
setCategoryCode
(
String
categoryCode
)
{
this
.
categoryCode
=
categoryCode
;
}
}
\ 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/AlertCalledController.java
View file @
be46a8ae
...
...
@@ -168,7 +168,7 @@ public class AlertCalledController extends BaseController {
* @return
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{id}"
)
@GetMapping
(
value
=
"/
find/
{id}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
public
ResponseModel
<
Object
>
selectById
(
@PathVariable
Long
id
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-latentdanger-biz/src/main/java/com/yeejoin/amos/latentdanger/business/service/impl/LatentDangerServiceImpl.java
View file @
be46a8ae
...
...
@@ -2080,7 +2080,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
throw
new
Exception
(
executeSubmitDto
.
getMsg
());
}
List
<
String
>
userIds
=
workflowExecuteService
.
getUserIdsByWorkflow
(
latentDanger
.
getInstanceId
(),
executeSubmitDto
.
getCheckLeaderId
());
asyncTask
.
sendDangerSubmitMsg
(
RequestContext
.
cloneRequestContext
(),
latentDanger
,
userIds
);
asyncTask
.
sendDangerSubmitMsg
(
RequestContext
.
cloneRequestContext
(),
latentDanger
,
userIds
,
ExecuteTypeEnum
.
getNameByCode
(
executeType
)
);
return
executeSubmitDto
;
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-latentdanger-biz/src/main/java/com/yeejoin/amos/latentdanger/core/async/AsyncTask.java
View file @
be46a8ae
...
...
@@ -27,11 +27,7 @@ import org.typroject.tyboot.core.foundation.context.RequestContext;
import
org.typroject.tyboot.core.foundation.context.RequestContextModel
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.util.Date
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -167,8 +163,8 @@ public class AsyncTask {
RequestContext
.
setProduct
(
requestContextModel
.
getProduct
());
RequestContext
.
setAppKey
(
requestContextModel
.
getAppKey
());
MessageModel
model
=
new
MessageModel
();
String
body
=
String
.
format
(
"隐患名称:%s;隐患级别:%s;治理方式:%s;推送时间:%s"
,
latentDanger
.
getDangerName
(),
latentDanger
.
getDangerLevelName
(),
latentDanger
.
getReformTypeName
(),
DateUtil
.
date2LongStr
(
new
Date
()));
String
body
=
String
.
format
(
"隐患名称:%s;隐患级别:%s;治理方式:%s;
当前状态:%s;
推送时间:%s"
,
latentDanger
.
getDangerName
(),
latentDanger
.
getDangerLevelName
(),
latentDanger
.
getReformTypeName
(),
latentDanger
.
getDangerStateName
(),
DateUtil
.
date2LongStr
(
new
Date
()));
model
.
setBody
(
body
);
getMessageModel
(
model
,
latentDanger
);
try
{
...
...
@@ -188,13 +184,13 @@ public class AsyncTask {
* 确认隐患发送消息
*/
@Async
public
void
sendDangerSubmitMsg
(
RequestContextModel
requestContextModel
,
LatentDanger
latentDanger
,
List
<
String
>
userIds
){
public
void
sendDangerSubmitMsg
(
RequestContextModel
requestContextModel
,
LatentDanger
latentDanger
,
List
<
String
>
userIds
,
String
executeName
){
RequestContext
.
setToken
(
requestContextModel
.
getToken
());
RequestContext
.
setProduct
(
requestContextModel
.
getProduct
());
RequestContext
.
setAppKey
(
requestContextModel
.
getAppKey
());
MessageModel
model
=
new
MessageModel
();
String
body
=
String
.
format
(
"隐患名称:%s;隐患级别:%s;治理方式:%s;推送时间:%s"
,
latentDanger
.
getDangerName
(),
latentDanger
.
getDangerLevelName
(),
latentDanger
.
getReformTypeName
(),
DateUtil
.
date2LongStr
(
new
Date
()));
String
body
=
String
.
format
(
"隐患名称:%s;隐患级别:%s;治理方式:%s;
当前状态:%s;审核结果:%s;
推送时间:%s"
,
latentDanger
.
getDangerName
(),
latentDanger
.
getDangerLevelName
(),
latentDanger
.
getReformTypeName
(),
latentDanger
.
getDangerStateName
(),
executeName
,
DateUtil
.
date2LongStr
(
new
Date
()));
model
.
setBody
(
body
);
model
.
setIsSendWeb
(
true
);
model
.
setRecivers
(
userIds
);
...
...
@@ -219,7 +215,9 @@ public class AsyncTask {
}
}
if
(!
ValidationUtil
.
isEmpty
(
type
)){
model
.
getExtras
().
put
(
"type"
,
type
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"type"
,
type
);
model
.
setExtras
(
map
);
}
model
.
setTitle
(
latentDanger
.
getDangerName
());
model
.
setIsSendApp
(
true
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/param/PushMsgParam.java
View file @
be46a8ae
...
...
@@ -3,6 +3,8 @@ package com.yeejoin.amos.maintenance.business.param;
import
java.util.List
;
import
java.util.Map
;
import
lombok.Data
;
@Data
public
class
PushMsgParam
{
...
...
@@ -41,54 +43,7 @@ public class PushMsgParam {
* jpush发送类型:1:广播;2:标签;3:别名
*/
private
String
type
=
"3"
;
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getContent
()
{
return
content
;
}
public
void
setContent
(
String
content
)
{
this
.
content
=
content
;
}
public
List
<
String
>
getRecivers
()
{
return
recivers
;
}
public
void
setRecivers
(
List
<
String
>
recivers
)
{
this
.
recivers
=
recivers
;
}
public
Map
<
String
,
String
>
getExtras
()
{
return
extras
;
}
public
void
setExtras
(
Map
<
String
,
String
>
extras
)
{
this
.
extras
=
extras
;
}
public
String
getSubject
()
{
return
subject
;
}
public
void
setSubject
(
String
subject
)
{
this
.
subject
=
subject
;
}
public
String
[]
getEmails
()
{
return
emails
;
}
public
void
setEmails
(
String
[]
emails
)
{
this
.
emails
=
emails
;
}
private
String
relationId
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/impl/MessageServiceImpl.java
View file @
be46a8ae
...
...
@@ -233,9 +233,10 @@ public class MessageServiceImpl implements IMessageService {
extras
.
put
(
"type"
,
MsgTypeEnum
.
CHECK
.
getCode
());
extras
.
put
(
"id"
,
checkMsgBo
.
getCheckId
()+
""
);
pushMsgParam
.
setExtras
(
extras
);
pushMsgParam
.
setRelationId
(
String
.
valueOf
(
checkMsgBo
.
getCheckId
()));
pmps
.
add
(
pushMsgParam
);
List
<
Msg
>
msgList
=
createMsg
(
jpushUser
,
checkMsgBo
);
pushFeignServer
.
sendMessage
(
toke
,
product
,
appKey
,
pmps
);
pushFeignServer
.
sendMessage
(
pmps
);
}
}
...
...
@@ -312,10 +313,11 @@ public class MessageServiceImpl implements IMessageService {
extras
.
put
(
"type"
,
msg
.
getMsgType
());
extras
.
put
(
"id"
,
msg
.
getRelationId
()==
null
?
"0"
:
msg
.
getRelationId
().
toString
());
pushMsg
.
setExtras
(
extras
);
pushMsg
.
setRelationId
(
msg
.
getRelationId
()==
null
?
"0"
:
msg
.
getRelationId
().
toString
());
pmps
.
add
(
pushMsg
);
msg
.
setSendTime
(
new
Date
());
msg
.
setStatus
(
1
);
pushFeignServer
.
sendMessage
(
toke
,
product
,
appKey
,
pmps
);
pushFeignServer
.
sendMessage
(
pmps
);
iMsgDao
.
save
(
msg
);
return
msg
;
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/feign/PushFeignServer.java
View file @
be46a8ae
...
...
@@ -2,49 +2,43 @@ package com.yeejoin.amos.maintenance.feign;
import
java.util.List
;
import
com.yeejoin.amos.maintenance.business.util.CommonResponse
;
import
com.yeejoin.amos.maintenance.business.util.CommonResponseUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.MediaType
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.client.RestTemplate
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.MessageModel
;
import
com.yeejoin.amos.maintenance.business.param.PushMsgParam
;
@Service
(
"pushFeignServer"
)
public
class
PushFeignServer
{
@Autowired
private
RestTemplate
restTemplate
;
@Value
(
"${Push.fegin.name}"
)
private
String
RPushFeginName
;
private
static
String
sendMessage
=
"/api/user/sendMessage"
;
public
String
geturls
(
String
url
){
return
"http://"
+
RPushFeginName
+
url
;
}
public
HttpHeaders
getHeader
(
String
toke
,
String
product
,
String
appKey
){
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
MediaType
.
APPLICATION_JSON
);
headers
.
set
(
"Content-Type"
,
"application/json"
);
headers
.
set
(
"token"
,
toke
);
headers
.
set
(
"product"
,
product
);
headers
.
set
(
"appKey"
,
appKey
);
return
headers
;
}
public
CommonResponse
sendMessage
(
String
toke
,
String
product
,
String
appKey
,
List
<
PushMsgParam
>
pushMsgParam
){
try
{
HttpEntity
httpEntity
=
new
HttpEntity
<>(
pushMsgParam
,
getHeader
(
toke
,
product
,
appKey
));
CommonResponse
commonResponse1
=
restTemplate
.
postForObject
(
geturls
(
sendMessage
),
httpEntity
,
CommonResponse
.
class
);
return
commonResponse1
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
CommonResponseUtil
.
failure
(
"发送失败"
);
}
}
public
void
sendMessage
(
List
<
PushMsgParam
>
pushMsgParam
){
try
{
pushMsgParam
.
forEach
(
action
->{
sendJP
(
action
);
})
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
public
void
sendMessage
(
PushMsgParam
pushMsgParam
){
try
{
sendJP
(
pushMsgParam
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
private
void
sendJP
(
PushMsgParam
pushMsgParam
){
MessageModel
model
=
new
MessageModel
();
model
.
setRelationId
(
pushMsgParam
.
getRelationId
());
model
.
setTitle
(
pushMsgParam
.
getSubject
(
));
model
.
setBody
(
pushMsgParam
.
getContent
()
);
model
.
setMsgType
(
"maintenance"
)
;
model
.
setIsSendApp
(
true
);
model
.
setIsSendWeb
(
true
);
model
.
setRecivers
(
pushMsgParam
.
getRecivers
()
);
model
.
setExtras
(
pushMsgParam
.
getExtras
());
Systemctl
.
messageClient
.
create
(
model
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/dao/mapper/InputItemMapper.java
View file @
be46a8ae
...
...
@@ -30,7 +30,7 @@ public interface InputItemMapper extends BaseMapper {
public
List
<
InputItemVo
>
getInputItemListByitemNos
(
@Param
(
"itemNos"
)
String
[]
itemNos
);
public
List
<
PointInputItemVo
>
queryCustomInputItemByPointId
(
@Param
(
"
pointId"
)
Long
pointId
,
@Param
(
"equipmentId"
)
String
equipmentName
);
public
List
<
PointInputItemVo
>
queryCustomInputItemByPointId
(
@Param
(
"
classifyId"
)
String
classifyId
);
public
PointInputItemVo
getInputItemByEquipmentName
(
@Param
(
"equipmentName"
)
String
equipmentName
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/dao/repository/IPointClassifyDao.java
View file @
be46a8ae
...
...
@@ -14,7 +14,7 @@ public interface IPointClassifyDao extends BaseDao<PointClassify, Long> {
@Modifying
@Transactional
@Query
(
value
=
"select * from p_point_classify where point_id = ?1"
,
nativeQuery
=
true
)
@Query
(
value
=
"select * from p_point_classify where point_id = ?1
and is_delete = 0
"
,
nativeQuery
=
true
)
List
<
PointClassify
>
getPointClassifyByPointId
(
long
id
);
@Modifying
...
...
@@ -27,5 +27,23 @@ public interface IPointClassifyDao extends BaseDao<PointClassify, Long> {
@Query
(
value
=
"delete from p_point_classify where point_id in (?1)"
,
nativeQuery
=
true
)
void
deleteByPointId
(
List
<
Long
>
pointIds
);
/**
* 根据原始id逻辑删除
* @param id 原始id
*/
@Modifying
@Transactional
@Query
(
value
=
"UPDATE p_point_classify SET is_delete = 1 WHERE original_id = (?1)"
,
nativeQuery
=
true
)
void
deleteByOriginalId
(
String
id
);
/**
* 根据原始id查询
* @param id 原始id
* @return List<PointClassify> 返回
*/
@Query
(
value
=
"select * from p_point_classify WHERE original_id = (?1) and is_delete =0"
,
nativeQuery
=
true
)
List
<
PointClassify
>
selectByOriginalId
(
String
id
);
PointClassify
findByOriginalId
(
String
originalId
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/dto/PointClassifySynDto.java
0 → 100644
View file @
be46a8ae
package
com
.
yeejoin
.
amos
.
patrol
.
business
.
dto
;
import
lombok.Data
;
/**
* @author DELL
*/
@Data
public
class
PointClassifySynDto
{
/**
* 原始数据id
*/
private
String
originalId
;
/**
* 原始数据name
*/
private
String
name
;
/**
* 编号
*/
private
String
code
;
/**
* 分类
*/
private
String
categoryName
;
/**
* 分类code
*/
private
String
categoryCode
;
/**
* 位置
*/
private
String
address
;
/**
* 建筑id
*/
private
String
buildingId
;
/**
* 建筑名称
*/
private
String
buildingName
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/CheckServiceImpl.java
View file @
be46a8ae
...
...
@@ -1134,32 +1134,32 @@ public class CheckServiceImpl implements ICheckService {
e
.
put
(
"photoData"
,
photoList
);
});
equip
.
put
(
"equipIputLsit"
,
inputContent
);
LinkedHashMap
<
String
,
Object
>
jsonObject
=
equipment
.
getEquipDetail
(
Long
.
parseLong
(
equip
.
get
(
"equipmentId"
).
toString
()));
LinkedHashMap
<
String
,
Object
>
result
=
(
LinkedHashMap
<
String
,
Object
>)
jsonObject
.
get
(
"result"
);
if
(
result
!=
null
){
if
(
result
.
get
(
"sourceName"
)!=
null
){
equip
.
put
(
"arec"
,
result
.
get
(
"sourceName"
).
toString
());
}
else
{
equip
.
put
(
"arec"
,
""
);
}
if
(
result
.
get
(
"categoryName"
)!=
null
){
equip
.
put
(
"equipType"
,
result
.
get
(
"categoryName"
).
toString
());
}
else
{
equip
.
put
(
"equipType"
,
""
);
}
if
(
result
.
get
(
"fullName"
)!=
null
){
if
(
result
.
get
(
"area"
)!=
null
){
equip
.
put
(
"area"
,
result
.
get
(
"fullName"
).
toString
()+
result
.
get
(
"area"
));
}
else
{
equip
.
put
(
"area"
,
result
.
get
(
"fullName"
).
toString
());
}
}
else
{
equip
.
put
(
"area"
,
""
);
}
equip
.
put
(
"place"
,
result
.
get
(
"warehouseStructureName"
));
}
//
LinkedHashMap<String,Object> jsonObject = equipment.getEquipDetail(Long.parseLong(equip.get("equipmentId").toString()));
//
LinkedHashMap<String,Object> result = (LinkedHashMap<String, Object>) jsonObject.get("result");
//
if(result!=null){
//
if(result.get("sourceName")!=null){
//
equip.put("arec",result.get("sourceName").toString());
//
}else{
//
equip.put("arec","");
//
}
//
if(result.get("categoryName")!=null){
//
equip.put("equipType",result.get("categoryName").toString());
//
}else{
//
equip.put("equipType","");
//
}
//
if(result.get("fullName")!=null){
//
if(result.get("area")!=null){
//
equip.put("area",result.get("fullName").toString()+result.get("area"));
//
}else {
//
equip.put("area",result.get("fullName").toString());
//
}
//
//
}else{
//
equip.put("area","");
//
}
//
//
equip.put("place", result.get("warehouseStructureName"));
//
}
});
return
equipList
;
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/PlanTaskServiceImpl.java
View file @
be46a8ae
...
...
@@ -781,9 +781,10 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
userNames
.
clear
();
String
[]
userIds1
=
e
.
get
(
"userId"
).
toString
().
split
(
","
);
for
(
String
userId
:
userIds1
)
{
userNames
.
add
(
userModelMap
.
get
(
userId
));
if
(!
ObjectUtils
.
isEmpty
(
userModelMap
.
get
(
userId
)))
{
userNames
.
add
(
userModelMap
.
get
(
userId
));
}
}
userNames
.
remove
(
null
);
if
(
userNames
.
size
()
>
0
)
{
e
.
put
(
"executiveName"
,
Joiner
.
on
(
","
).
join
(
userNames
));
}
else
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/PointServiceImpl.java
View file @
be46a8ae
package
com
.
yeejoin
.
amos
.
patrol
.
business
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.base.Joiner
;
...
...
@@ -11,6 +12,7 @@ import com.yeejoin.amos.patrol.business.dao.mapper.InputItemMapper;
import
com.yeejoin.amos.patrol.business.dao.mapper.PointMapper
;
import
com.yeejoin.amos.patrol.business.dao.mapper.RouteMapper
;
import
com.yeejoin.amos.patrol.business.dao.repository.*
;
import
com.yeejoin.amos.patrol.business.dto.PointClassifySynDto
;
import
com.yeejoin.amos.patrol.business.entity.mybatis.CheckPtListBo
;
import
com.yeejoin.amos.patrol.business.entity.mybatis.PushTargetBo
;
import
com.yeejoin.amos.patrol.business.feign.EquipFeign
;
...
...
@@ -29,10 +31,13 @@ import com.yeejoin.amos.patrol.exception.YeeException;
import
com.yeejoin.amos.patrol.feign.RemoteSecurityService
;
import
com.yeejoin.amos.safety.common.cache.PointStatusCache
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.poi.ss.formula.functions.T
;
import
org.assertj.core.util.Sets
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanWrapper
;
import
org.springframework.beans.BeanWrapperImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.*
;
import
org.springframework.data.jpa.domain.Specification
;
...
...
@@ -46,12 +51,14 @@ import javax.persistence.criteria.CriteriaBuilder;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
java.beans.PropertyDescriptor
;
import
java.math.BigInteger
;
import
java.util.*
;
import
java.util.stream.Collector
;
import
java.util.stream.Collectors
;
@Service
(
"pointService"
)
@Slf4j
public
class
PointServiceImpl
implements
IPointService
{
@Autowired
...
...
@@ -320,6 +327,15 @@ public class PointServiceImpl implements IPointService {
newPointClassify
.
setCreatorId
(
point
.
getCreatorId
());
newPointClassify
.
setPointId
(
pointId
);
newPointClassify
.
setOrderNo
(
pointClassify
.
getOrderNo
());
newPointClassify
.
setDataSourceCode
(
pointClassify
.
getDataSourceCode
());
newPointClassify
.
setDataSourceName
(
pointClassify
.
getDataSourceName
());
newPointClassify
.
setAddress
(
pointClassify
.
getAddress
());
newPointClassify
.
setBuildingId
(
pointClassify
.
getBuildingId
());
newPointClassify
.
setOriginalId
(
pointClassify
.
getOriginalId
());
newPointClassify
.
setCategoryCode
(
pointClassify
.
getCategoryCode
());
newPointClassify
.
setCategoryName
(
pointClassify
.
getCategoryName
());
newPointClassify
.
setCode
(
pointClassify
.
getCode
());
newPointClassify
.
setBuildingName
(
pointClassify
.
getBuildingName
());
if
(!
optionalPointClassify
.
isPresent
())
{
pointResult
=
iPointClassifyDao
.
saveAndFlush
(
newPointClassify
);
}
else
{
...
...
@@ -1502,8 +1518,8 @@ public class PointServiceImpl implements IPointService {
public
List
<
Map
<
String
,
Object
>>
queryEquipPointInputItem
(
Long
pointId
)
{
List
<
Map
<
String
,
Object
>>
content
=
pointMapper
.
queryEquipPointInputItem
(
pointId
);
content
.
forEach
(
e
->{
if
(
e
.
get
(
"
equipmentId"
)!=
null
&&
!
StringUtils
.
isBlank
(
e
.
get
(
"equipmentI
d"
).
toString
())){
List
<
PointInputItemVo
>
inputItems
=
inputItemMapper
.
queryCustomInputItemByPointId
(
pointId
,
e
.
get
(
"equipmentI
d"
).
toString
());
if
(
e
.
get
(
"
id"
)!=
null
&&
!
StringUtils
.
isBlank
(
e
.
get
(
"i
d"
).
toString
())){
List
<
PointInputItemVo
>
inputItems
=
inputItemMapper
.
queryCustomInputItemByPointId
(
e
.
get
(
"i
d"
).
toString
());
e
.
put
(
"equipIputDetailData"
,
inputItems
);
}
});
...
...
@@ -1628,4 +1644,52 @@ public class PointServiceImpl implements IPointService {
public
LinkedHashMap
<
String
,
Object
>
getRegionTress
()
{
return
equipFeign
.
getRegionTress
();
}
@Override
public
void
syncPointClassify
(
Map
<
String
,
Object
>
map
)
{
if
(
ObjectUtils
.
isEmpty
(
map
))
{
log
.
info
(
"消息内容为空!!!"
);
return
;
}
String
method
=
map
.
get
(
"method"
).
toString
();
PointClassifySynDto
pointClassifySynDto
=
JSON
.
parseObject
(
map
.
get
(
"data"
).
toString
(),
PointClassifySynDto
.
class
);
switch
(
method
)
{
case
"DELETE"
:
iPointClassifyDao
.
deleteByOriginalId
(
pointClassifySynDto
.
getOriginalId
());
break
;
case
"UPDATE"
:
List
<
PointClassify
>
pointClassifyList
=
iPointClassifyDao
.
selectByOriginalId
(
pointClassifySynDto
.
getOriginalId
());
if
(
ObjectUtils
.
isEmpty
(
pointClassifyList
))
{
log
.
info
(
"数据不存在!"
);
}
pointClassifyList
.
forEach
(
pointClassify
->
{
BeanUtils
.
copyProperties
(
pointClassifySynDto
,
pointClassify
,
getNullPropertyNames
(
pointClassifySynDto
));
iPointClassifyDao
.
saveAndFlush
(
pointClassify
);
});
break
;
default
:
log
.
info
(
"方法参数错误!!!"
);
break
;
}
}
/**
* 获取控制字段列表
* @param source 对象
* @return 为空数组
*/
private
static
String
[]
getNullPropertyNames
(
Object
source
)
{
final
BeanWrapper
src
=
new
BeanWrapperImpl
(
source
);
PropertyDescriptor
[]
pds
=
src
.
getPropertyDescriptors
();
Set
<
String
>
emptyNames
=
new
HashSet
<
String
>();
for
(
PropertyDescriptor
pd
:
pds
)
{
Object
srcValue
=
src
.
getPropertyValue
(
pd
.
getName
());
if
(
srcValue
==
null
)
{
emptyNames
.
add
(
pd
.
getName
());
}
}
String
[]
result
=
new
String
[
emptyNames
.
size
()];
return
emptyNames
.
toArray
(
result
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/intfc/IPointService.java
View file @
be46a8ae
...
...
@@ -343,4 +343,7 @@ public interface IPointService {
List
queryItemList4RoutePoint
(
Long
pointId
,
Long
equipId
);
LinkedHashMap
<
String
,
Object
>
getRegionTress
();
void
syncPointClassify
(
Map
<
String
,
Object
>
map
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/vo/PointInputItemNewVo.java
View file @
be46a8ae
...
...
@@ -65,6 +65,35 @@ public class PointInputItemNewVo{
* 序号
*/
private
Integer
orderNo
;
/**
* 数据源名称(冗余)
*/
private
String
dataSourceName
;
/**
* 数据源code(1 消防装备 2 重点部位 3 自定义)
*/
private
String
dataSourceCode
;
/**
* 编号
*/
private
String
code
;
/**
* 建筑id
*/
private
String
buildingId
;
/**
* 建筑name
*/
private
String
buildingName
;
/**
* 原始id
*/
private
String
originalId
;
private
List
<
PointInputItemVo
>
equipIputDetailData
=
new
ArrayList
<
PointInputItemVo
>();
...
...
@@ -178,4 +207,52 @@ public class PointInputItemNewVo{
public
void
setMaintenanceName
(
String
maintenanceName
)
{
this
.
maintenanceName
=
maintenanceName
;
}
public
String
getDataSourceName
()
{
return
dataSourceName
;
}
public
void
setDataSourceName
(
String
dataSourceName
)
{
this
.
dataSourceName
=
dataSourceName
;
}
public
String
getDataSourceCode
()
{
return
dataSourceCode
;
}
public
void
setDataSourceCode
(
String
dataSourceCode
)
{
this
.
dataSourceCode
=
dataSourceCode
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getBuildingId
()
{
return
buildingId
;
}
public
void
setBuildingId
(
String
buildingId
)
{
this
.
buildingId
=
buildingId
;
}
public
String
getOriginalId
()
{
return
originalId
;
}
public
void
setOriginalId
(
String
originalId
)
{
this
.
originalId
=
originalId
;
}
public
String
getBuildingName
()
{
return
buildingName
;
}
public
void
setBuildingName
(
String
buildingName
)
{
this
.
buildingName
=
buildingName
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/feign/PushFeignServer.java
View file @
be46a8ae
package
com
.
yeejoin
.
amos
.
patrol
.
feign
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.MediaType
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.client.RestTemplate
;
import
com.yeejoin.amos.patrol.business.param.PushMsgParam
;
import
com.yeejoin.amos.patrol.business.util.CommonResponse
;
import
com.yeejoin.amos.patrol.business.util.CommonResponseUtil
;
import
com.yeejoin.amos.patrol.core.common.response.TaskInfoRespone
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.MessageModel
;
import
com.yeejoin.amos.patrol.business.param.PushMsgParam
;
@Service
(
"pushFeignServer"
)
public
class
PushFeignServer
{
// @Autowired
// private RestTemplate restTemplate;
//
// @Value("${Push.fegin.name}")
// private String RPushFeginName;
// private static String sendMessage = "/api/user/sendMessage";
//
// public String geturls(String url){
// return "http://"+RPushFeginName+url;
// }
// public HttpHeaders getHeader(String toke,String product,String appKey){
// HttpHeaders headers = new HttpHeaders();
// headers.setContentType(MediaType.APPLICATION_JSON);
// headers.set("Content-Type", "application/json");
// headers.set("token", toke);
// headers.set("product",product);
// headers.set("appKey", appKey);
// return headers;
// }
public
void
sendMessage
(
String
toke
,
String
product
,
String
appKey
,
List
<
PushMsgParam
>
pushMsgParam
){
public
void
sendMessage
(
String
toke
,
String
product
,
String
appKey
,
List
<
PushMsgParam
>
pushMsgParam
){
try
{
pushMsgParam
.
forEach
(
action
->{
sendJP
(
action
);
...
...
@@ -50,7 +21,8 @@ public class PushFeignServer {
}
}
public
void
sendMessage
(
String
toke
,
String
product
,
String
appKey
,
PushMsgParam
pushMsgParam
){
public
void
sendMessage
(
String
toke
,
String
product
,
String
appKey
,
PushMsgParam
pushMsgParam
){
try
{
sendJP
(
pushMsgParam
);
}
catch
(
Exception
e
)
{
...
...
@@ -64,6 +36,7 @@ public class PushFeignServer {
model
.
setTitle
(
pushMsgParam
.
getSubject
());
model
.
setBody
(
pushMsgParam
.
getContent
());
model
.
setMsgType
(
"patrolSystem"
);
model
.
setIsSendApp
(
true
);
model
.
setRecivers
(
pushMsgParam
.
getRecivers
());
model
.
setExtras
(
pushMsgParam
.
getExtras
());
Systemctl
.
messageClient
.
create
(
model
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/mqtt/PatrolMqttListener.java
0 → 100644
View file @
be46a8ae
package
com
.
yeejoin
.
amos
.
patrol
.
mqtt
;
import
com.alibaba.fastjson.JSON
;
import
com.yeejoin.amos.patrol.business.service.intfc.IPointService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
java.util.Map
;
/**
* @author DELL
*/
@Component
@Slf4j
public
class
PatrolMqttListener
extends
EmqxListener
{
@Value
(
"${patrol.point.classify.topic}"
)
private
String
pointClassifyTopic
;
@Autowired
private
IPointService
iPointService
;
@Override
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
{
if
(
log
.
isInfoEnabled
()){
log
.
info
(
"收到消息主题:{},消息内容:{}"
,
topic
,
message
.
toString
());
}
try
{
Map
<
String
,
Object
>
msg
=
JSON
.
parseObject
(
message
.
toString
());
if
(
pointClassifyTopic
.
equals
(
topic
))
{
iPointService
.
syncPointClassify
(
msg
);
}
log
.
info
(
"巡检对象同步完成"
);
}
catch
(
Exception
e
)
{
log
.
info
(
"巡检对象同步失败:{}"
,
e
.
getMessage
());
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/param/PushMsgParam.java
View file @
be46a8ae
...
...
@@ -3,6 +3,9 @@ package com.yeejoin.amos.supervision.business.param;
import
java.util.List
;
import
java.util.Map
;
import
lombok.Data
;
@Data
public
class
PushMsgParam
{
...
...
@@ -41,6 +44,8 @@ public class PushMsgParam {
* jpush发送类型:1:广播;2:标签;3:别名
*/
private
String
type
=
"3"
;
private
String
relationId
;
public
String
getType
()
{
return
type
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/impl/MessageServiceImpl.java
View file @
be46a8ae
...
...
@@ -233,9 +233,10 @@ public class MessageServiceImpl implements IMessageService {
extras
.
put
(
"type"
,
MsgTypeEnum
.
CHECK
.
getCode
());
extras
.
put
(
"id"
,
checkMsgBo
.
getCheckId
()+
""
);
pushMsgParam
.
setExtras
(
extras
);
pushMsgParam
.
setRelationId
(
checkMsgBo
.
getCheckId
()+
""
);
pmps
.
add
(
pushMsgParam
);
List
<
Msg
>
msgList
=
createMsg
(
jpushUser
,
checkMsgBo
);
pushFeignServer
.
sendMessage
(
toke
,
product
,
appKey
,
pmps
);
pushFeignServer
.
sendMessage
(
pmps
);
}
}
...
...
@@ -312,10 +313,11 @@ public class MessageServiceImpl implements IMessageService {
extras
.
put
(
"type"
,
msg
.
getMsgType
());
extras
.
put
(
"id"
,
msg
.
getRelationId
()==
null
?
"0"
:
msg
.
getRelationId
().
toString
());
pushMsg
.
setExtras
(
extras
);
pushMsg
.
setRelationId
(
msg
.
getRelationId
()==
null
?
"0"
:
msg
.
getRelationId
().
toString
());
pmps
.
add
(
pushMsg
);
msg
.
setSendTime
(
new
Date
());
msg
.
setStatus
(
1
);
pushFeignServer
.
sendMessage
(
toke
,
product
,
appKey
,
pmps
);
pushFeignServer
.
sendMessage
(
pmps
);
iMsgDao
.
save
(
msg
);
return
msg
;
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/feign/PushFeignServer.java
View file @
be46a8ae
...
...
@@ -2,49 +2,43 @@ package com.yeejoin.amos.supervision.feign;
import
java.util.List
;
import
com.yeejoin.amos.supervision.business.util.CommonResponse
;
import
com.yeejoin.amos.supervision.business.util.CommonResponseUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.MediaType
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.client.RestTemplate
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.MessageModel
;
import
com.yeejoin.amos.supervision.business.param.PushMsgParam
;
@Service
(
"pushFeignServer"
)
public
class
PushFeignServer
{
@Autowired
private
RestTemplate
restTemplate
;
@Value
(
"${Push.fegin.name}"
)
private
String
RPushFeginName
;
private
static
String
sendMessage
=
"/api/user/sendMessage"
;
public
String
geturls
(
String
url
){
return
"http://"
+
RPushFeginName
+
url
;
}
public
HttpHeaders
getHeader
(
String
toke
,
String
product
,
String
appKey
){
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
MediaType
.
APPLICATION_JSON
);
headers
.
set
(
"Content-Type"
,
"application/json"
);
headers
.
set
(
"token"
,
toke
);
headers
.
set
(
"product"
,
product
);
headers
.
set
(
"appKey"
,
appKey
);
return
headers
;
}
public
CommonResponse
sendMessage
(
String
toke
,
String
product
,
String
appKey
,
List
<
PushMsgParam
>
pushMsgParam
){
try
{
HttpEntity
httpEntity
=
new
HttpEntity
<>(
pushMsgParam
,
getHeader
(
toke
,
product
,
appKey
));
CommonResponse
commonResponse1
=
restTemplate
.
postForObject
(
geturls
(
sendMessage
),
httpEntity
,
CommonResponse
.
class
);
return
commonResponse1
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
CommonResponseUtil
.
failure
(
"发送失败"
);
}
}
public
void
sendMessage
(
List
<
PushMsgParam
>
pushMsgParam
){
try
{
pushMsgParam
.
forEach
(
action
->{
sendJP
(
action
);
})
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
public
void
sendMessage
(
PushMsgParam
pushMsgParam
){
try
{
sendJP
(
pushMsgParam
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
private
void
sendJP
(
PushMsgParam
pushMsgParam
){
MessageModel
model
=
new
MessageModel
();
model
.
setRelationId
(
pushMsgParam
.
getRelationId
());
model
.
setTitle
(
pushMsgParam
.
getSubject
(
));
model
.
setBody
(
pushMsgParam
.
getContent
()
);
model
.
setMsgType
(
"supervision"
)
;
model
.
setIsSendApp
(
true
);
model
.
setIsSendWeb
(
true
);
model
.
setRecivers
(
pushMsgParam
.
getRecivers
()
);
model
.
setExtras
(
pushMsgParam
.
getExtras
());
Systemctl
.
messageClient
.
create
(
model
);
}
}
amos-boot-system-jcs/src/main/resources/db/changelog/jcs-1.0.0.0.xml
View file @
be46a8ae
...
...
@@ -2022,6 +2022,54 @@
</sql>
</changeSet>
<changeSet
author=
"chenhao"
id=
"2021-11-02-2"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"cb_firefighters"
columnName=
"fire_team_name"
/>
</not>
</preConditions>
<comment>
update data cb_firefighters
</comment>
<sql>
ALTER TABLE cb_firefighters ADD fire_team_name varchar(100) NULL COMMENT '消防队伍名称'
</sql>
</changeSet>
<changeSet
author=
"chenhao"
id=
"2021-11-02-3"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"cb_key_site"
columnName=
"belong_name"
/>
</not>
</preConditions>
<comment>
update data cb_key_site
</comment>
<sql>
ALTER TABLE cb_key_site ADD belong_name varchar(100) NULL COMMENT '所属单位/部门名称';
</sql>
</changeSet>
<changeSet
author=
"chenhao"
id=
"2021-11-02-4"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"cb_org_usr"
columnName=
"parent_name"
/>
</not>
</preConditions>
<comment>
update data cb_org_usr
</comment>
<sql>
ALTER TABLE cb_org_usr ADD parent_name varchar(100) NULL COMMENT '归属机构/部门/人员名称';
</sql>
</changeSet>
<changeSet
author=
"chenhao"
id=
"2021-11-04-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"cb_fire_team"
columnName=
"parent_name"
/>
</not>
</preConditions>
<comment>
update data cb_fire_team
</comment>
<sql>
ALTER TABLE cb_fire_team ADD parent_name varchar(100) NULL COMMENT '父级队伍名称';
</sql>
</changeSet>
<changeSet
author=
"litw"
id=
"2021-11-03-01"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
...
...
@@ -2046,6 +2094,5 @@
</sql>
</changeSet>
</databaseChangeLog>
</databaseChangeLog>
amos-boot-system-patrol/src/main/java/com/yeejoin/amos/PatrolApplication.java
View file @
be46a8ae
package
com
.
yeejoin
.
amos
;
import
com.yeejoin.amos.patrol.mqtt.PatrolMqttListener
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
...
...
@@ -20,6 +24,7 @@ import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
org.springframework.web.client.RestTemplate
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.restful.config.JsonSerializerManage
;
import
org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler
;
...
...
@@ -59,6 +64,15 @@ public class PatrolApplication {
return
new
RestTemplate
();
}
@Autowired
private
PatrolMqttListener
patrolMqttListener
;
@Autowired
private
EmqKeeper
emqKeeper
;
@Value
(
"${patrol.topic}"
)
private
String
patrolTopic
;
/**
* 启动amosop-server
*
...
...
@@ -81,4 +95,18 @@ public class PatrolApplication {
"----------------------------------------------------------"
);
}
/**
* 初始化MQTT
* @throws MqttException
*/
@Bean
void
initMqtt
()
{
try
{
emqKeeper
.
getMqttClient
().
subscribe
(
patrolTopic
,
1
,
patrolMqttListener
);
}
catch
(
MqttException
e
)
{
e
.
printStackTrace
();
logger
.
error
(
"EMQ初始化连接失败!"
);
}
}
}
\ No newline at end of file
amos-boot-system-patrol/src/main/resources/application.properties
View file @
be46a8ae
spring.application.name
=
AMOS-PATROL
-tb
spring.application.name
=
AMOS-PATROL
server.servlet.context-path
=
/patrol
server.port
=
8082
...
...
@@ -44,6 +44,8 @@ Push.fegin.name=APPMESSAGEPUSHSERVICE
amos.flowWork.topic
=
/STATE_GRID/hazardManagement
amosRefresh.danger.topic
=
patrolDangerInsertOrUpdate
amosRefresh.patrol.topic
=
patrolCheckInsert
patrol.point.classify.topic
=
patrol/point/classify
patrol.topic
=
patrol/#
#停止通过WEB公开所有端点
management.endpoints.web.exposure.exclude
=
*
## redis失效时间
...
...
amos-boot-system-patrol/src/main/resources/db/changelog/patrol-3.0.1.xml
View file @
be46a8ae
...
...
@@ -313,4 +313,121 @@
</sql>
</changeSet>
<changeSet
author=
"xixinzhao"
id=
"20211102-19"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"p_point_classify"
columnName=
"code"
/>
</not>
</preConditions>
<comment>
p_point_classify add column code
</comment>
<sql>
ALTER TABLE `p_point_classify`
ADD COLUMN `code` varchar(255) DEFAULT NULL COMMENT '编号';
</sql>
</changeSet>
<changeSet
author=
"xixinzhao"
id=
"20211102-20"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"p_point_classify"
columnName=
"category_name"
/>
</not>
</preConditions>
<comment>
p_point_classify add column category_name
</comment>
<sql>
ALTER TABLE `p_point_classify`
ADD COLUMN `category_name` varchar(255) DEFAULT NULL COMMENT '分类名称';
</sql>
</changeSet>
<changeSet
author=
"xixinzhao"
id=
"20211102-22"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"p_point_classify"
columnName=
"address"
/>
</not>
</preConditions>
<comment>
p_point_classify add column address
</comment>
<sql>
ALTER TABLE `p_point_classify`
ADD COLUMN `address` varchar(255) DEFAULT NULL COMMENT '位置';
</sql>
</changeSet>
<changeSet
author=
"xixinzhao"
id=
"20211102-23"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"p_point_classify"
columnName=
"data_source_code"
/>
</not>
</preConditions>
<comment>
p_point_classify add column data_source_code
</comment>
<sql>
ALTER TABLE `p_point_classify`
ADD COLUMN `data_source_code` int(10) DEFAULT NULL COMMENT '数据源code(1 消防装备 2 重点部位 3 自定义)';
</sql>
</changeSet>
<changeSet
author=
"xixinzhao"
id=
"20211102-24"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"p_point_classify"
columnName=
"data_source_name"
/>
</not>
</preConditions>
<comment>
p_point_classify add column data_source_name
</comment>
<sql>
ALTER TABLE `p_point_classify`
ADD COLUMN `data_source_name` varchar(255) DEFAULT NULL COMMENT '数据源名称(冗余)';
</sql>
</changeSet>
<changeSet
author=
"xixinzhao"
id=
"20211102-26"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"p_point_classify"
columnName=
"building_id"
/>
</not>
</preConditions>
<comment>
p_point_classify add column building_id
</comment>
<sql>
ALTER TABLE `p_point_classify`
ADD COLUMN `building_id` varchar(255) DEFAULT NULL COMMENT '建筑id';
</sql>
</changeSet>
<changeSet
author=
"xixinzhao"
id=
"20211102-27"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"p_point_classify"
columnName=
"building_name"
/>
</not>
</preConditions>
<comment>
p_point_classify add column building_name
</comment>
<sql>
ALTER TABLE `p_point_classify`
ADD COLUMN `building_name` varchar(255) DEFAULT NULL COMMENT '建筑名称';
</sql>
</changeSet>
<changeSet
author=
"xixinzhao"
id=
"20211102-28"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"p_point_classify"
columnName=
"category_code"
/>
</not>
</preConditions>
<comment>
p_point_classify add column category_code
</comment>
<sql>
ALTER TABLE `p_point_classify`
ADD COLUMN `category_code` varchar(255) DEFAULT NULL COMMENT '分类id';
</sql>
</changeSet>
<changeSet
author=
"xixinzhao"
id=
"20211102-29"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"p_point_classify"
columnName=
"is_delete"
/>
</not>
</preConditions>
<comment>
p_point_classify add column is_delete
</comment>
<sql>
ALTER TABLE `p_point_classify`
ADD COLUMN `is_delete` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除( 0未删除,1已删除 )';
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
amos-boot-system-patrol/src/main/resources/db/mapper/dbTemplate_check.xml
View file @
be46a8ae
...
...
@@ -846,6 +846,15 @@
classify.id as classifyId,
classify.name as equipmentName,
classify.equipment_id as equipmentId,
classify.original_id as originalId,
classify.code,
classify.category_name as categoryName,
classify.address as area,
classify.data_source_code as dataSourceCode,
classify.data_source_name as equipType,
classify.building_id as buildingId,
classify.building_name as place,
classify.category_code as categoryCode,
(SELECT create_date FROM p_check WHERE id = #{checkID}) as createDate
FROM
p_point_classify classify
...
...
amos-boot-system-patrol/src/main/resources/db/mapper/dbTemplate_input_item.xml
View file @
be46a8ae
...
...
@@ -188,8 +188,9 @@
LEFT JOIN p_input_item pii ON pii.id = ppi.input_item_id
lEFT JOIN p_route_point_item prpi ON prpi.point_input_item_id = pii.id
WHERE pii.is_delete = '0'
<if
test=
"pointId!=null and pointId !='' "
>
AND ppc.point_id = #{pointId}
</if>
<if
test=
"equipmentId!=null and equipmentId !='' "
>
AND ppc.equipment_id = #{equipmentId}
</if>
<if
test=
"classifyId!=null and classifyId !='' "
>
AND ppc.id = #{classifyId}
</if>
<!-- <if test="pointId!=null and pointId !='' "> AND ppc.point_id = #{pointId}</if>-->
<!-- <if test="equipmentId!=null and equipmentId !='' "> AND ppc.equipment_id = #{equipmentId}</if>-->
</select>
<select
id=
"getInputItemListByitemNos"
resultType=
"com.yeejoin.amos.patrol.business.vo.InputItemVo"
>
SELECT
...
...
amos-boot-system-patrol/src/main/resources/db/mapper/pointMapper.xml
View file @
be46a8ae
...
...
@@ -942,32 +942,57 @@
AND p.org_code = #{orgCode}
AND c.is_delete = 0
</select>
<!-- <select id="queryEquipPointInputItem" resultType="java.util.Map">-->
<!-- SELECT-->
<!-- distinct cast(spec.id as char) AS equipmentId,-->
<!-- we.name AS name,-->
<!-- structure.source_id AS sourceId,-->
<!-- structure.source_code AS sourceCode,-->
<!-- spec.system_id AS systemId,-->
<!-- spec.code AS code,-->
<!-- cast(ppc.id as char) AS id,-->
<!-- category.NAME AS categoryName,-->
<!-- category.CODE AS categoryCode,-->
<!-- equipment_detail.area AS address,-->
<!-- structure.NAME AS acre,-->
<!-- we.inspection_spec as inspectionName,-->
<!-- ppc.order_no as orderNo-->
<!-- FROM-->
<!-- p_point_classify ppc-->
<!-- LEFT JOIN wl_equipment_specific spec ON spec.id=ppc.equipment_id-->
<!-- LEFT JOIN wl_equipment_detail equipment_detail ON equipment_detail.id = spec.equipment_detail_id-->
<!-- LEFT JOIN wl_stock_detail detail ON detail.equipment_specific_id = spec.id-->
<!-- LEFT JOIN wl_warehouse_structure structure ON detail.warehouse_structure_id = structure.id-->
<!-- LEFT JOIN f_fire_fighting_system AS manage ON manage.id = spec.system_id-->
<!-- LEFT JOIN wl_equipment we ON we.id = equipment_detail.equipment_id-->
<!-- LEFT JOIN wl_equipment_category category ON category.id = we.category_id-->
<!-- WHERE-->
<!-- <if test = "pointId!=''" > ppc.point_id = #{pointId} </if>-->
<!-- </select>-->
<select
id=
"queryEquipPointInputItem"
resultType=
"java.util.Map"
>
SELECT
distinct cast(spec.id as char) AS equipmentId,
we.name AS name,
structure.source_id AS sourceId,
structure.source_code AS sourceCode,
spec.system_id AS systemId,
spec.code AS code,
cast(ppc.id as char) AS id,
category.NAME AS categoryName,
category.CODE AS categoryCode,
equipment_detail.area AS address,
structure.NAME AS acre,
we.inspection_spec as inspectionName,
ppc.order_no as orderNo
ppc.id,
ppc.point_id pointId,
ppc.name,
ppc.code,
ppc.creator_id creatorId,
ppc.create_date createDate,
ppc.order_no orderNo,
ppc.original_id originalId,
ppc.equipment_id equipmentId,
ppc.inspection_spec_name inspectionSpecName,
ppc.category_name categoryName,
ppc.address,
ppc.data_source_code dataSourceCode,
ppc.data_source_name dataSourceName,
ppc.building_id buildingId,
ppc.building_name buildingName,
ppc.category_code categoryCode
FROM
p_point_classify ppc
LEFT JOIN wl_equipment_specific spec ON spec.id=ppc.equipment_id
LEFT JOIN wl_equipment_detail equipment_detail ON equipment_detail.id = spec.equipment_detail_id
LEFT JOIN wl_stock_detail detail ON detail.equipment_specific_id = spec.id
LEFT JOIN wl_warehouse_structure structure ON detail.warehouse_structure_id = structure.id
LEFT JOIN f_fire_fighting_system AS manage ON manage.id = spec.system_id
LEFT JOIN wl_equipment we ON we.id = equipment_detail.equipment_id
LEFT JOIN wl_equipment_category category ON category.id = we.category_id
p_point_classify ppc
WHERE
<if
test =
"pointId!=''"
>
ppc.point_id = #{pointId}
</if>
ppc.is_delete = 0
<if
test =
"pointId!=''"
>
AND ppc.point_id = #{pointId}
</if>
</select>
<select
id=
"queryPointCount4Route"
parameterType=
"long"
resultType=
"int"
>
...
...
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