Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dc-cost-system
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
bltdc
dc-cost-system
Commits
40a0b238
Commit
40a0b238
authored
Mar 03, 2020
by
yinyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定时自动作废过期财务驳回费用单
parent
db6074d4
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
108 additions
and
0 deletions
+108
-0
CostStatusSyncConfiguration.java
.../other/other_cost/config/CostStatusSyncConfiguration.java
+33
-0
CostDao.java
...e/src/main/java/com/blt/other/other_cost/dao/CostDao.java
+2
-0
CostStatusSyncJob.java
.../java/com/blt/other/other_cost/job/CostStatusSyncJob.java
+61
-0
CostService.java
...in/java/com/blt/other/other_cost/service/CostService.java
+2
-0
CostServiceImpl.java
...om/blt/other/other_cost/service/impl/CostServiceImpl.java
+5
-0
Cost.xml
cost-core/src/main/resources/mapper/Cost.xml
+5
-0
No files found.
cost-core/src/main/java/com/blt/other/other_cost/config/CostStatusSyncConfiguration.java
0 → 100644
View file @
40a0b238
package
com
.
blt
.
other
.
other_cost
.
config
;
import
com.blt.other.other_cost.job.CostStatusSyncJob
;
import
org.quartz.*
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
public
class
CostStatusSyncConfiguration
{
// 扫描主体列表时间间隔:(秒)
private
static
final
int
TIME
=
3
;
// JobDetail 定义要执行的 job
@Bean
public
JobDetail
costCompanySyncJobJobDetail
(){
return
JobBuilder
.
newJob
(
CostStatusSyncJob
.
class
)
.
withIdentity
(
"costStatusSyncJob"
)
.
storeDurably
().
build
();
}
// 触发 Bean 的 Trigger
@Bean
public
Trigger
costCompanySyncJobTrigger
(){
SimpleScheduleBuilder
simpleScheduleBuilder
=
SimpleScheduleBuilder
.
simpleSchedule
()
.
withIntervalInHours
(
TIME
).
repeatForever
();
return
TriggerBuilder
.
newTrigger
().
forJob
(
costCompanySyncJobJobDetail
())
.
withIdentity
(
"costStatusSuncTrigger"
)
.
withSchedule
(
simpleScheduleBuilder
).
build
();
}
}
cost-core/src/main/java/com/blt/other/other_cost/dao/CostDao.java
View file @
40a0b238
...
...
@@ -120,4 +120,6 @@ public interface CostDao {
List
<
CostDomain
>
selectNoPayCost
(
@Param
(
"list"
)
List
<
String
>
costNoList
);
Integer
selectCostStatusByNo
(
@Param
(
"costNo"
)
String
costNo
);
List
<
CostDto
>
getCostByRejectStatus
();
}
cost-core/src/main/java/com/blt/other/other_cost/job/CostStatusSyncJob.java
0 → 100644
View file @
40a0b238
package
com
.
blt
.
other
.
other_cost
.
job
;
import
com.blt.other.other_auth.dao.UserDao
;
import
com.blt.other.other_cost.dao.CostDao
;
import
com.blt.other.other_cost.dao.CostLogDao
;
import
com.blt.other.other_cost.dto.CostDto
;
import
com.blt.other.other_cost.service.CostService
;
import
com.blt.other.other_database.model.CostDomain
;
import
com.blt.other.other_database.model.CostLogDomain
;
import
com.blt.other.other_database.model.UserDomain
;
import
org.quartz.JobExecutionContext
;
import
org.quartz.JobExecutionException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.quartz.QuartzJobBean
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
public
class
CostStatusSyncJob
extends
QuartzJobBean
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
CostCompanySyncJob
.
class
);
@Autowired
private
CostService
costService
;
@Autowired
private
CostLogDao
costLogDao
;
@Autowired
private
CostDao
costDao
;
@Autowired
private
UserDao
userDao
;
@Override
protected
void
executeInternal
(
JobExecutionContext
jobExecutionContext
)
throws
JobExecutionException
{
List
<
CostDto
>
costDtoList
=
costService
.
getCostByRejectStatus
();
for
(
CostDto
costDto
:
costDtoList
)
{
CostDomain
costDomain
=
new
CostDomain
();
costDomain
.
setCostNo
(
costDto
.
getCostNo
());
costDomain
.
setCostStatus
(
5
);
int
result
=
costDao
.
update
(
costDomain
);
if
(
result
>
0
)
{
CostLogDomain
costLog
=
new
CostLogDomain
();
costLog
.
setCostNo
(
costDto
.
getCostNo
());
costLog
.
setUpdateTime
(
new
Date
());
UserDomain
user
=
userDao
.
selectByuserid
(
2493
);
costLog
.
setUpdateUsercode
(
user
.
getUsercode
());
costLog
.
setUpdateUserid
(
2493
);
costLog
.
setUpdateUsername
(
user
.
getUsername
());
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
costLog
.
setUpdateNote
(
sdf
.
format
(
costLog
.
getUpdateTime
())+
" 过期财务驳回单系统自动作废 更新人:"
+
user
.
getUsername
());
costLogDao
.
insert
(
costLog
);
}
}
}
}
cost-core/src/main/java/com/blt/other/other_cost/service/CostService.java
View file @
40a0b238
...
...
@@ -99,4 +99,6 @@ public interface CostService {
List
<
CostDto
>
getLinkLendCost
(
Integer
createuserid
);
Integer
getCostStatusByNo
(
String
costNo
);
List
<
CostDto
>
getCostByRejectStatus
();
}
cost-core/src/main/java/com/blt/other/other_cost/service/impl/CostServiceImpl.java
View file @
40a0b238
...
...
@@ -357,6 +357,11 @@ public class CostServiceImpl implements CostService {
}
@Override
public
List
<
CostDto
>
getCostByRejectStatus
()
{
return
costDao
.
getCostByRejectStatus
();
}
@Override
public
CostDomain
getCostDomainByNo
(
String
costNo
)
{
CostDomain
costDomain
=
costDao
.
selectByCostNo
(
costNo
);
return
costDomain
;
...
...
cost-core/src/main/resources/mapper/Cost.xml
View file @
40a0b238
...
...
@@ -555,4 +555,8 @@
<select
id=
"selectCostStatusByNo"
resultType=
"integer"
>
select cost_status from cost where cost_no=#{costNo}
</select>
<select
id=
"getCostByRejectStatus"
resultType=
"com.blt.other.other_cost.dto.CostDto"
>
select * from cost where cost_status = 3 and reject_type = 1 and reject_time
<![CDATA[<]]>
date_sub(now(),INTERVAL 1 DAY)
</select>
</mapper>
\ No newline at end of file
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