Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
38e454ec
o2oa
项目概览
weixin_42566577
/
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,发现更多精彩内容 >>
提交
38e454ec
编写于
8月 10, 2020
作者:
O
o2null
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'fix/teamwork_cachekey' into 'develop'
考勤缓存修改 See merge request o2oa/o2oa!1371
上级
4bbef840
1ebaa9b6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
36 addition
and
27 deletion
+36
-27
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceSelfHolidayService.java
...ssemble/control/service/AttendanceSelfHolidayService.java
+15
-10
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceStatisticalCycleService.java
...le/control/service/AttendanceStatisticalCycleService.java
+11
-9
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceWorkDayConfigService.java
...emble/control/service/AttendanceWorkDayConfigService.java
+10
-8
未找到文件。
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceSelfHolidayService.java
浏览文件 @
38e454ec
...
...
@@ -2,19 +2,21 @@ package com.x.attendance.assemble.control.service;
import
com.x.attendance.assemble.control.Business
;
import
com.x.attendance.entity.AttendanceSelfHoliday
;
import
com.x.attendance.entity.AttendanceStatisticalCycle
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
net.sf.ehcache.Ehcache
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.CacheManager
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
public
class
AttendanceSelfHolidayService
{
private
Ehcache
cache_AttendanceSelfHoliday
=
ApplicationCache
.
instance
().
getCache
(
AttendanceSelfHoliday
.
class
);
private
CacheCategory
cache_AttendanceSelfHoliday
=
new
CacheCategory
(
AttendanceSelfHoliday
.
class
);
public
AttendanceSelfHoliday
get
(
EntityManagerContainer
emc
,
String
id
)
throws
Exception
{
if
(
id
==
null
||
id
.
isEmpty
()
){
...
...
@@ -37,15 +39,18 @@ public class AttendanceSelfHolidayService {
}
public
List
<
AttendanceSelfHoliday
>
listWithPersonFromCache
(
EntityManagerContainer
emc
,
String
person
,
boolean
debugger
)
throws
Exception
{
String
cacheKey
=
ApplicationCache
.
concreteCacheKey
(
"list#"
+
person
);
Element
element
=
cache_AttendanceSelfHoliday
.
get
(
cacheKey
);
//String cacheKey = ApplicationCache.concreteCacheKey( "list#" + person );
//Element element = cache_AttendanceSelfHoliday.get(cacheKey);
CacheKey
cacheKey
=
new
CacheKey
(
"list#"
+
person
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache_AttendanceSelfHoliday
,
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
return
(
List
<
AttendanceSelfHoliday
>)
element
.
getObjectValue
(
);
if
(
optional
.
isPresent
(
))
{
return
(
(
List
<
AttendanceSelfHoliday
>)
optional
.
get
()
);
}
else
{
List
<
String
>
ids
=
getByPersonName
(
emc
,
person
);
List
<
AttendanceSelfHoliday
>
list
=
list
(
emc
,
ids
);
cache_AttendanceSelfHoliday
.
put
(
new
Element
(
cacheKey
,
list
)
);
CacheManager
.
put
(
cache_AttendanceSelfHoliday
,
cacheKey
,
list
);
return
list
;
}
}
...
...
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceStatisticalCycleService.java
浏览文件 @
38e454ec
...
...
@@ -4,6 +4,7 @@ import java.util.ArrayList;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.concurrent.ConcurrentHashMap
;
import
com.x.attendance.assemble.common.date.DateOperation
;
...
...
@@ -15,15 +16,16 @@ import com.x.base.core.container.EntityManagerContainer;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.annotation.CheckPersistType
;
import
com.x.base.core.entity.annotation.CheckRemoveType
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.cache.CacheManager
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
net.sf.ehcache.Ehcache
;
import
net.sf.ehcache.Element
;
public
class
AttendanceStatisticalCycleService
{
private
Ehcache
cache_AttendanceStatisticalCycle
=
ApplicationCache
.
instance
().
getCache
(
AttendanceStatisticalCycle
.
class
);
private
CacheCategory
cache_AttendanceStatisticalCycle
=
new
CacheCategory
(
AttendanceStatisticalCycle
.
class
);
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
AttendanceStatisticalCycleService
.
class
);
private
UserManagerService
userManagerService
=
new
UserManagerService
();
...
...
@@ -35,12 +37,12 @@ public class AttendanceStatisticalCycleService {
* @throws Exception
*/
public
Map
<
String
,
Map
<
String
,
List
<
AttendanceStatisticalCycle
>>>
getAllStatisticalCycleMapWithCache
(
Boolean
debugger
)
throws
Exception
{
String
cacheKey
=
ApplicationCache
.
concreteCacheKey
(
"map#all"
);
Element
element
=
cache_AttendanceStatisticalCycle
.
get
(
cacheKey
);
CacheKey
cacheKey
=
new
CacheKey
(
"map#all"
);
Map
<
String
,
Map
<
String
,
List
<
AttendanceStatisticalCycle
>>>
statisticalCycleMap
=
null
;
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
return
(
Map
<
String
,
Map
<
String
,
List
<
AttendanceStatisticalCycle
>>>)
element
.
getObjectValue
(
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache_AttendanceStatisticalCycle
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
return
(
(
Map
<
String
,
Map
<
String
,
List
<
AttendanceStatisticalCycle
>>>)
optional
.
get
()
);
}
else
{
return
getCycleMapFormAllCycles
(
false
);
}
...
...
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceWorkDayConfigService.java
浏览文件 @
38e454ec
package
com.x.attendance.assemble.control.service
;
import
java.util.List
;
import
java.util.Optional
;
import
com.x.attendance.assemble.control.Business
;
import
com.x.attendance.entity.AttendanceWorkDayConfig
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
net.sf.ehcache.Ehcache
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.CacheManager
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
public
class
AttendanceWorkDayConfigService
{
private
Ehcache
cache_AttendanceWorkDayConfig
=
ApplicationCache
.
instance
().
getCache
(
AttendanceWorkDayConfig
.
class
);
private
CacheCategory
cache_AttendanceWorkDayConfig
=
new
CacheCategory
(
AttendanceWorkDayConfig
.
class
);
/**
* 从缓存中获取所有的工作日配置
* @return
* @throws Exception
*/
public
List
<
AttendanceWorkDayConfig
>
getAllWorkDayConfigWithCache
(
Boolean
debugger
)
throws
Exception
{
String
cacheKey
=
ApplicationCache
.
concreteCacheKey
(
"list#all"
);
Element
element
=
cache_AttendanceWorkDayConfig
.
get
(
cacheKey
);
CacheKey
cacheKey
=
new
CacheKey
(
"list#all"
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache_AttendanceWorkDayConfig
,
cacheKey
);
List
<
AttendanceWorkDayConfig
>
workDayConfigList
=
null
;
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
return
(
List
<
AttendanceWorkDayConfig
>)
element
.
getObjectValue
(
);
if
(
optional
.
isPresent
(
))
{
return
(
(
List
<
AttendanceWorkDayConfig
>)
optional
.
get
()
);
}
else
{
return
listAll
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录