Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fuyue82
o2oa
提交
35efcd0c
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,发现更多精彩内容 >>
提交
35efcd0c
编写于
9月 10, 2020
作者:
L
luojing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复jpql distinct 导致响应缓慢
上级
fa80acc2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
34 addition
and
30 deletion
+34
-30
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/factory/AttendanceDetailFactory.java
...nce/assemble/control/factory/AttendanceDetailFactory.java
+29
-26
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/factory/DingdingAttendanceFactory.java
...e/assemble/control/factory/DingdingAttendanceFactory.java
+5
-4
未找到文件。
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/factory/AttendanceDetailFactory.java
浏览文件 @
35efcd0c
...
@@ -3,6 +3,7 @@ package com.x.attendance.assemble.control.factory;
...
@@ -3,6 +3,7 @@ package com.x.attendance.assemble.control.factory;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
javax.persistence.EntityManager
;
import
javax.persistence.EntityManager
;
import
javax.persistence.Query
;
import
javax.persistence.Query
;
...
@@ -284,8 +285,10 @@ public class AttendanceDetailFactory extends AbstractFactory {
...
@@ -284,8 +285,10 @@ public class AttendanceDetailFactory extends AbstractFactory {
}
}
}
}
cq
.
distinct
(
true
).
select
(
root
.
get
(
AttendanceDetail_
.
empName
)
);
/*cq.distinct(true).select( root.get( AttendanceDetail_.empName ) );
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
20000
).
getResultList
();
return em.createQuery(cq.where(p)).setMaxResults(20000).getResultList();*/
cq
.
select
(
root
.
get
(
AttendanceDetail_
.
empName
)
).
where
(
p
);
return
em
.
createQuery
(
cq
).
setMaxResults
(
20000
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
}
}
/**
/**
...
@@ -344,8 +347,8 @@ public class AttendanceDetailFactory extends AbstractFactory {
...
@@ -344,8 +347,8 @@ public class AttendanceDetailFactory extends AbstractFactory {
}
}
}
}
cq
.
distinct
(
true
).
select
(
root
.
get
(
AttendanceDetail_
.
empName
)
);
cq
.
select
(
root
.
get
(
AttendanceDetail_
.
empName
)
).
where
(
p
);
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
20000
).
getResultList
(
);
return
em
.
createQuery
(
cq
).
setMaxResults
(
20000
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
()
);
}
}
//@MethodDescribe("按指定的开始时间,结束时间列示未被分析的AttendanceDetail信息列表")
//@MethodDescribe("按指定的开始时间,结束时间列示未被分析的AttendanceDetail信息列表")
...
@@ -433,11 +436,11 @@ public class AttendanceDetailFactory extends AbstractFactory {
...
@@ -433,11 +436,11 @@ public class AttendanceDetailFactory extends AbstractFactory {
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
AttendanceDetail
>
root
=
cq
.
from
(
AttendanceDetail
.
class
);
Root
<
AttendanceDetail
>
root
=
cq
.
from
(
AttendanceDetail
.
class
);
cq
.
distinct
(
true
).
select
(
root
.
get
(
AttendanceDetail_
.
unitName
));
cq
.
select
(
root
.
get
(
AttendanceDetail_
.
unitName
));
Predicate
p
=
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
recordStatus
),
1
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
recordStatus
),
1
);
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
yearString
),
year
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
yearString
),
year
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
monthString
),
month
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
monthString
),
month
));
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
20000
).
getResultList
();
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
20000
).
getResultList
()
.
stream
().
distinct
().
collect
(
Collectors
.
toList
())
;
}
}
/**
/**
...
@@ -482,11 +485,11 @@ public class AttendanceDetailFactory extends AbstractFactory {
...
@@ -482,11 +485,11 @@ public class AttendanceDetailFactory extends AbstractFactory {
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
AttendanceDetail
>
root
=
cq
.
from
(
AttendanceDetail
.
class
);
Root
<
AttendanceDetail
>
root
=
cq
.
from
(
AttendanceDetail
.
class
);
cq
.
distinct
(
true
).
select
(
root
.
get
(
AttendanceDetail_
.
unitName
));
cq
.
select
(
root
.
get
(
AttendanceDetail_
.
unitName
));
Predicate
p
=
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
recordStatus
),
1
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
recordStatus
),
1
);
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
cycleYear
),
cycleYear
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
cycleYear
),
cycleYear
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
cycleMonth
),
cycleMonth
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
cycleMonth
),
cycleMonth
));
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
20000
).
getResultList
();
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
20000
).
getResultList
()
.
stream
().
distinct
().
collect
(
Collectors
.
toList
())
;
}
}
//@MethodDescribe("按指定的统计周期年份,月份列示AttendanceDetail信息中涉及的顶层组织名称列表")
//@MethodDescribe("按指定的统计周期年份,月份列示AttendanceDetail信息中涉及的顶层组织名称列表")
...
@@ -498,11 +501,11 @@ public class AttendanceDetailFactory extends AbstractFactory {
...
@@ -498,11 +501,11 @@ public class AttendanceDetailFactory extends AbstractFactory {
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
AttendanceDetail
>
root
=
cq
.
from
(
AttendanceDetail
.
class
);
Root
<
AttendanceDetail
>
root
=
cq
.
from
(
AttendanceDetail
.
class
);
cq
.
distinct
(
true
).
select
(
root
.
get
(
AttendanceDetail_
.
topUnitName
));
cq
.
select
(
root
.
get
(
AttendanceDetail_
.
topUnitName
));
Predicate
p
=
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
recordStatus
),
1
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
recordStatus
),
1
);
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
yearString
),
year
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
yearString
),
year
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
monthString
),
month
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
monthString
),
month
));
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
1000
).
getResultList
();
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
1000
).
getResultList
()
.
stream
().
distinct
().
collect
(
Collectors
.
toList
())
;
}
}
//@MethodDescribe("按指定的统计周期年份,月份列示AttendanceDetail信息中涉及的员工姓名列表")
//@MethodDescribe("按指定的统计周期年份,月份列示AttendanceDetail信息中涉及的员工姓名列表")
...
@@ -514,11 +517,11 @@ public class AttendanceDetailFactory extends AbstractFactory {
...
@@ -514,11 +517,11 @@ public class AttendanceDetailFactory extends AbstractFactory {
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
AttendanceDetail
>
root
=
cq
.
from
(
AttendanceDetail
.
class
);
Root
<
AttendanceDetail
>
root
=
cq
.
from
(
AttendanceDetail
.
class
);
cq
.
distinct
(
true
).
select
(
root
.
get
(
AttendanceDetail_
.
empName
));
cq
.
select
(
root
.
get
(
AttendanceDetail_
.
empName
));
Predicate
p
=
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
recordStatus
),
1
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
recordStatus
),
1
);
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
cycleYear
),
cycleYear
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
cycleYear
),
cycleYear
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
cycleMonth
),
cycleMonth
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
cycleMonth
),
cycleMonth
));
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
20000
).
getResultList
();
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
20000
).
getResultList
()
.
stream
().
distinct
().
collect
(
Collectors
.
toList
())
;
}
}
//@MethodDescribe("按指定的统计周期年份,月份列示AttendanceDetail信息中涉及的顶层组织名称列表")
//@MethodDescribe("按指定的统计周期年份,月份列示AttendanceDetail信息中涉及的顶层组织名称列表")
...
@@ -530,11 +533,11 @@ public class AttendanceDetailFactory extends AbstractFactory {
...
@@ -530,11 +533,11 @@ public class AttendanceDetailFactory extends AbstractFactory {
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
AttendanceDetail
>
root
=
cq
.
from
(
AttendanceDetail
.
class
);
Root
<
AttendanceDetail
>
root
=
cq
.
from
(
AttendanceDetail
.
class
);
cq
.
distinct
(
true
).
select
(
root
.
get
(
AttendanceDetail_
.
topUnitName
));
cq
.
select
(
root
.
get
(
AttendanceDetail_
.
topUnitName
));
Predicate
p
=
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
recordStatus
),
1
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
recordStatus
),
1
);
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
cycleYear
),
cycleYear
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
cycleYear
),
cycleYear
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
cycleMonth
),
cycleMonth
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
cycleMonth
),
cycleMonth
));
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
20000
).
getResultList
();
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
20000
).
getResultList
()
.
stream
().
distinct
().
collect
(
Collectors
.
toList
())
;
}
}
//@MethodDescribe("按指定的统计周期年份,月份列示AttendanceDetail信息中涉及的组织名称列表")
//@MethodDescribe("按指定的统计周期年份,月份列示AttendanceDetail信息中涉及的组织名称列表")
...
@@ -546,11 +549,11 @@ public class AttendanceDetailFactory extends AbstractFactory {
...
@@ -546,11 +549,11 @@ public class AttendanceDetailFactory extends AbstractFactory {
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
AttendanceDetail
>
root
=
cq
.
from
(
AttendanceDetail
.
class
);
Root
<
AttendanceDetail
>
root
=
cq
.
from
(
AttendanceDetail
.
class
);
cq
.
distinct
(
true
).
select
(
root
.
get
(
AttendanceDetail_
.
unitName
));
cq
.
select
(
root
.
get
(
AttendanceDetail_
.
unitName
));
Predicate
p
=
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
recordStatus
),
1
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
recordStatus
),
1
);
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
cycleYear
),
cycleYear
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
cycleYear
),
cycleYear
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
cycleMonth
),
cycleMonth
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
cycleMonth
),
cycleMonth
));
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
20000
).
getResultList
();
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
20000
).
getResultList
()
.
stream
().
distinct
().
collect
(
Collectors
.
toList
())
;
}
}
//@MethodDescribe("按指定的统计周期年份,月份列示AttendanceDetail信息中涉及的组织名称列表")
//@MethodDescribe("按指定的统计周期年份,月份列示AttendanceDetail信息中涉及的组织名称列表")
...
@@ -562,12 +565,12 @@ public class AttendanceDetailFactory extends AbstractFactory {
...
@@ -562,12 +565,12 @@ public class AttendanceDetailFactory extends AbstractFactory {
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
AttendanceDetail
>
root
=
cq
.
from
(
AttendanceDetail
.
class
);
Root
<
AttendanceDetail
>
root
=
cq
.
from
(
AttendanceDetail
.
class
);
cq
.
distinct
(
true
).
select
(
root
.
get
(
AttendanceDetail_
.
unitName
));
cq
.
select
(
root
.
get
(
AttendanceDetail_
.
unitName
));
Predicate
p
=
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
recordStatus
),
1
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
recordStatus
),
1
);
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
cycleYear
),
cycleYear
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
cycleYear
),
cycleYear
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
cycleMonth
),
cycleMonth
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
cycleMonth
),
cycleMonth
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
empName
),
employeeName
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
empName
),
employeeName
));
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
20000
).
getResultList
();
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
20000
).
getResultList
()
.
stream
().
distinct
().
collect
(
Collectors
.
toList
())
;
}
}
...
@@ -580,10 +583,10 @@ public class AttendanceDetailFactory extends AbstractFactory {
...
@@ -580,10 +583,10 @@ public class AttendanceDetailFactory extends AbstractFactory {
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
AttendanceDetail
>
root
=
cq
.
from
(
AttendanceDetail
.
class
);
Root
<
AttendanceDetail
>
root
=
cq
.
from
(
AttendanceDetail
.
class
);
cq
.
distinct
(
true
).
select
(
root
.
get
(
AttendanceDetail_
.
id
));
cq
.
select
(
root
.
get
(
AttendanceDetail_
.
id
));
//一般始终为true, id is not null
//一般始终为true, id is not null
Predicate
p
=
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
batchName
),
file_id
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
AttendanceDetail_
.
batchName
),
file_id
);
return
em
.
createQuery
(
cq
.
where
(
p
)).
getResultList
();
return
em
.
createQuery
(
cq
.
where
(
p
)).
getResultList
()
.
stream
().
distinct
().
collect
(
Collectors
.
toList
())
;
}
}
//@MethodDescribe("按年份月份查询某用户的打卡数据记录列表")
//@MethodDescribe("按年份月份查询某用户的打卡数据记录列表")
...
@@ -1304,9 +1307,9 @@ public class AttendanceDetailFactory extends AbstractFactory {
...
@@ -1304,9 +1307,9 @@ public class AttendanceDetailFactory extends AbstractFactory {
List
<
Selection
<?>>
selectionList
=
new
ArrayList
<
Selection
<?>>();
List
<
Selection
<?>>
selectionList
=
new
ArrayList
<
Selection
<?>>();
selectionList
.
add
(
root
.
get
(
AttendanceDetail_
.
cycleYear
));
selectionList
.
add
(
root
.
get
(
AttendanceDetail_
.
cycleYear
));
selectionList
.
add
(
root
.
get
(
AttendanceDetail_
.
cycleMonth
));
selectionList
.
add
(
root
.
get
(
AttendanceDetail_
.
cycleMonth
));
cq
.
distinct
(
true
).
multiselect
(
selectionList
);
cq
.
multiselect
(
selectionList
);
return
em
.
createQuery
(
cq
.
where
(
p
)).
getResultList
();
return
em
.
createQuery
(
cq
.
where
(
p
)).
getResultList
()
.
stream
().
distinct
().
collect
(
Collectors
.
toList
())
;
}
}
public
List
<
AttendanceCycles
>
getCyclesFromDetailWithDateSplit
(
String
empName
,
Date
startDate
,
Date
endDate
)
throws
Exception
{
public
List
<
AttendanceCycles
>
getCyclesFromDetailWithDateSplit
(
String
empName
,
Date
startDate
,
Date
endDate
)
throws
Exception
{
...
@@ -1322,9 +1325,9 @@ public class AttendanceDetailFactory extends AbstractFactory {
...
@@ -1322,9 +1325,9 @@ public class AttendanceDetailFactory extends AbstractFactory {
List
<
Selection
<?>>
selectionList
=
new
ArrayList
<
Selection
<?>>();
List
<
Selection
<?>>
selectionList
=
new
ArrayList
<
Selection
<?>>();
selectionList
.
add
(
root
.
get
(
AttendanceDetail_
.
cycleYear
));
selectionList
.
add
(
root
.
get
(
AttendanceDetail_
.
cycleYear
));
selectionList
.
add
(
root
.
get
(
AttendanceDetail_
.
cycleMonth
));
selectionList
.
add
(
root
.
get
(
AttendanceDetail_
.
cycleMonth
));
cq
.
distinct
(
true
).
multiselect
(
selectionList
);
cq
.
multiselect
(
selectionList
);
return
em
.
createQuery
(
cq
.
where
(
p
)).
getResultList
();
return
em
.
createQuery
(
cq
.
where
(
p
)).
getResultList
()
.
stream
().
distinct
().
collect
(
Collectors
.
toList
())
;
}
}
//@MethodDescribe("查询未归档的条卡记录列表,最大2000条")
//@MethodDescribe("查询未归档的条卡记录列表,最大2000条")
...
@@ -1409,7 +1412,7 @@ public class AttendanceDetailFactory extends AbstractFactory {
...
@@ -1409,7 +1412,7 @@ public class AttendanceDetailFactory extends AbstractFactory {
);
);
p
=
cb
.
and
(
p
,
p_or
);
p
=
cb
.
and
(
p
,
p_or
);
}
}
cq
.
distinct
(
true
).
select
(
root
.
get
(
AttendanceDetail_
.
empName
));
cq
.
select
(
root
.
get
(
AttendanceDetail_
.
empName
));
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
100000
).
getResultList
();
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
100000
).
getResultList
()
.
stream
().
distinct
().
collect
(
Collectors
.
toList
())
;
}
}
}
}
\ No newline at end of file
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/factory/DingdingAttendanceFactory.java
浏览文件 @
35efcd0c
...
@@ -15,6 +15,7 @@ import javax.persistence.metamodel.SingularAttribute;
...
@@ -15,6 +15,7 @@ import javax.persistence.metamodel.SingularAttribute;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
public
class
DingdingAttendanceFactory
extends
AbstractFactory
{
public
class
DingdingAttendanceFactory
extends
AbstractFactory
{
...
@@ -315,8 +316,8 @@ public class DingdingAttendanceFactory extends AbstractFactory {
...
@@ -315,8 +316,8 @@ public class DingdingAttendanceFactory extends AbstractFactory {
CriteriaQuery
<
String
>
query
=
cb
.
createQuery
(
String
.
class
);
CriteriaQuery
<
String
>
query
=
cb
.
createQuery
(
String
.
class
);
Root
<
AttendanceDingtalkDetail
>
root
=
query
.
from
(
AttendanceDingtalkDetail
.
class
);
Root
<
AttendanceDingtalkDetail
>
root
=
query
.
from
(
AttendanceDingtalkDetail
.
class
);
Predicate
p
=
cb
.
between
(
root
.
get
(
AttendanceDingtalkDetail_
.
userCheckTime
),
startTime
.
getTime
(),
endTime
.
getTime
());
Predicate
p
=
cb
.
between
(
root
.
get
(
AttendanceDingtalkDetail_
.
userCheckTime
),
startTime
.
getTime
(),
endTime
.
getTime
());
query
.
select
(
root
.
get
(
AttendanceDingtalkDetail_
.
o2Unit
)).
where
(
p
)
.
distinct
(
true
)
;
query
.
select
(
root
.
get
(
AttendanceDingtalkDetail_
.
o2Unit
)).
where
(
p
);
return
em
.
createQuery
(
query
).
getResultList
();
return
em
.
createQuery
(
query
).
getResultList
()
.
stream
().
distinct
().
collect
(
Collectors
.
toList
())
;
}
}
...
@@ -608,8 +609,8 @@ public class DingdingAttendanceFactory extends AbstractFactory {
...
@@ -608,8 +609,8 @@ public class DingdingAttendanceFactory extends AbstractFactory {
CriteriaQuery
<
String
>
query
=
cb
.
createQuery
(
String
.
class
);
CriteriaQuery
<
String
>
query
=
cb
.
createQuery
(
String
.
class
);
Root
<
AttendanceQywxDetail
>
root
=
query
.
from
(
AttendanceQywxDetail
.
class
);
Root
<
AttendanceQywxDetail
>
root
=
query
.
from
(
AttendanceQywxDetail
.
class
);
Predicate
p
=
cb
.
between
(
root
.
get
(
AttendanceQywxDetail_
.
checkin_time_date
),
startTime
,
endTime
);
Predicate
p
=
cb
.
between
(
root
.
get
(
AttendanceQywxDetail_
.
checkin_time_date
),
startTime
,
endTime
);
query
.
select
(
root
.
get
(
AttendanceQywxDetail_
.
o2Unit
)).
where
(
p
)
.
distinct
(
true
)
;
query
.
select
(
root
.
get
(
AttendanceQywxDetail_
.
o2Unit
)).
where
(
p
);
return
em
.
createQuery
(
query
).
getResultList
();
return
em
.
createQuery
(
query
).
getResultList
()
.
stream
().
distinct
().
collect
(
Collectors
.
toList
())
;
}
}
/**
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录