Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doc_wei
Skyeye
提交
e2a58854
S
Skyeye
项目概览
doc_wei
/
Skyeye
通知
1173
Star
154
Fork
127
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Skyeye
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
e2a58854
编写于
11月 28, 2021
作者:
doc_wei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
考勤打卡-->添加节假日不打卡功能
考勤报表-->添加节假日不打卡功能的计算
上级
9d397ebc
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
170 addition
and
80 deletion
+170
-80
skyeye-checkwork/src/main/java/com/skyeye/eve/service/impl/CheckWorkServiceImpl.java
...ava/com/skyeye/eve/service/impl/CheckWorkServiceImpl.java
+40
-29
skyeye-checkwork/src/main/resources/reqmapping/mapping/checkwork.xml
...kwork/src/main/resources/reqmapping/mapping/checkwork.xml
+2
-2
skyeye-common/src/main/java/com/skyeye/eve/dao/SysScheduleCommonDao.java
...rc/main/java/com/skyeye/eve/dao/SysScheduleCommonDao.java
+31
-0
skyeye-common/src/main/java/com/skyeye/eve/service/SysScheduleCommonService.java
...java/com/skyeye/eve/service/SysScheduleCommonService.java
+26
-0
skyeye-common/src/main/java/com/skyeye/eve/service/impl/SysScheduleCommonServiceImpl.java
...skyeye/eve/service/impl/SysScheduleCommonServiceImpl.java
+45
-0
skyeye-common/src/main/resources/mapper/common/SysScheduleCommonMapper.xml
.../main/resources/mapper/common/SysScheduleCommonMapper.xml
+15
-0
skyeye-schedule/src/main/java/com/skyeye/eve/service/impl/ScheduleDayServiceImpl.java
...a/com/skyeye/eve/service/impl/ScheduleDayServiceImpl.java
+3
-2
skyeye-wages/src/main/java/com/skyeye/eve/dao/WagesStaffMationDao.java
...src/main/java/com/skyeye/eve/dao/WagesStaffMationDao.java
+0
-8
skyeye-wages/src/main/java/com/skyeye/eve/service/WagesStaffMationService.java
.../java/com/skyeye/eve/service/WagesStaffMationService.java
+0
-9
skyeye-wages/src/main/java/com/skyeye/eve/service/impl/WagesStaffMationServiceImpl.java
.../skyeye/eve/service/impl/WagesStaffMationServiceImpl.java
+5
-17
skyeye-wages/src/main/resources/mapper/wages/WagesStaffMationMapper.xml
...rc/main/resources/mapper/wages/WagesStaffMationMapper.xml
+0
-10
skyeye-web/src/main/java/com/skyeye/sys/quartz/CheckWorkQuartz.java
.../src/main/java/com/skyeye/sys/quartz/CheckWorkQuartz.java
+3
-3
未找到文件。
skyeye-checkwork/src/main/java/com/skyeye/eve/service/impl/CheckWorkServiceImpl.java
浏览文件 @
e2a58854
...
...
@@ -16,10 +16,7 @@ import com.skyeye.common.util.ToolUtil;
import
com.skyeye.eve.dao.CheckWorkDao
;
import
com.skyeye.eve.dao.CheckWorkOvertimeDao
;
import
com.skyeye.eve.dao.CheckWorkTimeDao
;
import
com.skyeye.eve.service.CheckWorkBusinessTripService
;
import
com.skyeye.eve.service.CheckWorkLeaveService
;
import
com.skyeye.eve.service.CheckWorkOvertimeService
;
import
com.skyeye.eve.service.CheckWorkService
;
import
com.skyeye.eve.service.*
;
import
com.skyeye.exception.CustomException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -65,6 +62,9 @@ public class CheckWorkServiceImpl implements CheckWorkService {
@Autowired
private
CheckWorkOvertimeDao
checkWorkOvertimeDao
;
@Autowired
private
SysScheduleCommonService
sysScheduleCommonService
;
public
static
enum
CheckTypeFrom
{
CHECT_BTN_FROM_TIMEID
(
1
,
"根据班次id计算考勤按钮的显示状态"
),
CHECT_BTN_FROM_OVERTIME
(
2
,
"根据加班日计算考勤按钮的显示状态"
);
...
...
@@ -93,7 +93,6 @@ public class CheckWorkServiceImpl implements CheckWorkService {
* @return void 返回类型
* @throws
*/
@SuppressWarnings
(
"static-access"
)
@Override
@Transactional
(
value
=
"transactionManager"
)
public
void
insertCheckWorkStartWork
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
...
...
@@ -167,7 +166,6 @@ public class CheckWorkServiceImpl implements CheckWorkService {
* @return void 返回类型
* @throws
*/
@SuppressWarnings
(
"static-access"
)
@Override
@Transactional
(
value
=
"transactionManager"
)
public
void
editCheckWorkEndWork
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
...
...
@@ -416,33 +414,30 @@ public class CheckWorkServiceImpl implements CheckWorkService {
outputObject
.
setBean
(
bean
);
outputObject
.
settotal
(
1
);
}
/**
*
* @Title: queryCheckWorkTimeToShowButton
* @Description: 判断显示打上班卡或者下班卡
* @param inputObject
* @param outputObject
* @throws Exception 参数
* @return void 返回类型
* @throws
*/
* 判断显示打上班卡或者下班卡
*
* @param inputObject
* @param outputObject
* @throws Exception
*/
@Override
public
void
queryCheckWorkTimeToShowButton
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
Map
<
String
,
Object
>
map
=
inputObject
.
getParams
();
Map
<
String
,
Object
>
user
=
inputObject
.
getLogParams
();
String
today
YMD
=
DateUtil
.
getYmdTimeAndToString
();
String
today
=
DateUtil
.
getYmdTimeAndToString
();
String
userId
=
user
.
get
(
"id"
).
toString
();
String
timeId
=
map
.
get
(
"timeId"
).
toString
();
String
staffId
=
user
.
get
(
"staffId"
).
toString
();
String
nowTimeHMS
=
DateUtil
.
getHmsTimeAndToString
();
// 1.获取当前用户的考勤班次信息
Map
<
String
,
Object
>
workTime
=
getWorkTime
(
userId
,
today
YMD
,
timeId
,
staffId
);
Map
<
String
,
Object
>
workTime
=
getWorkTime
(
userId
,
today
,
timeId
,
staffId
);
if
(
Integer
.
parseInt
(
workTime
.
get
(
"type"
).
toString
())
==
CheckTypeFrom
.
CHECT_BTN_FROM_OVERTIME
.
getType
()){
timeId
=
"-"
;
}
// 2.判断显示打上班卡或者下班卡
Map
<
String
,
Object
>
result
=
getChectBtn
(
today
YMD
,
userId
,
timeId
,
workTime
,
nowTimeHMS
);
Map
<
String
,
Object
>
result
=
getChectBtn
(
today
,
userId
,
timeId
,
workTime
,
nowTimeHMS
);
outputObject
.
setBean
(
result
);
}
...
...
@@ -450,16 +445,16 @@ public class CheckWorkServiceImpl implements CheckWorkService {
* 获取当前用户的考勤班次信息
*
* @param userId 用户id
* @param today
YMD
指定日期,格式为yyyy-MM-dd(一般为今天的日期)
* @param today 指定日期,格式为yyyy-MM-dd(一般为今天的日期)
* @param timeId 班次id
* @param staffId 员工id
* @return
* @throws Exception
*/
private
Map
<
String
,
Object
>
getWorkTime
(
String
userId
,
String
today
YMD
,
String
timeId
,
String
staffId
)
throws
Exception
{
private
Map
<
String
,
Object
>
getWorkTime
(
String
userId
,
String
today
,
String
timeId
,
String
staffId
)
throws
Exception
{
Map
<
String
,
Object
>
workTime
;
// 判断今天是否是加班日
List
<
Map
<
String
,
Object
>>
overTimeMation
=
checkWorkOvertimeDao
.
queryPassThisDayAndCreateId
(
userId
,
today
YMD
);
List
<
Map
<
String
,
Object
>>
overTimeMation
=
checkWorkOvertimeDao
.
queryPassThisDayAndCreateId
(
userId
,
today
);
if
(
overTimeMation
!=
null
&&
!
overTimeMation
.
isEmpty
()){
// 根据加班日判断显示打上班卡或者下班卡
workTime
=
overTimeMation
.
get
(
0
);
...
...
@@ -477,17 +472,18 @@ public class CheckWorkServiceImpl implements CheckWorkService {
/**
* 判断显示打上班卡或者下班卡
*
* @param today
YMD
指定日期,格式为yyyy-MM-dd(一般为今天的日期)
* @param today 指定日期,格式为yyyy-MM-dd(一般为今天的日期)
* @param userId 用户id
* @param timeId 班次id
* @param workTime 考勤班次信息
* @param nowTimeHMS 指定日期,格式为HH:mm:ss(一般为当前时间)
* @return
* @throws Exception
*/
private
Map
<
String
,
Object
>
getChectBtn
(
String
today
YMD
,
String
userId
,
String
timeId
,
Map
<
String
,
Object
>
workTime
,
String
nowTimeHMS
)
throws
Exception
{
private
Map
<
String
,
Object
>
getChectBtn
(
String
today
,
String
userId
,
String
timeId
,
Map
<
String
,
Object
>
workTime
,
String
nowTimeHMS
)
throws
Exception
{
// 获取今天的打卡记录
Map
<
String
,
Object
>
isAlreadyCheck
=
checkWorkDao
.
queryisAlreadyCheck
(
today
YMD
,
userId
,
timeId
);
Integer
checkState
=
getCheckState
(
isAlreadyCheck
,
nowTimeHMS
,
workTime
);
Map
<
String
,
Object
>
isAlreadyCheck
=
checkWorkDao
.
queryisAlreadyCheck
(
today
,
userId
,
timeId
);
Integer
checkState
=
getCheckState
(
isAlreadyCheck
,
nowTimeHMS
,
workTime
,
today
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
result
.
put
(
"isCheck"
,
checkState
);
result
.
putAll
(
workTime
);
...
...
@@ -504,11 +500,20 @@ public class CheckWorkServiceImpl implements CheckWorkService {
* @param isAlreadyCheck 今日打卡信息
* @param nowTimeHMS 指定日期,格式为HH:mm:ss
* @param workTime 班次考勤信息
* @param today 指定日期,格式为yyyy-MM-dd(一般为今天的日期)
* @return
* @throws
Parse
Exception
* @throws Exception
*/
private
Integer
getCheckState
(
Map
<
String
,
Object
>
isAlreadyCheck
,
String
nowTimeHMS
,
Map
<
String
,
Object
>
workTime
)
throws
ParseException
{
private
Integer
getCheckState
(
Map
<
String
,
Object
>
isAlreadyCheck
,
String
nowTimeHMS
,
Map
<
String
,
Object
>
workTime
,
String
today
)
throws
Exception
{
Integer
checkState
=
null
;
if
(
Integer
.
parseInt
(
workTime
.
get
(
"type"
).
toString
())
==
CheckTypeFrom
.
CHECT_BTN_FROM_TIMEID
.
getType
()){
if
(
sysScheduleCommonService
.
judgeISHoliday
(
today
)){
// 今天不是加班日,但是是节假日,则不显示按钮
checkState
=
4
;
return
checkState
;
}
}
if
(
isAlreadyCheck
==
null
&&
DateUtil
.
compareTimeHMS
(
nowTimeHMS
,
workTime
.
get
(
"clockOut"
).
toString
()))
{
// 今日没有打卡,且没有到下班时间,显示早卡按钮
checkState
=
1
;
...
...
@@ -691,7 +696,9 @@ public class CheckWorkServiceImpl implements CheckWorkService {
@Override
public
void
queryCheckWorkReport
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
Map
<
String
,
Object
>
map
=
inputObject
.
getParams
();
// 1.获取所有的考勤班次在指定日期内需要上班多少天
Map
<
String
,
Integer
>
timeWorkDay
=
getAllCheckWorkTime
(
map
.
get
(
"startTime"
).
toString
(),
map
.
get
(
"endTime"
).
toString
());
// 2.分页获取员工考勤信息
Page
pages
=
PageHelper
.
startPage
(
Integer
.
parseInt
(
map
.
get
(
"page"
).
toString
()),
Integer
.
parseInt
(
map
.
get
(
"limit"
).
toString
()));
List
<
Map
<
String
,
Object
>>
beans
=
checkWorkDao
.
queryCheckWorkReport
(
map
);
setShouldTime
(
beans
,
timeWorkDay
);
...
...
@@ -702,6 +709,7 @@ public class CheckWorkServiceImpl implements CheckWorkService {
private
void
setShouldTime
(
List
<
Map
<
String
,
Object
>>
beans
,
Map
<
String
,
Integer
>
timeWorkDay
){
for
(
Map
<
String
,
Object
>
bean:
beans
){
String
[]
timsIds
=
bean
.
get
(
"timsIds"
).
toString
().
split
(
","
);
// 该员工在指定日期范围内应该上班的天数
Integer
shouldTime
=
0
;
for
(
String
timeId:
timsIds
){
if
(!
ToolUtil
.
isBlank
(
timeId
)){
...
...
@@ -734,6 +742,10 @@ public class CheckWorkServiceImpl implements CheckWorkService {
// 1.获取范围内的所有日期
List
<
String
>
days
=
DateUtil
.
getDays
(
startTime
,
endTime
);
for
(
String
day:
days
){
if
(
sysScheduleCommonService
.
judgeISHoliday
(
day
)){
// 如果是法定节假日,则不参与计算
continue
;
}
// 判断日期是周几
int
weekDay
=
DateUtil
.
getWeek
(
day
);
// 判断日期是单周还是双周
...
...
@@ -759,7 +771,6 @@ public class CheckWorkServiceImpl implements CheckWorkService {
* @return: boolean
* @throws
*/
@SuppressWarnings
(
"unchecked"
)
private
boolean
getTimeWhetherWork
(
String
timeId
,
int
weekDay
,
int
weekType
,
List
<
Map
<
String
,
Object
>>
workTime
){
Map
<
String
,
Object
>
timeMation
=
workTime
.
stream
().
filter
(
item
->
item
.
get
(
"timeId"
).
toString
().
equals
(
timeId
)).
collect
(
Collectors
.
toList
()).
get
(
0
);
if
(
timeMation
!=
null
&&
!
timeMation
.
isEmpty
()){
...
...
skyeye-checkwork/src/main/resources/reqmapping/mapping/checkwork.xml
浏览文件 @
e2a58854
...
...
@@ -106,7 +106,7 @@
<property
id=
"monthMation"
name=
"monthMation"
ref=
"required"
var=
"当前月上个年月"
/>
<property
id=
"timeId"
name=
"timeId"
ref=
"required"
var=
"班次id"
/>
</url>
<url
id=
"checkwork015"
path=
"/post/CheckWorkController/queryCheckWorkReport"
val=
"获取考勤报表数据"
allUse=
"2"
>
<url
id=
"checkwork015"
path=
"/post/CheckWorkController/queryCheckWorkReport"
val=
"获取考勤报表数据"
method=
"POST"
allUse=
"2"
>
<property
id=
"limit"
name=
"limit"
ref=
"required,num"
var=
"分页参数,每页多少条数据"
/>
<property
id=
"page"
name=
"page"
ref=
"required,num"
var=
"分页参数,第几页"
/>
<property
id=
"userName"
name=
"userName"
ref=
""
var=
"员工姓名"
/>
...
...
@@ -117,7 +117,7 @@
<property
id=
"endTime"
name=
"endTime"
ref=
"required"
var=
"最后时间"
/>
<property
id=
"timeId"
name=
"timeId"
ref=
""
var=
"班次id"
/>
</url>
<url
id=
"checkwork016"
path=
"/post/CheckWorkController/queryCheckWorkEcharts"
val=
"获取考勤图标数据"
allUse=
"2"
>
<url
id=
"checkwork016"
path=
"/post/CheckWorkController/queryCheckWorkEcharts"
val=
"获取考勤图标数据"
method=
"POST"
allUse=
"2"
>
<property
id=
"userName"
name=
"userName"
ref=
""
var=
"员工姓名"
/>
<property
id=
"companyName"
name=
"companyName"
ref=
""
var=
"公司"
/>
<property
id=
"departmentName"
name=
"departmentName"
ref=
""
var=
"部门"
/>
...
...
skyeye-common/src/main/java/com/skyeye/eve/dao/SysScheduleCommonDao.java
0 → 100644
浏览文件 @
e2a58854
/*******************************************************************************
* Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye
******************************************************************************/
package
com.skyeye.eve.dao
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* @ClassName: SysScheduleCommonDao
* @Description: 节假日公共部分
* @author: skyeye云系列--卫志强
* @date: 2021/11/28 9:48
* @Copyright: 2021 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved.
* 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的
*/
public
interface
SysScheduleCommonDao
{
/**
* 根据指定天判断是否属于节假日
*
* @param day 指定天,格式为yyyy-mm-dd
* @return
* @throws Exception
*/
List
<
Map
<
String
,
Object
>>
queryWhetherIsHolidayByDate
(
@Param
(
"day"
)
String
day
)
throws
Exception
;
}
skyeye-common/src/main/java/com/skyeye/eve/service/SysScheduleCommonService.java
0 → 100644
浏览文件 @
e2a58854
/*******************************************************************************
* Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye
******************************************************************************/
package
com.skyeye.eve.service
;
/**
* @ClassName: SysScheduleCommonService
* @Description: 节假日公共部分
* @author: skyeye云系列--卫志强
* @date: 2021/11/28 9:49
* @Copyright: 2021 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved.
* 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的
*/
public
interface
SysScheduleCommonService
{
/**
* 判断指定日期是否是节假日
*
* @param day 日期,格式为yyyy-mm-dd
* @return true:是节假日;false:不是节假日
* @throws Exception
*/
boolean
judgeISHoliday
(
String
day
)
throws
Exception
;
}
skyeye-common/src/main/java/com/skyeye/eve/service/impl/SysScheduleCommonServiceImpl.java
0 → 100644
浏览文件 @
e2a58854
/*******************************************************************************
* Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye
******************************************************************************/
package
com.skyeye.eve.service.impl
;
import
com.skyeye.eve.dao.SysScheduleCommonDao
;
import
com.skyeye.eve.service.SysScheduleCommonService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
/**
* @ClassName: SysScheduleCommonServiceImpl
* @Description: 节假日公共部分
* @author: skyeye云系列--卫志强
* @date: 2021/11/28 9:49
* @Copyright: 2021 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved.
* 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的
*/
@Service
public
class
SysScheduleCommonServiceImpl
implements
SysScheduleCommonService
{
@Autowired
private
SysScheduleCommonDao
sysScheduleCommonDao
;
/**
* 判断指定日期是否是节假日
*
* @param day 日期,格式为yyyy-mm-dd
* @return true:是节假日;false:不是节假日
* @throws Exception
*/
@Override
public
boolean
judgeISHoliday
(
String
day
)
throws
Exception
{
List
<
Map
<
String
,
Object
>>
holiday
=
sysScheduleCommonDao
.
queryWhetherIsHolidayByDate
(
day
);
if
(
holiday
==
null
||
holiday
.
isEmpty
()){
return
false
;
}
return
true
;
}
}
skyeye-common/src/main/resources/mapper/common/SysScheduleCommonMapper.xml
0 → 100644
浏览文件 @
e2a58854
<?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=
"com.skyeye.eve.dao.SysScheduleCommonDao"
>
<select
id=
"queryWhetherIsHolidayByDate"
resultType=
"java.util.Map"
>
SELECT
a.id
FROM
schedule_day a
WHERE #{day} >= DATE_FORMAT(a.start_time, '%Y-%m-%d')
AND DATE_FORMAT(a.end_time, '%Y-%m-%d') >= #{day}
AND a.type = 3
</select>
</mapper>
\ No newline at end of file
skyeye-schedule/src/main/java/com/skyeye/eve/service/impl/ScheduleDayServiceImpl.java
浏览文件 @
e2a58854
...
...
@@ -123,7 +123,7 @@ public class ScheduleDayServiceImpl implements ScheduleDayService{
/**
*
* @Title: queryScheduleDayMationByUserId
* @Description: 根据用户日程信息
* @Description: 根据用户
id获取
日程信息
* @param inputObject
* @param outputObject
* @throws Exception 参数
...
...
@@ -162,8 +162,9 @@ public class ScheduleDayServiceImpl implements ScheduleDayService{
map
.
put
(
"userId"
,
user
.
get
(
"id"
));
List
<
Map
<
String
,
Object
>>
beans
=
scheduleDayDao
.
queryScheduleDayMationTodayByUserId
(
map
);
outputObject
.
setBeans
(
beans
);
if
(
beans
!=
null
&&
!
beans
.
isEmpty
())
if
(
beans
!=
null
&&
!
beans
.
isEmpty
())
{
outputObject
.
settotal
(
beans
.
size
());
}
}
/**
...
...
skyeye-wages/src/main/java/com/skyeye/eve/dao/WagesStaffMationDao.java
浏览文件 @
e2a58854
...
...
@@ -89,12 +89,4 @@ public interface WagesStaffMationDao {
*/
public
Map
<
String
,
Object
>
queryWagesStaffPaymentDetail
(
@Param
(
"staffId"
)
String
staffId
,
@Param
(
"payMonth"
)
String
payMonth
)
throws
Exception
;
/**
* 根据指定天判断是否属于节假日
*
* @param day 指定天,格式为yyyy-mm-dd
* @return
* @throws Exception
*/
List
<
Map
<
String
,
Object
>>
queryWhetherIsHolidayByDate
(
@Param
(
"day"
)
String
day
)
throws
Exception
;
}
skyeye-wages/src/main/java/com/skyeye/eve/service/WagesStaffMationService.java
浏览文件 @
e2a58854
...
...
@@ -32,13 +32,4 @@ public interface WagesStaffMationService {
*/
void
setLastMonthBe
(
List
<
Map
<
String
,
Object
>>
staffWorkTime
,
Map
<
String
,
String
>
staffModelFieldMap
,
String
lastMonthDate
)
throws
Exception
;
/**
* 判断指定日期是否是节假日
*
* @param yesterdayTime 昨天的日期,格式为yyyy-mm-dd
* @return
* @throws Exception
*/
boolean
judgeISHoliday
(
String
yesterdayTime
)
throws
Exception
;
}
skyeye-wages/src/main/java/com/skyeye/eve/service/impl/WagesStaffMationServiceImpl.java
浏览文件 @
e2a58854
...
...
@@ -14,6 +14,7 @@ import com.skyeye.common.util.DateUtil;
import
com.skyeye.eve.dao.WagesModelDao
;
import
com.skyeye.eve.dao.WagesModelFieldDao
;
import
com.skyeye.eve.dao.WagesStaffMationDao
;
import
com.skyeye.eve.service.SysScheduleCommonService
;
import
com.skyeye.eve.service.WagesStaffMationService
;
import
com.skyeye.wages.constant.WagesConstant
;
import
org.slf4j.Logger
;
...
...
@@ -52,6 +53,9 @@ public class WagesStaffMationServiceImpl implements WagesStaffMationService {
@Autowired
private
WagesModelFieldDao
wagesModelFieldDao
;
@Autowired
private
SysScheduleCommonService
sysScheduleCommonService
;
/**
* 计薪资字段状态
*/
...
...
@@ -198,7 +202,7 @@ public class WagesStaffMationServiceImpl implements WagesStaffMationService {
for
(
Map
<
String
,
Object
>
bean
:
staffWorkTime
)
{
List
<
Map
<
String
,
Object
>>
days
=
(
List
<
Map
<
String
,
Object
>>)
bean
.
get
(
"days"
);
for
(
String
day
:
lastMonthDays
)
{
// 周几
if
(
this
.
judgeISHoliday
(
day
)){
if
(
sysScheduleCommonService
.
judgeISHoliday
(
day
)){
// 如果是节假日,则不计算
continue
;
}
...
...
@@ -229,20 +233,4 @@ public class WagesStaffMationServiceImpl implements WagesStaffMationService {
staffModelFieldMap
.
put
(
WagesConstant
.
DEFAULT_WAGES_FIELD_TYPE
.
LAST_MONTH_BE_HOUR
.
getKey
(),
CalculationUtil
.
divide
(
lastMonthBeHour
,
"60"
,
2
));
}
/**
* 判断指定日期是否是节假日
*
* @param yesterdayTime 昨天的日期,格式为yyyy-mm-dd
* @return
* @throws Exception
*/
@Override
public
boolean
judgeISHoliday
(
String
yesterdayTime
)
throws
Exception
{
List
<
Map
<
String
,
Object
>>
holiday
=
wagesStaffMationDao
.
queryWhetherIsHolidayByDate
(
yesterdayTime
);
if
(
holiday
==
null
||
holiday
.
isEmpty
()){
return
false
;
}
return
true
;
}
}
skyeye-wages/src/main/resources/mapper/wages/WagesStaffMationMapper.xml
浏览文件 @
e2a58854
...
...
@@ -240,14 +240,4 @@
AND date_format(b.cancel_day, '%Y-%m') = #{lastMonthDate}
</select>
<select
id=
"queryWhetherIsHolidayByDate"
resultType=
"java.util.Map"
>
SELECT
a.id
FROM
schedule_day a
WHERE #{day} >= DATE_FORMAT(a.start_time, '%Y-%m-%d')
AND DATE_FORMAT(a.end_time, '%Y-%m-%d') >= #{day}
AND a.type = 3
</select>
</mapper>
\ No newline at end of file
skyeye-web/src/main/java/com/skyeye/sys/quartz/CheckWorkQuartz.java
浏览文件 @
e2a58854
...
...
@@ -13,7 +13,7 @@ import com.skyeye.eve.dao.CheckWorkLeaveDao;
import
com.skyeye.eve.dao.CheckWorkTimeDao
;
import
com.skyeye.eve.entity.quartz.SysQuartzRunHistory
;
import
com.skyeye.eve.service.SysQuartzRunHistoryService
;
import
com.skyeye.eve.service.
WagesStaffMati
onService
;
import
com.skyeye.eve.service.
SysScheduleComm
onService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -53,7 +53,7 @@ public class CheckWorkQuartz {
private
CheckWorkLeaveDao
checkWorkLeaveDao
;
@Autowired
private
WagesStaffMationService
wagesStaffMati
onService
;
private
SysScheduleCommonService
sysScheduleComm
onService
;
@Autowired
private
SysQuartzRunHistoryService
sysQuartzRunHistoryService
;
...
...
@@ -72,7 +72,7 @@ public class CheckWorkQuartz {
List
<
Map
<
String
,
Object
>>
workTime
=
getAllCheckWorkTime
();
// 得到昨天的时间
String
yesterdayTime
=
DateUtil
.
getSpecifiedDayMation
(
DateUtil
.
getTimeAndToString
(),
"yyyy-MM-dd"
,
0
,
1
,
7
);
if
(
workTime
!=
null
&&
!
workTime
.
isEmpty
()
&&
!
wagesStaffMati
onService
.
judgeISHoliday
(
yesterdayTime
)){
if
(
workTime
!=
null
&&
!
workTime
.
isEmpty
()
&&
!
sysScheduleComm
onService
.
judgeISHoliday
(
yesterdayTime
)){
// 班次信息不为空,并且昨天不是节假日
log
.
info
(
"Fill in the clocking information for timing task execution time is {}"
,
yesterdayTime
);
// 判断昨天的日期是周几
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录