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
f6401551
Commit
f6401551
authored
Jun 21, 2023
by
刘林
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_dl' into develop_dl
parents
1621984d
e89864e9
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
361 additions
and
6 deletions
+361
-6
PointSystem.java
...va/com/yeejoin/equipmanage/common/entity/PointSystem.java
+49
-0
EquipmentSpecificController.java
...n/equipmanage/controller/EquipmentSpecificController.java
+11
-5
BizInfo.java
...iz/src/main/java/com/yeejoin/equipmanage/dto/BizInfo.java
+36
-0
DynamicDetails.java
...main/java/com/yeejoin/equipmanage/dto/DynamicDetails.java
+22
-0
TabContent.java
...src/main/java/com/yeejoin/equipmanage/dto/TabContent.java
+23
-0
WarningDto.java
...src/main/java/com/yeejoin/equipmanage/dto/WarningDto.java
+34
-0
PointSystemMapper.java
...ava/com/yeejoin/equipmanage/mapper/PointSystemMapper.java
+16
-0
IPointSystemService.java
.../com/yeejoin/equipmanage/service/IPointSystemService.java
+15
-0
PointSystemServiceImpl.java
...join/equipmanage/service/impl/PointSystemServiceImpl.java
+123
-0
application.properties
...ot-system-equip/src/main/resources/application.properties
+6
-1
wl-3.6.0.xml
...ot-system-equip/src/main/resources/changelog/wl-3.6.0.xml
+26
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/PointSystem.java
0 → 100644
View file @
f6401551
package
com
.
yeejoin
.
equipmanage
.
common
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.equipmanage.common.entity.publics.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
/**
* @description:
* @author: tw
* @createDate: 2023/6/19
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"dz_point_system"
)
@ApiModel
(
value
=
"PointSystem对象"
,
description
=
""
)
public
class
PointSystem
extends
BaseEntity
{
@ApiModelProperty
(
value
=
"场站"
)
@TableField
(
"station"
)
private
String
station
;
@ApiModelProperty
(
value
=
"二维码"
)
@TableField
(
"number"
)
private
String
number
;
@ApiModelProperty
(
value
=
"类型"
)
@TableField
(
"type"
)
private
String
type
;
@ApiModelProperty
(
value
=
"'地址'"
)
@TableField
(
"address"
)
private
String
address
;
@ApiModelProperty
(
value
=
"测点类型"
)
@TableField
(
"point_type"
)
private
String
pointType
;
@ApiModelProperty
(
value
=
"测点值"
)
@TableField
(
"value"
)
private
String
value
;
@ApiModelProperty
(
value
=
"功能码"
)
@TableField
(
"function_num"
)
private
String
functionNum
;
@ApiModelProperty
(
value
=
"kks码"
)
@TableField
(
"kks"
)
private
String
kks
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EquipmentSpecificController.java
View file @
f6401551
...
@@ -453,19 +453,25 @@ public class EquipmentSpecificController extends AbstractBaseController {
...
@@ -453,19 +453,25 @@ public class EquipmentSpecificController extends AbstractBaseController {
query
.
notIn
(
EquipQrcodeRecord:
:
getSourceId
,
id
);
query
.
notIn
(
EquipQrcodeRecord:
:
getSourceId
,
id
);
query
.
isNull
(
EquipQrcodeRecord:
:
getCleanTime
);
query
.
isNull
(
EquipQrcodeRecord:
:
getCleanTime
);
List
<
EquipQrcodeRecord
>
equipQrcodeRecords
=
equipQrcodeRecordMapper
.
selectList
(
query
);
List
<
EquipQrcodeRecord
>
equipQrcodeRecords
=
equipQrcodeRecordMapper
.
selectList
(
query
);
//修改本次清除的装备事件
LambdaQueryWrapper
<
EquipQrcodeRecord
>
one
=
new
LambdaQueryWrapper
<>();
one
.
eq
(
EquipQrcodeRecord:
:
getEquipid
,
equipId
);
one
.
eq
(
EquipQrcodeRecord:
:
getSourceId
,
id
);
one
.
isNull
(
EquipQrcodeRecord:
:
getCleanTime
);
EquipQrcodeRecord
equipQrcodeRecord
=
equipQrcodeRecordMapper
.
selectOne
(
one
);
equipQrcodeRecord
.
setCleanTime
(
new
Date
());
equipQrcodeRecordMapper
.
updateById
(
equipQrcodeRecord
);
if
(
equipQrcodeRecords
.
size
()
==
0
)
{
//如果记录表中此装备无未消除的故障等 则恢复绿码
if
(
equipQrcodeRecords
.
size
()
==
0
)
{
//如果记录表中此装备无未消除的故障等 则恢复绿码
//修改装备二维码状态为合格 此处为0代表绿色 是idx只有在合格是才会触发此接口
//修改装备二维码状态为合格 此处为0代表绿色 是idx只有在合格是才会触发此接口
equipmentSpecificSerivce
.
updateEquipSpecificStatus
(
"0"
,
equipId
);
equipmentSpecificSerivce
.
updateEquipSpecificStatus
(
"0"
,
equipId
);
}
else
{
}
else
{
//先修改本次清除的装备事件
EquipQrcodeRecord
equipQrcodeRecord
=
equipQrcodeRecords
.
stream
().
filter
(
e
->
e
.
getSourceId
().
equals
(
id
)).
findFirst
().
get
();
equipQrcodeRecords
.
remove
(
equipQrcodeRecord
);
equipQrcodeRecord
.
setCleanTime
(
new
Date
());
equipQrcodeRecordMapper
.
updateById
(
equipQrcodeRecord
);
//然后取结果集中剩余状态最高的颜色赋码
//然后取结果集中剩余状态最高的颜色赋码
String
status
=
equipQrcodeRecords
.
stream
().
sorted
(
Comparator
.
comparing
(
EquipQrcodeRecord:
:
getStatus
)).
findFirst
().
get
().
getStatus
();
String
status
=
equipQrcodeRecords
.
stream
().
sorted
(
Comparator
.
comparing
(
EquipQrcodeRecord:
:
getStatus
)).
findFirst
().
get
().
getStatus
();
equipmentSpecificSerivce
.
updateEquipSpecificStatus
(
status
,
equipId
);
equipmentSpecificSerivce
.
updateEquipSpecificStatus
(
status
,
equipId
);
}
}
return
CommonResponseUtil
.
success
();
return
CommonResponseUtil
.
success
();
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/dto/BizInfo.java
0 → 100644
View file @
f6401551
package
com
.
yeejoin
.
equipmanage
.
dto
;
import
lombok.Data
;
import
java.util.List
;
/**
* @description:
* @author: tw
* @createDate: 2023/6/19
*/
@Data
public
class
BizInfo
{
private
String
sourceAttributionDesc
;
private
String
sourceAttribution
;
private
List
<
DynamicDetails
>
dynamicDetails
;
private
String
warningObjectCode
;
private
String
warningTime
;
private
String
warningObjectName
;
public
BizInfo
(
String
sourceAttributionDesc
,
String
sourceAttribution
,
List
<
DynamicDetails
>
dynamicDetails
,
String
warningObjectCode
,
String
warningTime
,
String
warningObjectName
)
{
this
.
sourceAttributionDesc
=
sourceAttributionDesc
;
this
.
sourceAttribution
=
sourceAttribution
;
this
.
dynamicDetails
=
dynamicDetails
;
this
.
warningObjectCode
=
warningObjectCode
;
this
.
warningTime
=
warningTime
;
this
.
warningObjectName
=
warningObjectName
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/dto/DynamicDetails.java
0 → 100644
View file @
f6401551
package
com
.
yeejoin
.
equipmanage
.
dto
;
import
lombok.Data
;
import
java.util.List
;
/**
* @description:
* @author: tw
* @createDate: 2023/6/19
*/
@Data
public
class
DynamicDetails
{
private
String
tabName
;
private
List
<
TabContent
>
tabContent
;
public
DynamicDetails
(
String
tabName
,
List
<
TabContent
>
tabContent
)
{
this
.
tabName
=
tabName
;
this
.
tabContent
=
tabContent
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/dto/TabContent.java
0 → 100644
View file @
f6401551
package
com
.
yeejoin
.
equipmanage
.
dto
;
import
lombok.Data
;
/**
* @description:
* @author: tw
* @createDate: 2023/6/19
*/
@Data
public
class
TabContent
{
private
String
label
;
private
String
type
;
private
Object
value
;
private
String
key
;
public
TabContent
(
String
label
,
String
type
,
Object
value
,
String
key
)
{
this
.
label
=
label
;
this
.
type
=
type
;
this
.
value
=
value
;
this
.
key
=
key
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/dto/WarningDto.java
0 → 100644
View file @
f6401551
package
com
.
yeejoin
.
equipmanage
.
dto
;
import
lombok.Data
;
import
java.util.List
;
/**
* @description:
* @author: tw
* @createDate: 2023/6/19
*/
@Data
public
class
WarningDto
{
private
BizInfo
bizInfo
;
private
String
indexKey
;
private
String
indexValue
;
private
String
traceId
;
public
WarningDto
(
String
indexKey
,
String
indexValue
,
String
traceId
,
String
sourceAttributionDesc
,
String
sourceAttribution
,
List
<
DynamicDetails
>
dynamicDetails
,
String
warningObjectCode
,
String
warningTime
,
String
warningObjectName
)
{
this
.
bizInfo
=
new
BizInfo
(
sourceAttributionDesc
,
sourceAttribution
,
dynamicDetails
,
warningObjectCode
,
warningTime
,
warningObjectName
);
this
.
indexKey
=
indexKey
;
this
.
indexValue
=
indexValue
;
this
.
traceId
=
traceId
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/PointSystemMapper.java
0 → 100644
View file @
f6401551
package
com
.
yeejoin
.
equipmanage
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.equipmanage.common.entity.PointSystem
;
/**
* @description:
* @author: tw
* @createDate: 2023/6/19
*/
public
interface
PointSystemMapper
extends
BaseMapper
<
PointSystem
>
{
//推送预警
public
void
sendWarning
();
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IPointSystemService.java
0 → 100644
View file @
f6401551
package
com
.
yeejoin
.
equipmanage
.
service
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex
;
/**
* @description:
* @author: tw
* @createDate: 2023/6/19
*/
public
interface
IPointSystemService
{
//触发风险预警
public
void
sendWarning
(
String
address
,
String
value
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/PointSystemServiceImpl.java
0 → 100644
View file @
f6401551
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecific
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex
;
import
com.yeejoin.equipmanage.common.entity.PointSystem
;
import
com.yeejoin.equipmanage.common.utils.HttpContentTypeUtil
;
import
com.yeejoin.equipmanage.dto.DynamicDetails
;
import
com.yeejoin.equipmanage.dto.TabContent
;
import
com.yeejoin.equipmanage.dto.WarningDto
;
import
com.yeejoin.equipmanage.mapper.PointSystemMapper
;
import
com.yeejoin.equipmanage.service.IPointSystemService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
/**
* @description:
* @author: tw
* @createDate: 2023/6/19
*/
@Service
public
class
PointSystemServiceImpl
extends
ServiceImpl
<
PointSystemMapper
,
PointSystem
>
implements
IPointSystemService
{
@Autowired
PointSystemMapper
pointSystemMapper
;
@Value
(
"${power.station.url}"
)
private
String
powerStationUrl
;
private
final
String
TABNAME
=
"预警问题"
;
private
final
String
TEXT
=
"text"
;
@Value
(
"${power.station.warning:104/data/analysis}"
)
private
String
STATIONWARNING
;
@Autowired
protected
EmqKeeper
emqKeeper
;
@Override
public
void
sendWarning
(
String
address
,
String
value
)
{
try
{
//通过测点地址获取,和对应值 获取kks
QueryWrapper
<
PointSystem
>
pointSystemWrapper
=
new
QueryWrapper
<>();
pointSystemWrapper
.
lambda
().
eq
(
PointSystem:
:
getAddress
,
address
);
pointSystemWrapper
.
lambda
().
eq
(
PointSystem:
:
getValue
,
value
);
PointSystem
pointSystem
=
pointSystemMapper
.
selectOne
(
pointSystemWrapper
);
if
(
pointSystem
==
null
)
{
throw
new
RuntimeException
(
"获取kks码失败!"
);
}
//调用获取设备相关信息
Map
<
String
,
String
>
maps
=
new
HashMap
<>();
maps
.
put
(
"type"
,
"equipinfo"
);
maps
.
put
(
"kksbm"
,
pointSystem
.
getKks
());
String
data
=
HttpContentTypeUtil
.
sendHttpPost
(
powerStationUrl
,
maps
);
if
(
StringUtils
.
isEmpty
(
data
)
||
!(
Boolean
)
JSON
.
parseObject
(
data
).
get
(
"success"
))
{
throw
new
RuntimeException
(
"获取设备信息失败!"
);
}
JSONObject
json
=
JSON
.
parseObject
(
data
);
JSONObject
jsond
=
(
JSONObject
)
json
.
get
(
"dataset"
);
JSONArray
list
=
(
JSONArray
)
jsond
.
get
(
"datas"
);
JSONObject
eqdata
=
null
;
if
(
list
==
null
||
list
.
isEmpty
())
{
throw
new
RuntimeException
(
"获取设备信息失败!"
);
}
eqdata
=
(
JSONObject
)
list
.
get
(
0
);
//组装数据,发送预警
WarningDto
warningDto
=
setWarningDto
(
pointSystem
,
eqdata
);
emqKeeper
.
getMqttClient
().
publish
(
STATIONWARNING
,
JSON
.
toJSONString
(
warningDto
).
getBytes
(),
0
,
false
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"预警消息发送失败!"
);
}
}
public
WarningDto
setWarningDto
(
PointSystem
pointSystem
,
JSONObject
eqdata
){
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
time
=
sdf
.
format
(
new
Date
());
String
warningObjectCode
=
pointSystem
.
getKks
();
List
<
TabContent
>
tabContent
=
new
ArrayList
<>();
tabContent
.
add
(
new
TabContent
(
"KKS编码"
,
TEXT
,
warningObjectCode
,
"key1"
));
tabContent
.
add
(
new
TabContent
(
"设备名称"
,
TEXT
,
eqdata
.
get
(
"kksms"
),
"key2"
));
tabContent
.
add
(
new
TabContent
(
"发生时间"
,
TEXT
,
time
,
"key3"
));
DynamicDetails
dynamicDetails
=
new
DynamicDetails
(
TABNAME
,
tabContent
);
List
<
DynamicDetails
>
dynamicDetailsList
=
new
ArrayList
<>();
dynamicDetailsList
.
add
(
dynamicDetails
);
StringBuffer
indexKey
=
new
StringBuffer
(
pointSystem
.
getStation
())
.
append
(
"#"
)
.
append
(
pointSystem
.
getNumber
())
.
append
(
"#"
)
.
append
(
pointSystem
.
getFunctionNum
());
StringBuffer
indexValue
=
new
StringBuffer
(
pointSystem
.
getPointType
())
.
append
(
"#"
)
.
append
(
pointSystem
.
getValue
());
WarningDto
WarningDto
=
new
WarningDto
(
indexKey
.
toString
(),
indexValue
.
toString
(),
null
,
(
String
)
eqdata
.
get
(
"sourceAttributionDesc"
),
(
String
)
eqdata
.
get
(
"sourceAttribution"
),
dynamicDetailsList
,
warningObjectCode
,
time
,
(
String
)
eqdata
.
get
(
"kksms"
)
);
return
WarningDto
;
}
}
amos-boot-system-equip/src/main/resources/application.properties
View file @
f6401551
...
@@ -24,7 +24,7 @@ pagehelper.support-methods-arguments=true
...
@@ -24,7 +24,7 @@ pagehelper.support-methods-arguments=true
spring.main.allow-bean-definition-overriding
=
true
spring.main.allow-bean-definition-overriding
=
true
#liquibase
#liquibase
spring.liquibase.change-log
=
classpath:/changelog/changelog-master.xml
spring.liquibase.change-log
=
classpath:/changelog/changelog-master.xml
spring.liquibase.enabled
=
tru
e
spring.liquibase.enabled
=
fals
e
#\u4E0A\u4F20\u6587\u4EF6\u8BBE\u7F6E
#\u4E0A\u4F20\u6587\u4EF6\u8BBE\u7F6E
spring.servlet.multipart.maxFileSize
=
100MB
spring.servlet.multipart.maxFileSize
=
100MB
...
@@ -159,3 +159,7 @@ spring.security.user.password=a1234560
...
@@ -159,3 +159,7 @@ spring.security.user.password=a1234560
stationCode
=
LSHLZ1bZAJU645Pgl7
stationCode
=
LSHLZ1bZAJU645Pgl7
##\u4EE3\u7801\u4E2D\u6709\u90E8\u5206\u903B\u8F91\u51B2\u7A81\u9700\u8981\u5904\u7406 \u4E3A\u533A\u5206\u673A\u573A\u548C\u7535\u529B\u903B\u8F91 \u589E\u52A0\u5F00\u5173 \u82E5\u4E3Atrue \u5219\u4E3A\u673A\u573A\u903B\u8F91 \u4E3Afalse \u5219\u4E3A\u7535\u529B\u903B\u8F91
##\u4EE3\u7801\u4E2D\u6709\u90E8\u5206\u903B\u8F91\u51B2\u7A81\u9700\u8981\u5904\u7406 \u4E3A\u533A\u5206\u673A\u573A\u548C\u7535\u529B\u903B\u8F91 \u589E\u52A0\u5F00\u5173 \u82E5\u4E3Atrue \u5219\u4E3A\u673A\u573A\u903B\u8F91 \u4E3Afalse \u5219\u4E3A\u7535\u529B\u903B\u8F91
logic
=
false
logic
=
false
#电站对接第三方查询设备kks码
power.station.url
=
http://139.9.169.123:5024/process/DataInterface
#电站104采集预警
power.station.warning
=
104/data/analysis
\ No newline at end of file
amos-boot-system-equip/src/main/resources/changelog/wl-3.6.0.xml
View file @
f6401551
...
@@ -915,4 +915,29 @@
...
@@ -915,4 +915,29 @@
alter table `wl_equipment_specific_index` add column `gateway_id` varchar(50) COMMENT '网关标识ID';
alter table `wl_equipment_specific_index` add column `gateway_id` varchar(50) COMMENT '网关标识ID';
</sql>
</sql>
</changeSet>
</changeSet>
<changeSet
author=
"20230620"
id=
"20230620-1"
runAlways=
"true"
>
<comment>
`dz_point_system`
</comment>
<sql
endDelimiter=
"#"
>
CREATE TABLE `dz_point_system` (
`id` bigint(0) NOT NULL,
`station` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '场站',
`number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '型号',
`type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '类型',
`address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '地址',
`point_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '测点类型',
`value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '测点值',
`function_num` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '功能码',
`kks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT 'kks码',
`create_date` datetime(0) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
</sql>
</changeSet>
</databaseChangeLog>
</databaseChangeLog>
\ 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