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
bf0abf9c
Commit
bf0abf9c
authored
May 13, 2020
by
Administrator
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'lal' into 'develop'
Lal See merge request 8timerv2/8timerapiv200!88
parents
cb98fecd
83f9450c
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
397 additions
and
51 deletions
+397
-51
src/main/java/cn/timer/api/bean/kqmk/KqglAssoLeaveRules.java
+4
-1
src/main/java/cn/timer/api/bean/kqmk/KqglAssoOvertimeRules.java
+2
-2
src/main/java/cn/timer/api/bean/kqmk/KqglAssoYhkqz.java
+50
-0
src/main/java/cn/timer/api/bean/kqmk/KqglMainKqz.java
+4
-0
src/main/java/cn/timer/api/config/Initialization/InitializeSetting.java
+1
-1
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
+166
-35
src/main/java/cn/timer/api/dao/kqmk/KqglAssoYhkqzMapper.java
+16
-0
src/main/java/cn/timer/api/dao/kqmk/KqglMainKqzMapper.java
+6
-0
src/main/java/cn/timer/api/dto/kqmk/AttendanceGroupDto.java
+4
-3
src/main/java/cn/timer/api/dto/kqmk/KqglAssoLeaveRulesDto.java
+5
-1
src/main/java/cn/timer/api/dto/kqmk/KqglAssoOvertimeRulesDto.java
+2
-2
src/main/java/cn/timer/api/dto/kqmk/KqglMainKqzDto.java
+3
-0
src/main/resources/mapping/kqmk/KqglAssoYhkqzMapper.xml
+91
-0
src/main/resources/mapping/kqmk/KqglMainKqzMapper.xml
+43
-6
No files found.
src/main/java/cn/timer/api/bean/kqmk/KqglAssoLeaveRules.java
View file @
bf0abf9c
...
...
@@ -47,7 +47,7 @@ public class KqglAssoLeaveRules extends Model<KqglAssoLeaveRules> {
private
Integer
leaveType
;
@ApiModelProperty
(
value
=
"适用范围 "
,
example
=
"0:全公司 >0:考勤组id"
)
private
String
apply
;
private
Integer
apply
;
@ApiModelProperty
(
value
=
"创建时间 创建时间"
,
example
=
"101"
)
private
Long
createTime
;
...
...
@@ -64,4 +64,6 @@ public class KqglAssoLeaveRules extends Model<KqglAssoLeaveRules> {
@ApiModelProperty
(
value
=
"假期余额 0:关(该项余额为“不限余额”);1:开(该项余额为“0”)"
,
example
=
"101"
)
private
Integer
leaveBalance
;
}
\ No newline at end of file
src/main/java/cn/timer/api/bean/kqmk/KqglAssoOvertimeRules.java
View file @
bf0abf9c
...
...
@@ -40,8 +40,8 @@ public class KqglAssoOvertimeRules extends Model<KqglAssoOvertimeRules> {
@ApiModelProperty
(
value
=
"规则名称 "
,
example
=
"以审批时间计算加班"
)
private
String
name
;
@ApiModelProperty
(
value
=
"应用范围"
,
example
=
"
1
"
)
private
String
appliedScope
;
@ApiModelProperty
(
value
=
"应用范围"
,
example
=
"
(0:全公司 >0:考勤组id)
"
)
private
Integer
appliedScope
;
@ApiModelProperty
(
value
=
"工作日是否允许加班 0:否;1:是"
,
example
=
"1"
)
private
Integer
isWorkovertime
;
...
...
src/main/java/cn/timer/api/bean/kqmk/KqglAssoYhkqz.java
0 → 100644
View file @
bf0abf9c
package
cn
.
timer
.
api
.
bean
.
kqmk
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.extension.activerecord.Model
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author LAL 2020-05-12
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table
(
name
=
"kqgl_asso_yhkqz"
)
@ApiModel
(
"用户和考勤组关系表"
)
public
class
KqglAssoYhkqz
extends
Model
<
KqglAssoYhkqz
>
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
@TableId
(
type
=
IdType
.
AUTO
)
@ApiModelProperty
(
value
=
"id id"
,
example
=
"101"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"考勤组id 考勤组id"
,
example
=
"101"
)
private
Integer
kqzid
;
@ApiModelProperty
(
value
=
"用户id 用户id"
,
example
=
"101"
)
private
Integer
userid
;
@ApiModelProperty
(
value
=
"企业id 企业id"
,
example
=
"101"
)
private
Integer
qyid
;
}
\ No newline at end of file
src/main/java/cn/timer/api/bean/kqmk/KqglMainKqz.java
View file @
bf0abf9c
...
...
@@ -94,4 +94,7 @@ public class KqglMainKqz extends Model<KqglMainKqz> {
@ApiModelProperty
(
value
=
"外勤 外勤"
,
example
=
"101"
)
private
Integer
isWq
;
@ApiModelProperty
(
value
=
"加班规则 加班规则"
,
example
=
"101"
)
private
Integer
overtimeRulesId
;
}
\ No newline at end of file
src/main/java/cn/timer/api/config/Initialization/InitializeSetting.java
View file @
bf0abf9c
...
...
@@ -19,7 +19,7 @@ public class InitializeSetting implements ApplicationRunner {
@Override
public
void
run
(
ApplicationArguments
args
)
throws
Exception
{
StaticVariable
.
mac_command
=
"http://1
92.168.3.143:8088
/cmd"
;
//考勤机执行命令
StaticVariable
.
mac_command
=
"http://1
20.24.24.239:8095
/cmd"
;
//考勤机执行命令
}
}
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
View file @
bf0abf9c
package
cn
.
timer
.
api
.
controller
.
kqgl
;
import
java.lang.reflect.InvocationTargetException
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
...
@@ -15,7 +15,6 @@ import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
...
@@ -26,21 +25,24 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.lang.Console
;
import
cn.hutool.json.JSONObject
;
import
cn.timer.api.bean.kqgl.AttConditions
;
import
cn.timer.api.bean.kqgl.AttendanceCardList
;
import
cn.timer.api.bean.kqmk.KqglAssOvertimeVice
;
import
cn.timer.api.bean.kqmk.KqglAssoBcsz
;
import
cn.timer.api.bean.kqmk.KqglAssoDkdz
;
import
cn.timer.api.bean.kqmk.KqglAssoDkwx
;
import
cn.timer.api.bean.kqmk.KqglAssoKqj
;
import
cn.timer.api.bean.kqmk.KqglAssoKqzdkfs
;
import
cn.timer.api.bean.kqmk.KqglAssoLeaveBalance
;
import
cn.timer.api.bean.kqmk.KqglAssoLeaveRules
;
import
cn.timer.api.bean.kqmk.KqglAssoOvertimeBasics
;
import
cn.timer.api.bean.kqmk.KqglAssoOvertimeRange
;
import
cn.timer.api.bean.kqmk.KqglAssoOvertimeRules
;
import
cn.timer.api.bean.kqmk.KqglAssoPbmx
;
import
cn.timer.api.bean.kqmk.KqglAssoRulesVice
;
import
cn.timer.api.bean.kqmk.KqglAssoTeshu
;
import
cn.timer.api.bean.kqmk.KqglAssoYhkqz
;
import
cn.timer.api.bean.kqmk.KqglAssoZhoupaiban
;
import
cn.timer.api.bean.kqmk.KqglMainKqz
;
import
cn.timer.api.bean.
spmk.SpmkInitiatorConfig
;
import
cn.timer.api.bean.
yggl.YgglMainEmp
;
import
cn.timer.api.config.annotation.CurrentUser
;
import
cn.timer.api.config.annotation.UserBean
;
import
cn.timer.api.dao.kqmk.KqglAssOvertimeViceMapper
;
...
...
@@ -50,6 +52,7 @@ import cn.timer.api.dao.kqmk.KqglAssoDkwxMapper;
import
cn.timer.api.dao.kqmk.KqglAssoKqjMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoLeaveBalanceMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoLeaveRulesMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoOvertimeRangeMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoOvertimeRulesMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoRulesViceMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoYhsbMapper
;
...
...
@@ -94,7 +97,6 @@ public class TimeCardController {
attquerycriteriadto
.
getTotalPage
()
==
null
?
10
:
attquerycriteriadto
.
getTotalPage
());
attquerycriteriadto
.
setOrgCode
(
userBean
.
getOrgCode
());
attquerycriteriadto
.
setEmpNum
(
userBean
.
getEmpNum
());
// IPage<KqglAssoBcsz> pageAs = kqglassobcszmapper.selectPage(page, attquerycriteriadto);//用于SQL语句
IPage
<
KqglAssoBcsz
>
pageAs
=
kqglassobcszmapper
.
selectPage
(
page
,
new
QueryWrapper
<
KqglAssoBcsz
>().
lambda
().
eq
(
KqglAssoBcsz:
:
getQyid
,
userBean
.
getOrgCode
()));
List
<
KqglAssoBcsz
>
listAs
=
pageAs
.
getRecords
();
return
ResultUtil
.
data
(
pageAs
,
listAs
,
"操作成功!"
);
...
...
@@ -134,7 +136,6 @@ public class TimeCardController {
@ApiOperation
(
value
=
"4:获取班次信息-根据班次id"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
4
)
public
Result
<
Object
>
getShiftCenter
(
@PathVariable
(
"id"
)
Integer
id
)
{
return
ResultUtil
.
data
(
KqglAssoBcsz
.
builder
().
id
(
id
).
build
().
selectById
(),
"操作成功!"
);
}
...
...
@@ -154,11 +155,13 @@ public class TimeCardController {
/**
* 查询列表-获取加班规则数据-分页
* @throws InvocationTargetException
* @throws IllegalAccessException
*/
@PostMapping
(
value
=
"/select_overtime_rules"
)
@ApiOperation
(
value
=
"6.获取加班规则数据-根据 组织机构代码-分页"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
6
)
public
Result
<
Object
>
selectOvertimeRules
(
@CurrentUser
UserBean
userBean
,
@RequestBody
AttqueryCriteriaDto
attquerycriteriadto
)
{
public
Result
<
Object
>
selectOvertimeRules
(
@CurrentUser
UserBean
userBean
,
@RequestBody
AttqueryCriteriaDto
attquerycriteriadto
)
throws
IllegalAccessException
,
InvocationTargetException
{
IPage
<
KqglAssoOvertimeRules
>
page
=
new
Page
<
KqglAssoOvertimeRules
>(
attquerycriteriadto
.
getCurrentPage
()
==
null
?
1
:
attquerycriteriadto
.
getCurrentPage
(),
attquerycriteriadto
.
getTotalPage
()
==
null
?
10
:
attquerycriteriadto
.
getTotalPage
());
...
...
@@ -166,9 +169,31 @@ public class TimeCardController {
attquerycriteriadto
.
setEmpNum
(
userBean
.
getEmpNum
());
IPage
<
KqglAssoOvertimeRules
>
pageAs
=
kqglassoovertimerulesmapper
.
selectPage
(
page
,
new
QueryWrapper
<
KqglAssoOvertimeRules
>().
lambda
().
eq
(
KqglAssoOvertimeRules:
:
getOrgCode
,
userBean
.
getOrgCode
()));
List
<
KqglAssoOvertimeRules
>
listAs
=
pageAs
.
getRecords
();
return
ResultUtil
.
data
(
pageAs
,
listAs
,
"操作成功!"
);
List
<
KqglAssoOvertimeRulesDto
>
rulesdto
=
new
ArrayList
<
KqglAssoOvertimeRulesDto
>();
for
(
int
i
=
0
,
n
=
listAs
.
size
();
i
<
n
;
i
++)
{
String
[]
nary
=
null
;
if
(
listAs
.
get
(
i
).
getAppliedScope
()
==
0
)
{
//全公司
nary
=
new
String
[
1
];
//用户名
nary
[
0
]
=
"全公司"
;
}
else
{
List
<
KqglAssoOvertimeRange
>
overtim
=
kqglassoovertimerangemapper
.
selectList
(
new
QueryWrapper
<
KqglAssoOvertimeRange
>().
lambda
().
eq
(
KqglAssoOvertimeRange:
:
getOvertimeRulesId
,
listAs
.
get
(
i
).
getId
()));
nary
=
new
String
[
overtim
.
size
()];
//用户名
for
(
int
y
=
0
,
l
=
overtim
.
size
();
y
<
l
;
y
++)
{
KqglMainKqz
kqzmc
=
kqglmainkqzmapper
.
selectOne
(
new
QueryWrapper
<
KqglMainKqz
>().
lambda
().
eq
(
KqglMainKqz:
:
getId
,
overtim
.
get
(
y
).
getAttgroupId
()));
nary
[
y
]
=
kqzmc
.
getName
();
}
}
KqglAssoOvertimeRulesDto
ruldto
=
KqglAssoOvertimeRulesDto
.
builder
().
build
();
ruldto
.
setApplyrange
(
nary
);
BeanUtil
.
copyProperties
(
listAs
.
get
(
i
),
ruldto
,
"starttime"
,
"applyrange"
);
rulesdto
.
add
(
ruldto
);
}
return
ResultUtil
.
data
(
pageAs
,
rulesdto
,
"操作成功!"
);
}
@Autowired
private
KqglAssoOvertimeRangeMapper
kqglassoovertimerangemapper
;
/**
* 新增/修改--加班规则
*/
...
...
@@ -179,21 +204,28 @@ public class TimeCardController {
overrules
.
setCreateTime
(
new
Date
().
getTime
());
overrules
.
setOrgCode
(
userBean
.
getOrgCode
());
overrules
.
setCreateUserid
(
userBean
.
getEmpNum
());
String
[]
launchs
=
overrules
.
getApplyrange
();
String
appliedscope
=
StringUtils
.
join
(
launchs
,
","
);
// rul.setAppliedScope(appliedscope);//应用范围
overrules
.
setAppliedScope
(
appliedscope
);
KqglAssoOvertimeRules
rul
=
KqglAssoOvertimeRules
.
builder
().
build
();
// 克隆 KqglAssoOvertimeRulesDto对象 到 KqglAssoOvertimeRules对象
BeanUtil
.
copyProperties
(
overrules
,
rul
,
"starttime"
,
"applyrange"
);
if
(!
rul
.
insertOrUpdate
())
return
ResultUtil
.
error
(
"操作失败"
);
Integer
id
=
rul
.
getId
();
Console
.
log
(
"新增/修改加班规则id: "
+
id
);
List
<
KqglAssoOvertimeRange
>
overatts
=
new
ArrayList
<
KqglAssoOvertimeRange
>();
String
[]
launchs
=
overrules
.
getApplyrange
();
if
(
launchs
.
length
==
0
)
{
KqglAssoOvertimeRange
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoOvertimeRange
>().
lambda
().
eq
(
KqglAssoOvertimeRange:
:
getOvertimeRulesId
,
id
));
}
else
if
(
launchs
!=
null
&&
launchs
.
length
>
0
){
for
(
int
p
=
0
;
p
<
launchs
.
length
;
p
++){
KqglAssoOvertimeRange
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoOvertimeRange
>().
lambda
().
eq
(
KqglAssoOvertimeRange:
:
getOvertimeRulesId
,
id
));
KqglAssoOvertimeRange
vice
=
KqglAssoOvertimeRange
.
builder
().
build
();
vice
.
setOvertimeRulesId
(
id
);
vice
.
setAttgroupId
(
Integer
.
valueOf
(
launchs
[
p
]));
overatts
.
add
(
vice
);
}
}
if
(
overatts
.
size
()
>
0
)
{
kqglassoovertimerangemapper
.
insertovertimerangelist
(
overatts
);
}
List
<
KqglAssOvertimeVice
>
overtimes
=
new
ArrayList
<
KqglAssOvertimeVice
>();
StartTimeRestDto
[]
rest
=
overrules
.
getStarttime
();
if
(
rest
!=
null
&&
rest
.
length
>
0
){
...
...
@@ -222,8 +254,11 @@ public class TimeCardController {
public
Result
<
IndividualOvertimeRuleDto
>
getOvertimeRules
(
@PathVariable
(
"id"
)
Integer
id
)
{
IndividualOvertimeRuleDto
overrule
=
IndividualOvertimeRuleDto
.
builder
().
build
();
KqglAssoOvertimeRules
rules
=
KqglAssoOvertimeRules
.
builder
().
id
(
id
).
build
().
selectById
();
String
str
=
rules
.
getAppliedScope
();
String
[]
arr
=
str
.
split
(
","
);
// 用,分割
List
<
KqglAssoOvertimeRange
>
overtim
=
kqglassoovertimerangemapper
.
selectList
(
new
QueryWrapper
<
KqglAssoOvertimeRange
>().
lambda
().
eq
(
KqglAssoOvertimeRange:
:
getOvertimeRulesId
,
rules
.
getId
()));
String
[]
arr
=
new
String
[
overtim
.
size
()];
//用户名
for
(
int
i
=
0
,
n
=
overtim
.
size
();
i
<
n
;
i
++)
{
arr
[
i
]
=
overtim
.
get
(
i
).
getAttgroupId
().
toString
();
}
KqglAssoOvertimeRulesDto
ruldto
=
KqglAssoOvertimeRulesDto
.
builder
().
build
();
ruldto
.
setApplyrange
(
arr
);
BeanUtil
.
copyProperties
(
rules
,
ruldto
,
"starttime"
,
"applyrange"
);
...
...
@@ -312,18 +347,17 @@ public class TimeCardController {
BeanUtil
.
copyProperties
(
leaverules
,
learul
,
"starttime"
);
if
(!
learul
.
insertOrUpdate
())
return
ResultUtil
.
error
(
"操作失败"
);
Integer
id
=
learul
.
getId
();
Console
.
log
(
"新增/修改--假期规则id: "
+
id
);
if
(
leaverules
.
getLeaveBalance
()
==
0
)
{
//假期余额 0:关(该项余额为“不限余额”);1:开(该项余额为“0”)
KqglAssoLeaveBalance
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoLeaveBalance
>().
lambda
().
eq
(
KqglAssoLeaveBalance:
:
getLeaveRulesId
,
id
)
.
eq
(
KqglAssoLeaveBalance
::
getOrgCode
,
userBean
.
getOrgCode
()));
}
List
<
KqglAssoRulesVice
>
vices
=
new
ArrayList
<
KqglAssoRulesVice
>();
String
[]
rest
=
leaverules
.
getRange
();
if
(
rest
!=
null
&&
rest
.
length
>
0
){
if
(
rest
.
length
==
0
)
{
KqglAssoRulesVice
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoRulesVice
>().
lambda
().
eq
(
KqglAssoRulesVice:
:
getLeaveRulesId
,
id
));
}
else
if
(
rest
!=
null
&&
rest
.
length
>
0
){
for
(
int
p
=
0
;
p
<
rest
.
length
;
p
++){
KqglAssoRulesVice
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoRulesVice
>().
lambda
().
eq
(
KqglAssoRulesVice:
:
getLeaveRulesId
,
id
));
KqglAssoRulesVice
vice
=
KqglAssoRulesVice
.
builder
().
build
();
...
...
@@ -606,7 +640,6 @@ public class TimeCardController {
public
Result
<
Object
>
BalanceHeader
(
@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
();
return
ResultUtil
.
data
(
balheas
,
"操作成功!"
);
}
...
...
@@ -617,10 +650,8 @@ 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
<
LeaveTypeDto
>
leas
=
new
ArrayList
<
LeaveTypeDto
>();
for
(
KqglAssoLeaveRules
rul
:
balheas
)
{
LeaveTypeDto
lea
=
LeaveTypeDto
.
builder
().
build
();
...
...
@@ -638,9 +669,7 @@ public class TimeCardController {
@ApiOperation
(
value
=
"31:根据组织机构代码 获取考勤组"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
31
)
public
Result
<
Object
>
CheckWorkatt
(
@CurrentUser
UserBean
userBean
)
{
List
<
KqglMainKqz
>
kqzs
=
KqglMainKqz
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
KqglMainKqz
>().
lambda
().
eq
(
KqglMainKqz:
:
getQyid
,
userBean
.
getOrgCode
()));
List
<
LeaveTypeDto
>
leas
=
new
ArrayList
<
LeaveTypeDto
>();
for
(
KqglMainKqz
rul
:
kqzs
)
{
LeaveTypeDto
lea
=
LeaveTypeDto
.
builder
().
build
();
...
...
@@ -648,7 +677,6 @@ public class TimeCardController {
lea
.
setValue
(
rul
.
getName
());
leas
.
add
(
lea
);
}
return
ResultUtil
.
data
(
leas
,
"操作成功!"
);
}
...
...
@@ -659,9 +687,7 @@ public class TimeCardController {
@ApiOperation
(
value
=
"32:根据组织机构代码 获取加班基础设置信息"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
32
)
public
Result
<
Object
>
overtimebasicinformation
(
@CurrentUser
UserBean
userBean
)
{
KqglAssoOvertimeBasics
kqjdev
=
KqglAssoOvertimeBasics
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoOvertimeBasics
>().
lambda
().
eq
(
KqglAssoOvertimeBasics:
:
getOrgCode
,
userBean
.
getOrgCode
()));
return
ResultUtil
.
data
(
kqjdev
,
"操作成功!"
);
}
...
...
@@ -672,7 +698,6 @@ public class TimeCardController {
@ApiOperation
(
value
=
"33:获取假期规则数据-分页"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
33
)
public
Result
<
Object
>
selectleaverules
(
@CurrentUser
UserBean
userBean
,
@RequestBody
AttqueryCriteriaDto
attquerycriteriadto
)
{
IPage
<
KqglAssoLeaveRules
>
page
=
new
Page
<
KqglAssoLeaveRules
>(
attquerycriteriadto
.
getCurrentPage
()
==
null
?
1
:
attquerycriteriadto
.
getCurrentPage
(),
attquerycriteriadto
.
getTotalPage
()
==
null
?
10
:
attquerycriteriadto
.
getTotalPage
());
...
...
@@ -680,10 +705,116 @@ public class TimeCardController {
attquerycriteriadto
.
setEmpNum
(
userBean
.
getEmpNum
());
IPage
<
KqglAssoLeaveRules
>
pageAs
=
kqglassoleaverulesmapper
.
selectPage
(
page
,
new
QueryWrapper
<
KqglAssoLeaveRules
>().
lambda
().
eq
(
KqglAssoLeaveRules:
:
getOrgCode
,
userBean
.
getOrgCode
()));
List
<
KqglAssoLeaveRules
>
listAs
=
pageAs
.
getRecords
();
List
<
KqglAssoLeaveRulesDto
>
leadto
=
new
ArrayList
<
KqglAssoLeaveRulesDto
>();
for
(
int
i
=
0
,
n
=
listAs
.
size
();
i
<
n
;
i
++)
{
String
[]
nary
=
null
;
if
(
listAs
.
get
(
i
).
getApply
()
==
0
)
{
//全公司
nary
=
new
String
[
1
];
//用户名
nary
[
0
]
=
"全公司"
;
}
else
{
//考勤组
List
<
KqglAssoRulesVice
>
vice
=
kqglassorulesvicemapper
.
selectList
(
new
QueryWrapper
<
KqglAssoRulesVice
>().
lambda
().
eq
(
KqglAssoRulesVice:
:
getLeaveRulesId
,
listAs
.
get
(
i
).
getId
()));
nary
=
new
String
[
vice
.
size
()];
//用户名
for
(
int
y
=
0
,
l
=
vice
.
size
();
y
<
l
;
y
++)
{
KqglMainKqz
kqzmc
=
kqglmainkqzmapper
.
selectOne
(
new
QueryWrapper
<
KqglMainKqz
>().
lambda
().
eq
(
KqglMainKqz:
:
getId
,
vice
.
get
(
y
).
getAttgroupId
()));
nary
[
y
]
=
kqzmc
.
getName
();
}
}
KqglAssoLeaveRulesDto
learul
=
KqglAssoLeaveRulesDto
.
builder
().
build
();
learul
.
setApplyrange
(
nary
);
BeanUtil
.
copyProperties
(
listAs
.
get
(
i
),
learul
,
"range"
,
"applyrange"
);
leadto
.
add
(
learul
);
}
return
ResultUtil
.
data
(
pageAs
,
leadto
,
"操作成功!"
);
}
/**
* 查询列表-考勤组-分页
*/
@PostMapping
(
value
=
"/attendance_group"
)
@ApiOperation
(
value
=
"34:查询列表-我审批的/抄送我的-分页"
,
httpMethod
=
"POST"
,
notes
=
"查询列表-我审批的-关键字、审批状态、发起时间-分页"
)
@ApiOperationSupport
(
order
=
34
)
public
Result
<
Object
>
AttendanceGroup
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
AttqueryCriteriaDto
attquerycriteriadto
){
IPage
<
KqglMainKqzDto
>
page
=
new
Page
<
KqglMainKqzDto
>(
attquerycriteriadto
.
getCurrentPage
()
==
null
?
1
:
attquerycriteriadto
.
getCurrentPage
(),
attquerycriteriadto
.
getTotalPage
()
==
null
?
10
:
attquerycriteriadto
.
getTotalPage
());
attquerycriteriadto
.
setOrgCode
(
userBean
.
getOrgCode
());
attquerycriteriadto
.
setEmpNum
(
userBean
.
getEmpNum
());
// 缺-部门id 搜索
IPage
<
KqglMainKqzDto
>
pageAs
=
kqglmainkqzmapper
.
selectPageByQueryKqglMain
(
page
,
attquerycriteriadto
);
List
<
KqglMainKqzDto
>
listAs
=
pageAs
.
getRecords
();
return
ResultUtil
.
data
(
pageAs
,
listAs
,
"操作成功!"
);
}
/**
* 获取打卡地址数据
*/
@GetMapping
(
value
=
"/InGroupPunchAddress"
)
@ApiOperation
(
value
=
"35:获取打卡地址数据"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
35
)
public
Result
<
Object
>
getInGroupPunchAddress
(
@CurrentUser
UserBean
userBean
)
{
List
<
KqglAssoDkdz
>
shiftList
=
KqglAssoDkdz
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
KqglAssoDkdz
>().
lambda
().
eq
(
KqglAssoDkdz:
:
getQyid
,
userBean
.
getOrgCode
()));
return
ResultUtil
.
data
(
shiftList
);
}
/**
* 获取打卡WIFI数据
*/
@GetMapping
(
value
=
"/InGroupPunchWIFI"
)
@ApiOperation
(
value
=
"36:获取打卡WIFI数据"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
36
)
public
Result
<
Object
>
getInGroupPunchWIFI
(
@CurrentUser
UserBean
userBean
)
{
List
<
KqglAssoDkwx
>
shiftList
=
KqglAssoDkwx
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
KqglAssoDkwx
>().
lambda
().
eq
(
KqglAssoDkwx:
:
getQyid
,
userBean
.
getOrgCode
()));
return
ResultUtil
.
data
(
shiftList
);
}
/**
* 获取班次
*/
@GetMapping
(
value
=
"/AttShift"
)
@ApiOperation
(
value
=
"37:获取班次-根据 组织机构代码"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
37
)
public
Result
<
Object
>
getAttShiftList
(
@CurrentUser
UserBean
userBean
)
{
List
<
KqglAssoBcsz
>
attshiftList
=
KqglAssoBcsz
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
KqglAssoBcsz
>().
lambda
().
eq
(
KqglAssoBcsz:
:
getQyid
,
userBean
.
getOrgCode
()));
return
ResultUtil
.
data
(
attshiftList
);
}
/**
* 获取员工数据
*/
@GetMapping
(
value
=
"/Employee"
)
@ApiOperation
(
value
=
"38:获取员工数据-根据 组织机构代码"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
38
)
public
Result
<
Object
>
getEmployeeData
(
@CurrentUser
UserBean
userBean
)
{
List
<
YgglMainEmp
>
yggl
=
YgglMainEmp
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
YgglMainEmp
>().
lambda
().
eq
(
YgglMainEmp:
:
getOrgCode
,
userBean
.
getOrgCode
()));
return
ResultUtil
.
data
(
yggl
);
}
/**
* 删除考勤组
*/
@DeleteMapping
(
value
=
"/AttendanceGroup/{id}"
)
@ApiOperation
(
value
=
"39:删除考勤组"
,
httpMethod
=
"DELETE"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
39
)
public
Result
<
Integer
>
DelAttendanceGroup
(
@PathVariable
(
"id"
)
Integer
id
)
{
if
(
KqglMainKqz
.
builder
().
id
(
id
).
build
().
deleteById
())
{
//删除考勤组绑定的打卡方式
KqglAssoKqzdkfs
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoKqzdkfs
>().
lambda
().
eq
(
KqglAssoKqzdkfs:
:
getKqzId
,
id
));
//删除用户和考勤组关系表
KqglAssoYhkqz
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoYhkqz
>().
lambda
().
eq
(
KqglAssoYhkqz:
:
getKqzid
,
id
));
//删除特殊日期表
KqglAssoTeshu
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoTeshu
>().
lambda
().
eq
(
KqglAssoTeshu:
:
getKqzid
,
id
));
//删除排班明细表(自由排班)
KqglAssoPbmx
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoPbmx
>().
lambda
().
eq
(
KqglAssoPbmx:
:
getKqzid
,
id
));
//删除考勤周排班
KqglAssoZhoupaiban
.
builder
().
build
().
delete
(
new
QueryWrapper
<
KqglAssoZhoupaiban
>().
lambda
().
eq
(
KqglAssoZhoupaiban:
:
getKqzid
,
id
));
return
ResultUtil
.
data
(
id
,
"删除成功"
);
}
return
ResultUtil
.
error
(
"删除失败"
);
}
/**************************/
/**
* 查询列表-加班补偿方式
*/
@GetMapping
(
value
=
"/list_compensate"
)
...
...
src/main/java/cn/timer/api/dao/kqmk/KqglAssoYhkqzMapper.java
0 → 100644
View file @
bf0abf9c
package
cn
.
timer
.
api
.
dao
.
kqmk
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.springframework.stereotype.Repository
;
import
cn.timer.api.bean.kqmk.KqglAssoYhkqz
;
/**
* 用户和考勤组关系表
*
* @author LAL 2020-05-12
*/
@Repository
public
interface
KqglAssoYhkqzMapper
extends
BaseMapper
<
KqglAssoYhkqz
>
{
}
src/main/java/cn/timer/api/dao/kqmk/KqglMainKqzMapper.java
View file @
bf0abf9c
...
...
@@ -2,11 +2,14 @@ package cn.timer.api.dao.kqmk;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
cn.timer.api.bean.kqmk.KqglMainKqz
;
import
cn.timer.api.dto.kqmk.AttqueryCriteriaDto
;
import
cn.timer.api.dto.kqmk.KqglMainKqzDto
;
/**
...
...
@@ -20,4 +23,7 @@ public interface KqglMainKqzMapper extends BaseMapper<KqglMainKqz> {
List
<
KqglMainKqzDto
>
selectAttGroupMachineByQyid
(
int
qyid
);
KqglMainKqz
getAttendanceGroupInformationByUserid
(
int
userid
,
int
qyid
);
IPage
<
KqglMainKqzDto
>
selectPageByQueryKqglMain
(
IPage
<
KqglMainKqzDto
>
page
,
@Param
(
"param"
)
AttqueryCriteriaDto
attquerycriteriadto
);
}
src/main/java/cn/timer/api/dto/kqmk/AttendanceGroupDto.java
View file @
bf0abf9c
...
...
@@ -14,7 +14,7 @@ import lombok.NoArgsConstructor;
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
AttendanceGroupDto
implements
Serializable
{
public
class
AttendanceGroupDto
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
5573272776427338217L
;
...
...
@@ -45,9 +45,9 @@ public class AttendanceGroupDto implements Serializable{
private
String
pbfsnm
;
// 排班方式
private
String
dkfs
;
// 打卡方式
private
Integer
isWq
;
//外勤
private
Integer
isWq
;
//
外勤
private
Integer
kqjid
;
private
List
<
AttGroupBinPunchMode
>
kqzdkfslist
=
new
ArrayList
<
AttGroupBinPunchMode
>()
;
private
List
<
AttGroupBinPunchMode
>
kqzdkfslist
;
}
\ No newline at end of file
src/main/java/cn/timer/api/dto/kqmk/KqglAssoLeaveRulesDto.java
View file @
bf0abf9c
...
...
@@ -28,7 +28,7 @@ public class KqglAssoLeaveRulesDto {
private
Integer
leaveType
;
@ApiModelProperty
(
value
=
"适用范围 "
,
example
=
"0:全公司 -1:考勤组id"
)
private
String
apply
;
private
Integer
apply
;
@ApiModelProperty
(
value
=
"创建时间 创建时间"
,
example
=
"101"
)
private
Long
createTime
;
...
...
@@ -48,4 +48,7 @@ public class KqglAssoLeaveRulesDto {
@ApiModelProperty
(
value
=
"适用范围集合"
,
example
=
"101"
)
private
String
[]
range
;
@ApiModelProperty
(
value
=
"适用范围名称"
,
example
=
"101"
)
private
String
[]
applyrange
;
}
\ No newline at end of file
src/main/java/cn/timer/api/dto/kqmk/KqglAssoOvertimeRulesDto.java
View file @
bf0abf9c
...
...
@@ -20,8 +20,8 @@ public class KqglAssoOvertimeRulesDto {
@ApiModelProperty
(
value
=
"规则名称 "
,
example
=
"以审批时间计算加班"
)
private
String
name
;
@ApiModelProperty
(
value
=
"应用范围"
,
example
=
"
1
"
)
private
String
appliedScope
;
@ApiModelProperty
(
value
=
"应用范围"
,
example
=
"
(0:全公司 >0:考勤组id)
"
)
private
Integer
appliedScope
;
@ApiModelProperty
(
value
=
"工作日是否允许加班 0:否;1:是"
,
example
=
"1"
)
private
Integer
isWorkovertime
;
...
...
src/main/java/cn/timer/api/dto/kqmk/KqglMainKqzDto.java
View file @
bf0abf9c
...
...
@@ -75,6 +75,9 @@ public class KqglMainKqzDto {
@ApiModelProperty
(
value
=
"外勤 外勤"
,
example
=
"101"
)
private
Integer
isWq
;
@ApiModelProperty
(
value
=
"加班规则 加班规则"
,
example
=
"101"
)
private
Integer
overtimeRulesId
;
@ApiModelProperty
(
value
=
"考勤组人员数"
,
example
=
"100"
)
private
Integer
kqznum
;
...
...
src/main/resources/mapping/kqmk/KqglAssoYhkqzMapper.xml
0 → 100644
View file @
bf0abf9c
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.timer.api.dao.kqmk.KqglAssoYhkqzMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.timer.api.bean.kqmk.KqglAssoYhkqz"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"kqzid"
property=
"kqzid"
/>
<result
column=
"userid"
property=
"userid"
/>
<result
column=
"qyid"
property=
"qyid"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id,
kqzid,
userid,
qyid
</sql>
<sql
id=
"Base_Column_List_Alias"
>
id KqglAssoYhkqz_id,
kqzid KqglAssoYhkqz_kqzid,
userid KqglAssoYhkqz_userid,
qyid KqglAssoYhkqz_qyid
</sql>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoYhkqz">
INSERT INTO kqgl_asso_yhkqz
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != kqzid'>
kqzid,
</if>
<if test ='null != userid'>
userid,
</if>
<if test ='null != qyid'>
qyid
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != kqzid'>
#{kqzid},
</if>
<if test ='null != userid'>
#{userid},
</if>
<if test ='null != qyid'>
#{qyid}
</if>
</trim>
</insert>
<delete id="delete" >
DELETE FROM kqgl_asso_yhkqz
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.kqmk.KqglAssoYhkqz">
UPDATE kqgl_asso_yhkqz
<set>
<if test ='null != kqzid'>kqzid = #{kqzid},</if>
<if test ='null != userid'>userid = #{userid},</if>
<if test ='null != qyid'>qyid = #{qyid}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_yhkqz
WHERE id = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_yhkqz
LIMIT #{offset}, #{pageSize}
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM kqgl_asso_yhkqz
</select>
-->
</mapper>
\ No newline at end of file
src/main/resources/mapping/kqmk/KqglMainKqzMapper.xml
View file @
bf0abf9c
...
...
@@ -24,6 +24,7 @@
<result
column=
"sybc"
property=
"sybc"
/>
<result
column=
"is_xzbcdk"
property=
"isXzbcdk"
/>
<result
column=
"is_wq"
property=
"isWq"
/>
<result
column=
"overtime_rules_id"
property=
"overtimeRulesId"
/>
</resultMap>
<resultMap
id=
"AuxiliaryMap"
type=
"cn.timer.api.dto.kqmk.KqglMainKqzDto"
>
...
...
@@ -47,6 +48,7 @@
<result
column=
"sybc"
property=
"sybc"
/>
<result
column=
"is_xzbcdk"
property=
"isXzbcdk"
/>
<result
column=
"is_wq"
property=
"isWq"
/>
<result
column=
"overtime_rules_id"
property=
"overtimeRulesId"
/>
<result
column=
"kqznum"
property=
"kqznum"
/>
<result
column=
"pbfsnm"
property=
"pbfsnm"
/>
...
...
@@ -74,7 +76,8 @@
is_wpbsdk,
sybc,
is_xzbcdk,
is_wq
is_wq,
overtime_rules_id
</sql>
<sql
id=
"Base_Column_List_Alias"
>
...
...
@@ -97,7 +100,8 @@
is_wpbsdk KqglMainKqz_is_wpbsdk,
sybc KqglMainKqz_sybc,
is_xzbcdk KqglMainKqz_is_xzbcdk,
is_wq KqglMainKqz_is_wq
is_wq KqglMainKqz_is_wq,
overtime_rules_id KqglMainKqz_overtime_rules_id
</sql>
<sql
id=
"Base_Column_List_a"
>
...
...
@@ -120,7 +124,8 @@
a.is_wpbsdk,
a.sybc,
a.is_xzbcdk,
a.is_wq
a.is_wq,
a.overtime_rules_id
</sql>
<select
id=
"selectAttGroupMachineByQyid"
resultMap=
"AuxiliaryMap"
>
...
...
@@ -138,6 +143,31 @@
where yhkqz.userid = #{userid,jdbcType=INTEGER} and yhkqz.qyid = #{qyid,jdbcType=INTEGER})
</select>
<select
id=
"selectPageByQueryKqglMain"
resultMap=
"AuxiliaryMap"
>
select kqz.*,
case kqz.pbfs
WHEN '1' then '固定排班'
WHEN '2' then '排班制'
else '自由工时'
end as pbfsnm,
znm.kqznum,
dkfs.type
from kqgl_main_kqz kqz
LEFT JOIN (select count(yhkqz.kqzid) as kqznum,
yhkqz.kqzid as kqzid
from kqgl_asso_yhkqz yhkqz
where yhkqz.qyid = #{param.orgCode}
GROUP BY yhkqz.kqzid) as znm on znm.kqzid = kqz.id
LEFT JOIN (select kqzdkfs.kqz_id as kqzId,kqzdkfs.type as type from kqgl_asso_kqzdkfs kqzdkfs
where kqzdkfs.qyid = #{param.orgCode} ) as dkfs on dkfs.kqzId = kqz.id
where 1=1
and kqz.qyid = #{param.orgCode}
<if
test=
"param.query != null and param.query != ''"
>
and kqz.`name` like CONCAT('%',#{param.query},'%')
</if>
</select>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglMainKqz">
...
...
@@ -198,7 +228,10 @@
is_xzbcdk,
</if>
<if test ='null != isWq'>
is_wq
is_wq,
</if>
<if test ='null != overtimeRulesId'>
overtime_rules_id
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
...
...
@@ -257,7 +290,10 @@
#{isXzbcdk},
</if>
<if test ='null != isWq'>
#{isWq}
#{isWq},
</if>
<if test ='null != overtimeRulesId'>
#{overtimeRulesId}
</if>
</trim>
</insert>
...
...
@@ -288,7 +324,8 @@
<if test ='null != isWpbsdk'>is_wpbsdk = #{isWpbsdk},</if>
<if test ='null != sybc'>sybc = #{sybc},</if>
<if test ='null != isXzbcdk'>is_xzbcdk = #{isXzbcdk},</if>
<if test ='null != isWq'>is_wq = #{isWq}</if>
<if test ='null != isWq'>is_wq = #{isWq},</if>
<if test ='null != overtimeRulesId'>overtime_rules_id = #{overtimeRulesId}</if>
</set>
WHERE id = #{id}
</update>
...
...
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