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
aa29bdd6
Commit
aa29bdd6
authored
Jun 09, 2020
by
lal
Committed by
chenzg
Jul 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
faa806c3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
19 deletions
+66
-19
src/main/java/cn/timer/api/controller/kqgl/ClockInController.java
+0
-0
src/main/java/cn/timer/api/controller/kqgl/ClockInTool.java
+43
-0
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
+16
-13
src/main/java/cn/timer/api/controller/kqgl/atttimer/AttendanceTaskTiming.java
+6
-6
src/main/java/cn/timer/api/dto/kqmk/AttSchedule.java
+1
-0
No files found.
src/main/java/cn/timer/api/controller/kqgl/ClockInController.java
View file @
aa29bdd6
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/kqgl/ClockInTool.java
View file @
aa29bdd6
...
@@ -23,6 +23,36 @@ public class ClockInTool {
...
@@ -23,6 +23,36 @@ public class ClockInTool {
static
SimpleDateFormat
famt
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
static
SimpleDateFormat
famt
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
/**
/**
* @param timeStr 修改的时间
* @param num 修改数字
* @param numtime
* @return 1:增加一年、2:增加一天、3:减10天、4:增加一个月
*/
public
static
String
requires_extra_times
(
String
timeStr
,
int
num
,
int
numtime
)
{
DateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Date
date
=
null
;
try
{
date
=
df
.
parse
(
timeStr
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
date
);
// 设置起时间
if
(
numtime
==
1
)
{
cal
.
add
(
Calendar
.
YEAR
,
num
);
// 增加一年
}
else
if
(
numtime
==
2
)
{
cal
.
add
(
Calendar
.
DATE
,
num
);
//增加一天
}
else
if
(
numtime
==
3
)
{
cal
.
add
(
Calendar
.
DATE
,
num
);
//减10天
}
else
{
cal
.
add
(
Calendar
.
MONTH
,
num
);
//增加一个月
}
return
df
.
format
(
cal
.
getTime
());
}
/**
* @param timeStr
* @param timeStr
* @param addnumber
* @param addnumber
* @return 通过java Calendar 实现时间+ 分钟
* @return 通过java Calendar 实现时间+ 分钟
...
@@ -432,5 +462,18 @@ public class ClockInTool {
...
@@ -432,5 +462,18 @@ public class ClockInTool {
res
=
String
.
valueOf
(
ts
);
res
=
String
.
valueOf
(
ts
);
return
res
;
return
res
;
}
}
/**
* 时间戳转换时间
*/
public
static
String
stampToDate
(
String
s
){
String
res
;
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
long
lt
=
new
Long
(
s
);
Date
date
=
new
Date
(
lt
);
res
=
simpleDateFormat
.
format
(
date
);
return
res
;
}
}
}
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
View file @
aa29bdd6
...
@@ -993,20 +993,23 @@ public class TimeCardController {
...
@@ -993,20 +993,23 @@ public class TimeCardController {
String
DevId
=
""
;
String
DevId
=
""
;
for
(
KqglAssoKqzdkfs
abp:
kqjs
)
{
for
(
KqglAssoKqzdkfs
abp:
kqjs
)
{
KqglAssoKqj
kqj
=
KqglAssoKqj
.
builder
().
id
(
abp
.
getDkfsid
()).
build
().
selectById
();
//查询考勤机“序列号”
KqglAssoKqj
kqj
=
KqglAssoKqj
.
builder
().
id
(
abp
.
getDkfsid
()).
build
().
selectById
();
//查询考勤机“序列号”
DevId
=
kqj
.
getCode
();
if
(
kqj
!=
null
)
{
for
(
UserAttendanceRel
user:
attusers
)
{
DevId
=
kqj
.
getCode
();
String
user_id
=
user
.
getEmpnum
();
//"1692";//要删除的考勤组里面用户ID
for
(
UserAttendanceRel
user:
attusers
)
{
String
user_id
=
user
.
getEmpnum
();
//"1692";//要删除的考勤组里面用户ID
String
url
=
mac_command
+
"/deleteUser"
;
HttpHeaders
headers
=
new
HttpHeaders
();
String
url
=
mac_command
+
"/deleteUser"
;
MultiValueMap
<
String
,
Object
>
params
=
new
LinkedMultiValueMap
<>();
HttpHeaders
headers
=
new
HttpHeaders
();
params
.
add
(
"devId"
,
DevId
);
MultiValueMap
<
String
,
Object
>
params
=
new
LinkedMultiValueMap
<>();
params
.
add
(
"userId"
,
user_id
);
params
.
add
(
"devId"
,
DevId
);
RestTemplate
restTemplate
=
new
RestTemplate
();
params
.
add
(
"userId"
,
user_id
);
HttpEntity
httpEntity
=
new
HttpEntity
(
params
,
headers
);
RestTemplate
restTemplate
=
new
RestTemplate
();
ResponseEntity
<
String
>
request
=
restTemplate
.
postForEntity
(
url
,
httpEntity
,
String
.
class
);
HttpEntity
httpEntity
=
new
HttpEntity
(
params
,
headers
);
System
.
err
.
print
(
request
.
getBody
());
ResponseEntity
<
String
>
request
=
restTemplate
.
postForEntity
(
url
,
httpEntity
,
String
.
class
);
System
.
err
.
print
(
request
.
getBody
());
}
}
}
}
}
userequirelationmapper
.
deleteBykqzid
(
id
);
userequirelationmapper
.
deleteBykqzid
(
id
);
...
...
src/main/java/cn/timer/api/controller/kqgl/atttimer/AttendanceTaskTiming.java
View file @
aa29bdd6
...
@@ -14,7 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -14,7 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired;
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
;
import
org.springframework.scheduling.annotation.SchedulingConfigurer
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
@@ -31,6 +30,7 @@ import cn.timer.api.bean.kqmk.KqglAssoRelationSummary;
...
@@ -31,6 +30,7 @@ import cn.timer.api.bean.kqmk.KqglAssoRelationSummary;
import
cn.timer.api.bean.kqmk.KqglAssoTeshu
;
import
cn.timer.api.bean.kqmk.KqglAssoTeshu
;
import
cn.timer.api.bean.kqmk.KqglAssoZhoupaiban
;
import
cn.timer.api.bean.kqmk.KqglAssoZhoupaiban
;
import
cn.timer.api.bean.kqmk.KqglMainKqz
;
import
cn.timer.api.bean.kqmk.KqglMainKqz
;
import
cn.timer.api.bean.qyzx.QyzxEntInfoM
;
import
cn.timer.api.controller.kqgl.ClockInTool
;
import
cn.timer.api.controller.kqgl.ClockInTool
;
import
cn.timer.api.dao.kqgl.AttendanceWeeklySchMapper
;
import
cn.timer.api.dao.kqgl.AttendanceWeeklySchMapper
;
import
cn.timer.api.dao.kqgl.PunchCardDetailsMapper
;
import
cn.timer.api.dao.kqgl.PunchCardDetailsMapper
;
...
@@ -105,7 +105,7 @@ public class AttendanceTaskTiming{
...
@@ -105,7 +105,7 @@ public class AttendanceTaskTiming{
*/
*/
//3.添加定时任务 每天下午七点执行一次
//3.添加定时任务 每天下午七点执行一次
@Scheduled
(
cron
=
"0
0 19
* * ?"
)
@Scheduled
(
cron
=
"0
34 10
* * ?"
)
//或直接指定时间间隔,例如:5秒
//或直接指定时间间隔,例如:5秒
//@Scheduled(fixedRate=5000)
//@Scheduled(fixedRate=5000)
...
@@ -142,7 +142,7 @@ public class AttendanceTaskTiming{
...
@@ -142,7 +142,7 @@ public class AttendanceTaskTiming{
ca
.
set
(
Calendar
.
DAY_OF_MONTH
,
ca
.
getActualMaximum
(
Calendar
.
DAY_OF_MONTH
));
ca
.
set
(
Calendar
.
DAY_OF_MONTH
,
ca
.
getActualMaximum
(
Calendar
.
DAY_OF_MONTH
));
Long
endDate
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
sdf1
.
format
(
ca
.
getTime
()),
"yyyy-MM-dd"
)).
getTime
();
Long
endDate
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
sdf1
.
format
(
ca
.
getTime
()),
"yyyy-MM-dd"
)).
getTime
();
//
List<QyzxEntInfoM> orgcodelist = qyzxentinfommapper.selectList(new QueryWrapper<QyzxEntInfoM>());//系统中的所有公司 所有未到期的公司
List
<
QyzxEntInfoM
>
orgcodelist
=
qyzxentinfommapper
.
selectList
(
new
QueryWrapper
<
QyzxEntInfoM
>());
//系统中的所有公司 所有未到期的公司
String
str
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
new
Date
()).
toString
();
//
String
str
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
new
Date
()).
toString
();
//
String
ttstr
=
new
SimpleDateFormat
(
"yyyy-MM"
).
format
(
new
Date
()).
toString
();
//
String
ttstr
=
new
SimpleDateFormat
(
"yyyy-MM"
).
format
(
new
Date
()).
toString
();
//
...
@@ -154,8 +154,8 @@ public class AttendanceTaskTiming{
...
@@ -154,8 +154,8 @@ public class AttendanceTaskTiming{
KqglAssoMonthPunchSummary
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoMonthPunchSummary
>().
lambda
().
eq
(
KqglAssoMonthPunchSummary:
:
getBelongYear
,
year
).
eq
(
KqglAssoMonthPunchSummary:
:
getBelongMonth
,
month
));
KqglAssoMonthPunchSummary
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoMonthPunchSummary
>().
lambda
().
eq
(
KqglAssoMonthPunchSummary:
:
getBelongYear
,
year
).
eq
(
KqglAssoMonthPunchSummary:
:
getBelongMonth
,
month
));
//
for(int t = 0;t<orgcodelist.size();t++){
for
(
int
t
=
0
;
t
<
orgcodelist
.
size
();
t
++){
int
org_code
=
310
;
//
orgcodelist.get(t).getId();//企业组织代码
int
org_code
=
orgcodelist
.
get
(
t
).
getId
();
//企业组织代码
List
<
AdditionalDto
>
userlist
=
kqglassoleavebalancemapper
.
selectAdditionalList
(
org_code
);
List
<
AdditionalDto
>
userlist
=
kqglassoleavebalancemapper
.
selectAdditionalList
(
org_code
);
for
(
AdditionalDto
user
:
userlist
)
{
for
(
AdditionalDto
user
:
userlist
)
{
double
traveltotal
=
0
,
egresstotal
=
0
,
overtimetotal
=
0
;
double
traveltotal
=
0
,
egresstotal
=
0
,
overtimetotal
=
0
;
...
@@ -684,7 +684,7 @@ public class AttendanceTaskTiming{
...
@@ -684,7 +684,7 @@ public class AttendanceTaskTiming{
summary
.
setDay31
(
noticesArray
[
30
]);
summary
.
setDay31
(
noticesArray
[
30
]);
summary
.
insert
();
summary
.
insert
();
}
}
//
}
}
// KqglTaskTiming.builder().task("AttendanceTask").id(sockid).executionStatus(0).lastExecutionTime(new Date().getTime()).build().updateById();
// KqglTaskTiming.builder().task("AttendanceTask").id(sockid).executionStatus(0).lastExecutionTime(new Date().getTime()).build().updateById();
// return new Exception().getStackTrace()[0].getMethodName();
// return new Exception().getStackTrace()[0].getMethodName();
...
...
src/main/java/cn/timer/api/dto/kqmk/AttSchedule.java
View file @
aa29bdd6
...
@@ -20,6 +20,7 @@ public class AttSchedule implements Serializable{
...
@@ -20,6 +20,7 @@ public class AttSchedule implements Serializable{
private
Integer
id
;
private
Integer
id
;
private
Integer
sort
;
// 1:上班;2:下班; 3:上班;4:下班;5:上班;6:下班
private
Integer
sort
;
// 1:上班;2:下班; 3:上班;4:下班;5:上班;6:下班
private
Integer
nextday
;
//0:否;1:是
private
Long
time
;
private
Long
time
;
private
Long
starttime
;
private
Long
starttime
;
private
Long
endtime
;
private
Long
endtime
;
...
...
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