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
d9b2f803
Commit
d9b2f803
authored
Jul 03, 2023
by
xixinzhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_dl_0703' into develop_dl
parents
91b0b58a
1ebdb002
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
525 additions
and
412 deletions
+525
-412
RedisKey.java
...java/com/yeejoin/amos/boot/biz/common/utils/RedisKey.java
+6
-1
OrgPersonDto.java
...yeejoin/amos/boot/module/common/api/dto/OrgPersonDto.java
+2
-1
OrgUsrDto.java
...om/yeejoin/amos/boot/module/common/api/dto/OrgUsrDto.java
+2
-0
OrgUsr.java
...om/yeejoin/amos/boot/module/common/api/entity/OrgUsr.java
+3
-0
OrganizationMapper.java
...n/amos/boot/module/jcs/api/mapper/OrganizationMapper.java
+3
-1
OrganizationMapper.xml
...-jcs-api/src/main/resources/mapper/OrganizationMapper.xml
+38
-20
PointCheckTypeEnum.java
.../yeejoin/amos/patrol/common/enums/PointCheckTypeEnum.java
+4
-4
OrgUsrServiceImpl.java
...oot/module/common/biz/service/impl/OrgUsrServiceImpl.java
+5
-4
EquipmentIndexCacheRunner.java
...yeejoin/equipmanage/config/EquipmentIndexCacheRunner.java
+8
-2
ConfigureController.java
...m/yeejoin/equipmanage/controller/ConfigureController.java
+2
-0
TopographyController.java
.../yeejoin/equipmanage/controller/TopographyController.java
+30
-27
EquipmentSpecificAlarmMapper.java
...join/equipmanage/mapper/EquipmentSpecificAlarmMapper.java
+2
-0
ManufacturerInfoMapper.java
...om/yeejoin/equipmanage/mapper/ManufacturerInfoMapper.java
+4
-2
ApplicationRunnerImpl.java
...ejoin/equipmanage/service/impl/ApplicationRunnerImpl.java
+1
-1
EquipmentIndexImpl.java
.../yeejoin/equipmanage/service/impl/EquipmentIndexImpl.java
+2
-2
EquipmentServiceImpl.java
...eejoin/equipmanage/service/impl/EquipmentServiceImpl.java
+2
-8
EquipmentSpecificAlarmLogServiceImpl.java
...ge/service/impl/EquipmentSpecificAlarmLogServiceImpl.java
+1
-1
EquipmentSpecificSerivceImpl.java
...quipmanage/service/impl/EquipmentSpecificSerivceImpl.java
+1
-0
FormInstanceEquipServiceImpl.java
...quipmanage/service/impl/FormInstanceEquipServiceImpl.java
+10
-5
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+236
-228
StartLoader.java
.../yeejoin/amos/boot/module/jcs/biz/config/StartLoader.java
+11
-6
FirefightersController.java
...oot/module/jcs/biz/controller/FirefightersController.java
+1
-8
OrganizationImpl.java
...os/boot/module/jcs/biz/service/impl/OrganizationImpl.java
+29
-13
InputItemController.java
.../amos/patrol/business/controller/InputItemController.java
+7
-6
AmostEquipApplication.java
...quip/src/main/java/com/yeejoin/AmostEquipApplication.java
+10
-4
nameKeyInfo.json
...oot-system-equip/src/main/resources/json/nameKeyInfo.json
+2
-2
EquipmentCategoryMapper.xml
...uip/src/main/resources/mapper/EquipmentCategoryMapper.xml
+2
-0
EquipmentDetailMapper.xml
...equip/src/main/resources/mapper/EquipmentDetailMapper.xml
+2
-2
EquipmentSpecificAlarmMapper.xml
...rc/main/resources/mapper/EquipmentSpecificAlarmMapper.xml
+7
-0
EquipmentSpecificIndexMapper.xml
...rc/main/resources/mapper/EquipmentSpecificIndexMapper.xml
+36
-36
EquipmentSpecificMapper.xml
...uip/src/main/resources/mapper/EquipmentSpecificMapper.xml
+9
-16
ManufacturerInfoMapper.xml
...quip/src/main/resources/mapper/ManufacturerInfoMapper.xml
+20
-2
jcs-1.0.0.0.xml
...ystem-jcs/src/main/resources/db/changelog/jcs-1.0.0.0.xml
+14
-2
PatrolApplication.java
...rol/src/main/java/com/yeejoin/amos/PatrolApplication.java
+2
-2
dbTemplate_input_item.xml
...ol/src/main/resources/db/mapper/dbTemplate_input_item.xml
+2
-2
application-dev.properties
...ils-message/src/main/resources/application-dev.properties
+5
-4
application.properties
...t-utils-message/src/main/resources/application.properties
+4
-0
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/RedisKey.java
View file @
d9b2f803
...
@@ -48,6 +48,11 @@ public class RedisKey {
...
@@ -48,6 +48,11 @@ public class RedisKey {
*/
*/
public
static
final
String
EQUIP_INDEX_ADDRESS
=
"equip_index_address"
;
public
static
final
String
EQUIP_INDEX_ADDRESS
=
"equip_index_address"
;
/**
* 装备指标Key值
*/
public
static
final
String
EQUIP_INDEX_ADDRESS_KEY
=
"equip_index_address_key"
;
/** 驼峰转下划线(简单写法,效率低于 ) */
/** 驼峰转下划线(简单写法,效率低于 ) */
public
static
String
humpToLine
(
String
str
)
{
public
static
String
humpToLine
(
String
str
)
{
return
str
.
replaceAll
(
"[A-Z]"
,
"_$0"
).
toLowerCase
();
return
str
.
replaceAll
(
"[A-Z]"
,
"_$0"
).
toLowerCase
();
...
@@ -74,7 +79,7 @@ public class RedisKey {
...
@@ -74,7 +79,7 @@ public class RedisKey {
public
static
String
buildPatternKey
(
String
token
)
{
public
static
String
buildPatternKey
(
String
token
)
{
return
REGION_REDIS_PREFIX
+
"*"
+
"_"
+
token
;
return
REGION_REDIS_PREFIX
+
"*"
+
"_"
+
token
;
}
}
/**
/**
* 判断str1中包含str2的个数
* 判断str1中包含str2的个数
* @param str1
* @param str1
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/OrgPersonDto.java
View file @
d9b2f803
...
@@ -22,7 +22,6 @@ import lombok.EqualsAndHashCode;
...
@@ -22,7 +22,6 @@ import lombok.EqualsAndHashCode;
@ApiModel
(
value
=
"OrgUsr对象"
,
description
=
"人员信息"
)
@ApiModel
(
value
=
"OrgUsr对象"
,
description
=
"人员信息"
)
public
class
OrgPersonDto
extends
BaseDto
{
public
class
OrgPersonDto
extends
BaseDto
{
/**
/**
*
*
*/
*/
...
@@ -82,4 +81,6 @@ public class OrgPersonDto extends BaseDto {
...
@@ -82,4 +81,6 @@ public class OrgPersonDto extends BaseDto {
@ApiModelProperty
(
value
=
"动态表单值"
)
@ApiModelProperty
(
value
=
"动态表单值"
)
private
List
<
DynamicFormInstance
>
dynamicFormValue
;
private
List
<
DynamicFormInstance
>
dynamicFormValue
;
private
String
personImg
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/OrgUsrDto.java
View file @
d9b2f803
...
@@ -99,4 +99,6 @@ public class OrgUsrDto extends BaseDto {
...
@@ -99,4 +99,6 @@ public class OrgUsrDto extends BaseDto {
@ApiModelProperty
(
value
=
"消防信息实体"
)
@ApiModelProperty
(
value
=
"消防信息实体"
)
private
CompanyInfo
companyInfo
;
private
CompanyInfo
companyInfo
;
private
String
personImg
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/entity/OrgUsr.java
View file @
d9b2f803
...
@@ -90,4 +90,7 @@ public class OrgUsr extends BaseEntity {
...
@@ -90,4 +90,7 @@ public class OrgUsr extends BaseEntity {
@ApiModelProperty
(
value
=
"管理类别"
)
@ApiModelProperty
(
value
=
"管理类别"
)
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
String
managementType
;
private
String
managementType
;
@ApiModelProperty
(
value
=
"人员照片"
)
private
String
personImg
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/mapper/OrganizationMapper.java
View file @
d9b2f803
...
@@ -15,7 +15,9 @@ import java.util.Map;
...
@@ -15,7 +15,9 @@ import java.util.Map;
public
interface
OrganizationMapper
extends
BaseMapper
<
Organization
>
{
public
interface
OrganizationMapper
extends
BaseMapper
<
Organization
>
{
Page
<
Map
<
String
,
Object
>>
getOrganizationInfo
(
Page
<
Map
<
String
,
Object
>>
page
,
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
List
<
Map
<
String
,
Object
>>
getOrganizationInfo
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
Map
<
String
,
Object
>
getTeamLeader
();
Page
<
Map
<
String
,
Object
>>
getOrganizationList
(
Page
<
Map
<
String
,
Object
>>
page
,
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
Page
<
Map
<
String
,
Object
>>
getOrganizationList
(
Page
<
Map
<
String
,
Object
>>
page
,
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/resources/mapper/OrganizationMapper.xml
View file @
d9b2f803
...
@@ -5,13 +5,22 @@
...
@@ -5,13 +5,22 @@
<select
id=
"getOrganizationInfo"
resultType=
"java.util.Map"
>
<select
id=
"getOrganizationInfo"
resultType=
"java.util.Map"
>
SELECT
( SELECT COUNT( 1 ) FROM cb_organization_user cou WHERE cou.emergency_team_id = co.sequence_nbr ) AS
value,
co.emergency_team_name AS name
FROM
cb_organization co
WHERE co.is_delete = 0
ORDER BY
co.sort desc
LIMIT 5
</select>
<select
id=
"getTeamLeader"
resultType=
"Map"
>
SELECT
SELECT
(
(
SELECT
SELECT
Ifnull (GROUP_CONCAT( cou.biz_org_name ),'') AS
Ifnull (GROUP_CONCAT( cou.biz_org_name ),'') AS value
value
FROM
FROM
(
(
SELECT
SELECT
...
@@ -32,25 +41,34 @@
...
@@ -32,25 +41,34 @@
)
)
AND cdfi.field_code = 'userId'
AND cdfi.field_code = 'userId'
) temp
) temp
LEFT JOIN cb_org_usr cou ON cou.sequence_nbr = temp.userId
LEFT JOIN cb_org_usr cou ON cou.sequence_nbr = temp.userId WHERE cou.is_delete = 0
WHERE cou.is_delete = 0
) AS value,
) AS
(
value
,
'当值值长' AS name UNION
(
SELECT
SELECT
( SELECT COUNT( 1 ) FROM cb_organization_user cou WHERE cou.emergency_team_id = co.sequence_nbr ) AS
Ifnull(GROUP_CONCAT( dfi.field_value ),'') AS tel
value
,
co.emergency_team_name AS name
FROM
FROM
cb_organization co
(
WHERE co.is_delete = 0
SELECT
ORDER BY
cdfi.field_value AS userId
co.sort desc
FROM
LIMIT 5
cb_dynamic_form_instance cdfi
WHERE
cdfi.instance_id IN (
SELECT
cdps.instance_id
FROM
cb_duty_person_shift cdps
LEFT JOIN cb_dynamic_form_instance cdfi ON cdps.instance_id = cdfi.instance_id
WHERE
cdfi.field_code = 'postType'
AND field_value = '1676'
AND cdps.duty_date = ( SELECT DATE_FORMAT(NOW(),"%Y-%m-%d"))
)
)
AND cdfi.field_code = 'userId'
) temp
LEFT JOIN cb_dynamic_form_instance dfi ON dfi.instance_id = temp.userId WHERE dfi.field_code = 'telephone'
) AS tel,
'当值值长' AS name
</select>
</select>
<select
id=
"getOrganizationList"
resultType=
"java.util.Map"
>
<select
id=
"getOrganizationList"
resultType=
"java.util.Map"
>
SELECT
SELECT
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-patrol-api/src/main/java/com/yeejoin/amos/patrol/common/enums/PointCheckTypeEnum.java
View file @
d9b2f803
...
@@ -6,10 +6,10 @@ import java.util.List;
...
@@ -6,10 +6,10 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
public
enum
PointCheckTypeEnum
{
public
enum
PointCheckTypeEnum
{
WGJC
(
"外观检查"
,
"
WGJC
"
),
WGJC
(
"外观检查"
,
"
外观检查
"
),
GNCS
(
"功能测试"
,
"
GNCS
"
),
GNCS
(
"功能测试"
,
"
功能测试
"
),
HJJC
(
"环境检查"
,
"
HJJC
"
),
HJJC
(
"环境检查"
,
"
环境检查
"
),
QT
(
"其他"
,
"
QT
"
);
QT
(
"其他"
,
"
其他
"
);
private
String
name
;
private
String
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/OrgUsrServiceImpl.java
View file @
d9b2f803
...
@@ -778,9 +778,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -778,9 +778,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
public
String
getPersonImg
(
String
id
)
{
public
String
getPersonImg
(
String
id
)
{
Long
userId
=
Long
.
valueOf
(
id
);
Long
userId
=
Long
.
valueOf
(
id
);
OrgUsr
orgUsr
=
this
.
baseMapper
.
queryByUserId
(
userId
);
OrgUsr
orgUsr
=
this
.
baseMapper
.
queryByUserId
(
userId
);
List
<
DynamicFormInstanceDto
>
list
=
alertFormValueServiceImpl
.
listBySeqnum
(
orgUsr
.
getSequenceNbr
());
return
orgUsr
.
getPersonImg
();
String
str
=
list
.
get
(
0
).
getFieldValue
();
return
str
;
}
}
public
List
<
FormValue
>
getFormValueDetail
(
Long
id
)
throws
Exception
{
public
List
<
FormValue
>
getFormValueDetail
(
Long
id
)
throws
Exception
{
...
@@ -2964,6 +2962,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -2964,6 +2962,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
orgUsr
.
setBizOrgName
(
peopleBasicInfoDto
.
getName
());
orgUsr
.
setBizOrgName
(
peopleBasicInfoDto
.
getName
());
orgUsr
.
setParentId
(
peopleBasicInfoDto
.
getCompany
());
orgUsr
.
setParentId
(
peopleBasicInfoDto
.
getCompany
());
orgUsr
.
setParentName
(
peopleBasicInfoDto
.
getBizOrgName
());
orgUsr
.
setParentName
(
peopleBasicInfoDto
.
getBizOrgName
());
orgUsr
.
setPersonImg
(
peopleBasicInfoDto
.
getPersonImg
());
orgUsr
.
setIsDelete
(
false
);
orgUsr
.
setIsDelete
(
false
);
return
orgUsr
;
return
orgUsr
;
}
}
...
@@ -3293,9 +3292,11 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -3293,9 +3292,11 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
if
(
"1601"
.
equals
(
type
))
{
if
(
"1601"
.
equals
(
type
))
{
deleteFirefighters
(
id
);
deleteFirefighters
(
id
);
}
}
// 巡检站端与中心级数据同步
// 4.解决人员更换岗位类型然后删除,App打卡还有脏数据问题
firefightersService
.
update
(
new
UpdateWrapper
<
Firefighters
>().
eq
(
"org_usr_id"
,
id
).
set
(
"is_delete"
,
1
));
// 巡检站端与中心级数据同步
TransactionSynchronizationManager
.
registerSynchronization
(
new
TransactionSynchronization
()
{
TransactionSynchronizationManager
.
registerSynchronization
(
new
TransactionSynchronization
()
{
@Override
@Override
public
void
afterCommit
()
{
public
void
afterCommit
()
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/config/EquipmentIndexCacheRunner.java
View file @
d9b2f803
...
@@ -32,11 +32,16 @@ public class EquipmentIndexCacheRunner implements CommandLineRunner {
...
@@ -32,11 +32,16 @@ public class EquipmentIndexCacheRunner implements CommandLineRunner {
public
void
run
(
String
...
args
)
throws
Exception
{
public
void
run
(
String
...
args
)
throws
Exception
{
log
.
info
(
">>服务启动执行,执行预加载数据等操作"
);
log
.
info
(
">>服务启动执行,执行预加载数据等操作"
);
redisUtils
.
del
(
RedisKey
.
EQUIP_INDEX_ADDRESS
);
redisUtils
.
del
(
RedisKey
.
EQUIP_INDEX_ADDRESS
);
redisUtils
.
del
(
RedisKey
.
EQUIP_INDEX_ADDRESS_KEY
);
List
<
EquipmentIndexVO
>
equipSpecificIndexList
=
equipmentSpecificIndexMapper
.
getEquipSpecificIndexList
(
null
);
List
<
EquipmentIndexVO
>
equipSpecificIndexList
=
equipmentSpecificIndexMapper
.
getEquipSpecificIndexList
(
null
);
Map
<
String
,
Object
>
equipmentIndexVOMap
=
equipSpecificIndexList
.
stream
()
Map
<
String
,
Object
>
equipmentIndexVOMap
=
equipSpecificIndexList
.
stream
()
.
filter
(
v
->
v
.
getGatewayId
()
!=
null
&&
v
.
getIndexAddress
()
!=
null
)
.
filter
(
v
->
v
.
getGatewayId
()
!=
null
)
.
collect
(
Collectors
.
toMap
(
vo
->
vo
.
getIndexAddress
()
+
"_"
+
vo
.
getGatewayId
(),
Function
.
identity
(),(
v1
,
v2
)
->
v1
));
.
collect
(
Collectors
.
toMap
(
vo
->
vo
.
getIndexAddress
()
+
"_"
+
vo
.
getGatewayId
(),
Function
.
identity
(),(
v1
,
v2
)
->
v1
));
Map
<
String
,
Object
>
equipmentIndexKeyMap
=
equipSpecificIndexList
.
stream
()
.
filter
(
v
->
v
.
getIndexAddress
()
!=
null
&&
v
.
getGatewayId
()
==
null
)
.
collect
(
Collectors
.
toMap
(
EquipmentIndexVO:
:
getIndexAddress
,
Function
.
identity
(),(
v1
,
v2
)
->
v1
));
redisUtils
.
hmset
(
RedisKey
.
EQUIP_INDEX_ADDRESS
,
equipmentIndexVOMap
);
redisUtils
.
hmset
(
RedisKey
.
EQUIP_INDEX_ADDRESS
,
equipmentIndexVOMap
);
redisUtils
.
hmset
(
RedisKey
.
EQUIP_INDEX_ADDRESS_KEY
,
equipmentIndexKeyMap
);
}
}
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/ConfigureController.java
View file @
d9b2f803
...
@@ -847,7 +847,9 @@ public class ConfigureController extends AbstractBaseController {
...
@@ -847,7 +847,9 @@ public class ConfigureController extends AbstractBaseController {
list
.
forEach
(
e
->
list
.
forEach
(
e
->
iFireFightingSystemService
.
iotDayReport
(
e
.
get
(
"bizOrgCode"
),
finalStartDate
,
finalEndDate
)
iFireFightingSystemService
.
iotDayReport
(
e
.
get
(
"bizOrgCode"
),
finalStartDate
,
finalEndDate
)
);
);
log
.
info
(
"定时生成 物联报表-日执行结束"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
info
(
"定时生成 物联报表-日执行报错"
);
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
return
CommonResponseUtil
.
success
();
return
CommonResponseUtil
.
success
();
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/TopographyController.java
View file @
d9b2f803
...
@@ -899,9 +899,18 @@ public class TopographyController extends AbstractBaseController {
...
@@ -899,9 +899,18 @@ public class TopographyController extends AbstractBaseController {
String
json
=
JSON
.
toJSONString
(
entity
.
getResult
());
String
json
=
JSON
.
toJSONString
(
entity
.
getResult
());
List
<
Map
<
String
,
String
>>
listObject
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parse
(
json
);
List
<
Map
<
String
,
String
>>
listObject
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parse
(
json
);
List
<
IotDataVO
>
vos
=
new
ArrayList
<>();
List
<
IotDataVO
>
vos
=
new
ArrayList
<>();
Map
<
String
,
List
<
Date
>>
dateMap
=
new
HashMap
<>();
for
(
Map
<
String
,
String
>
mapList
:
listObject
)
{
for
(
Map
<
String
,
String
>
mapList
:
listObject
)
{
for
(
Map
.
Entry
entry
:
mapList
.
entrySet
())
{
for
(
Map
.
Entry
entry
:
mapList
.
entrySet
())
{
if
(!
"name"
.
equals
(
entry
.
getKey
())
&&
!
"deviceName"
.
equals
(
entry
.
getKey
()))
{
if
(!
"name"
.
equals
(
entry
.
getKey
())
&&
!
"deviceName"
.
equals
(
entry
.
getKey
())
&&
!
"time"
.
equals
(
entry
.
getKey
())
&&
!
"createdTime"
.
equals
(
entry
.
getKey
()))
{
if
(!
dateMap
.
containsKey
(
entry
.
getKey
()))
{
ArrayList
<
Date
>
dates1
=
new
ArrayList
<>();
dates1
.
add
(
dateParse
(
mapList
.
get
(
"time"
)));
dateMap
.
put
(
entry
.
getKey
().
toString
(),
dates1
);
}
else
{
dateMap
.
get
(
entry
.
getKey
()).
add
(
dateParse
(
mapList
.
get
(
"time"
)));
}
IotDataVO
vo
=
new
IotDataVO
();
IotDataVO
vo
=
new
IotDataVO
();
vo
.
setKey
(
String
.
valueOf
(
entry
.
getKey
()));
vo
.
setKey
(
String
.
valueOf
(
entry
.
getKey
()));
vo
.
setValue
(
String
.
valueOf
(
entry
.
getValue
()));
vo
.
setValue
(
String
.
valueOf
(
entry
.
getValue
()));
...
@@ -909,25 +918,15 @@ public class TopographyController extends AbstractBaseController {
...
@@ -909,25 +918,15 @@ public class TopographyController extends AbstractBaseController {
}
}
}
}
}
}
Map
<
String
,
List
<
Date
>>
dateMap
=
new
HashMap
<>();
// for (int i = 0; i < vos.size(); i = i + 2) {
for
(
int
i
=
0
;
i
<
vos
.
size
();
i
=
i
+
2
)
{
// Date useDate = null;
Date
useDate
=
null
;
// String indexKey = null;
String
indexKey
=
null
;
// if (vos.get(i).getKey().equals("time")) {
if
(
vos
.
get
(
i
).
getKey
().
equals
(
"time"
))
{
// useDate = dateParse(vos.get(i).getValue().toString());
useDate
=
dateParse
(
vos
.
get
(
i
).
getValue
().
toString
());
// indexKey = String.valueOf(vos.get(i + 1).getKey());
indexKey
=
String
.
valueOf
(
vos
.
get
(
i
+
1
).
getKey
());
// }
}
else
{
//
useDate
=
dateParse
(
vos
.
get
(
i
).
getValue
().
toString
());
// }
indexKey
=
String
.
valueOf
(
vos
.
get
(
i
).
getKey
());
}
if
(!
dateMap
.
containsKey
(
indexKey
))
{
ArrayList
<
Date
>
dates1
=
new
ArrayList
<>();
dates1
.
add
(
useDate
);
dateMap
.
put
(
indexKey
,
dates1
);
}
else
{
dateMap
.
get
(
indexKey
).
add
(
useDate
);
}
}
List
<
EquipmentSpecificIndex
>
indexes
=
equipmentSpecificIndexMapper
.
getEquipmentSpeIndexByIotCodeAndTrend
(
iotCode
);
List
<
EquipmentSpecificIndex
>
indexes
=
equipmentSpecificIndexMapper
.
getEquipmentSpeIndexByIotCodeAndTrend
(
iotCode
);
if
(
0
<
indexes
.
size
())
{
if
(
0
<
indexes
.
size
())
{
List
<
TopographyIotIndexTrendVo
>
list
=
new
ArrayList
<>();
List
<
TopographyIotIndexTrendVo
>
list
=
new
ArrayList
<>();
...
@@ -1437,13 +1436,17 @@ public class TopographyController extends AbstractBaseController {
...
@@ -1437,13 +1436,17 @@ public class TopographyController extends AbstractBaseController {
private
Date
dateParse
(
String
value
)
throws
ParseException
{
private
Date
dateParse
(
String
value
)
throws
ParseException
{
String
strDate
=
value
.
substring
(
0
,
19
);
if
(
value
.
length
()
>
19
)
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
ISO8601_DATE_HOUR_MIN_SEC
);
String
strDate
=
value
.
substring
(
0
,
19
);
SimpleDateFormat
sdf1
=
new
SimpleDateFormat
(
DateUtils
.
DATE_TIME_PATTERN
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
ISO8601_DATE_HOUR_MIN_SEC
);
sdf
.
setTimeZone
(
TimeZone
.
getTimeZone
(
"UTC"
));
SimpleDateFormat
sdf1
=
new
SimpleDateFormat
(
DateUtils
.
DATE_TIME_PATTERN
);
Date
date
=
sdf
.
parse
(
strDate
);
sdf
.
setTimeZone
(
TimeZone
.
getTimeZone
(
"UTC"
));
String
time
=
DateTimeUtil
.
format
(
date
,
DateTimeUtil
.
ISO_DATE_HOUR24_MIN_SEC
);
Date
date
=
sdf
.
parse
(
strDate
);
return
sdf1
.
parse
(
time
);
String
time
=
DateTimeUtil
.
format
(
date
,
DateTimeUtil
.
ISO_DATE_HOUR24_MIN_SEC
);
return
sdf1
.
parse
(
time
);
}
else
{
return
DateUtils
.
dateParse
(
value
,
DateUtils
.
DATE_TIME_PATTERN
);
}
}
}
/***
/***
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/EquipmentSpecificAlarmMapper.java
View file @
d9b2f803
...
@@ -232,4 +232,6 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif
...
@@ -232,4 +232,6 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif
List
<
Map
<
String
,
Object
>>
stationInfo
();
List
<
Map
<
String
,
Object
>>
stationInfo
();
void
updateStatusByAlarm
();
void
updateStatusByAlarm
();
void
clearAlarmData
(
@Param
(
"equipmentSpecificId"
)
Long
equipmentSpecificId
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/ManufacturerInfoMapper.java
View file @
d9b2f803
...
@@ -2,6 +2,9 @@ package com.yeejoin.equipmanage.mapper;
...
@@ -2,6 +2,9 @@ package com.yeejoin.equipmanage.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.equipmanage.common.entity.ManufacturerInfo
;
import
com.yeejoin.equipmanage.common.entity.ManufacturerInfo
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
/**
* Mapper 接口
* Mapper 接口
...
@@ -14,7 +17,6 @@ public interface ManufacturerInfoMapper extends BaseMapper<ManufacturerInfo> {
...
@@ -14,7 +17,6 @@ public interface ManufacturerInfoMapper extends BaseMapper<ManufacturerInfo> {
int
checkName
(
String
name
,
Long
id
);
int
checkName
(
String
name
,
Long
id
);
String
checkDelete
(
Long
id
);
List
<
String
>
checkDelete
(
@Param
(
"ids"
)
List
<
Long
>
ids
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/ApplicationRunnerImpl.java
View file @
d9b2f803
...
@@ -62,6 +62,6 @@ public class ApplicationRunnerImpl implements ApplicationRunner {
...
@@ -62,6 +62,6 @@ public class ApplicationRunnerImpl implements ApplicationRunner {
iSourceStatistics
.
initAllCategoryStatisticsData
(
SourceTypeEnum
.
IOT
);
iSourceStatistics
.
initAllCategoryStatisticsData
(
SourceTypeEnum
.
IOT
);
maintenanceResourceDataService
.
subscribeTopic
();
maintenanceResourceDataService
.
subscribeTopic
();
emqKeeper
.
getMqttClient
().
subscribe
(
ConfigPageTopicEnum
.
INTEGRATE
.
getTopic
(),
2
,
integratePageDataListener
);
emqKeeper
.
subscript
(
ConfigPageTopicEnum
.
INTEGRATE
.
getTopic
(),
2
,
integratePageDataListener
);
}
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentIndexImpl.java
View file @
d9b2f803
...
@@ -131,8 +131,8 @@ public class EquipmentIndexImpl extends ServiceImpl<EquipmentIndexMapper, Equipm
...
@@ -131,8 +131,8 @@ public class EquipmentIndexImpl extends ServiceImpl<EquipmentIndexMapper, Equipm
CarProperty
carProperty
=
new
CarProperty
();
CarProperty
carProperty
=
new
CarProperty
();
carProperty
.
setCarId
(
car
.
getId
());
carProperty
.
setCarId
(
car
.
getId
());
carProperty
.
setEquipmentIndexId
(
equipmentIndex
.
getId
());
carProperty
.
setEquipmentIndexId
(
equipmentIndex
.
getId
());
carProperty
.
setEquipmentIndexKey
(
equipmentIndex
.
getPerfQuota
Name
());
carProperty
.
setEquipmentIndexKey
(
equipmentIndex
.
getPerfQuota
DefinitionId
());
carProperty
.
setEquipmentIndexName
(
equipmentIndex
.
getPerfQuota
DefinitionId
());
carProperty
.
setEquipmentIndexName
(
equipmentIndex
.
getPerfQuota
Name
());
if
(
bool
.
get
())
{
if
(
bool
.
get
())
{
carProperty
.
setEmergencyLevelColor
(
signalClassify
.
getEmergencyLevelColor
());
carProperty
.
setEmergencyLevelColor
(
signalClassify
.
getEmergencyLevelColor
());
carProperty
.
setIsAlarm
(
signalClassify
.
getIsAlarm
());
carProperty
.
setIsAlarm
(
signalClassify
.
getIsAlarm
());
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentServiceImpl.java
View file @
d9b2f803
...
@@ -383,14 +383,8 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
...
@@ -383,14 +383,8 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
@Override
@Override
public
String
checkDelete
(
List
<
Long
>
ids
)
{
public
String
checkDelete
(
List
<
Long
>
ids
)
{
String
res
=
""
;
List
<
String
>
s
=
manufacturerInfoMapper
.
checkDelete
(
ids
);
for
(
Long
id
:
ids
)
{
return
String
.
join
(
","
,
s
);
String
s
=
manufacturerInfoMapper
.
checkDelete
(
id
);
if
(
s
!=
null
&&
!(
""
).
equals
(
s
))
{
res
=
res
+
s
+
" , "
;
}
}
return
res
;
}
}
@Override
@Override
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificAlarmLogServiceImpl.java
View file @
d9b2f803
...
@@ -175,7 +175,7 @@ public class EquipmentSpecificAlarmLogServiceImpl extends ServiceImpl<EquipmentS
...
@@ -175,7 +175,7 @@ public class EquipmentSpecificAlarmLogServiceImpl extends ServiceImpl<EquipmentS
EquipmentIndex
equipmentIndex
=
equipmentIndexMapper
.
getMessage
(
equipmentSpecificId
,
pressurePumpStart
);
EquipmentIndex
equipmentIndex
=
equipmentIndexMapper
.
getMessage
(
equipmentSpecificId
,
pressurePumpStart
);
LambdaQueryWrapper
<
EquipmentSpecificAlarm
>
lambda
=
new
QueryWrapper
<
EquipmentSpecificAlarm
>().
lambda
();
LambdaQueryWrapper
<
EquipmentSpecificAlarm
>
lambda
=
new
QueryWrapper
<
EquipmentSpecificAlarm
>().
lambda
();
lambda
.
eq
(
EquipmentSpecificAlarm:
:
getEquipmentSpecificId
,
equipmentSpecific
.
getId
());
lambda
.
eq
(
EquipmentSpecificAlarm:
:
getEquipmentSpecificId
,
equipmentSpecific
.
getId
());
lambda
.
eq
(
EquipmentSpecificAlarm:
:
getEquipmentSpecificIndexKey
,
equipmentSpecific
.
getRealtimeIotIndexKey
()
);
lambda
.
eq
(
EquipmentSpecificAlarm:
:
getEquipmentSpecificIndexKey
,
pressurePumpStart
);
lambda
.
eq
(
EquipmentSpecificAlarm:
:
getStatus
,
AlarmStatusEnum
.
BJ
.
getCode
());
lambda
.
eq
(
EquipmentSpecificAlarm:
:
getStatus
,
AlarmStatusEnum
.
BJ
.
getCode
());
lambda
.
orderByDesc
(
EquipmentSpecificAlarm:
:
getCreateDate
);
lambda
.
orderByDesc
(
EquipmentSpecificAlarm:
:
getCreateDate
);
lambda
.
last
(
"limit 1"
);
lambda
.
last
(
"limit 1"
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificSerivceImpl.java
View file @
d9b2f803
...
@@ -1004,6 +1004,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
...
@@ -1004,6 +1004,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
equipmentDetailService
.
removeById
(
equipmentSpecific
.
getEquipmentDetailId
());
equipmentDetailService
.
removeById
(
equipmentSpecific
.
getEquipmentDetailId
());
}
}
if
(
res
>
0
)
{
if
(
res
>
0
)
{
equipmentSpecificAlarmMapper
.
clearAlarmData
(
id
);
// 删除设备动态表单扩展属性
// 删除设备动态表单扩展属性
return
formInstanceEquipService
.
deleteInstanceById
(
id
);
return
formInstanceEquipService
.
deleteInstanceById
(
id
);
}
else
{
}
else
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FormInstanceEquipServiceImpl.java
View file @
d9b2f803
...
@@ -214,11 +214,16 @@ public class FormInstanceEquipServiceImpl extends ServiceImpl<FormInstanceEquipM
...
@@ -214,11 +214,16 @@ public class FormInstanceEquipServiceImpl extends ServiceImpl<FormInstanceEquipM
@Override
@Override
@Transactional
(
rollbackFor
=
{
Exception
.
class
,
BaseException
.
class
})
@Transactional
(
rollbackFor
=
{
Exception
.
class
,
BaseException
.
class
})
public
Object
updateForm
(
Long
instanceId
,
String
orgCode
,
Map
<
String
,
Object
>
map
,
String
groupCode
)
{
public
Object
updateForm
(
Long
instanceId
,
String
orgCode
,
Map
<
String
,
Object
>
map
,
String
groupCode
)
{
if
(
com
.
yeejoin
.
equipmanage
.
common
.
utils
.
StringUtil
.
isNotEmpty
(
groupCode
))
{
List
<
FormInstanceEquip
>
list
=
this
.
queryByInstanceId
(
instanceId
);
map
.
keySet
().
forEach
(
x
->
{
if
(
CollectionUtils
.
isEmpty
(
list
))
{
formInstanceEquipMapper
.
updateFormFieldValue
(
instanceId
,
x
,
String
.
valueOf
(
map
.
get
(
x
)));
saveForm
(
groupCode
,
orgCode
,
map
,
String
.
valueOf
(
instanceId
));
});
}
else
{
return
CommonResponseUtil
.
success
();
if
(
com
.
yeejoin
.
equipmanage
.
common
.
utils
.
StringUtil
.
isNotEmpty
(
groupCode
))
{
map
.
keySet
().
forEach
(
x
->
{
formInstanceEquipMapper
.
updateFormFieldValue
(
instanceId
,
x
,
String
.
valueOf
(
map
.
get
(
x
)));
});
return
CommonResponseUtil
.
success
();
}
}
}
return
null
;
return
null
;
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttReceiveServiceImpl.java
View file @
d9b2f803
...
@@ -74,8 +74,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -74,8 +74,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
private
static
Map
<
String
,
TemperatureAlarmDto
>
temperatureMap
=
new
HashMap
<>();
private
static
Map
<
String
,
TemperatureAlarmDto
>
temperatureMap
=
new
HashMap
<>();
static
IEquipmentSpecificIndexService
equipmentSpecificIndexService
;
static
IEquipmentSpecificIndexService
equipmentSpecificIndexService
;
@Value
(
"${iot.async.flag}"
)
private
boolean
iotAsyncExecutorFlag
;
@Autowired
@Autowired
public
void
setEquipmentSpecificIndexService
(
IEquipmentSpecificIndexService
equipmentSpecificIndexService
)
{
public
void
setEquipmentSpecificIndexService
(
IEquipmentSpecificIndexService
equipmentSpecificIndexService
)
{
MqttReceiveServiceImpl
.
equipmentSpecificIndexService
=
equipmentSpecificIndexService
;
MqttReceiveServiceImpl
.
equipmentSpecificIndexService
=
equipmentSpecificIndexService
;
...
@@ -382,250 +381,262 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -382,250 +381,262 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
message
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
message
);
String
dataType
=
jsonObject
.
getString
(
"datatype"
);
String
dataType
=
jsonObject
.
getString
(
"datatype"
);
String
indexAddress
,
value
,
timeStamp
,
quality
=
null
;
String
indexAddress
=
null
,
value
,
timeStamp
,
quality
=
null
;
//如果消息是遥信类型,进行指标转换
//如果消息是遥信类型,进行指标转换
if
(
dataType
!=
null
&&
dataType
.
equals
(
"state"
))
{
assert
dataType
!=
null
;
if
(
dataType
.
equals
(
"state"
))
{
indexAddress
=
jsonObject
.
getString
(
"scadaid"
);
indexAddress
=
jsonObject
.
getString
(
"scadaid"
);
value
=
jsonObject
.
getInteger
(
"value"
)
==
1
?
"true"
:
"false"
;
value
=
jsonObject
.
getInteger
(
"value"
)
==
1
?
"true"
:
"false"
;
timeStamp
=
jsonObject
.
getString
(
"timestamp"
);
timeStamp
=
jsonObject
.
getString
(
"timestamp"
);
}
else
{
}
else
if
(
dataType
.
equals
(
"analog"
))
{
indexAddress
=
jsonObject
.
getString
(
"key"
);
indexAddress
=
jsonObject
.
getString
(
"key"
);
value
=
jsonObject
.
getString
(
"value"
);
value
=
jsonObject
.
getString
(
"value"
);
timeStamp
=
jsonObject
.
getString
(
"time_stamp"
);
timeStamp
=
jsonObject
.
getString
(
"time_stamp"
);
quality
=
jsonObject
.
getString
(
"quality"
);
quality
=
jsonObject
.
getString
(
"quality"
);
}
else
{
indexAddress
=
jsonObject
.
getString
(
"key"
);
value
=
jsonObject
.
getFloat
(
"value"
)
==
0.0
?
"false"
:
"true"
;
timeStamp
=
jsonObject
.
getString
(
"time_stamp"
);
quality
=
jsonObject
.
getString
(
"quality"
);
}
}
Map
<
Object
,
Object
>
equipmentIndexKeyMap
=
redisUtils
.
hmget
(
RedisKey
.
EQUIP_INDEX_ADDRESS_KEY
);
if
(
equipmentIndexKeyMap
.
get
(
indexAddress
)
!=
null
)
{
EquipmentSpecificIndex
equipmentSpeIndex
=
equipmentSpecificIndexService
.
getEquipmentSpeIndexByIndexAddress
(
indexAddress
,
null
);
EquipmentSpecificIndex
equipmentSpeIndex
=
equipmentSpecificIndexService
.
getEquipmentSpeIndexByIndexAddress
(
indexAddress
,
null
);
equipmentSpeIndex
.
setValue
(
value
);
if
(
equipmentSpeIndex
==
null
)
{
equipmentSpeIndex
.
setValueLabel
(
valueTranslate
(
value
,
equipmentSpeIndex
.
getValueEnum
()));
return
;
equipmentSpeIndex
.
setEquipmentType
(
topicEntity
.
getType
());
}
equipmentSpeIndex
.
setUpdateDate
(
new
Date
());
equipmentSpeIndex
.
setValue
(
value
);
equipmentSpeIndex
.
setQuality
(
quality
);
equipmentSpeIndex
.
setValueLabel
(
valueTranslate
(
value
,
equipmentSpeIndex
.
getValueEnum
()));
equipmentSpeIndex
.
setDataType
(
dataType
);
equipmentSpeIndex
.
setEquipmentType
(
topicEntity
.
getType
());
equipmentSpeIndex
.
setTimeStamp
(
timeStamp
);
equipmentSpeIndex
.
setUpdateDate
(
new
Date
());
equipmentSpeIndex
.
setUUID
(
UUIDUtils
.
getUUID
());
equipmentSpeIndex
.
setQuality
(
quality
);
equipmentSpeIndex
.
setDataType
(
dataType
);
equipmentSpeIndex
.
setTimeStamp
(
timeStamp
);
equipmentSpeIndex
.
setUUID
(
UUIDUtils
.
getUUID
());
IotDataVO
iotDataVO
=
new
IotDataVO
();
IotDataVO
iotDataVO
=
new
IotDataVO
();
iotDataVO
.
setKey
(
equipmentSpeIndex
.
getNameKey
());
iotDataVO
.
setKey
(
equipmentSpeIndex
.
getNameKey
());
iotDataVO
.
setValue
(
value
);
iotDataVO
.
setValue
(
value
);
iotDatalist
.
add
(
iotDataVO
);
iotDatalist
.
add
(
iotDataVO
);
// iEquipmentSpecificSerivce.getEquipSpecificDetailsByEquipmentId(equipmentSpeIndex.getEquipmentSpecificId());
QueryWrapper
<
EquipmentSpecific
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
EquipmentSpecific
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"id"
,
equipmentSpeIndex
.
getEquipmentSpecificId
());
queryWrapper
.
eq
(
"id"
,
equipmentSpeIndex
.
getEquipmentSpecificId
());
EquipmentSpecific
equipmentSpecific
=
iEquipmentSpecificSerivce
.
getOne
(
queryWrapper
);
EquipmentSpecific
equipmentSpecific
=
iEquipmentSpecificSerivce
.
getOne
(
queryWrapper
);
if
(
equipmentSpecific
==
null
)
{
if
(
equipmentSpecific
==
null
)
{
return
;
return
;
}
}
String
iotCode
=
equipmentSpecific
.
getIotCode
();
String
iotCode
=
equipmentSpecific
.
getIotCode
();
StringBuilder
endIndex
=
new
StringBuilder
(
iotCode
).
insert
(
8
,
'/'
);
String
iotTopic
=
"influxdb/"
+
endIndex
;
if
(
isSendIot
)
{
JSONObject
msg
=
new
JSONObject
();
msg
.
put
(
equipmentSpeIndex
.
getEquipmentIndexKey
(),
value
);
mqttSendGateway
.
sendToMqtt
(
iotTopic
,
JSON
.
toJSONString
(
msg
));
}
List
<
EquipmentSpecificVo
>
eqIotCodeList
=
iEquipmentSpecificSerivce
.
getEquipAndCarIotcodeByIotcode
(
iotCode
);
List
<
EquipmentSpecificVo
>
eqIotCodeList
=
iEquipmentSpecificSerivce
.
getEquipAndCarIotcodeByIotcode
(
iotCode
);
if
(
eqIotCodeList
.
isEmpty
())
{
if
(
eqIotCodeList
.
isEmpty
())
{
log
.
info
(
"该数据{}不存在!"
,
iotCode
);
log
.
info
(
"该数据{}不存在!"
,
iotCode
);
return
;
return
;
}
}
if
(
eqIotCodeList
.
size
()
>
1
)
{
if
(
eqIotCodeList
.
size
()
>
1
)
{
log
.
info
(
"有重复的{}数据!"
,
iotCode
);
log
.
info
(
"有重复的{}数据!"
,
iotCode
);
}
}
EquipmentSpecificVo
equipmentSpecificVo
=
eqIotCodeList
.
get
(
0
);
EquipmentSpecificVo
equipmentSpecificVo
=
eqIotCodeList
.
get
(
0
);
topicEntity
.
setType
(
equipmentSpecificVo
.
getType
());
topicEntity
.
setType
(
equipmentSpecificVo
.
getType
());
topicEntity
.
setCode
(
equipmentSpecificVo
.
getCode
());
topicEntity
.
setCode
(
equipmentSpecificVo
.
getCode
());
//es存储数据
//es存储数据
eSeqService
.
saveESEquiplistSpecificBySystemESVO
(
equipmentSpeIndex
,
String
.
valueOf
(
equipmentSpecificVo
.
getSystemId
()),
equipmentSpecificVo
.
getSystemName
());
eSeqService
.
saveESEquiplistSpecificBySystemESVO
(
equipmentSpeIndex
,
String
.
valueOf
(
equipmentSpecificVo
.
getSystemId
()),
equipmentSpecificVo
.
getSystemName
());
//更新装备性能指标
//更新装备性能指标
equipmentSpecificIndexService
.
updateById
(
equipmentSpeIndex
);
equipmentSpecificIndexService
.
updateById
(
equipmentSpeIndex
);
// 更新设备表指标状态
// 更新设备表指标状态
iEquipmentSpecificSerivce
.
updateEquipmentSpecIndexRealtimeData
(
equipmentSpeIndex
);
iEquipmentSpecificSerivce
.
updateEquipmentSpecIndexRealtimeData
(
equipmentSpeIndex
);
equipmentSpecificIndexList
.
add
(
equipmentSpeIndex
);
equipmentSpecificIndexList
.
add
(
equipmentSpeIndex
);
indexStateList
.
add
(
createIndexStateVo
(
equipmentSpeIndex
));
indexStateList
.
add
(
createIndexStateVo
(
equipmentSpeIndex
));
// 添加指标报告
// 添加指标报告
saveEquipmentAlarmReportDay
(
equipmentSpeIndex
);
saveEquipmentAlarmReportDay
(
equipmentSpeIndex
);
// 火眼数据构造告警指标逻辑
// 火眼数据构造告警指标逻辑
equipmentSpeIndex
=
handleTemperatureAlarm
(
equipmentSpeIndex
,
iotDatalist
);
equipmentSpeIndex
=
handleTemperatureAlarm
(
equipmentSpeIndex
,
iotDatalist
);
boolean
alarmFlag
=
false
;
boolean
alarmFlag
=
false
;
Map
<
String
,
String
>
messageBodyMap
=
new
HashMap
<>();
Map
<
String
,
String
>
messageBodyMap
=
new
HashMap
<>();
//管网压力、泡沫罐信息、水箱液位告警处理
//管网压力、泡沫罐信息、水箱液位告警处理
if
(
iotDataVO
.
getKey
().
toLowerCase
().
equals
(
CAFS_FoamTank_FoamTankLevel
.
toLowerCase
())
||
if
(
iotDataVO
.
getKey
().
toLowerCase
().
equals
(
CAFS_FoamTank_FoamTankLevel
.
toLowerCase
())
||
FHS_PipePressureDetector_PipePressure
.
toLowerCase
().
equals
(
iotDataVO
.
getKey
().
toLowerCase
())
||
FHS_PipePressureDetector_PipePressure
.
toLowerCase
().
equals
(
iotDataVO
.
getKey
().
toLowerCase
())
||
iotDataVO
.
getKey
().
toLowerCase
().
equals
(
CAFS_WaterTank_WaterTankLevel
.
toLowerCase
()))
{
iotDataVO
.
getKey
().
toLowerCase
().
equals
(
CAFS_WaterTank_WaterTankLevel
.
toLowerCase
()))
{
alarmFlag
=
doFoamTankLevel
(
iotDataVO
,
equipmentSpeIndex
,
messageBodyMap
);
alarmFlag
=
doFoamTankLevel
(
iotDataVO
,
equipmentSpeIndex
,
messageBodyMap
);
}
}
//消防水池液位处理
//消防水池液位处理
if
(
iotDataVO
.
getKey
().
toLowerCase
().
equals
(
FHS_FirePoolDevice_WaterLevel
.
toLowerCase
())
||
if
(
iotDataVO
.
getKey
().
toLowerCase
().
equals
(
FHS_FirePoolDevice_WaterLevel
.
toLowerCase
())
||
iotDataVO
.
getKey
().
toLowerCase
().
equals
(
FHS_WirelessliquidDetector_WaterLevel
.
toLowerCase
()))
{
iotDataVO
.
getKey
().
toLowerCase
().
equals
(
FHS_WirelessliquidDetector_WaterLevel
.
toLowerCase
()))
{
alarmFlag
=
doWaterPoolLevel
(
iotDataVO
,
equipmentSpeIndex
,
messageBodyMap
);
alarmFlag
=
doWaterPoolLevel
(
iotDataVO
,
equipmentSpeIndex
,
messageBodyMap
);
}
}
// 遥测数据生成告警事件、日志处理
// 遥测数据生成告警事件、日志处理
if
(
iotDataVO
.
getKey
().
toLowerCase
().
equals
(
CAFS_FoamTank_FoamTankLevel
.
toLowerCase
())
||
if
(
iotDataVO
.
getKey
().
toLowerCase
().
equals
(
CAFS_FoamTank_FoamTankLevel
.
toLowerCase
())
||
FHS_PipePressureDetector_PipePressure
.
toLowerCase
().
equals
(
iotDataVO
.
getKey
().
toLowerCase
())
||
FHS_PipePressureDetector_PipePressure
.
toLowerCase
().
equals
(
iotDataVO
.
getKey
().
toLowerCase
())
||
iotDataVO
.
getKey
().
toLowerCase
().
equals
(
CAFS_WaterTank_WaterTankLevel
.
toLowerCase
())
||
iotDataVO
.
getKey
().
toLowerCase
().
equals
(
CAFS_WaterTank_WaterTankLevel
.
toLowerCase
())
||
iotDataVO
.
getKey
().
toLowerCase
().
equals
(
FHS_FirePoolDevice_WaterLevel
.
toLowerCase
())
||
iotDataVO
.
getKey
().
toLowerCase
().
equals
(
FHS_FirePoolDevice_WaterLevel
.
toLowerCase
())
||
iotDataVO
.
getKey
().
toLowerCase
().
equals
(
FHS_WirelessliquidDetector_WaterLevel
.
toLowerCase
()))
{
iotDataVO
.
getKey
().
toLowerCase
().
equals
(
FHS_WirelessliquidDetector_WaterLevel
.
toLowerCase
()))
{
handlingAlarms
(
equipmentSpeIndex
,
alarmFlag
);
handlingAlarms
(
equipmentSpeIndex
,
alarmFlag
);
}
}
// 指标告警处理
if
(
equipmentSpeIndex
.
getIsAlarm
()
!=
null
&&
1
==
equipmentSpeIndex
.
getIsAlarm
())
{
equipmentSpecificAlarms
.
addAll
(
createIndexAlarmRecord
(
equipmentSpeIndex
,
messageBodyMap
));
}
// 遥测遥信数据推送云端kafka
JSONObject
jsonObjectXf
=
new
JSONObject
();
jsonObjectXf
.
put
(
"data_class"
,
"realdata"
);
if
(
equipmentSpeIndex
.
getIsTrend
()
==
1
)
{
jsonObjectXf
.
put
(
"data_type"
,
"analog"
);
}
else
{
jsonObjectXf
.
put
(
"data_type"
,
"state"
);
}
String
date
=
DateUtils
.
date2LongStr
(
new
Date
());
jsonObjectXf
.
put
(
"op_type"
,
"subscribe_emergency"
);
JSONObject
jsonObjectCondition
=
new
JSONObject
();
jsonObjectCondition
.
put
(
"station_psr_id"
,
stationCode
);
jsonObjectCondition
.
put
(
"station_name"
,
stationName
);
jsonObjectCondition
.
put
(
"data_upload_time"
,
date
);
jsonObjectXf
.
put
(
"condition"
,
jsonObjectCondition
);
JSONObject
jsonObjectData
=
new
JSONObject
();
jsonObjectData
.
put
(
"psrId"
,
stationCode
);
jsonObjectData
.
put
(
"astId"
,
equipmentSpeIndex
.
getSpecificCode
());
jsonObjectData
.
put
(
"equipType"
,
equipmentSpeIndex
.
getEquipmentCode
());
jsonObjectData
.
put
(
"name"
,
equipmentSpeIndex
.
getEquipmentSpecificName
()
+
"-"
+
equipmentSpeIndex
.
getEquipmentSpecificIndexName
());
if
(
value
.
equals
(
"true"
))
{
jsonObjectData
.
put
(
"value"
,
"1"
);
}
else
if
(
value
.
equals
(
"false"
))
{
jsonObjectData
.
put
(
"value"
,
"0"
);
}
else
{
jsonObjectData
.
put
(
"value"
,
value
);
}
jsonObjectData
.
put
(
"measurementType"
,
null
==
equipmentSpeIndex
.
getEquipmentIndexKey
()
?
""
:
equipmentSpeIndex
.
getEquipmentIndexKey
());
jsonObjectData
.
put
(
"dateTime"
,
date
);
jsonObjectData
.
put
(
"quality"
,
"0"
);
// 量测质量码:0 有效,1 无效
List
<
JSONObject
>
jsonObjects
=
Arrays
.
asList
(
jsonObjectData
);
jsonObjectXf
.
put
(
"data"
,
jsonObjects
);
// 指标告警处理
if
(
equipmentSpeIndex
.
getIsAlarm
()
!=
null
&&
1
==
equipmentSpeIndex
.
getIsAlarm
())
{
equipmentSpecificAlarms
.
addAll
(
createIndexAlarmRecord
(
equipmentSpeIndex
,
messageBodyMap
));
}
// 遥测遥信数据推送云端kafka
JSONObject
jsonObjectXf
=
new
JSONObject
();
jsonObjectXf
.
put
(
"data_class"
,
"realdata"
);
// 遥测
if
(
equipmentSpeIndex
.
getIsTrend
()
==
1
)
{
if
(!
isOpenTelemetering
&&
equipmentSpeIndex
.
getIsTrend
()
==
1
)
{
jsonObjectXf
.
put
(
"data_type"
,
"analog"
);
}
else
{
jsonObjectXf
.
put
(
"data_type"
,
"state"
);
}
}
else
{
String
date
=
DateUtils
.
date2LongStr
(
new
Date
());
try
{
jsonObjectXf
.
put
(
"op_type"
,
"subscribe_emergency"
);
emqKeeper
.
getMqttClient
().
publish
(
"emq.xf.created"
,
jsonObjectXf
.
toString
().
getBytes
(),
1
,
false
);
JSONObject
jsonObjectCondition
=
new
JSONObject
();
log
.
info
(
"遥测遥信数据推送云端kafka成功"
);
jsonObjectCondition
.
put
(
"station_psr_id"
,
stationCode
);
}
catch
(
MqttException
e
)
{
jsonObjectCondition
.
put
(
"station_name"
,
stationName
);
log
.
error
(
"遥测遥信数据推送云端kafka失败=====>"
+
e
.
getMessage
());
jsonObjectCondition
.
put
(
"data_upload_time"
,
date
);
e
.
printStackTrace
();
jsonObjectXf
.
put
(
"condition"
,
jsonObjectCondition
);
JSONObject
jsonObjectData
=
new
JSONObject
();
jsonObjectData
.
put
(
"psrId"
,
stationCode
);
jsonObjectData
.
put
(
"astId"
,
equipmentSpeIndex
.
getSpecificCode
());
jsonObjectData
.
put
(
"equipType"
,
equipmentSpeIndex
.
getEquipmentCode
());
jsonObjectData
.
put
(
"name"
,
equipmentSpeIndex
.
getEquipmentSpecificName
()
+
"-"
+
equipmentSpeIndex
.
getEquipmentSpecificIndexName
());
if
(
value
.
equals
(
"true"
))
{
jsonObjectData
.
put
(
"value"
,
"1"
);
}
else
if
(
value
.
equals
(
"false"
))
{
jsonObjectData
.
put
(
"value"
,
"0"
);
}
else
{
jsonObjectData
.
put
(
"value"
,
value
);
}
}
}
jsonObjectData
.
put
(
"measurementType"
,
null
==
equipmentSpeIndex
.
getEquipmentIndexKey
()
?
""
:
equipmentSpeIndex
.
getEquipmentIndexKey
());
jsonObjectData
.
put
(
"dateTime"
,
date
);
jsonObjectData
.
put
(
"quality"
,
"0"
);
// 量测质量码:0 有效,1 无效
List
<
JSONObject
>
jsonObjects
=
Arrays
.
asList
(
jsonObjectData
);
// 报警数据保存
jsonObjectXf
.
put
(
"data"
,
jsonObjects
);
List
<
EquipmentSpecificAlarmLog
>
alarmLogs
=
new
ArrayList
<>();
if
(!
ObjectUtils
.
isEmpty
(
equipmentSpecificAlarms
))
{
equipmentSpecificAlarmService
.
saveOrUpdateBatch
(
equipmentSpecificAlarms
);
}
// 需要在事务提交之后,否则事务隔离查询不出数据
// 遥测
TransactionSynchronizationManager
.
registerSynchronization
(
new
TransactionSynchronization
()
{
if
(!
isOpenTelemetering
&&
equipmentSpeIndex
.
getIsTrend
()
==
1
)
{
@Override
public
void
afterCommit
()
{
equipmentSpecificAlarms
.
forEach
(
action
->
{
if
(
AlarmStatusEnum
.
BJ
.
getCode
()
==
action
.
getStatus
())
{
alarmLogs
.
add
(
addEquipAlarmLogRecord
(
action
));
if
(
ValidationUtil
.
isEmpty
(
action
.
getAlamContent
()))
{
action
.
setAlamContent
(
action
.
getEquipmentSpecificName
()
+
action
.
getEquipmentSpecificIndexName
());
}
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQDQR
.
getTopic
(),
JSONArray
.
toJSON
(
action
).
toString
());
}
else
{
alarmLogs
.
addAll
(
upAlarmLogStatus
(
action
.
getIotCode
(),
action
.
getEquipmentSpecificIndexKey
(),
action
.
getTraceId
(),
equipmentSpecificAlarmLogService
,
false
));
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQYQR
.
getTopic
(),
JSONArray
.
toJSON
(
action
).
toString
());
bool
=
Boolean
.
TRUE
;
}
});
// 直流中心消息推送刷新
}
else
{
publishDataToDCCenterPage
(
equipmentSpecificIndexList
);
try
{
emqKeeper
.
getMqttClient
().
publish
(
"emq.xf.created"
,
jsonObjectXf
.
toString
().
getBytes
(),
1
,
false
);
log
.
info
(
"遥测遥信数据推送云端kafka成功"
);
}
catch
(
MqttException
e
)
{
log
.
error
(
"遥测遥信数据推送云端kafka失败=====>"
+
e
.
getMessage
());
e
.
printStackTrace
();
}
}
// 四横八纵遥测信号信息列表刷新
// 报警数据保存
publishNormalIndexValueToPage
(
equipmentSpecificIndexList
);
List
<
EquipmentSpecificAlarmLog
>
alarmLogs
=
new
ArrayList
<>();
if
(
"zd"
.
equals
(
system
))
{
if
(!
ObjectUtils
.
isEmpty
(
equipmentSpecificAlarms
))
{
System
.
out
.
println
(
"站端系统----------------"
);
equipmentSpecificAlarmService
.
saveOrUpdateBatch
(
equipmentSpecificAlarms
);
}
// 向预控系统发送消息
// 需要在事务提交之后,否则事务隔离查询不出数据
sendEquipSpecIndexToAutosysTopic
(
equipmentSpecificIndexList
);
TransactionSynchronizationManager
.
registerSynchronization
(
new
TransactionSynchronization
()
{
@Override
public
void
afterCommit
()
{
equipmentSpecificAlarms
.
forEach
(
action
->
{
if
(
AlarmStatusEnum
.
BJ
.
getCode
()
==
action
.
getStatus
())
{
alarmLogs
.
add
(
addEquipAlarmLogRecord
(
action
));
if
(
ValidationUtil
.
isEmpty
(
action
.
getAlamContent
()))
{
action
.
setAlamContent
(
action
.
getEquipmentSpecificName
()
+
action
.
getEquipmentSpecificIndexName
());
}
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQDQR
.
getTopic
(),
JSONArray
.
toJSON
(
action
).
toString
());
}
else
{
alarmLogs
.
addAll
(
upAlarmLogStatus
(
action
.
getIotCode
(),
action
.
getEquipmentSpecificIndexKey
(),
action
.
getTraceId
(),
equipmentSpecificAlarmLogService
,
false
));
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQYQR
.
getTopic
(),
JSONArray
.
toJSON
(
action
).
toString
());
bool
=
Boolean
.
TRUE
;
}
});
//
首页性能指标数据订阅
//
直流中心消息推送刷新
mqttSendGateway
.
sendToMqtt
(
indexTopic
,
JSON
.
toJSONString
(
indexStateList
)
);
publishDataToDCCenterPage
(
equipmentSpecificIndexList
);
// 组态大屏消息推送,设备表实时指标修改
// 四横八纵遥测信号信息列表刷新
intePageSysDataRefresh
(
equipmentSpecificIndexList
,
topicEntity
);
publishNormalIndexValueToPage
(
equipmentSpecificIndexList
);
if
(
"zd"
.
equals
(
system
))
{
System
.
out
.
println
(
"站端系统----------------"
);
// 数字换流站同步指标修改
// 向预控系统发送消息
syncSpecificIndexsToGS
(
equipmentSpecificIndexList
);
sendEquipSpecIndexToAutosysTopic
(
equipmentSpecificIndexList
);
// 则更新拓扑节点数据及告警状态
// 首页性能指标数据订阅
updateNodeDateByEquipId
(
equipmentSpecificIndexList
);
mqttSendGateway
.
sendToMqtt
(
indexTopic
,
JSON
.
toJSONString
(
indexStateList
)
);
// 向画布推送
// 组态大屏消息推送,设备表实时指标修改
publishDataToCanvas
(
equipmentSpecificIndexList
);
intePageSysDataRefresh
(
equipmentSpecificIndexList
,
topicEntity
);
// 向其他系统推送报警
// 数字换流站同步指标修改
equipmentAlarmLogsToOtherSystems
(
alarmLogs
);
syncSpecificIndexsToGS
(
equipmentSpecificIndexList
);
if
(
equipmentSpecificVo
.
getEcode
()
!=
null
)
{
// 则更新拓扑节点数据及告警状态
String
ecode
=
equipmentSpecificVo
.
getEcode
();
updateNodeDateByEquipId
(
equipmentSpecificIndexList
);
boolean
flag
=
false
;
//消防泵
// 向画布推送
String
[]
strings
=
pumpCodes
.
split
(
","
);
publishDataToCanvas
(
equipmentSpecificIndexList
);
for
(
String
string
:
strings
)
{
if
(
ecode
.
startsWith
(
string
))
{
//通知>消防应急预案
topicEntity
.
setType
(
"xfb"
);
mqttSendGateway
.
sendToMqtt
(
emergencyDisposalIndicators
,
JSONObject
.
toJSONString
(
topicEntity
));
flag
=
true
;
break
;
}
}
// 消防炮
// 向其他系统推送报警
String
[]
stringxfp
=
monitorCodes
.
split
(
","
);
equipmentAlarmLogsToOtherSystems
(
alarmLogs
);
if
(!
flag
)
{
for
(
String
string1
:
stringxfp
)
{
if
(
equipmentSpecificVo
.
getEcode
()
!=
null
)
{
if
(
ecode
.
startsWith
(
string1
))
{
String
ecode
=
equipmentSpecificVo
.
getEcode
();
boolean
flag
=
false
;
//消防泵
String
[]
strings
=
pumpCodes
.
split
(
","
);
for
(
String
string
:
strings
)
{
if
(
ecode
.
startsWith
(
string
))
{
//通知>消防应急预案
//通知>消防应急预案
topicEntity
.
setType
(
"xf
p
"
);
topicEntity
.
setType
(
"xf
b
"
);
mqttSendGateway
.
sendToMqtt
(
emergencyDisposalIndicators
,
JSONObject
.
toJSONString
(
topicEntity
));
mqttSendGateway
.
sendToMqtt
(
emergencyDisposalIndicators
,
JSONObject
.
toJSONString
(
topicEntity
));
flag
=
true
;
flag
=
true
;
break
;
break
;
}
}
}
}
}
//消防水源
// 消防炮
if
(!
flag
)
{
String
[]
stringxfp
=
monitorCodes
.
split
(
","
);
List
<
Map
>
lit
=
iEquipmentSpecificSerivce
.
getWater
(
equipmentSpecificVo
.
getId
());
if
(!
flag
)
{
if
(
lit
!=
null
&&
lit
.
size
()
>
0
)
{
for
(
String
string1
:
stringxfp
)
{
topicEntity
.
setType
(
"xfsy"
);
if
(
ecode
.
startsWith
(
string1
))
{
mqttSendGateway
.
sendToMqtt
(
emergencyDisposalIndicators
,
JSONObject
.
toJSONString
(
topicEntity
));
//通知>消防应急预案
topicEntity
.
setType
(
"xfp"
);
mqttSendGateway
.
sendToMqtt
(
emergencyDisposalIndicators
,
JSONObject
.
toJSONString
(
topicEntity
));
flag
=
true
;
break
;
}
}
}
//消防水源
if
(!
flag
)
{
List
<
Map
>
lit
=
iEquipmentSpecificSerivce
.
getWater
(
equipmentSpecificVo
.
getId
());
if
(
lit
!=
null
&&
lit
.
size
()
>
0
)
{
topicEntity
.
setType
(
"xfsy"
);
mqttSendGateway
.
sendToMqtt
(
emergencyDisposalIndicators
,
JSONObject
.
toJSONString
(
topicEntity
));
}
}
}
}
}
}
}
}
}
}
});
});
}
}
}
/**
/**
...
@@ -654,32 +665,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -654,32 +665,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
String
deviceCode
=
jsonObject
.
getString
(
"deviceCode"
);
String
deviceCode
=
jsonObject
.
getString
(
"deviceCode"
);
String
gatewayId
=
jsonObject
.
getString
(
"gatewayId"
);
String
gatewayId
=
jsonObject
.
getString
(
"gatewayId"
);
String
value
=
jsonObject
.
getString
(
"value"
);
String
value
=
jsonObject
.
getString
(
"value"
);
String
key
=
indexAddress
+
"_"
+
gatewayId
;
Map
<
Object
,
Object
>
equipmentIndexVOMap
=
redisUtils
.
hmget
(
RedisKey
.
EQUIP_INDEX_ADDRESS
);
if
(
equipmentIndexVOMap
.
get
(
key
)
!=
null
)
{
EquipmentIndexVO
equipmentSpeIndex
=
(
EquipmentIndexVO
)
equipmentIndexVOMap
.
get
(
key
);
tagsMap
.
put
(
"key"
,
indexAddress
+
"_"
+
gatewayId
);
String
valueLabel
=
valueTranslate
(
value
,
equipmentSpeIndex
.
getValueEnum
());
fieldsMap
.
put
(
"traceId"
,
traceId
);
fieldsMap
.
put
(
"address"
,
indexAddress
);
fieldsMap
.
put
(
"value"
,
value
);
fieldsMap
.
put
(
"valueLabel"
,
valueLabel
.
equals
(
""
)
?
value
:
valueLabel
);
fieldsMap
.
put
(
"gatewayId"
,
gatewayId
);
fieldsMap
.
put
(
"dataType"
,
dataType
);
fieldsMap
.
put
(
"equipmentId"
,
equipmentSpeIndex
.
getEquipmentId
());
// fieldsMap.put("equipmentIndexName", equipmentSpeIndex.getEquipmentIndexName());
// fieldsMap.put("equipmentIndexKey", equipmentSpeIndex.getEquipmentIndexKey());
// fieldsMap.put("isAlarm", equipmentSpeIndex.getIsAlarm().toString());
fieldsMap
.
put
(
"unit"
,
equipmentSpeIndex
.
getUnitName
());
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
fieldsMap
.
put
(
"createdTime"
,
simpleDateFormat
.
format
(
new
Date
()));
fieldsMap
.
put
(
"equipmentIndex"
,
JSON
.
toJSONString
(
equipmentSpeIndex
));
//保存influxDB库
influxDbConnection
.
insert
(
"iot_data"
,
tagsMap
,
fieldsMap
);
}
EquipmentSpecificIndex
equipmentSpeIndex
=
equipmentSpecificIndexService
.
getEquipmentSpeIndexByIndexAddress
(
indexAddress
,
gatewayId
);
EquipmentSpecificIndex
equipmentSpeIndex
=
equipmentSpecificIndexService
.
getEquipmentSpeIndexByIndexAddress
(
indexAddress
,
gatewayId
);
...
@@ -698,6 +683,25 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -698,6 +683,25 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
//更新装备性能指标
//更新装备性能指标
//equipmentSpecificIndexService.updateById(equipmentSpeIndex);
//equipmentSpecificIndexService.updateById(equipmentSpeIndex);
tagsMap
.
put
(
"key"
,
indexAddress
+
"_"
+
gatewayId
);
fieldsMap
.
put
(
"traceId"
,
traceId
);
fieldsMap
.
put
(
"address"
,
indexAddress
);
fieldsMap
.
put
(
"value"
,
value
);
fieldsMap
.
put
(
"gatewayId"
,
gatewayId
);
fieldsMap
.
put
(
"dataType"
,
dataType
);
fieldsMap
.
put
(
"equipmentId"
,
equipmentSpeIndex
.
getEquipmentId
());
fieldsMap
.
put
(
"equipmentIndexName"
,
equipmentSpeIndex
.
getEquipmentIndexName
());
fieldsMap
.
put
(
"equipmentIndexKey"
,
equipmentSpeIndex
.
getEquipmentIndexKey
());
fieldsMap
.
put
(
"isAlarm"
,
equipmentSpeIndex
.
getIsAlarm
().
toString
());
fieldsMap
.
put
(
"unit"
,
equipmentSpeIndex
.
getUnit
());
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
fieldsMap
.
put
(
"createdTime"
,
simpleDateFormat
.
format
(
new
Date
()));
fieldsMap
.
put
(
"equipmentIndex"
,
JSON
.
toJSONString
(
equipmentSpeIndex
));
//保存influxDB库
influxDbConnection
.
insert
(
"iot_data"
,
tagsMap
,
fieldsMap
);
QueryWrapper
<
EquipmentSpecific
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
EquipmentSpecific
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"id"
,
equipmentSpeIndex
.
getEquipmentSpecificId
());
queryWrapper
.
eq
(
"id"
,
equipmentSpeIndex
.
getEquipmentSpecificId
());
EquipmentSpecific
equipmentSpecific
=
iEquipmentSpecificSerivce
.
getOne
(
queryWrapper
);
EquipmentSpecific
equipmentSpecific
=
iEquipmentSpecificSerivce
.
getOne
(
queryWrapper
);
...
@@ -809,12 +813,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -809,12 +813,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
iotDataListToCacheMap
(
iotDatalist
);
iotDataListToCacheMap
(
iotDatalist
);
iotDatalist
.
forEach
(
iotDataVO
->
{
iotDatalist
.
forEach
(
iotDataVO
->
{
boolean
alarmFlag
=
false
;
boolean
alarmFlag
=
false
;
String
indexKey
=
iotDataVO
.
getKey
();
String
indexValue
=
iotDataVO
.
getValue
().
toString
();
// 稳压泵启停信号处理
if
(
indexKey
.
equals
(
pressurePumpStart
))
{
pressurePump
(
indexKey
,
indexValue
,
iotDatalist
,
topicEntity
);
}
for
(
EquipmentSpecificIndex
equipmentSpecificIndex
:
indexList
)
{
for
(
EquipmentSpecificIndex
equipmentSpecificIndex
:
indexList
)
{
if
(!
ObjectUtils
.
isEmpty
(
equipmentSpecificIndex
.
getNameKey
())
if
(!
ObjectUtils
.
isEmpty
(
equipmentSpecificIndex
.
getNameKey
())
&&
equipmentSpecificIndex
.
getNameKey
().
toLowerCase
().
equals
(
iotDataVO
.
getKey
().
toLowerCase
()))
{
&&
equipmentSpecificIndex
.
getNameKey
().
toLowerCase
().
equals
(
iotDataVO
.
getKey
().
toLowerCase
()))
{
...
@@ -934,6 +933,15 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -934,6 +933,15 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
TransactionSynchronizationManager
.
registerSynchronization
(
new
TransactionSynchronization
()
{
TransactionSynchronizationManager
.
registerSynchronization
(
new
TransactionSynchronization
()
{
@Override
@Override
public
void
afterCommit
()
{
public
void
afterCommit
()
{
iotDatalist
.
forEach
(
iotDataVO
->
{
String
indexKey
=
iotDataVO
.
getKey
();
String
indexValue
=
iotDataVO
.
getValue
().
toString
();
// 稳压泵启停信号处理
if
(
indexKey
.
equals
(
pressurePumpStart
))
{
pressurePump
(
indexKey
,
indexValue
,
iotDatalist
,
topicEntity
);
}
});
equipmentSpecificAlarms
.
forEach
(
action
->
{
equipmentSpecificAlarms
.
forEach
(
action
->
{
EquipmentSpecific
specific
=
equipmentSpecificMapper
.
selectById
(
action
.
getEquipmentSpecificId
());
EquipmentSpecific
specific
=
equipmentSpecificMapper
.
selectById
(
action
.
getEquipmentSpecificId
());
if
(
AlarmStatusEnum
.
BJ
.
getCode
()
==
action
.
getStatus
())
{
if
(
AlarmStatusEnum
.
BJ
.
getCode
()
==
action
.
getStatus
())
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/config/StartLoader.java
View file @
d9b2f803
...
@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.jcs.api.service.ICcsToStationUserInfo;
...
@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.jcs.api.service.ICcsToStationUserInfo;
import
com.yeejoin.amos.component.rule.config.ClazzUtils
;
import
com.yeejoin.amos.component.rule.config.ClazzUtils
;
import
com.yeejoin.amos.component.rule.config.RuleConfig
;
import
com.yeejoin.amos.component.rule.config.RuleConfig
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -16,6 +17,7 @@ import org.springframework.boot.ApplicationRunner;
...
@@ -16,6 +17,7 @@ import org.springframework.boot.ApplicationRunner;
import
org.springframework.core.annotation.Order
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.util.List
;
import
java.util.List
;
...
@@ -50,22 +52,25 @@ public class StartLoader implements ApplicationRunner {
...
@@ -50,22 +52,25 @@ public class StartLoader implements ApplicationRunner {
public
void
loadSysParams
(){
public
void
loadSysParams
(){
try
{
try
{
emqKeeper
.
getMqttClient
().
subscribe
(
topic
,
(
s
,
mqttMessage
)
->
{
emqKeeper
.
subscript
(
topic
,
1
,
new
EmqxListener
()
{
byte
[]
payload
=
mqttMessage
.
getPayload
();
@Override
public
void
processMessage
(
String
s
,
MqttMessage
mqttMessage
)
throws
Exception
{
byte
[]
payload
=
mqttMessage
.
getPayload
();
String
obj
=
new
String
(
payload
);
String
obj
=
new
String
(
payload
);
if
(!
ValidationUtil
.
isEmpty
(
obj
))
{
if
(!
ValidationUtil
.
isEmpty
(
obj
))
{
JSONObject
json
=
JSON
.
parseObject
(
obj
);
JSONObject
json
=
JSON
.
parseObject
(
obj
);
AlertNewsDto
alertNewsDto
=
new
AlertNewsDto
(
"物联警情"
,
AlertNewsDto
alertNewsDto
=
new
AlertNewsDto
(
"物联警情"
,
"物联设备发生警情,发生位置:"
+(
json
.
get
(
"address"
)!=
null
?
json
.
get
(
"address"
).
toString
():
""
)+
"物联设备发生警情,发生位置:"
+(
json
.
get
(
"address"
)!=
null
?
json
.
get
(
"address"
).
toString
():
""
)+
",事发单位:"
+(
json
.
get
(
"unitInvolvedName"
)!=
null
?
json
.
get
(
"unitInvolvedName"
).
toString
():
""
)
",事发单位:"
+(
json
.
get
(
"unitInvolvedName"
)!=
null
?
json
.
get
(
"unitInvolvedName"
).
toString
():
""
)
+
",联系人:"
+(
json
.
get
(
"contactUser"
)!=
null
?
json
.
get
(
"contactUser"
).
toString
():
""
)
+
",联系人:"
+(
json
.
get
(
"contactUser"
)!=
null
?
json
.
get
(
"contactUser"
).
toString
():
""
)
+
",联系电话:"
+(
json
.
get
(
"contactPhone"
)!=
null
?
json
.
get
(
"contactPhone"
).
toString
():
""
)+
".请尽快处理!"
,
+
",联系电话:"
+(
json
.
get
(
"contactPhone"
)!=
null
?
json
.
get
(
"contactPhone"
).
toString
():
""
)+
".请尽快处理!"
,
json
.
get
(
"id"
).
toString
(),
json
);
json
.
get
(
"id"
).
toString
(),
json
);
emqKeeper
.
getMqttClient
().
publish
(
topicweb
,
JSON
.
toJSON
(
alertNewsDto
).
toString
().
getBytes
(
"UTF-8"
),
1
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
topicweb
,
JSON
.
toJSON
(
alertNewsDto
).
toString
().
getBytes
(
"UTF-8"
),
1
,
false
);
}
}
}
});
});
}
catch
(
Mqtt
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
info
(
"订阅物联警情异常"
,
e
);
logger
.
info
(
"订阅物联警情异常"
,
e
);
}
}
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/FirefightersController.java
View file @
d9b2f803
...
@@ -5,6 +5,7 @@ import java.util.*;
...
@@ -5,6 +5,7 @@ import java.util.*;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.common.api.entity.*
;
import
com.yeejoin.amos.boot.module.common.api.enums.ExceptionEnum
;
import
com.yeejoin.amos.boot.module.common.api.enums.ExceptionEnum
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
...
@@ -50,14 +51,6 @@ import com.yeejoin.amos.boot.module.common.api.dto.FirefightersZhDto;
...
@@ -50,14 +51,6 @@ import com.yeejoin.amos.boot.module.common.api.dto.FirefightersZhDto;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.PeopleBasicInfoDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.PeopleBasicInfoDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.PeopleInfoDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.PeopleInfoDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireTeam
;
import
com.yeejoin.amos.boot.module.common.api.entity.Firefighters
;
import
com.yeejoin.amos.boot.module.common.api.entity.FirefightersContacts
;
import
com.yeejoin.amos.boot.module.common.api.entity.FirefightersContract
;
import
com.yeejoin.amos.boot.module.common.api.entity.FirefightersEducation
;
import
com.yeejoin.amos.boot.module.common.api.entity.FirefightersJacket
;
import
com.yeejoin.amos.boot.module.common.api.entity.FirefightersPost
;
import
com.yeejoin.amos.boot.module.common.api.entity.FirefightersThought
;
import
com.yeejoin.amos.boot.module.common.api.enums.OrgPersonEnum
;
import
com.yeejoin.amos.boot.module.common.api.enums.OrgPersonEnum
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FireTeamServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FireTeamServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersContactsServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersContactsServiceImpl
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/OrganizationImpl.java
View file @
d9b2f803
...
@@ -38,12 +38,25 @@ public class OrganizationImpl extends BaseService<Organization, Organization, Or
...
@@ -38,12 +38,25 @@ public class OrganizationImpl extends BaseService<Organization, Organization, Or
@Override
@Override
public
Page
<
Map
<
String
,
Object
>>
getOrganizationInfo
(
Page
<
Map
<
String
,
Object
>>
page
,
String
bizOrgCode
)
{
public
Page
<
Map
<
String
,
Object
>>
getOrganizationInfo
(
Page
<
Map
<
String
,
Object
>>
page
,
String
bizOrgCode
)
{
Page
<
Map
<
String
,
Object
>>
page1
=
new
Page
<>();
Page
<
Map
<
String
,
Object
>>
page1
=
new
Page
<>();
List
<
Map
<
String
,
Object
>>
list
=
organizationMapper
.
getOrganizationInfo
(
page
,
bizOrgCode
).
getRecords
(
);
List
<
Map
<
String
,
Object
>>
list
=
organizationMapper
.
getOrganizationInfo
(
bizOrgCode
);
LambdaQueryWrapper
<
Organization
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
Organization
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
orderByDesc
(
Organization:
:
getSort
);
wrapper
.
orderByDesc
(
Organization:
:
getSort
);
List
<
Organization
>
organizations
=
this
.
baseMapper
.
selectList
(
wrapper
);
List
<
Organization
>
organizations
=
this
.
baseMapper
.
selectList
(
wrapper
);
List
<
Map
<
String
,
Object
>>
res
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
res
=
new
ArrayList
<>();
if
(
0
<
list
.
size
())
{
if
(
0
<
list
.
size
())
{
// 获取值长
Map
<
String
,
Object
>
resMap
=
this
.
baseMapper
.
getTeamLeader
();
Map
<
String
,
Object
>
leaderMap
=
new
HashMap
<>();
if
(
ObjectUtils
.
isEmpty
(
resMap
.
get
(
"value"
)))
{
leaderMap
.
put
(
"name"
,
resMap
.
get
(
"name"
)
+
""
);
leaderMap
.
put
(
"value"
,
""
);
}
else
{
// 跟现场确认此处值长只有一人,所以只做一人处理
leaderMap
.
put
(
"name"
,
resMap
.
get
(
"name"
)
+
" "
+
"1人"
);
leaderMap
.
put
(
"value"
,
resMap
.
get
(
"value"
)
+
"-"
+
resMap
.
get
(
"tel"
));
}
res
.
add
(
leaderMap
);
for
(
Map
<
String
,
Object
>
map
:
list
)
{
for
(
Map
<
String
,
Object
>
map
:
list
)
{
Map
<
String
,
Object
>
tempMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
tempMap
=
new
HashMap
<>();
if
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"value"
)))
{
if
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"value"
)))
{
...
@@ -51,19 +64,22 @@ public class OrganizationImpl extends BaseService<Organization, Organization, Or
...
@@ -51,19 +64,22 @@ public class OrganizationImpl extends BaseService<Organization, Organization, Or
tempMap
.
put
(
"value"
,
""
);
tempMap
.
put
(
"value"
,
""
);
}
else
{
}
else
{
tempMap
.
put
(
"name"
,
map
.
get
(
"name"
)
+
" "
+
map
.
get
(
"value"
)
+
"人"
);
tempMap
.
put
(
"name"
,
map
.
get
(
"name"
)
+
" "
+
map
.
get
(
"value"
)
+
"人"
);
Organization
organization
=
organizations
.
stream
().
filter
(
x
->
x
.
getEmergencyTeamName
().
equals
(
map
.
get
(
"name"
))).
collect
(
Collectors
.
toList
()).
get
(
0
);
List
<
Organization
>
organizationList
=
organizations
.
stream
().
filter
(
x
->
x
.
getEmergencyTeamName
().
equals
(
map
.
get
(
"name"
))).
collect
(
Collectors
.
toList
());
String
[]
nameArr
=
organization
.
getGroupLeader
().
split
(
","
);
if
(
0
<
organizationList
.
size
())
{
List
<
String
>
nameList
=
Arrays
.
asList
(
nameArr
);
Organization
organization
=
organizationList
.
get
(
0
);
String
[]
telArr
=
new
String
[
nameList
.
size
()];
String
[]
nameArr
=
organization
.
getGroupLeader
().
split
(
","
);
if
(
ObjectUtils
.
isNotEmpty
(
organization
.
getGroupLeaderTel
()))
{
List
<
String
>
nameList
=
Arrays
.
asList
(
nameArr
);
telArr
=
organization
.
getGroupLeaderTel
().
split
(
"\n"
);
String
[]
telArr
=
new
String
[
nameList
.
size
()];
}
if
(
ObjectUtils
.
isNotEmpty
(
organization
.
getGroupLeaderTel
()))
{
List
<
String
>
telList
=
Arrays
.
asList
(
telArr
);
telArr
=
organization
.
getGroupLeaderTel
().
split
(
"\n"
);
List
<
String
>
valueList
=
new
ArrayList
<>();
}
for
(
int
i
=
0
;
i
<
nameList
.
size
();
i
++)
{
List
<
String
>
telList
=
Arrays
.
asList
(
telArr
);
valueList
.
add
(
nameList
.
get
(
i
)
+
"-"
+
telList
.
get
(
i
));
List
<
String
>
valueList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
nameList
.
size
();
i
++)
{
valueList
.
add
(
nameList
.
get
(
i
)
+
"-"
+
telList
.
get
(
i
));
}
tempMap
.
put
(
"value"
,
String
.
join
(
","
,
valueList
));
}
}
tempMap
.
put
(
"value"
,
String
.
join
(
","
,
valueList
));
}
}
res
.
add
(
tempMap
);
res
.
add
(
tempMap
);
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/controller/InputItemController.java
View file @
d9b2f803
...
@@ -713,8 +713,8 @@ public class InputItemController extends AbstractBaseController {
...
@@ -713,8 +713,8 @@ public class InputItemController extends AbstractBaseController {
}
}
//如果为1则为否,顺应机场逻辑
//如果为1则为否,顺应机场逻辑
param
.
setCustomType
(
"1"
.
equals
(
param
.
getCustomType
())
?
null
:
param
.
getCustomType
());
/*
param.setCustomType("1".equals(param.getCustomType()) ? null : param.getCustomType());
param
.
setKeyPartsType
(
"1"
.
equals
(
param
.
getKeyPartsType
())
?
null
:
param
.
getKeyPartsType
());
param.setKeyPartsType("1".equals(param.getKeyPartsType()) ? null : param.getKeyPartsType());
*/
AgencyUserModel
user
=
getUserInfo
();
AgencyUserModel
user
=
getUserInfo
();
if
(
ObjectUtils
.
isEmpty
(
user
))
{
if
(
ObjectUtils
.
isEmpty
(
user
))
{
return
CommonResponseUtil
.
failure
(
"用户session过期"
);
return
CommonResponseUtil
.
failure
(
"用户session过期"
);
...
@@ -752,6 +752,7 @@ public class InputItemController extends AbstractBaseController {
...
@@ -752,6 +752,7 @@ public class InputItemController extends AbstractBaseController {
map
.
put
(
"OkScore"
,
param
.
getOkScore
()!=
null
?
param
.
getOkScore
():
0
);
map
.
put
(
"OkScore"
,
param
.
getOkScore
()!=
null
?
param
.
getOkScore
():
0
);
map
.
put
(
"NoScore"
,
param
.
getNoScore
()!=
null
?
param
.
getNoScore
():
0
);
map
.
put
(
"NoScore"
,
param
.
getNoScore
()!=
null
?
param
.
getNoScore
():
0
);
map
.
put
(
"CheckType"
,
param
.
getCheckType
());
map
.
put
(
"CheckType"
,
param
.
getCheckType
());
inputItem
.
setInputClassify
(
param
.
getInputClassify
());
inputItem
.
setDataJson
(
JSONObject
.
toJSONString
(
map
));
inputItem
.
setDataJson
(
JSONObject
.
toJSONString
(
map
));
}
else
if
(
param
.
getItemType
().
equals
(
"选择"
)){
}
else
if
(
param
.
getItemType
().
equals
(
"选择"
)){
...
@@ -771,10 +772,10 @@ public class InputItemController extends AbstractBaseController {
...
@@ -771,10 +772,10 @@ public class InputItemController extends AbstractBaseController {
map
.
put
(
"ValidDown"
,
param
.
getValidDown
()!=
null
?
param
.
getValidDown
():
""
);
map
.
put
(
"ValidDown"
,
param
.
getValidDown
()!=
null
?
param
.
getValidDown
():
""
);
map
.
put
(
"OkUp"
,
param
.
getOkUp
()!=
null
?
param
.
getOkUp
():
""
);
map
.
put
(
"OkUp"
,
param
.
getOkUp
()!=
null
?
param
.
getOkUp
():
""
);
map
.
put
(
"OkDown"
,
param
.
getOkDown
()!=
null
?
param
.
getOkDown
():
""
);
map
.
put
(
"OkDown"
,
param
.
getOkDown
()!=
null
?
param
.
getOkDown
():
""
);
map
.
put
(
"CheckValidUp"
,
param
.
getCheckValidUp
().
equals
(
"
false
"
)?
false
:
true
);
map
.
put
(
"CheckValidUp"
,
param
.
getCheckValidUp
().
equals
(
"
否
"
)?
false
:
true
);
map
.
put
(
"CheckValidDown"
,
param
.
getCheckValidDown
().
equals
(
"
false
"
)?
false
:
true
);
map
.
put
(
"CheckValidDown"
,
param
.
getCheckValidDown
().
equals
(
"
否
"
)?
false
:
true
);
map
.
put
(
"CheckOkUp"
,
param
.
getCheckOkUp
().
equals
(
"
false
"
)?
false
:
true
);
map
.
put
(
"CheckOkUp"
,
param
.
getCheckOkUp
().
equals
(
"
否
"
)?
false
:
true
);
map
.
put
(
"CheckOkDown"
,
param
.
getCheckOkDown
().
equals
(
"
false
"
)?
false
:
true
);
map
.
put
(
"CheckOkDown"
,
param
.
getCheckOkDown
().
equals
(
"
否
"
)?
false
:
true
);
map
.
put
(
"Precision"
,
param
.
getPrecision
()!=
null
?
param
.
getPrecision
():
0
);
map
.
put
(
"Precision"
,
param
.
getPrecision
()!=
null
?
param
.
getPrecision
():
0
);
inputItem
.
setDataJson
(
JSONObject
.
toJSONString
(
map
));
inputItem
.
setDataJson
(
JSONObject
.
toJSONString
(
map
));
}
}
...
...
amos-boot-system-equip/src/main/java/com/yeejoin/AmostEquipApplication.java
View file @
d9b2f803
...
@@ -49,8 +49,8 @@ public class AmostEquipApplication {
...
@@ -49,8 +49,8 @@ public class AmostEquipApplication {
@Autowired
@Autowired
private
EmqKeeper
emqKeeper
;
private
EmqKeeper
emqKeeper
;
//
@Autowired
@Autowired
//
private CarIotListener carIotListener;
private
CarIotListener
carIotListener
;
@Autowired
@Autowired
private
CarIotNewListener
carIotNewListener
;
private
CarIotNewListener
carIotNewListener
;
...
@@ -60,7 +60,7 @@ public class AmostEquipApplication {
...
@@ -60,7 +60,7 @@ public class AmostEquipApplication {
public
static
void
main
(
String
[]
args
)
throws
UnknownHostException
{
public
static
void
main
(
String
[]
args
)
throws
UnknownHostException
{
ConfigurableApplicationContext
context
=
SpringApplication
.
run
(
AmostEquipApplication
.
class
,
args
);
ConfigurableApplicationContext
context
=
SpringApplication
.
run
(
AmostEquipApplication
.
class
,
args
);
Environment
env
=
context
.
getEnvironment
();
Environment
env
=
context
.
getEnvironment
();
String
ip
=
InetAddress
.
getLocalHost
().
getHostAddress
();
String
ip
=
InetAddress
.
getLocalHost
().
getHostAddress
();
...
@@ -85,8 +85,14 @@ public class AmostEquipApplication {
...
@@ -85,8 +85,14 @@ public class AmostEquipApplication {
*/
*/
@Bean
@Bean
void
initMqtt
()
throws
MqttException
{
void
initMqtt
()
throws
MqttException
{
emqKeeper
.
getMqttClient
().
subscribe
(
"+/+/property"
,
1
,
carIotNewListener
);
try
{
emqKeeper
.
subscript
(
"+/+/property"
,
1
,
carIotListener
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
logger
.
error
(
"EMQ初始化连接失败!"
);
}
}
}
//江西电建服务重启后对于未计时且未结束的里程的进行处理
//江西电建服务重启后对于未计时且未结束的里程的进行处理
@Bean
@Bean
void
initCarMelige
()
{
void
initCarMelige
()
{
...
...
amos-boot-system-equip/src/main/resources/json/nameKeyInfo.json
View file @
d9b2f803
...
@@ -6,8 +6,8 @@
...
@@ -6,8 +6,8 @@
"faultNameKey"
:
"FHS_PressurePump_Fault,FHS_PressurePump_RunFault,FHS_PressurePump_OverLoadFault"
,
"faultNameKey"
:
"FHS_PressurePump_Fault,FHS_PressurePump_RunFault,FHS_PressurePump_OverLoadFault"
,
"expire"
:
14400
,
"expire"
:
14400
,
"countExpire"
:
1209600
,
"countExpire"
:
1209600
,
"equipmentCode"
:
"92010800
KAL44
"
,
"equipmentCode"
:
"92010800"
,
"pipePressureEquipmentCode"
:
"92011000
T5Q44
"
,
"pipePressureEquipmentCode"
:
"92011000"
,
"top"
:
"100"
,
"top"
:
"100"
,
"countRedisKey"
:
"Count"
"countRedisKey"
:
"Count"
}
}
...
...
amos-boot-system-equip/src/main/resources/mapper/EquipmentCategoryMapper.xml
View file @
d9b2f803
...
@@ -573,6 +573,7 @@
...
@@ -573,6 +573,7 @@
AND biz_org_code like concat(#{bizOrgCode}, '%')
AND biz_org_code like concat(#{bizOrgCode}, '%')
AND is_delete = '0'
AND is_delete = '0'
AND input_type!='1'
AND input_type!='1'
AND key_parts_type='0'
</select>
</select>
<select
id=
"countByCustomType"
resultType=
"int"
>
<select
id=
"countByCustomType"
resultType=
"int"
>
...
@@ -581,6 +582,7 @@
...
@@ -581,6 +582,7 @@
AND biz_org_code like concat(#{bizOrgCode}, '%')
AND biz_org_code like concat(#{bizOrgCode}, '%')
AND is_delete = '0'
AND is_delete = '0'
AND input_type!='1'
AND input_type!='1'
AND custom_type='0'
</select>
</select>
<select
id=
"countAll"
resultType=
"int"
>
<select
id=
"countAll"
resultType=
"int"
>
...
...
amos-boot-system-equip/src/main/resources/mapper/EquipmentDetailMapper.xml
View file @
d9b2f803
...
@@ -155,10 +155,10 @@
...
@@ -155,10 +155,10 @@
<select
id=
"checkDelete"
resultType=
"String"
>
<select
id=
"checkDelete"
resultType=
"String"
>
select
select
(select name from wl_equipment_detail eq where eq.id = sto.equipment_detail_id) as name
(select name from wl_equipment_detail eq where eq.id = sto.equipment_detail_id) as name
from wl_stock_detail as sto
from wl_stock_detail as sto
where
where
equipment_detail_id = #{id}
equipment_detail_id = #{id}
group by equipment_detail_id
group by equipment_detail_id
</select>
</select>
<select
id=
"getWareId"
resultType=
"Long"
>
<select
id=
"getWareId"
resultType=
"Long"
>
...
...
amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificAlarmMapper.xml
View file @
d9b2f803
...
@@ -1590,4 +1590,10 @@
...
@@ -1590,4 +1590,10 @@
GROUP BY
GROUP BY
a.`name`
a.`name`
</select>
</select>
<delete
id=
"clearAlarmData"
>
DELETE FROM wl_equipment_specific_alarm WHERE equipment_specific_id = #{equipmentSpecificId};
DELETE FROM wl_equipment_specific_alarm_log WHERE equipment_specific_id = #{equipmentSpecificId};
DELETE FROM wl_equipment_alarm_report_day WHERE equipment_specific_id = #{equipmentSpecificId};
</delete>
</mapper>
</mapper>
\ No newline at end of file
amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificIndexMapper.xml
View file @
d9b2f803
...
@@ -491,7 +491,7 @@
...
@@ -491,7 +491,7 @@
left join wl_warehouse_structure str on str.id = wes.warehouse_structure_id
left join wl_warehouse_structure str on str.id = wes.warehouse_structure_id
left join wl_stock_detail wlsd on wes.id = wlsd.equipment_specific_id
left join wl_stock_detail wlsd on wes.id = wlsd.equipment_specific_id
where wed.production_date is not null
where wed.production_date is not null
and wlsd.status != 7
and wlsd.status != 7
</select>
</select>
<select
id=
"getEquipIndexInIndex"
resultType=
"com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex"
>
<select
id=
"getEquipIndexInIndex"
resultType=
"com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex"
>
SELECT
SELECT
...
@@ -510,7 +510,7 @@
...
@@ -510,7 +510,7 @@
LEFT JOIN wl_equipment_detail wled ON es.equipment_detail_id = wled.id
LEFT JOIN wl_equipment_detail wled ON es.equipment_detail_id = wled.id
<where>
<where>
<if
test=
"list != null and list.size > 0 and type = 'id'"
>
<if
test=
"list != null and list.size > 0 and type = 'id'"
>
si.equipment_index_key IN
si.equipment_index_key
IN
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
","
>
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{item}
#{item}
</foreach>
</foreach>
...
@@ -523,45 +523,45 @@
...
@@ -523,45 +523,45 @@
<!-- 根据信号索引查询装备性能指标 -->
<!-- 根据信号索引查询装备性能指标 -->
<select
id=
"getEquipmentSpeIndexByIndexAddress"
<select
id=
"getEquipmentSpeIndexByIndexAddress"
resultType=
"com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex"
>
resultType=
"com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex"
>
SELECT wesi.id AS id,
SELECT wesi.id
AS id,
wei.name_key AS nameKey,
wei.name_key AS nameKey,
wesi.value AS value,
wesi.value AS value,
wesi.equipment_specific_id AS equipmentSpecificId,
wesi.equipment_specific_id AS equipmentSpecificId,
wesi.equipment_index_id AS equipmentIndexId,
wesi.equipment_index_id AS equipmentIndexId,
wesi.equipment_index_name AS equipmentIndexName,
wesi.equipment_index_name AS equipmentIndexName,
wesi.equipment_index_key AS equipmentIndexKey,
wesi.equipment_index_key AS equipmentIndexKey,
wesi.value_label AS valueLabel,
wesi.value_label AS valueLabel,
wei.type_code AS typeCode,
wei.type_code AS typeCode,
wei.type_name AS typeName,
wei.type_name AS typeName,
wei.name AS indexName,
wei.name AS indexName,
wes
i.unit AS indexUnitName,
we
i.unit AS indexUnitName,
wes.org_code AS orgCode,
wes.org_code AS orgCode,
ed.`name` AS equipmentSpecificName,
ed.`name` AS equipmentSpecificName,
ed.equipment_name AS equipmentName,
ed.equipment_name AS equipmentName,
wes.iot_code AS iotCode,
wes.iot_code AS iotCode,
wes.code AS specificCode,
wes.code AS specificCode,
wei.`name` AS equipmentSpecificIndexName,
wei.`name` AS equipmentSpecificIndexName,
wei.`value_enum` AS valueEnum,
wei.`value_enum` AS valueEnum,
wei.is_trend AS isTrend,
wei.is_trend AS isTrend,
wes.qr_code AS qrCode,
wes.qr_code AS qrCode,
wesi.update_date AS updateDate,
wesi.update_date AS updateDate,
ed.code AS equipmentCode,
ed.code AS equipmentCode,
ed.equipment_id AS equipmentId,
ed.equipment_id AS equipmentId,
ed.id AS equipmentDetailId,
ed.id AS equipmentDetailId,
wes.code as equipmentSpecificCode,
wes.code as equipmentSpecificCode,
wes.system_id as systemId,
wes.system_id as systemId,
wesi.is_alarm as isAlarm,
wesi.is_alarm as isAlarm,
wesi.emergency_level_color as emergencyLevelColor,
wesi.emergency_level_color as emergencyLevelColor,
wesi.emergency_level as emergencyLevel,
wesi.emergency_level as emergencyLevel,
wesi.emergency_level_describe as emergencyLevelDescribe,
wesi.emergency_level_describe as emergencyLevelDescribe,
wes.biz_org_name AS bizOrgName,
wes.biz_org_name AS bizOrgName,
wes.biz_org_code AS bizOrgCode
wes.biz_org_code AS bizOrgCode
FROM wl_equipment_specific_index AS wesi
FROM wl_equipment_specific_index AS wesi
LEFT JOIN wl_equipment_specific AS wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_specific AS wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_detail ed ON ed.id = wes.equipment_detail_id
LEFT JOIN wl_equipment_detail ed ON ed.id = wes.equipment_detail_id
LEFT JOIN wl_equipment_index AS wei ON wei.id = wesi.equipment_index_id
LEFT JOIN wl_equipment_index AS wei ON wei.id = wesi.equipment_index_id
WHERE
WHERE
wesi.index_address = #{indexAddress}
wesi.index_address = #{indexAddress}
<if
test=
"gatewayId != null"
>
<if
test=
"gatewayId != null"
>
AND wesi.gateway_id = #{gatewayId}
AND wesi.gateway_id = #{gatewayId}
</if>
</if>
...
...
amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificMapper.xml
View file @
d9b2f803
...
@@ -1410,22 +1410,15 @@
...
@@ -1410,22 +1410,15 @@
WHERE es.id = #{equipmentSpecificId}
WHERE es.id = #{equipmentSpecificId}
</select>
</select>
<delete
id=
"deleteEquipDataBySpecificId"
>
<delete
id=
"deleteEquipDataBySpecificId"
>
DELETE es, ed, esi, ves, esr, esa, esal, eard FROM
DELETE FROM wl_equipment_specific WHERE id = #{specificId};
wl_equipment_specific es
DELETE FROM wl_equipment_detail WHERE id = (SELECT equipment_detail_id FROM wl_equipment_specific WHERE id = #{specificId});
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
DELETE FROM wl_equipment_specific_alarm WHERE equipment_specific_id = #{specificId};
LEFT JOIN wl_equipment_specific_index esi ON es.id = esi.equipment_specific_id
DELETE FROM wl_equipment_specific_alarm_log WHERE equipment_specific_id = #{specificId};
LEFT JOIN wl_video_equipment_specific ves ON es.id = ves.equipment_specific_id
DELETE FROM wl_equipment_alarm_report_day WHERE equipment_specific_id = #{specificId};
LEFT JOIN wl_equipment_specific_relation esr ON ed.id = esr.equipment_specific_id
DELETE FROM wl_equipment_specific_index WHERE equipment_specific_id = #{specificId};
LEFT JOIN wl_equipment_specific_alarm esa ON ed.id = esa.equipment_specific_id
DELETE FROM wl_video_equipment_specific WHERE equipment_specific_id = #{specificId};
LEFT JOIN wl_equipment_specific_alarm_log esal ON ed.id = esal.equipment_specific_id
DELETE FROM wl_equipment_specific_relation WHERE equipment_specific_id = #{specificId};
LEFT JOIN wl_equipment_alarm_report_day eard ON ed.id = eard.equipment_specific_id
WHERE es.id = #{specificId}
</delete>
</delete>
<delete
id=
"deleteEquipDataByStockDetailId"
>
<delete
id=
"deleteEquipDataByStockDetailId"
>
DELETE
DELETE
...
@@ -1877,7 +1870,7 @@
...
@@ -1877,7 +1870,7 @@
WHERE
WHERE
(
(
0
<![CDATA[<>]]>
find_in_set(`fs`.`id`, `s`.`system_id`)
0
<![CDATA[<>]]>
find_in_set(`fs`.`id`, `s`.`system_id`)
)
limit
1
)
LIMIT
1
) AS `chargePersonName`
) AS `chargePersonName`
FROM
FROM
`wl_equipment_specific_index` `si`
`wl_equipment_specific_index` `si`
...
...
amos-boot-system-equip/src/main/resources/mapper/ManufacturerInfoMapper.xml
View file @
d9b2f803
...
@@ -26,8 +26,26 @@
...
@@ -26,8 +26,26 @@
</select>
</select>
<select
id=
"checkDelete"
resultType=
"string"
>
<select
id=
"checkDelete"
resultType=
"string"
>
select name from wl_equipment_detail where equipment_id = #{id}
select
name
from
wl_equipment_detail
<where>
equipment_id IN
<foreach
collection=
"ids"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</where>
union
union
select name from wl_car where equipment_id = #{id}
select
name
from
wl_car
<where>
equipment_id IN
<foreach
collection=
"ids"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</where>
</select>
</select>
</mapper>
</mapper>
amos-boot-system-jcs/src/main/resources/db/changelog/jcs-1.0.0.0.xml
View file @
d9b2f803
...
@@ -3870,7 +3870,7 @@
...
@@ -3870,7 +3870,7 @@
</sql>
</sql>
</changeSet>
</changeSet>
<changeSet
author=
"ltw"
id=
"20230614-ltw-01"
>
<changeSet
author=
"ltw"
id=
"20230614-ltw-01"
runOnChange=
"true"
>
<preConditions
onFail=
"MARK_RAN"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<not>
<columnExists
tableName=
"cb_organization_user"
columnName=
"post_name"
/>
<columnExists
tableName=
"cb_organization_user"
columnName=
"post_name"
/>
...
@@ -3878,7 +3878,19 @@
...
@@ -3878,7 +3878,19 @@
</preConditions>
</preConditions>
<comment>
modify table cb_organization_user modify columns
</comment>
<comment>
modify table cb_organization_user modify columns
</comment>
<sql>
<sql>
ALTER TABLE `cb_organization_user` MODIFY `post_name` varchar(4000) DEFAULT NULL COMMENT '岗位名称'
ALTER TABLE `cb_organization_user` MODIFY `post_name` varchar(4000) DEFAULT NULL COMMENT '岗位名称';
</sql>
</changeSet>
<changeSet
author=
"ky"
id=
"2023-06-21-001"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"cb_org_usr"
columnName=
"person_img"
/>
</not>
</preConditions>
<comment>
cb_org_usr add column
</comment>
<sql>
alter table `cb_org_usr` add column `person_img` varchar(255) DEFAULT NULL COMMENT '人员照片'
</sql>
</sql>
</changeSet>
</changeSet>
...
...
amos-boot-system-patrol/src/main/java/com/yeejoin/amos/PatrolApplication.java
View file @
d9b2f803
...
@@ -102,8 +102,8 @@ public class PatrolApplication {
...
@@ -102,8 +102,8 @@ public class PatrolApplication {
@Bean
@Bean
void
initMqtt
()
{
void
initMqtt
()
{
try
{
try
{
emqKeeper
.
getMqttClient
().
subscribe
(
patrolTopic
,
1
,
patrolMqttListener
);
emqKeeper
.
subscript
(
patrolTopic
,
1
,
patrolMqttListener
);
}
catch
(
Mqtt
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
logger
.
error
(
"EMQ初始化连接失败!"
);
logger
.
error
(
"EMQ初始化连接失败!"
);
}
}
...
...
amos-boot-system-patrol/src/main/resources/db/mapper/dbTemplate_input_item.xml
View file @
d9b2f803
...
@@ -333,10 +333,10 @@
...
@@ -333,10 +333,10 @@
and a.equipment_type is not null
and a.equipment_type is not null
</if>
</if>
<if
test=
"treeId != null and treeId != '' and treeId == '-4'"
>
<if
test=
"treeId != null and treeId != '' and treeId == '-4'"
>
and a.key_parts_type
is not null
and a.key_parts_type
='0'
</if>
</if>
<if
test=
"treeId != null and treeId != '' and treeId == '-5'"
>
<if
test=
"treeId != null and treeId != '' and treeId == '-5'"
>
and a.custom_type
is not null
and a.custom_type
='0'
</if>
</if>
<if
test=
"subCode!=null and subCode!='' and subCode!=' ' and
<if
test=
"subCode!=null and subCode!='' and subCode!=' ' and
treeId != null and treeId != '' and treeId != '-3' and treeId != '-1' and
treeId != null and treeId != '' and treeId != '-3' and treeId != '-1' and
...
...
amos-boot-utils/amos-boot-utils-message/src/main/resources/application-dev.properties
View file @
d9b2f803
...
@@ -83,17 +83,17 @@ emqx.max-inflight=1000
...
@@ -83,17 +83,17 @@ emqx.max-inflight=1000
# 下面个配置默认站端 中心级系统的时候注释掉上边 放开下边
# 下面个配置默认站端 中心级系统的时候注释掉上边 放开下边
#站端配置
#站端配置
#需要监听得kafka消息主题 根据是否是中心极和站端选择需要监听得主题进行配置
#需要监听得kafka消息主题 根据是否是中心极和站端选择需要监听得主题进行配置
#
kafka.topics=null
kafka.topics
=
null
#需要监听得eqm消息主题 根据是否是中心极和站端选择需要监听得主题进行配置 emq.iot.created,
#需要监听得eqm消息主题 根据是否是中心极和站端选择需要监听得主题进行配置 emq.iot.created,
#emq.topic=emq.xf.created,emq.iot.created,emq.patrol.created,emq.sign.created,emq.bussSign.created,emq.user.created,emq.risk
.created
emq.topic
=
emq.xf.created,emq.iot.created,emq.patrol.created,emq.sign.created,emq.bussSign.created,emq.user
.created
##中心级配置配置
##中心级配置配置
##需要监听得kafka消息主题 根据是否是中心极和站端选择需要监听得主题进行配置
##需要监听得kafka消息主题 根据是否是中心极和站端选择需要监听得主题进行配置
kafka.topics
=
JKXT2BP-XFYY-Topic
#
kafka.topics=JKXT2BP-XFYY-Topic
#
#
##需要监听得eqm消息主题 根据是否是中心极和站端选择需要监听得主题进行配置 emq.iot.created,
##需要监听得eqm消息主题 根据是否是中心极和站端选择需要监听得主题进行配置 emq.iot.created,
emq.topic
=
ccs-user-login-info,sync.execute
#emq.topic=
queue.kafka.topics
=
null
queue.kafka.topics
=
null
kafka.auto-startup
=
false
kafka.auto-startup
=
false
\ No newline at end of file
amos-boot-utils/amos-boot-utils-message/src/main/resources/application.properties
View file @
d9b2f803
...
@@ -8,3 +8,6 @@ spring.jackson.serialization.write-dates-as-timestamps=true
...
@@ -8,3 +8,6 @@ spring.jackson.serialization.write-dates-as-timestamps=true
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic
=
false
logic
=
false
logging.config
=
classpath:logback-${spring.profiles.active}.xml
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment