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
12d80bca
Commit
12d80bca
authored
Jun 04, 2020
by
lal
Committed by
chenzg
Jul 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
730da395
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
140 additions
and
2 deletions
+140
-2
src/main/java/cn/timer/api/config/Initialization/InitializeSetting.java
+2
-1
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
+89
-1
src/main/java/cn/timer/api/dto/kqmk/AttMemberSettings.java
+24
-0
src/main/java/cn/timer/api/dto/kqmk/UserAttendanceRelDto.java
+25
-0
No files found.
src/main/java/cn/timer/api/config/Initialization/InitializeSetting.java
View file @
12d80bca
...
...
@@ -19,7 +19,8 @@ public class InitializeSetting implements ApplicationRunner {
@Override
public
void
run
(
ApplicationArguments
args
)
throws
Exception
{
StaticVariable
.
mac_command
=
"http://120.24.24.239:8095/cmd"
;
//考勤机执行命令
// StaticVariable.mac_command = "http://120.24.24.239:8095";//考勤机执行命令
StaticVariable
.
mac_command
=
"http://172.20.10.2:8088"
;
//考勤机执行命令
}
}
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
View file @
12d80bca
...
...
@@ -36,6 +36,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.lang.Console
;
import
cn.timer.api.bean.kqgl.KqglAssoKqjgly
;
import
cn.timer.api.bean.kqgl.PunchCardDetails
;
import
cn.timer.api.bean.kqgl.PunchRecord
;
import
cn.timer.api.bean.kqgl.UserAttendanceRel
;
...
...
@@ -86,6 +87,7 @@ import cn.timer.api.dao.kqmk.KqglAssoYhkqzMapper;
import
cn.timer.api.dao.kqmk.KqglAssoYhsbMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoZhoupaibanMapper
;
import
cn.timer.api.dao.kqmk.KqglMainKqzMapper
;
import
cn.timer.api.dto.kqmk.AttMemberSettings
;
import
cn.timer.api.dto.kqmk.AttSchedulingDto
;
import
cn.timer.api.dto.kqmk.AttendanceAssistantDto
;
import
cn.timer.api.dto.kqmk.AttqueryCriteriaDto
;
...
...
@@ -104,6 +106,7 @@ import cn.timer.api.dto.kqmk.ModifyEmployeeBalanceDto;
import
cn.timer.api.dto.kqmk.OriginalRecordDto
;
import
cn.timer.api.dto.kqmk.SetConditionsDto
;
import
cn.timer.api.dto.kqmk.StartTimeRestDto
;
import
cn.timer.api.dto.kqmk.UserAttendanceRelDto
;
import
cn.timer.api.dto.kqmk.VacationInformationDto
;
import
cn.timer.api.utils.DateUtil
;
import
cn.timer.api.utils.ResponseResult
;
...
...
@@ -1150,6 +1153,92 @@ public class TimeCardController {
}
/**
* 获取当前考勤组所有人员
*/
@GetMapping
(
value
=
"/AttUserGroupList/{id}"
)
@ApiOperation
(
value
=
"获取当前考勤组所有人员"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
getAttUserGroupList
(
@CurrentUser
UserBean
userBean
,
@PathVariable
(
"id"
)
Integer
id
)
{
UserAttendanceRelDto
usatt
=
UserAttendanceRelDto
.
builder
().
build
();
List
<
UserAttendanceRel
>
userattgor
=
userattendancerelmapper
.
selectAttendanceOfficerByKqzid
(
id
,
userBean
.
getOrgCode
());
usatt
.
setUseratts
(
userattgor
);
KqglMainKqz
kqztypeid
=
kqglmainkqzmapper
.
selectOne
(
new
QueryWrapper
<
KqglMainKqz
>().
lambda
().
eq
(
KqglMainKqz:
:
getId
,
id
));
usatt
.
setTypeid
(
kqztypeid
.
getPbfs
());
return
ResultUtil
.
data
(
usatt
);
}
@PostMapping
(
value
=
"/setmembers"
)
@ApiOperation
(
value
=
"考勤设置成员"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
Attsetmembers
(
@CurrentUser
UserBean
userBean
,
@RequestBody
AttMemberSettings
attsetuser
)
{
//确认当前考勤组是否存在考勤机打卡
List
<
KqglAssoKqzdkfs
>
dkfs
=
kqglassokqzdkfsmapper
.
selectList
(
new
QueryWrapper
<
KqglAssoKqzdkfs
>().
lambda
().
eq
(
KqglAssoKqzdkfs:
:
getType
,
1
).
eq
(
KqglAssoKqzdkfs:
:
getKqzId
,
attsetuser
.
getAttgroupid
()));
if
(
dkfs
.
size
()
>
0
)
{
for
(
KqglAssoKqzdkfs
fss:
dkfs
)
{
String
DevId
=
null
;
int
kqjid
=
0
;
KqglAssoKqj
kqj
=
KqglAssoKqj
.
builder
().
id
(
fss
.
getDkfsid
()).
build
().
selectById
();
//查询考勤机“序列号”
DevId
=
kqj
.
getCode
();
kqjid
=
kqj
.
getId
();
//考勤组新增员工
String
[]
addmember
=
attsetuser
.
getAddMember
();
String
urladd
=
StaticVariable
.
mac_command
+
"/addUserName"
;
for
(
int
a
=
0
;
a
<
addmember
.
length
;
a
++){
HttpHeaders
headers
=
new
HttpHeaders
();
MultiValueMap
<
String
,
Object
>
params
=
new
LinkedMultiValueMap
<>();
params
.
add
(
"devId"
,
DevId
);
params
.
add
(
"userId"
,
addmember
[
a
]);
YgglMainEmp
yggluser
=
YgglMainEmp
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>().
lambda
().
eq
(
YgglMainEmp:
:
getOrgCode
,
userBean
.
getOrgCode
()).
eq
(
YgglMainEmp:
:
getEmpNum
,
addmember
[
a
]));
params
.
add
(
"userName"
,
yggluser
.
getName
());
RestTemplate
restTemplate
=
new
RestTemplate
();
HttpEntity
httpEntity
=
new
HttpEntity
(
params
,
headers
);
ResponseEntity
<
String
>
request
=
restTemplate
.
postForEntity
(
urladd
,
httpEntity
,
String
.
class
);
System
.
err
.
print
(
request
.
getBody
());
//需要改下下
KqglAssoYhsb
uskqj
=
KqglAssoYhsb
.
builder
().
userId
(
Integer
.
valueOf
(
addmember
[
a
])).
kqjid
(
kqjid
).
type
(
1
).
isGly
(
0
).
build
();
if
(!
uskqj
.
insert
())
return
ResultUtil
.
error
(
"操作失败--新增用户与设备关系"
);
}
//考勤组减少员工
String
[]
removemember
=
attsetuser
.
getRemoveMember
();
String
urlre
=
StaticVariable
.
mac_command
+
"/deleteUser"
;
for
(
int
r
=
0
;
r
<
removemember
.
length
;
r
++){
HttpHeaders
headers
=
new
HttpHeaders
();
MultiValueMap
<
String
,
Object
>
params
=
new
LinkedMultiValueMap
<>();
params
.
add
(
"devId"
,
DevId
);
params
.
add
(
"userId"
,
removemember
[
r
]);
RestTemplate
restTemplate
=
new
RestTemplate
();
HttpEntity
httpEntity
=
new
HttpEntity
(
params
,
headers
);
ResponseEntity
<
String
>
request
=
restTemplate
.
postForEntity
(
urlre
,
httpEntity
,
String
.
class
);
System
.
err
.
print
(
request
.
getBody
());
//用户与设备关系表
KqglAssoYhsb
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoYhsb
>().
lambda
().
eq
(
KqglAssoYhsb:
:
getUserId
,
removemember
[
r
]).
eq
(
KqglAssoYhsb:
:
getKqjid
,
kqjid
).
eq
(
KqglAssoYhsb:
:
getType
,
1
));
//考勤机管理员
KqglAssoKqjgly
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoKqjgly
>().
lambda
().
eq
(
KqglAssoKqjgly:
:
getKqjid
,
kqjid
).
eq
(
KqglAssoKqjgly:
:
getUserid
,
removemember
[
r
]));
}
}
}
//删除--kqgl_asso_yhkqz[用户和考勤组关系表]
return
ResultUtil
.
success
(
"成功"
);
}
@PutMapping
(
value
=
"/switch"
)
@ApiOperation
(
value
=
"41:设置假期规则开关"
,
httpMethod
=
"PUT"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
41
)
...
...
@@ -1910,7 +1999,6 @@ public class TimeCardController {
// return ResultUtil.data(map);
// }
/**************************/
/**
* 查询列表-加班补偿方式
...
...
src/main/java/cn/timer/api/dto/kqmk/AttMemberSettings.java
0 → 100644
View file @
12d80bca
package
cn
.
timer
.
api
.
dto
.
kqmk
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
AttMemberSettings
{
@ApiModelProperty
(
value
=
"考勤组id"
,
example
=
"字段说明"
)
private
Integer
attgroupid
;
@ApiModelProperty
(
value
=
"考勤组新增员工"
,
example
=
"字段说明"
)
private
String
[]
addMember
;
@ApiModelProperty
(
value
=
"考勤组减少员工 "
,
example
=
"字段说明"
)
private
String
[]
removeMember
;
}
src/main/java/cn/timer/api/dto/kqmk/UserAttendanceRelDto.java
0 → 100644
View file @
12d80bca
package
cn
.
timer
.
api
.
dto
.
kqmk
;
import
java.io.Serializable
;
import
java.util.List
;
import
cn.timer.api.bean.kqgl.UserAttendanceRel
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
UserAttendanceRelDto
implements
Serializable
{
private
static
final
long
serialVersionUID
=
8904448757565309401L
;
private
Integer
typeid
;
private
List
<
UserAttendanceRel
>
useratts
;
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment