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
e59bc0ce
Commit
e59bc0ce
authored
Oct 11, 2022
by
KeYong
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_dl_plan6' into develop_dl_plan6
parents
04c779e4
7c16e08c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
457 additions
and
0 deletions
+457
-0
PressurePumpCheckEnum.java
...ejoin/equipmanage/common/enums/PressurePumpCheckEnum.java
+33
-0
PressurePumpEnum.java
...om/yeejoin/equipmanage/common/enums/PressurePumpEnum.java
+68
-0
PressurePumpMessageEnum.java
...oin/equipmanage/common/enums/PressurePumpMessageEnum.java
+43
-0
PressurePumpValueEnum.java
...ejoin/equipmanage/common/enums/PressurePumpValueEnum.java
+34
-0
EquipmentSpecificIndexMapper.java
...join/equipmanage/mapper/EquipmentSpecificIndexMapper.java
+3
-0
IEquipmentSpecificIndexService.java
...n/equipmanage/service/IEquipmentSpecificIndexService.java
+7
-0
EquipmentSpecificIndexServiceImpl.java
...anage/service/impl/EquipmentSpecificIndexServiceImpl.java
+6
-0
EquipmentSpecificSerivceImpl.java
...quipmanage/service/impl/EquipmentSpecificSerivceImpl.java
+75
-0
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+179
-0
application-dev.properties
...ystem-equip/src/main/resources/application-dev.properties
+9
-0
EquipmentSpecificIndexMapper.xml
...rc/main/resources/mapper/EquipmentSpecificIndexMapper.xml
+0
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/enums/PressurePumpCheckEnum.java
0 → 100644
View file @
e59bc0ce
package
com
.
yeejoin
.
equipmanage
.
common
.
enums
;
public
enum
PressurePumpCheckEnum
{
LE
(
"le"
,
"小于等于"
),
GE
(
"ge"
,
"大于等于"
),
BE
(
"be"
,
"在两者之间"
);
private
String
code
;
private
String
describe
;
private
PressurePumpCheckEnum
(
String
code
,
String
describe
)
{
this
.
code
=
code
;
this
.
describe
=
describe
;
}
public
String
getCode
()
{
return
code
;
}
public
String
getDescribe
()
{
return
describe
;
}
public
static
PressurePumpCheckEnum
getByCode
(
String
code
)
{
for
(
PressurePumpCheckEnum
l
:
PressurePumpCheckEnum
.
values
())
{
if
(
code
.
equals
(
l
.
getCode
()))
{
return
l
;
}
}
return
null
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/enums/PressurePumpEnum.java
0 → 100644
View file @
e59bc0ce
package
com
.
yeejoin
.
equipmanage
.
common
.
enums
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
enum
PressurePumpEnum
{
// ALONE_START_YXSC("FHS_PressurePump_Start_ALONE_START_YXSC", "ge", "5", "", "aaa", "bbb", "last"),
ALONE_START_QT
(
"FHS_PressurePump_Start_ALONE_START_QT"
,
PressurePumpCheckEnum
.
LE
.
getCode
(),
""
,
"5"
,
PressurePumpValueEnum
.
LAST_STOP
.
getCode
(),
PressurePumpMessageEnum
.
MESSAGE_LEVEL_QT_WJ
.
getCode
()),
ALONE_STOP_QT
(
"FHS_PressurePump_Stop_ALONE_STOP_QT"
,
PressurePumpCheckEnum
.
GE
.
getCode
(),
"5"
,
""
,
PressurePumpValueEnum
.
LAST_START
.
getCode
(),
PressurePumpMessageEnum
.
MESSAGE_LEVEL_QT_WJ_YXSC
.
getCode
()),
ALL_START_QT_WJ
(
"FHS_PressurePump_Start_ALL_START_QT_WJ"
,
PressurePumpCheckEnum
.
LE
.
getCode
(),
""
,
"30"
,
PressurePumpValueEnum
.
LATELY_STOP
.
getCode
(),
PressurePumpMessageEnum
.
MESSAGE_LEVEL_QT_WJ
.
getCode
()),
ALL_START_QT_YZ
(
"FHS_PressurePump_Start_ALL_START_QT_YZ"
,
PressurePumpCheckEnum
.
BE
.
getCode
(),
"30"
,
"60"
,
PressurePumpValueEnum
.
LATELY_STOP
.
getCode
(),
PressurePumpMessageEnum
.
MESSAGE_LEVEL_YZ
.
getCode
()),
ALL_START_QT_YB
(
"FHS_PressurePump_Start_ALL_START_QT_YB"
,
PressurePumpCheckEnum
.
BE
.
getCode
(),
"60"
,
"240"
,
PressurePumpValueEnum
.
LATELY_STOP
.
getCode
(),
PressurePumpMessageEnum
.
MESSAGE_LEVEL_YB
.
getCode
()),
ALL_STOP_QT_WJ
(
"FHS_PressurePump_Stop_ALL_STOP_QT_WJ"
,
PressurePumpCheckEnum
.
LE
.
getCode
(),
""
,
"30"
,
PressurePumpValueEnum
.
LATELY_START
.
getCode
(),
PressurePumpMessageEnum
.
MESSAGE_LEVEL_QT_WJ
.
getCode
()),
ALL_STOP_QT_YZ
(
"FHS_PressurePump_Stop_ALL_STOP_QT_YZ"
,
PressurePumpCheckEnum
.
BE
.
getCode
(),
"30"
,
"60"
,
PressurePumpValueEnum
.
LATELY_START
.
getCode
(),
PressurePumpMessageEnum
.
MESSAGE_LEVEL_YZ
.
getCode
()),
ALL_STOP_QT_YB
(
"FHS_PressurePump_Stop_ALL_STOP_QT_YB"
,
PressurePumpCheckEnum
.
BE
.
getCode
(),
"60"
,
"240"
,
PressurePumpValueEnum
.
LATELY_START
.
getCode
(),
PressurePumpMessageEnum
.
MESSAGE_LEVEL_YB
.
getCode
());
private
String
code
;
private
String
operator
;
private
String
leftValue
;
private
String
rightValue
;
private
String
compareValue
;
private
String
level
;
private
PressurePumpEnum
(
String
code
,
String
operator
,
String
leftValue
,
String
rightValue
,
String
compareValue
,
String
level
)
{
this
.
code
=
code
;
this
.
operator
=
operator
;
this
.
leftValue
=
leftValue
;
this
.
rightValue
=
rightValue
;
this
.
compareValue
=
compareValue
;
this
.
level
=
level
;
}
public
static
List
<
PressurePumpEnum
>
getEnumListByCode
(
String
code
)
{
List
<
PressurePumpEnum
>
list
=
new
ArrayList
<>();
for
(
PressurePumpEnum
e
:
PressurePumpEnum
.
values
())
{
if
(
e
.
getCode
().
startsWith
(
code
))
{
list
.
add
(
e
);
}
}
return
list
;
}
public
String
getCode
()
{
return
code
;
}
public
String
getOperator
()
{
return
operator
;
}
public
String
getLeftValue
()
{
return
leftValue
;
}
public
String
getRightValue
()
{
return
rightValue
;
}
public
String
getCompareValue
()
{
return
compareValue
;
}
public
String
getLevel
()
{
return
level
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/enums/PressurePumpMessageEnum.java
0 → 100644
View file @
e59bc0ce
package
com
.
yeejoin
.
equipmanage
.
common
.
enums
;
public
enum
PressurePumpMessageEnum
{
MESSAGE_LEVEL_YB
(
"YB"
,
"【%s】分钟内,启停间隔较小"
,
""
,
"名称:稳压泵启停异常提醒;时间:%s;内容:【%s】- 【%s】 - 【%s】分钟内,设备启停频繁,请及时查看处理"
),
MESSAGE_LEVEL_YZ
(
"YZ"
,
"【%s】分钟内,启停间隔较小"
,
""
,
"名称:稳压泵启停异常提醒;时间:%s;内容:【%s】- 【%s】 - 【%s】分钟内,设备启停频繁,请及时查看处理"
),
MESSAGE_LEVEL_QT_WJ
(
"QT_WJ"
,
"【%s】分钟内,设备启停频繁"
,
""
,
"名称:漏水提醒; 时间:%s;内容:【%s】- 【%s】 - 【%s】分钟内,设备启停频繁,可能存在漏水,请及时查看处理"
),
MESSAGE_LEVEL_QT_WJ_YXSC
(
"WJ_YXSC"
,
"运行时长超过【%s】分钟,存在漏水可能"
,
""
,
"名称:漏水提醒; 时间:%s;内容:【%s】- 【%s】 - 运行时长超过【%s】分钟,存在漏水可能,请及时查看处理"
);
private
String
code
;
private
String
allMessage
;
private
String
marqueeMessage
;
private
String
recordMessage
;
private
PressurePumpMessageEnum
(
String
code
,
String
allMessage
,
String
marqueeMessage
,
String
recordMessage
)
{
this
.
code
=
code
;
this
.
allMessage
=
allMessage
;
this
.
marqueeMessage
=
marqueeMessage
;
this
.
recordMessage
=
recordMessage
;
}
public
String
getCode
()
{
return
code
;
}
public
String
getAllMessage
()
{
return
allMessage
;
}
public
String
getMarqueeMessage
()
{
return
marqueeMessage
;
}
public
String
getRecordMessage
()
{
return
recordMessage
;
}
public
static
PressurePumpMessageEnum
getByCode
(
String
code
)
{
for
(
PressurePumpMessageEnum
l
:
PressurePumpMessageEnum
.
values
())
{
if
(
code
.
equals
(
l
.
getCode
()))
{
return
l
;
}
}
return
null
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/enums/PressurePumpValueEnum.java
0 → 100644
View file @
e59bc0ce
package
com
.
yeejoin
.
equipmanage
.
common
.
enums
;
public
enum
PressurePumpValueEnum
{
LAST_STOP
(
"lastStop"
,
"上次停泵时间"
),
LAST_START
(
"lastStart"
,
"上次启泵时间"
),
LATELY_STOP
(
"latelyStop"
,
"所有泵最近一次停泵时间"
),
LATELY_START
(
"latelyStart"
,
"所有泵最近一次启泵时间"
);
private
String
code
;
private
String
describe
;
private
PressurePumpValueEnum
(
String
code
,
String
describe
)
{
this
.
code
=
code
;
this
.
describe
=
describe
;
}
public
String
getCode
()
{
return
code
;
}
public
String
getDescribe
()
{
return
describe
;
}
public
static
PressurePumpValueEnum
getByCode
(
String
code
)
{
for
(
PressurePumpValueEnum
l
:
PressurePumpValueEnum
.
values
())
{
if
(
code
.
equals
(
l
.
getCode
()))
{
return
l
;
}
}
return
null
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/EquipmentSpecificIndexMapper.java
View file @
e59bc0ce
...
@@ -110,4 +110,7 @@ public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecif
...
@@ -110,4 +110,7 @@ public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecif
List
<
EquipmentSpecificIndex
>
getEquipmentSpeIndexByIotCodeTrend
(
String
iotCode
,
Integer
isTrend
,
String
fieldKey
);
List
<
EquipmentSpecificIndex
>
getEquipmentSpeIndexByIotCodeTrend
(
String
iotCode
,
Integer
isTrend
,
String
fieldKey
);
List
<
Map
<
String
,
Object
>>
getEquipSpecificScrap
();
List
<
EquipmentSpecificIndex
>
getEquipIndexInIndex
(
@Param
(
"list"
)
List
<
String
>
listIndex
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IEquipmentSpecificIndexService.java
View file @
e59bc0ce
...
@@ -27,4 +27,11 @@ public interface IEquipmentSpecificIndexService extends IService<EquipmentSpecif
...
@@ -27,4 +27,11 @@ public interface IEquipmentSpecificIndexService extends IService<EquipmentSpecif
* @Date 2020/11/3 17:58
* @Date 2020/11/3 17:58
*/
*/
List
<
EquipmentSpecificIndex
>
getEquipmentSpeIndexBySpeIotCode
(
String
iotCode
);
List
<
EquipmentSpecificIndex
>
getEquipmentSpeIndexBySpeIotCode
(
String
iotCode
);
/**
* 根据指标key查询列表
* @param listIndex keys
* @return 列表
*/
List
<
EquipmentSpecificIndex
>
getEquipmentSpeIndexByIndex
(
List
<
String
>
listIndex
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificIndexServiceImpl.java
View file @
e59bc0ce
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex
;
import
com.yeejoin.equipmanage.mapper.EquipmentSpecificIndexMapper
;
import
com.yeejoin.equipmanage.mapper.EquipmentSpecificIndexMapper
;
...
@@ -23,4 +24,9 @@ public class EquipmentSpecificIndexServiceImpl extends ServiceImpl<EquipmentSpec
...
@@ -23,4 +24,9 @@ public class EquipmentSpecificIndexServiceImpl extends ServiceImpl<EquipmentSpec
public
List
<
EquipmentSpecificIndex
>
getEquipmentSpeIndexBySpeIotCode
(
String
iotCode
)
{
public
List
<
EquipmentSpecificIndex
>
getEquipmentSpeIndexBySpeIotCode
(
String
iotCode
)
{
return
this
.
baseMapper
.
getEquipmentSpeIndexBySpeIotCode
(
iotCode
);
return
this
.
baseMapper
.
getEquipmentSpeIndexBySpeIotCode
(
iotCode
);
}
}
@Override
public
List
<
EquipmentSpecificIndex
>
getEquipmentSpeIndexByIndex
(
List
<
String
>
listIndex
)
{
return
this
.
baseMapper
.
getEquipIndexInIndex
(
listIndex
);
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificSerivceImpl.java
View file @
e59bc0ce
...
@@ -6,6 +6,8 @@ import java.util.*;
...
@@ -6,6 +6,8 @@ import java.util.*;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.MessageModel
;
import
com.yeejoin.equipmanage.common.entity.vo.*
;
import
com.yeejoin.equipmanage.common.entity.vo.*
;
import
com.yeejoin.equipmanage.common.vo.*
;
import
com.yeejoin.equipmanage.common.vo.*
;
import
com.yeejoin.equipmanage.mapper.*
;
import
com.yeejoin.equipmanage.mapper.*
;
...
@@ -17,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -17,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
...
@@ -162,6 +165,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
...
@@ -162,6 +165,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Value
(
"${equipment.type}"
)
@Value
(
"${equipment.type}"
)
String
equipmentCategoryLeftTypeCode
;
String
equipmentCategoryLeftTypeCode
;
@Value
(
"${equipment.scrap.day}"
)
String
equipmentScrapDay
;
@Autowired
@Autowired
private
ISyncDataService
syncDataService
;
private
ISyncDataService
syncDataService
;
...
@@ -1805,4 +1811,73 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
...
@@ -1805,4 +1811,73 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
return
infoVoList
;
return
infoVoList
;
}
}
/**
* 在设备报废前30日 每日9点执行 系统推送提醒。设备报废后停止消息推送提醒。。
*
* @throws Exception
*/
@Scheduled
(
cron
=
"${equipment.scrap.cron}"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
equipmentScrap
()
throws
Exception
{
List
<
Map
<
String
,
Object
>>
equipSpecificScrap
=
equipmentSpecificIndexMapper
.
getEquipSpecificScrap
();
equipSpecificScrap
.
forEach
(
e
->{
try
{
int
year
=
e
.
get
(
"weExpiry"
)
!=
null
?
Integer
.
parseInt
(
e
.
get
(
"weExpiry"
).
toString
())
:
Integer
.
parseInt
(
e
.
get
(
"wesExpiry"
).
toString
());
Date
productDate
=
DateUtils
.
dateParse
(
e
.
get
(
"product"
).
toString
(),
DateUtils
.
DATE_TIME_PATTERN
);
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
productDate
);
calendar
.
add
(
Calendar
.
YEAR
,
year
);
Date
now
=
new
Date
();
String
scrapTime
=
new
SimpleDateFormat
(
DateUtils
.
DATE_TIME_PATTERN
).
format
(
calendar
.
getTime
());
int
i
=
0
;
while
(
now
.
after
(
calendar
.
getTime
()))
{
calendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
1
);
i
++;
}
if
(
i
<
Integer
.
parseInt
(
equipmentScrapDay
)
&&
i
>
-
1
)
{
syncSystemctlMsg
(
e
,
scrapTime
,
i
);
}
}
catch
(
ParseException
parseException
)
{
parseException
.
printStackTrace
();
}
});
}
void
syncSystemctlMsg
(
Map
<
String
,
Object
>
map
,
String
scrapTime
,
int
i
)
{
try
{
MessageModel
model
=
new
MessageModel
();
model
.
setTitle
(
"报废到期提醒"
);
String
equipName
=
map
.
get
(
"name"
).
toString
();
String
location
=
map
.
get
(
"sName"
).
toString
()
+
map
.
get
(
"position"
).
toString
()
;
String
body
=
String
.
format
(
"%s-%s于%s报废,请提前更换处理"
,
equipName
,
location
,
scrapTime
);
String
join
=
String
.
format
(
"设备还剩%s天报废,请提前更换"
,
i
);
model
.
setBody
(
body
);
model
.
setMsgType
(
"scrapWarning"
);
model
.
setSendTime
(
new
Date
());
model
.
setIsSendApp
(
false
);
model
.
setTerminal
(
"WEB"
);
model
.
setIsSendWeb
(
true
);
model
.
setRelationId
(
map
.
get
(
"id"
).
toString
());
model
.
setCategory
(
1
);
List
<
String
>
receive
=
new
ArrayList
<>();
receive
.
add
(
"system"
);
Map
<
String
,
String
>
ext
=
new
HashMap
<>();
ext
.
put
(
"content"
,
join
);
ext
.
put
(
"type"
,
"报废到期"
);
ext
.
put
(
"name"
,
map
.
get
(
"name"
).
toString
());
ext
.
put
(
"time"
,
new
SimpleDateFormat
(
DateUtils
.
DATE_TIME_PATTERN
).
format
(
new
Date
()));
model
.
setExtras
(
ext
);
model
.
setRecivers
(
receive
);
Systemctl
.
messageClient
.
create
(
model
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttReceiveServiceImpl.java
View file @
e59bc0ce
This diff is collapsed.
Click to expand it.
amos-boot-system-equip/src/main/resources/application-dev.properties
View file @
e59bc0ce
...
@@ -101,3 +101,12 @@ iot.code.prefix.have.used=
...
@@ -101,3 +101,12 @@ iot.code.prefix.have.used=
#是否向iot推送消息
#是否向iot推送消息
isSendIot
=
false
isSendIot
=
false
#报废前30日 发起提醒
equipment.scrap.day
=
30
#提醒时间
equipment.scrap.cron
=
0 0 9 * * ?
# 稳压泵启动信号
equipment.pressurepump.start
=
FHS_PressurePump_Start
# 稳压泵停止信号
equipment.pressurepump.stop
=
FHS_PressurePump_Stop
amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificIndexMapper.xml
View file @
e59bc0ce
This diff is collapsed.
Click to expand it.
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