Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
53eddca0
Commit
53eddca0
authored
May 16, 2024
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
节假日配置表及社保医疗截止配置表调整
parent
ab08f2ec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
6 deletions
+41
-6
DateUtil.java
...om/yifu/cloud/plus/v1/yifu/common/core/util/DateUtil.java
+17
-4
TSocialDeadlineInfoServiceImpl.java
...u/social/service/impl/TSocialDeadlineInfoServiceImpl.java
+24
-2
No files found.
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/util/DateUtil.java
View file @
53eddca0
...
...
@@ -575,6 +575,13 @@ public class DateUtil {
return
formater
.
format
(
date
);
}
public
static
int
getDays
(
Date
date
)
{
GregorianCalendar
cal
=
new
GregorianCalendar
();
cal
.
setTime
(
date
);
int
day
=
cal
.
get
(
Calendar
.
DAY_OF_MONTH
);
return
day
;
}
/**
* @param date
* @return string
...
...
@@ -1188,6 +1195,13 @@ public class DateUtil {
c1
.
set
(
Integer
.
valueOf
(
yearMonth
.
substring
(
0
,
4
)),
Integer
.
valueOf
(
yearMonth
.
substring
(
4
,
6
))-
1
,
c1
.
getActualMaximum
(
Calendar
.
DAY_OF_MONTH
));
return
c1
.
getTime
();
}
public
static
int
getLastDayOfDate
(
Date
date
){
Calendar
c2
=
Calendar
.
getInstance
();
int
day
=
c2
.
getActualMaximum
(
Calendar
.
DAY_OF_MONTH
);
return
day
;
}
/**
* 根据指定的格式将字符串转换成Date 如输入:2003-11-19 11:20:20将按照这个转成时间
*
...
...
@@ -1317,12 +1331,11 @@ public class DateUtil {
return
cal
.
getTime
();
}
public
static
Date
getDa
teOfThisMonth
(
Date
date
){
public
static
Date
getDa
yOfThisMonth
(
int
day
){
Calendar
cal
=
Calendar
.
getInstance
();
if
(
date
!=
null
)
{
cal
.
setTime
(
date
);
}
cal
.
setTime
(
new
Date
());
cal
.
set
(
Calendar
.
MONTH
,
Integer
.
valueOf
(
DateUtil
.
getMonth
(
new
Date
()))-
1
);
cal
.
set
(
Calendar
.
DAY_OF_MONTH
,
day
);
return
cal
.
getTime
();
}
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TSocialDeadlineInfoServiceImpl.java
View file @
53eddca0
...
...
@@ -289,6 +289,10 @@ public class TSocialDeadlineInfoServiceImpl extends ServiceImpl<TSocialDeadlineI
}
TSocialDeadlineInfo
save
;
LambdaQueryWrapper
<
TSocialDeadlineInfo
>
queryWrapper
;
int
medicalDay
;
int
socialDay
;
int
curlDay
;
int
setDay
;
for
(
TSocialDeadlineInfo
sd:
baseLists
){
queryWrapper
=
null
;
save
=
new
TSocialDeadlineInfo
();
...
...
@@ -296,10 +300,27 @@ public class TSocialDeadlineInfoServiceImpl extends ServiceImpl<TSocialDeadlineI
save
.
setId
(
null
);
save
.
setMonth
(
Integer
.
parseInt
(
DateUtil
.
getThisMonth
()));
save
.
setType
(
CommonConstants
.
ZERO_STRING
);
save
.
setSocialEndDate
(
DateUtil
.
getDateOfThisMonth
(
save
.
getSocialEndDate
()));
save
.
setMedicalEndDate
(
DateUtil
.
getDateOfThisMonth
(
save
.
getMedicalEndDate
()));
//如果月份超出当前月 大概率是 日设置有问题这里做个优化
setDay
=
DateUtil
.
getDays
(
save
.
getMedicalEndDate
());
curlDay
=
DateUtil
.
getLastDayOfDate
(
new
Date
());
if
(
setDay
>
curlDay
){
medicalDay
=
curlDay
;
}
else
{
medicalDay
=
setDay
;
}
save
.
setMedicalEndDate
(
DateUtil
.
getDayOfThisMonth
(
medicalDay
));
setDay
=
DateUtil
.
getDays
(
save
.
getSocialEndDate
());
if
(
setDay
>
curlDay
){
socialDay
=
curlDay
;
}
else
{
socialDay
=
setDay
;
}
save
.
setSocialEndDate
(
DateUtil
.
getDayOfThisMonth
(
socialDay
));
initSocialEndDate
(
holidayMap
,
save
);
initMedicalEndDate
(
holidayMap
,
save
);
save
.
setUpdateTime
(
null
);
save
.
setUpdateBy
(
null
);
save
.
setUpdateName
(
null
);
queryWrapper
=
initCountQuery
(
save
,
queryWrapper
);
if
(
baseMapper
.
selectCount
(
queryWrapper
)
>
0
){
continue
;
...
...
@@ -392,6 +413,7 @@ public class TSocialDeadlineInfoServiceImpl extends ServiceImpl<TSocialDeadlineI
if
(
Common
.
isNotNull
(
exit
)){
return
R
.
failed
(
"已存在对应月份与缴纳地的配置,请确认后操作!"
);
}
//如果是基础配置 重置之前的配置
updateType
(
tSocialDeadlineInfo
);
if
(
baseMapper
.
insert
(
tSocialDeadlineInfo
)
>=
0
){
return
R
.
ok
();
...
...
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