Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fuyue82
o2oa
提交
b93b0d7d
o2oa
项目概览
fuyue82
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b93b0d7d
编写于
8月 19, 2021
作者:
L
luojing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
考勤-优化打卡部门计算方法
上级
6a0e14f6
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
52 addition
and
3 deletion
+52
-3
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceScheduleSettingService.java
...ble/control/service/AttendanceScheduleSettingService.java
+34
-3
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/UserManagerService.java
...tendance/assemble/control/service/UserManagerService.java
+18
-0
未找到文件。
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceScheduleSettingService.java
浏览文件 @
b93b0d7d
...
...
@@ -3,6 +3,8 @@ package com.x.attendance.assemble.control.service;
import
java.util.List
;
import
com.x.attendance.entity.AttendanceDetail
;
import
com.x.attendance.entity.AttendanceEmployeeConfig
;
import
com.x.base.core.project.tools.ListTools
;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.attendance.assemble.control.Business
;
...
...
@@ -18,7 +20,8 @@ import com.x.base.core.project.logger.LoggerFactory;
public
class
AttendanceScheduleSettingService
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
AttendanceScheduleSettingService
.
class
);
private
AttendanceEmployeeConfigServiceAdv
attendanceEmployeeConfigServiceAdv
=
new
AttendanceEmployeeConfigServiceAdv
();
private
String
topUnit
=
""
;
public
List
<
AttendanceScheduleSetting
>
listAll
(
EntityManagerContainer
emc
)
throws
Exception
{
Business
business
=
new
Business
(
emc
);
return
business
.
getAttendanceScheduleSettingFactory
().
listAll
();
...
...
@@ -77,12 +80,21 @@ public class AttendanceScheduleSettingService {
}
public
AttendanceScheduleSetting
getAttendanceScheduleSettingWithPerson
(
String
personName
,
Boolean
debugger
)
throws
Exception
{
topUnit
=
""
;
UserManagerService
userManagerService
=
new
UserManagerService
();
String
unitName
=
userManagerService
.
getUnitNameWithPersonName
(
personName
);
//先根据考勤人员配置去计算组织及顶级组织,如果没有符合条件的再按personName的人员组织计算
//String unitName = userManagerService.getUnitNameWithPersonName( personName );
String
unitName
=
this
.
getUnitByconfig
(
userManagerService
,
personName
);
if
(
StringUtils
.
isEmpty
(
unitName
)){
unitName
=
userManagerService
.
getUnitNameWithPersonName
(
personName
);
}
AttendanceScheduleSetting
attendanceScheduleSetting
=
getAttendanceScheduleSettingWithUnitName
(
unitName
);
if
(
attendanceScheduleSetting
==
null
)
{
//如果没有找到,那么应该为该人员所属的组织创建一个新的排班配置
String
topUnitName
=
userManagerService
.
getTopUnitNameWithUnitName
(
unitName
);
String
topUnitName
=
topUnit
;
if
(
StringUtils
.
isEmpty
(
topUnit
)){
topUnitName
=
userManagerService
.
getTopUnitNameWithUnitName
(
unitName
);
}
attendanceScheduleSetting
=
createNewScheduleSetting
(
unitName
,
topUnitName
,
debugger
);
}
return
attendanceScheduleSetting
;
...
...
@@ -154,4 +166,23 @@ public class AttendanceScheduleSettingService {
}
return
new_attendanceScheduleSetting
;
}
private
String
getUnitByconfig
(
UserManagerService
userManagerService
,
String
personName
)
throws
Exception
{
String
result
=
""
;
List
<
AttendanceEmployeeConfig
>
attendanceEmployeeConfigList
=
attendanceEmployeeConfigServiceAdv
.
listByConfigType
(
"REQUIRED"
);
if
(
ListTools
.
isNotEmpty
(
attendanceEmployeeConfigList
)
)
{
for
(
AttendanceEmployeeConfig
attendanceEmployeeConfig
:
attendanceEmployeeConfigList
){
if
(
StringUtils
.
isNotEmpty
(
attendanceEmployeeConfig
.
getEmployeeName
())){
if
(
StringUtils
.
equals
(
personName
,
attendanceEmployeeConfig
.
getEmployeeName
())){
result
=
attendanceEmployeeConfig
.
getUnitName
();
}
}
else
if
(
StringUtils
.
isNotEmpty
(
attendanceEmployeeConfig
.
getUnitName
())){
if
(
userManagerService
.
checkHasPerson
(
personName
,
attendanceEmployeeConfig
.
getUnitName
(),
true
)){
result
=
attendanceEmployeeConfig
.
getUnitName
();
topUnit
=
attendanceEmployeeConfig
.
getTopUnitName
();
}
}
}
}
return
result
;
}
}
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/UserManagerService.java
浏览文件 @
b93b0d7d
...
...
@@ -10,6 +10,7 @@ import com.x.base.core.project.organization.Identity;
import
com.x.base.core.project.organization.Person
;
import
com.x.base.core.project.organization.Unit
;
import
com.x.base.core.project.tools.ListTools
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
java.util.List
;
...
...
@@ -442,6 +443,23 @@ public class UserManagerService {
}
}
public
Boolean
checkHasPerson
(
String
personName
,
String
unitName
,
Boolean
recursive
)
throws
Exception
{
if
(
personName
==
null
||
personName
.
isEmpty
())
{
throw
new
Exception
(
"personName is null!"
);
}
if
(
unitName
==
null
||
unitName
.
isEmpty
())
{
throw
new
Exception
(
"unitName is null!"
);
}
if
(
recursive
==
null
)
{
throw
new
Exception
(
"recursive is null!"
);
}
Business
business
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
business
=
new
Business
(
emc
);
return
business
.
organization
().
unit
().
checkHasPerson
(
personName
,
unitName
,
recursive
);
}
}
public
List
<
String
>
listUnitNamesWithPerson
(
String
personName
)
throws
Exception
{
if
(
personName
==
null
||
personName
.
isEmpty
())
{
throw
new
Exception
(
"personName is null!"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录