Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
attendance-performance-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
attendance-performance-platform
Commits
04fd5f60
Commit
04fd5f60
authored
Aug 24, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改用户等
parent
d682e5d7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
241 additions
and
22 deletions
+241
-22
attendance-performance-manager/src/main/java/com/mortals/xhx/base/framework/interceptor/AuthTokenServiceImpl.java
.../xhx/base/framework/interceptor/AuthTokenServiceImpl.java
+13
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/base/system/idgenerator/service/impl/IdgeneratorServiceImpl.java
...stem/idgenerator/service/impl/IdgeneratorServiceImpl.java
+34
-9
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/SyncPortalUserTaskImpl.java
...a/com/mortals/xhx/daemon/task/SyncPortalUserTaskImpl.java
+103
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
...in/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
+58
-6
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/work/FixWorkOtherAttendance.java
...odule/attendance/service/work/FixWorkOtherAttendance.java
+23
-4
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/impl/StaffServiceImpl.java
...rtals/xhx/module/staff/service/impl/StaffServiceImpl.java
+10
-3
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/base/framework/interceptor/AuthTokenServiceImpl.java
View file @
04fd5f60
...
@@ -10,6 +10,8 @@ import com.mortals.framework.service.IUser;
...
@@ -10,6 +10,8 @@ import com.mortals.framework.service.IUser;
import
com.mortals.framework.util.DateUtils
;
import
com.mortals.framework.util.DateUtils
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.xhx.base.system.user.model.UserEntity
;
import
com.mortals.xhx.base.system.user.model.UserEntity
;
import
com.mortals.xhx.base.system.user.model.UserQuery
;
import
com.mortals.xhx.base.system.user.service.UserService
;
import
com.mortals.xhx.feign.user.IUserFeign
;
import
com.mortals.xhx.feign.user.IUserFeign
;
import
io.jsonwebtoken.Claims
;
import
io.jsonwebtoken.Claims
;
import
io.jsonwebtoken.Jwts
;
import
io.jsonwebtoken.Jwts
;
...
@@ -19,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -19,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Base64
;
import
java.util.Base64
;
...
@@ -74,6 +77,8 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
...
@@ -74,6 +77,8 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
@Autowired
@Autowired
private
ICacheService
cacheService
;
private
ICacheService
cacheService
;
@Autowired
private
UserService
userService
;
/**
/**
* 获取信息
* 获取信息
...
@@ -96,6 +101,14 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
...
@@ -96,6 +101,14 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
cacheService
.
select
(
db
);
cacheService
.
select
(
db
);
if
(
StringUtils
.
isNotEmpty
(
userStr
))
{
if
(
StringUtils
.
isNotEmpty
(
userStr
))
{
UserEntity
userEntity
=
JSONObject
.
parseObject
(
userStr
,
UserEntity
.
class
);
UserEntity
userEntity
=
JSONObject
.
parseObject
(
userStr
,
UserEntity
.
class
);
//与本地转换
UserQuery
userQuery
=
new
UserQuery
();
userQuery
.
setLoginName
(
userEntity
.
getLoginName
());
UserEntity
localuserEntity
=
userService
.
selectOne
(
userQuery
);
if
(
ObjectUtils
.
isEmpty
(
localuserEntity
)){
localuserEntity
.
setToken
(
token
);
return
localuserEntity
;
}
userEntity
.
setToken
(
token
);
userEntity
.
setToken
(
token
);
return
userEntity
;
return
userEntity
;
}
else
{
}
else
{
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/base/system/idgenerator/service/impl/IdgeneratorServiceImpl.java
View file @
04fd5f60
...
@@ -36,12 +36,15 @@ public class IdgeneratorServiceImpl implements IdgeneratorService {
...
@@ -36,12 +36,15 @@ public class IdgeneratorServiceImpl implements IdgeneratorService {
private
ConcurrentHashMap
<
IdGeneratorKey
,
SequenceId
>
seqIdMap
=
new
ConcurrentHashMap
<>();
private
ConcurrentHashMap
<
IdGeneratorKey
,
SequenceId
>
seqIdMap
=
new
ConcurrentHashMap
<>();
/** 默认步长,即一次取多少个ID */
/**
* 默认步长,即一次取多少个ID
*/
private
static
final
Long
DEFAULT_STEP
=
50L
;
private
static
final
Long
DEFAULT_STEP
=
50L
;
/**
/**
* <B>Description</B> 生成器key枚举 <br />
* <B>Description</B> 生成器key枚举 <br />
*
* @author
* @author
* @createTime 2016年3月16日 上午10:07:19
* @createTime 2016年3月16日 上午10:07:19
*/
*/
...
@@ -64,15 +67,25 @@ public class IdgeneratorServiceImpl implements IdgeneratorService {
...
@@ -64,15 +67,25 @@ public class IdgeneratorServiceImpl implements IdgeneratorService {
EFFECT_KEY
(
1L
,
"effect"
,
null
),
EFFECT_KEY
(
1L
,
"effect"
,
null
),
OTHER_KEY
(
1L
,
"other"
,
null
),
OTHER_KEY
(
1L
,
"other"
,
null
),
/** 空,测试用 */
USER_KEY
(
10000L
,
"user"
,
null
),
/**
* 空,测试用
*/
DUMMY
(
DEFAULT_STEP
,
""
,
null
),
DUMMY
(
DEFAULT_STEP
,
""
,
null
),
;
;
/** 步长 */
/**
* 步长
*/
private
final
Long
step
;
private
final
Long
step
;
/** 生成ID方法名 */
/**
* 生成ID方法名
*/
private
final
String
methodName
;
private
final
String
methodName
;
/** 生成ID所需参数因子类型 */
/**
* 生成ID所需参数因子类型
*/
private
final
Class
[]
factorsClazz
;
private
final
Class
[]
factorsClazz
;
private
IdGeneratorKey
(
Long
step
,
String
methodName
,
Class
[]
factorsClazz
)
{
private
IdGeneratorKey
(
Long
step
,
String
methodName
,
Class
[]
factorsClazz
)
{
...
@@ -169,6 +182,12 @@ public class IdgeneratorServiceImpl implements IdgeneratorService {
...
@@ -169,6 +182,12 @@ public class IdgeneratorServiceImpl implements IdgeneratorService {
}
}
}
}
private
Long
user
()
{
synchronized
(
IdGeneratorKey
.
USER_KEY
)
{
return
getNextSequenceId
(
IdGeneratorKey
.
USER_KEY
,
null
);
}
}
// *******************************************************************************
// *******************************************************************************
/**
/**
...
@@ -292,7 +311,7 @@ public class IdgeneratorServiceImpl implements IdgeneratorService {
...
@@ -292,7 +311,7 @@ public class IdgeneratorServiceImpl implements IdgeneratorService {
private
int
updateTableIdMaxValueBatch
(
final
IdGeneratorKey
key
,
final
Long
startSeq
,
final
SequenceId
idSequence
,
private
int
updateTableIdMaxValueBatch
(
final
IdGeneratorKey
key
,
final
Long
startSeq
,
final
SequenceId
idSequence
,
Integer
num
)
{
Integer
num
)
{
synchronized
(
IdGeneratorKey
.
DUMMY
)
{
synchronized
(
IdGeneratorKey
.
DUMMY
)
{
IdgeneratorEntity
entity
=
new
IdgeneratorEntity
();
IdgeneratorEntity
entity
=
new
IdgeneratorEntity
();
entity
.
setIdType
(
key
.
name
());
entity
.
setIdType
(
key
.
name
());
...
@@ -326,13 +345,19 @@ public class IdgeneratorServiceImpl implements IdgeneratorService {
...
@@ -326,13 +345,19 @@ public class IdgeneratorServiceImpl implements IdgeneratorService {
private
class
SequenceId
{
private
class
SequenceId
{
/** 步长 */
/**
* 步长
*/
private
Long
step
=
100L
;
private
Long
step
=
100L
;
/** 开始ID */
/**
* 开始ID
*/
private
volatile
AtomicLong
startSeq
=
new
AtomicLong
(
1
);
private
volatile
AtomicLong
startSeq
=
new
AtomicLong
(
1
);
/** 结束ID */
/**
* 结束ID
*/
private
volatile
Long
finishSeq
=
0L
;
private
volatile
Long
finishSeq
=
0L
;
public
Long
next
()
{
public
Long
next
()
{
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/SyncPortalUserTaskImpl.java
0 → 100644
View file @
04fd5f60
package
com.mortals.xhx.daemon.task
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.service.ITask
;
import
com.mortals.framework.service.ITaskExcuteService
;
import
com.mortals.xhx.base.system.user.model.UserEntity
;
import
com.mortals.xhx.base.system.user.model.UserQuery
;
import
com.mortals.xhx.base.system.user.service.UserService
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.user.UserPdu
;
import
com.mortals.xhx.feign.user.IUserFeign
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* 同步门户用户
*/
@Slf4j
@Service
(
"SyncPortalUserTask"
)
public
class
SyncPortalUserTaskImpl
implements
ITaskExcuteService
{
@Autowired
private
IUserFeign
userFeign
;
@Autowired
private
UserService
userService
;
@Override
public
void
excuteTask
(
ITask
task
)
throws
AppException
{
try
{
log
.
info
(
"同步门户用户"
);
syncPersons
();
}
catch
(
Exception
e
)
{
log
.
error
(
"同步门户异常"
,
e
);
}
}
private
void
syncPersons
()
{
UserPdu
userPdu
=
new
UserPdu
();
userPdu
.
setPage
(
1
);
userPdu
.
setSize
(-
1
);
Rest
<
RespData
<
List
<
UserPdu
>>>
resp
=
userFeign
.
list
(
userPdu
);
if
(
resp
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
List
<
UserPdu
>
userPduList
=
resp
.
getData
().
getData
();
log
.
info
(
"用户总数量:{}"
,
userPduList
.
size
());
if
(!
ObjectUtils
.
isEmpty
(
userPduList
))
{
List
<
UserEntity
>
newUserList
=
userPduList
.
stream
().
map
(
newUser
->
{
UserEntity
userEntity
=
new
UserEntity
();
userEntity
.
initAttrValue
();
BeanUtils
.
copyProperties
(
newUser
,
userEntity
,
new
String
[]{
"id"
,
"lastLoginTime"
,
"lastLoginAddress"
});
return
userEntity
;
}).
collect
(
Collectors
.
toList
());
List
<
UserEntity
>
oldUserList
=
userService
.
find
(
new
UserQuery
());
log
.
info
(
" oldUserList size:{}"
,
oldUserList
.
size
());
//当前用户map
Map
<
String
,
UserEntity
>
oldUserMap
=
oldUserList
.
parallelStream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getLoginName
(),
y
->
y
,
(
o
,
n
)
->
n
));
//门户用户map
// Map<String, UserEntity> newUserMap = newUserList.stream().collect(Collectors.toMap(x -> x.getLoginName(), y -> y, (o, n) -> n));
List
<
UserEntity
>
saveUserList
=
newUserList
.
stream
().
map
(
item
->
{
if
(!
oldUserMap
.
containsKey
(
item
.
getLoginName
()))
{
item
.
setCreateUserId
(
1L
);
item
.
setCreateUserName
(
"系统管理员"
);
item
.
setCreateTime
(
new
Date
());
return
item
;
}
return
null
;
}).
filter
(
f
->
f
!=
null
).
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
saveUserList
))
{
log
.
info
(
"用户新增,size:{}"
,
saveUserList
.
size
());
saveUserList
.
stream
().
forEach
(
item
->
{
userService
.
getUserDao
().
insert
(
item
);
});
}
}
//查找新增 与更新
}
}
@Override
public
void
stopTask
(
ITask
task
)
throws
AppException
{
}
}
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
View file @
04fd5f60
...
@@ -6,7 +6,7 @@ import com.mortals.framework.common.Rest;
...
@@ -6,7 +6,7 @@ import com.mortals.framework.common.Rest;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.service.ITask
;
import
com.mortals.framework.service.ITask
;
import
com.mortals.framework.service.ITaskExcuteService
;
import
com.mortals.framework.service.ITaskExcuteService
;
import
com.mortals.xhx.common.code.
YesNoEnum
;
import
com.mortals.xhx.common.code.
*
;
import
com.mortals.xhx.module.attendance.model.AttendanceStatEntity
;
import
com.mortals.xhx.module.attendance.model.AttendanceStatEntity
;
import
com.mortals.xhx.module.attendance.model.AttendanceVacationBalanceEntity
;
import
com.mortals.xhx.module.attendance.model.AttendanceVacationBalanceEntity
;
import
com.mortals.xhx.module.attendance.service.AttendanceStatService
;
import
com.mortals.xhx.module.attendance.service.AttendanceStatService
;
...
@@ -22,18 +22,20 @@ import com.mortals.xhx.module.hik.person.model.rsp.person.PersonDataInfo;
...
@@ -22,18 +22,20 @@ import com.mortals.xhx.module.hik.person.model.rsp.person.PersonDataInfo;
import
com.mortals.xhx.module.hik.person.model.rsp.person.PersonInfo
;
import
com.mortals.xhx.module.hik.person.model.rsp.person.PersonInfo
;
import
com.mortals.xhx.module.hik.person.service.IHikPersonService
;
import
com.mortals.xhx.module.hik.person.service.IHikPersonService
;
import
com.mortals.xhx.module.staff.model.StaffEntity
;
import
com.mortals.xhx.module.staff.model.StaffEntity
;
import
com.mortals.xhx.module.staff.model.StaffLeaveEntity
;
import
com.mortals.xhx.module.staff.model.StaffQuery
;
import
com.mortals.xhx.module.staff.service.StaffLeaveService
;
import
com.mortals.xhx.module.staff.service.StaffService
;
import
com.mortals.xhx.module.staff.service.StaffService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
java.util.Date
;
import
java.util.*
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.Objects
;
/**
/**
* 同步用户
* 同步
海康
用户
*/
*/
@Slf4j
@Slf4j
@Service
(
"SyncUserTask"
)
@Service
(
"SyncUserTask"
)
...
@@ -52,6 +54,8 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
...
@@ -52,6 +54,8 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
@Autowired
@Autowired
private
IHikPersonService
hikPersonService
;
private
IHikPersonService
hikPersonService
;
@Autowired
private
StaffLeaveService
staffLeaveService
;
@Override
@Override
public
void
excuteTask
(
ITask
task
)
throws
AppException
{
public
void
excuteTask
(
ITask
task
)
throws
AppException
{
...
@@ -72,11 +76,21 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
...
@@ -72,11 +76,21 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
Rest
<
PersonDataInfo
>
personRest
=
hikPersonService
.
getPersonList
(
personReq
);
Rest
<
PersonDataInfo
>
personRest
=
hikPersonService
.
getPersonList
(
personReq
);
if
(
personRest
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
if
(
personRest
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
List
<
PersonInfo
>
personInfoList
=
personRest
.
getData
().
getList
();
List
<
PersonInfo
>
personInfoList
=
personRest
.
getData
().
getList
();
//做差集 更新本地用户为离职员工
StaffQuery
staffQuery
=
new
StaffQuery
();
staffQuery
.
setSource
(
1
);
staffQuery
.
setStatusNotList
(
Arrays
.
asList
(
StaffSatusEnum
.
离职
.
getValue
()));
Map
<
String
,
StaffEntity
>
staffCollect
=
staffService
.
find
(
staffQuery
).
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getWorkNum
(),
y
->
y
,
(
o
,
n
)
->
n
));
for
(
PersonInfo
personInfo
:
personInfoList
)
{
for
(
PersonInfo
personInfo
:
personInfoList
)
{
if
(
ObjectUtils
.
isEmpty
(
personInfo
.
getJobNo
()))
{
if
(
ObjectUtils
.
isEmpty
(
personInfo
.
getJobNo
()))
{
log
.
info
(
"jobNo is null ==>{}"
,
JSON
.
toJSONString
(
personInfo
));
log
.
info
(
"jobNo is null ==>{}"
,
JSON
.
toJSONString
(
personInfo
));
continue
;
continue
;
}
}
if
(
staffCollect
.
containsKey
(
personInfo
.
getJobNo
()))
{
staffCollect
.
remove
(
personInfo
.
getJobNo
());
}
StaffEntity
staffEntity
=
staffService
.
getExtCache
(
StrUtil
.
padPre
(
personInfo
.
getJobNo
(),
8
,
"0"
));
StaffEntity
staffEntity
=
staffService
.
getExtCache
(
StrUtil
.
padPre
(
personInfo
.
getJobNo
(),
8
,
"0"
));
DeptEntity
deptEntity
=
deptService
.
selectOne
(
new
DeptQuery
().
deptCode
(
personInfo
.
getOrgIndexCode
()));
DeptEntity
deptEntity
=
deptService
.
selectOne
(
new
DeptQuery
().
deptCode
(
personInfo
.
getOrgIndexCode
()));
...
@@ -164,6 +178,44 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
...
@@ -164,6 +178,44 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
}
}
}
}
if
(
staffCollect
.
size
()
>
0
)
{
//需要将此人员变更为离职
staffCollect
.
entrySet
().
stream
().
forEach
(
item
->
{
StaffEntity
staffEntity
=
item
.
getValue
();
staffEntity
.
setStatus
(
StaffSatusEnum
.
离职
.
getValue
());
staffEntity
.
setUpdateTime
(
new
Date
());
staffEntity
.
setUpdateUserId
(
1L
);
staffService
.
update
(
staffEntity
);
//新增离职人员
StaffLeaveEntity
staffLeaveEntity
=
new
StaffLeaveEntity
();
staffLeaveEntity
.
initAttrValue
();
staffLeaveEntity
.
setStaffId
(
staffEntity
.
getId
());
staffLeaveEntity
.
setStaffName
(
staffEntity
.
getName
());
staffLeaveEntity
.
setGender
(
staffEntity
.
getGender
());
staffLeaveEntity
.
setBirthday
(
staffEntity
.
getBirthday
());
staffLeaveEntity
.
setPhotoPath
(
staffEntity
.
getPhotoPath
());
staffLeaveEntity
.
setPhoneNumber
(
staffEntity
.
getPhoneNumber
());
staffLeaveEntity
.
setIdCard
(
staffEntity
.
getIdCard
());
staffLeaveEntity
.
setWorkNum
(
staffEntity
.
getWorkNum
());
staffLeaveEntity
.
setPoliticalstatus
(
staffEntity
.
getPoliticalstatus
());
staffLeaveEntity
.
setDeptId
(
staffEntity
.
getDeptId
());
staffLeaveEntity
.
setDeptName
(
staffEntity
.
getDeptName
());
staffLeaveEntity
.
setJobId
(
staffEntity
.
getPositionId
());
staffLeaveEntity
.
setJobName
(
staffEntity
.
getPositionName
());
staffLeaveEntity
.
setStaffType
(
staffEntity
.
getStaffType
());
staffLeaveEntity
.
setStatus
(
StaffSatusEnum
.
离职
.
getValue
());
staffLeaveEntity
.
setLeaveDate
(
new
Date
());
staffLeaveEntity
.
setLeaveReason
(
""
);
staffLeaveEntity
.
setAuditStatus
(
AuditStatusEnum
.
通过
.
getValue
());
staffLeaveEntity
.
setCreateUserId
(
1L
);
staffLeaveEntity
.
setCreateTime
(
new
Date
());
staffLeaveService
.
save
(
staffLeaveEntity
);
});
}
}
}
}
}
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/work/FixWorkOtherAttendance.java
View file @
04fd5f60
...
@@ -183,7 +183,7 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
...
@@ -183,7 +183,7 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
//判断考勤时间是否在下班打卡区间内
//判断考勤时间是否在下班打卡区间内
boolean
offInTime
=
DateUtil
.
isIn
(
curDateTime
,
offWorkDateBefore
,
offWorkDateAfter
);
boolean
offInTime
=
DateUtil
.
isIn
(
curDateTime
,
offWorkDateBefore
,
offWorkDateAfter
);
if
(
goInTime
==
false
&&
offInTime
==
false
)
{
if
(
goInTime
==
false
&&
offInTime
==
false
)
{
// log.info("考勤时间不在上班区间与下班区间中,不做处理!attendDate:{}", DateUtil.formatDateTime(commonData.getAttendanceDate()));
// log.info("考勤时间不在上班区间与下班区间中,不做处理!attendDate:{}", DateUtil.formatDateTime(commonData.getAttendanceDate()));
continue
;
continue
;
}
}
if
(
goInTime
)
{
if
(
goInTime
)
{
...
@@ -227,6 +227,25 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
...
@@ -227,6 +227,25 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
}
}
}
}
if
(!
ObjectUtils
.
isEmpty
(
commonData
.
getDetailEntityList
()))
{
if
(!
ObjectUtils
.
isEmpty
(
commonData
.
getDetailEntityList
()))
{
//判断当前计算的时间,如果小于缺卡打卡时间 则删除详细考勤记录
Iterator
<
AttendanceRecordDetailEntity
>
iterator
=
commonData
.
getDetailEntityList
().
iterator
();
while
(
iterator
.
hasNext
())
{
AttendanceRecordDetailEntity
next
=
iterator
.
next
();
if
(
next
.
getGoWorkResult
()
==
GoWorkResultEnum
.
缺卡
.
getValue
())
{
if
(
DateUtil
.
compare
(
new
Date
(),
next
.
getGoWorkDate
())
<
0
)
{
iterator
.
remove
();
}
}
if
(
next
.
getOffWorkResult
()
==
OffWorkResultEnum
.
缺卡
.
getValue
())
{
if
(
DateUtil
.
compare
(
new
Date
(),
next
.
getOffWorkDate
())
<
0
)
{
next
.
setGoWorkDate
(
null
);
next
.
setGoWorkResult
(
GoWorkResultEnum
.
正常
.
getValue
());
}
}
}
AttendanceClassDetailEntity
attendanceClassDetailEntity
=
attendanceClassDetailService
.
get
(
commonData
.
getDetailEntityList
().
get
(
0
).
getShiftsId
());
AttendanceClassDetailEntity
attendanceClassDetailEntity
=
attendanceClassDetailService
.
get
(
commonData
.
getDetailEntityList
().
get
(
0
).
getShiftsId
());
commonData
.
getAttendanceRecordEntity
().
setClassId
(
attendanceClassDetailEntity
==
null
?
0L
:
attendanceClassDetailEntity
.
getClassId
());
commonData
.
getAttendanceRecordEntity
().
setClassId
(
attendanceClassDetailEntity
==
null
?
0L
:
attendanceClassDetailEntity
.
getClassId
());
commonData
.
getAttendanceRecordEntity
().
setClassName
(
attendanceClassDetailEntity
==
null
?
""
:
attendanceClassDetailEntity
.
getClassName
());
commonData
.
getAttendanceRecordEntity
().
setClassName
(
attendanceClassDetailEntity
==
null
?
""
:
attendanceClassDetailEntity
.
getClassName
());
...
@@ -318,13 +337,13 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
...
@@ -318,13 +337,13 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
Long
[]
errorIds
=
errorService
.
find
(
errorQuery
).
stream
().
map
(
i
->
i
.
getId
()).
toArray
(
Long
[]::
new
);
Long
[]
errorIds
=
errorService
.
find
(
errorQuery
).
stream
().
map
(
i
->
i
.
getId
()).
toArray
(
Long
[]::
new
);
if
(!
ObjectUtils
.
isEmpty
(
errorIds
))
{
if
(!
ObjectUtils
.
isEmpty
(
errorIds
))
{
errorService
.
remove
(
errorIds
,
context
);
errorService
.
remove
(
errorIds
,
context
);
}
}
for
(
AttendanceRecordErrorEntity
errorEntity
:
errorEntityList
)
{
for
(
AttendanceRecordErrorEntity
errorEntity
:
errorEntityList
)
{
//查看是否存在相同的异常记录,如果存在 则不添加
//查看是否存在相同的异常记录,如果存在 则不添加
errorQuery
=
new
AttendanceRecordErrorQuery
();
errorQuery
=
new
AttendanceRecordErrorQuery
();
errorQuery
.
setShiftsId
(
errorEntity
.
getShiftsId
());
errorQuery
.
setShiftsId
(
errorEntity
.
getShiftsId
());
errorQuery
.
setGoOffDateTime
(
errorEntity
.
getErrorDateTime
());
errorQuery
.
setGoOffDateTime
(
errorEntity
.
getErrorDateTime
());
errorQuery
.
setStaffId
(
errorEntity
.
getStaffId
());
errorQuery
.
setStaffId
(
errorEntity
.
getStaffId
());
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/impl/StaffServiceImpl.java
View file @
04fd5f60
...
@@ -8,6 +8,8 @@ import com.mortals.framework.model.Context;
...
@@ -8,6 +8,8 @@ import com.mortals.framework.model.Context;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl
;
import
com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl
;
import
com.mortals.framework.util.SecurityUtil
;
import
com.mortals.framework.util.SecurityUtil
;
import
com.mortals.xhx.base.system.idgenerator.service.IdgeneratorService
;
import
com.mortals.xhx.base.system.idgenerator.service.impl.IdgeneratorServiceImpl
;
import
com.mortals.xhx.base.system.role.model.RoleUserQuery
;
import
com.mortals.xhx.base.system.role.model.RoleUserQuery
;
import
com.mortals.xhx.base.system.role.service.RoleUserService
;
import
com.mortals.xhx.base.system.role.service.RoleUserService
;
import
com.mortals.xhx.base.system.user.model.UserEntity
;
import
com.mortals.xhx.base.system.user.model.UserEntity
;
...
@@ -42,6 +44,8 @@ import org.springframework.util.ObjectUtils;
...
@@ -42,6 +44,8 @@ import org.springframework.util.ObjectUtils;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
com
.
mortals
.
xhx
.
base
.
system
.
idgenerator
.
service
.
impl
.
IdgeneratorServiceImpl
.
IdGeneratorKey
.
USER_KEY
;
/**
/**
* StaffService
* StaffService
* 员工基本信息 service实现
* 员工基本信息 service实现
...
@@ -69,6 +73,9 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
...
@@ -69,6 +73,9 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
@Autowired
@Autowired
private
AttendanceVacationBalanceService
balanceService
;
private
AttendanceVacationBalanceService
balanceService
;
@Autowired
private
IdgeneratorService
idgeneratorService
;
@Override
@Override
protected
String
getExtKey
(
StaffEntity
data
)
{
protected
String
getExtKey
(
StaffEntity
data
)
{
...
@@ -85,9 +92,6 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
...
@@ -85,9 +92,6 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
}
}
}
}
@Override
@Override
public
StaffInfoVo
queryAll
(
Context
context
)
{
public
StaffInfoVo
queryAll
(
Context
context
)
{
StaffInfoVo
staffInfoVo
=
new
StaffInfoVo
();
StaffInfoVo
staffInfoVo
=
new
StaffInfoVo
();
...
@@ -226,6 +230,9 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
...
@@ -226,6 +230,9 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
entity
.
setLoginPwd
(
"123456"
);
entity
.
setLoginPwd
(
"123456"
);
}
}
//生成用户id,不与门户服务用户相同
// Long userId = idgeneratorService.getLongId(USER_KEY);
// entity.setId(userId);
userEntity
.
setLoginName
(
StrUtil
.
cleanBlank
(
entity
.
getLoginName
()));
userEntity
.
setLoginName
(
StrUtil
.
cleanBlank
(
entity
.
getLoginName
()));
userEntity
.
setRealName
(
entity
.
getName
());
userEntity
.
setRealName
(
entity
.
getName
());
userEntity
.
setUserType
(
UserType
.
WORK_PERSON
.
getValue
());
userEntity
.
setUserType
(
UserType
.
WORK_PERSON
.
getValue
());
...
...
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