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
e7a0df76
Commit
e7a0df76
authored
Nov 21, 2020
by
ilal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
b10687ea
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
162 additions
and
0 deletions
+162
-0
src/main/java/cn/timer/api/controller/xcgl/SalaryManagementController.java
+137
-0
src/main/java/cn/timer/api/dto/xcgl/FixedSalaryStaffDto.java
+3
-0
src/main/java/cn/timer/api/dto/xcgl/ImportSalaryfileDto.java
+17
-0
src/main/resources/mapping/xcgl/XcglAssoXzdazdyMapper.xml
+5
-0
No files found.
src/main/java/cn/timer/api/controller/xcgl/SalaryManagementController.java
View file @
e7a0df76
...
...
@@ -1497,6 +1497,143 @@ public class SalaryManagementController {
return
ResultUtil
.
data
(
imds
,
"导入成功"
);
}
/**
* 导入薪资
* @throws ParseException
*/
@PostMapping
(
value
=
"/paysalaryfile"
)
@ApiOperation
(
value
=
"导入薪资"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
paySalaryfile
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
ValidList
<
ImportSalaryfileDto
>
impor
)
{
int
toinsert
=
0
;
//新增
int
toupdate
=
0
;
//更新
int
failure
=
0
;
//失败
List
<
Map
<
String
,
String
>>
reasons
=
Lists
.
newArrayList
();
for
(
ImportSalaryfileDto
file
:
impor
)
{
String
name
=
file
.
getEmpname
();
Map
<
String
,
String
>
map
=
Maps
.
newHashMap
();
try
{
YgglMainEmp
emp
=
YgglMainEmp
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>().
lambda
().
eq
(
YgglMainEmp:
:
getName
,
file
.
getEmpname
()).
eq
(
YgglMainEmp:
:
getPhone
,
file
.
getPhone
())
.
eq
(
YgglMainEmp:
:
getOrgCode
,
userBean
.
getOrgCode
()));
if
(
emp
!=
null
)
{
//0:定薪 1:调薪
if
(
file
.
getSfdx
()
==
0
)
{
XcglAssoXzdadx
xzdadx
=
XcglAssoXzdadx
.
builder
().
build
();
xzdadx
.
setUserid
(
emp
.
getEmpNum
());
//用户id
xzdadx
.
setSxrq
(
file
.
getSxrq
());
//生效日期
xzdadx
.
setAddtime
(
new
Date
().
getTime
());
xzdadx
.
setRemarks
(
""
);
xzdadx
.
setQyid
(
userBean
.
getOrgCode
());
xzdadx
.
setTxzt
(
0
);
//0:使用中;1:历史, 2: 未生效
xcglassoxzdadxmapper
.
xzdadxinsert
(
xzdadx
);
int
zdyid
=
xzdadx
.
getId
();
List
<
XcglAssoXzdaz
>
xzdazlist
=
new
ArrayList
<
XcglAssoXzdaz
>();
CustomDto
[]
cus
=
file
.
getCus
();
List
<
XcglAssoXzdazdy
>
xzs
=
XcglAssoXzdazdy
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
XcglAssoXzdazdy
>().
lambda
().
eq
(
XcglAssoXzdazdy:
:
getQyid
,
userBean
.
getOrgCode
()));
for
(
XcglAssoXzdazdy
xz
:
xzs
)
{
XcglAssoXzdaz
xzdaz
=
XcglAssoXzdaz
.
builder
().
build
();
xzdaz
.
setXzdazdyid
(
xz
.
getId
());
//薪资档案自定义id
xzdaz
.
setRsz
(
"0"
);
//输入值
xzdaz
.
setXzdadxid
(
zdyid
);
//薪资档案-定薪id
xzdaz
.
insert
();
}
if
(
cus
.
length
>
0
){
for
(
int
p
=
0
;
p
<
cus
.
length
;
p
++){
XcglAssoXzdaz
.
builder
().
build
().
delete
(
new
QueryWrapper
<
XcglAssoXzdaz
>().
lambda
().
eq
(
XcglAssoXzdaz:
:
getXzdazdyid
,
cus
[
p
].
getId
()).
eq
(
XcglAssoXzdaz:
:
getXzdadxid
,
zdyid
));
XcglAssoXzdaz
xzdaz
=
new
XcglAssoXzdaz
();
xzdaz
.
setXzdazdyid
(
cus
[
p
].
getId
());
//薪资档案自定义id
xzdaz
.
setRsz
(
cus
[
p
].
getVal
());
//输入值
xzdaz
.
setXzdadxid
(
zdyid
);
//薪资档案-定薪id
xzdazlist
.
add
(
xzdaz
);
}
}
if
(
xzdazlist
.
size
()>
0
){
xcglassoxzdazmapper
.
insertxcglassoxzdazList
(
xzdazlist
);
}
toinsert
++;
}
else
{
// 当前日期
String
curDate
=
DateUtil
.
getStringFormat
(
new
Date
().
getTime
());
// 未生效的调薪记录同一天只能有一条
XcglAssoXzdadx
tmp
=
new
LambdaQueryChainWrapper
<
XcglAssoXzdadx
>(
xcglassoxzdadxmapper
)
.
eq
(
XcglAssoXzdadx:
:
getUserid
,
emp
.
getEmpNum
())
.
eq
(
XcglAssoXzdadx:
:
getTxzt
,
2
)
.
eq
(
XcglAssoXzdadx:
:
getSxrq
,
file
.
getSxrq
())
.
one
();
if
(!
Objects
.
isNull
(
tmp
))
{
return
ResultUtil
.
error
(
"调薪成功失败, 已存在生效日期"
+
file
.
getSxrq
()
+
"的待生效记录, 请到调薪记录页面查看!"
);
}
int
txzt
=
2
;
if
(
DateUtil
.
getFormat
(
file
.
getSxrq
())
<=
DateUtil
.
getFormat
(
curDate
))
{
// 生效日期在当天或之前的, 立即生效, 原使用中的记录变成历史记录
XcglAssoXzdadx
xzds
=
new
LambdaQueryChainWrapper
<
XcglAssoXzdadx
>(
xcglassoxzdadxmapper
)
.
eq
(
XcglAssoXzdadx:
:
getUserid
,
emp
.
getEmpNum
())
.
eq
(
XcglAssoXzdadx:
:
getTxzt
,
0
)
.
one
();
if
(
xzds
!=
null
)
{
XcglAssoXzdadx
txrz
=
XcglAssoXzdadx
.
builder
().
build
();
txrz
.
setTxzt
(
1
);
//0:使用中;1:历史, 2: 未生效
txrz
.
setId
(
xzds
.
getId
());
txrz
.
updateById
();
}
txzt
=
0
;
}
XcglAssoXzdadx
xzdadx
=
XcglAssoXzdadx
.
builder
().
build
();
xzdadx
.
setUserid
(
emp
.
getEmpNum
());
//用户id
xzdadx
.
setSxrq
(
file
.
getSxrq
());
//生效日期
xzdadx
.
setAddtime
(
new
Date
().
getTime
());
xzdadx
.
setXgyhid
(
userBean
.
getEmpNum
());
//修改用户id
xzdadx
.
setRemarks
(
""
);
xzdadx
.
setQyid
(
userBean
.
getOrgCode
());
xzdadx
.
setTxzt
(
txzt
);
xcglassoxzdadxmapper
.
xzdadxinsert
(
xzdadx
);
int
zdyid
=
xzdadx
.
getId
();
List
<
XcglAssoXzdaz
>
xzdazlist
=
new
ArrayList
<
XcglAssoXzdaz
>();
CustomDto
[]
cus
=
file
.
getCus
();
if
(
cus
.
length
>
0
){
for
(
int
p
=
0
;
p
<
cus
.
length
;
p
++){
XcglAssoXzdaz
xzdaz
=
new
XcglAssoXzdaz
();
xzdaz
.
setXzdazdyid
(
cus
[
p
].
getId
());
//薪资档案自定义id
xzdaz
.
setRsz
(
cus
[
p
].
getVal
());
//输入值
xzdaz
.
setXzdadxid
(
zdyid
);
//薪资档案-定薪id
xzdazlist
.
add
(
xzdaz
);
}
}
if
(
xzdazlist
.
size
()>
0
){
xcglassoxzdazmapper
.
insertxcglassoxzdazList
(
xzdazlist
);
}
toinsert
++;
}
}
else
{
failure
++;
map
.
put
(
"name"
,
name
);
map
.
put
(
"msg"
,
"该员工不存在"
);
reasons
.
add
(
map
);
}
}
catch
(
Exception
e
)
{
failure
++;
map
.
put
(
"name"
,
name
);
map
.
put
(
"msg"
,
StringUtils
.
isBlank
(
e
.
getMessage
())
?
"必填数据出现空值"
:
e
.
getMessage
());
reasons
.
add
(
map
);
}
}
ImportDescriptionDto
imds
=
new
ImportDescriptionDto
();
imds
.
setSuccess
(
toinsert
+
toupdate
);
//成功
imds
.
setToinsert
(
toinsert
);
imds
.
setToupdate
(
toupdate
);
//更新
imds
.
setFailure
(
failure
);
//失败
imds
.
setReasons
(
reasons
);
return
ResultUtil
.
data
(
imds
,
"成功"
);
}
@PostMapping
(
value
=
"/determinesalaryrules"
)
@ApiOperation
(
value
=
"是否确定薪资规则"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
DetermineSalaryRules
(
@CurrentUser
UserBean
userBean
,
@RequestBody
SalaryRulesDto
salaryrulesdto
)
{
...
...
src/main/java/cn/timer/api/dto/xcgl/FixedSalaryStaffDto.java
View file @
e7a0df76
...
...
@@ -31,5 +31,8 @@ public class FixedSalaryStaffDto implements Serializable {
int
id
;
String
remarks
;
//备注
String
phone
;
//
String
sxrq
;
//
List
<
DefinedItemsDto
>
defdto
=
new
ArrayList
<
DefinedItemsDto
>();
}
src/main/java/cn/timer/api/dto/xcgl/ImportSalaryfileDto.java
0 → 100644
View file @
e7a0df76
package
cn
.
timer
.
api
.
dto
.
xcgl
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
ImportSalaryfileDto
{
String
empname
;
// 用户姓名
String
phone
;
// 电话号码
String
sxrq
;
// 生效日期
Integer
sfdx
;
//0:定薪 1:调薪
CustomDto
[]
cus
;
// 自定义输入值
}
src/main/resources/mapping/xcgl/XcglAssoXzdazdyMapper.xml
View file @
e7a0df76
...
...
@@ -24,6 +24,9 @@
<result
column=
"tratime"
property=
"tratime"
/>
<result
column=
"txzt"
property=
"txzt"
/>
<result
column=
"remarks"
property=
"remarks"
/>
<result
column=
"phone"
property=
"phone"
/>
<result
column=
"sxrq"
property=
"sxrq"
/>
<collection
property=
"defdto"
ofType=
"cn.timer.api.dto.xcgl.DefinedItemsDto"
>
...
...
@@ -202,6 +205,8 @@
when 1 then '正式'
when 2 then '离职中'
else '已离职' end as empjobstatus,
emp.phone,
(select xsz.sxrq from xcgl_asso_xzdadx xsz where xsz.txzt = 0 and xsz.userid = emp.emp_num) as sxrq,
SUBSTR(emp.rz_time,1,10) emprztime ,
SUBSTR(emp.zz_time,1,10) empzztime,
IF(dadx.userid IS NOT NULL,1,0) as sfdx,
...
...
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