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
0137ca0b
Commit
0137ca0b
authored
Feb 17, 2023
by
KeYong
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_dl_plan6_temp' into develop_dl_plan6_temp
parents
087faae0
48885585
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
125 additions
and
51 deletions
+125
-51
DayHourEnum.java
...ava/com/yeejoin/equipmanage/common/enums/DayHourEnum.java
+31
-0
BigScreenController.java
...m/yeejoin/equipmanage/controller/BigScreenController.java
+2
-2
ConfigureController.java
...m/yeejoin/equipmanage/controller/ConfigureController.java
+4
-4
SupervisionConfigureController.java
...quipmanage/controller/SupervisionConfigureController.java
+43
-36
IotFeign.java
...src/main/java/com/yeejoin/equipmanage/fegin/IotFeign.java
+0
-3
FireFightingSystemMapper.java
.../yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
+7
-0
EmergencyServiceImpl.java
...eejoin/equipmanage/service/impl/EmergencyServiceImpl.java
+2
-2
EquipmentSpecificAlarmServiceImpl.java
...anage/service/impl/EquipmentSpecificAlarmServiceImpl.java
+20
-4
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+15
-0
pom.xml
pom.xml
+1
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/enums/DayHourEnum.java
0 → 100644
View file @
0137ca0b
package
com
.
yeejoin
.
equipmanage
.
common
.
enums
;
/**
* 一天内不同时段个数
*/
public
enum
DayHourEnum
{
hour
(
"小时"
,
24
),
hafHour
(
"半小时个数"
,
48
),
twoHour
(
"两小时个数"
,
12
),
fourHour
(
"四小时个数"
,
6
);
private
String
name
;
private
int
number
;
DayHourEnum
(
String
name
,
int
number
){
this
.
name
=
name
;
this
.
number
=
number
;
}
public
String
getName
()
{
return
name
;
}
public
int
getNumber
()
{
return
number
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/BigScreenController.java
View file @
0137ca0b
...
...
@@ -114,8 +114,8 @@ public class BigScreenController extends AbstractBaseController {
ResponseModel
entity1
=
null
;
ResponseModel
entity2
=
null
;
try
{
entity1
=
iotFeign
.
selectListNew
(
getAppKey
(),
getProduct
(),
getToken
(),
prefix
,
suffix
,
startDateStr
,
nowStrLong
,
"true"
,
pressurePumpStart
);
entity2
=
iotFeign
.
selectListNew
(
getAppKey
(),
getProduct
(),
getToken
(),
prefix
,
suffix
,
startDateStr
,
nowStrLong
,
"false"
,
pressurePumpStart
);
entity1
=
iotFeign
.
selectListNew
(
prefix
,
suffix
,
startDateStr
,
nowStrLong
,
"true"
,
pressurePumpStart
);
entity2
=
iotFeign
.
selectListNew
(
prefix
,
suffix
,
startDateStr
,
nowStrLong
,
"false"
,
pressurePumpStart
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/ConfigureController.java
View file @
0137ca0b
...
...
@@ -332,8 +332,8 @@ public class ConfigureController extends AbstractBaseController {
ResponseModel
entity1
=
null
;
ResponseModel
entity2
=
null
;
try
{
entity1
=
iotFeign
.
selectListNew
(
getAppKey
(),
getProduct
(),
getToken
(),
prefix
,
suffix
,
startDateStr
,
nowStrLong
,
"true"
,
pressurePumpStart
);
entity2
=
iotFeign
.
selectListNew
(
getAppKey
(),
getProduct
(),
getToken
(),
prefix
,
suffix
,
startDateStr
,
nowStrLong
,
"false"
,
pressurePumpStart
);
entity1
=
iotFeign
.
selectListNew
(
prefix
,
suffix
,
startDateStr
,
nowStrLong
,
"true"
,
pressurePumpStart
);
entity2
=
iotFeign
.
selectListNew
(
prefix
,
suffix
,
startDateStr
,
nowStrLong
,
"false"
,
pressurePumpStart
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -393,8 +393,8 @@ public class ConfigureController extends AbstractBaseController {
ResponseModel
entity1
=
null
;
ResponseModel
entity2
=
null
;
try
{
entity1
=
iotFeign
.
selectListNew
(
getAppKey
(),
getProduct
(),
getToken
(),
prefix
,
suffix
,
startDateStr
,
nowStrLong
,
"true"
,
pressurePumpStart
);
entity2
=
iotFeign
.
selectListNew
(
getAppKey
(),
getProduct
(),
getToken
(),
prefix
,
suffix
,
startDateStr
,
nowStrLong
,
"false"
,
pressurePumpStart
);
entity1
=
iotFeign
.
selectListNew
(
prefix
,
suffix
,
startDateStr
,
nowStrLong
,
"true"
,
pressurePumpStart
);
entity2
=
iotFeign
.
selectListNew
(
prefix
,
suffix
,
startDateStr
,
nowStrLong
,
"false"
,
pressurePumpStart
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/SupervisionConfigureController.java
View file @
0137ca0b
...
...
@@ -386,48 +386,55 @@ public class SupervisionConfigureController extends AbstractBaseController {
Long
stop_time
=
0L
;
Date
startDate
=
null
;
Date
stopDate
=
null
;
if
(
ObjectUtils
.
isEmpty
(
item
.
get
(
"start"
))
&&
ObjectUtils
.
isEmpty
(
item
.
get
(
"stop"
)))
{
item
.
put
(
"equipment_index_name"
,
"无信号"
);
item
.
put
(
"update_time"
,
false
);
if
(!
ObjectUtils
.
isEmpty
(
item
.
get
(
"start"
)))
{
startTime
=
item
.
get
(
"start"
).
toString
().
substring
(
0
,
19
).
replace
(
"T"
,
" "
);
startDate
=
DateUtils
.
dateAddHours
(
DateUtils
.
longStr2Date
(
startTime
),
+
8
);
startTimeList
.
add
(
startDate
.
getTime
());
start_time
=
startDate
.
getTime
();
item
.
put
(
"startTime"
,
startDate
);
}
else
{
if
(!
ObjectUtils
.
isEmpty
(
item
.
get
(
"start"
)))
{
startTime
=
item
.
get
(
"start"
).
toString
().
substring
(
0
,
19
).
replace
(
"T"
,
" "
);
startDate
=
DateUtils
.
dateAddHours
(
DateUtils
.
longStr2Date
(
startTime
),
+
8
);
startTimeList
.
add
(
startDate
.
getTime
());
start_time
=
startDate
.
getTime
();
item
.
put
(
"startTime"
,
startDate
);
}
else
{
item
.
put
(
"startTime"
,
0
);
}
if
(!
ObjectUtils
.
isEmpty
(
item
.
get
(
"stop"
)))
{
stopTime
=
item
.
get
(
"stop"
).
toString
().
substring
(
0
,
19
).
replace
(
"T"
,
" "
);
stopDate
=
DateUtils
.
dateAddHours
(
DateUtils
.
longStr2Date
(
stopTime
),
+
8
);
stopTimeList
.
add
(
stopDate
.
getTime
());
stop_time
=
stopDate
.
getTime
();
item
.
put
(
"stopTime"
,
stopDate
);
}
else
{
item
.
put
(
"stopTime"
,
0
);
item
.
put
(
"startTime"
,
0
);
}
if
(!
ObjectUtils
.
isEmpty
(
item
.
get
(
"stop"
)))
{
stopTime
=
item
.
get
(
"stop"
).
toString
().
substring
(
0
,
19
).
replace
(
"T"
,
" "
);
stopDate
=
DateUtils
.
dateAddHours
(
DateUtils
.
longStr2Date
(
stopTime
),
+
8
);
stopTimeList
.
add
(
stopDate
.
getTime
());
stop_time
=
stopDate
.
getTime
();
item
.
put
(
"stopTime"
,
stopDate
);
}
else
{
item
.
put
(
"stopTime"
,
0
);
}
Map
<
String
,
Object
>
stateMap
=
fireFightingSystemMapper
.
queryPressureNowSignalBySpecificId
((
Long
)
item
.
get
(
"id"
));
Long
update_date
=
0L
;
if
(!
ObjectUtils
.
isEmpty
(
stateMap
))
{
try
{
String
time1
=
stateMap
.
get
(
"update_date"
).
toString
().
replace
(
"T"
,
" "
);
update_date
=
sdf
.
parse
(
time1
).
getTime
();
}
catch
(
ParseException
e
)
{
throw
new
RuntimeException
(
e
);
}
if
(
start_time
-
stop_time
>
0
)
{
long
res
=
nowDateTime
-
start_time
;
long
diffMinute
=
res
/
1000
/
60
;
if
(
diffMinute
>
5
)
{
time
=
false
;
}
item
.
put
(
"upTime"
,
diffMinute
);
item
.
put
(
"equipment_index_name"
,
"启动"
);
item
.
put
(
"update_time"
,
startDate
);
}
else
{
item
.
put
(
"upTime"
,
0
);
item
.
put
(
"equipment_index_name"
,
"停止"
);
item
.
put
(
"update_time"
,
stopDate
);
}
if
(
start_time
-
stop_time
>
0
)
{
long
res
=
nowDateTime
-
start_time
;
long
diffMinute
=
res
/
1000
/
60
;
if
(
diffMinute
>
5
)
{
time
=
false
;
}
item
.
put
(
"upTime"
,
diffMinute
);
item
.
put
(
"equipment_index_name"
,
update_date
-
start_time
>
0
?
stateMap
.
get
(
"equipment_index_name"
)
:
"启动"
);
item
.
put
(
"update_time"
,
update_date
-
start_time
>
0
?
stateMap
.
get
(
"update_date"
)
:
startDate
);
}
else
if
(
start_time
-
stop_time
<
0
)
{
item
.
put
(
"equipment_index_name"
,
update_date
-
stop_time
>
0
?
stateMap
.
get
(
"equipment_index_name"
)
:
"停止"
);
item
.
put
(
"update_time"
,
update_date
-
stop_time
>
0
?
stateMap
.
get
(
"update_date"
)
:
stopDate
);
}
else
{
item
.
put
(
"equipment_index_name"
,
ObjectUtils
.
isEmpty
(
stateMap
)
?
"无信号"
:
stateMap
.
get
(
"equipment_index_name"
));
item
.
put
(
"update_time"
,
ObjectUtils
.
isEmpty
(
stateMap
)
?
false
:
stateMap
.
get
(
"update_date"
));
}
item
.
put
(
"stateDesc"
,
Integer
.
parseInt
(
String
.
valueOf
(
item
.
get
(
"isAlarm"
)))
==
0
&&
time
?
"正常"
:
"异常"
);
if
(
"正常"
.
equals
(
item
.
get
(
"stateDesc"
).
toString
()))
{
item
.
put
(
"sort"
,
0
);
if
(
"正常"
.
equals
(
item
.
get
(
"stateDesc"
).
toString
()))
{
item
.
put
(
"sort"
,
0
);
}
else
{
item
.
put
(
"sort"
,
1
);
item
.
put
(
"sort"
,
1
);
}
}
// List<Long> startCollect = startTimeList.stream().sorted(Comparator.reverseOrder()).limit(1).collect(Collectors.toList());
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/fegin/IotFeign.java
View file @
0137ca0b
...
...
@@ -64,9 +64,6 @@ public interface IotFeign {
@RequestMapping
(
value
=
"v1/livedata/common/list"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
ResponseModel
selectListNew
(
@RequestHeader
(
"appKey"
)
String
appKey
,
@RequestHeader
(
"product"
)
String
product
,
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"measurement"
)
String
measurement
,
@RequestParam
(
required
=
false
,
value
=
"deviceName"
)
String
deviceName
,
@RequestParam
(
value
=
"timeStart"
)
String
beginDate
,
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
View file @
0137ca0b
...
...
@@ -427,6 +427,13 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
Map
<
String
,
String
>
queryPressureNowStateBySpecificId
(
@Param
(
"id"
)
Long
id
);
/**
* 根据装备ID查最新一条有信号的指标信息
* @param id
* @return
*/
Map
<
String
,
Object
>
queryPressureNowSignalBySpecificId
(
@Param
(
"id"
)
Long
id
);
/**
* 稳压泵信息-3小消防给水信息
* @param bizOrgCode
* @param systemCode
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EmergencyServiceImpl.java
View file @
0137ca0b
...
...
@@ -237,7 +237,7 @@ public class EmergencyServiceImpl implements IEmergencyService {
prefix
=
iotCode
.
toString
().
substring
(
0
,
8
);
suffix
=
iotCode
.
toString
().
substring
(
8
);
try
{
ResponseModel
responseModel
=
iotFeign
.
selectListNew
(
appKey
,
product
,
token
,
prefix
,
suffix
,
startTime
,
endTime
,
null
,
pressurePumpStart
);
ResponseModel
responseModel
=
iotFeign
.
selectListNew
(
prefix
,
suffix
,
startTime
,
endTime
,
null
,
pressurePumpStart
);
if
(
200
==
responseModel
.
getStatus
())
{
String
json
=
JSON
.
toJSONString
(
responseModel
.
getResult
());
List
<
Map
<
String
,
String
>>
dataList
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parse
(
json
);
...
...
@@ -402,7 +402,7 @@ public class EmergencyServiceImpl implements IEmergencyService {
durationTime
=
intervalTime2
;
intervalTime1
=
falseDataList
.
get
(
0
).
get
(
"createdTime"
);
String
stop5BeforeTime
=
DateUtils
.
convertDateToString
(
DateUtils
.
dateAddMinutes
(
DateUtils
.
convertStrToDate
(
intervalTime1
,
"yyyy-MM-dd HH:mm:ss"
),
-
5
),
"yyyy-MM-dd HH:mm:ss"
);
ResponseModel
pipeResponseModel
=
iotFeign
.
selectListNew
(
appKey
,
product
,
token
,
prefix
,
null
,
stop5BeforeTime
,
intervalTime2
,
null
,
"FHS_PipePressureDetector_PipePressure"
);
ResponseModel
pipeResponseModel
=
iotFeign
.
selectListNew
(
prefix
,
null
,
stop5BeforeTime
,
intervalTime2
,
null
,
"FHS_PipePressureDetector_PipePressure"
);
if
(
200
==
pipeResponseModel
.
getStatus
())
{
String
pipeJson
=
JSON
.
toJSONString
(
pipeResponseModel
.
getResult
());
List
<
Map
<
String
,
String
>>
pipeDataList
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parse
(
pipeJson
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificAlarmServiceImpl.java
View file @
0137ca0b
...
...
@@ -35,6 +35,7 @@ import org.springframework.data.domain.PageImpl;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -788,8 +789,18 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
if
(
equipmentSpecificMapper
.
getEquipmentSpecificIotCodeWYB
().
get
(
0
)
!=
null
)
{
vo
=
equipmentSpecificMapper
.
getEquipmentSpecificIotCodeWYB
().
get
(
0
);
}
int
startNum
=
Integer
.
parseInt
(
stringObjectMap
.
get
(
"startNum"
).
toString
());
ResponseModel
start
=
iotFeign
.
selectListNew
(
remoteSecurityService
.
getServerToken
().
getAppKey
(),
remoteSecurityService
.
getServerToken
().
getProduct
(),
remoteSecurityService
.
getServerToken
().
getToke
(),
vo
.
getIotCode
().
substring
(
0
,
8
),
null
,
startTime
,
endTime
,
"true"
,
pressurePumpStart
);
// 启停总数
int
allNum
=
0
;
// 启动次数
int
startNum
=
0
;
ResponseModel
all
=
iotFeign
.
selectListNew
(
vo
.
getIotCode
().
substring
(
0
,
8
),
null
,
startTime
,
endTime
,
null
,
pressurePumpStart
);
if
(
200
==
all
.
getStatus
()
&&
!
ObjectUtils
.
isEmpty
(
all
.
getResult
()))
{
String
json1
=
JSON
.
toJSONString
(
all
.
getResult
());
List
<
Map
<
String
,
String
>>
listObject1
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parse
(
json1
);
allNum
=
listObject1
.
size
();
}
ResponseModel
start
=
iotFeign
.
selectListNew
(
vo
.
getIotCode
().
substring
(
0
,
8
),
null
,
startTime
,
endTime
,
"true"
,
pressurePumpStart
);
if
(
200
==
start
.
getStatus
()
&&
!
ObjectUtils
.
isEmpty
(
start
.
getResult
()))
{
String
json1
=
JSON
.
toJSONString
(
start
.
getResult
());
List
<
Map
<
String
,
String
>>
listObject1
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parse
(
json1
);
...
...
@@ -797,7 +808,6 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
}
Map
<
String
,
Object
>
retMap
=
new
HashMap
<>();
int
allNum
=
Integer
.
parseInt
(
stringObjectMap
.
get
(
"allNum"
).
toString
());
// 计算平均每小时打压频率
try
{
...
...
@@ -808,7 +818,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
int
twoHour
=
DateUtils
.
dateBetweenNew2
(
DateUtils
.
dateParse
(
startTime
,
null
),
DateUtils
.
dateParse
(
endTime
,
null
));
int
fourHour
=
DateUtils
.
dateBetweenNew3
(
DateUtils
.
dateParse
(
startTime
,
null
),
DateUtils
.
dateParse
(
endTime
,
null
));
// 开始时间与结束时间为同一天时 给默认值
if
(
hour
==
0
){
hour
=
DayHourEnum
.
hour
.
getNumber
();
hafHour
=
DayHourEnum
.
hafHour
.
getNumber
();
twoHour
=
DayHourEnum
.
twoHour
.
getNumber
();
fourHour
=
DayHourEnum
.
fourHour
.
getNumber
();
}
if
(
allNum
/
hour
>
15
)
{
retMap
.
put
(
"status"
,
"异常"
);
}
else
{
...
...
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
0137ca0b
...
...
@@ -2831,6 +2831,21 @@
LIMIT 1
</select>
<select
id=
"queryPressureNowSignalBySpecificId"
resultType=
"java.util.Map"
>
SELECT
DATE_FORMAT(i.update_date, '%Y-%m-%d %H:%i:%S') update_date,
i.equipment_index_name,
value
FROM
wl_equipment_specific_index i
WHERE
i.equipment_specific_id = #{id,jdbcType=VARCHAR}
AND value
<![CDATA[<>]]>
'' AND value IS NOT NULL
ORDER BY
i.update_date DESC
LIMIT 1
</select>
<select
id=
"getPressurePumpInfo3Small"
resultType=
"java.util.Map"
>
SELECT
ed.`name`,
...
...
pom.xml
View file @
0137ca0b
...
...
@@ -31,6 +31,7 @@
<rule.version>
1.7.9-SNAPSHOT
</rule.version>
<itext.version>
7.1.1
</itext.version>
<elasticsearch.version>
7.15.2
</elasticsearch.version>
<sonar.qualitygate.wait>
true
</sonar.qualitygate.wait>
</properties>
<dependencies>
...
...
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