Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloud-fb
Overview
Overview
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
王衍超
cloud-fb
Commits
8be650b3
Commit
8be650b3
authored
May 12, 2021
by
高晓磊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取已经设置的预警人员id
parent
9f2dc139
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
22 deletions
+47
-22
StationDaoImpl.java
.../java/com/xyst/dinas/biz/internal/dao/StationDaoImpl.java
+1
-1
WarningServiceImpl.java
...main/java/com/xyst/dinas/biz/warn/WarningServiceImpl.java
+32
-17
WarningService.java
.../java/com/xyst/dinas/biz/warn/service/WarningService.java
+3
-0
WarnSettingController.java
...in/java/com/xyst/dinas/biz/web/WarnSettingController.java
+11
-4
No files found.
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/internal/dao/StationDaoImpl.java
View file @
8be650b3
...
...
@@ -56,7 +56,7 @@ public class StationDaoImpl extends AbstractBaseDao implements StationDao, Stat
@Override
public
List
<
KObject
>
listStationInfoByRegionalCompany
(
UUID
regionalCompanyId
)
{
KClass
bean
=
Amino
.
getStaticMetadataContext
().
getBean
(
StationConstant
.
ENTITY
,
KClass
.
class
);
KClass
bean
=
Amino
.
getStaticMetadataContext
().
getBean
(
ENTITY
,
KClass
.
class
);
DetachedCriteria
detachedCriteria
=
DetachedCriteria
.
forEntityName
(
bean
.
getName
());
detachedCriteria
.
add
(
Restrictions
.
eq
(
"del"
,
false
));
...
...
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/warn/WarningServiceImpl.java
View file @
8be650b3
package
com
.
xyst
.
dinas
.
biz
.
warn
;
import
java.time.LocalDateTime
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.UUID
;
import
java.util.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.lang.Nullable
;
...
...
@@ -26,14 +24,14 @@ public class WarningServiceImpl implements WarningService{
@Autowired
private
WarnSettingDao
warnSettingDao
;
/**
* 新增预警设置<br/>
* 自动触发预警
*/
@Override
public
UUID
insertWarnSetting
(
WarnSetting
warnSetting
)
{
String
billType
=
warnSetting
.
getBillType
();
String
warnCalculator
=
warnSetting
.
warnCalculator
();
Assert
.
notNull
(
billType
,
"The billType must not be null!"
);
...
...
@@ -63,18 +61,18 @@ public class WarningServiceImpl implements WarningService{
baseBusinessWarn
.
warn
();
return
warSettingId
;
}
/**
* 更新预警设置<br/>
* 自动触发预警
*/
@Override
public
void
updateWarnSetting
(
WarnSettingReq
warnSetting
)
{
UUID
warSettingId
=
warnSetting
.
getId
();
Assert
.
notNull
(
warSettingId
,
"The warSettingId must not be null"
);
KObject
warSettingIdObj
=
warnSettingDao
.
queryWarnSettingById
(
warSettingId
);
List
<
UUID
>
personnel
=
warnSetting
.
getPersonnel
();
if
(
personnel
!=
null
)
{
String
personnelStr
=
UuidListToString
(
personnel
);
...
...
@@ -91,7 +89,7 @@ public class WarningServiceImpl implements WarningService{
BaseBusinessWarn
baseBusinessWarn
=
new
BaseBusinessWarn
(
warSettingId
);
baseBusinessWarn
.
warn
();
}
/**
* 新增预警执行记录
* @param warnExeRecord
...
...
@@ -99,7 +97,7 @@ public class WarningServiceImpl implements WarningService{
*/
@Override
public
UUID
insertWarnExe
(
WarnExeRecord
warnExeRecord
)
{
KClass
type
=
Amino
.
getApplicationMetadataContext
().
getBean
(
WarnSettingConstant
.
ENTITY_WARNINGEXE
,
KClass
.
class
);
JsonNode
json
=
JSONObjectUtils
.
toJson
(
warnExeRecord
);
KObject
object
=
JSONObjectUtils
.
toObject
(
json
,
type
);
...
...
@@ -112,7 +110,7 @@ public class WarningServiceImpl implements WarningService{
object
.
set
(
WarnSettingConstant
.
ACTUAL_VALUE
,
warnExeRecord
.
getActualValue
());
return
warnSettingDao
.
create
(
object
);
}
@Override
public
void
updateWarnExe
(
WarnExeRecord
warnExeRecord
)
{
KObject
object
=
warnSettingDao
.
queryWarningExeById
(
warnExeRecord
.
getId
());
...
...
@@ -122,14 +120,14 @@ public class WarningServiceImpl implements WarningService{
if
(
warnExeRecord
.
getActualValue
()!=
null
)
object
.
set
(
"actualValue"
,
warnExeRecord
.
getActualValue
());
warnSettingDao
.
update
(
object
);
}
/**
* 结束一条预警设置的预警执行记录
* @param warnSettingId
*/
@Override
public
void
endWarnStateBySettingId
(
UUID
warnSettingId
)
{
KObject
warnExeRecord
=
warnSettingDao
.
queryWarnExeRecordBySettingId
(
warnSettingId
);
warnSettingDao
.
endWarnRecordState
(
warnExeRecord
);
}
...
...
@@ -138,7 +136,7 @@ public class WarningServiceImpl implements WarningService{
public
WarnSetting
getWarnSetting
(
UUID
warnSettingId
)
{
return
warnSettingDao
.
getWarnSetting
(
warnSettingId
);
}
@Override
public
WarnSetting
getWarnSetting
(
String
billType
,
UUID
billId
,
String
target
)
{
return
warnSettingDao
.
getWarnSetting
(
billType
,
billId
,
target
);
...
...
@@ -147,7 +145,7 @@ public class WarningServiceImpl implements WarningService{
public
List
<
KObject
>
queryWarnSettings
(
String
billType
,
@Nullable
UUID
billId
,
@Nullable
String
target
){
return
warnSettingDao
.
queryWarnSettings
(
billType
,
billId
,
target
);
}
@Override
public
WarnExeRecord
queryWarnExeRecord
(
UUID
warnSettingId
)
{
return
warnSettingDao
.
queryWarnExeRecord
(
warnSettingId
);
...
...
@@ -171,7 +169,7 @@ public class WarningServiceImpl implements WarningService{
}
@Override
@Override
public
KObject
queryWarnSettingById
(
UUID
id
)
{
KObject
KObj
=
warnSettingDao
.
queryWarnSettingById
(
id
);
return
KObj
;
...
...
@@ -193,7 +191,7 @@ public class WarningServiceImpl implements WarningService{
KObject
warnExeRecord
=
warnSettingDao
.
queryWarnExeRecordBySettingId
(
warnSettingId
);
warnSettingDao
.
endWarnRecordState
(
warnExeRecord
);
}
/**
* 开启或关闭预警设置; 可重复开启或关闭
* @param warnSettingId 预警设置ID
...
...
@@ -251,4 +249,21 @@ public class WarningServiceImpl implements WarningService{
return
new
BaseBusinessWarn
(
warnSettingId
);
}
@Override
public
ArrayList
<
String
>
getExistedWarningSettingPersonnelByBillType
(
UUID
id
)
{
WarnSetting
warnSetting
=
warnSettingDao
.
getWarnSetting
(
id
);
List
<
KObject
>
kObjects
=
warnSettingDao
.
queryWarnSettings
(
warnSetting
.
getBillType
(),
null
,
null
);
HashSet
<
String
>
strings
=
new
HashSet
<>();
kObjects
.
forEach
(
a
->
{
String
[]
personnels
=
Optional
.
ofNullable
(
a
.
getString
(
"personnel"
)).
orElse
(
""
).
split
(
","
);
strings
.
addAll
(
Arrays
.
asList
(
personnels
));
}
);
strings
.
remove
(
""
);
return
new
ArrayList
<>(
strings
);
}
}
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/warn/service/WarningService.java
View file @
8be650b3
package
com
.
xyst
.
dinas
.
biz
.
warn
.
service
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.UUID
;
...
...
@@ -95,4 +96,6 @@ public interface WarningService {
void
ignoreWarnExeRecord
(
UUID
id
);
HashMap
<
String
,
Object
>
warnRecodeGroupInfo
(
List
<
UUID
>
regionalCompanyIds
,
List
<
String
>
targets
);
ArrayList
<
String
>
getExistedWarningSettingPersonnelByBillType
(
UUID
id
);
}
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/web/WarnSettingController.java
View file @
8be650b3
...
...
@@ -64,8 +64,15 @@ public class WarnSettingController {
}
/**
* 获取已经设置的预警通知人员
* @param id
* @return
*/
@GetMapping
(
"/warnsetting/getExistedWarningSettingPersonnel/{id}"
)
public
ResponseObj
getExistedWarningSetting
(
@PathVariable
(
"id"
)
UUID
id
)
{
List
<
String
>
personnel
=
warningService
.
getExistedWarningSettingPersonnelByBillType
(
id
);
return
ResponseObj
.
success
(
"查询成功"
,
personnel
);
}
}
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