Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
d3b83848
Commit
d3b83848
authored
Sep 02, 2023
by
陶湘宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
配置文件控制定时器运行
parent
4b121214
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
273 additions
and
231 deletions
+273
-231
src/main/java/cn/timer/api/Application.java
+1
-1
src/main/java/cn/timer/api/config/schedule/SchedulerCondition.java
+14
-0
src/main/java/cn/timer/api/controller/htzz/atttimer/NewsTaskTiming.java
+8
-2
src/main/java/cn/timer/api/controller/insure/task/InsureTaskTiming.java
+5
-2
src/main/java/cn/timer/api/controller/kqgl/ClockInController.java
+214
-210
src/main/java/cn/timer/api/controller/kqgl/atttimer/AttendanceTaskTiming.java
+5
-2
src/main/java/cn/timer/api/controller/kqgl/atttimer/LastMonthtimingExport.java
+10
-5
src/main/java/cn/timer/api/controller/xcgl/atttimer/SalaryTaskTiming.java
+8
-3
src/main/resources/application-pro.yml
+3
-3
src/main/resources/application.yml
+3
-1
src/main/resources/config/cron.setting
+1
-1
src/main/resources/logback-spring.xml
+1
-1
No files found.
src/main/java/cn/timer/api/Application.java
View file @
d3b83848
...
@@ -21,7 +21,7 @@ import cn.hutool.core.net.NetUtil;
...
@@ -21,7 +21,7 @@ import cn.hutool.core.net.NetUtil;
@MapperScan
({
"cn.timer.api.dao"
})
// 扫描的mapper
@MapperScan
({
"cn.timer.api.dao"
})
// 扫描的mapper
@ComponentScan
(
basePackages
=
{
"cn.timer.api"
})
@ComponentScan
(
basePackages
=
{
"cn.timer.api"
})
@SpringBootApplication
@SpringBootApplication
@EnableScheduling
//
@EnableScheduling
@EnableTransactionManagement
@EnableTransactionManagement
public
class
Application
{
public
class
Application
{
...
...
src/main/java/cn/timer/api/config/schedule/SchedulerCondition.java
0 → 100644
View file @
d3b83848
package
cn
.
timer
.
api
.
config
.
schedule
;
import
org.springframework.context.annotation.Condition
;
import
org.springframework.context.annotation.ConditionContext
;
import
org.springframework.core.type.AnnotatedTypeMetadata
;
public
class
SchedulerCondition
implements
Condition
{
@Override
public
boolean
matches
(
ConditionContext
context
,
AnnotatedTypeMetadata
metadata
)
{
System
.
out
.
println
(
"是否启动定时器"
+
context
.
getEnvironment
().
getProperty
(
"enable.scheduling"
));
return
Boolean
.
valueOf
(
context
.
getEnvironment
().
getProperty
(
"enable.scheduling"
));
}
}
\ No newline at end of file
src/main/java/cn/timer/api/controller/htzz/atttimer/NewsTaskTiming.java
View file @
d3b83848
...
@@ -5,7 +5,10 @@ import java.text.SimpleDateFormat;
...
@@ -5,7 +5,10 @@ import java.text.SimpleDateFormat;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
cn.timer.api.config.schedule.SchedulerCondition
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Conditional
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
...
@@ -21,15 +24,18 @@ import cn.timer.api.controller.kqgl.ClockInTool;
...
@@ -21,15 +24,18 @@ import cn.timer.api.controller.kqgl.ClockInTool;
* 消息定时器
* 消息定时器
*
*
*/
*/
@Slf4j
@Configuration
// 1.主要用于标记配置类,兼备Component的效果。
@Configuration
// 1.主要用于标记配置类,兼备Component的效果。
@EnableScheduling
// 2.开启定时任务
//
@EnableScheduling // 2.开启定时任务
public
class
NewsTaskTiming
{
public
class
NewsTaskTiming
{
@Autowired
@Autowired
private
AlicloudSMS
sms
;
private
AlicloudSMS
sms
;
@Conditional
(
SchedulerCondition
.
class
)
//定时器开关
@Scheduled
(
cron
=
"0 0 8 * * ?"
)
//早上八点
@Scheduled
(
cron
=
"0 0 8 * * ?"
)
//早上八点
public
void
MessageAlert
()
throws
ParseException
{
public
void
MessageAlert
()
throws
ParseException
{
log
.
info
(
"消息定时器启动"
);
//当前时间
//当前时间
String
nowdate
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
new
Date
()).
toString
();
//
String
nowdate
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
new
Date
()).
toString
();
//
...
...
src/main/java/cn/timer/api/controller/insure/task/InsureTaskTiming.java
View file @
d3b83848
...
@@ -6,6 +6,7 @@ import cn.timer.api.bean.insure.InsurePolicy;
...
@@ -6,6 +6,7 @@ import cn.timer.api.bean.insure.InsurePolicy;
import
cn.timer.api.bean.insure.InsureUser
;
import
cn.timer.api.bean.insure.InsureUser
;
import
cn.timer.api.bean.yggl.YgglMainEmp
;
import
cn.timer.api.bean.yggl.YgglMainEmp
;
import
cn.timer.api.config.exception.CustomException
;
import
cn.timer.api.config.exception.CustomException
;
import
cn.timer.api.config.schedule.SchedulerCondition
;
import
cn.timer.api.dao.insure.InsurePolicyMapper
;
import
cn.timer.api.dao.insure.InsurePolicyMapper
;
import
cn.timer.api.dao.insure.InsureUserMapper
;
import
cn.timer.api.dao.insure.InsureUserMapper
;
import
cn.timer.api.dao.yggl.YgglMainEmpMapper
;
import
cn.timer.api.dao.yggl.YgglMainEmpMapper
;
...
@@ -13,6 +14,7 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -13,6 +14,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Conditional
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
...
@@ -29,7 +31,7 @@ import java.util.stream.Collectors;
...
@@ -29,7 +31,7 @@ import java.util.stream.Collectors;
* @Date 2022/5/5 11:20
* @Date 2022/5/5 11:20
*/
*/
@Configuration
//1.主要用于标记配置类,兼备Component的效果。
@Configuration
//1.主要用于标记配置类,兼备Component的效果。
@EnableScheduling
// 2.开启定时任务
//
@EnableScheduling // 2.开启定时任务
@Slf4j
@Slf4j
public
class
InsureTaskTiming
{
public
class
InsureTaskTiming
{
@Autowired
@Autowired
...
@@ -37,11 +39,12 @@ public class InsureTaskTiming {
...
@@ -37,11 +39,12 @@ public class InsureTaskTiming {
@Autowired
@Autowired
private
YgglMainEmpMapper
ygglMainEmpMapper
;
private
YgglMainEmpMapper
ygglMainEmpMapper
;
@Conditional
(
SchedulerCondition
.
class
)
//定时器开关
@Scheduled
(
cron
=
"0/1 0 0 * * ?"
)
//每月第一天
@Scheduled
(
cron
=
"0/1 0 0 * * ?"
)
//每月第一天
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateInsureStatusTask
(){
public
void
updateInsureStatusTask
(){
try
{
try
{
log
.
info
(
"保单定时器"
);
Date
now
=
DateUtil
.
date
();
Date
now
=
DateUtil
.
date
();
/*获取正常的保单*/
/*获取正常的保单*/
List
<
InsurePolicy
>
insurePolicyList
=
InsurePolicy
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
InsurePolicy
>().
lambda
().
eq
(
InsurePolicy:
:
getStatus
,
"1"
).
lt
(
InsurePolicy:
:
getPolicyDateEnd
,
now
));
List
<
InsurePolicy
>
insurePolicyList
=
InsurePolicy
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
InsurePolicy
>().
lambda
().
eq
(
InsurePolicy:
:
getStatus
,
"1"
).
lt
(
InsurePolicy:
:
getPolicyDateEnd
,
now
));
...
...
src/main/java/cn/timer/api/controller/kqgl/ClockInController.java
View file @
d3b83848
...
@@ -95,8 +95,19 @@ public class ClockInController {
...
@@ -95,8 +95,19 @@ public class ClockInController {
private
KqglAssoBcszMapper
kqglassobcszmapper
;
private
KqglAssoBcszMapper
kqglassobcszmapper
;
@Autowired
@Autowired
private
KqglAssoRelationSummaryMapper
kqglassorelationsummarymapper
;
private
KqglAssoRelationSummaryMapper
kqglassorelationsummarymapper
;
//考勤组绑定的打卡方式
@Autowired
private
AttGroupBinPunchModeMapper
attgroupbinpunchmodemapper
;
//考勤机
@Autowired
private
AttendanceMachineMapper
attendancemachinemapper
;
//考勤地址
@Autowired
private
PunchCardAddressMapper
punchcardaddressmapper
;
//考勤WIFI
@Autowired
private
PunchCardWiFiMapper
punchcardwifimapper
;
SimpleDateFormat
sdf1
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
sdf1
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
sdf2
=
new
SimpleDateFormat
(
"EEE"
);
SimpleDateFormat
sdf2
=
new
SimpleDateFormat
(
"EEE"
);
SimpleDateFormat
df1
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
df1
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
...
@@ -2881,18 +2892,7 @@ public class ClockInController {
...
@@ -2881,18 +2892,7 @@ public class ClockInController {
//***************************************************&**&******&***&****&***&**************************************************//
//***************************************************&**&******&***&****&***&**************************************************//
//**************************************************&&&&&&*****&&&******&&&****************************************************//
//**************************************************&&&&&&*****&&&******&&&****************************************************//
//*************************************************&******&****&********&******************************************************//
//*************************************************&******&****&********&******************************************************//
//考勤组绑定的打卡方式
@Autowired
private
AttGroupBinPunchModeMapper
attgroupbinpunchmodemapper
;
//考勤机
@Autowired
private
AttendanceMachineMapper
attendancemachinemapper
;
//考勤地址
@Autowired
private
PunchCardAddressMapper
punchcardaddressmapper
;
//考勤WIFI
@Autowired
private
PunchCardWiFiMapper
punchcardwifimapper
;
/**
/**
* 获取考勤打卡数据------APP打卡
* 获取考勤打卡数据------APP打卡
* @throws ParseException
* @throws ParseException
...
@@ -2900,10 +2900,10 @@ public class ClockInController {
...
@@ -2900,10 +2900,10 @@ public class ClockInController {
@PostMapping
(
value
=
"/ClockData"
)
@PostMapping
(
value
=
"/ClockData"
)
@ApiOperation
(
value
=
"获取考勤打卡数据------APP打卡"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperation
(
value
=
"获取考勤打卡数据------APP打卡"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
3
)
@ApiOperationSupport
(
order
=
3
)
public
Result
<
Object
>
getAttClockData
(
@CurrentUser
UserBean
userBean
,
@RequestBody
AttConditions
attconditions
)
throws
ParseException
{
public
Result
<
Object
>
getAttClockData
(
@CurrentUser
UserBean
userBean
,
@RequestBody
AttConditions
attconditions
)
{
try
{
long
nowdate
=
new
Date
().
getTime
();
long
nowdate
=
new
Date
().
getTime
();
String
str
=
null
;
String
str
=
null
;
if
(!(
""
).
equals
(
attconditions
.
getDate
())){
if
(!(
""
).
equals
(
attconditions
.
getDate
())){
str
=
attconditions
.
getDate
();
str
=
attconditions
.
getDate
();
...
@@ -2912,24 +2912,24 @@ public class ClockInController {
...
@@ -2912,24 +2912,24 @@ public class ClockInController {
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
str
=
sdf
.
format
(
d
);
str
=
sdf
.
format
(
d
);
}
}
//前一天时间
//前一天时间
String
yesterday
=
ClockInTool
.
requires_extra_times
(
str
,-
1
,
3
,
1
);
//前一天
String
yesterday
=
ClockInTool
.
requires_extra_times
(
str
,-
1
,
3
,
1
);
//前一天
Long
startDateyesterday
=
DateUtil
.
getStartTime
(
0
,
DateUtil
.
getStringTime
(
yesterday
,
"yyyy-MM-dd"
)).
getTime
();
Long
startDateyesterday
=
DateUtil
.
getStartTime
(
0
,
DateUtil
.
getStringTime
(
yesterday
,
"yyyy-MM-dd"
)).
getTime
();
Long
endDateyesterday
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
yesterday
,
"yyyy-MM-dd"
)).
getTime
();
Long
endDateyesterday
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
yesterday
,
"yyyy-MM-dd"
)).
getTime
();
Long
startDate
=
DateUtil
.
getStartTime
(
0
,
DateUtil
.
getStringTime
(
str
,
"yyyy-MM-dd"
)).
getTime
();
Long
startDate
=
DateUtil
.
getStartTime
(
0
,
DateUtil
.
getStringTime
(
str
,
"yyyy-MM-dd"
)).
getTime
();
Long
endDate
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
str
,
"yyyy-MM-dd"
)).
getTime
();
Long
endDate
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
str
,
"yyyy-MM-dd"
)).
getTime
();
String
stampToDate
=
ClockInTool
.
stampToDate
(
String
.
valueOf
(
endDate
));
//当天打卡的最后时间
String
stampToDate
=
ClockInTool
.
stampToDate
(
String
.
valueOf
(
endDate
));
//当天打卡的最后时间
Timestamp
d
=
Timestamp
.
valueOf
(
stampToDate
);
Timestamp
d
=
Timestamp
.
valueOf
(
stampToDate
);
Timestamp
b
=
Timestamp
.
valueOf
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
new
Date
()));
//当前时间
Timestamp
b
=
Timestamp
.
valueOf
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
new
Date
()));
//当前时间
String
now
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
new
Date
());
String
now
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
new
Date
());
KqglMainKqz
attgro
=
kqglmainkqzmapper
.
getAttendanceGroupInformationByUserid
(
userBean
.
getEmpNum
(),
userBean
.
getOrgCode
());
//考勤组信息
KqglMainKqz
attgro
=
kqglmainkqzmapper
.
getAttendanceGroupInformationByUserid
(
userBean
.
getEmpNum
(),
userBean
.
getOrgCode
());
//考勤组信息
if
(
attgro
!=
null
)
{
if
(
attgro
!=
null
)
{
//APP获取当前天的考勤信息
//APP获取当前天的考勤信息
AttendanceCardListDto
attdate
=
MethodCall
(
userBean
.
getOrgCode
(),
userBean
.
getEmpNum
(),
attconditions
.
getDate
());
AttendanceCardListDto
attdate
=
MethodCall
(
userBean
.
getOrgCode
(),
userBean
.
getEmpNum
(),
attconditions
.
getDate
());
...
@@ -2938,21 +2938,21 @@ public class ClockInController {
...
@@ -2938,21 +2938,21 @@ public class ClockInController {
// attdate.setAttpr(dajllist);
// attdate.setAttpr(dajllist);
int
dkcs
=
0
;
int
dkcs
=
0
;
int
isxbdk
=
0
;
int
isxbdk
=
0
;
String
yymmdd
=
str
.
substring
(
2
,
10
);
String
yymmdd
=
str
.
substring
(
2
,
10
);
String
nowattdate
=
yymmdd
+
" "
+
ClockInTool
.
dateToWeek2
(
str
);
String
nowattdate
=
yymmdd
+
" "
+
ClockInTool
.
dateToWeek2
(
str
);
//查询当天考勤记录
//查询当天考勤记录
List
<
KqglAssoDkjl
>
dajllist_
=
kqglassodkjlmapper
.
getDetailedRecordClock
(
startDate
,
endDate
,
userBean
.
getEmpNum
(),
nowattdate
,
userBean
.
getOrgCode
());
List
<
KqglAssoDkjl
>
dajllist_
=
kqglassodkjlmapper
.
getDetailedRecordClock
(
startDate
,
endDate
,
userBean
.
getEmpNum
(),
nowattdate
,
userBean
.
getOrgCode
());
if
(
dajllist_
.
size
()
>
0
)
{
if
(
dajllist_
.
size
()
>
0
)
{
dkcs
=
dajllist_
.
size
();
dkcs
=
dajllist_
.
size
();
isxbdk
=
dajllist_
.
get
(
dajllist_
.
size
()-
1
).
getSort
();
isxbdk
=
dajllist_
.
get
(
dajllist_
.
size
()-
1
).
getSort
();
}
}
if
(
attdate
.
getAttgrouptype
()
!=
3
)
{
if
(
attdate
.
getAttgrouptype
()
!=
3
)
{
List
<
AttSchedule
>
attsch
=
attdate
.
getAttsch
();
List
<
AttSchedule
>
attsch
=
attdate
.
getAttsch
();
if
(
EmptyUtil
.
isNotEmpty
(
attdate
.
getAttsch
())
&&
attsch
.
get
(
0
).
getId
()
!=
0
)
{
//班次不为空
if
(
EmptyUtil
.
isNotEmpty
(
attdate
.
getAttsch
())
&&
attsch
.
get
(
0
).
getId
()
!=
0
)
{
//班次不为空
int
bc
=
0
;
int
bc
=
0
;
int
bsz
=
0
;
int
bsz
=
0
;
...
@@ -2964,42 +2964,42 @@ public class ClockInController {
...
@@ -2964,42 +2964,42 @@ public class ClockInController {
int
sb1
=
0
,
xb1
=
0
,
sb2
=
0
,
xb2
=
0
,
sb3
=
0
,
xb3
=
0
;
int
sb1
=
0
,
xb1
=
0
,
sb2
=
0
,
xb2
=
0
,
sb3
=
0
,
xb3
=
0
;
//先判断前一天是否存在次日打卡的方式
//先判断前一天是否存在次日打卡的方式
KqglAssoBcsz
jianchashif
=
KqglAssoBcsz
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoBcsz
>().
lambda
().
eq
(
KqglAssoBcsz:
:
getId
,
attsch
.
get
(
0
).
getId
()));
KqglAssoBcsz
jianchashif
=
KqglAssoBcsz
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoBcsz
>().
lambda
().
eq
(
KqglAssoBcsz:
:
getId
,
attsch
.
get
(
0
).
getId
()));
if
(
jianchashif
.
getIsSbdk1Cr
()
==
1
)
{
if
(
jianchashif
.
getIsSbdk1Cr
()
==
1
)
{
sb1
=
1
;
sb1
=
1
;
crlasttime
=
(
str
+
" "
+
jianchashif
.
getSbdk1
()+
":00"
).
replaceAll
(
"\r|\n"
,
""
);}
crlasttime
=
(
str
+
" "
+
jianchashif
.
getSbdk1
()+
":00"
).
replaceAll
(
"\r|\n"
,
""
);}
if
(
jianchashif
.
getIsXbdk1Cr
()
==
1
)
{
if
(
jianchashif
.
getIsXbdk1Cr
()
==
1
)
{
xb1
=
1
;
xb1
=
1
;
crlasttime
=
(
str
+
" "
+
jianchashif
.
getXbdk1
()+
":00"
).
replaceAll
(
"\r|\n"
,
""
);}
crlasttime
=
(
str
+
" "
+
jianchashif
.
getXbdk1
()+
":00"
).
replaceAll
(
"\r|\n"
,
""
);}
if
(
jianchashif
.
getIsSbdk2Cr
()
==
1
)
{
if
(
jianchashif
.
getIsSbdk2Cr
()
==
1
)
{
sb2
=
1
;
sb2
=
1
;
crlasttime
=
(
str
+
" "
+
jianchashif
.
getSbdk2
()+
":00"
).
replaceAll
(
"\r|\n"
,
""
);}
crlasttime
=
(
str
+
" "
+
jianchashif
.
getSbdk2
()+
":00"
).
replaceAll
(
"\r|\n"
,
""
);}
if
(
jianchashif
.
getIsXbdk2Cr
()
==
1
)
{
if
(
jianchashif
.
getIsXbdk2Cr
()
==
1
)
{
xb2
=
1
;
xb2
=
1
;
crlasttime
=
(
str
+
" "
+
jianchashif
.
getXbdk2
()+
":00"
).
replaceAll
(
"\r|\n"
,
""
);}
crlasttime
=
(
str
+
" "
+
jianchashif
.
getXbdk2
()+
":00"
).
replaceAll
(
"\r|\n"
,
""
);}
if
(
jianchashif
.
getIsSbdk3Cr
()
==
1
)
{
if
(
jianchashif
.
getIsSbdk3Cr
()
==
1
)
{
sb3
=
1
;
sb3
=
1
;
crlasttime
=
(
str
+
" "
+
jianchashif
.
getSbdk3
()+
":00"
).
replaceAll
(
"\r|\n"
,
""
);}
crlasttime
=
(
str
+
" "
+
jianchashif
.
getSbdk3
()+
":00"
).
replaceAll
(
"\r|\n"
,
""
);}
if
(
jianchashif
.
getIsXbdk3Cr
()
==
1
)
{
if
(
jianchashif
.
getIsXbdk3Cr
()
==
1
)
{
xb3
=
1
;
xb3
=
1
;
crlasttime
=
(
str
+
" "
+
jianchashif
.
getXbdk3
()+
":00"
).
replaceAll
(
"\r|\n"
,
""
);}
crlasttime
=
(
str
+
" "
+
jianchashif
.
getXbdk3
()+
":00"
).
replaceAll
(
"\r|\n"
,
""
);}
//
//
if
(
sb1
==
1
||
xb1
==
1
||
sb2
==
1
||
xb2
==
1
||
sb3
==
1
||
xb3
==
1
)
{
if
(
sb1
==
1
||
xb1
==
1
||
sb2
==
1
||
xb2
==
1
||
sb3
==
1
||
xb3
==
1
)
{
//前一天的班次
//前一天的班次
AttendanceCardListDto
beforeattdate
=
MethodCall
(
userBean
.
getOrgCode
(),
userBean
.
getEmpNum
(),
yesterday
);
AttendanceCardListDto
beforeattdate
=
MethodCall
(
userBean
.
getOrgCode
(),
userBean
.
getEmpNum
(),
yesterday
);
//前一天的打卡数据
//前一天的打卡数据
// String yesterday = ClockInTool.requires_extra_times(now,-1,3,1);//前一天
// String yesterday = ClockInTool.requires_extra_times(now,-1,3,1);//前一天
// Long startDateyesterday = DateUtil.getStartTime(0,DateUtil.getStringTime(yesterday,"yyyy-MM-dd")).getTime();
// Long startDateyesterday = DateUtil.getStartTime(0,DateUtil.getStringTime(yesterday,"yyyy-MM-dd")).getTime();
String
attdate_
=
new
SimpleDateFormat
(
"yy-MM-dd"
).
format
(
Double
.
valueOf
(
startDateyesterday
));
//转换打卡时间格式
String
attdate_
=
new
SimpleDateFormat
(
"yy-MM-dd"
).
format
(
Double
.
valueOf
(
startDateyesterday
));
//转换打卡时间格式
String
yeboattdate
=
attdate_
+
" "
+
ClockInTool
.
dateToWeek2
(
yesterday
);
String
yeboattdate
=
attdate_
+
" "
+
ClockInTool
.
dateToWeek2
(
yesterday
);
//次日查询昨日考勤时 时间范围扩大到 昨日开始到今日结束
//次日查询昨日考勤时 时间范围扩大到 昨日开始到今日结束
List
<
KqglAssoDkjl
>
dajllistbefo
=
kqglassodkjlmapper
.
getDetailedRecordClock
(
startDateyesterday
,
endDate
,
userBean
.
getEmpNum
(),
yeboattdate
,
userBean
.
getOrgCode
());
List
<
KqglAssoDkjl
>
dajllistbefo
=
kqglassodkjlmapper
.
getDetailedRecordClock
(
startDateyesterday
,
endDate
,
userBean
.
getEmpNum
(),
yeboattdate
,
userBean
.
getOrgCode
());
List
<
AttSchedule
>
beforeattsch
=
beforeattdate
.
getAttsch
();
List
<
AttSchedule
>
beforeattsch
=
beforeattdate
.
getAttsch
();
int
p
=
0
;
int
p
=
0
;
if
(
EmptyUtil
.
isNotEmpty
(
beforeattdate
.
getAttsch
())
&&
beforeattsch
.
get
(
0
).
getId
()
!=
0
)
{
if
(
EmptyUtil
.
isNotEmpty
(
beforeattdate
.
getAttsch
())
&&
beforeattsch
.
get
(
0
).
getId
()
!=
0
)
{
int
g
=
1
;
int
g
=
1
;
...
@@ -3019,7 +3019,7 @@ public class ClockInController {
...
@@ -3019,7 +3019,7 @@ public class ClockInController {
isdkjl
=
false
;
isdkjl
=
false
;
}
}
}
}
if
(
dkjlbefo
.
getDktime
()
!=
null
)
{
if
(
dkjlbefo
.
getDktime
()
!=
null
)
{
bycf
=
false
;
bycf
=
false
;
bc
++;
bc
++;
...
@@ -3027,7 +3027,7 @@ public class ClockInController {
...
@@ -3027,7 +3027,7 @@ public class ClockInController {
}
else
{
}
else
{
attschbefo
.
setIsdk
(
0
);
attschbefo
.
setIsdk
(
0
);
}
}
if
(
beforeattdate
.
getAttsch
().
size
()
==
2
)
{
if
(
beforeattdate
.
getAttsch
().
size
()
==
2
)
{
if
(
befo
.
getStarttime
()
!=
0
&&
befo
.
getEndtime
()
!=
0
)
{
if
(
befo
.
getStarttime
()
!=
0
&&
befo
.
getEndtime
()
!=
0
)
{
boolean
ectivedate
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
nowdate
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
befo
.
getStarttime
()),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
befo
.
getEndtime
()),
"yyyy-MM-dd HH:mm"
);
boolean
ectivedate
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
nowdate
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
befo
.
getStarttime
()),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
befo
.
getEndtime
()),
"yyyy-MM-dd HH:mm"
);
...
@@ -3057,7 +3057,7 @@ public class ClockInController {
...
@@ -3057,7 +3057,7 @@ public class ClockInController {
bc
--;
bc
--;
attschbefo
.
setIsdk
(
0
);
attschbefo
.
setIsdk
(
0
);
}
}
}
else
{
}
else
{
if
(
bycf
)
{
if
(
bycf
)
{
bc
++;
bc
++;
...
@@ -3065,9 +3065,9 @@ public class ClockInController {
...
@@ -3065,9 +3065,9 @@ public class ClockInController {
}
}
}
}
}
}
Timestamp
tt
=
Timestamp
.
valueOf
(
ClockInTool
.
stampToDate
(
String
.
valueOf
(
befo
.
getTime
())));
Timestamp
tt
=
Timestamp
.
valueOf
(
ClockInTool
.
stampToDate
(
String
.
valueOf
(
befo
.
getTime
())));
if
(
attschbefo
.
getIsdk
()
==
1
&&
b
.
after
(
tt
)
&&
isdkjl
)
{
if
(
attschbefo
.
getIsdk
()
==
1
&&
b
.
after
(
tt
)
&&
isdkjl
)
{
dkjlbefo
.
setStatus
(
17
);
//缺卡
dkjlbefo
.
setStatus
(
17
);
//缺卡
dkjlbefo
.
setSort
(
befo
.
getSort
());
dkjlbefo
.
setSort
(
befo
.
getSort
());
...
@@ -3075,18 +3075,18 @@ public class ClockInController {
...
@@ -3075,18 +3075,18 @@ public class ClockInController {
//更新打卡关闭
//更新打卡关闭
attschbefo
.
setIsupdate
(
0
);
attschbefo
.
setIsupdate
(
0
);
}
}
attschbefo
.
setDajl
(
dkjlbefo
);
attschbefo
.
setDajl
(
dkjlbefo
);
attsch
.
add
(
p
,
attschbefo
);
attsch
.
add
(
p
,
attschbefo
);
p
++;
p
++;
}
}
}
}
}
}
}
}
/****************昨日结束***************/
/****************昨日结束***************/
int
bccs
=
attdate
.
getAttsch
().
size
();
int
bccs
=
attdate
.
getAttsch
().
size
();
int
r
=
1
;
int
r
=
1
;
// int bc = 0;
// int bc = 0;
...
@@ -3103,9 +3103,9 @@ public class ClockInController {
...
@@ -3103,9 +3103,9 @@ public class ClockInController {
//有范围
//有范围
if
(
ash
.
getStarttime
()
!=
0
&&
ash
.
getEndtime
()
!=
0
)
{
if
(
ash
.
getStarttime
()
!=
0
&&
ash
.
getEndtime
()
!=
0
)
{
boolean
ectivedate
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
nowdate
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
ash
.
getStarttime
()),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
ash
.
getEndtime
()),
"yyyy-MM-dd HH:mm"
);
boolean
ectivedate
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
nowdate
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
ash
.
getStarttime
()),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
ash
.
getEndtime
()),
"yyyy-MM-dd HH:mm"
);
String
timme
=
ClockInTool
.
stampToDate2
(
String
.
valueOf
(
ash
.
getTime
()));
String
timme
=
ClockInTool
.
stampToDate2
(
String
.
valueOf
(
ash
.
getTime
()));
if
(
r
==
1
)
{
if
(
r
==
1
)
{
if
(
ectivedate
)
{
if
(
ectivedate
)
{
bsz
=
1
;
bsz
=
1
;
...
@@ -3114,17 +3114,17 @@ public class ClockInController {
...
@@ -3114,17 +3114,17 @@ public class ClockInController {
dk1
=
false
;
dk1
=
false
;
bc
++;
bc
++;
ash
.
setIsdk
(
1
);
ash
.
setIsdk
(
1
);
if
(!
now
.
equals
(
timme
))
{
if
(!
now
.
equals
(
timme
))
{
ash
.
setIsupdate
(
0
);
ash
.
setIsupdate
(
0
);
}
else
{
}
else
{
ash
.
setIsupdate
(
1
);
ash
.
setIsupdate
(
1
);
}
}
}
}
}
}
if
(
r
==
2
)
{
if
(
r
==
2
)
{
if
(
ectivedate
)
{
if
(
ectivedate
)
{
bsz
=
1
;
bsz
=
1
;
...
@@ -3133,19 +3133,19 @@ public class ClockInController {
...
@@ -3133,19 +3133,19 @@ public class ClockInController {
dk2
=
false
;
dk2
=
false
;
bc
++;
bc
++;
ash
.
setIsdk
(
1
);
ash
.
setIsdk
(
1
);
if
(!
now
.
equals
(
timme
))
{
if
(!
now
.
equals
(
timme
))
{
ash
.
setIsupdate
(
0
);
ash
.
setIsupdate
(
0
);
}
else
{
}
else
{
if
(
isxbdk
==
2
)
{
if
(
isxbdk
==
2
)
{
ash
.
setIsupdate
(
1
);
ash
.
setIsupdate
(
1
);
}
}
}
}
}
}
}
}
r
++;
r
++;
//是否请假
//是否请假
KqglAssoRelationSummary
leainv
=
kqglassorelationsummarymapper
.
leaveinvesti
(
userBean
.
getEmpNum
(),
2
,
str
,
userBean
.
getOrgCode
());
KqglAssoRelationSummary
leainv
=
kqglassorelationsummarymapper
.
leaveinvesti
(
userBean
.
getEmpNum
(),
2
,
str
,
userBean
.
getOrgCode
());
boolean
adopt
=
false
;
boolean
adopt
=
false
;
...
@@ -3162,7 +3162,7 @@ public class ClockInController {
...
@@ -3162,7 +3162,7 @@ public class ClockInController {
Timestamp
a
=
Timestamp
.
valueOf
(
xbdk1
);
//下班
Timestamp
a
=
Timestamp
.
valueOf
(
xbdk1
);
//下班
String
sbdk1
=
(
str
+
" "
+
shif
.
getSbdk1
()+
":00"
).
replaceAll
(
"\r|\n"
,
""
);
String
sbdk1
=
(
str
+
" "
+
shif
.
getSbdk1
()+
":00"
).
replaceAll
(
"\r|\n"
,
""
);
Timestamp
c
=
Timestamp
.
valueOf
(
sbdk1
);
//上班
Timestamp
c
=
Timestamp
.
valueOf
(
sbdk1
);
//上班
if
(
r
==
1
)
{
if
(
r
==
1
)
{
if
(
b
.
after
(
a
)
&&
b
.
after
(
c
))
{
// 当前时间大于下班打卡时间
if
(
b
.
after
(
a
)
&&
b
.
after
(
c
))
{
// 当前时间大于下班打卡时间
bc
++;
bc
++;
...
@@ -3184,7 +3184,7 @@ public class ClockInController {
...
@@ -3184,7 +3184,7 @@ public class ClockInController {
}
}
}
}
r
++;
r
++;
//是否请假
//是否请假
KqglAssoRelationSummary
leainv
=
kqglassorelationsummarymapper
.
leaveinvesti
(
userBean
.
getEmpNum
(),
2
,
str
,
userBean
.
getOrgCode
());
KqglAssoRelationSummary
leainv
=
kqglassorelationsummarymapper
.
leaveinvesti
(
userBean
.
getEmpNum
(),
2
,
str
,
userBean
.
getOrgCode
());
boolean
adopt
=
false
;
boolean
adopt
=
false
;
...
@@ -3204,7 +3204,7 @@ public class ClockInController {
...
@@ -3204,7 +3204,7 @@ public class ClockInController {
}
else
{
}
else
{
bc
++;
bc
++;
ash
.
setIsdk
(
1
);
ash
.
setIsdk
(
1
);
if
(
ash
.
getSort
()
==
1
)
{
if
(
ash
.
getSort
()
==
1
)
{
dk1
=
false
;
dk1
=
false
;
}
}
...
@@ -3224,7 +3224,7 @@ public class ClockInController {
...
@@ -3224,7 +3224,7 @@ public class ClockInController {
dk6
=
false
;
dk6
=
false
;
}
}
}
}
//是否请假
//是否请假
KqglAssoRelationSummary
leainv
=
kqglassorelationsummarymapper
.
leaveinvesti
(
userBean
.
getEmpNum
(),
2
,
str
,
userBean
.
getOrgCode
());
KqglAssoRelationSummary
leainv
=
kqglassorelationsummarymapper
.
leaveinvesti
(
userBean
.
getEmpNum
(),
2
,
str
,
userBean
.
getOrgCode
());
boolean
adopt
=
false
;
boolean
adopt
=
false
;
...
@@ -3236,14 +3236,14 @@ public class ClockInController {
...
@@ -3236,14 +3236,14 @@ public class ClockInController {
ash
.
setIsleave
(
1
);
ash
.
setIsleave
(
1
);
}
}
}
}
String
afterday
=
ClockInTool
.
requires_extra_times
(
str
,+
1
,
3
,
1
);
//后一天
String
afterday
=
ClockInTool
.
requires_extra_times
(
str
,+
1
,
3
,
1
);
//后一天
Long
endDateafterday
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
afterday
,
"yyyy-MM-dd"
)).
getTime
();
Long
endDateafterday
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
afterday
,
"yyyy-MM-dd"
)).
getTime
();
if
(
sb1
==
1
||
xb1
==
1
||
sb2
==
1
||
xb2
==
1
||
sb3
==
1
||
xb3
==
1
)
{
//当天存在次日打卡数据时 查询打卡记录范围应该是:当天的开始到后一天的结束
if
(
sb1
==
1
||
xb1
==
1
||
sb2
==
1
||
xb2
==
1
||
sb3
==
1
||
xb3
==
1
)
{
//当天存在次日打卡数据时 查询打卡记录范围应该是:当天的开始到后一天的结束
dajllist_
=
kqglassodkjlmapper
.
getDetailedRecordClock
(
startDate
,
endDateafterday
,
userBean
.
getEmpNum
(),
nowattdate
,
userBean
.
getOrgCode
());
dajllist_
=
kqglassodkjlmapper
.
getDetailedRecordClock
(
startDate
,
endDateafterday
,
userBean
.
getEmpNum
(),
nowattdate
,
userBean
.
getOrgCode
());
}
}
KqglAssoDkjl
dkjl
=
KqglAssoDkjl
.
builder
().
build
();
KqglAssoDkjl
dkjl
=
KqglAssoDkjl
.
builder
().
build
();
for
(
KqglAssoDkjl
daj
:
dajllist_
)
{
for
(
KqglAssoDkjl
daj
:
dajllist_
)
{
if
(
ash
.
getId
()
==
daj
.
getBcid
()
&&
ash
.
getSort
()
==
daj
.
getSort
())
{
//班次id和打卡顺序对应
if
(
ash
.
getId
()
==
daj
.
getBcid
()
&&
ash
.
getSort
()
==
daj
.
getSort
())
{
//班次id和打卡顺序对应
...
@@ -3251,7 +3251,7 @@ public class ClockInController {
...
@@ -3251,7 +3251,7 @@ public class ClockInController {
int
bcid
=
dkjl
.
getBcid
();
int
bcid
=
dkjl
.
getBcid
();
int
results
=
dkjl
.
getResults
();
int
results
=
dkjl
.
getResults
();
KqglAssoBcsz
bcsz
=
KqglAssoBcsz
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoBcsz
>().
lambda
().
eq
(
KqglAssoBcsz:
:
getId
,
bcid
));
KqglAssoBcsz
bcsz
=
KqglAssoBcsz
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoBcsz
>().
lambda
().
eq
(
KqglAssoBcsz:
:
getId
,
bcid
));
if
(
now
.
equals
(
ClockInTool
.
stampToDate2
(
String
.
valueOf
(
ash
.
getTime
()))))
{
if
(
now
.
equals
(
ClockInTool
.
stampToDate2
(
String
.
valueOf
(
ash
.
getTime
()))))
{
if
(
attdate
.
getAttsch
().
size
()
==
2
)
{
if
(
attdate
.
getAttsch
().
size
()
==
2
)
{
if
(
dkjl
.
getSort
()
==
2
)
{
if
(
dkjl
.
getSort
()
==
2
)
{
...
@@ -3267,7 +3267,7 @@ public class ClockInController {
...
@@ -3267,7 +3267,7 @@ public class ClockInController {
}
}
}
}
}
}
if
(
bcsz
!=
null
&&
(
dkjl
.
getSort
())%
2
>
0
)
{
if
(
bcsz
!=
null
&&
(
dkjl
.
getSort
())%
2
>
0
)
{
int
yxcdfzs
=
bcsz
.
getYxcdfzs
();
//允许迟到分钟数
int
yxcdfzs
=
bcsz
.
getYxcdfzs
();
//允许迟到分钟数
int
yzcdfzs
=
bcsz
.
getYzcdfzs
();
//严重迟到分钟数
int
yzcdfzs
=
bcsz
.
getYzcdfzs
();
//严重迟到分钟数
...
@@ -3288,7 +3288,7 @@ public class ClockInController {
...
@@ -3288,7 +3288,7 @@ public class ClockInController {
dkjl
.
setStatus
(
16
);
//旷工迟到
dkjl
.
setStatus
(
16
);
//旷工迟到
}
}
}
}
if
(
bsz
==
1
)
{
if
(
bsz
==
1
)
{
bc
++;
bc
++;
ash
.
setIsdk
(
1
);
ash
.
setIsdk
(
1
);
...
@@ -3299,12 +3299,12 @@ public class ClockInController {
...
@@ -3299,12 +3299,12 @@ public class ClockInController {
BeanUtil
.
copyProperties
(
daj
,
dkjl
,
"attdate"
,
"remarks"
,
"userId"
,
"attime"
,
"dkmxid"
,
"commentary"
,
"punchequipment"
,
"punchmode"
);
BeanUtil
.
copyProperties
(
daj
,
dkjl
,
"attdate"
,
"remarks"
,
"userId"
,
"attime"
,
"dkmxid"
,
"commentary"
,
"punchequipment"
,
"punchmode"
);
}
}
}
}
KqglAssoBcsz
shif
=
KqglAssoBcsz
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoBcsz
>().
lambda
().
eq
(
KqglAssoBcsz:
:
getId
,
ash
.
getId
()));
KqglAssoBcsz
shif
=
KqglAssoBcsz
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoBcsz
>().
lambda
().
eq
(
KqglAssoBcsz:
:
getId
,
ash
.
getId
()));
Timestamp
tt
=
Timestamp
.
valueOf
(
ClockInTool
.
stampToDate
(
String
.
valueOf
(
ash
.
getTime
())));
Timestamp
tt
=
Timestamp
.
valueOf
(
ClockInTool
.
stampToDate
(
String
.
valueOf
(
ash
.
getTime
())));
//处理下班不用打卡的数据
//处理下班不用打卡的数据
if
(
shif
.
getIsXbdk
()
==
1
&&
(
ash
.
getSort
())%
2
==
0
)
{
if
(
shif
.
getIsXbdk
()
==
1
&&
(
ash
.
getSort
())%
2
==
0
)
{
if
(
dkjl
.
getDktime
()
==
null
&&
b
.
after
(
tt
))
{
if
(
dkjl
.
getDktime
()
==
null
&&
b
.
after
(
tt
))
{
dkjl
.
setDktime
(
ash
.
getTime
());
dkjl
.
setDktime
(
ash
.
getTime
());
dkjl
.
setStatus
(
1
);
dkjl
.
setStatus
(
1
);
...
@@ -3324,7 +3324,7 @@ public class ClockInController {
...
@@ -3324,7 +3324,7 @@ public class ClockInController {
ash
.
setIsupdate
(
0
);
ash
.
setIsupdate
(
0
);
ash
.
setIsdk
(
1
);
ash
.
setIsdk
(
1
);
}
}
//
//
if
(
ash
.
getIsdk
()
==
1
&&
b
.
after
(
tt
)
&&
dkjl
.
getDktime
()
==
null
&&
dkjl
.
getId
()
==
null
&&
dkcs
>
0
&&
iscrdk
)
{
if
(
ash
.
getIsdk
()
==
1
&&
b
.
after
(
tt
)
&&
dkjl
.
getDktime
()
==
null
&&
dkjl
.
getId
()
==
null
&&
dkcs
>
0
&&
iscrdk
)
{
dkjl
.
setStatus
(
17
);
//缺卡
dkjl
.
setStatus
(
17
);
//缺卡
...
@@ -3338,15 +3338,15 @@ public class ClockInController {
...
@@ -3338,15 +3338,15 @@ public class ClockInController {
dkjl
.
setSort
(
ash
.
getSort
());
dkjl
.
setSort
(
ash
.
getSort
());
dkjl
.
setId
(
888
);
dkjl
.
setId
(
888
);
}
}
ash
.
setDajl
(
dkjl
);
//班次信息中插入打卡打卡 数据
ash
.
setDajl
(
dkjl
);
//班次信息中插入打卡打卡 数据
/****/
/****/
//事务(请假,加班,调休,出差)
//事务(请假,加班,调休,出差)
KqglAssoRelationSummary
asssum1
=
KqglAssoRelationSummary
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoRelationSummary
>().
lambda
().
eq
(
KqglAssoRelationSummary:
:
getUserId
,
userBean
.
getEmpNum
())
KqglAssoRelationSummary
asssum1
=
KqglAssoRelationSummary
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoRelationSummary
>().
lambda
().
eq
(
KqglAssoRelationSummary:
:
getUserId
,
userBean
.
getEmpNum
())
.
eq
(
KqglAssoRelationSummary:
:
getAppTime
,
str
).
eq
(
KqglAssoRelationSummary:
:
getOrgCode
,
userBean
.
getOrgCode
()).
last
(
"LIMIT 1"
));
.
eq
(
KqglAssoRelationSummary:
:
getAppTime
,
str
).
eq
(
KqglAssoRelationSummary:
:
getOrgCode
,
userBean
.
getOrgCode
()).
last
(
"LIMIT 1"
));
if
(
asssum1
!=
null
)
{
if
(
asssum1
!=
null
)
{
if
(
asssum1
.
getApprovalType
()
!=
5
)
{
if
(
asssum1
.
getApprovalType
()
!=
5
)
{
String
startTime
=
asssum1
.
getStartTime
();
//
String
startTime
=
asssum1
.
getStartTime
();
//
String
endTime
=
asssum1
.
getEndTime
();
//
String
endTime
=
asssum1
.
getEndTime
();
//
...
@@ -3358,11 +3358,11 @@ public class ClockInController {
...
@@ -3358,11 +3358,11 @@ public class ClockInController {
}
}
}
}
}
}
//0:无;1:事假;2:调休;3:病假;4:年假;5:产假;6:陪产假;7:婚假;8:例假;9:丧假;10:哺乳假;11:加班;12:出差;13:外出
//0:无;1:事假;2:调休;3:病假;4:年假;5:产假;6:陪产假;7:婚假;8:例假;9:丧假;10:哺乳假;11:加班;12:出差;13:外出
if
(
asssum1
.
getApprovalType
()
==
1
)
{
if
(
asssum1
.
getApprovalType
()
==
1
)
{
dkjl
.
setCalendar_status_type
(
11
);
dkjl
.
setCalendar_status_type
(
11
);
ash
.
setCalendar_status_type
(
11
);
ash
.
setCalendar_status_type
(
11
);
}
else
if
(
asssum1
.
getApprovalType
()
==
2
)
{
}
else
if
(
asssum1
.
getApprovalType
()
==
2
)
{
//请假
//请假
...
@@ -3417,16 +3417,16 @@ public class ClockInController {
...
@@ -3417,16 +3417,16 @@ public class ClockInController {
ash
.
setCalendar_status_type
(
0
);
ash
.
setCalendar_status_type
(
0
);
}
}
/****/
/****/
// ash.setDajl(dkjl);//班次信息中插入打卡打卡 数据
// ash.setDajl(dkjl);//班次信息中插入打卡打卡 数据
}
}
}
}
boolean
lcdkgb
=
true
;
boolean
lcdkgb
=
true
;
if
(
attdate
.
getAttsch
().
size
()
==
2
&&
dkcs
==
2
&&
now
.
equals
(
str
))
{
if
(
attdate
.
getAttsch
().
size
()
==
2
&&
dkcs
==
2
&&
now
.
equals
(
str
))
{
lcdkgb
=
false
;
lcdkgb
=
false
;
KqglAssoDkjl
dk
=
KqglAssoDkjl
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoDkjl
>().
lambda
().
eq
(
KqglAssoDkjl:
:
getQyid
,
userBean
.
getOrgCode
())
KqglAssoDkjl
dk
=
KqglAssoDkjl
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoDkjl
>().
lambda
().
eq
(
KqglAssoDkjl:
:
getQyid
,
userBean
.
getOrgCode
())
.
eq
(
KqglAssoDkjl:
:
getUserId
,
userBean
.
getEmpNum
()).
ge
(
KqglAssoDkjl:
:
getDktime
,
startDate
).
le
(
KqglAssoDkjl:
:
getDktime
,
endDate
)
.
eq
(
KqglAssoDkjl:
:
getUserId
,
userBean
.
getEmpNum
()).
ge
(
KqglAssoDkjl:
:
getDktime
,
startDate
).
le
(
KqglAssoDkjl:
:
getDktime
,
endDate
)
.
ne
(
KqglAssoDkjl:
:
getSort
,
0
).
ne
(
KqglAssoDkjl:
:
getStatus
,
2
).
ne
(
KqglAssoDkjl:
:
getStatus
,
0
)
.
ne
(
KqglAssoDkjl:
:
getSort
,
0
).
ne
(
KqglAssoDkjl:
:
getStatus
,
2
).
ne
(
KqglAssoDkjl:
:
getStatus
,
0
)
...
@@ -3440,7 +3440,7 @@ public class ClockInController {
...
@@ -3440,7 +3440,7 @@ public class ClockInController {
}
}
}
}
}
}
//全部为缺卡时 没有打卡按钮显示
//全部为缺卡时 没有打卡按钮显示
if
(
attsch
.
get
(
0
).
getDajl
().
getId
()
!=
null
&&
iscrdk
)
{
if
(
attsch
.
get
(
0
).
getDajl
().
getId
()
!=
null
&&
iscrdk
)
{
if
(
attdate
.
getAttsch
().
size
()
==
2
||
attdate
.
getAttsch
().
size
()
==
4
||
attdate
.
getAttsch
().
size
()
==
6
)
{
if
(
attdate
.
getAttsch
().
size
()
==
2
||
attdate
.
getAttsch
().
size
()
==
4
||
attdate
.
getAttsch
().
size
()
==
6
)
{
...
@@ -3460,7 +3460,7 @@ public class ClockInController {
...
@@ -3460,7 +3460,7 @@ public class ClockInController {
}
}
}
}
}
}
//当天最后一个班打完后 打卡按钮全部不显示(没打卡的显示缺卡)
//当天最后一个班打完后 打卡按钮全部不显示(没打卡的显示缺卡)
boolean
isdkjj
=
true
;
boolean
isdkjj
=
true
;
if
(
attdate
.
getAttsch
().
size
()
==
2
)
{
if
(
attdate
.
getAttsch
().
size
()
==
2
)
{
...
@@ -3471,45 +3471,45 @@ public class ClockInController {
...
@@ -3471,45 +3471,45 @@ public class ClockInController {
attsch
.
get
(
0
).
getDajl
().
setStatus
(
17
);
//缺卡
attsch
.
get
(
0
).
getDajl
().
setStatus
(
17
);
//缺卡
attsch
.
get
(
0
).
getDajl
().
setSort
(
attdate
.
getAttsch
().
get
(
0
).
getSort
());
attsch
.
get
(
0
).
getDajl
().
setSort
(
attdate
.
getAttsch
().
get
(
0
).
getSort
());
attsch
.
get
(
0
).
getDajl
().
setId
(
888
);
attsch
.
get
(
0
).
getDajl
().
setId
(
888
);
attdate
.
getAttsch
().
get
(
0
).
setIsdk
(
1
);
attdate
.
getAttsch
().
get
(
0
).
setIsdk
(
1
);
}
}
}
}
}
else
if
(
attdate
.
getAttsch
().
size
()
==
4
)
{
}
else
if
(
attdate
.
getAttsch
().
size
()
==
4
)
{
if
(
attsch
.
get
(
3
).
getDajl
().
getId
()
!=
null
&&
attsch
.
get
(
3
).
getDajl
().
getDktime
()
!=
null
)
{
if
(
attsch
.
get
(
3
).
getDajl
().
getId
()
!=
null
&&
attsch
.
get
(
3
).
getDajl
().
getDktime
()
!=
null
)
{
isdkjj
=
false
;
isdkjj
=
false
;
if
(
attsch
.
get
(
0
).
getDajl
().
getId
()
==
null
&&
attsch
.
get
(
0
).
getDajl
().
getDktime
()
==
null
)
{
if
(
attsch
.
get
(
0
).
getDajl
().
getId
()
==
null
&&
attsch
.
get
(
0
).
getDajl
().
getDktime
()
==
null
)
{
attsch
.
get
(
0
).
getDajl
().
setDktime
(
null
);
attsch
.
get
(
0
).
getDajl
().
setDktime
(
null
);
attsch
.
get
(
0
).
getDajl
().
setStatus
(
17
);
//缺卡
attsch
.
get
(
0
).
getDajl
().
setStatus
(
17
);
//缺卡
attsch
.
get
(
0
).
getDajl
().
setSort
(
attdate
.
getAttsch
().
get
(
0
).
getSort
());
attsch
.
get
(
0
).
getDajl
().
setSort
(
attdate
.
getAttsch
().
get
(
0
).
getSort
());
attsch
.
get
(
0
).
getDajl
().
setId
(
888
);
attsch
.
get
(
0
).
getDajl
().
setId
(
888
);
attdate
.
getAttsch
().
get
(
0
).
setIsdk
(
1
);
attdate
.
getAttsch
().
get
(
0
).
setIsdk
(
1
);
}
}
if
(
attsch
.
get
(
1
).
getDajl
().
getId
()
==
null
&&
attsch
.
get
(
1
).
getDajl
().
getDktime
()
==
null
&&
attsch
.
get
(
1
).
getDajl
().
getId
()
!=
999
)
{
if
(
attsch
.
get
(
1
).
getDajl
().
getId
()
==
null
&&
attsch
.
get
(
1
).
getDajl
().
getDktime
()
==
null
&&
attsch
.
get
(
1
).
getDajl
().
getId
()
!=
999
)
{
attsch
.
get
(
1
).
getDajl
().
setDktime
(
null
);
attsch
.
get
(
1
).
getDajl
().
setDktime
(
null
);
attsch
.
get
(
1
).
getDajl
().
setStatus
(
17
);
//缺卡
attsch
.
get
(
1
).
getDajl
().
setStatus
(
17
);
//缺卡
attsch
.
get
(
1
).
getDajl
().
setSort
(
attdate
.
getAttsch
().
get
(
1
).
getSort
());
attsch
.
get
(
1
).
getDajl
().
setSort
(
attdate
.
getAttsch
().
get
(
1
).
getSort
());
attsch
.
get
(
1
).
getDajl
().
setId
(
888
);
attsch
.
get
(
1
).
getDajl
().
setId
(
888
);
attdate
.
getAttsch
().
get
(
1
).
setIsdk
(
1
);
attdate
.
getAttsch
().
get
(
1
).
setIsdk
(
1
);
}
}
if
(
attsch
.
get
(
2
).
getDajl
().
getId
()
==
null
&&
attsch
.
get
(
2
).
getDajl
().
getDktime
()
==
null
)
{
if
(
attsch
.
get
(
2
).
getDajl
().
getId
()
==
null
&&
attsch
.
get
(
2
).
getDajl
().
getDktime
()
==
null
)
{
attsch
.
get
(
2
).
getDajl
().
setDktime
(
null
);
attsch
.
get
(
2
).
getDajl
().
setDktime
(
null
);
attsch
.
get
(
2
).
getDajl
().
setStatus
(
17
);
//缺卡
attsch
.
get
(
2
).
getDajl
().
setStatus
(
17
);
//缺卡
attsch
.
get
(
2
).
getDajl
().
setSort
(
attdate
.
getAttsch
().
get
(
2
).
getSort
());
attsch
.
get
(
2
).
getDajl
().
setSort
(
attdate
.
getAttsch
().
get
(
2
).
getSort
());
attsch
.
get
(
2
).
getDajl
().
setId
(
888
);
attsch
.
get
(
2
).
getDajl
().
setId
(
888
);
attdate
.
getAttsch
().
get
(
2
).
setIsdk
(
1
);
attdate
.
getAttsch
().
get
(
2
).
setIsdk
(
1
);
}
}
}
}
}
else
if
(
attdate
.
getAttsch
().
size
()
==
6
)
{
}
else
if
(
attdate
.
getAttsch
().
size
()
==
6
)
{
if
(
attsch
.
get
(
5
).
getDajl
().
getId
()
!=
null
&&
attsch
.
get
(
5
).
getDajl
().
getDktime
()
!=
null
)
{
if
(
attsch
.
get
(
5
).
getDajl
().
getId
()
!=
null
&&
attsch
.
get
(
5
).
getDajl
().
getDktime
()
!=
null
)
{
isdkjj
=
false
;
isdkjj
=
false
;
if
(
attsch
.
get
(
0
).
getDajl
().
getId
()
==
null
&&
attsch
.
get
(
0
).
getDajl
().
getDktime
()
==
null
)
{
if
(
attsch
.
get
(
0
).
getDajl
().
getId
()
==
null
&&
attsch
.
get
(
0
).
getDajl
().
getDktime
()
==
null
)
{
attsch
.
get
(
0
).
getDajl
().
setDktime
(
null
);
attsch
.
get
(
0
).
getDajl
().
setDktime
(
null
);
attsch
.
get
(
0
).
getDajl
().
setStatus
(
17
);
//缺卡
attsch
.
get
(
0
).
getDajl
().
setStatus
(
17
);
//缺卡
...
@@ -3547,27 +3547,27 @@ public class ClockInController {
...
@@ -3547,27 +3547,27 @@ public class ClockInController {
}
}
}
}
}
}
// System.out.println(attsch.get(attdate.getAttsch().size()-1).getTime());
// System.out.println(attsch.get(attdate.getAttsch().size()-1).getTime());
//全部为 1 时 iscrdk
//全部为 1 时 iscrdk
if
(
bccs
==
bc
&&
b
.
before
(
d
)
&&
lcdkgb
&&
isdkjj
)
{
if
(
bccs
==
bc
&&
b
.
before
(
d
)
&&
lcdkgb
&&
isdkjj
)
{
KqglAssoDkjl
dk
=
KqglAssoDkjl
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoDkjl
>().
lambda
().
eq
(
KqglAssoDkjl:
:
getQyid
,
userBean
.
getOrgCode
())
KqglAssoDkjl
dk
=
KqglAssoDkjl
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoDkjl
>().
lambda
().
eq
(
KqglAssoDkjl:
:
getQyid
,
userBean
.
getOrgCode
())
.
eq
(
KqglAssoDkjl:
:
getUserId
,
userBean
.
getEmpNum
()).
ge
(
KqglAssoDkjl:
:
getDktime
,
startDate
).
le
(
KqglAssoDkjl:
:
getDktime
,
endDate
)
.
eq
(
KqglAssoDkjl:
:
getUserId
,
userBean
.
getEmpNum
()).
ge
(
KqglAssoDkjl:
:
getDktime
,
startDate
).
le
(
KqglAssoDkjl:
:
getDktime
,
endDate
)
.
ne
(
KqglAssoDkjl:
:
getSort
,
0
).
ne
(
KqglAssoDkjl:
:
getStatus
,
2
).
ne
(
KqglAssoDkjl:
:
getStatus
,
0
)
.
ne
(
KqglAssoDkjl:
:
getSort
,
0
).
ne
(
KqglAssoDkjl:
:
getStatus
,
2
).
ne
(
KqglAssoDkjl:
:
getStatus
,
0
)
.
orderByDesc
(
KqglAssoDkjl:
:
getSort
).
last
(
"LIMIT 1"
));
.
orderByDesc
(
KqglAssoDkjl:
:
getSort
).
last
(
"LIMIT 1"
));
if
(
dk
!=
null
&&
attdate
.
getAttsch
().
size
()
!=
dk
.
getSort
())
{
if
(
dk
!=
null
&&
attdate
.
getAttsch
().
size
()
!=
dk
.
getSort
())
{
AttSchedule
att
=
attsch
.
get
(
dk
.
getSort
()-
cr
);
AttSchedule
att
=
attsch
.
get
(
dk
.
getSort
()-
cr
);
if
(
att
.
getDajl
().
getId
()
!=
null
&&
att
.
getDajl
().
getStatus
()
!=
17
&&
att
.
getDajl
().
getId
()
!=
888
)
{
if
(
att
.
getDajl
().
getId
()
!=
null
&&
att
.
getDajl
().
getStatus
()
!=
17
&&
att
.
getDajl
().
getId
()
!=
888
)
{
att
.
setIsdk
(
0
);
att
.
setIsdk
(
0
);
AttSchedule
attw
=
attsch
.
get
(
dk
.
getSort
()-
1
);
AttSchedule
attw
=
attsch
.
get
(
dk
.
getSort
()-
1
);
attw
.
setIsupdate
(
1
);
attw
.
setIsupdate
(
1
);
}
else
{
}
else
{
AttSchedule
att1
=
attsch
.
get
(
dk
.
getSort
()+
cr
);
AttSchedule
att1
=
attsch
.
get
(
dk
.
getSort
()+
cr
);
att1
.
setIsdk
(
0
);
att1
.
setIsdk
(
0
);
AttSchedule
attw
=
attsch
.
get
(
dk
.
getSort
()+
cr
-
1
);
AttSchedule
attw
=
attsch
.
get
(
dk
.
getSort
()+
cr
-
1
);
attw
.
setIsupdate
(
1
);
attw
.
setIsupdate
(
1
);
}
}
...
@@ -3597,7 +3597,7 @@ public class ClockInController {
...
@@ -3597,7 +3597,7 @@ public class ClockInController {
attcto
.
setIsdk
(
1
);
attcto
.
setIsdk
(
1
);
}
}
}
else
if
(
attdate
.
getAttsch
().
size
()
==
4
)
{
}
else
if
(
attdate
.
getAttsch
().
size
()
==
4
)
{
AttSchedule
attc
=
attsch
.
get
(
0
);
AttSchedule
attc
=
attsch
.
get
(
0
);
if
(
attc
.
getDajl
().
getId
()
!=
null
&&
attc
.
getDajl
().
getStatus
()
==
17
&&
attc
.
getDajl
().
getId
()
==
888
)
{
if
(
attc
.
getDajl
().
getId
()
!=
null
&&
attc
.
getDajl
().
getStatus
()
==
17
&&
attc
.
getDajl
().
getId
()
==
888
)
{
attc
.
getDajl
().
setId
(
null
);
attc
.
getDajl
().
setId
(
null
);
...
@@ -3628,14 +3628,14 @@ public class ClockInController {
...
@@ -3628,14 +3628,14 @@ public class ClockInController {
}
}
attc
.
setIsdk
(
0
);
attc
.
setIsdk
(
0
);
}
}
}
}
}
}
}
}
}
}
//没有打卡按钮时
//没有打卡按钮时
for
(
int
y
=
0
;
y
<
bc
;
y
++)
{
for
(
int
y
=
0
;
y
<
bc
;
y
++)
{
AttSchedule
attc
=
attsch
.
get
(
y
);
AttSchedule
attc
=
attsch
.
get
(
y
);
...
@@ -3645,14 +3645,14 @@ public class ClockInController {
...
@@ -3645,14 +3645,14 @@ public class ClockInController {
}
}
}
}
}
}
}
else
{
}
else
{
//休息的时候
//休息的时候
// List<AttSchedule> attsch_ = new ArrayList<AttSchedule>();
// List<AttSchedule> attsch_ = new ArrayList<AttSchedule>();
// attdate.setAttsch(attsch_);
// attdate.setAttsch(attsch_);
List
<
AttSchedule
>
attsch_
=
new
ArrayList
<
AttSchedule
>();
List
<
AttSchedule
>
attsch_
=
new
ArrayList
<
AttSchedule
>();
if
(
dajllist_
.
size
()
>
0
)
{
if
(
dajllist_
.
size
()
>
0
)
{
for
(
int
i
=
1
;
i
<=
dajllist_
.
size
();
i
++){
for
(
int
i
=
1
;
i
<=
dajllist_
.
size
();
i
++){
KqglAssoDkjl
dkjl
=
KqglAssoDkjl
.
builder
().
build
();
KqglAssoDkjl
dkjl
=
KqglAssoDkjl
.
builder
().
build
();
...
@@ -3684,12 +3684,12 @@ public class ClockInController {
...
@@ -3684,12 +3684,12 @@ public class ClockInController {
attdate
.
setAttsch
(
attsch_
);
attdate
.
setAttsch
(
attsch_
);
}
}
}
}
}
else
{
}
else
{
//自由工时
//自由工时
List
<
AttSchedule
>
attsch
=
new
ArrayList
<
AttSchedule
>();
List
<
AttSchedule
>
attsch
=
new
ArrayList
<
AttSchedule
>();
if
(
dajllist_
.
size
()
>
0
)
{
if
(
dajllist_
.
size
()
>
0
)
{
for
(
int
i
=
1
;
i
<=
dajllist_
.
size
();
i
++){
for
(
int
i
=
1
;
i
<=
dajllist_
.
size
();
i
++){
KqglAssoDkjl
dkjl
=
KqglAssoDkjl
.
builder
().
build
();
KqglAssoDkjl
dkjl
=
KqglAssoDkjl
.
builder
().
build
();
...
@@ -3721,7 +3721,7 @@ public class ClockInController {
...
@@ -3721,7 +3721,7 @@ public class ClockInController {
attdate
.
setAttsch
(
attsch
);
attdate
.
setAttsch
(
attsch
);
}
}
}
}
List
<
TransactionApprovalDto
>
tranappr
=
new
ArrayList
<
TransactionApprovalDto
>();
List
<
TransactionApprovalDto
>
tranappr
=
new
ArrayList
<
TransactionApprovalDto
>();
//事务审批单
//事务审批单
List
<
KqglAssoRelationSummary
>
trap
=
KqglAssoRelationSummary
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
KqglAssoRelationSummary
>().
lambda
().
eq
(
KqglAssoRelationSummary:
:
getUserId
,
userBean
.
getEmpNum
())
List
<
KqglAssoRelationSummary
>
trap
=
KqglAssoRelationSummary
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
KqglAssoRelationSummary
>().
lambda
().
eq
(
KqglAssoRelationSummary:
:
getUserId
,
userBean
.
getEmpNum
())
...
@@ -3730,7 +3730,7 @@ public class ClockInController {
...
@@ -3730,7 +3730,7 @@ public class ClockInController {
for
(
KqglAssoRelationSummary
spnsw
:
trap
)
{
for
(
KqglAssoRelationSummary
spnsw
:
trap
)
{
if
(
spnsw
.
getApprovalType
()
!=
5
)
{
if
(
spnsw
.
getApprovalType
()
!=
5
)
{
TransactionApprovalDto
taap
=
TransactionApprovalDto
.
builder
().
build
();
TransactionApprovalDto
taap
=
TransactionApprovalDto
.
builder
().
build
();
if
(
spnsw
.
getApprovalType
()
==
1
)
{
if
(
spnsw
.
getApprovalType
()
==
1
)
{
taap
.
setCalendar_status_type
(
11
);
taap
.
setCalendar_status_type
(
11
);
}
else
if
(
spnsw
.
getApprovalType
()
==
2
)
{
}
else
if
(
spnsw
.
getApprovalType
()
==
2
)
{
...
@@ -3766,25 +3766,25 @@ public class ClockInController {
...
@@ -3766,25 +3766,25 @@ public class ClockInController {
}
else
if
(
spnsw
.
getApprovalType
()
==
4
)
{
}
else
if
(
spnsw
.
getApprovalType
()
==
4
)
{
taap
.
setCalendar_status_type
(
13
);
taap
.
setCalendar_status_type
(
13
);
}
}
taap
.
setApproval_form
(
spnsw
.
getApprovalId
());
taap
.
setApproval_form
(
spnsw
.
getApprovalId
());
tranappr
.
add
(
taap
);
tranappr
.
add
(
taap
);
attdate
.
setTranappr
(
tranappr
);
attdate
.
setTranappr
(
tranappr
);
}
}
}
}
}
else
{
}
else
{
attdate
.
setTranappr
(
tranappr
);
attdate
.
setTranappr
(
tranappr
);
}
}
//外勤 true:开 false:关
//外勤 true:开 false:关
if
(
attgro
.
getIsWq
()
==
1
)
{
if
(
attgro
.
getIsWq
()
==
1
)
{
attdate
.
setFieldpersonnel
(
true
);
attdate
.
setFieldpersonnel
(
true
);
}
else
{
}
else
{
attdate
.
setFieldpersonnel
(
false
);
attdate
.
setFieldpersonnel
(
false
);
}
}
//打卡方式
//打卡方式
List
<
AttGroupBinPunchMode
>
attmetlist
=
attgroupbinpunchmodemapper
.
selectByPrimaryByKqzId
(
attgro
.
getId
());
List
<
AttGroupBinPunchMode
>
attmetlist
=
attgroupbinpunchmodemapper
.
selectByPrimaryByKqzId
(
attgro
.
getId
());
for
(
AttGroupBinPunchMode
agbp:
attmetlist
){
for
(
AttGroupBinPunchMode
agbp:
attmetlist
){
...
@@ -3797,13 +3797,13 @@ public class ClockInController {
...
@@ -3797,13 +3797,13 @@ public class ClockInController {
attdate
.
setAttwifi
(
true
);
attdate
.
setAttwifi
(
true
);
}
}
}
}
//详细打卡方式
//详细打卡方式
List
<
AttClockMethod
>
akms
=
new
ArrayList
<
AttClockMethod
>();
List
<
AttClockMethod
>
akms
=
new
ArrayList
<
AttClockMethod
>();
for
(
AttGroupBinPunchMode
abp:
attmetlist
){
for
(
AttGroupBinPunchMode
abp:
attmetlist
){
if
(
abp
.
getType
()
==
1
){
if
(
abp
.
getType
()
==
1
){
AttendanceMachine
kqjs
=
attendancemachinemapper
.
selectByPrimaryKey
(
abp
.
getDkfsid
());
AttendanceMachine
kqjs
=
attendancemachinemapper
.
selectByPrimaryKey
(
abp
.
getDkfsid
());
AttClockMethod
akm
=
AttClockMethod
.
builder
().
build
();
AttClockMethod
akm
=
AttClockMethod
.
builder
().
build
();
if
(
kqjs
!=
null
)
{
if
(
kqjs
!=
null
)
{
akm
.
setName
(
kqjs
.
getName
());
// 打卡名称
akm
.
setName
(
kqjs
.
getName
());
// 打卡名称
...
@@ -3815,7 +3815,7 @@ public class ClockInController {
...
@@ -3815,7 +3815,7 @@ public class ClockInController {
}
}
akms
.
add
(
akm
);
akms
.
add
(
akm
);
}
else
if
(
abp
.
getType
()
==
2
){
}
else
if
(
abp
.
getType
()
==
2
){
PunchCardAddress
kqdzs
=
punchcardaddressmapper
.
selectByPrimaryKey
(
abp
.
getDkfsid
());
PunchCardAddress
kqdzs
=
punchcardaddressmapper
.
selectByPrimaryKey
(
abp
.
getDkfsid
());
AttClockMethod
akm
=
AttClockMethod
.
builder
().
build
();
AttClockMethod
akm
=
AttClockMethod
.
builder
().
build
();
if
(
kqdzs
!=
null
)
{
if
(
kqdzs
!=
null
)
{
akm
.
setName
(
kqdzs
.
getName
());
// 打卡名称
akm
.
setName
(
kqdzs
.
getName
());
// 打卡名称
...
@@ -3827,7 +3827,7 @@ public class ClockInController {
...
@@ -3827,7 +3827,7 @@ public class ClockInController {
}
}
akms
.
add
(
akm
);
akms
.
add
(
akm
);
}
else
{
}
else
{
PunchCardWiFi
kqwfs
=
punchcardwifimapper
.
selectByPrimaryKey
(
abp
.
getDkfsid
());
PunchCardWiFi
kqwfs
=
punchcardwifimapper
.
selectByPrimaryKey
(
abp
.
getDkfsid
());
AttClockMethod
akm
=
AttClockMethod
.
builder
().
build
();
AttClockMethod
akm
=
AttClockMethod
.
builder
().
build
();
if
(
kqwfs
!=
null
)
{
if
(
kqwfs
!=
null
)
{
akm
.
setName
(
kqwfs
.
getName
());
// 打卡名称
akm
.
setName
(
kqwfs
.
getName
());
// 打卡名称
...
@@ -3841,29 +3841,29 @@ public class ClockInController {
...
@@ -3841,29 +3841,29 @@ public class ClockInController {
}
}
}
}
attdate
.
setMachine
(
akms
);
attdate
.
setMachine
(
akms
);
//当天第一次打卡 前一天晚走小时**************************************************
//当天第一次打卡 前一天晚走小时**************************************************
double
latetime_
=
0
;
//前天晚走时长(分钟)
double
latetime_
=
0
;
//前天晚走时长(分钟)
Long
changed_time
=
0
l
;
//晚到后应打卡时间
Long
changed_time
=
0
l
;
//晚到后应打卡时间
if
(
attdate
.
getAttgrouptype
()
!=
3
)
{
if
(
attdate
.
getAttgrouptype
()
!=
3
)
{
List
<
AttSchedule
>
ash
=
attdate
.
getAttsch
();
List
<
AttSchedule
>
ash
=
attdate
.
getAttsch
();
if
(
EmptyUtil
.
isNotEmpty
(
attdate
.
getAttsch
())
&&
ash
.
get
(
0
).
getId
()
!=
0
)
{
if
(
EmptyUtil
.
isNotEmpty
(
attdate
.
getAttsch
())
&&
ash
.
get
(
0
).
getId
()
!=
0
)
{
KqglAssoBcsz
shif
=
KqglAssoBcsz
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoBcsz
>().
lambda
().
eq
(
KqglAssoBcsz:
:
getId
,
ash
.
get
(
0
).
getId
()));
KqglAssoBcsz
shif
=
KqglAssoBcsz
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoBcsz
>().
lambda
().
eq
(
KqglAssoBcsz:
:
getId
,
ash
.
get
(
0
).
getId
()));
if
(
shif
!=
null
)
{
if
(
shif
!=
null
)
{
int
dkcs_
=
shif
.
getSxbcs
();
//上下班打卡次数
int
dkcs_
=
shif
.
getSxbcs
();
//上下班打卡次数
int
iswzwd
=
shif
.
getIsWzwd
();
//是否开启晚走晚到(0:否;1:是)
int
iswzwd
=
shif
.
getIsWzwd
();
//是否开启晚走晚到(0:否;1:是)
//统一分钟数
//统一分钟数
double
xbwz1
=
0
,
xbwz2
=
0
,
xbwz3
=
0
;
double
xbwz1
=
0
,
xbwz2
=
0
,
xbwz3
=
0
;
int
sbwd1
=
0
,
sbwd2
=
0
,
sbwd3
=
0
;
int
sbwd1
=
0
,
sbwd2
=
0
,
sbwd3
=
0
;
int
arrive_late
=
0
;
//晚到时间
int
arrive_late
=
0
;
//晚到时间
String
clock_date
=
""
;
//应打卡时间
String
clock_date
=
""
;
//应打卡时间
Long
latetime
=
0
l
;
//前天晚走时长(分钟)
Long
latetime
=
0
l
;
//前天晚走时长(分钟)
KqglAssoDkmx
yesterdaymx
=
KqglAssoDkmx
.
builder
().
build
();
KqglAssoDkmx
yesterdaymx
=
KqglAssoDkmx
.
builder
().
build
();
AttendanceCardListDto
attdateyesterday
;
AttendanceCardListDto
attdateyesterday
;
long
yesendtime1
=
0
,
yesendtime2
=
0
,
yesendtime3
=
0
;
long
yesendtime1
=
0
,
yesendtime2
=
0
,
yesendtime3
=
0
;
...
@@ -3872,23 +3872,23 @@ public class ClockInController {
...
@@ -3872,23 +3872,23 @@ public class ClockInController {
if
(
iswzwd
>
0
)
{
if
(
iswzwd
>
0
)
{
//统一分钟数
//统一分钟数
xbwz1
=
Double
.
valueOf
(
shif
.
getXbwz1
())
*
60
;
//下班晚走1
xbwz1
=
Double
.
valueOf
(
shif
.
getXbwz1
())
*
60
;
//下班晚走1
String
as
=
String
.
valueOf
(
Double
.
valueOf
(
shif
.
getSbwd1
())
*
60
);
String
as
=
String
.
valueOf
(
Double
.
valueOf
(
shif
.
getSbwd1
())
*
60
);
sbwd1
=
Integer
.
valueOf
(
as
.
replaceAll
(
regex
,
"$1$2"
));
//上班晚到1
sbwd1
=
Integer
.
valueOf
(
as
.
replaceAll
(
regex
,
"$1$2"
));
//上班晚到1
xbwz2
=
Double
.
valueOf
(
shif
.
getXbwz2
())
*
60
;
//下班晚走2
xbwz2
=
Double
.
valueOf
(
shif
.
getXbwz2
())
*
60
;
//下班晚走2
String
qw
=
String
.
valueOf
(
Double
.
valueOf
(
shif
.
getSbwd2
())
*
60
);
String
qw
=
String
.
valueOf
(
Double
.
valueOf
(
shif
.
getSbwd2
())
*
60
);
sbwd2
=
Integer
.
valueOf
(
qw
.
replaceAll
(
regex
,
"$1$2"
));
//上班晚到2
sbwd2
=
Integer
.
valueOf
(
qw
.
replaceAll
(
regex
,
"$1$2"
));
//上班晚到2
xbwz3
=
Double
.
valueOf
(
shif
.
getXbwz3
())
*
60
;
//下班晚走3
xbwz3
=
Double
.
valueOf
(
shif
.
getXbwz3
())
*
60
;
//下班晚走3
String
ed
=
String
.
valueOf
(
Double
.
valueOf
(
shif
.
getSbwd3
())
*
60
);
String
ed
=
String
.
valueOf
(
Double
.
valueOf
(
shif
.
getSbwd3
())
*
60
);
sbwd3
=
Integer
.
valueOf
(
ed
.
replaceAll
(
regex
,
"$1$2"
));
//上班晚到3
sbwd3
=
Integer
.
valueOf
(
ed
.
replaceAll
(
regex
,
"$1$2"
));
//上班晚到3
//获取前一天最后下班的时间
//获取前一天最后下班的时间
yesterdaymx
=
KqglAssoDkmx
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoDkmx
>().
lambda
().
eq
(
KqglAssoDkmx:
:
getUserid
,
userBean
.
getEmpNum
())
yesterdaymx
=
KqglAssoDkmx
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoDkmx
>().
lambda
().
eq
(
KqglAssoDkmx:
:
getUserid
,
userBean
.
getEmpNum
())
.
ge
(
KqglAssoDkmx:
:
getDksj
,
startDateyesterday
).
le
(
KqglAssoDkmx:
:
getDksj
,
endDateyesterday
).
eq
(
KqglAssoDkmx:
:
getQyid
,
userBean
.
getOrgCode
()));
.
ge
(
KqglAssoDkmx:
:
getDksj
,
startDateyesterday
).
le
(
KqglAssoDkmx:
:
getDksj
,
endDateyesterday
).
eq
(
KqglAssoDkmx:
:
getQyid
,
userBean
.
getOrgCode
()));
attdateyesterday
=
MethodCall
(
userBean
.
getOrgCode
(),
userBean
.
getEmpNum
(),
yesterday
);
attdateyesterday
=
MethodCall
(
userBean
.
getOrgCode
(),
userBean
.
getEmpNum
(),
yesterday
);
List
<
AttSchedule
>
ashyes
=
attdateyesterday
.
getAttsch
();
List
<
AttSchedule
>
ashyes
=
attdateyesterday
.
getAttsch
();
if
(
attdateyesterday
.
getAttsch
().
size
()
==
2
||
attdateyesterday
.
getAttsch
().
size
()
==
4
||
attdateyesterday
.
getAttsch
().
size
()
==
6
)
{
if
(
attdateyesterday
.
getAttsch
().
size
()
==
2
||
attdateyesterday
.
getAttsch
().
size
()
==
4
||
attdateyesterday
.
getAttsch
().
size
()
==
6
)
{
yesendtime1
=
ashyes
.
get
(
1
).
getTime
();
yesendtime1
=
ashyes
.
get
(
1
).
getTime
();
...
@@ -3899,7 +3899,7 @@ public class ClockInController {
...
@@ -3899,7 +3899,7 @@ public class ClockInController {
if
(
attdateyesterday
.
getAttsch
().
size
()
==
6
)
{
if
(
attdateyesterday
.
getAttsch
().
size
()
==
6
)
{
yesendtime3
=
ashyes
.
get
(
5
).
getTime
();
yesendtime3
=
ashyes
.
get
(
5
).
getTime
();
}
}
if
(
yesterdaymx
!=
null
)
{
if
(
yesterdaymx
!=
null
)
{
if
(
dkcs_
==
1
)
{
if
(
dkcs_
==
1
)
{
if
(
yesterdaymx
.
getXbdk1
()
!=
null
&&
yesterdaymx
.
getXbdk1jg
()
==
0
)
{
if
(
yesterdaymx
.
getXbdk1
()
!=
null
&&
yesterdaymx
.
getXbdk1jg
()
==
0
)
{
...
@@ -3915,7 +3915,7 @@ public class ClockInController {
...
@@ -3915,7 +3915,7 @@ public class ClockInController {
}
}
}
}
}
}
if
(
latetime
!=
0
)
{
if
(
latetime
!=
0
)
{
latetime_
=
Double
.
valueOf
(
String
.
valueOf
(
latetime
));
//前天晚走时长(分钟)
latetime_
=
Double
.
valueOf
(
String
.
valueOf
(
latetime
));
//前天晚走时长(分钟)
if
(
latetime_
>
xbwz1
&&
latetime_
<
xbwz2
)
{
if
(
latetime_
>
xbwz1
&&
latetime_
<
xbwz2
)
{
...
@@ -3934,21 +3934,25 @@ public class ClockInController {
...
@@ -3934,21 +3934,25 @@ public class ClockInController {
attdate
.
setChanged_time
(
changed_time
);
attdate
.
setChanged_time
(
changed_time
);
}
}
}
}
}
}
return
ResultUtil
.
data
(
attdate
);
return
ResultUtil
.
data
(
attdate
);
}
else
{
}
else
{
AttendanceCardListDto
attdate_
=
AttendanceCardListDto
.
builder
().
build
();
AttendanceCardListDto
attdate_
=
AttendanceCardListDto
.
builder
().
build
();
return
ResultUtil
.
data
(
attdate_
,
"未加入考勤组"
);
return
ResultUtil
.
data
(
attdate_
,
"未加入考勤组"
);
}
}
}
catch
(
Exception
e
){
log
.
error
(
"getAttClockData-erro:"
+
e
.
getStackTrace
());
return
ResultUtil
.
error
(
"获取考勤组异常"
);
}
}
}
private
SimpleDateFormat
mat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
private
SimpleDateFormat
mat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
@Autowired
@Autowired
private
KqglAssoTeshuMapper
kqglassoteshumapper
;
private
KqglAssoTeshuMapper
kqglassoteshumapper
;
@Autowired
@Autowired
...
@@ -3959,16 +3963,16 @@ public class ClockInController {
...
@@ -3959,16 +3963,16 @@ public class ClockInController {
* APP 手机日历数据
* APP 手机日历数据
* @param userBean
* @param userBean
* @return
* @return
* @throws ParseException
* @throws ParseException
*/
*/
@GetMapping
(
value
=
"/workbench_calendar/{date}"
)
@GetMapping
(
value
=
"/workbench_calendar/{date}"
)
@ApiOperation
(
value
=
"手机日历数据"
,
httpMethod
=
"GET"
,
notes
=
"查询数据"
)
@ApiOperation
(
value
=
"手机日历数据"
,
httpMethod
=
"GET"
,
notes
=
"查询数据"
)
public
Result
<
Object
>
Workbench_calendar
(
@CurrentUser
UserBean
userBean
,
@PathVariable
(
"date"
)
String
date
)
throws
ParseException
{
public
Result
<
Object
>
Workbench_calendar
(
@CurrentUser
UserBean
userBean
,
@PathVariable
(
"date"
)
String
date
)
throws
ParseException
{
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
//设置日期格式
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
//设置日期格式
String
current
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
new
Date
());
String
current
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
new
Date
());
String
yue
=
new
SimpleDateFormat
(
"yyyy-MM"
).
format
(
new
Date
());
String
yue
=
new
SimpleDateFormat
(
"yyyy-MM"
).
format
(
new
Date
());
SimpleDateFormat
df1
=
new
SimpleDateFormat
(
"yyyy-MM"
);
SimpleDateFormat
df1
=
new
SimpleDateFormat
(
"yyyy-MM"
);
Date
date_
;
Date
date_
;
try
{
try
{
...
@@ -3978,68 +3982,68 @@ public class ClockInController {
...
@@ -3978,68 +3982,68 @@ public class ClockInController {
date_
=
new
Date
();
date_
=
new
Date
();
}
}
// int dateOne= ClockInTool.getYearMonth(date_);
// int dateOne= ClockInTool.getYearMonth(date_);
// 准备第一个模板,从字符串中提取出日期数字
// 准备第一个模板,从字符串中提取出日期数字
String
pat1
=
"yyyy-MM"
;
String
pat1
=
"yyyy-MM"
;
String
pat
=
"yyyyMM"
;
String
pat
=
"yyyyMM"
;
SimpleDateFormat
sdfi
=
new
SimpleDateFormat
(
pat1
)
;
// 实例化模板对象
SimpleDateFormat
sdfi
=
new
SimpleDateFormat
(
pat1
)
;
// 实例化模板对象
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
pat
)
;
// 实例化模板对象
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
pat
)
;
// 实例化模板对象
Date
d
=
null
;
Date
d
=
null
;
try
{
try
{
d
=
sdfi
.
parse
(
date
)
;
// 将给定的字符串中的日期提取出来
d
=
sdfi
.
parse
(
date
)
;
// 将给定的字符串中的日期提取出来
}
catch
(
Exception
e
){
// 如果提供的字符串格式有错误,则进行异常处理
}
catch
(
Exception
e
){
// 如果提供的字符串格式有错误,则进行异常处理
e
.
printStackTrace
()
;
// 打印异常信息
e
.
printStackTrace
()
;
// 打印异常信息
}
}
int
dateOne
=
Integer
.
valueOf
(
sdf
.
format
(
d
));
int
dateOne
=
Integer
.
valueOf
(
sdf
.
format
(
d
));
int
dangqian
=
Integer
.
valueOf
(
new
SimpleDateFormat
(
"yyyyMM"
).
format
(
new
Date
()));
//当前
int
dangqian
=
Integer
.
valueOf
(
new
SimpleDateFormat
(
"yyyyMM"
).
format
(
new
Date
()));
//当前
List
<
WorkbenchCalendarDto
>
workcal
=
new
ArrayList
<
WorkbenchCalendarDto
>();
List
<
WorkbenchCalendarDto
>
workcal
=
new
ArrayList
<
WorkbenchCalendarDto
>();
if
(
dateOne
<=
dangqian
){
if
(
dateOne
<=
dangqian
){
Long
startMonth
=
0
l
;
Long
startMonth
=
0
l
;
Long
endMonth
=
0
l
;
Long
endMonth
=
0
l
;
if
(
date
==
null
||
(
""
).
equals
(
date
))
{
if
(
date
==
null
||
(
""
).
equals
(
date
))
{
Calendar
c
=
Calendar
.
getInstance
();
Calendar
c
=
Calendar
.
getInstance
();
c
.
add
(
Calendar
.
MONTH
,
0
);
c
.
add
(
Calendar
.
MONTH
,
0
);
c
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
//设置为1号,当前日期既为本月第一天
c
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
//设置为1号,当前日期既为本月第一天
String
first
=
mat
.
format
(
c
.
getTime
());
String
first
=
mat
.
format
(
c
.
getTime
());
startMonth
=
DateUtil
.
getStartTime
(
0
,
DateUtil
.
getStringTime
(
first
,
"yyyy-MM-dd"
)).
getTime
();
startMonth
=
DateUtil
.
getStartTime
(
0
,
DateUtil
.
getStringTime
(
first
,
"yyyy-MM-dd"
)).
getTime
();
endMonth
=
new
Date
().
getTime
();
endMonth
=
new
Date
().
getTime
();
}
else
{
}
else
{
String
time
=
date
+
"-01"
;
String
time
=
date
+
"-01"
;
String
sdaet
=
ClockInTool
.
getMinMonthDate
(
time
);
String
sdaet
=
ClockInTool
.
getMinMonthDate
(
time
);
startMonth
=
ClockInTool
.
getStartTime
(
0
,
ClockInTool
.
getStringTime
(
sdaet
,
"yyyy-MM-dd"
)).
getTime
();
startMonth
=
ClockInTool
.
getStartTime
(
0
,
ClockInTool
.
getStringTime
(
sdaet
,
"yyyy-MM-dd"
)).
getTime
();
String
edate
=
ClockInTool
.
getMaxMonthDate
(
time
);
String
edate
=
ClockInTool
.
getMaxMonthDate
(
time
);
endMonth
=
ClockInTool
.
getnowEndTime
(
23
,
ClockInTool
.
getStringTime
(
edate
,
"yyyy-MM-dd"
)).
getTime
();
endMonth
=
ClockInTool
.
getnowEndTime
(
23
,
ClockInTool
.
getStringTime
(
edate
,
"yyyy-MM-dd"
)).
getTime
();
if
(
date
.
equals
(
yue
))
{
if
(
date
.
equals
(
yue
))
{
endMonth
=
new
Date
().
getTime
();
endMonth
=
new
Date
().
getTime
();
}
}
}
}
String
[]
rangeArray
=
ClockInTool
.
listToString
(
ClockInTool
.
getDays
(
df
.
format
(
startMonth
),
df
.
format
(
endMonth
))).
split
(
";"
);
//目前为止所有日期
String
[]
rangeArray
=
ClockInTool
.
listToString
(
ClockInTool
.
getDays
(
df
.
format
(
startMonth
),
df
.
format
(
endMonth
))).
split
(
";"
);
//目前为止所有日期
String
[]
range
=
rangeArray
[
0
].
split
(
","
);
String
[]
range
=
rangeArray
[
0
].
split
(
","
);
KqglMainKqz
attgro
=
kqglmainkqzmapper
.
getAttendanceGroupInformationByUserid
(
userBean
.
getEmpNum
(),
userBean
.
getOrgCode
());
//考勤组信息
KqglMainKqz
attgro
=
kqglmainkqzmapper
.
getAttendanceGroupInformationByUserid
(
userBean
.
getEmpNum
(),
userBean
.
getOrgCode
());
//考勤组信息
for
(
String
num
:
range
)
{
for
(
String
num
:
range
)
{
Long
start_time
=
DateUtil
.
getStartTime
(
0
,
DateUtil
.
getStringTime
(
num
,
"yyyy-MM-dd"
)).
getTime
();
Long
start_time
=
DateUtil
.
getStartTime
(
0
,
DateUtil
.
getStringTime
(
num
,
"yyyy-MM-dd"
)).
getTime
();
Long
end_time
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
num
,
"yyyy-MM-dd"
)).
getTime
();
Long
end_time
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
num
,
"yyyy-MM-dd"
)).
getTime
();
WorkbenchCalendarDto
wocal
=
WorkbenchCalendarDto
.
builder
().
build
();
WorkbenchCalendarDto
wocal
=
WorkbenchCalendarDto
.
builder
().
build
();
wocal
.
setDate
(
num
);
wocal
.
setDate
(
num
);
if
(
attgro
!=
null
)
{
//有无考勤组
if
(
attgro
!=
null
)
{
//有无考勤组
AttendanceCardListDto
attdate
=
MethodCall
(
userBean
.
getOrgCode
(),
userBean
.
getEmpNum
(),
num
);
//获取当天所打卡班次
AttendanceCardListDto
attdate
=
MethodCall
(
userBean
.
getOrgCode
(),
userBean
.
getEmpNum
(),
num
);
//获取当天所打卡班次
List
<
AttSchedule
>
ashss
=
attdate
.
getAttsch
();
//获取今天应打卡时间
List
<
AttSchedule
>
ashss
=
attdate
.
getAttsch
();
//获取今天应打卡时间
if
(
EmptyUtil
.
isNotEmpty
(
attdate
.
getAttsch
())
&&
attdate
.
getAttgrouptype
()
!=
3
)
{
//班次不为空
if
(
EmptyUtil
.
isNotEmpty
(
attdate
.
getAttsch
())
&&
attdate
.
getAttgrouptype
()
!=
3
)
{
//班次不为空
KqglAssoBcsz
bcsts
=
KqglAssoBcsz
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoBcsz
>().
lambda
().
eq
(
KqglAssoBcsz:
:
getId
,
ashss
.
get
(
0
).
getId
()));
KqglAssoBcsz
bcsts
=
KqglAssoBcsz
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoBcsz
>().
lambda
().
eq
(
KqglAssoBcsz:
:
getId
,
ashss
.
get
(
0
).
getId
()));
if
(
ashss
.
get
(
0
).
getId
()
!=
0
)
{
if
(
ashss
.
get
(
0
).
getId
()
!=
0
)
{
KqglAssoDkmx
dkmc
=
KqglAssoDkmx
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoDkmx
>().
lambda
().
eq
(
KqglAssoDkmx:
:
getUserid
,
userBean
.
getEmpNum
()).
eq
(
KqglAssoDkmx:
:
getQyid
,
userBean
.
getOrgCode
())
KqglAssoDkmx
dkmc
=
KqglAssoDkmx
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoDkmx
>().
lambda
().
eq
(
KqglAssoDkmx:
:
getUserid
,
userBean
.
getEmpNum
()).
eq
(
KqglAssoDkmx:
:
getQyid
,
userBean
.
getOrgCode
())
.
ge
(
KqglAssoDkmx:
:
getDksj
,
start_time
).
le
(
KqglAssoDkmx:
:
getDksj
,
end_time
));
.
ge
(
KqglAssoDkmx:
:
getDksj
,
start_time
).
le
(
KqglAssoDkmx:
:
getDksj
,
end_time
));
...
@@ -4063,7 +4067,7 @@ public class ClockInController {
...
@@ -4063,7 +4067,7 @@ public class ClockInController {
}
}
}
}
}
}
if
(
attdate
.
getAttsch
().
size
()
==
4
||
attdate
.
getAttsch
().
size
()
==
6
)
{
if
(
attdate
.
getAttsch
().
size
()
==
4
||
attdate
.
getAttsch
().
size
()
==
6
)
{
if
(
dkmc
.
getSbdk2
()
!=
null
&&
dkmc
.
getSbdk2jg
()
==
0
&&
dkmc
.
getXbdk2
()
!=
null
&&
dkmc
.
getXbdk2jg
()
==
0
)
{
if
(
dkmc
.
getSbdk2
()
!=
null
&&
dkmc
.
getSbdk2jg
()
==
0
&&
dkmc
.
getXbdk2
()
!=
null
&&
dkmc
.
getXbdk2jg
()
==
0
)
{
wocal
.
setCalendar_status
(
1
);
//打卡正常
wocal
.
setCalendar_status
(
1
);
//打卡正常
...
@@ -4078,12 +4082,12 @@ public class ClockInController {
...
@@ -4078,12 +4082,12 @@ public class ClockInController {
wocal
.
setCalendar_status_type
(
0
);
wocal
.
setCalendar_status_type
(
0
);
}
}
}
else
{
}
else
{
wocal
.
setCalendar_status
(
3
);
//打卡异常
wocal
.
setCalendar_status
(
3
);
//打卡异常
wocal
.
setCalendar_status_type
(
0
);
wocal
.
setCalendar_status_type
(
0
);
}
}
}
}
}
}
if
(
attdate
.
getAttsch
().
size
()
==
6
)
{
if
(
attdate
.
getAttsch
().
size
()
==
6
)
{
if
(
dkmc
.
getSbdk3
()
!=
null
&&
dkmc
.
getSbdk3jg
()
==
0
&&
dkmc
.
getXbdk3
()
!=
null
&&
dkmc
.
getXbdk3jg
()
==
0
)
{
if
(
dkmc
.
getSbdk3
()
!=
null
&&
dkmc
.
getSbdk3jg
()
==
0
&&
dkmc
.
getXbdk3
()
!=
null
&&
dkmc
.
getXbdk3jg
()
==
0
)
{
wocal
.
setCalendar_status
(
1
);
//打卡正常
wocal
.
setCalendar_status
(
1
);
//打卡正常
...
@@ -4098,12 +4102,12 @@ public class ClockInController {
...
@@ -4098,12 +4102,12 @@ public class ClockInController {
wocal
.
setCalendar_status_type
(
0
);
wocal
.
setCalendar_status_type
(
0
);
}
}
}
else
{
}
else
{
wocal
.
setCalendar_status
(
3
);
//打卡异常
wocal
.
setCalendar_status
(
3
);
//打卡异常
wocal
.
setCalendar_status_type
(
0
);
wocal
.
setCalendar_status_type
(
0
);
}
}
}
}
}
}
// KqglAssoRelationSummary asssum = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, userBean.getEmpNum())
// KqglAssoRelationSummary asssum = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, userBean.getEmpNum())
// .eq(KqglAssoRelationSummary::getAppTime, num).last("LIMIT 1"));
// .eq(KqglAssoRelationSummary::getAppTime, num).last("LIMIT 1"));
// if(asssum != null) {
// if(asssum != null) {
...
@@ -4113,7 +4117,7 @@ public class ClockInController {
...
@@ -4113,7 +4117,7 @@ public class ClockInController {
wocal
.
setCalendar_status
(
3
);
//打卡异常
wocal
.
setCalendar_status
(
3
);
//打卡异常
wocal
.
setCalendar_status_type
(
0
);
wocal
.
setCalendar_status_type
(
0
);
}
}
//事务(请假,加班,调休,出差)
//事务(请假,加班,调休,出差)
KqglAssoRelationSummary
asssum
=
KqglAssoRelationSummary
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoRelationSummary
>().
lambda
().
eq
(
KqglAssoRelationSummary:
:
getUserId
,
userBean
.
getEmpNum
())
KqglAssoRelationSummary
asssum
=
KqglAssoRelationSummary
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoRelationSummary
>().
lambda
().
eq
(
KqglAssoRelationSummary:
:
getUserId
,
userBean
.
getEmpNum
())
.
eq
(
KqglAssoRelationSummary:
:
getAppTime
,
num
).
eq
(
KqglAssoRelationSummary:
:
getOrgCode
,
userBean
.
getOrgCode
()).
last
(
"LIMIT 1"
));
.
eq
(
KqglAssoRelationSummary:
:
getAppTime
,
num
).
eq
(
KqglAssoRelationSummary:
:
getOrgCode
,
userBean
.
getOrgCode
()).
last
(
"LIMIT 1"
));
...
@@ -4123,7 +4127,7 @@ public class ClockInController {
...
@@ -4123,7 +4127,7 @@ public class ClockInController {
}
else
{
}
else
{
wocal
.
setCalendar_status
(
2
);
//事务(请假,加班,调休,出差)
wocal
.
setCalendar_status
(
2
);
//事务(请假,加班,调休,出差)
}
}
//0:无;1:事假;2:调休;3:病假;4:年假;5:产假;6:陪产假;7:婚假;8:例假;9:丧假;10:哺乳假;11:加班;12:出差;13:外出
//0:无;1:事假;2:调休;3:病假;4:年假;5:产假;6:陪产假;7:婚假;8:例假;9:丧假;10:哺乳假;11:加班;12:出差;13:外出
if
(
asssum
.
getApprovalType
()
==
1
)
{
if
(
asssum
.
getApprovalType
()
==
1
)
{
wocal
.
setCalendar_status_type
(
11
);
wocal
.
setCalendar_status_type
(
11
);
...
@@ -4171,22 +4175,22 @@ public class ClockInController {
...
@@ -4171,22 +4175,22 @@ public class ClockInController {
}
}
workcal
.
add
(
wocal
);
workcal
.
add
(
wocal
);
}
}
//当月后续补贴数据
//当月后续补贴数据
if
(
date
==
null
||
(
""
).
equals
(
date
)
||
date
.
equals
(
yue
))
{
if
(
date
==
null
||
(
""
).
equals
(
date
)
||
date
.
equals
(
yue
))
{
int
pbfs
=
0
;
int
pbfs
=
0
;
String
next_day
=
ClockInTool
.
requires_extra_times
(
current
,
1
,
2
,
1
);
String
next_day
=
ClockInTool
.
requires_extra_times
(
current
,
1
,
2
,
1
);
Calendar
ca
=
Calendar
.
getInstance
();
Calendar
ca
=
Calendar
.
getInstance
();
ca
.
set
(
Calendar
.
DAY_OF_MONTH
,
ca
.
getActualMaximum
(
Calendar
.
DAY_OF_MONTH
));
ca
.
set
(
Calendar
.
DAY_OF_MONTH
,
ca
.
getActualMaximum
(
Calendar
.
DAY_OF_MONTH
));
String
last
=
mat
.
format
(
ca
.
getTime
());
String
last
=
mat
.
format
(
ca
.
getTime
());
Long
endMonth_
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
last
,
"yyyy-MM-dd"
)).
getTime
();
Long
endMonth_
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
last
,
"yyyy-MM-dd"
)).
getTime
();
String
[]
nextrangeArray
=
ClockInTool
.
listToString
(
ClockInTool
.
getDays
(
next_day
,
sdf1
.
format
(
endMonth_
))).
split
(
";"
);
//目前为止所有日期
String
[]
nextrangeArray
=
ClockInTool
.
listToString
(
ClockInTool
.
getDays
(
next_day
,
sdf1
.
format
(
endMonth_
))).
split
(
";"
);
//目前为止所有日期
String
[]
nextrange
=
nextrangeArray
[
0
].
split
(
","
);
String
[]
nextrange
=
nextrangeArray
[
0
].
split
(
","
);
String
ttstr
=
date
;
//
String
ttstr
=
date
;
//
String
[]
ycqts
=
new
String
[
31
];
//应上班的具体天数(yyyy-MM-dd)
String
[]
ycqts
=
new
String
[
31
];
//应上班的具体天数(yyyy-MM-dd)
String
[]
xxts
=
new
String
[
31
];
//休息的具体天数(yyyy-MM-dd)
String
[]
xxts
=
new
String
[
31
];
//休息的具体天数(yyyy-MM-dd)
if
(
attgro
!=
null
){
//该员工是否加入到考勤组 排班方式 1:固定排班;2:自由排班;3:自由工时 计算出应出勤,实际出勤,休息天数
if
(
attgro
!=
null
){
//该员工是否加入到考勤组 排班方式 1:固定排班;2:自由排班;3:自由工时 计算出应出勤,实际出勤,休息天数
if
(
attgro
.
getPbfs
()
==
1
){
//固定排班
if
(
attgro
.
getPbfs
()
==
1
){
//固定排班
pbfs
=
1
;
pbfs
=
1
;
...
@@ -4215,7 +4219,7 @@ public class ClockInController {
...
@@ -4215,7 +4219,7 @@ public class ClockInController {
needfig
[
e
]
=
String
.
valueOf
(
awek
.
getType
());
//获取设置的应打卡周几
needfig
[
e
]
=
String
.
valueOf
(
awek
.
getType
());
//获取设置的应打卡周几
e
++;
e
++;
}
}
//目前为止应出勤天数
//目前为止应出勤天数
int
w
=
0
,
x
=
0
;
int
w
=
0
,
x
=
0
;
int
zj
=
6
;
int
zj
=
6
;
...
@@ -4229,7 +4233,7 @@ public class ClockInController {
...
@@ -4229,7 +4233,7 @@ public class ClockInController {
ycqts
=
ycqtst
;
ycqts
=
ycqtst
;
w
++;
w
++;
}
}
}
else
{
}
else
{
String
[]
xxtst
=
new
String
[
xxts
.
length
+
zj
];
String
[]
xxtst
=
new
String
[
xxts
.
length
+
zj
];
System
.
arraycopy
(
xxts
,
0
,
xxtst
,
0
,
xxts
.
length
);
System
.
arraycopy
(
xxts
,
0
,
xxtst
,
0
,
xxts
.
length
);
...
@@ -4297,7 +4301,7 @@ public class ClockInController {
...
@@ -4297,7 +4301,7 @@ public class ClockInController {
int
g
=
0
,
x
=
0
;
int
g
=
0
,
x
=
0
;
for
(
String
num
:
nextrange
)
{
for
(
String
num
:
nextrange
)
{
if
(
Arrays
.
binarySearch
(
ziyoupb
,
String
.
valueOf
(
ClockInTool
.
dateToWeek
(
num
)))
>=
0
)
{
//对比排班应打卡时间
if
(
Arrays
.
binarySearch
(
ziyoupb
,
String
.
valueOf
(
ClockInTool
.
dateToWeek
(
num
)))
>=
0
)
{
//对比排班应打卡时间
ycqts
[
g
]
=
num
;
ycqts
[
g
]
=
num
;
g
++;
g
++;
}
else
{
}
else
{
xxts
[
x
]
=
num
;
xxts
[
x
]
=
num
;
...
@@ -4306,7 +4310,7 @@ public class ClockInController {
...
@@ -4306,7 +4310,7 @@ public class ClockInController {
}
}
}
}
}
}
if
(!(
nextrange
[
0
]).
equals
(
""
))
{
if
(!(
nextrange
[
0
]).
equals
(
""
))
{
for
(
String
nus
:
nextrange
)
{
for
(
String
nus
:
nextrange
)
{
WorkbenchCalendarDto
wocal
=
WorkbenchCalendarDto
.
builder
().
build
();
WorkbenchCalendarDto
wocal
=
WorkbenchCalendarDto
.
builder
().
build
();
...
@@ -4324,12 +4328,12 @@ public class ClockInController {
...
@@ -4324,12 +4328,12 @@ public class ClockInController {
wocal
.
setCalendar_status_type
(
0
);
wocal
.
setCalendar_status_type
(
0
);
}
}
}
}
workcal
.
add
(
wocal
);
workcal
.
add
(
wocal
);
}
}
}
}
}
}
}
else
{
}
else
{
String
time
=
date
+
"-01"
;
String
time
=
date
+
"-01"
;
...
@@ -4337,16 +4341,16 @@ public class ClockInController {
...
@@ -4337,16 +4341,16 @@ public class ClockInController {
Long
startMonth
=
ClockInTool
.
getStartTime
(
0
,
ClockInTool
.
getStringTime
(
sdaet
,
"yyyy-MM-dd"
)).
getTime
();
Long
startMonth
=
ClockInTool
.
getStartTime
(
0
,
ClockInTool
.
getStringTime
(
sdaet
,
"yyyy-MM-dd"
)).
getTime
();
String
edate
=
ClockInTool
.
getMaxMonthDate
(
time
);
String
edate
=
ClockInTool
.
getMaxMonthDate
(
time
);
Long
endMonth
=
ClockInTool
.
getnowEndTime
(
23
,
ClockInTool
.
getStringTime
(
edate
,
"yyyy-MM-dd"
)).
getTime
();
Long
endMonth
=
ClockInTool
.
getnowEndTime
(
23
,
ClockInTool
.
getStringTime
(
edate
,
"yyyy-MM-dd"
)).
getTime
();
//固定排班
//固定排班
String
[]
rangeArray
=
ClockInTool
.
listToString
(
ClockInTool
.
getDays
(
df
.
format
(
startMonth
),
df
.
format
(
endMonth
))).
split
(
";"
);
//目前为止所有日期
String
[]
rangeArray
=
ClockInTool
.
listToString
(
ClockInTool
.
getDays
(
df
.
format
(
startMonth
),
df
.
format
(
endMonth
))).
split
(
";"
);
//目前为止所有日期
String
[]
range
=
rangeArray
[
0
].
split
(
","
);
String
[]
range
=
rangeArray
[
0
].
split
(
","
);
/******************/
/******************/
String
[]
ycqts
=
new
String
[
31
];
//应上班的具体天数(yyyy-MM-dd)
String
[]
ycqts
=
new
String
[
31
];
//应上班的具体天数(yyyy-MM-dd)
String
[]
xxts
=
new
String
[
31
];
//休息的具体天数(yyyy-MM-dd)
String
[]
xxts
=
new
String
[
31
];
//休息的具体天数(yyyy-MM-dd)
//考勤组信息
//考勤组信息
KqglMainKqz
attgro
=
kqglmainkqzmapper
.
getAttendanceGroupInformationByUserid
(
userBean
.
getEmpNum
(),
userBean
.
getOrgCode
());
KqglMainKqz
attgro
=
kqglmainkqzmapper
.
getAttendanceGroupInformationByUserid
(
userBean
.
getEmpNum
(),
userBean
.
getOrgCode
());
//固定排班
//固定排班
if
(
attgro
.
getPbfs
()
==
1
)
{
if
(
attgro
.
getPbfs
()
==
1
)
{
List
<
KqglAssoTeshu
>
bxdklist
=
kqglassoteshumapper
.
ShouldSpecialDatessetByKqzid
(
attgro
.
getId
(),
date
,
1
);
//当前月 必须打卡日期
List
<
KqglAssoTeshu
>
bxdklist
=
kqglassoteshumapper
.
ShouldSpecialDatessetByKqzid
(
attgro
.
getId
(),
date
,
1
);
//当前月 必须打卡日期
...
@@ -4374,7 +4378,7 @@ public class ClockInController {
...
@@ -4374,7 +4378,7 @@ public class ClockInController {
needfig
[
e
]
=
String
.
valueOf
(
awek
.
getType
());
//获取设置的应打卡周几
needfig
[
e
]
=
String
.
valueOf
(
awek
.
getType
());
//获取设置的应打卡周几
e
++;
e
++;
}
}
//目前为止应出勤天数
//目前为止应出勤天数
int
w
=
0
,
x
=
0
;
int
w
=
0
,
x
=
0
;
int
zj
=
6
;
int
zj
=
6
;
...
@@ -4410,7 +4414,7 @@ public class ClockInController {
...
@@ -4410,7 +4414,7 @@ public class ClockInController {
}
}
}
}
/******************/
/******************/
for
(
String
num
:
range
)
{
for
(
String
num
:
range
)
{
WorkbenchCalendarDto
wocal
=
WorkbenchCalendarDto
.
builder
().
build
();
WorkbenchCalendarDto
wocal
=
WorkbenchCalendarDto
.
builder
().
build
();
wocal
.
setDate
(
num
);
wocal
.
setDate
(
num
);
...
@@ -4420,19 +4424,19 @@ public class ClockInController {
...
@@ -4420,19 +4424,19 @@ public class ClockInController {
if
(
ClockInTool
.
useArrayUtils
(
ClockInTool
.
deleteArrayNull
(
xxts
),
num
))
{
if
(
ClockInTool
.
useArrayUtils
(
ClockInTool
.
deleteArrayNull
(
xxts
),
num
))
{
wocal
.
setCalendar_status
(
4
);
//
wocal
.
setCalendar_status
(
4
);
//
}
}
if
(!
ClockInTool
.
useArrayUtils
(
ClockInTool
.
deleteArrayNull
(
ycqts
),
num
)
&&
!
ClockInTool
.
useArrayUtils
(
ClockInTool
.
deleteArrayNull
(
xxts
),
num
))
{
if
(!
ClockInTool
.
useArrayUtils
(
ClockInTool
.
deleteArrayNull
(
ycqts
),
num
)
&&
!
ClockInTool
.
useArrayUtils
(
ClockInTool
.
deleteArrayNull
(
xxts
),
num
))
{
wocal
.
setCalendar_status
(
0
);
//
wocal
.
setCalendar_status
(
0
);
//
}
}
workcal
.
add
(
wocal
);
workcal
.
add
(
wocal
);
}
}
}
}
}
}
return
ResultUtil
.
data
(
workcal
,
"操作成功!"
);
return
ResultUtil
.
data
(
workcal
,
"操作成功!"
);
}
}
}
}
src/main/java/cn/timer/api/controller/kqgl/atttimer/AttendanceTaskTiming.java
View file @
d3b83848
...
@@ -10,8 +10,10 @@ import java.util.Date;
...
@@ -10,8 +10,10 @@ import java.util.Date;
import
java.util.List
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.Locale
;
import
cn.timer.api.config.schedule.SchedulerCondition
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Conditional
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
...
@@ -61,7 +63,7 @@ import cn.timer.api.utils.DateUtil;
...
@@ -61,7 +63,7 @@ import cn.timer.api.utils.DateUtil;
* 考勤报表汇总数据
* 考勤报表汇总数据
*/
*/
@Configuration
//1.主要用于标记配置类,兼备Component的效果。
@Configuration
//1.主要用于标记配置类,兼备Component的效果。
@EnableScheduling
// 2.开启定时任务
//
@EnableScheduling // 2.开启定时任务
@Slf4j
@Slf4j
public
class
AttendanceTaskTiming
{
public
class
AttendanceTaskTiming
{
...
@@ -93,13 +95,14 @@ public class AttendanceTaskTiming{
...
@@ -93,13 +95,14 @@ public class AttendanceTaskTiming{
// @Scheduled(cron = "0 */2 * * * ?")
// @Scheduled(cron = "0 */2 * * * ?")
// @Scheduled(cron = "0 25 11 * * ?")
// @Scheduled(cron = "0 25 11 * * ?")
@Conditional
(
SchedulerCondition
.
class
)
//定时器开关
@Scheduled
(
cron
=
"0 0 8,12,16,20 * * ?"
)
//每天上午8、12点,下午16点,20点 执行
@Scheduled
(
cron
=
"0 0 8,12,16,20 * * ?"
)
//每天上午8、12点,下午16点,20点 执行
public
void
AttendanceTask
()
throws
ParseException
{
public
void
AttendanceTask
()
throws
ParseException
{
boolean
implement
=
true
;
boolean
implement
=
true
;
//逻辑
//逻辑
if
(
implement
)
{
if
(
implement
)
{
log
.
info
(
"AttendanceTask考勤数据统计开始"
);
Calendar
c
=
Calendar
.
getInstance
();
Calendar
c
=
Calendar
.
getInstance
();
c
.
add
(
Calendar
.
MONTH
,
0
);
c
.
add
(
Calendar
.
MONTH
,
0
);
c
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
//设置为1号,当前日期既为本月第一天
c
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
//设置为1号,当前日期既为本月第一天
...
...
src/main/java/cn/timer/api/controller/kqgl/atttimer/LastMonthtimingExport.java
View file @
d3b83848
...
@@ -10,7 +10,10 @@ import java.util.Date;
...
@@ -10,7 +10,10 @@ import java.util.Date;
import
java.util.List
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.Locale
;
import
cn.timer.api.config.schedule.SchedulerCondition
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Conditional
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
...
@@ -59,8 +62,9 @@ import cn.timer.api.utils.DateUtil;
...
@@ -59,8 +62,9 @@ import cn.timer.api.utils.DateUtil;
/**
/**
* @author Yl123 上月数据
* @author Yl123 上月数据
*/
*/
@Slf4j
@Configuration
//1.主要用于标记配置类,兼备Component的效果。
@Configuration
//1.主要用于标记配置类,兼备Component的效果。
@EnableScheduling
// 2.开启定时任务
//@Conditional(SchedulerCondition.class) //定时器开关
public
class
LastMonthtimingExport
{
public
class
LastMonthtimingExport
{
@Autowired
@Autowired
private
KqglMainKqzMapper
kqglmainkqzmapper
;
private
KqglMainKqzMapper
kqglmainkqzmapper
;
...
@@ -89,12 +93,13 @@ public class LastMonthtimingExport {
...
@@ -89,12 +93,13 @@ public class LastMonthtimingExport {
private
static
String
lastDay
;
private
static
String
lastDay
;
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
@Conditional
(
SchedulerCondition
.
class
)
//定时器开关
// @Scheduled(cron = "0 55 11 * * ?")
// @Scheduled(cron = "0 55 11 * * ?")
@Scheduled
(
cron
=
"0 0 4,20 * * ?"
)
//每天上午4点,下午20点 执行
@Scheduled
(
cron
=
"0 0 4,20 * * ?"
)
//每天上午4点,下午20点 执行
public
void
LastMonthtimingAttendanceTask
()
throws
ParseException
{
public
void
LastMonthtimingAttendanceTask
()
throws
ParseException
{
log
.
info
(
"=======================================上月数据定时任务开始======================================="
);
//获取前月的最后一天
//获取前月的最后一天
Calendar
cale
=
Calendar
.
getInstance
();
Calendar
cale
=
Calendar
.
getInstance
();
cale
.
set
(
Calendar
.
DAY_OF_MONTH
,
0
);
//设置为1号,当前日期既为本月第一天
cale
.
set
(
Calendar
.
DAY_OF_MONTH
,
0
);
//设置为1号,当前日期既为本月第一天
...
...
src/main/java/cn/timer/api/controller/xcgl/atttimer/SalaryTaskTiming.java
View file @
d3b83848
...
@@ -13,9 +13,12 @@ import java.util.Locale;
...
@@ -13,9 +13,12 @@ import java.util.Locale;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.timer.api.bean.xcgl.XcglAssoXzdadx
;
import
cn.timer.api.bean.xcgl.XcglAssoXzdadx
;
import
cn.timer.api.bean.xcgl.XcglAssoXzdaz
;
import
cn.timer.api.bean.xcgl.XcglAssoXzdaz
;
import
cn.timer.api.config.schedule.SchedulerCondition
;
import
cn.timer.api.dao.xcgl.XcglAssoXzdadxMapper
;
import
cn.timer.api.dao.xcgl.XcglAssoXzdadxMapper
;
import
com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper
;
import
com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Conditional
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
...
@@ -65,16 +68,18 @@ import javax.annotation.Resource;
...
@@ -65,16 +68,18 @@ import javax.annotation.Resource;
*/
*/
//@Component
//@Component
//@Lazy
//@Lazy
@Slf4j
@Configuration
//1.主要用于标记配置类,兼备Component的效果。
@Configuration
//1.主要用于标记配置类,兼备Component的效果。
@EnableScheduling
// 2.开启定时任务
//
@EnableScheduling // 2.开启定时任务
public
class
SalaryTaskTiming
{
public
class
SalaryTaskTiming
{
// 薪酬管理-定薪
// 薪酬管理-定薪
@Resource
@Resource
private
XcglAssoXzdadxMapper
xcglassoxzdadxmapper
;
private
XcglAssoXzdadxMapper
xcglassoxzdadxmapper
;
//3.添加定时任务 每天凌晨1点执行一次
@Conditional
(
SchedulerCondition
.
class
)
//定时器开关
@Scheduled
(
cron
=
"0 0 1 * * ?"
)
@Scheduled
(
cron
=
"0 0 1 * * ?"
)
//3.添加定时任务 每天凌晨1点执行一次
public
void
AttendanceTask
()
throws
ParseException
{
public
void
AttendanceTask
()
throws
ParseException
{
log
.
info
(
"调薪记录生效定时任务"
);
// 使用状态(0:使用中;1:历史, 2: 未生效)
// 使用状态(0:使用中;1:历史, 2: 未生效)
// 当前日期
// 当前日期
String
curDate
=
DateUtil
.
getStringFormat
(
new
Date
().
getTime
());
String
curDate
=
DateUtil
.
getStringFormat
(
new
Date
().
getTime
());
...
...
src/main/resources/application-pro.yml
View file @
d3b83848
...
@@ -101,7 +101,7 @@ spring:
...
@@ -101,7 +101,7 @@ spring:
protocol
:
smtp
protocol
:
smtp
host
:
smtp.163.com
host
:
smtp.163.com
username
:
youlingrc123@163.com
username
:
youlingrc123@163.com
password
:
RIMBNJJQNKYNVUWL
password
:
youlingrc189
default-encoding
:
utf-8
default-encoding
:
utf-8
properties
:
properties
:
mail
:
mail
:
...
@@ -164,8 +164,8 @@ pagehelper:
...
@@ -164,8 +164,8 @@ pagehelper:
#showSql
#showSql
logging
:
logging
:
level
:
level
:
root
:
ERROR
root
:
INFO
cn.timer.api.dao
:
error
cn.timer.api.dao
:
info
pattern
:
pattern
:
console
:
'
--%p--%m%n'
console
:
'
--%p--%m%n'
...
...
src/main/resources/application.yml
View file @
d3b83848
spring
:
spring
:
profiles
:
profiles
:
active
:
dev
active
:
pro
#active: '@environment@'
#active: '@environment@'
enable
:
scheduling
:
false
src/main/resources/config/cron.setting
View file @
d3b83848
# 我是合同证照
# 我是合同证照
[cn.timer.api.utils]
[cn.timer.api.utils]
TimerUtil.start = 0/10 0 0 0 0 1/5
TimerUtil.start = 0/10 0 0 0 0 1/5
src/main/resources/logback-spring.xml
View file @
d3b83848
...
@@ -69,7 +69,7 @@
...
@@ -69,7 +69,7 @@
<!--用来指定日志文件的上限大小,那么到了这个值,就会删除旧的日志 -->
<!--用来指定日志文件的上限大小,那么到了这个值,就会删除旧的日志 -->
<!--<totalSizeCap>1GB</totalSizeCap> -->
<!--<totalSizeCap>1GB</totalSizeCap> -->
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
10
0
MB
</maxFileSize>
<maxFileSize>
10
24
MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
</rollingPolicy>
<!--日志输出编码格式化 -->
<!--日志输出编码格式化 -->
...
...
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