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
30de84de
Commit
30de84de
authored
Mar 03, 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
ba1be8c5
c0bf78b9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
66 additions
and
63 deletions
+66
-63
DayHourEnum.java
...ava/com/yeejoin/equipmanage/common/enums/DayHourEnum.java
+0
-31
DateUtils.java
.../java/com/yeejoin/equipmanage/common/utils/DateUtils.java
+16
-12
EmergencyController.java
...m/yeejoin/equipmanage/controller/EmergencyController.java
+20
-1
IEmergencyService.java
...va/com/yeejoin/equipmanage/service/IEmergencyService.java
+2
-0
IPressurePumpService.java
...com/yeejoin/equipmanage/service/IPressurePumpService.java
+7
-0
EmergencyServiceImpl.java
...eejoin/equipmanage/service/impl/EmergencyServiceImpl.java
+0
-0
EquipmentSpecificAlarmServiceImpl.java
...anage/service/impl/EquipmentSpecificAlarmServiceImpl.java
+4
-11
PressurePumpServiceImpl.java
...oin/equipmanage/service/impl/PressurePumpServiceImpl.java
+15
-7
OrgUsrMapper.xml
...t-system-equip/src/main/resources/mapper/OrgUsrMapper.xml
+2
-1
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
deleted
100644 → 0
View file @
ba1be8c5
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-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/utils/DateUtils.java
View file @
30de84de
...
...
@@ -473,9 +473,10 @@ public class DateUtils {
* @throws ParseException
*/
public
static
int
dateBetweenNew
(
Date
startDate
,
Date
endDate
)
throws
ParseException
{
Date
dateStart
=
dateParse
(
dateFormat
(
startDate
,
DATE_PATTERN
),
DATE_PATTERN
);
Date
dateEnd
=
dateParse
(
dateFormat
(
endDate
,
DATE_PATTERN
),
DATE_PATTERN
);
return
(
int
)
((
dateEnd
.
getTime
()
-
dateStart
.
getTime
())
/
1000
/
60
/
60
);
Date
dateStart
=
dateParse
(
dateFormat
(
startDate
,
DATE_TIME_PATTERN
),
DATE_TIME_PATTERN
);
Date
dateEnd
=
dateParse
(
dateFormat
(
endDate
,
DATE_TIME_PATTERN
),
DATE_TIME_PATTERN
);
double
ceil
=
Math
.
ceil
((
dateEnd
.
getTime
()
-
dateStart
.
getTime
())
*
1.0
/
1000
/
60
/
60
);
return
new
Double
(
ceil
).
intValue
()
;
}
/**
...
...
@@ -487,9 +488,10 @@ public class DateUtils {
* @throws ParseException
*/
public
static
int
dateBetweenNew1
(
Date
startDate
,
Date
endDate
)
throws
ParseException
{
Date
dateStart
=
dateParse
(
dateFormat
(
startDate
,
DATE_PATTERN
),
DATE_PATTERN
);
Date
dateEnd
=
dateParse
(
dateFormat
(
endDate
,
DATE_PATTERN
),
DATE_PATTERN
);
return
(
int
)
((
dateEnd
.
getTime
()
-
dateStart
.
getTime
())
/
1000
/
60
/
30
);
Date
dateStart
=
dateParse
(
dateFormat
(
startDate
,
DATE_TIME_PATTERN
),
DATE_TIME_PATTERN
);
Date
dateEnd
=
dateParse
(
dateFormat
(
endDate
,
DATE_TIME_PATTERN
),
DATE_TIME_PATTERN
);
double
ceil
=
Math
.
ceil
((
dateEnd
.
getTime
()
-
dateStart
.
getTime
())
*
1.0
/
1000
/
60
/
30
);
return
new
Double
(
ceil
).
intValue
()
;
}
/**
...
...
@@ -501,9 +503,10 @@ public class DateUtils {
* @throws ParseException
*/
public
static
int
dateBetweenNew2
(
Date
startDate
,
Date
endDate
)
throws
ParseException
{
Date
dateStart
=
dateParse
(
dateFormat
(
startDate
,
DATE_PATTERN
),
DATE_PATTERN
);
Date
dateEnd
=
dateParse
(
dateFormat
(
endDate
,
DATE_PATTERN
),
DATE_PATTERN
);
return
(
int
)
((
dateEnd
.
getTime
()
-
dateStart
.
getTime
())
/
1000
/
60
/
120
);
Date
dateStart
=
dateParse
(
dateFormat
(
startDate
,
DATE_TIME_PATTERN
),
DATE_TIME_PATTERN
);
Date
dateEnd
=
dateParse
(
dateFormat
(
endDate
,
DATE_TIME_PATTERN
),
DATE_TIME_PATTERN
);
double
ceil
=
Math
.
ceil
((
dateEnd
.
getTime
()
-
dateStart
.
getTime
())
*
1.0
/
1000
/
60
/
120
);
return
new
Double
(
ceil
).
intValue
()
;
}
/**
...
...
@@ -515,9 +518,10 @@ public class DateUtils {
* @throws ParseException
*/
public
static
int
dateBetweenNew3
(
Date
startDate
,
Date
endDate
)
throws
ParseException
{
Date
dateStart
=
dateParse
(
dateFormat
(
startDate
,
DATE_PATTERN
),
DATE_PATTERN
);
Date
dateEnd
=
dateParse
(
dateFormat
(
endDate
,
DATE_PATTERN
),
DATE_PATTERN
);
return
(
int
)
((
dateEnd
.
getTime
()
-
dateStart
.
getTime
())
/
1000
/
60
/
240
);
Date
dateStart
=
dateParse
(
dateFormat
(
startDate
,
DATE_TIME_PATTERN
),
DATE_TIME_PATTERN
);
Date
dateEnd
=
dateParse
(
dateFormat
(
endDate
,
DATE_TIME_PATTERN
),
DATE_TIME_PATTERN
);
double
ceil
=
Math
.
ceil
((
dateEnd
.
getTime
()
-
dateStart
.
getTime
())
*
1.0
/
1000
/
60
/
240
);
return
new
Double
(
ceil
).
intValue
()
;
}
/**
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EmergencyController.java
View file @
30de84de
...
...
@@ -577,7 +577,7 @@ public class EmergencyController extends AbstractBaseController {
@PersonIdentify
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getPressurePumpStatusChart"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"四横八纵-稳压泵启停状态图"
,
notes
=
"四横八纵-稳压泵启停状态图"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"四横八纵-稳压泵启停状态图"
,
notes
=
"四横八纵-稳压泵启停状态图
,取舍补点
"
)
public
ResponseModel
getPressurePumpStatusChart
(
@RequestParam
String
startTime
,
@RequestParam
String
endTime
,
@RequestParam
(
required
=
false
)
String
bizOrgCode
)
{
if
(
StringUtils
.
isEmpty
(
bizOrgCode
))
{
...
...
@@ -595,6 +595,25 @@ public class EmergencyController extends AbstractBaseController {
@PersonIdentify
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getPressurePumpStatusDetailChart"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"四横八纵-稳压泵启停状态图"
,
notes
=
"四横八纵-稳压泵启停状态图,分钟级补点"
)
public
ResponseModel
getPressurePumpStatusDetailChart
(
@RequestParam
String
startTime
,
@RequestParam
String
endTime
,
@RequestParam
(
required
=
false
)
String
bizOrgCode
)
{
if
(
StringUtils
.
isEmpty
(
bizOrgCode
))
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
if
(!
ValidationUtil
.
isEmpty
(
personIdentity
))
{
bizOrgCode
=
personIdentity
.
getBizOrgCode
();
if
(
bizOrgCode
==
null
)
{
return
CommonResponseUtil
.
success
(
Collections
.
EMPTY_MAP
);
}
}
}
return
CommonResponseUtil
.
success
(
iEmergencyService
.
getPressurePumpStatusDetailChart
(
startTime
,
endTime
,
bizOrgCode
));
}
@PersonIdentify
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getPressurePumpDiagnosticAnalysis"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"四横八纵-稳压泵诊断分析"
,
notes
=
"四横八纵-稳压泵诊断分析"
)
public
ResponseModel
getPressurePumpDiagnosticAnalysis
(
@RequestParam
(
required
=
false
)
String
bizOrgCode
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IEmergencyService.java
View file @
30de84de
...
...
@@ -57,6 +57,8 @@ public interface IEmergencyService {
Map
<
String
,
Object
>
getPressurePumpStatusChart
(
String
startTime
,
String
endTime
,
String
bizOrgCode
);
Map
<
String
,
Object
>
getPressurePumpStatusDetailChart
(
String
startTime
,
String
endTime
,
String
bizOrgCode
);
List
<
Map
<
String
,
Object
>>
getPressurePumpDiagnosticAnalysis
(
String
bizOrgCode
);
Page
<
Map
<
String
,
Object
>>
alarmList
(
Page
<
Map
<
String
,
Object
>>
page
,
String
bizOrgCode
,
List
<
String
>
types
,
List
<
String
>
emergencyLevels
,
String
name
,
Integer
cleanStatus
,
Integer
handleStatus
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IPressurePumpService.java
View file @
30de84de
...
...
@@ -178,4 +178,11 @@ public interface IPressurePumpService {
* @return
*/
List
<
OrgUsrDto
>
getOrgUsrDtoInfo
(
Map
<
String
,
String
>
map
);
/**
* 获取公司顶级bizOrgCode
* @param bizOrgCode
* @return
*/
String
getCompanyBizOrgCode
(
String
bizOrgCode
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EmergencyServiceImpl.java
View file @
30de84de
This diff is collapsed.
Click to expand it.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificAlarmServiceImpl.java
View file @
30de84de
...
...
@@ -812,20 +812,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
// 计算平均每小时打压频率
try
{
int
hour
=
DateUtils
.
dateBetweenNew
(
DateUtils
.
dateParse
(
startTime
,
null
),
DateUtils
.
dateParse
(
endTime
,
null
));
int
hour
=
DateUtils
.
dateBetweenNew
(
DateUtils
.
dateParse
(
startTime
,
DateUtils
.
DATE_TIME_PATTERN
),
DateUtils
.
dateParse
(
endTime
,
DateUtils
.
DATE_TIME_PATTERN
));
int
hafHour
=
DateUtils
.
dateBetweenNew1
(
DateUtils
.
dateParse
(
startTime
,
null
),
DateUtils
.
dateParse
(
endTime
,
null
));
int
hafHour
=
DateUtils
.
dateBetweenNew1
(
DateUtils
.
dateParse
(
startTime
,
DateUtils
.
DATE_TIME_PATTERN
),
DateUtils
.
dateParse
(
endTime
,
DateUtils
.
DATE_TIME_PATTERN
));
int
twoHour
=
DateUtils
.
dateBetweenNew2
(
DateUtils
.
dateParse
(
startTime
,
null
),
DateUtils
.
dateParse
(
endTime
,
null
));
int
twoHour
=
DateUtils
.
dateBetweenNew2
(
DateUtils
.
dateParse
(
startTime
,
DateUtils
.
DATE_TIME_PATTERN
),
DateUtils
.
dateParse
(
endTime
,
DateUtils
.
DATE_TIME_PATTERN
));
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
();
}
int
fourHour
=
DateUtils
.
dateBetweenNew3
(
DateUtils
.
dateParse
(
startTime
,
DateUtils
.
DATE_TIME_PATTERN
),
DateUtils
.
dateParse
(
endTime
,
DateUtils
.
DATE_TIME_PATTERN
));
if
(
allNum
/
hour
>
15
)
{
retMap
.
put
(
"status"
,
"异常"
);
}
else
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/PressurePumpServiceImpl.java
View file @
30de84de
...
...
@@ -58,13 +58,8 @@ public class PressurePumpServiceImpl implements IPressurePumpService {
@Async
public
void
saveDataToRedis
(
List
<
IotDataVO
>
iotDatalist
,
String
iotCode
,
String
bizOrgCode
)
{
// 获取公司顶级bizOrgCode
Map
<
String
,
String
>
params
=
new
HashMap
<>();
params
.
put
(
"bizOrgType"
,
PressurePumpRelateEnum
.
BIZ_ORG_TYPE_COMPANY
.
getValue
());
params
.
put
(
"bizOrgCode"
,
bizOrgCode
);
List
<
OrgUsrDto
>
orgUsrDtoList
=
getOrgUsrDtoInfo
(
params
);
if
(
CollectionUtils
.
isNotEmpty
(
orgUsrDtoList
))
{
bizOrgCode
=
orgUsrDtoList
.
get
(
0
).
getBizOrgCode
();
if
(
StringUtils
.
isNotBlank
(
bizOrgCode
))
{
bizOrgCode
=
getCompanyBizOrgCode
(
bizOrgCode
);
if
(
StringUtils
.
isNotBlank
(
bizOrgCode
))
{
String
pressurePumpValue
=
PressurePumpRelateEnum
.
PRESSURE_PUMP
.
getValue
();
// 获取配置JSON信息集合
List
<
Map
>
list
=
getNameKeyInfoList
(
pressurePumpValue
);
...
...
@@ -84,6 +79,17 @@ public class PressurePumpServiceImpl implements IPressurePumpService {
}
}
}
@Override
public
String
getCompanyBizOrgCode
(
String
bizOrgCode
)
{
Map
<
String
,
String
>
params
=
new
HashMap
<>();
params
.
put
(
"bizOrgType"
,
PressurePumpRelateEnum
.
BIZ_ORG_TYPE_COMPANY
.
getValue
());
params
.
put
(
"bizOrgCode"
,
bizOrgCode
);
List
<
OrgUsrDto
>
orgUsrDtoList
=
getOrgUsrDtoInfo
(
params
);
if
(
CollectionUtils
.
isNotEmpty
(
orgUsrDtoList
))
{
bizOrgCode
=
orgUsrDtoList
.
get
(
orgUsrDtoList
.
size
()
-
1
).
getBizOrgCode
();
}
return
bizOrgCode
;
}
@Override
...
...
@@ -303,6 +309,8 @@ public class PressurePumpServiceImpl implements IPressurePumpService {
PressurePumpCountVo
countVo
=
new
PressurePumpCountVo
();
countVo
.
setTime
(
time
);
countVo
.
setValue
(
dataMap
.
get
(
time
).
size
());
// 获取公司顶级bizOrgCode
bizOrgCode
=
getCompanyBizOrgCode
(
bizOrgCode
);
// 获取的数据存储到redis
String
topic
=
String
.
join
(
":"
,
infoCode
,
bizOrgCode
,
countRedisKey
,
fieldKey
,
iotCode
,
time
);
countVo
.
setIotCode
(
topic
);
...
...
amos-boot-system-equip/src/main/resources/mapper/OrgUsrMapper.xml
View file @
30de84de
...
...
@@ -64,8 +64,9 @@
biz_org_type = #{bizOrgType}
</if>
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
AND locate(
#{bizOrgCode}, biz_org_code
) > 0
AND locate(
biz_org_code, #{bizOrgCode}
) > 0
</if>
</where>
ORDER BY sequence_nbr
</select>
</mapper>
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