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
4290eeca
Commit
4290eeca
authored
Apr 23, 2021
by
王衍超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
预警功能bug修复;
parent
cdcb7b0e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
WarningServiceImpl.java
...main/java/com/xyst/dinas/biz/warn/WarningServiceImpl.java
+1
-4
ContractExpireWarningCalculator.java
.../dinas/contract/warn/ContractExpireWarningCalculator.java
+11
-5
No files found.
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/warn/WarningServiceImpl.java
View file @
4290eeca
...
...
@@ -82,7 +82,6 @@ public class WarningServiceImpl implements WarningService{
Boolean
isOpen
=
warnSetting
.
isOpen
();
if
(
isOpen
!=
null
)
warSettingIdObj
.
set
(
WarnSettingConstant
.
isOpen
,
isOpen
);
warnSettingDao
.
update
(
warSettingIdObj
);
//修改后触发预警
BaseBusinessWarn
baseBusinessWarn
=
new
BaseBusinessWarn
(
warSettingId
);
baseBusinessWarn
.
warn
();
...
...
@@ -111,9 +110,7 @@ public class WarningServiceImpl implements WarningService{
@Override
public
void
updateWarnExe
(
WarnExeRecord
warnExeRecord
)
{
KClass
type
=
Amino
.
getApplicationMetadataContext
().
getBean
(
WarnSettingConstant
.
ENTITY_WARNINGEXE
,
KClass
.
class
);
JsonNode
json
=
JSONObjectUtils
.
toJson
(
warnExeRecord
);
KObject
object
=
JSONObjectUtils
.
toObject
(
json
,
type
);
KObject
object
=
warnSettingDao
.
queryWarningExeById
(
warnExeRecord
.
getId
());
object
.
set
(
"recentlyTime"
,
warnExeRecord
.
getRecentlyTime
());
object
.
set
(
"endTime"
,
warnExeRecord
.
getEndTime
());
object
.
set
(
"warnState"
,
warnExeRecord
.
getWarnState
());
...
...
backend/xyst.dinas.contract/src/main/java/com/xyst/dinas/contract/warn/ContractExpireWarningCalculator.java
View file @
4290eeca
...
...
@@ -26,21 +26,27 @@ public class ContractExpireWarningCalculator implements IWarningCalculator{
@Autowired
private
ContractService
contractService
;
private
final
int
millisOfDay
=
1000
*
3600
*
24
;
@Override
public
boolean
isWarning
(
WarnSetting
warnSetting
)
{
String
min
=
warnSetting
.
getMin
();
String
target
=
warnSetting
.
getTarget
();
if
(
min
==
null
||
min
.
trim
().
length
()==
0
)
return
false
;
KObject
contract
=
contractService
.
queryContract
(
warnSetting
.
getBillId
());
Date
endDate
=
contract
.
getDate
(
ContractConstant
.
endDate
);
Date
now
=
new
Date
();
int
diff
=
now
.
compareTo
(
endDate
);
if
(
diff
>
Integer
.
valueOf
(
min
))
{
String
contractCode
=
contract
.
getString
(
ContractConstant
.
CONTRACT_CODE
);
int
diff
=
(
int
)
((
endDate
.
getTime
()
-
now
.
getTime
())
/
millisOfDay
);
// warnMessage = "编号["+contractCode+"]"+"的合同"+target+"为"+advanceBalance+",已不足"+min+"!";
if
(
diff
<
Integer
.
valueOf
(
min
))
{
int
value
=
diff
-
Integer
.
valueOf
(
min
);
String
contractCode
=
contract
.
getString
(
ContractConstant
.
CONTRACT_CODE
);
if
(
value
>=
0
)
{
warnMessage
=
"编号["
+
contractCode
+
"]"
+
"的合同还有"
+
value
+
"天到期!"
;
}
else
{
warnMessage
=
"编号["
+
contractCode
+
"]"
+
"的合同已经过期"
+
Math
.
abs
(
value
)+
"天!"
;
}
return
true
;
}
return
false
;
...
...
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