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
7619f8eb
Commit
7619f8eb
authored
Oct 30, 2020
by
mobh
Browse files
Options
Browse Files
Download
Plain Diff
修改冲突
parents
b66f5115
1bf44f61
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
291 additions
and
138 deletions
+291
-138
src/main/java/cn/timer/api/bean/xcgl/XcglAssoXzdadx.java
+1
-1
src/main/java/cn/timer/api/controller/xcgl/SalaryManagementController.java
+107
-39
src/main/java/cn/timer/api/controller/xcgl/atttimer/SalaryTaskTiming.java
+114
-0
src/main/java/cn/timer/api/dao/xcgl/XcglAssoXzdadxMapper.java
+11
-0
src/main/java/cn/timer/api/dao/xcgl/XcglAssoXzdazdyMapper.java
+3
-2
src/main/java/cn/timer/api/dto/xcgl/CustomDto.java
+1
-1
src/main/java/cn/timer/api/dto/xcgl/FixedSalaryStaffDto.java
+2
-0
src/main/java/cn/timer/api/dto/xcgl/FixedsalaryDto.java
+2
-1
src/main/java/cn/timer/api/utils/DateUtil.java
+0
-45
src/main/java/cn/timer/api/utils/Page.java
+11
-2
src/main/resources/mapping/xcgl/XcglAssoGztztMapper.xml
+1
-1
src/main/resources/mapping/xcgl/XcglAssoXzdadxMapper.xml
+9
-34
src/main/resources/mapping/xcgl/XcglAssoXzdazdyMapper.xml
+29
-12
No files found.
src/main/java/cn/timer/api/bean/xcgl/XcglAssoXzdadx.java
View file @
7619f8eb
...
@@ -62,7 +62,7 @@ public class XcglAssoXzdadx extends Model<XcglAssoXzdadx> {
...
@@ -62,7 +62,7 @@ public class XcglAssoXzdadx extends Model<XcglAssoXzdadx> {
@ApiModelProperty
(
value
=
"企业id"
,
example
=
"117"
)
@ApiModelProperty
(
value
=
"企业id"
,
example
=
"117"
)
private
Integer
qyid
;
private
Integer
qyid
;
@ApiModelProperty
(
value
=
"使用状态(0:使用中;1:历史)"
,
example
=
"0"
)
@ApiModelProperty
(
value
=
"使用状态(0:使用中;1:历史
, 2: 未生效
)"
,
example
=
"0"
)
private
Integer
txzt
;
private
Integer
txzt
;
...
...
src/main/java/cn/timer/api/controller/xcgl/SalaryManagementController.java
View file @
7619f8eb
...
@@ -3,19 +3,13 @@ package cn.timer.api.controller.xcgl;
...
@@ -3,19 +3,13 @@ package cn.timer.api.controller.xcgl;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Arrays
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.script.ScriptEngine
;
import
javax.script.ScriptEngine
;
import
javax.script.ScriptEngineManager
;
import
javax.script.ScriptEngineManager
;
import
javax.script.ScriptException
;
import
javax.script.ScriptException
;
import
cn.timer.api.bean.sbgjj.SbgjjAssoCbfa
;
import
cn.timer.api.dto.xcgl.*
;
import
cn.timer.api.dto.xcgl.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
...
@@ -841,8 +835,10 @@ public class SalaryManagementController {
...
@@ -841,8 +835,10 @@ public class SalaryManagementController {
search
.
getCurrentPage
()
==
null
?
1
:
search
.
getCurrentPage
(),
search
.
getCurrentPage
()
==
null
?
1
:
search
.
getCurrentPage
(),
search
.
getTotalPage
()
==
null
?
10
:
search
.
getTotalPage
());
search
.
getTotalPage
()
==
null
?
10
:
search
.
getTotalPage
());
IPage
<
FixedSalaryStaffDto
>
dxrypage
=
xcglassoxzdazdymapper
.
selectFixedSalaryStaff
(
page
,
search
);
//
long
total
=
xcglassoxzdazdymapper
.
selectFixedSalaryStaffCount
(
search
);
return
ResultUtil
.
data
(
dxrypage
,
dxrypage
.
getRecords
(),
"获取自定义薪资组表头信息"
);
List
<
FixedSalaryStaffDto
>
dxrylist
=
xcglassoxzdazdymapper
.
selectFixedSalaryStaff
(
search
);
page
.
setTotal
(
total
);
return
ResultUtil
.
data
(
page
,
dxrylist
,
"获取自定义薪资组表头信息"
);
}
}
/**
/**
...
@@ -958,12 +954,12 @@ public class SalaryManagementController {
...
@@ -958,12 +954,12 @@ public class SalaryManagementController {
@ApiOperation
(
value
=
"定薪"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperation
(
value
=
"定薪"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
public
ResponseResult
fixedsalary
(
@CurrentUser
UserBean
userBean
,
@RequestBody
FixedsalaryDto
fixedsalarydto
)
{
public
ResponseResult
fixedsalary
(
@CurrentUser
UserBean
userBean
,
@RequestBody
FixedsalaryDto
fixedsalarydto
)
{
XcglAssoXzdadx
xzdadx
=
XcglAssoXzdadx
.
builder
().
build
();
XcglAssoXzdadx
xzdadx
=
XcglAssoXzdadx
.
builder
().
build
();
xzdadx
.
setUserid
(
Integer
.
valueOf
(
fixedsalarydto
.
get
I
d
()));
//用户id
xzdadx
.
setUserid
(
Integer
.
valueOf
(
fixedsalarydto
.
get
Useri
d
()));
//用户id
xzdadx
.
setSxrq
(
fixedsalarydto
.
getSxrq
());
//生效日期
xzdadx
.
setSxrq
(
fixedsalarydto
.
getSxrq
());
//生效日期
xzdadx
.
setAddtime
(
new
Date
().
getTime
());
xzdadx
.
setAddtime
(
new
Date
().
getTime
());
xzdadx
.
setRemarks
(
fixedsalarydto
.
getRemarks
());
xzdadx
.
setRemarks
(
fixedsalarydto
.
getRemarks
());
xzdadx
.
setQyid
(
userBean
.
getOrgCode
());
xzdadx
.
setQyid
(
userBean
.
getOrgCode
());
xzdadx
.
setTxzt
(
0
);
//0:使用中;1:
最近使用;2:历史
xzdadx
.
setTxzt
(
0
);
//0:使用中;1:
历史, 2: 未生效
xcglassoxzdadxmapper
.
xzdadxinsert
(
xzdadx
);
xcglassoxzdadxmapper
.
xzdadxinsert
(
xzdadx
);
int
zdyid
=
xzdadx
.
getId
();
int
zdyid
=
xzdadx
.
getId
();
List
<
XcglAssoXzdaz
>
xzdazlist
=
new
ArrayList
<
XcglAssoXzdaz
>();
List
<
XcglAssoXzdaz
>
xzdazlist
=
new
ArrayList
<
XcglAssoXzdaz
>();
...
@@ -1010,39 +1006,57 @@ public class SalaryManagementController {
...
@@ -1010,39 +1006,57 @@ public class SalaryManagementController {
@PostMapping
(
value
=
"/payensaad"
)
@PostMapping
(
value
=
"/payensaad"
)
@ApiOperation
(
value
=
"调薪"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperation
(
value
=
"调薪"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
public
ResponseResult
EnterSalaryAdjustment
(
@CurrentUser
UserBean
userBean
,
@RequestBody
FixedsalaryDto
fixedsalarydto
)
{
public
ResponseResult
EnterSalaryAdjustment
(
@CurrentUser
UserBean
userBean
,
@RequestBody
FixedsalaryDto
fixedsalarydto
)
{
XcglAssoXzdadx
xzds
=
new
LambdaQueryChainWrapper
<
XcglAssoXzdadx
>(
xcglassoxzdadxmapper
).
eq
(
XcglAssoXzdadx:
:
getUserid
,
Integer
.
valueOf
(
fixedsalarydto
.
getId
())).
eq
(
XcglAssoXzdadx:
:
getTxzt
,
0
).
one
();
// 当前日期
String
curDate
=
DateUtil
.
getStringFormat
(
new
Date
().
getTime
());
// 未生效的调薪记录同一天只能有一条
XcglAssoXzdadx
tmp
=
new
LambdaQueryChainWrapper
<
XcglAssoXzdadx
>(
xcglassoxzdadxmapper
)
.
eq
(
XcglAssoXzdadx:
:
getUserid
,
Integer
.
valueOf
(
fixedsalarydto
.
getUserid
()))
.
eq
(
XcglAssoXzdadx:
:
getTxzt
,
2
)
.
eq
(
XcglAssoXzdadx:
:
getSxrq
,
fixedsalarydto
.
getSxrq
())
.
one
();
if
(!
Objects
.
isNull
(
tmp
))
{
return
new
ResponseResult
().
fail
(
"调薪成功失败, 已存在生效日期"
+
fixedsalarydto
.
getSxrq
()
+
"的待生效记录, 请到调薪记录页面查看!"
);
}
int
txzt
=
2
;
if
(
curDate
.
equals
(
fixedsalarydto
.
getSxrq
()))
{
// 生效日期在当天, 立即生效, 原使用中的记录变成历史记录
XcglAssoXzdadx
xzds
=
new
LambdaQueryChainWrapper
<
XcglAssoXzdadx
>(
xcglassoxzdadxmapper
)
.
eq
(
XcglAssoXzdadx:
:
getUserid
,
Integer
.
valueOf
(
fixedsalarydto
.
getUserid
()))
.
eq
(
XcglAssoXzdadx:
:
getTxzt
,
0
)
.
one
();
if
(
xzds
!=
null
)
{
if
(
xzds
!=
null
)
{
XcglAssoXzdadx
txrz
=
XcglAssoXzdadx
.
builder
().
build
();
XcglAssoXzdadx
txrz
=
XcglAssoXzdadx
.
builder
().
build
();
txrz
.
setTxzt
(
1
);
//
使用状态(0:使用中;1:历史
txrz
.
setTxzt
(
1
);
//
0:使用中;1:历史, 2: 未生效
txrz
.
setId
(
xzds
.
getId
());
txrz
.
setId
(
xzds
.
getId
());
txrz
.
updateById
();
txrz
.
updateById
();
XcglAssoXzdadx
xzdadx
=
XcglAssoXzdadx
.
builder
().
build
();
xzdadx
.
setUserid
(
Integer
.
valueOf
(
fixedsalarydto
.
getId
()));
//用户id
xzdadx
.
setSxrq
(
fixedsalarydto
.
getSxrq
());
//生效日期
xzdadx
.
setAddtime
(
new
Date
().
getTime
());
xzdadx
.
setXgyhid
(
userBean
.
getEmpNum
());
//修改用户id
xzdadx
.
setRemarks
(
fixedsalarydto
.
getRemarks
());
xzdadx
.
setQyid
(
userBean
.
getOrgCode
());
xzdadx
.
setTxzt
(
0
);
//0:使用中;1:历史
xcglassoxzdadxmapper
.
xzdadxinsert
(
xzdadx
);
int
zdyid
=
xzdadx
.
getId
();
List
<
XcglAssoXzdaz
>
xzdazlist
=
new
ArrayList
<
XcglAssoXzdaz
>();
CustomDto
[]
cus
=
fixedsalarydto
.
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
);
}
return
new
ResponseResult
().
success
(
"调薪成功"
,
xzdadx
);
}
}
return
new
ResponseResult
().
error
(
"调薪失败"
);
txzt
=
0
;
}
XcglAssoXzdadx
xzdadx
=
XcglAssoXzdadx
.
builder
().
build
();
xzdadx
.
setUserid
(
Integer
.
valueOf
(
fixedsalarydto
.
getUserid
()));
//用户id
xzdadx
.
setSxrq
(
fixedsalarydto
.
getSxrq
());
//生效日期
xzdadx
.
setAddtime
(
new
Date
().
getTime
());
xzdadx
.
setXgyhid
(
userBean
.
getEmpNum
());
//修改用户id
xzdadx
.
setRemarks
(
fixedsalarydto
.
getRemarks
());
xzdadx
.
setQyid
(
userBean
.
getOrgCode
());
xzdadx
.
setTxzt
(
txzt
);
xcglassoxzdadxmapper
.
xzdadxinsert
(
xzdadx
);
int
zdyid
=
xzdadx
.
getId
();
List
<
XcglAssoXzdaz
>
xzdazlist
=
new
ArrayList
<
XcglAssoXzdaz
>();
CustomDto
[]
cus
=
fixedsalarydto
.
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
);
}
return
new
ResponseResult
().
success
(
"调薪成功"
,
xzdadx
);
}
}
/**
/**
...
@@ -1054,6 +1068,60 @@ public class SalaryManagementController {
...
@@ -1054,6 +1068,60 @@ public class SalaryManagementController {
List
<
FixedSalaryStaffDto
>
txjllist
=
xcglassoxzdazdymapper
.
SalaryAdjustmentRecord
(
userBean
.
getOrgCode
(),
id
);
List
<
FixedSalaryStaffDto
>
txjllist
=
xcglassoxzdazdymapper
.
SalaryAdjustmentRecord
(
userBean
.
getOrgCode
(),
id
);
return
new
ResponseResult
().
success
(
"获取调薪记录信息"
,
txjllist
);
return
new
ResponseResult
().
success
(
"获取调薪记录信息"
,
txjllist
);
}
}
/**
* 调薪记录编辑保存
*/
@PostMapping
(
value
=
"/saveTXjlEdit"
)
@ApiOperation
(
value
=
"调薪"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
public
ResponseResult
saveTXjlEdit
(
@CurrentUser
UserBean
userBean
,
@RequestBody
FixedsalaryDto
fixedsalarydto
)
{
// 当前日期
String
curDate
=
DateUtil
.
getStringFormat
(
new
Date
().
getTime
());
// 未生效的调薪记录同一天只能有一条
XcglAssoXzdadx
tmp
=
new
LambdaQueryChainWrapper
<
XcglAssoXzdadx
>(
xcglassoxzdadxmapper
)
.
eq
(
XcglAssoXzdadx:
:
getUserid
,
Integer
.
valueOf
(
fixedsalarydto
.
getUserid
()))
.
eq
(
XcglAssoXzdadx:
:
getTxzt
,
2
)
.
eq
(
XcglAssoXzdadx:
:
getSxrq
,
fixedsalarydto
.
getSxrq
())
.
one
();
if
(!
Objects
.
isNull
(
tmp
)
&&
!
tmp
.
getId
().
equals
(
fixedsalarydto
.
getId
()))
{
return
new
ResponseResult
().
fail
(
"调薪成功失败, 已存在生效日期"
+
fixedsalarydto
.
getSxrq
()
+
"的待生效记录, 请到调薪记录页面查看!"
);
}
int
txzt
=
2
;
if
(
curDate
.
equals
(
fixedsalarydto
.
getSxrq
()))
{
// 生效日期在当天, 立即生效, 原使用中的记录变成历史记录
XcglAssoXzdadx
xzds
=
new
LambdaQueryChainWrapper
<
XcglAssoXzdadx
>(
xcglassoxzdadxmapper
)
.
eq
(
XcglAssoXzdadx:
:
getUserid
,
Integer
.
valueOf
(
fixedsalarydto
.
getUserid
()))
.
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
=
new
XcglAssoXzdadx
();
xzdadx
.
setId
(
fixedsalarydto
.
getId
());
xzdadx
.
setSxrq
(
fixedsalarydto
.
getSxrq
());
//生效日期
xzdadx
.
setAddtime
(
new
Date
().
getTime
());
xzdadx
.
setXgyhid
(
userBean
.
getEmpNum
());
//修改用户id
xzdadx
.
setRemarks
(
fixedsalarydto
.
getRemarks
());
xzdadx
.
setTxzt
(
txzt
);
xcglassoxzdadxmapper
.
updateById
(
xzdadx
);
CustomDto
[]
cus
=
fixedsalarydto
.
getCus
();
if
(
cus
.
length
>
0
){
for
(
int
p
=
0
;
p
<
cus
.
length
;
p
++){
XcglAssoXzdaz
xzdaz
=
new
XcglAssoXzdaz
();
xzdaz
.
setId
(
cus
[
p
].
getId
());
xzdaz
.
setRsz
(
cus
[
p
].
getVal
());
//输入值
xcglassoxzdazmapper
.
updateById
(
xzdaz
);
}
}
return
new
ResponseResult
().
success
(
"保存成功"
);
}
/**
/**
* 删除调薪记录
* 删除调薪记录
...
...
src/main/java/cn/timer/api/controller/xcgl/atttimer/SalaryTaskTiming.java
0 → 100644
View file @
7619f8eb
package
cn
.
timer
.
api
.
controller
.
xcgl
.
atttimer
;
import
java.text.DateFormat
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Locale
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.timer.api.bean.xcgl.XcglAssoXzdadx
;
import
cn.timer.api.bean.xcgl.XcglAssoXzdaz
;
import
cn.timer.api.dao.xcgl.XcglAssoXzdadxMapper
;
import
com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
cn.timer.api.bean.kqgl.AttendanceWeeklySch
;
import
cn.timer.api.bean.kqgl.PunchCardDetails
;
import
cn.timer.api.bean.kqgl.PunchRecord
;
import
cn.timer.api.bean.kqgl.Schedule
;
import
cn.timer.api.bean.kqmk.KqglAssoBcsz
;
import
cn.timer.api.bean.kqmk.KqglAssoDkmx
;
import
cn.timer.api.bean.kqmk.KqglAssoLeaveRules
;
import
cn.timer.api.bean.kqmk.KqglAssoMonthPunchSummary
;
import
cn.timer.api.bean.kqmk.KqglAssoOvertimeBasics
;
import
cn.timer.api.bean.kqmk.KqglAssoPbmx
;
import
cn.timer.api.bean.kqmk.KqglAssoRelationSummary
;
import
cn.timer.api.bean.kqmk.KqglAssoTeshu
;
import
cn.timer.api.bean.kqmk.KqglAssoZhoupaiban
;
import
cn.timer.api.bean.kqmk.KqglMainKqz
;
import
cn.timer.api.bean.kqmk.KqmkRedletterDay
;
import
cn.timer.api.bean.qyzx.QyzxEntInfoM
;
import
cn.timer.api.bean.yggl.YgglMainLzb
;
import
cn.timer.api.controller.kqgl.ClockInController
;
import
cn.timer.api.controller.kqgl.ClockInTool
;
import
cn.timer.api.controller.kqgl.EmptyUtil
;
import
cn.timer.api.dao.kqgl.AttendanceWeeklySchMapper
;
import
cn.timer.api.dao.kqgl.PunchCardDetailsMapper
;
import
cn.timer.api.dao.kqgl.PunchRecordMapper
;
import
cn.timer.api.dao.kqgl.ScheduleMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoDkmxMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoLeaveBalanceMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoRelationSummaryMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoTeshuMapper
;
import
cn.timer.api.dao.kqmk.KqglMainKqzMapper
;
import
cn.timer.api.dao.qyzx.QyzxEntInfoMMapper
;
import
cn.timer.api.dto.kqmk.AdditionalDto
;
import
cn.timer.api.dto.kqmk.AttSchedule
;
import
cn.timer.api.dto.kqmk.AttSubsidiaryDto
;
import
cn.timer.api.dto.kqmk.AttendanceCardListDto
;
import
cn.timer.api.utils.DateUtil
;
import
javax.annotation.Resource
;
/**
* 调薪记录生效定时任务
*/
//@Component
//@Lazy
@Configuration
//1.主要用于标记配置类,兼备Component的效果。
@EnableScheduling
// 2.开启定时任务
public
class
SalaryTaskTiming
{
// 薪酬管理-定薪
@Resource
private
XcglAssoXzdadxMapper
xcglassoxzdadxmapper
;
//3.添加定时任务 每天凌晨1点执行一次
@Scheduled
(
cron
=
"0 0 1 * * ?"
)
public
void
AttendanceTask
()
throws
ParseException
{
// 使用状态(0:使用中;1:历史, 2: 未生效)
// 当前日期
String
curDate
=
DateUtil
.
getStringFormat
(
new
Date
().
getTime
());
// 获取小于等于当前日期的未生效数据
List
<
XcglAssoXzdadx
>
xzdxlist
=
xcglassoxzdadxmapper
.
listIneffective
(
curDate
);
if
(
CollectionUtil
.
isNotEmpty
(
xzdxlist
))
{
xzdxlist
.
forEach
(
o
->
{
// 将使用中的薪资数据置为历史
XcglAssoXzdadx
dadxUsed
=
new
LambdaQueryChainWrapper
<
XcglAssoXzdadx
>(
xcglassoxzdadxmapper
)
.
eq
(
XcglAssoXzdadx:
:
getUserid
,
o
.
getUserid
())
.
eq
(
XcglAssoXzdadx:
:
getTxzt
,
0
).
one
();
dadxUsed
.
setTxzt
(
1
);
xcglassoxzdadxmapper
.
updateById
(
dadxUsed
);
// 将未生效的薪资数据置为使用中
o
.
setTxzt
(
0
);
xcglassoxzdadxmapper
.
updateById
(
o
);
});
}
// 处理出现多个使用中的错误数据, list 按工号、生效日期升序
List
<
XcglAssoXzdadx
>
listRepeat
=
xcglassoxzdadxmapper
.
listRepeatUsed
();
if
(
CollectionUtil
.
isNotEmpty
(
listRepeat
))
{
for
(
int
i
=
0
;
i
<
listRepeat
.
size
();
i
++)
{
XcglAssoXzdadx
xzdadx
=
listRepeat
.
get
(
i
);
while
((
i
+
1
)
<
listRepeat
.
size
()
&&
xzdadx
.
getUserid
().
equals
(
listRepeat
.
get
(
i
+
1
).
getUserid
()))
{
xzdadx
.
setTxzt
(
1
);
xcglassoxzdadxmapper
.
updateById
(
xzdadx
);
xzdadx
=
listRepeat
.
get
(
i
+
1
);
i
=
i
+
1
;
}
}
}
}
}
src/main/java/cn/timer/api/dao/xcgl/XcglAssoXzdadxMapper.java
View file @
7619f8eb
...
@@ -2,6 +2,7 @@ package cn.timer.api.dao.xcgl;
...
@@ -2,6 +2,7 @@ package cn.timer.api.dao.xcgl;
import
java.util.List
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
...
@@ -16,4 +17,14 @@ public interface XcglAssoXzdadxMapper extends BaseMapper<XcglAssoXzdadx> {
...
@@ -16,4 +17,14 @@ public interface XcglAssoXzdadxMapper extends BaseMapper<XcglAssoXzdadx> {
int
xzdadxinsert
(
XcglAssoXzdadx
xcglassoxzdadx
);
int
xzdadxinsert
(
XcglAssoXzdadx
xcglassoxzdadx
);
int
insertxcglassoxzdadxList
(
List
<
XcglAssoXzdadx
>
xcglassoxzdadx
);
int
insertxcglassoxzdadxList
(
List
<
XcglAssoXzdadx
>
xcglassoxzdadx
);
/**
* 获取小于等于当前日期的未生效数据 yyyy-mm-dd
*/
List
<
XcglAssoXzdadx
>
listIneffective
(
@Param
(
"curDate"
)
String
curDate
);
/**
* 获取使用中多于1条数据的记录
*/
List
<
XcglAssoXzdadx
>
listRepeatUsed
();
}
}
src/main/java/cn/timer/api/dao/xcgl/XcglAssoXzdazdyMapper.java
View file @
7619f8eb
...
@@ -25,8 +25,9 @@ public interface XcglAssoXzdazdyMapper extends BaseMapper<XcglAssoXzdazdy> {
...
@@ -25,8 +25,9 @@ public interface XcglAssoXzdazdyMapper extends BaseMapper<XcglAssoXzdazdy> {
int
dazdyupdate
(
XcglAssoXzdazdy
xcglassoxzdazdy
);
int
dazdyupdate
(
XcglAssoXzdazdy
xcglassoxzdazdy
);
IPage
<
FixedSalaryStaffDto
>
selectFixedSalaryStaff
(
IPage
<
FixedSalaryStaffDto
>
page
,
@Param
(
"param"
)
SearchSalariedPeopleDto
search
);
long
selectFixedSalaryStaffCount
(
@Param
(
"param"
)
SearchSalariedPeopleDto
search
);
List
<
FixedSalaryStaffDto
>
selectFixedSalaryStaff
(
@Param
(
"param"
)
SearchSalariedPeopleDto
search
);
List
<
ChangeSalaryDto
>
AchieveSalaryAdjustment
(
Integer
orgcode
,
Integer
empnum
);
List
<
ChangeSalaryDto
>
AchieveSalaryAdjustment
(
Integer
orgcode
,
Integer
empnum
);
List
<
FixedSalaryStaffDto
>
SalaryAdjustmentRecord
(
Integer
orgcode
,
Integer
empnum
);
List
<
FixedSalaryStaffDto
>
SalaryAdjustmentRecord
(
Integer
orgcode
,
Integer
empnum
);
...
...
src/main/java/cn/timer/api/dto/xcgl/CustomDto.java
View file @
7619f8eb
...
@@ -15,6 +15,6 @@ public class CustomDto implements Serializable {
...
@@ -15,6 +15,6 @@ public class CustomDto implements Serializable {
*/
*/
private
static
final
long
serialVersionUID
=
-
7594521197951361545L
;
private
static
final
long
serialVersionUID
=
-
7594521197951361545L
;
Integer
id
;
//
薪资档案自定义
id
Integer
id
;
//
记录
id
String
val
;
// 输入值
String
val
;
// 输入值
}
}
src/main/java/cn/timer/api/dto/xcgl/FixedSalaryStaffDto.java
View file @
7619f8eb
...
@@ -27,7 +27,9 @@ public class FixedSalaryStaffDto implements Serializable {
...
@@ -27,7 +27,9 @@ public class FixedSalaryStaffDto implements Serializable {
String
empzztime
;
// 转正日期
String
empzztime
;
// 转正日期
int
sfdx
;
//是否定薪 0:无;1:有
int
sfdx
;
//是否定薪 0:无;1:有
String
tratime
;
//调薪日期
String
tratime
;
//调薪日期
Integer
txzt
;
//使用状态 0:使用中;1:历史, 2 未生效
int
id
;
int
id
;
String
remarks
;
//备注
List
<
DefinedItemsDto
>
defdto
=
new
ArrayList
<
DefinedItemsDto
>();
List
<
DefinedItemsDto
>
defdto
=
new
ArrayList
<
DefinedItemsDto
>();
}
}
src/main/java/cn/timer/api/dto/xcgl/FixedsalaryDto.java
View file @
7619f8eb
...
@@ -15,7 +15,8 @@ public class FixedsalaryDto implements Serializable {
...
@@ -15,7 +15,8 @@ public class FixedsalaryDto implements Serializable {
*/
*/
private
static
final
long
serialVersionUID
=
2239288307511437403L
;
private
static
final
long
serialVersionUID
=
2239288307511437403L
;
CustomDto
[]
cus
;
// 自定义输入值
CustomDto
[]
cus
;
// 自定义输入值
String
id
;
// 用户工号
String
user
id
;
// 用户工号
String
remarks
;
// 备注
String
remarks
;
// 备注
String
sxrq
;
// 生效日期
String
sxrq
;
// 生效日期
Integer
id
;
// 记录ID
}
}
src/main/java/cn/timer/api/utils/DateUtil.java
View file @
7619f8eb
...
@@ -479,49 +479,4 @@ public class DateUtil {
...
@@ -479,49 +479,4 @@ public class DateUtil {
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
calendar
.
getActualMinimum
(
Calendar
.
DAY_OF_MONTH
));
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
calendar
.
getActualMinimum
(
Calendar
.
DAY_OF_MONTH
));
return
dft
.
format
(
calendar
.
getTime
());
return
dft
.
format
(
calendar
.
getTime
());
}
}
public
static
void
main
(
String
[]
args
)
throws
ParseException
{
// System.out.println(getStartTime(0).getTime());
// System.out.println(getnowEndTime(23).getTime());
// long ts=getStartTime(0).getTime();
// System.out.println(getnowEndTime(23).getTime());
// System.out.println(getStringFormat(ts));
// String time=getStringFormat(ts);
// time +="9:00";
// System.out.println(getStringTime(time,"yyyy-MM-ddHH:mm"));
// System.out.println(System.currentTimeMillis());
// System.out.println(getStringTime("23:00","HH:mm"));
// System.out.println(getStringTime("00:00","HH:mm"));
// System.out.println(getStringDate(System.currentTimeMillis()));
//
//
// SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("dd");
// Date date = new Date(1516291200000L);
// System.out.println(simpleDateFormat1.format(date));
// System.out.println("--------------根据特定的日期‘2014-8-1’获取特定日期所在一个月的每一天--------------");
// SimpleDateFormat dateFm = new SimpleDateFormat("EEEE",Locale.CHINA);
// Date d2=paraseStringToDate("2018-7-3");
// List<String> lst4=getAllDaysMonthByDate(d2);
// for(String s3:lst4){
// System.out.print(s3+" ");
// System.out.print(dateFm.format(paraseStringToDate(s3))+" ");
// System.out.println(s3.substring(s3.length()-2, s3.length()));
// }
// System.out.println(Math.abs((1514854800000L-1514865600000L)/60000));
// System.out.println(getFirstDayOfMonth("2018-1-1"));
// System.out.println(getLastDayOfMonth("2018-1-1"));
// System.out.println(getStringFormat(1520179200000L));
// Calendar todayStart = Calendar.getInstance();
// todayStart.setTimeInMillis(1515164400000L);
// todayStart.set(Calendar.HOUR_OF_DAY, 0);
// todayStart.set(Calendar.MINUTE, 0);
// todayStart.set(Calendar.SECOND, 0);
// todayStart.set(Calendar.MILLISECOND, 0);
// System.out.println(todayStart.getTime().getTime());
Date
da
=
new
Date
();
System
.
out
.
println
(
da
);
System
.
out
.
println
(
da
.
getTime
());
}
}
}
src/main/java/cn/timer/api/utils/Page.java
View file @
7619f8eb
...
@@ -19,6 +19,11 @@ public class Page {
...
@@ -19,6 +19,11 @@ public class Page {
*/
*/
private
Integer
totalPage
;
private
Integer
totalPage
;
/**
* 偏移
*/
private
Integer
offset
;
public
Integer
getCurrentPage
()
{
public
Integer
getCurrentPage
()
{
return
currentPage
==
null
||
currentPage
<=
0
?
1
:
currentPage
;
return
currentPage
==
null
||
currentPage
<=
0
?
1
:
currentPage
;
}
}
...
@@ -29,13 +34,17 @@ public class Page {
...
@@ -29,13 +34,17 @@ public class Page {
}
}
public
Integer
getTotalPage
()
{
public
Integer
getTotalPage
()
{
return
totalPage
==
null
||
totalPage
<=
0
?
10
:
totalPage
;
return
totalPage
==
null
||
totalPage
<=
0
?
10
:
totalPage
;
}
}
public
void
setTotalPage
(
Integer
totalPage
)
{
public
void
setTotalPage
(
Integer
totalPage
)
{
this
.
totalPage
=
totalPage
;
this
.
totalPage
=
totalPage
;
}
}
public
Integer
getOffset
()
{
return
this
.
currentPage
>
0
?
(
this
.
currentPage
-
1
)
*
this
.
totalPage
:
0
;
}
public
void
setOffset
(
Integer
offset
)
{
this
.
offset
=
offset
;
}
}
}
src/main/resources/mapping/xcgl/XcglAssoGztztMapper.xml
View file @
7619f8eb
...
@@ -79,7 +79,7 @@
...
@@ -79,7 +79,7 @@
left join zzgl_bmgw_m um on um.id = m.up_id
left join zzgl_bmgw_m um on um.id = m.up_id
) as bmgw on bmgw.mid = emp.bmgw_id
) as bmgw on bmgw.mid = emp.bmgw_id
<if
test=
"xzzid != null"
>
<if
test=
"xzzid != null"
>
LEFT JOIN xcgl_asso_xzury xzury ON xzury.userid = emp.
id
and xzury.xzzid = #{xzzid}
LEFT JOIN xcgl_asso_xzury xzury ON xzury.userid = emp.
emp_num
and xzury.xzzid = #{xzzid}
</if>
</if>
where gztzt.qyid = #{orgcode}
where gztzt.qyid = #{orgcode}
<if
test=
"gztszid != null"
>
and gztzt.gztszid = #{gztszid}
</if>
<if
test=
"gztszid != null"
>
and gztzt.gztszid = #{gztszid}
</if>
...
...
src/main/resources/mapping/xcgl/XcglAssoXzdadxMapper.xml
View file @
7619f8eb
...
@@ -116,42 +116,18 @@
...
@@ -116,42 +116,18 @@
</trim>
</trim>
</insert>
</insert>
<!-- <delete id="delete" >
<!-- 获取小于等于当前日期的未生效记录 -->
DELETE FROM xcgl_asso_xzdadx
<select
id=
"listIneffective"
resultMap=
"BaseResultMap"
>
WHERE id = #{id}
SELECT
<include
refid=
"Base_Column_List"
></include>
</delete>
<update id="update" parameterType="cn.timer.api.bean.xcgl.XcglAssoXzdadx">
UPDATE xcgl_asso_xzdadx
<set>
<if test ='null != userid'>userid = #{userid},</if>
<if test ='null != sxrq'>sxrq = #{sxrq},</if>
<if test ='null != addtime'>addtime = #{addtime},</if>
<if test ='null != xgyhid'>xgyhid = #{xgyhid},</if>
<if test ='null != remarks'>remarks = #{remarks},</if>
<if test ='null != qyid'>qyid = #{qyid},</if>
<if test ='null != txzt'>txzt = #{txzt}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM xcgl_asso_xzdadx
FROM xcgl_asso_xzdadx
WHERE
id = #{id
}
WHERE
txzt = 2 AND sxrq
<
= #{curDate
}
</select>
</select>
<select id="pageList" resultMap="BaseResultMap">
<!-- 获取使用中多于1条数据的记录 -->
SELECT <include refid="Base_Column_List" />
<select
id=
"listRepeatUsed"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
></include>
FROM xcgl_asso_xzdadx
FROM xcgl_asso_xzdadx
LIMIT #{offset}, #{pageSize}
WHERE txzt = 0 AND exists (SELECT * from (select userid, count(*) as cnt from xcgl_asso_xzdadx where txzt = 0 group by userid) as tmp where cnt > 1)
ORDER BY userid, sxrq asc
</select>
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM xcgl_asso_xzdadx
</select>
-->
</mapper>
</mapper>
\ No newline at end of file
src/main/resources/mapping/xcgl/XcglAssoXzdazdyMapper.xml
View file @
7619f8eb
...
@@ -22,6 +22,9 @@
...
@@ -22,6 +22,9 @@
<result
column=
"empzztime"
property=
"empzztime"
/>
<result
column=
"empzztime"
property=
"empzztime"
/>
<result
column=
"sfdx"
property=
"sfdx"
/>
<result
column=
"sfdx"
property=
"sfdx"
/>
<result
column=
"tratime"
property=
"tratime"
/>
<result
column=
"tratime"
property=
"tratime"
/>
<result
column=
"txzt"
property=
"txzt"
/>
<result
column=
"remarks"
property=
"remarks"
/>
<collection
property=
"defdto"
ofType=
"cn.timer.api.dto.xcgl.DefinedItemsDto"
>
<collection
property=
"defdto"
ofType=
"cn.timer.api.dto.xcgl.DefinedItemsDto"
>
<result
column=
"dazid"
property=
"dazid"
/>
<result
column=
"dazid"
property=
"dazid"
/>
...
@@ -169,6 +172,16 @@
...
@@ -169,6 +172,16 @@
FROM xcgl_asso_xzdazdy
FROM xcgl_asso_xzdazdy
</select> -->
</select> -->
<select
id=
"selectFixedSalaryStaffCount"
resultType=
"java.lang.Long"
>
select COUNT(*) from yggl_main_emp emp
where emp.org_code = #{param.orgcode}
<if
test=
"param.status != ''"
>
and emp.job_status = #{param.status}
</if>
<if
test=
"param.text != ''"
>
and (emp.`name` like CONCAT('%',#{param.text},'%') or emp.emp_num = #{param.text})
</if>
</select>
<select
id=
"selectFixedSalaryStaff"
resultMap=
"FixedSalaryStaffMap"
>
<select
id=
"selectFixedSalaryStaff"
resultMap=
"FixedSalaryStaffMap"
>
select emp.emp_num empnum,
select emp.emp_num empnum,
emp.`name` empname,
emp.`name` empname,
...
@@ -194,16 +207,17 @@
...
@@ -194,16 +207,17 @@
xzdaz.xzdazdyid as xzdazdyid,
xzdaz.xzdazdyid as xzdazdyid,
xzdaz.rsz as dazrsz,
xzdaz.rsz as dazrsz,
xzdaz.xzdadxid as xzdadxid
xzdaz.xzdadxid as xzdadxid
from yggl_main_emp emp
from (select * from yggl_main_emp emp
LEFT JOIN xcgl_asso_xzdadx as dadx on dadx.userid = emp.emp_num and dadx.txzt = 0 and dadx.qyid = #{param.orgcode}
where emp.org_code = #{param.orgcode}
LEFT JOIN xcgl_asso_xzdaz as xzdaz on xzdaz.xzdadxid = dadx.id
<if
test=
"param.status != ''"
>
where emp.org_code = #{param.orgcode}
and emp.job_status = #{param.status}
<if
test=
"param.status != ''"
>
</if>
and emp.job_status = #{param.status}
<if
test=
"param.text != ''"
>
</if>
and (emp.`name` like CONCAT('%',#{param.text},'%') or emp.emp_num = #{param.text})
<if
test=
"param.text != ''"
>
</if>
and (emp.`name` like CONCAT('%',#{param.text},'%') or emp.emp_num = #{param.text})
LIMIT #{param.offset}, #{param.totalPage}
</if>
) emp
LEFT JOIN xcgl_asso_xzdadx as dadx on dadx.userid = emp.emp_num and dadx.txzt = 0
</select>
</select>
...
@@ -283,6 +297,8 @@
...
@@ -283,6 +297,8 @@
SUBSTR(emp.zz_time,1,10) empzztime,
SUBSTR(emp.zz_time,1,10) empzztime,
IF(dadx.userid IS NOT NULL,1,0) AS sfdx,
IF(dadx.userid IS NOT NULL,1,0) AS sfdx,
dadx.sxrq as tratime,
dadx.sxrq as tratime,
dadx.txzt as txzt,
dadx.remarks as remarks,
xzdaz.id as dazid,
xzdaz.id as dazid,
xzdaz.xzdazdyid as xzdazdyid,
xzdaz.xzdazdyid as xzdazdyid,
xzdaz.rsz as dazrsz,
xzdaz.rsz as dazrsz,
...
@@ -291,8 +307,8 @@
...
@@ -291,8 +307,8 @@
LEFT JOIN yggl_main_emp emp on dadx.userid = emp.emp_num
LEFT JOIN yggl_main_emp emp on dadx.userid = emp.emp_num
LEFT JOIN xcgl_asso_xzdaz as xzdaz on xzdaz.xzdadxid = dadx.id
LEFT JOIN xcgl_asso_xzdaz as xzdaz on xzdaz.xzdadxid = dadx.id
where emp.org_code = #{orgcode}
where emp.org_code = #{orgcode}
and emp.emp_num = #{empnum}
and emp.emp_num = #{empnum}
and dadx.txzt = 1
ORDER BY dadx.txzt, dadx.sxrq DESC
</select>
</select>
</mapper>
</mapper>
\ 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