Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
063c97f5
Commit
063c97f5
authored
Jul 29, 2019
by
Mccoy Z Xia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trigger 触发相关功能
parent
14c2058e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
122 additions
and
2 deletions
+122
-2
CalendarEnum.java
...in/java/pwc/taxtech/atms/constant/enums/CalendarEnum.java
+5
-0
CalendarActionServiceImpl.java
.../taxtech/atms/service/impl/CalendarActionServiceImpl.java
+46
-2
CalendarActionByAreaDto.java
...wc/taxtech/atms/calendar/dto/CalendarActionByAreaDto.java
+71
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/constant/enums/CalendarEnum.java
View file @
063c97f5
...
...
@@ -2,6 +2,11 @@ package pwc.taxtech.atms.constant.enums;
public
enum
CalendarEnum
{
TRIGGER_UNIT_CALENDAR_DAY
(
"CalendarDay"
,
"1"
,
""
),
TRIGGER_UNIT_WEEK_DAY
(
"WeekDay"
,
"2"
,
""
),
TRIGGER_UNIT_MONTH
(
"Month"
,
"3"
,
""
),
TRIGGER_UNIT_YEAR
(
"Year"
,
"4"
,
""
),
CALENDAR_EVENT_COMPLETED
(
"已完成"
,
"1"
,
""
),
CALENDAR_EVENT_NOT_COMPLETED
(
"未完成"
,
"0"
,
""
),
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/CalendarActionServiceImpl.java
View file @
063c97f5
package
pwc
.
taxtech
.
atms
.
service
.
impl
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
pwc.taxtech.atms.calendar.dao.CalendarActionJurisdictionRelationshipMapper
;
import
pwc.taxtech.atms.calendar.dao.CalendarActionMapper
;
import
pwc.taxtech.atms.calendar.dao.CalendarJurisdictionMapper
;
import
pwc.taxtech.atms.calendar.dao.ext.CalendarActionTMapper
;
import
pwc.taxtech.atms.calendar.dao.ext.CalendarExtMapper
;
import
pwc.taxtech.atms.calendar.dao.ext.CalendarJurisdictionTMapper
;
import
pwc.taxtech.atms.calendar.dto.CalendarActionByAreaDto
;
import
pwc.taxtech.atms.calendar.dto.CalendarActionDto
;
import
pwc.taxtech.atms.calendar.dto.CalendarJurisdictionDto
;
import
pwc.taxtech.atms.calendar.entity.*
;
import
pwc.taxtech.atms.constant.enums.CalendarEnum
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.service.ICalendarActionService
;
...
...
@@ -22,6 +24,7 @@ import java.util.ArrayList;
import
java.util.Date
;
import
java.util.List
;
/**
* <p> @Description </p>
*
...
...
@@ -60,7 +63,7 @@ public class CalendarActionServiceImpl extends BaseService implements ICalendarA
if
(
dto
.
getId
()
==
null
)
{
result
=
insertAction
(
dto
);
}
else
{
result
=
updateAction
(
dto
);
result
=
updateAction
(
dto
);
}
return
new
OperationResultDto
(
result
);
...
...
@@ -163,4 +166,45 @@ public class CalendarActionServiceImpl extends BaseService implements ICalendarA
return
OperationResultDto
.
success
(
actionDtoList
);
}
public
boolean
addTriggerEvent
(
Long
entityId
,
Long
triggerId
,
Integer
areaId
)
{
//获取对应trigger和area的action list
List
<
CalendarActionByAreaDto
>
actionList
=
getActionListByTriggerAndArea
(
triggerId
,
areaId
);
//查询是否有对应actionId的未完成状态的event
//存在 update
//不存在 insert
//计算dueDate时间
//update/insert
Date
effectiveDate
=
new
Date
();
Integer
logicNum
=
null
,
logicUnitId
=
null
;
Date
dueDate
=
calculateDueDate
(
effectiveDate
,
logicNum
,
logicUnitId
);
return
true
;
}
private
Date
calculateDueDate
(
Date
effectiveDate
,
Integer
logicNum
,
Integer
logicUnitId
)
{
if
(
Integer
.
parseInt
(
CalendarEnum
.
TRIGGER_UNIT_CALENDAR_DAY
.
getCode
())
==
logicUnitId
)
{
return
DateUtils
.
addDays
(
effectiveDate
,
logicNum
);
}
else
if
(
Integer
.
parseInt
(
CalendarEnum
.
TRIGGER_UNIT_WEEK_DAY
.
getCode
())
==
logicUnitId
){
return
DateUtils
.
addWeeks
(
effectiveDate
,
logicNum
);
}
else
if
(
Integer
.
parseInt
(
CalendarEnum
.
TRIGGER_UNIT_MONTH
.
getCode
())
==
logicUnitId
){
return
DateUtils
.
addMonths
(
effectiveDate
,
logicNum
);
}
else
if
(
Integer
.
parseInt
(
CalendarEnum
.
TRIGGER_UNIT_YEAR
.
getCode
())
==
logicUnitId
){
return
DateUtils
.
addYears
(
effectiveDate
,
logicNum
);
}
return
null
;
}
private
List
<
CalendarActionByAreaDto
>
getActionListByTriggerAndArea
(
Long
triggerId
,
Integer
areaId
)
{
return
null
;
}
}
atms-dao/src/main/java/pwc/taxtech/atms/calendar/dto/CalendarActionByAreaDto.java
0 → 100644
View file @
063c97f5
package
pwc
.
taxtech
.
atms
.
calendar
.
dto
;
/**
* <p> @Description </p>
*
* @Author: Mccoy Z Xia (Xia zhixin)
* @Date: 2019-07-29 18:08
* @Version: 1.0
**/
public
class
CalendarActionByAreaDto
{
private
Long
actionId
;
private
String
actionName
;
private
Long
taskTypeId
;
private
String
description
;
private
Integer
logicNum
;
private
Integer
logicUnitId
;
public
Long
getActionId
()
{
return
actionId
;
}
public
void
setActionId
(
Long
actionId
)
{
this
.
actionId
=
actionId
;
}
public
String
getActionName
()
{
return
actionName
;
}
public
void
setActionName
(
String
actionName
)
{
this
.
actionName
=
actionName
;
}
public
Long
getTaskTypeId
()
{
return
taskTypeId
;
}
public
void
setTaskTypeId
(
Long
taskTypeId
)
{
this
.
taskTypeId
=
taskTypeId
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
Integer
getLogicNum
()
{
return
logicNum
;
}
public
void
setLogicNum
(
Integer
logicNum
)
{
this
.
logicNum
=
logicNum
;
}
public
Integer
getLogicUnitId
()
{
return
logicUnitId
;
}
public
void
setLogicUnitId
(
Integer
logicUnitId
)
{
this
.
logicUnitId
=
logicUnitId
;
}
}
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