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
673d84b5
Commit
673d84b5
authored
Apr 19, 2023
by
daijunxiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
汇总关联 职位关联
parent
51f6da09
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
184 additions
and
100 deletions
+184
-100
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
...in/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
+89
-74
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/model/AttendanceVacationBalanceEntity.java
...ule/attendance/model/AttendanceVacationBalanceEntity.java
+0
-1
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dept/service/DeptService.java
...java/com/mortals/xhx/module/dept/service/DeptService.java
+2
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/job/dao/JobDao.java
.../src/main/java/com/mortals/xhx/module/job/dao/JobDao.java
+4
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/job/dao/ibatis/JobDaoImpl.java
...ava/com/mortals/xhx/module/job/dao/ibatis/JobDaoImpl.java
+12
-3
attendance-performance-manager/src/main/java/com/mortals/xhx/module/job/model/JobEntity.java
...main/java/com/mortals/xhx/module/job/model/JobEntity.java
+1
-6
attendance-performance-manager/src/main/java/com/mortals/xhx/module/job/model/vo/JobVo.java
.../main/java/com/mortals/xhx/module/job/model/vo/JobVo.java
+3
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/job/service/JobService.java
...n/java/com/mortals/xhx/module/job/service/JobService.java
+7
-1
attendance-performance-manager/src/main/java/com/mortals/xhx/module/job/service/impl/JobServiceImpl.java
...m/mortals/xhx/module/job/service/impl/JobServiceImpl.java
+11
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/job/web/JobController.java
...in/java/com/mortals/xhx/module/job/web/JobController.java
+18
-3
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/dao/StaffDao.java
.../main/java/com/mortals/xhx/module/staff/dao/StaffDao.java
+5
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/dao/ibatis/StaffDaoImpl.java
...com/mortals/xhx/module/staff/dao/ibatis/StaffDaoImpl.java
+5
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/model/StaffEntity.java
.../java/com/mortals/xhx/module/staff/model/StaffEntity.java
+3
-1
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/StaffService.java
...va/com/mortals/xhx/module/staff/service/StaffService.java
+7
-4
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/impl/StaffServiceImpl.java
...rtals/xhx/module/staff/service/impl/StaffServiceImpl.java
+6
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/web/StaffController.java
...ava/com/mortals/xhx/module/staff/web/StaffController.java
+1
-5
attendance-performance-manager/src/main/resources/sqlmap/module/attendance/AttendanceStatMapper.xml
...sources/sqlmap/module/attendance/AttendanceStatMapper.xml
+1
-1
attendance-performance-manager/src/main/resources/sqlmap/module/job/JobMapper.xml
...anager/src/main/resources/sqlmap/module/job/JobMapper.xml
+6
-0
attendance-performance-manager/src/main/resources/sqlmap/module/staff/StaffMapper.xml
...er/src/main/resources/sqlmap/module/staff/StaffMapper.xml
+3
-0
attendance-performance-manager/src/test/java/com/mortals/httpclient/staff/StaffController.http
...st/java/com/mortals/httpclient/staff/StaffController.http
+0
-1
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
View file @
673d84b5
...
...
@@ -11,7 +11,6 @@ import com.mortals.xhx.busiz.rsp.ListDept;
import
com.mortals.xhx.busiz.rsp.ListItem
;
import
com.mortals.xhx.busiz.rsp.PersonHikData
;
import
com.mortals.xhx.module.attendance.dao.ibatis.*
;
import
com.mortals.xhx.module.attendance.model.AttendanceRecordEntity
;
import
com.mortals.xhx.module.attendance.model.AttendanceStatEntity
;
import
com.mortals.xhx.module.attendance.model.AttendanceVacationBalanceEntity
;
import
com.mortals.xhx.module.dept.dao.ibatis.DeptDaoImpl
;
...
...
@@ -24,7 +23,6 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.Objects
;
...
...
@@ -79,20 +77,21 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
DeptEntity
deptEntityParent
=
deptDao
.
queryDeptParient
(
listDept
.
getParentOrgIndexCode
());
//新增
if
(
Objects
.
isNull
(
deptEntity
))
{
deptEntity
.
initAttrValue
();
DeptEntity
deptEntity1
=
new
DeptEntity
();
deptEntity1
.
initAttrValue
();
if
(
Objects
.
nonNull
(
deptEntityParent
))
{
deptEntity
.
setParentId
(
deptEntityParent
.
getId
());
deptEntity
1
.
setParentId
(
deptEntityParent
.
getId
());
}
deptEntity
.
setDeptName
(
listDept
.
getOrgName
());
deptEntity
.
setDeptCode
(
listDept
.
getOrgIndexCode
());
deptEntity
.
setAncestors
(
listDept
.
getOrgPath
());
deptEntity
.
setOrderNum
(
0
);
deptEntity
.
setRemark
(
listDept
.
getParentOrgIndexCode
());
deptEntity
.
setCreateTime
(
new
Date
());
deptEntity
.
setCreateUserId
(
Long
.
valueOf
(
1
));
deptEntity
.
setUpdateTime
(
new
Date
());
deptEntity
.
setUpdateUserId
(
Long
.
valueOf
(
1
));
deptService
.
save
(
deptEntity
);
deptEntity
1
.
setDeptName
(
listDept
.
getOrgName
());
deptEntity
1
.
setDeptCode
(
listDept
.
getOrgIndexCode
());
deptEntity
1
.
setAncestors
(
listDept
.
getOrgPath
());
deptEntity
1
.
setOrderNum
(
0
);
deptEntity
1
.
setRemark
(
listDept
.
getParentOrgIndexCode
());
deptEntity
1
.
setCreateTime
(
new
Date
());
deptEntity
1
.
setCreateUserId
(
Long
.
valueOf
(
1
));
deptEntity
1
.
setUpdateTime
(
new
Date
());
deptEntity
1
.
setUpdateUserId
(
Long
.
valueOf
(
1
));
deptService
.
save
(
deptEntity
1
);
}
else
{
//更新
deptEntity
.
initAttrValue
();
...
...
@@ -122,31 +121,38 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
//判断本地数据是否为空
if
(
Objects
.
isNull
(
staffEntity1
))
{
//新增员工信息
staffEntity1
.
initAttrValue
();
StaffEntity
staffEntity
=
new
StaffEntity
();
staffEntity
.
initAttrValue
();
if
(
Objects
.
nonNull
(
staffEntity1
))
{
staffEntity
1
.
setDeptId
(
deptEntity
.
getId
());
staffEntity
.
setDeptId
(
deptEntity
.
getId
());
}
staffEntity
1
.
setName
(
list
.
getPersonName
());
staffEntity
1
.
setRemarkId
(
list
.
getPersonId
());
staffEntity
1
.
setPicUri
(
list
.
getPersonPhoto
().
getPicUri
());
staffEntity
1
.
setServerIndexCode
(
list
.
getPersonPhoto
().
getServerIndexCode
());
staffEntity
1
.
setDeptName
(
list
.
getOrgName
());
staffEntity
1
.
setSource
(
1
);
staffEntity
1
.
setStatus
(
1
);
staffEntity
1
.
setGender
(
list
.
getGender
());
staffEntity
1
.
setWorkNum
(
list
.
getJobNo
());
staffEntity
1
.
setCreateUserId
(
Long
.
valueOf
(
1
));
staffEntity
1
.
setCreateTime
(
new
Date
());
staffEntity
.
setName
(
list
.
getPersonName
());
staffEntity
.
setRemarkId
(
list
.
getPersonId
());
staffEntity
.
setPicUri
(
list
.
getPersonPhoto
().
getPicUri
());
staffEntity
.
setServerIndexCode
(
list
.
getPersonPhoto
().
getServerIndexCode
());
staffEntity
.
setDeptName
(
list
.
getOrgName
());
staffEntity
.
setSource
(
1
);
staffEntity
.
setStatus
(
1
);
staffEntity
.
setGender
(
list
.
getGender
());
staffEntity
.
setWorkNum
(
list
.
getJobNo
());
staffEntity
.
setCreateUserId
(
Long
.
valueOf
(
1
));
staffEntity
.
setCreateTime
(
new
Date
());
if
(
list
.
getBirthday
()
!=
null
)
{
staffEntity
1
.
setBirthday
((
Date
)
list
.
getBirthday
());
staffEntity
.
setBirthday
((
Date
)
list
.
getBirthday
());
}
if
(
list
.
getPhoneNo
()
!=
null
)
{
staffEntity
1
.
setPhoneNumber
(
String
.
valueOf
(
list
.
getPhoneNo
()));
staffEntity
.
setPhoneNumber
(
String
.
valueOf
(
list
.
getPhoneNo
()));
}
service
.
save
(
staffEntity1
);
service
.
save
(
staffEntity
);
AttendanceVacationBalanceEntity
attendanceVacationBalanceEntity
=
new
AttendanceVacationBalanceEntity
();
attendanceVacationBalanceEntity
.
initAttrValue
();
attendanceVacationBalanceEntity
.
setStaffId
(
staffEntity
.
getId
());
attendanceVacationBalanceEntity
.
setStaffName
(
staffEntity
.
getName
());
attendanceVacationBalanceEntity
.
setDeptId
(
deptEntity
.
getId
());
attendanceVacationBalanceEntity
.
setDeptName
(
deptEntity
.
getDeptName
());
balanceDao
.
insert
(
attendanceVacationBalanceEntity
);
//统计各级部门员工数量
DeptEntity
deptEntity1
=
deptService
.
get
(
staffEntity1
.
getDeptId
());
String
ancestor
=
deptEntity1
.
getAncestors
().
split
(
","
,
2
)[
1
];
String
ancestor
=
deptEntity
.
getAncestors
().
split
(
","
,
2
)[
1
];
String
[]
ancestors
=
ancestor
.
split
(
","
);
for
(
String
newAncestor
:
ancestors
)
{
DeptEntity
deptEntity2
=
deptService
.
get
(
Long
.
valueOf
(
newAncestor
));
...
...
@@ -180,60 +186,70 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
staffEntity1
.
setPhoneNumber
(
String
.
valueOf
(
list
.
getPhoneNo
()));
}
service
.
update
(
staffEntity1
);
AttendanceVacationBalanceEntity
attendanceVacationBalanceEntity
=
new
AttendanceVacationBalanceEntity
();
attendanceVacationBalanceEntity
.
initAttrValue
();
attendanceVacationBalanceEntity
.
setStaffId
(
staffEntity1
.
getId
());
attendanceVacationBalanceEntity
.
setStaffName
(
staffEntity1
.
getName
());
attendanceVacationBalanceEntity
.
setDeptId
(
deptEntity
.
getId
());
attendanceVacationBalanceEntity
.
setDeptName
(
deptEntity
.
getDeptName
());
balanceDao
.
update
(
attendanceVacationBalanceEntity
);
//统计各级部门员工数量
DeptEntity
deptEntity1
=
deptService
.
get
(
staffEntity1
.
getDeptId
());
String
ancestor
=
deptEntity1
.
getAncestors
().
split
(
","
,
2
)[
1
];
String
ancestor
=
deptEntity
.
getAncestors
().
split
(
","
,
2
)[
1
];
String
[]
ancestors
=
ancestor
.
split
(
","
);
for
(
String
newAncestor
:
ancestors
)
{
DeptEntity
deptEntity2
=
deptService
.
get
(
Long
.
valueOf
(
newAncestor
));
if
(
Objects
.
nonNull
(
deptEntity2
))
{
deptEntity2
.
setPersonNum
(
deptEntity2
.
getPersonNum
()
+
1
);
deptService
.
update
(
deptEntity2
);
System
.
out
.
println
(
"1"
);
}
}
}
//同步人员的考勤汇总信息
//通过员工id获取考勤数据
AttendanceRecordEntity
attendanceRecordEntity
=
attendanceRecordDao
.
get
(
staffEntity1
.
getId
());
//通过考勤id统计上班迟到次数
int
goWorkCountDele
=
attendanceRecordDetailDao
.
goWorkCount
(
attendanceRecordEntity
.
getId
());
//员工id获取异常打卡所有记录
int
errorAttendaceCount
=
attendanceRecordErrorDao
.
errorAttendance
(
attendanceRecordEntity
.
getId
());
AttendanceVacationBalanceEntity
balanceEntity
=
balanceDao
.
queryEntity
(
attendanceRecordEntity
.
getId
());
//
//通过员工id获取考勤数据
//
AttendanceRecordEntity attendanceRecordEntity = attendanceRecordDao.get(staffEntity1.getId());
//
//通过考勤id统计上班迟到次数
////
int goWorkCountDele = attendanceRecordDetailDao.goWorkCount(attendanceRecordEntity.getId());
////
//员工id获取异常打卡所有记录
////
int errorAttendaceCount = attendanceRecordErrorDao.errorAttendance(attendanceRecordEntity.getId());
AttendanceVacationBalanceEntity
balanceEntity
=
balanceDao
.
queryEntity
(
staffEntity1
.
getId
());
AttendanceStatEntity
statEntity
=
attendanceStatDao
.
queryEntity
(
staffEntity1
.
getId
());
//为空执行新增
if
(
Objects
.
isNull
(
statEntity
)){
statEntity
.
initAttrValue
();
statEntity
.
setStaffId
(
staffEntity1
.
getId
());
statEntity
.
setStaffName
(
staffEntity1
.
getName
());
statEntity
.
setDeptId
(
staffEntity1
.
getDeptId
());
statEntity
.
setDeptName
(
staffEntity1
.
getDeptName
());
AttendanceStatEntity
attendanceStatEntity
=
new
AttendanceStatEntity
();
attendanceStatEntity
.
initAttrValue
();
attendanceStatEntity
.
setStaffId
(
staffEntity1
.
getId
());
attendanceStatEntity
.
setStaffName
(
staffEntity1
.
getName
());
attendanceStatEntity
.
setDeptId
(
staffEntity1
.
getDeptId
());
attendanceStatEntity
.
setDeptName
(
staffEntity1
.
getDeptName
());
attendanceStatEntity
.
setCreateTime
(
new
Date
());
attendanceStatEntity
.
setCreateUserId
(
Long
.
valueOf
(
1
));
//21假
s
tatEntity
.
setBackToUnit
(
balanceEntity
.
getBackToUnit
());
s
tatEntity
.
setOnDutyLeave
(
balanceEntity
.
getOnDutyLeave
());
s
tatEntity
.
setOutOfOffice
(
balanceEntity
.
getOutOfOffice
());
s
tatEntity
.
setShiftCompensation
(
balanceEntity
.
getShiftCompensation
());
s
tatEntity
.
setPhysicalExamination
(
balanceEntity
.
getPhysicalExamination
());
s
tatEntity
.
setQuarantine
(
balanceEntity
.
getQuarantine
());
s
tatEntity
.
setBusinessTrip
(
balanceEntity
.
getBusinessTrip
());
s
tatEntity
.
setPublicHoliday
(
balanceEntity
.
getPublicHoliday
());
s
tatEntity
.
setSickLeave
(
balanceEntity
.
getSickLeaveDays
());
s
tatEntity
.
setFuneralLeave
(
balanceEntity
.
getBereavementLeaveDays
());
s
tatEntity
.
setMarriageLeave
(
balanceEntity
.
getMarriageLeaveDays
());
s
tatEntity
.
setChildRearingLeave
(
balanceEntity
.
getChildRearingLeave
());
s
tatEntity
.
setBreastfeedingLeaveDays
(
balanceEntity
.
getBreastfeedingLeaveDays
());
s
tatEntity
.
setMenstrualLeaveDays
(
balanceEntity
.
getMenstrualLeaveDays
());
s
tatEntity
.
setAnnualLeaveDays
(
balanceEntity
.
getAnnualLeaveDays
());
s
tatEntity
.
setCompensatedLeaveDays
(
balanceEntity
.
getCompensatedLeaveDays
());
s
tatEntity
.
setPaternityLeaveDays
(
balanceEntity
.
getPaternityLeaveDays
());
s
tatEntity
.
setMaternityLeave
(
balanceEntity
.
getMaternityLeaveDays
());
s
tatEntity
.
setTransferBack
(
balanceEntity
.
getTransferBack
());
s
tatEntity
.
setHomeLeave
(
balanceEntity
.
getHomeLeave
());
s
tatEntity
.
setPersonalLeave
(
balanceEntity
.
getPersonalLeaveDays
());
s
tatEntity
.
setLateTimes
(
goWorkCountDele
);
s
tatEntity
.
setNonCompliancePunch
(
BigDecimal
.
valueOf
(
errorAttendaceCount
));
attendanceStatDao
.
insert
(
s
tatEntity
);
attendanceS
tatEntity
.
setBackToUnit
(
balanceEntity
.
getBackToUnit
());
attendanceS
tatEntity
.
setOnDutyLeave
(
balanceEntity
.
getOnDutyLeave
());
attendanceS
tatEntity
.
setOutOfOffice
(
balanceEntity
.
getOutOfOffice
());
attendanceS
tatEntity
.
setShiftCompensation
(
balanceEntity
.
getShiftCompensation
());
attendanceS
tatEntity
.
setPhysicalExamination
(
balanceEntity
.
getPhysicalExamination
());
attendanceS
tatEntity
.
setQuarantine
(
balanceEntity
.
getQuarantine
());
attendanceS
tatEntity
.
setBusinessTrip
(
balanceEntity
.
getBusinessTrip
());
attendanceS
tatEntity
.
setPublicHoliday
(
balanceEntity
.
getPublicHoliday
());
attendanceS
tatEntity
.
setSickLeave
(
balanceEntity
.
getSickLeaveDays
());
attendanceS
tatEntity
.
setFuneralLeave
(
balanceEntity
.
getBereavementLeaveDays
());
attendanceS
tatEntity
.
setMarriageLeave
(
balanceEntity
.
getMarriageLeaveDays
());
attendanceS
tatEntity
.
setChildRearingLeave
(
balanceEntity
.
getChildRearingLeave
());
attendanceS
tatEntity
.
setBreastfeedingLeaveDays
(
balanceEntity
.
getBreastfeedingLeaveDays
());
attendanceS
tatEntity
.
setMenstrualLeaveDays
(
balanceEntity
.
getMenstrualLeaveDays
());
attendanceS
tatEntity
.
setAnnualLeaveDays
(
balanceEntity
.
getAnnualLeaveDays
());
attendanceS
tatEntity
.
setCompensatedLeaveDays
(
balanceEntity
.
getCompensatedLeaveDays
());
attendanceS
tatEntity
.
setPaternityLeaveDays
(
balanceEntity
.
getPaternityLeaveDays
());
attendanceS
tatEntity
.
setMaternityLeave
(
balanceEntity
.
getMaternityLeaveDays
());
attendanceS
tatEntity
.
setTransferBack
(
balanceEntity
.
getTransferBack
());
attendanceS
tatEntity
.
setHomeLeave
(
balanceEntity
.
getHomeLeave
());
attendanceS
tatEntity
.
setPersonalLeave
(
balanceEntity
.
getPersonalLeaveDays
());
// attendanceS
tatEntity.setLateTimes(goWorkCountDele);
// attendanceS
tatEntity.setNonCompliancePunch(BigDecimal.valueOf(errorAttendaceCount));
attendanceStatDao
.
insert
(
attendanceS
tatEntity
);
}
//不为空执行修改
else
{
...
...
@@ -242,6 +258,7 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
statEntity
.
setStaffName
(
staffEntity1
.
getName
());
statEntity
.
setDeptId
(
staffEntity1
.
getDeptId
());
statEntity
.
setDeptName
(
staffEntity1
.
getDeptName
());
//21假
statEntity
.
setBackToUnit
(
balanceEntity
.
getBackToUnit
());
statEntity
.
setOnDutyLeave
(
balanceEntity
.
getOnDutyLeave
());
...
...
@@ -264,15 +281,13 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
statEntity
.
setTransferBack
(
balanceEntity
.
getTransferBack
());
statEntity
.
setHomeLeave
(
balanceEntity
.
getHomeLeave
());
statEntity
.
setPersonalLeave
(
balanceEntity
.
getPersonalLeaveDays
());
statEntity
.
setLateTimes
(
goWorkCountDele
);
statEntity
.
setNonCompliancePunch
(
BigDecimal
.
valueOf
(
errorAttendaceCount
));
//
statEntity.setLateTimes(goWorkCountDele);
//
statEntity.setNonCompliancePunch(BigDecimal.valueOf(errorAttendaceCount));
attendanceStatDao
.
update
(
statEntity
);
}
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/model/AttendanceVacationBalanceEntity.java
View file @
673d84b5
...
...
@@ -27,7 +27,6 @@ public class AttendanceVacationBalanceEntity extends AttendanceVacationBalanceVo
/**
* 部门id
*/
@Excel
(
name
=
"部门id"
)
private
Long
deptId
;
/**
* 部门名称
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dept/service/DeptService.java
View file @
673d84b5
...
...
@@ -51,4 +51,6 @@ public interface DeptService extends ICRUDService<DeptEntity,Long>{
}
\ No newline at end of file
attendance-performance-manager/src/main/java/com/mortals/xhx/module/job/dao/JobDao.java
View file @
673d84b5
...
...
@@ -2,7 +2,9 @@ package com.mortals.xhx.module.job.dao;
import
com.mortals.framework.dao.ICRUDDao
;
import
com.mortals.xhx.module.job.model.JobEntity
;
import
java.util.List
;
/**
* 职位信息Dao
* 职位信息 DAO接口
...
...
@@ -13,5 +15,7 @@ import java.util.List;
public
interface
JobDao
extends
ICRUDDao
<
JobEntity
,
Long
>{
List
<
JobEntity
>
queryGroupName
();
List
<
JobEntity
>
queryPositionName
();
}
attendance-performance-manager/src/main/java/com/mortals/xhx/module/job/dao/ibatis/JobDaoImpl.java
View file @
673d84b5
package
com.mortals.xhx.module.job.dao.ibatis
;
import
org.springframework.stereotype.Repository
;
import
com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis
;
import
com.mortals.xhx.module.job.dao.JobDao
;
import
com.mortals.xhx.module.job.model.JobEntity
;
import
java.util.Date
;
import
com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* 职位信息DaoImpl DAO接口
*
...
...
@@ -17,5 +18,13 @@ import java.util.List;
public
class
JobDaoImpl
extends
BaseCRUDDaoMybatis
<
JobEntity
,
Long
>
implements
JobDao
{
@Override
public
List
<
JobEntity
>
queryGroupName
()
{
return
getSqlSession
().
selectList
(
getSqlId
(
"queryGroupName"
));
}
@Override
public
List
<
JobEntity
>
queryPositionName
()
{
return
getSqlSession
().
selectList
(
getSqlId
(
"queryPositionName"
));
}
}
attendance-performance-manager/src/main/java/com/mortals/xhx/module/job/model/JobEntity.java
View file @
673d84b5
package
com.mortals.xhx.module.job.model
;
import
java.util.List
;
import
java.util.ArrayList
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.mortals.framework.annotation.Excel
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.xhx.module.job.model.vo.JobVo
;
/**
* 职位信息实体对象
...
...
@@ -164,7 +159,7 @@ public class JobEntity extends JobVo {
public
void
initAttrValue
(){
this
.
groupId
=
null
;
this
.
groupId
=
0L
;
this
.
groupName
=
""
;
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/job/model/vo/JobVo.java
View file @
673d84b5
...
...
@@ -2,6 +2,7 @@ package com.mortals.xhx.module.job.model.vo;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.xhx.module.job.model.JobEntity
;
import
com.mortals.xhx.module.staff.model.StaffEntity
;
import
lombok.Data
;
import
java.util.ArrayList
;
...
...
@@ -19,4 +20,6 @@ public class JobVo extends BaseEntityLong {
* 子站点业务
*/
private
List
<
JobEntity
>
children
=
new
ArrayList
<>();
private
List
<
StaffEntity
>
staffEntities
;
}
\ No newline at end of file
attendance-performance-manager/src/main/java/com/mortals/xhx/module/job/service/JobService.java
View file @
673d84b5
package
com.mortals.xhx.module.job.service
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.job.model.JobEntity
;
import
com.mortals.xhx.module.job.model.JobQuery
;
import
java.util.List
;
/**
* JobService
*
...
...
@@ -10,5 +15,6 @@ import com.mortals.xhx.module.job.model.JobEntity;
* @date 2023-04-07
*/
public
interface
JobService
extends
ICRUDService
<
JobEntity
,
Long
>{
List
<
JobEntity
>
queryGroupName
(
JobQuery
jobQuery
);
List
<
JobEntity
>
queryPositionName
(
JobQuery
jobQuery
);
}
\ No newline at end of file
attendance-performance-manager/src/main/java/com/mortals/xhx/module/job/service/impl/JobServiceImpl.java
View file @
673d84b5
...
...
@@ -25,6 +25,7 @@ public class JobServiceImpl extends AbstractCRUDServiceImpl<JobDao, JobEntity, L
protected
void
findAfter
(
JobEntity
entity
,
Context
context
,
List
<
JobEntity
>
list
)
throws
AppException
{
list
.
stream
().
peek
(
item
->
{
List
<
JobEntity
>
childs
=
this
.
find
(
new
JobQuery
().
groupId
(
item
.
getId
()));
System
.
out
.
println
(
"111"
+
childs
);
if
(!
ObjectUtils
.
isEmpty
(
childs
))
{
item
.
setChildren
(
childs
);
}
else
{
...
...
@@ -32,4 +33,14 @@ public class JobServiceImpl extends AbstractCRUDServiceImpl<JobDao, JobEntity, L
}
}).
count
();
}
@Override
public
List
<
JobEntity
>
queryGroupName
(
JobQuery
jobQuery
)
{
return
dao
.
queryGroupName
();
}
@Override
public
List
<
JobEntity
>
queryPositionName
(
JobQuery
jobQuery
)
{
return
dao
.
queryPositionName
();
}
}
\ No newline at end of file
attendance-performance-manager/src/main/java/com/mortals/xhx/module/job/web/JobController.java
View file @
673d84b5
package
com.mortals.xhx.module.job.web
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.common.code.JobTypeEnum
;
import
com.mortals.xhx.module.job.model.JobEntity
;
import
com.mortals.xhx.module.job.model.JobQuery
;
import
com.mortals.xhx.module.job.service.JobService
;
import
com.mortals.xhx.module.staff.model.StaffEntity
;
import
com.mortals.xhx.module.staff.service.impl.StaffServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* 职位信息
...
...
@@ -26,6 +30,9 @@ public class JobController extends BaseCRUDJsonBodyMappingController<JobService,
@Autowired
private
ParamService
paramService
;
@Autowired
private
StaffServiceImpl
staffService
;
public
JobController
()
{
super
.
setModuleDesc
(
"职位信息"
);
...
...
@@ -34,13 +41,21 @@ public class JobController extends BaseCRUDJsonBodyMappingController<JobService,
@Override
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
this
.
addDict
(
model
,
"type"
,
JobTypeEnum
.
getEnumMap
());
this
.
addDict
(
model
,
"group"
,
service
.
queryGroupName
(
new
JobQuery
()).
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getId
().
toString
(),
y
->
y
.
getGroupName
(),(
o
,
n
)->
n
)));
super
.
init
(
model
,
context
);
}
@Override
protected
void
doListBefore
(
JobEntity
query
,
Map
<
String
,
Object
>
model
,
Context
context
)
throws
AppException
{
protected
void
doListBefore
(
JobEntity
query
,
Map
<
String
,
Object
>
model
,
Context
context
)
{
query
.
setSize
(-
1
);
query
.
setType
(
1
);
super
.
doListBefore
(
query
,
model
,
context
);
}
@Override
protected
int
infoAfter
(
Long
id
,
Map
<
String
,
Object
>
model
,
JobEntity
entity
,
Context
context
)
throws
AppException
{
List
<
StaffEntity
>
staffEntity
=
staffService
.
queryJob
(
id
);
entity
.
setStaffEntities
(
staffEntity
);
return
super
.
infoAfter
(
id
,
model
,
entity
,
context
);
}
}
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/dao/StaffDao.java
View file @
673d84b5
...
...
@@ -57,4 +57,9 @@ public interface StaffDao extends ICRUDDao<StaffEntity,Long>{
* 查询部门信息
* */
StaffEntity
queryHik
(
String
remarkId
);
/**
* 查询拥有职位的员工
* */
List
<
StaffEntity
>
queryJob
(
Long
positionId
);
}
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/dao/ibatis/StaffDaoImpl.java
View file @
673d84b5
...
...
@@ -59,5 +59,10 @@ public class StaffDaoImpl extends BaseCRUDDaoMybatis<StaffEntity,Long> implement
return
this
.
getSqlSession
().
selectOne
(
this
.
getSqlId
(
"queryHik"
),
remarkId
);
}
@Override
public
List
<
StaffEntity
>
queryJob
(
Long
positionId
){
return
getSqlSession
().
selectList
(
this
.
getSqlId
(
"queryJob"
),
positionId
);
}
}
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/model/StaffEntity.java
View file @
673d84b5
...
...
@@ -22,7 +22,7 @@ public class StaffEntity extends StaffVo {
/**
* 性别(1.男,2.女)
*/
@Excel
(
name
=
"性别"
)
@Excel
(
name
=
"性别"
,
readConverterExp
=
"1=男,2=女"
)
private
Integer
gender
;
/**
* 出生日期
...
...
@@ -73,10 +73,12 @@ public class StaffEntity extends StaffVo {
/**
* 员工类型(1.全职,2.兼职,3.实习)
*/
@Excel
(
name
=
"员工类型"
,
readConverterExp
=
"1=全职,2=兼职,3=实习"
)
private
Integer
staffType
;
/**
* 员工状态(1.正式,2.试用,3.离职)
*/
@Excel
(
name
=
"员工状态"
,
readConverterExp
=
"1=正式,2=试用,3=离职"
)
private
Integer
status
;
/**
* 入职登记表
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/StaffService.java
View file @
673d84b5
package
com.mortals.xhx.module.staff.service
;
import
com.mortals.framework.service.ICRUDCacheService
;
import
com.mortals.xhx.module.staff.model.StaffEntity
;
import
com.mortals.xhx.module.staff.model.vo.StaffInfoVo
;
import
java.util.List
;
/**
* StaffService
*
...
...
@@ -13,10 +16,10 @@ import com.mortals.xhx.module.staff.model.vo.StaffInfoVo;
*/
public
interface
StaffService
extends
ICRUDCacheService
<
StaffEntity
,
Long
>
{
//查询所有数据
StaffInfoVo
queryAll
();
//统计所有在职员工
int
queryAllPerson
();
//查询员工数据
List
<
StaffEntity
>
queryJob
(
Long
positionId
);
}
\ No newline at end of file
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/impl/StaffServiceImpl.java
View file @
673d84b5
...
...
@@ -10,6 +10,8 @@ import com.mortals.xhx.module.staff.service.StaffService;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* StaffService
* 员工基本信息 service实现
...
...
@@ -60,6 +62,10 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
return
staffDao
.
queryInWork
();
}
@Override
public
List
<
StaffEntity
>
queryJob
(
Long
positionId
)
{
return
dao
.
queryJob
(
positionId
);
}
}
\ No newline at end of file
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/web/StaffController.java
View file @
673d84b5
...
...
@@ -52,17 +52,13 @@ public class StaffController extends BaseCRUDJsonBodyMappingController<StaffServ
this
.
addDict
(
model
,
"politicalstatus"
,
paramService
.
getParamBySecondOrganize
(
"Staff"
,
"politicalstatus"
));
this
.
addDict
(
model
,
"staffType"
,
paramService
.
getParamBySecondOrganize
(
"Staff"
,
"staffType"
));
this
.
addDict
(
model
,
"status"
,
paramService
.
getParamBySecondOrganize
(
"Staff"
,
"status"
));
this
.
addDict
(
model
,
"positionId"
,
jobService
.
find
(
new
JobQuery
()).
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getId
().
toString
(),
y
->
y
.
getJobName
(),(
o
,
n
)->
n
)));
this
.
addDict
(
model
,
"positionId"
,
jobService
.
queryPositionName
(
new
JobQuery
()).
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getId
().
toString
(),
y
->
y
.
getJobName
(),(
o
,
n
)->
n
)));
List
<
DeptEntity
>
list
=
deptService
.
find
(
new
DeptQuery
());
List
<
DeptTreeSelect
>
treeSelects
=
deptService
.
buildDeptTreeSelect
(
list
);
this
.
addDict
(
model
,
"deptPerson"
,
treeSelects
);
super
.
init
(
model
,
context
);
}
@Override
protected
void
doListBefore
(
StaffEntity
query
,
Map
<
String
,
Object
>
model
,
Context
context
)
throws
AppException
{
super
.
doListBefore
(
query
,
model
,
context
);
}
@Override
protected
int
doListAfter
(
StaffEntity
query
,
Map
<
String
,
Object
>
model
,
Context
context
)
throws
AppException
{
...
...
attendance-performance-manager/src/main/resources/sqlmap/module/attendance/AttendanceStatMapper.xml
View file @
673d84b5
...
...
@@ -2563,6 +2563,6 @@
</if>
</sql>
<select
id=
"queryEntity"
resultType=
"com.mortals.xhx.module.attendance.model.AttendanceStatEntity"
>
select * from mortals_xhx_attendance_
vacation_balance
where staffId = #{staffId}
select * from mortals_xhx_attendance_
stat
where staffId = #{staffId}
</select>
</mapper>
\ No newline at end of file
attendance-performance-manager/src/main/resources/sqlmap/module/job/JobMapper.xml
View file @
673d84b5
...
...
@@ -672,4 +672,10 @@
</trim>
</if>
</sql>
<select
id=
"queryGroupName"
resultType=
"com.mortals.xhx.module.job.model.JobEntity"
>
select id,groupName from mortals_xhx_job where type = 1
</select>
<select
id=
"queryPositionName"
resultType=
"com.mortals.xhx.module.job.model.JobEntity"
>
select id,jobName from mortals_xhx_job where type = 2
</select>
</mapper>
\ No newline at end of file
attendance-performance-manager/src/main/resources/sqlmap/module/staff/StaffMapper.xml
View file @
673d84b5
...
...
@@ -1420,4 +1420,7 @@
<select
id=
"queryHik"
resultType=
"com.mortals.xhx.module.staff.model.StaffEntity"
>
select * from mortals_xhx_staff where remarkId = #{remarkId}
</select>
<select
id=
"queryJob"
resultType=
"com.mortals.xhx.module.staff.model.StaffEntity"
>
select * from mortals_xhx_staff where positionId = #{positionId}
</select>
</mapper>
\ No newline at end of file
attendance-performance-manager/src/test/java/com/mortals/httpclient/staff/StaffController.http
View file @
673d84b5
...
...
@@ -18,7 +18,6 @@ POST {{baseUrl}}/staff/list
Content-Type: application/json
{
"phoneNumber": "%133%",
"page":1,
"size":10
}
...
...
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