Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
浙江兰德纵横网络技术股份有限公司
o2oa-crm
提交
18a5f300
O
o2oa-crm
项目概览
浙江兰德纵横网络技术股份有限公司
/
o2oa-crm
通知
0
Star
5
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
o2oa-crm
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
18a5f300
编写于
1月 25, 2021
作者:
L
luojing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
crm,添加未转化线索的搜索及展现
上级
1f77f71c
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
171 addition
and
270 deletion
+171
-270
x_wcrm_assemble_control/src/main/java/com/x/wcrm/assemble/control/factory/LeadsFactory.java
...ava/com/x/wcrm/assemble/control/factory/LeadsFactory.java
+60
-0
x_wcrm_assemble_control/src/main/java/com/x/wcrm/assemble/control/jaxrs/leads/ActionListMyNoTransform.java
...assemble/control/jaxrs/leads/ActionListMyNoTransform.java
+48
-0
x_wcrm_assemble_control/src/main/java/com/x/wcrm/assemble/control/jaxrs/leads/LeadsAction.java
.../com/x/wcrm/assemble/control/jaxrs/leads/LeadsAction.java
+19
-0
x_wcrm_assemble_control/src/main/java/com/x/wcrm/assemble/control/service/LeadsPermissionService.java
...wcrm/assemble/control/service/LeadsPermissionService.java
+43
-0
x_wcrm_assemble_control/x_wcrm_assemble_control.iml
x_wcrm_assemble_control/x_wcrm_assemble_control.iml
+1
-270
未找到文件。
x_wcrm_assemble_control/src/main/java/com/x/wcrm/assemble/control/factory/LeadsFactory.java
浏览文件 @
18a5f300
...
@@ -215,4 +215,64 @@ public class LeadsFactory extends AbstractFactory {
...
@@ -215,4 +215,64 @@ public class LeadsFactory extends AbstractFactory {
return
em
.
createQuery
(
cq
).
getSingleResult
();
return
em
.
createQuery
(
cq
).
getSingleResult
();
}
}
//根据责任人列表获得线索列表 (未转化)
public
List
<
Leads
>
ListByOwnerList_NoTransform
(
List
<
String
>
_distinguishNameList
,
Integer
adjustPage
,
Integer
adjustPageSize
,
String
keyString
,
String
orderFieldName
,
String
orderType
)
throws
Exception
{
EntityManager
em
=
this
.
entityManagerContainer
().
get
(
Leads
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
Leads
>
cq
=
cb
.
createQuery
(
Leads
.
class
);
Root
<
Leads
>
root
=
cq
.
from
(
Leads
.
class
);
Predicate
p
=
root
.
get
(
Leads_
.
owneruser
).
in
(
_distinguishNameList
);
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Leads_
.
istransform
),
BaseAction
.
NOT_TRANSFORM
));
//搜索关键字判断
if
(!
StringWCRMUtils
.
isEmptyKeyString
(
keyString
))
{
String
key
=
StringUtils
.
trim
(
StringUtils
.
replaceEach
(
keyString
,
new
String
[]
{
"\u3000"
,
"?"
,
"%"
},
new
String
[]
{
" "
,
""
,
""
}));
Predicate
p_like
=
cb
.
or
(
cb
.
like
(
root
.
get
(
Leads_
.
name
),
"%"
+
key
+
"%"
),
cb
.
like
(
root
.
get
(
Leads_
.
cellphone
),
"%"
+
key
+
"%"
),
cb
.
like
(
root
.
get
(
Leads_
.
pinyin
),
"%"
+
key
+
"%"
),
cb
.
like
(
root
.
get
(
Leads_
.
pinyinInitial
),
"%"
+
key
+
"%"
),
cb
.
like
(
root
.
get
(
Leads_
.
telephone
),
"%"
+
key
+
"%"
));
p
=
cb
.
and
(
p
,
p_like
);
}
//排序值字段,升降序判断
Order
_order
;
if
(
StringUtils
.
isEmpty
(
orderType
)
||
StringUtils
.
isEmpty
(
orderFieldName
)
||
null
==
orderType
||
null
==
orderFieldName
)
{
_order
=
cb
.
desc
(
root
.
get
(
defaultOrder
));
}
else
{
_order
=
CriteriaQueryTools
.
setOrder
(
cb
,
root
,
Leads_
.
class
,
orderFieldName
,
orderType
);
}
cq
.
select
(
root
).
where
(
p
).
orderBy
(
_order
);
// System.out.println("LeadsFactory.ListByOwnerList():" + cq.toString());
return
em
.
createQuery
(
cq
).
setFirstResult
((
adjustPage
-
1
)
*
adjustPageSize
).
setMaxResults
(
adjustPageSize
)
.
getResultList
();
}
//根据责任人列表获得线索数量(未转化)
public
Long
ListByOwnerList_NoTransform_Count
(
List
<
String
>
_distinguishNameList
,
String
keyString
)
throws
Exception
{
EntityManager
em
=
this
.
entityManagerContainer
().
get
(
Leads
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
Long
>
cq
=
cb
.
createQuery
(
Long
.
class
);
Root
<
Leads
>
root
=
cq
.
from
(
Leads
.
class
);
Predicate
p
=
root
.
get
(
Leads_
.
owneruser
).
in
(
_distinguishNameList
);
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Leads_
.
istransform
),
BaseAction
.
NOT_TRANSFORM
));
//搜索关键字判断
if
(!
StringWCRMUtils
.
isEmptyKeyString
(
keyString
))
{
String
key
=
StringUtils
.
trim
(
StringUtils
.
replaceEach
(
keyString
,
new
String
[]
{
"\u3000"
,
"?"
,
"%"
},
new
String
[]
{
" "
,
""
,
""
}));
Predicate
p_like
=
cb
.
or
(
cb
.
like
(
root
.
get
(
Leads_
.
name
),
"%"
+
key
+
"%"
),
cb
.
like
(
root
.
get
(
Leads_
.
cellphone
),
"%"
+
key
+
"%"
),
cb
.
like
(
root
.
get
(
Leads_
.
pinyin
),
"%"
+
key
+
"%"
),
cb
.
like
(
root
.
get
(
Leads_
.
pinyinInitial
),
"%"
+
key
+
"%"
),
cb
.
like
(
root
.
get
(
Leads_
.
telephone
),
"%"
+
key
+
"%"
));
p
=
cb
.
and
(
p
,
p_like
);
}
cq
.
select
(
cb
.
count
(
root
)).
where
(
p
);
return
em
.
createQuery
(
cq
).
getSingleResult
();
}
}
}
x_wcrm_assemble_control/src/main/java/com/x/wcrm/assemble/control/jaxrs/leads/ActionListMyNoTransform.java
0 → 100644
浏览文件 @
18a5f300
package
com.x.wcrm.assemble.control.jaxrs.leads
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.wcrm.assemble.control.Business
;
import
com.x.wcrm.assemble.control.ThisApplication
;
import
com.x.wcrm.assemble.control.wrapin.ListPagingWi
;
import
com.x.wcrm.core.entity.Leads
;
import
java.util.List
;
class
ActionListMyNoTransform
extends
BaseAction
{
// private static Logger logger = LoggerFactory.getLogger(ActionListMyHasTransform.class);
// 所有当前用户所有递归下级的已转化的线索,按照时间倒序排列。
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
,
Integer
adjustPage
,
Integer
adjustPageSize
,
JsonElement
jsonElement
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Business
business
=
new
Business
(
emc
);
List
<
Leads
>
os
=
leadsPermissionService
.
getList_MyDuty_And_SubNestedDuty_NoTransform
(
ThisApplication
.
context
(),
business
,
effectivePerson
,
adjustPage
,
adjustPageSize
,
wi
.
getKey
(),
wi
.
getOrderFieldName
(),
wi
.
getOrderType
());
List
<
Wo
>
wos
=
Wo
.
copier
.
copy
(
os
);
result
.
setData
(
wos
);
long
count
=
leadsPermissionService
.
getList_MyDuty_And_SubNestedDuty__NoTransform_Count
(
ThisApplication
.
context
(),
business
,
effectivePerson
,
wi
.
getKey
());
result
.
setCount
(
count
);
return
result
;
}
}
public
static
class
Wo
extends
Leads
{
private
static
final
long
serialVersionUID
=
5220686039082993620L
;
static
WrapCopier
<
Leads
,
Wo
>
copier
=
WrapCopierFactory
.
wo
(
Leads
.
class
,
Wo
.
class
,
null
,
JpaObject
.
FieldsInvisible
,
false
);
}
public
static
class
Wi
extends
ListPagingWi
{
}
}
x_wcrm_assemble_control/src/main/java/com/x/wcrm/assemble/control/jaxrs/leads/LeadsAction.java
浏览文件 @
18a5f300
...
@@ -329,4 +329,23 @@ public class LeadsAction extends StandardJaxrsAction {
...
@@ -329,4 +329,23 @@ public class LeadsAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
}
@JaxrsMethodDescribe
(
value
=
"获取我负责,和我下属负责未转化的线索"
,
action
=
ActionListMyNoTransform
.
class
)
@PUT
@Path
(
"listmynotransform/page/{page}/size/{size}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
ListMyNoTransform
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"页码"
)
@PathParam
(
"page"
)
Integer
page
,
@JaxrsParameterDescribe
(
"每页几条"
)
@PathParam
(
"size"
)
Integer
size
,
@JaxrsParameterDescribe
(
"匹配关键字"
)
JsonElement
jsonElement
)
{
ActionResult
<
List
<
ActionListMyNoTransform
.
Wo
>>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionListMyNoTransform
().
execute
(
effectivePerson
,
page
,
size
,
jsonElement
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
}
}
x_wcrm_assemble_control/src/main/java/com/x/wcrm/assemble/control/service/LeadsPermissionService.java
浏览文件 @
18a5f300
...
@@ -189,6 +189,49 @@ public class LeadsPermissionService extends PermissionServiceBase {
...
@@ -189,6 +189,49 @@ public class LeadsPermissionService extends PermissionServiceBase {
return
count
;
return
count
;
}
}
// 获得自己负责的,和我的下属负责线索(未转化):列表
public
List
<
Leads
>
getList_MyDuty_And_SubNestedDuty_NoTransform
(
AbstractContext
context
,
Business
business
,
EffectivePerson
effectivePerson
,
Integer
adjustPage
,
Integer
adjustPageSize
,
String
keyString
,
String
orderFieldName
,
String
orderType
)
throws
Exception
{
String
_me
=
effectivePerson
.
getDistinguishedName
();
List
<
String
>
_me_collection
=
new
ArrayList
<
String
>();
_me_collection
.
add
(
effectivePerson
.
getDistinguishedName
());
List
<
String
>
_persons
=
new
ArrayList
<
String
>();
_persons
.
add
(
_me
);
List
<
String
>
_subNestedPersons
=
getListWithPersonSubNested
(
context
,
effectivePerson
,
_me_collection
);
// 所有下属
if
(
ListTools
.
isNotEmpty
(
_subNestedPersons
))
{
_persons
=
ListTools
.
add
(
_persons
,
true
,
true
,
_subNestedPersons
);
}
// List<Leads> os = business.leadsFactory().ListByOwnerList(_persons);
List
<
Leads
>
os
=
business
.
leadsFactory
().
ListByOwnerList_NoTransform
(
_persons
,
adjustPage
,
adjustPageSize
,
keyString
,
orderFieldName
,
orderType
);
//校验查询出的线索list是否为空
if
(!
os
.
isEmpty
())
{
//获取跟进记录中的最新跟进记录时间和跟进记录内容,并赋值到线索内容中
this
.
getFollowRecords
(
os
,
business
);
}
return
os
;
}
// 获得自己负责的,和我的下属负责线索(未转化):数量
public
long
getList_MyDuty_And_SubNestedDuty__NoTransform_Count
(
AbstractContext
context
,
Business
business
,
EffectivePerson
effectivePerson
,
String
keyString
)
throws
Exception
{
String
_me
=
effectivePerson
.
getDistinguishedName
();
List
<
String
>
_me_collection
=
new
ArrayList
<
String
>();
_me_collection
.
add
(
effectivePerson
.
getDistinguishedName
());
List
<
String
>
_persons
=
new
ArrayList
<
String
>();
_persons
.
add
(
_me
);
List
<
String
>
_subNestedPersons
=
getListWithPersonSubNested
(
context
,
effectivePerson
,
_me_collection
);
// 所有下属
if
(
ListTools
.
isNotEmpty
(
_subNestedPersons
))
{
_persons
=
ListTools
.
add
(
_persons
,
true
,
true
,
_subNestedPersons
);
}
// List<Leads> os = business.leadsFactory().ListByOwnerList(_persons);
long
count
=
business
.
leadsFactory
().
ListByOwnerList_NoTransform_Count
(
_persons
,
keyString
);
return
count
;
}
/**
/**
* 根据线索的ID,获取对应的跟进记录中的最新跟进记录时间和跟进记录内容,并把时间和内容写入到线索内容中返回前端
* 根据线索的ID,获取对应的跟进记录中的最新跟进记录时间和跟进记录内容,并把时间和内容写入到线索内容中返回前端
* @param osList 线索
* @param osList 线索
...
...
x_wcrm_assemble_control/x_wcrm_assemble_control.iml
浏览文件 @
18a5f300
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录