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
5eacc9be
Commit
5eacc9be
authored
Jun 29, 2023
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备信息卡优化
parent
2d1523fb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
179 additions
and
2 deletions
+179
-2
EquipQrcodeRecord.java
.../yeejoin/equipmanage/common/entity/EquipQrcodeRecord.java
+4
-0
EquipInformationCardController.java
...quipmanage/controller/EquipInformationCardController.java
+133
-0
EquipmentSpecificController.java
...n/equipmanage/controller/EquipmentSpecificController.java
+3
-0
McbFeign.java
...src/main/java/com/yeejoin/equipmanage/fegin/McbFeign.java
+35
-0
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+4
-2
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/EquipQrcodeRecord.java
View file @
5eacc9be
...
@@ -48,4 +48,8 @@ public class EquipQrcodeRecord extends BaseEntity {
...
@@ -48,4 +48,8 @@ public class EquipQrcodeRecord extends BaseEntity {
@ApiModelProperty
(
value
=
"状态(0:绿码,1:黄码,2:红码)"
)
@ApiModelProperty
(
value
=
"状态(0:绿码,1:黄码,2:红码)"
)
@TableField
(
"system_code"
)
@TableField
(
"system_code"
)
private
String
systemCode
;
private
String
systemCode
;
@ApiModelProperty
(
value
=
"状态(0:绿码,1:黄码,2:红码)"
)
@TableField
(
"clean_reason"
)
private
String
cleanReason
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EquipInformationCardController.java
0 → 100644
View file @
5eacc9be
package
com
.
yeejoin
.
equipmanage
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.aspose.words.SaveOutputParameters
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.equipmanage.common.entity.EquipQrcodeRecord
;
import
com.yeejoin.equipmanage.common.enums.CheckStatusEnum
;
import
com.yeejoin.equipmanage.common.utils.CommonResponseUtil
;
import
com.yeejoin.equipmanage.fegin.IdxFeign
;
import
com.yeejoin.equipmanage.fegin.McbFeign
;
import
com.yeejoin.equipmanage.mapper.EquipQrcodeRecordMapper
;
import
com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmLogMapper
;
import
com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.checkerframework.checker.units.qual.A
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Slf4j
@RestController
@Api
(
tags
=
"设备信息卡Api"
)
@RequestMapping
(
value
=
"/equipInformationCard"
)
public
class
EquipInformationCardController
{
@Autowired
EquipmentSpecificAlarmLogMapper
equipmentSpecificAlarmLogMapper
;
@Autowired
EquipmentSpecificMapper
equipmentSpecificMapper
;
@Autowired
EquipQrcodeRecordMapper
equipQrcodeRecordMapper
;
@Autowired
IdxFeign
idxFeign
;
@Autowired
McbFeign
mcbFeign
;
@RequestMapping
(
value
=
"/equipOrPatrol"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"运维信息-设备告警/巡检"
,
notes
=
"运维信息-设备告警/巡检"
)
public
ResponseModel
getEquipAlarmList
(
String
equipmentId
,
String
type
)
{
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
List
<
String
>
idList
=
new
ArrayList
<>();
if
(
type
.
equals
(
"alarm"
)){
list
=
equipmentSpecificAlarmLogMapper
.
getEquipAlarmList
(
equipmentId
);
idList
=
equipmentSpecificAlarmLogMapper
.
getEquipAlarmIdList
(
equipmentId
);
}
else
if
(
type
.
equals
(
"check"
)){
list
=
equipmentSpecificMapper
.
selectListByPatrolCheck
(
equipmentId
);
list
.
stream
().
forEach
(
e
->
e
.
put
(
"is_ok"
,
CheckStatusEnum
.
getNameByCode
(
e
.
get
(
"is_ok"
).
toString
())));
idList
=
equipmentSpecificMapper
.
selectIdsByPatrolCheck
(
equipmentId
);
}
String
ids
=
String
.
join
(
","
,
idList
);
JSONObject
obj
=
idxFeign
.
queryDefectByCodes
(
idList
,
ids
);
List
<
JSONObject
>
jsonObjects
=
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
obj
.
get
(
"result"
)),
JSONObject
.
class
);
//缺陷对应记录 是否存在上报问题
if
(!
ValidationUtil
.
isEmpty
(
jsonObjects
)){
list
.
forEach
(
e
->{
jsonObjects
.
forEach
(
j
->{
if
(
e
.
get
(
"id"
).
toString
().
equals
(
j
.
getString
(
"checkId"
))){
e
.
put
(
"reportProblem"
,
j
.
getString
(
"defectDescribe"
));
e
.
put
(
"defectId"
,
j
.
getString
(
"id"
));
e
.
put
(
"defectStatus"
,
j
.
getString
(
"defectStatus"
).
equals
(
"0"
)?
"未处理"
:
"已处理"
);
}
});
});
}
map
.
put
(
"data"
,
list
);
map
.
put
(
"total"
,
list
.
size
());
return
CommonResponseUtil
.
success
(
map
);
}
@RequestMapping
(
value
=
"/mcb"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"预警记录"
,
notes
=
"预警记录"
)
public
ResponseModel
getMcbDataList
(
String
equipmentId
,
int
current
,
int
size
)
{
JSONObject
result
=
mcbFeign
.
list
(
current
,
size
,
equipmentId
);
JSONObject
jsonObject
=
result
.
getJSONObject
(
"result"
);
List
<
JSONObject
>
records
=
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
jsonObject
.
get
(
"records"
)),
JSONObject
.
class
);
LambdaQueryWrapper
<
EquipQrcodeRecord
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
EquipQrcodeRecord:
:
getEquipid
,
equipmentId
);
List
<
EquipQrcodeRecord
>
qrList
=
equipQrcodeRecordMapper
.
selectList
(
wrapper
);
records
.
forEach
(
record
->{
qrList
.
forEach
(
q
->{
if
(
q
.
getSourceId
().
equals
(
record
.
getString
(
"traceId"
))){
record
.
put
(
"cleanStatus"
,
q
.
getCleanTime
()
==
null
?
"未消除"
:
"已消除"
);
record
.
put
(
"cleanTime"
,
q
.
getCleanTime
());
record
.
put
(
"cleanReason"
,
q
.
getCleanReason
());
}
});
String
cs
=
""
;
JSONArray
list
=
record
.
getJSONArray
(
"rectificationProposal"
);
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
if
(
i
!=
(
list
.
size
()
-
1
)){
cs
+=
list
.
getJSONObject
(
i
).
getString
(
"measuresDesc"
)+
","
;
}
else
{
cs
+=
list
.
getJSONObject
(
i
).
getString
(
"measuresDesc"
);
}
}
record
.
put
(
"measure"
,
cs
);
});
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"data"
,
records
);
map
.
put
(
"total"
,
jsonObject
.
get
(
"total"
));
return
CommonResponseUtil
.
success
(
map
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EquipmentSpecificController.java
View file @
5eacc9be
...
@@ -461,6 +461,9 @@ public class EquipmentSpecificController extends AbstractBaseController {
...
@@ -461,6 +461,9 @@ public class EquipmentSpecificController extends AbstractBaseController {
one
.
isNull
(
EquipQrcodeRecord:
:
getCleanTime
);
one
.
isNull
(
EquipQrcodeRecord:
:
getCleanTime
);
EquipQrcodeRecord
equipQrcodeRecord
=
equipQrcodeRecordMapper
.
selectOne
(
one
);
EquipQrcodeRecord
equipQrcodeRecord
=
equipQrcodeRecordMapper
.
selectOne
(
one
);
equipQrcodeRecord
.
setCleanTime
(
new
Date
());
equipQrcodeRecord
.
setCleanTime
(
new
Date
());
if
(
equipQrcodeRecord
.
getSource
().
equals
(
"patrol"
)){
equipQrcodeRecord
.
setCleanReason
(
"设备再次巡查正常"
);
}
equipQrcodeRecordMapper
.
updateById
(
equipQrcodeRecord
);
equipQrcodeRecordMapper
.
updateById
(
equipQrcodeRecord
);
if
(
equipQrcodeRecords
.
size
()
==
0
)
{
//如果记录表中此装备无未消除的故障等 则恢复绿码
if
(
equipQrcodeRecords
.
size
()
==
0
)
{
//如果记录表中此装备无未消除的故障等 则恢复绿码
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/fegin/McbFeign.java
0 → 100644
View file @
5eacc9be
package
com
.
yeejoin
.
equipmanage
.
fegin
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.List
;
/**
* @author DELL
*/
@FeignClient
(
name
=
"${mcb.feign.name}"
,
path
=
"warning"
,
configuration
=
{
FeignConfiguration
.
class
})
public
interface
McbFeign
{
/***
* <pre>
* @Description: 根据告警id查询缺陷治理情况
* </pre>
*
* @MethodName:
* @Param:
* @Return: null
* @Throws
* @Author keyong
* @Date 2022/9/27 17:46
*/
@RequestMapping
(
value
=
"/warning-warning-info/page"
,
method
=
RequestMethod
.
GET
)
JSONObject
list
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
value
=
"objectId"
,
required
=
false
)
String
objectId
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttReceiveServiceImpl.java
View file @
5eacc9be
...
@@ -937,7 +937,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -937,7 +937,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
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
())
{
alarmLogs
.
add
(
addEquipAlarmLogRecord
(
action
));
EquipmentSpecificAlarmLog
equipmentSpecificAlarmLog
=
addEquipAlarmLogRecord
(
action
);
alarmLogs
.
add
(
equipmentSpecificAlarmLog
);
if
(
ValidationUtil
.
isEmpty
(
action
.
getAlamContent
()))
{
if
(
ValidationUtil
.
isEmpty
(
action
.
getAlamContent
()))
{
action
.
setAlamContent
(
action
.
getEquipmentSpecificName
()
+
action
.
getEquipmentSpecificIndexName
());
action
.
setAlamContent
(
action
.
getEquipmentSpecificName
()
+
action
.
getEquipmentSpecificIndexName
());
}
}
...
@@ -949,7 +950,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -949,7 +950,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
equipQrcodeRecord
.
setSource
(
"equip"
);
equipQrcodeRecord
.
setSource
(
"equip"
);
equipQrcodeRecord
.
setAlarmTime
(
new
Date
());
equipQrcodeRecord
.
setAlarmTime
(
new
Date
());
equipQrcodeRecord
.
setStatus
(
EquipQrcodeColorEnum
.
RED
.
getCode
());
equipQrcodeRecord
.
setStatus
(
EquipQrcodeColorEnum
.
RED
.
getCode
());
equipQrcodeRecord
.
setSourceId
(
action
.
getId
().
toString
());
equipQrcodeRecord
.
setSourceId
(
equipmentSpecificAlarmLog
.
getId
().
toString
());
equipQrcodeRecord
.
setBizOrgCode
(
action
.
getBizOrgCode
());
equipQrcodeRecord
.
setBizOrgCode
(
action
.
getBizOrgCode
());
equipQrcodeRecord
.
setBizOrgName
(
action
.
getBizOrgName
());
equipQrcodeRecord
.
setBizOrgName
(
action
.
getBizOrgName
());
equipQrcodeRecord
.
setSystemCode
(
action
.
getSystemIds
());
equipQrcodeRecord
.
setSystemCode
(
action
.
getSystemIds
());
...
@@ -965,6 +966,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -965,6 +966,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
wrapper
.
eq
(
EquipQrcodeRecord:
:
getSourceId
,
action
.
getId
());
wrapper
.
eq
(
EquipQrcodeRecord:
:
getSourceId
,
action
.
getId
());
EquipQrcodeRecord
equipQrcodeRecord
=
equipQrcodeRecordMapper
.
selectOne
(
wrapper
);
EquipQrcodeRecord
equipQrcodeRecord
=
equipQrcodeRecordMapper
.
selectOne
(
wrapper
);
equipQrcodeRecord
.
setCleanTime
(
new
Date
());
equipQrcodeRecord
.
setCleanTime
(
new
Date
());
equipQrcodeRecord
.
setCleanReason
(
"设备上报复归信息"
);
equipQrcodeRecordMapper
.
updateById
(
equipQrcodeRecord
);
equipQrcodeRecordMapper
.
updateById
(
equipQrcodeRecord
);
specific
.
setEquipStatus
(
EquipQrcodeColorEnum
.
GREEN
.
getCode
());
specific
.
setEquipStatus
(
EquipQrcodeColorEnum
.
GREEN
.
getCode
());
...
...
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