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
e09e731d
Commit
e09e731d
authored
Jun 19, 2020
by
邓实川
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
http://develop-gitlab.youlingrc.com/8timerv2/8timerapiv200.git
into dsc
parents
b8cbcc65
afdbae5d
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
264 additions
and
158 deletions
+264
-158
src/main/java/cn/timer/api/controller/LoginController.java
+30
-0
src/main/java/cn/timer/api/controller/kqgl/ClockInController.java
+144
-142
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
+54
-15
src/main/java/cn/timer/api/controller/kqgl/atttimer/AttendanceTaskTiming.java
+1
-1
src/main/java/cn/timer/api/dao/kqmk/KqglAssoLeaveBalanceMapper.java
+2
-0
src/main/java/cn/timer/api/dao/kqmk/KqglAssoLeaveRulesMapper.java
+4
-0
src/main/java/cn/timer/api/dto/kqmk/EmployeeLeaveBalanceDto.java
+5
-0
src/main/resources/mapping/kqmk/KqglAssoLeaveBalanceMapper.xml
+10
-0
src/main/resources/mapping/kqmk/KqglAssoLeaveRulesMapper.xml
+14
-0
No files found.
src/main/java/cn/timer/api/controller/LoginController.java
View file @
e09e731d
...
...
@@ -32,6 +32,7 @@ import cn.hutool.core.date.DateUtil;
import
cn.hutool.core.util.StrUtil
;
import
cn.timer.api.aspect.lang.annotation.Log
;
import
cn.timer.api.aspect.lang.enums.BusinessType
;
import
cn.timer.api.bean.kqmk.KqglAssoLeaveRules
;
import
cn.timer.api.bean.qyzx.QyzxEmpEntAsso
;
import
cn.timer.api.bean.qyzx.QyzxEmpLogin
;
import
cn.timer.api.bean.qyzx.QyzxEntInfoM
;
...
...
@@ -48,6 +49,7 @@ import cn.timer.api.config.enuminterface.YgEnumInterface.YgJobType;
import
cn.timer.api.config.enums.CommonEnum
;
import
cn.timer.api.config.enums.SysRoleType
;
import
cn.timer.api.controller.spmk.service.SpmkServiceImpl
;
import
cn.timer.api.dao.kqmk.KqglAssoLeaveRulesMapper
;
import
cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper
;
import
cn.timer.api.dao.qyzx.QyzxEmpLoginMapper
;
import
cn.timer.api.dao.yggl.YgglMainEmpMapper
;
...
...
@@ -457,6 +459,9 @@ public class LoginController {
@Autowired
SpmkServiceImpl
SpmkService
;
@Autowired
private
KqglAssoLeaveRulesMapper
kqglassoleaverulesmapper
;
/**
* 注册企业
...
...
@@ -541,6 +546,31 @@ public class LoginController {
QyzxAuthAccount
.
builder
().
createdTime
(
new
Date
()).
maxChildAccount
(
maxChildAccount
).
name
(
username
)
.
accountPhone
(
phone
).
empNum
(
login
.
getId
()).
orgCode
(
qyzxEntInfoM
.
getId
()).
build
().
insert
();
// TODO
// 主账号权限表
//*****************************考勤假期初始化
//获取模板数据
List
<
KqglAssoLeaveRules
>
ruless
=
new
LambdaQueryChainWrapper
<
KqglAssoLeaveRules
>(
kqglassoleaverulesmapper
).
eq
(
KqglAssoLeaveRules:
:
getOrgCode
,
0
).
list
();
//查询当前公司是否已初始化
KqglAssoLeaveRules
rule
=
kqglassoleaverulesmapper
.
selectOne
(
new
QueryWrapper
<
KqglAssoLeaveRules
>().
lambda
().
eq
(
KqglAssoLeaveRules:
:
getOrgCode
,
qyzxEntInfoM
.
getId
())
.
eq
(
KqglAssoLeaveRules:
:
getLeaveType
,
1
).
last
(
"LIMIT 1"
));
if
(
rule
==
null
)
{
List
<
KqglAssoLeaveRules
>
rullist
=
new
ArrayList
<
KqglAssoLeaveRules
>();
for
(
KqglAssoLeaveRules
rul
:
ruless
){
KqglAssoLeaveRules
vice
=
KqglAssoLeaveRules
.
builder
().
name
(
rul
.
getName
()).
company
(
rul
.
getCompany
()).
leaveType
(
rul
.
getLeaveType
())
.
apply
(
rul
.
getApply
()).
createTime
(
new
Date
().
getTime
()).
createUserid
(
999
).
orgCode
(
qyzxEntInfoM
.
getId
())
.
isOpen
(
rul
.
getIsOpen
()).
leaveBalance
(
rul
.
getLeaveBalance
()).
rulesType
(
rul
.
getRulesType
()).
build
();
rullist
.
add
(
vice
);
}
if
(
rullist
.
size
()
>
0
)
{
kqglassoleaverulesmapper
.
insertleaverulesList
(
rullist
);
}
System
.
out
.
println
(
"操作成功!"
);
}
else
{
System
.
out
.
println
(
"重复初始化数据!"
);
}
return
ResultUtil
.
success
(
"注册企业成功"
);
}
catch
(
Exception
e
)
{
...
...
src/main/java/cn/timer/api/controller/kqgl/ClockInController.java
View file @
e09e731d
...
...
@@ -122,12 +122,14 @@ public class ClockInController {
int
shifid
=
0
;
long
punchcardtime
=
0
,
punchstart
=
0
,
punchend
=
0
;
//应打卡时间,应打卡开始时间,应打卡结束时间
boolean
isRange
=
true
;
boolean
isRange
=
true
;
//是否在打卡时间范围内
int
atttype
=
0
;
int
execution_status
=
0
;
//执行状态
boolean
kskd
=
true
;
//识别是否更新最后一次打卡
boolean
kskd
=
true
;
//识别是否更新最后一次打卡 针对于最后一次下班卡
boolean
sbdkkd
=
false
;
//针对于上班 未超过上班卡打卡 视为无效打卡
ClockCollectData
clockt
=
new
ClockCollectData
();
...
...
@@ -269,104 +271,144 @@ public class ClockInController {
Map
<
String
,
Integer
>
comparemap
=
new
HashMap
();
if
(
dkmc
==
null
)
{
kskd
=
false
;
//打卡时间 对比班次 接近哪个时间就打哪个时间的卡
if
(
attdate
.
getAttsch
().
size
()
==
2
||
attdate
.
getAttsch
().
size
()
==
4
||
attdate
.
getAttsch
().
size
()
==
6
)
{
comparemap
.
put
(
"1"
,
dakjg1
);
comparemap
.
put
(
"2"
,
dakjg2
);
}
if
(
attdate
.
getAttsch
().
size
()
==
4
||
attdate
.
getAttsch
().
size
()
==
6
)
{
comparemap
.
put
(
"3"
,
dakjg3
);
comparemap
.
put
(
"4"
,
dakjg4
);
}
if
(
attdate
.
getAttsch
().
size
()
==
6
)
{
comparemap
.
put
(
"5"
,
dakjg5
);
comparemap
.
put
(
"6"
,
dakjg6
);
if
(
attdate
.
getAttsch
().
size
()
==
2
)
{
//一套上下班 上班1
atttype
=
1
;
}
else
{
//打卡时间 对比班次 接近哪个时间就打哪个时间的卡
if
(
attdate
.
getAttsch
().
size
()
==
4
||
attdate
.
getAttsch
().
size
()
==
6
)
{
//punchstart 应打卡开始时间 punchend:应打卡结束时间 time_:打卡时间
boolean
effectiveDate1
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
starttime1ks
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
starttime1js
),
"HH:mm"
);
if
(
effectiveDate1
)
{
//在范围内就打卡
atttype
=
1
;
}
else
{
isRange
=
false
;
}
boolean
effectiveDate2
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
endtime1ks
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
endtime1js
),
"HH:mm"
);
if
(
effectiveDate2
)
{
//在范围内就打卡
atttype
=
2
;
}
else
{
isRange
=
false
;
}
boolean
effectiveDate3
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
starttime2ks
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
starttime2js
),
"HH:mm"
);
if
(
effectiveDate3
)
{
//在范围内就打卡
atttype
=
3
;
}
else
{
isRange
=
false
;
}
boolean
effectiveDate4
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
endtime2ks
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
endtime2js
),
"HH:mm"
);
if
(
effectiveDate4
)
{
//在范围内就打卡
atttype
=
4
;
}
else
{
isRange
=
false
;
}
}
if
(
attdate
.
getAttsch
().
size
()
==
6
)
{
boolean
effectiveDate5
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
starttime3ks
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
starttime3js
),
"HH:mm"
);
if
(
effectiveDate5
)
{
//在范围内就打卡
atttype
=
5
;
}
else
{
isRange
=
false
;
}
boolean
effectiveDate6
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
endtime3ks
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
endtime3js
),
"HH:mm"
);
if
(
effectiveDate6
)
{
//在范围内就打卡
atttype
=
6
;
}
else
{
isRange
=
false
;
}
}
}
execution_status
=
1
;
}
else
{
execution_status
=
2
;
// boolean kskd = true;
if
(
attdate
.
getAttsch
().
size
()
==
2
)
{
if
(
dkmc
.
getSbdk1
()
!=
null
)
{
kskd
=
false
;
comparemap
.
clear
();
comparemap
.
put
(
"2"
,
dakjg2
);
}
//最后一次卡的时候 再继续打视为更新最后一次打卡
if
(
dkmc
.
getXbdk1
()
!=
null
)
{
kskd
=
true
;
comparemap
.
put
(
"2"
,
dakjg2
);
}
if
(
attdate
.
getAttsch
().
size
()
==
2
)
{
//下班1
if
(
dkmc
.
getSbdk1
()
!=
null
&&
dkmc
.
getXbdk1
()
==
null
){
//如果第二次后打卡,未超过上班时间 即为打卡失效
Date
sd1
=
df1
.
parse
(
ClockInTool
.
stampToDate
(
String
.
valueOf
(
starttime1
)));
//应打卡时间
Date
sd2
=
df1
.
parse
(
sStdIoTime
);
//打卡时间
if
(
sd1
.
after
(
sd2
))
{
sbdkkd
=
true
;
//
atttype
=
1
;
}
else
{
kskd
=
false
;
atttype
=
2
;
}
}
else
{
//最后一次卡的时候 再继续打视为更新最后一次打卡
kskd
=
true
;
atttype
=
2
;
}
}
if
(
attdate
.
getAttsch
().
size
()
==
4
)
{
if
(
dkmc
.
getSbdk1
()
!=
null
)
{
kskd
=
false
;
comparemap
.
clear
();
comparemap
.
put
(
"2"
,
dakjg2
);
comparemap
.
put
(
"3"
,
dakjg3
);
comparemap
.
put
(
"4"
,
dakjg4
);
}
if
(
dkmc
.
getXbdk1
()
!=
null
)
{
kskd
=
false
;
comparemap
.
clear
();
comparemap
.
put
(
"3"
,
dakjg3
);
comparemap
.
put
(
"4"
,
dakjg4
);
}
if
(
dkmc
.
getSbdk2
()
!=
null
)
{
kskd
=
false
;
comparemap
.
clear
();
comparemap
.
put
(
"4"
,
dakjg4
);
}
//最后一次卡的时候 再继续打视为更新最后一次打卡
if
(
dkmc
.
getXbdk2
()
!=
null
)
{
kskd
=
true
;
comparemap
.
clear
();
comparemap
.
put
(
"4"
,
dakjg4
);
}
if
(
attdate
.
getAttsch
().
size
()
==
4
||
attdate
.
getAttsch
().
size
()
==
6
)
{
boolean
effectiveDate1
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
starttime1ks
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
starttime1js
),
"HH:mm"
);
if
(
effectiveDate1
)
{
//在范围内就打卡
if
(
dkmc
.
getSbdk1
()
!=
null
)
{
sbdkkd
=
true
;
//
}
else
{
atttype
=
1
;
}
}
else
{
isRange
=
false
;
}
boolean
effectiveDate2
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
endtime1ks
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
endtime1js
),
"HH:mm"
);
if
(
effectiveDate2
)
{
//在范围内就打卡
if
(
dkmc
.
getXbdk1
()
!=
null
)
{
kskd
=
true
;
}
else
{
kskd
=
false
;
atttype
=
2
;
}
}
else
{
isRange
=
false
;
}
boolean
effectiveDate3
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
starttime2ks
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
starttime2js
),
"HH:mm"
);
if
(
effectiveDate3
)
{
//在范围内就打卡
if
(
dkmc
.
getSbdk2
()
!=
null
)
{
sbdkkd
=
true
;
//
}
else
{
atttype
=
3
;
}
}
else
{
isRange
=
false
;
}
boolean
effectiveDate4
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
endtime2ks
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
endtime2js
),
"HH:mm"
);
if
(
effectiveDate4
)
{
//在范围内就打卡
if
(
dkmc
.
getXbdk2
()
!=
null
)
{
kskd
=
true
;
}
else
{
kskd
=
false
;
atttype
=
4
;
}
}
else
{
isRange
=
false
;
}
}
if
(
attdate
.
getAttsch
().
size
()
==
6
)
{
if
(
dkmc
.
getSbdk1
()
!=
null
)
{
kskd
=
false
;
comparemap
.
clear
();
comparemap
.
put
(
"2"
,
dakjg2
);
comparemap
.
put
(
"3"
,
dakjg3
);
comparemap
.
put
(
"4"
,
dakjg4
);
comparemap
.
put
(
"5"
,
dakjg5
);
comparemap
.
put
(
"6"
,
dakjg6
);
}
if
(
dkmc
.
getXbdk1
()
!=
null
)
{
kskd
=
false
;
comparemap
.
clear
();
comparemap
.
put
(
"3"
,
dakjg3
);
comparemap
.
put
(
"4"
,
dakjg4
);
comparemap
.
put
(
"5"
,
dakjg5
);
comparemap
.
put
(
"6"
,
dakjg6
);
}
if
(
dkmc
.
getSbdk2
()
!=
null
)
{
kskd
=
false
;
comparemap
.
clear
();
comparemap
.
put
(
"4"
,
dakjg4
);
comparemap
.
put
(
"5"
,
dakjg5
);
comparemap
.
put
(
"6"
,
dakjg6
);
}
if
(
dkmc
.
getXbdk2
()
!=
null
)
{
kskd
=
false
;
comparemap
.
clear
();
comparemap
.
put
(
"5"
,
dakjg5
);
comparemap
.
put
(
"6"
,
dakjg6
);
}
if
(
dkmc
.
getSbdk3
()
!=
null
)
{
kskd
=
false
;
comparemap
.
clear
();
comparemap
.
put
(
"6"
,
dakjg6
);
}
//最后一次卡的时候 再继续打视为更新最后一次打卡
if
(
dkmc
.
getXbdk3
()
!=
null
)
{
kskd
=
true
;
comparemap
.
clear
();
comparemap
.
put
(
"6"
,
dakjg6
);
}
// if(kskd) {
// comparemap.put("6", dakjg6);
// }
boolean
effectiveDate5
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
starttime3ks
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
starttime3js
),
"HH:mm"
);
if
(
effectiveDate5
)
{
//在范围内就打卡
if
(
dkmc
.
getSbdk2
()
!=
null
)
{
sbdkkd
=
true
;
//
}
else
{
atttype
=
5
;
}
}
else
{
isRange
=
false
;
}
boolean
effectiveDate6
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
endtime3ks
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
endtime3js
),
"HH:mm"
);
if
(
effectiveDate6
)
{
//在范围内就打卡
if
(
dkmc
.
getXbdk2
()
!=
null
)
{
kskd
=
true
;
}
else
{
kskd
=
false
;
atttype
=
6
;
}
}
else
{
isRange
=
false
;
}
}
}
if
(
comparemap
.
size
()
>
0
)
{
List
<
Map
.
Entry
<
String
,
Integer
>>
list
=
new
ArrayList
(
comparemap
.
entrySet
());
Collections
.
sort
(
list
,
(
o1
,
o2
)
->
(
o1
.
getValue
()
-
o2
.
getValue
()));
atttype
=
Integer
.
valueOf
(
list
.
get
(
0
).
getKey
());
//应打卡的顺序
}
}
...
...
@@ -397,54 +439,6 @@ public class ClockInController {
}
// long punchcardtime,punchstart,punchend = 0;//应打卡时间,应打卡开始时间,应打卡结束时间
// int atttype = 0;
// if(dkmc == null) {//上班1 ****新增
// punchcardtime = starttime1;
// punchstart = starttime1ks;
// punchend = starttime1js;
// atttype = 1;
// }else {
// if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() == null)){ //下班1
// punchcardtime = endtime1;
// punchstart = endtime1ks;
// punchend = endtime1js;
// atttype = 2;
// }else if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (!("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() != null)
// && (("").equals(dkmc.getSbdk2()) || dkmc.getSbdk2() == null)){ //上班2
// punchcardtime = starttime2;
// punchstart = starttime2ks;
// punchend = starttime2js;
// atttype = 3;
// }else if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (!("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() != null)
// && (!("").equals(dkmc.getSbdk2()) || dkmc.getSbdk2() != null) && (("").equals(dkmc.getXbdk2()) || dkmc.getXbdk2() == null)){ //下班2
// punchcardtime = endtime2;
// punchstart = endtime2ks;
// punchend = endtime2js;
// atttype = 4;
// }else if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (!("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() != null)
// && (!("").equals(dkmc.getSbdk2()) || dkmc.getSbdk2() != null) && (!("").equals(dkmc.getXbdk2()) || dkmc.getXbdk2() != null)
// && (("").equals(dkmc.getSbdk3()) || dkmc.getSbdk3() == null)){ //上班3
// punchcardtime = starttime3;
// punchstart = starttime3ks;
// punchend = starttime3js;
// atttype = 5;
// }else if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (!("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() != null)
// && (!("").equals(dkmc.getSbdk2()) || dkmc.getSbdk2() != null) && (!("").equals(dkmc.getXbdk2()) || dkmc.getXbdk2() != null)
// && (!("").equals(dkmc.getSbdk3()) || dkmc.getSbdk3() != null) && (("").equals(dkmc.getXbdk3()) || dkmc.getXbdk3() == null)){ //下班3
// punchcardtime = endtime3;
// punchstart = endtime3ks;
// punchend = endtime3js;
// atttype = 6;
// }else {
// punchcardtime = 0;punchstart = 0;punchend = 0;atttype = 7;
// }
// }
if
(
clockt
.
getShifid
()
!=
0
)
{
KqglAssoBcsz
shif
=
KqglAssoBcsz
.
builder
().
build
();
...
...
@@ -453,8 +447,9 @@ public class ClockInController {
}
//打卡记录录入 -- 打卡是否有时间范围限制
// boolean isRange = true;
if
(
punchstart
>
0
&&
punchend
>
0
)
{
// boolean isRange = true;
if
(
attdate
.
getAttsch
().
size
()
==
2
)
{
if
(
punchstart
>
0
&&
punchend
>
0
)
{
String
staputime
=
new
SimpleDateFormat
(
"HH:mm"
).
format
(
punchstart
);
//应打卡开始时间
String
entputime
=
new
SimpleDateFormat
(
"HH:mm"
).
format
(
punchend
);
//应打卡结束时间
String
DKputime
=
new
SimpleDateFormat
(
"HH:mm"
).
format
(
time_
);
//打卡时间
...
...
@@ -466,6 +461,8 @@ public class ClockInController {
// throw new Exception();
}
}
}
if
(
isRange
)
{
int
yzcd
=
shif
.
getYzcdfzs
();
//严重迟到分钟数
int
kgcdfzs
=
shif
.
getKgcdfzs
();
//旷工迟到分钟数
...
...
@@ -626,7 +623,7 @@ public class ClockInController {
}
pcd
.
setId
(
dkmc
.
getId
());
if
(
atttype
<=
6
&&
atttype
>
0
){
if
(
atttype
<=
6
&&
atttype
>
0
&&
!
sbdkkd
){
int
update
=
kqglassodkmxmapper
.
updateByPrimaryKeySelective
(
pcd
);
//修改打卡记录
}
}
...
...
@@ -782,7 +779,7 @@ public class ClockInController {
String
attdate_
=
new
SimpleDateFormat
(
"yy-MM-dd"
).
format
(
Double
.
valueOf
(
attendance_date
));
//转换打卡时间格式
//true:确认为最后一次打卡更新打卡时 之前打卡的一条数据变为“打卡更新数据”
if
(
kskd
)
{
if
(
kskd
&&
(
atttype
==
2
||
atttype
==
4
||
atttype
==
6
)
)
{
KqglAssoDkjl
dkjj
=
KqglAssoDkjl
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoDkjl
>().
lambda
().
eq
(
KqglAssoDkjl:
:
getUserId
,
userid
).
eq
(
KqglAssoDkjl:
:
getType
,
2
)
.
eq
(
KqglAssoDkjl:
:
getSort
,
atttype
).
eq
(
KqglAssoDkjl:
:
getQyid
,
qyid
).
eq
(
KqglAssoDkjl:
:
getAttdate
,
attdate_
+
" "
+
ClockInTool
.
dateToWeek2
(
toweek
)));
...
...
@@ -864,6 +861,11 @@ public class ClockInController {
}
}
//第二次未超过应上班打卡时间 打卡为无效
if
(
sbdkkd
)
{
status
=
0
;
atttype
=
0
;
}
long
attime
;
// if(punchcardtime == 0 && !isRange){attime = new Date().getTime();}else{attime = punchcardtime;}// 考勤时间(应打卡时间)
...
...
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
View file @
e09e731d
...
...
@@ -343,13 +343,18 @@ public class TimeCardController {
StartTimeRestDto
[]
rest
=
overrules
.
getStarttime
();
if
(
rest
!=
null
&&
rest
.
length
>
0
){
for
(
int
p
=
0
;
p
<
rest
.
length
;
p
++){
KqglAssOvertimeVice
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssOvertimeVice
>().
lambda
().
eq
(
KqglAssOvertimeVice:
:
getOvertimeRulesId
,
id
));
KqglAssOvertimeVice
vice
=
new
KqglAssOvertimeVice
();
vice
.
setOvertimeRulesId
(
id
);
vice
.
setBreakStartTime
(
rest
[
p
].
getStarttime
());
vice
.
setBreakEndTime
(
rest
[
p
].
getEndtime
());
vice
.
setOverType
(
rest
[
p
].
getOvertype
());
overtimes
.
add
(
vice
);
if
(
rest
[
p
].
getStarttime
()
!=
null
)
{
KqglAssOvertimeVice
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssOvertimeVice
>().
lambda
().
eq
(
KqglAssOvertimeVice:
:
getOvertimeRulesId
,
id
));
KqglAssOvertimeVice
vice
=
new
KqglAssOvertimeVice
();
vice
.
setOvertimeRulesId
(
id
);
vice
.
setBreakStartTime
(
rest
[
p
].
getStarttime
());
vice
.
setBreakEndTime
(
rest
[
p
].
getEndtime
());
vice
.
setOverType
(
rest
[
p
].
getOvertype
());
overtimes
.
add
(
vice
);
}
else
{
break
;
}
}
}
if
(
overtimes
.
size
()>
0
){
...
...
@@ -481,7 +486,7 @@ public class TimeCardController {
}
}
else
{
for
(
YgglMainEmp
ye:
yggl
)
{
KqglAssoLeaveBalance
.
builder
().
leaveRulesId
(
id
).
userid
(
ye
.
getEmpNum
()).
modifyAction
(
1
).
balanceDays
(
"-1
-1
"
)
KqglAssoLeaveBalance
.
builder
().
leaveRulesId
(
id
).
userid
(
ye
.
getEmpNum
()).
modifyAction
(
1
).
balanceDays
(
"-1"
)
.
reason
(
"不限制余额"
).
modifyUserid
(
userBean
.
getEmpNum
()).
modifyTimer
(
new
Date
().
getTime
()).
orgCode
(
userBean
.
getOrgCode
()).
isAutomatic
(
1
).
modifyNumber
(
1
).
build
().
insert
();
//员工假期余额
}
}
...
...
@@ -852,6 +857,17 @@ public class TimeCardController {
}
/**
* 根据考勤余额id获取信息
*/
@GetMapping
(
value
=
"/hqleavebalance/{id}"
)
@ApiOperation
(
value
=
"获取班次信息-根据班次id"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
hqleavebalance
(
@PathVariable
(
"id"
)
Integer
id
,
@CurrentUser
UserBean
userBean
)
{
EmployeeLeaveBalanceDto
leanemp
=
kqglassoleavebalancemapper
.
selectleavebalanceList
(
id
,
userBean
.
getEmpNum
());
return
ResultUtil
.
data
(
leanemp
,
"操作成功!"
);
}
/**
* 根据 组织机构代码获取员工假期余额表头
*/
@GetMapping
(
value
=
"/balance_header"
)
...
...
@@ -871,15 +887,38 @@ public class TimeCardController {
@ApiOperation
(
value
=
"30: 查询列表-假期规则"
,
httpMethod
=
"GET"
,
notes
=
" 查询列表-假期规则"
)
@ApiOperationSupport
(
order
=
30
)
public
Result
<
Object
>
selectListLeaveRules
(
@CurrentUser
UserBean
userBean
)
{
List
<
KqglAssoLeaveRules
>
balheas
=
new
LambdaQueryChainWrapper
<
KqglAssoLeaveRules
>(
kqglassoleaverulesmapper
).
eq
(
KqglAssoLeaveRules
::
getOrgCode
,
userBean
.
getOrgCode
())
.
eq
(
KqglAssoLeaveRules
::
getLeaveType
,
2
).
or
().
eq
(
KqglAssoLeaveRules
::
getIsOpen
,
1
).
list
();
//
List<KqglAssoLeaveRules> balheas = new LambdaQueryChainWrapper<KqglAssoLeaveRules>(kqglassoleaverulesmapper).eq(KqglAssoLeaveRules :: getOrgCode,userBean.getOrgCode())
//
.eq(KqglAssoLeaveRules :: getLeaveType, 2).or().eq(KqglAssoLeaveRules :: getIsOpen, 1).list();
List
<
LeaveTypeDto
>
leas
=
new
ArrayList
<
LeaveTypeDto
>();
for
(
KqglAssoLeaveRules
rul
:
balheas
)
{
LeaveTypeDto
lea
=
LeaveTypeDto
.
builder
().
build
();
lea
.
setId
(
rul
.
getId
());
lea
.
setValue
(
rul
.
getName
());
leas
.
add
(
lea
);
KqglAssoYhkqz
yhd
=
KqglAssoYhkqz
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoYhkqz
>().
lambda
().
eq
(
KqglAssoYhkqz:
:
getUserid
,
userBean
.
getEmpNum
()).
eq
(
KqglAssoYhkqz:
:
getQyid
,
userBean
.
getOrgCode
()));
if
(
yhd
!=
null
)
{
//获取假期适用全公司的
List
<
KqglAssoLeaveRules
>
whole
=
kqglassoleaverulesmapper
.
selCompanywidedata
(
userBean
.
getOrgCode
(),
2
,
1
);
for
(
KqglAssoLeaveRules
rul
:
whole
)
{
LeaveTypeDto
lea
=
LeaveTypeDto
.
builder
().
build
();
lea
.
setId
(
rul
.
getId
());
lea
.
setValue
(
rul
.
getName
());
leas
.
add
(
lea
);
}
List
<
KqglAssoLeaveRules
>
assholi
=
kqglassoleaverulesmapper
.
AssociatedHolidays
(
yhd
.
getKqzid
());
for
(
KqglAssoLeaveRules
rul1
:
assholi
)
{
LeaveTypeDto
lea
=
LeaveTypeDto
.
builder
().
build
();
lea
.
setId
(
rul1
.
getId
());
lea
.
setValue
(
rul1
.
getName
());
leas
.
add
(
lea
);
}
}
// List<KqglAssoLeaveRules> balheas = kqglassoleaverulesmapper.selHeaderdata(userBean.getOrgCode(), 2, 1);
// List<LeaveTypeDto> leas = new ArrayList<LeaveTypeDto>();
// for(KqglAssoLeaveRules rul : balheas) {
// LeaveTypeDto lea = LeaveTypeDto.builder().build();
// lea.setId(rul.getId());
// lea.setValue(rul.getName());
// leas.add(lea);
// }
return
ResultUtil
.
data
(
leas
,
"操作成功!"
);
}
...
...
src/main/java/cn/timer/api/controller/kqgl/atttimer/AttendanceTaskTiming.java
View file @
e09e731d
...
...
@@ -105,7 +105,7 @@ public class AttendanceTaskTiming{
*/
//3.添加定时任务 每天下午七点执行一次
@Scheduled
(
cron
=
"0 0 19 * * ?"
)
//
@Scheduled(cron = "0 0 19 * * ?")
//或直接指定时间间隔,例如:5秒
//@Scheduled(fixedRate=5000)
...
...
src/main/java/cn/timer/api/dao/kqmk/KqglAssoLeaveBalanceMapper.java
View file @
e09e731d
...
...
@@ -26,4 +26,6 @@ public interface KqglAssoLeaveBalanceMapper extends BaseMapper<KqglAssoLeaveBala
AdditionalDto
selectAdditional
(
int
orgcode
,
int
empnum
);
List
<
AdditionalDto
>
selectAdditionalList
(
int
orgcode
);
EmployeeLeaveBalanceDto
selectleavebalanceList
(
int
leaverulesid
,
int
userid
);
}
src/main/java/cn/timer/api/dao/kqmk/KqglAssoLeaveRulesMapper.java
View file @
e09e731d
...
...
@@ -19,4 +19,8 @@ public interface KqglAssoLeaveRulesMapper extends BaseMapper<KqglAssoLeaveRules>
int
insertleaverulesList
(
List
<
KqglAssoLeaveRules
>
kqglassoleaverules
);
List
<
KqglAssoLeaveRules
>
selHeaderdata
(
int
orgcode
,
int
leavetype
,
int
isopen
);
List
<
KqglAssoLeaveRules
>
selCompanywidedata
(
int
orgcode
,
int
leavetype
,
int
isopen
);
List
<
KqglAssoLeaveRules
>
AssociatedHolidays
(
int
attgroupid
);
}
src/main/java/cn/timer/api/dto/kqmk/EmployeeLeaveBalanceDto.java
View file @
e09e731d
...
...
@@ -25,6 +25,11 @@ public class EmployeeLeaveBalanceDto {
@ApiModelProperty
(
value
=
"入职日期 "
,
example
=
"字段说明"
)
private
String
rztime
;
@ApiModelProperty
(
value
=
" "
,
example
=
"字段说明"
)
private
String
userid
;
@ApiModelProperty
(
value
=
" "
,
example
=
"字段说明"
)
private
String
balancedays
;
@ApiModelProperty
(
value
=
"表数据"
,
example
=
"字段说明"
)
List
<
BalanceSheetDataDto
>
balanceTo
;
...
...
src/main/resources/mapping/kqmk/KqglAssoLeaveBalanceMapper.xml
View file @
e09e731d
...
...
@@ -22,6 +22,8 @@
<result
column=
"empname"
property=
"empname"
/>
<result
column=
"department"
property=
"department"
/>
<result
column=
"rztime"
property=
"rztime"
/>
<result
column=
"userid"
property=
"userid"
/>
<result
column=
"balancedays"
property=
"balancedays"
/>
<collection
property=
"balanceTo"
ofType=
"cn.timer.api.dto.kqmk.BalanceSheetDataDto"
>
<result
column=
"leaverulesid"
property=
"leaverulesid"
/>
<result
column=
"balancedays"
property=
"balancedays"
/>
...
...
@@ -113,6 +115,14 @@
where emp.org_code = #{orgcode}
and emp.job_status in (0,1)
</select>
<select
id=
"selectleavebalanceList"
resultMap=
"LeaveBalanceMap"
>
select bal.userid,SUM(bal.balance_days) as balancedays
from kqgl_asso_leave_balance bal
where bal.leave_rules_id = #{leaverulesid} and bal.userid = #{userid}
GROUP BY bal.userid
</select>
<!--
...
...
src/main/resources/mapping/kqmk/KqglAssoLeaveRulesMapper.xml
View file @
e09e731d
...
...
@@ -50,6 +50,20 @@
WHERE org_code = #{orgcode}
AND (leave_type = #{leavetype} OR is_open = #{isopen})
</select>
<select
id=
"selCompanywidedata"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM kqgl_asso_leave_rules
WHERE org_code = #{orgcode}
and apply = 0
AND (leave_type = #{leavetype} OR is_open = #{isopen})
</select>
<select
id=
"AssociatedHolidays"
resultMap=
"BaseResultMap"
>
SELECT * FROM kqgl_asso_leave_rules rul
where rul.id in (select vic.leave_rules_id from kqgl_asso_rules_vice vic where vic.attgroup_id = #{attgroupid})
</select>
<insert
id=
"insertleaverulesList"
parameterType=
"java.util.List"
>
insert into kqgl_asso_leave_rules (name,company,leave_type,apply,create_time,create_userid,org_code,is_open,leave_balance,rules_type)
...
...
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