Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sunac_report
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
java-sunac-report
sunac_report
Commits
f9adb6ba
Commit
f9adb6ba
authored
Aug 27, 2019
by
sunxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定时任务 oracle数据库版修改
parent
b33ba283
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
7 deletions
+27
-7
ReportDao.java
src/main/java/com/ejweb/modules/report/dao/ReportDao.java
+1
-1
ReportEntity.java
src/main/java/com/ejweb/modules/report/entity/ReportEntity.java
+9
-0
TimedTask.java
src/main/java/com/ejweb/modules/report/utils/TimedTask.java
+8
-4
ReportDao.xml
src/main/resources/mappings/modules/report/ReportDao.xml
+9
-2
No files found.
src/main/java/com/ejweb/modules/report/dao/ReportDao.java
View file @
f9adb6ba
...
...
@@ -272,5 +272,5 @@ public interface ReportDao extends CrudDao<ReportEntity> {
* @param entity
* @return
*/
void
updateReportByClueTime
(
ReportEntity
entity
);
int
updateReportByClueTime
(
ReportEntity
entity
);
}
src/main/java/com/ejweb/modules/report/entity/ReportEntity.java
View file @
f9adb6ba
...
...
@@ -80,6 +80,15 @@ public class ReportEntity extends DataEntity<ReportEntity> {
private
CtBbtcRegion
supplementAreaNew
;
//被举报区域
private
CtBbtcBusType
supplementTypeNew
;
//业务类型
private
Date
transTime
;
//转为线索的时间
private
String
cuurentTime
;
//转为线索的时间
public
String
getCuurentTime
()
{
return
cuurentTime
;
}
public
void
setCuurentTime
(
String
cuurentTime
)
{
this
.
cuurentTime
=
cuurentTime
;
}
private
List
regionList
;
//区域列表
...
...
src/main/java/com/ejweb/modules/report/utils/TimedTask.java
View file @
f9adb6ba
...
...
@@ -7,6 +7,7 @@ import org.springframework.context.annotation.Lazy;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
/**
...
...
@@ -19,18 +20,21 @@ public class TimedTask {
@Autowired
private
ReportDao
reportDao
;
@Scheduled
(
cron
=
"0
0 12
* * ?"
)
//cron表达式 每天中午12执行
@Scheduled
(
cron
=
"0
23 15
* * ?"
)
//cron表达式 每天中午12执行
public
void
job1
()
{
//获取所有转为线索的举报信息
ReportEntity
reportEntity
=
new
ReportEntity
();
Calendar
c
=
Calendar
.
getInstance
();
c
.
add
(
Calendar
.
MONTH
,
-
3
);
// 当前日期减三个月 生产环境
/* c.add(Calendar.MINUTE, -25); // 当前日期减去25分钟 测试环境 */
reportEntity
.
setTransTime
(
c
.
getTime
());
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
String
formatDate
=
df
.
format
(
c
.
getTime
());
reportEntity
.
setCuurentTime
(
formatDate
);
try
{
/*跟据三个月前的过期时间查询并修改当天过期的举报信息*/
reportDao
.
updateReportByClueTime
(
reportEntity
);
System
.
out
.
println
(
"线索状态改变成功+
1"
);
int
i
=
reportDao
.
updateReportByClueTime
(
reportEntity
);
System
.
out
.
println
(
"线索状态改变成功+
"
+
i
);
}
catch
(
Exception
e
){
System
.
out
.
println
(
"线索状态改变异常"
);
}
...
...
src/main/resources/mappings/modules/report/ReportDao.xml
View file @
f9adb6ba
...
...
@@ -1143,11 +1143,17 @@
where del_flag = 0
</select>
<update
id=
"updateReportByClueTime"
parameterType=
"
ReportEntity"
>
<update
id=
"updateReportByClueTime"
parameterType=
"
com.ejweb.modules.report.entity.ReportEntity"
>
UPDATE ct_bbtc_report SET
report_status= '3',
deal_result='2'
WHERE where day(transTime) = day(#{transTime}) /* 比较日期数相同就行 */
where
report_status != '3' and
deal_result !='2'
<if
test=
"dbName == 'oracle'"
>
and TRANSTIME >= to_date(#{cuurentTime}, 'yyyy-MM-dd') AND TRANSTIME
<
= to_date( #{cuurentTime}|| ' 23:59:59', 'yyyy-MM-dd
hh24:mi:ss')
</if>
<if
test=
"dbName == 'mysql'"
>
and DATE(TRANSTIME) >= #{cuurentTime} AND DATE(TRANSTIME)
<
= #{cuurentTime}
</if>
</update>
</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