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
03976617
Commit
03976617
authored
Jul 09, 2022
by
284718418@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
假期统调
parent
897656d1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
0 deletions
+70
-0
src/main/java/cn/timer/api/bean/kqmk/KqglAssoLeaveBalance.java
+10
-0
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
+60
-0
No files found.
src/main/java/cn/timer/api/bean/kqmk/KqglAssoLeaveBalance.java
View file @
03976617
...
...
@@ -3,8 +3,10 @@ package cn.timer.api.bean.kqmk;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
javax.persistence.Transient
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.extension.activerecord.Model
;
...
...
@@ -15,6 +17,8 @@ import lombok.Builder;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
/**
* @author LAL 2020-05-09
*/
...
...
@@ -67,4 +71,9 @@ public class KqglAssoLeaveBalance extends Model<KqglAssoLeaveBalance> {
@ApiModelProperty
(
value
=
"是否为系统自动 0:否;1:是"
,
example
=
"101"
)
private
Integer
isAutomatic
;
@Transient
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"假期统调用户ID"
)
private
List
<
Integer
>
userIds
;
}
\ No newline at end of file
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
View file @
03976617
...
...
@@ -23,6 +23,7 @@ import org.springframework.http.HttpHeaders;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.util.StringUtils
;
...
...
@@ -984,6 +985,65 @@ public class TimeCardController {
}
/**
* 假期统调
*/
@PostMapping
(
value
=
"/leave_balance_all"
)
@ApiOperation
(
value
=
"假期统调"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
LeaveBalanceAll
(
@CurrentUser
UserBean
userBean
,
@RequestBody
KqglAssoLeaveBalance
balance
)
{
balance
.
setModifyUserid
(
userBean
.
getEmpNum
());
balance
.
setModifyTimer
(
new
Date
().
getTime
());
balance
.
setOrgCode
(
userBean
.
getOrgCode
());
String
balanceDays
=
"0"
;
if
(
balance
.
getModifyAction
()
==
1
)
{
//增加
balanceDays
=
"+"
+
balance
.
getBalanceDays
();
}
else
{
balanceDays
=
"-"
+
balance
.
getBalanceDays
();
}
balance
.
setBalanceDays
(
balanceDays
);
if
(!
CollectionUtils
.
isEmpty
(
balance
.
getUserIds
())){
for
(
Integer
userId
:
balance
.
getUserIds
())
{
KqglAssoLeaveBalance
balan
=
kqglassoleavebalancemapper
.
selectOne
(
new
QueryWrapper
<
KqglAssoLeaveBalance
>().
lambda
().
eq
(
KqglAssoLeaveBalance:
:
getUserid
,
userId
)
.
orderByDesc
(
KqglAssoLeaveBalance
::
getModifyNumber
).
last
(
"LIMIT 1"
));
if
(
balan
!=
null
)
{
balance
.
setModifyNumber
(
balan
.
getModifyNumber
()+
1
);
}
else
{
balance
.
setModifyNumber
(
1
);
}
balance
.
setUserid
(
userId
);
//添加成功
if
(
balance
.
insert
())
{
//查询员工假期余额表中所对应的假期id
KqglAssoLeaveEmployeeBalance
emba
=
KqglAssoLeaveEmployeeBalance
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoLeaveEmployeeBalance
>().
lambda
().
eq
(
KqglAssoLeaveEmployeeBalance:
:
getLeaveRulesId
,
balance
.
getLeaveRulesId
())
.
eq
(
KqglAssoLeaveEmployeeBalance:
:
getUserid
,
userId
).
eq
(
KqglAssoLeaveEmployeeBalance:
:
getOrgCode
,
userBean
.
getOrgCode
()));
//获取最后得到的最终余额
double
balance_days
=
kqglassoleavebalancemapper
.
Sumbalancedays
(
userId
,
userBean
.
getOrgCode
(),
balance
.
getLeaveRulesId
());
if
(
emba
!=
null
&&
balance_days
>
0
)
{
if
(
emba
.
getBalanceDays
()
!=
-
1
)
{
//确认为限制余额的
//修改最终的余额数
KqglAssoLeaveEmployeeBalance
.
builder
().
id
(
emba
.
getId
()).
balanceDays
(
balance_days
).
build
().
updateById
();
}
}
else
{
if
(
emba
.
getBalanceDays
()
!=
-
1
)
{
//确认为限制余额的
//修改最终的余额数
KqglAssoLeaveEmployeeBalance
.
builder
().
id
(
emba
.
getId
()).
balanceDays
(
0
).
build
().
updateById
();
}
}
}
}
}
return
ResultUtil
.
success
(
"操作成功!"
)
;
}
/**
* 根据考勤余额id获取信息 ||大于“0”为有数字限制 ||为“-1”时为无数字限制
*/
@GetMapping
(
value
=
"/hqleavebalance/{id}"
)
...
...
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