Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
iBiz企业中心
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz企业套件
iBiz企业中心
提交
9a30d8d5
提交
9a30d8d5
编写于
7月 06, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xignzi006 发布系统代码
上级
9ed6d07b
变更
8
展开全部
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
316 行增加
和
1 行删除
+316
-1
leads.ts
app_CRM/src/mock/entity/leads/leads.ts
+179
-0
lead-service-base.ts
app_CRM/src/service/lead/lead-service-base.ts
+26
-0
LeadMapper.java
...ibizlab/businesscentral/core/sales/mapper/LeadMapper.java
+1
-0
ILeadService.java
...zlab/businesscentral/core/sales/service/ILeadService.java
+1
-0
LeadServiceImpl.java
...inesscentral/core/sales/service/impl/LeadServiceImpl.java
+9
-0
LeadMapper.xml
...-core/src/main/resources/mapper/sales/lead/LeadMapper.xml
+9
-0
systemResource.json
...al-core/src/main/resources/permission/systemResource.json
+1
-1
LeadResource.java
...ibizlab/businesscentral/centralapi/rest/LeadResource.java
+90
-0
未找到文件。
app_CRM/src/mock/entity/leads/leads.ts
浏览文件 @
9a30d8d5
...
...
@@ -1871,6 +1871,185 @@ mock.onGet(new RegExp(/^\/leads\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((confi
});
// FetchExcluded
mock
.
onGet
(
new
RegExp
(
/^
\/
accounts
\/([
a-zA-Z0-9
\-\;]{1,35})\/
contacts
\/([
a-zA-Z0-9
\-\;]{1,35})\/
leads
\/
fetchexcluded$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:lead 方法: FetchExcluded"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'accountid'
,
'contactid'
];
let
tempValue
:
any
=
{};
const
matchArray
:
any
=
new
RegExp
(
/^
\/
accounts
\/([
a-zA-Z0-9
\-\;]{1,35})\/
contacts
\/([
a-zA-Z0-9
\-\;]{1,35})\/
leads
\/
fetchexcluded$/
).
exec
(
config
.
url
);
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
if
(
items
.
length
>
0
&&
paramArray
.
length
>
0
)
{
paramArray
.
forEach
((
paramkey
:
any
)
=>
{
if
(
tempValue
[
paramkey
]
&&
tempValue
[
paramkey
].
indexOf
(
";"
)
>
0
)
{
let
keysGrounp
:
Array
<
any
>
=
tempValue
[
paramkey
].
split
(
new
RegExp
(
/
[\;]
/
));
let
tempArray
:
Array
<
any
>
=
[];
keysGrounp
.
forEach
((
singlekey
:
any
)
=>
{
let
_items
=
items
.
filter
((
item
:
any
)
=>
{
return
item
[
paramkey
]
==
singlekey
});
if
(
_items
.
length
>
0
){
tempArray
.
push
(...
_items
);
}
})
items
=
tempArray
;
}
else
{
items
=
items
.
filter
((
item
:
any
)
=>
{
return
item
[
paramkey
]
==
tempValue
[
paramkey
]
});
}
})
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
items
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
items
];
});
// FetchExcluded
mock
.
onGet
(
new
RegExp
(
/^
\/
contacts
\/([
a-zA-Z0-9
\-\;]{1,35})\/
leads
\/
fetchexcluded$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:lead 方法: FetchExcluded"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'contactid'
];
let
tempValue
:
any
=
{};
const
matchArray
:
any
=
new
RegExp
(
/^
\/
contacts
\/([
a-zA-Z0-9
\-\;]{1,35})\/
leads
\/
fetchexcluded$/
).
exec
(
config
.
url
);
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
if
(
items
.
length
>
0
&&
paramArray
.
length
>
0
)
{
paramArray
.
forEach
((
paramkey
:
any
)
=>
{
if
(
tempValue
[
paramkey
]
&&
tempValue
[
paramkey
].
indexOf
(
";"
)
>
0
)
{
let
keysGrounp
:
Array
<
any
>
=
tempValue
[
paramkey
].
split
(
new
RegExp
(
/
[\;]
/
));
let
tempArray
:
Array
<
any
>
=
[];
keysGrounp
.
forEach
((
singlekey
:
any
)
=>
{
let
_items
=
items
.
filter
((
item
:
any
)
=>
{
return
item
[
paramkey
]
==
singlekey
});
if
(
_items
.
length
>
0
){
tempArray
.
push
(...
_items
);
}
})
items
=
tempArray
;
}
else
{
items
=
items
.
filter
((
item
:
any
)
=>
{
return
item
[
paramkey
]
==
tempValue
[
paramkey
]
});
}
})
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
items
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
items
];
});
// FetchExcluded
mock
.
onGet
(
new
RegExp
(
/^
\/
campaigns
\/([
a-zA-Z0-9
\-\;]{1,35})\/
leads
\/
fetchexcluded$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:lead 方法: FetchExcluded"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'campaignid'
];
let
tempValue
:
any
=
{};
const
matchArray
:
any
=
new
RegExp
(
/^
\/
campaigns
\/([
a-zA-Z0-9
\-\;]{1,35})\/
leads
\/
fetchexcluded$/
).
exec
(
config
.
url
);
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
if
(
items
.
length
>
0
&&
paramArray
.
length
>
0
)
{
paramArray
.
forEach
((
paramkey
:
any
)
=>
{
if
(
tempValue
[
paramkey
]
&&
tempValue
[
paramkey
].
indexOf
(
";"
)
>
0
)
{
let
keysGrounp
:
Array
<
any
>
=
tempValue
[
paramkey
].
split
(
new
RegExp
(
/
[\;]
/
));
let
tempArray
:
Array
<
any
>
=
[];
keysGrounp
.
forEach
((
singlekey
:
any
)
=>
{
let
_items
=
items
.
filter
((
item
:
any
)
=>
{
return
item
[
paramkey
]
==
singlekey
});
if
(
_items
.
length
>
0
){
tempArray
.
push
(...
_items
);
}
})
items
=
tempArray
;
}
else
{
items
=
items
.
filter
((
item
:
any
)
=>
{
return
item
[
paramkey
]
==
tempValue
[
paramkey
]
});
}
})
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
items
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
items
];
});
// FetchExcluded
mock
.
onGet
(
new
RegExp
(
/^
\/
leads
\/
fetchexcluded$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:lead 方法: FetchExcluded"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
mockDatas
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
mockDatas
?
mockDatas
:
[]];
});
// FetchExcluded
mock
.
onGet
(
new
RegExp
(
/^
\/
leads
\/
fetchexcluded
(\?[\w
-.
/
?%&=,
]
*
)
*$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:lead 方法: FetchExcluded"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
if
(
config
.
url
.
includes
(
'page'
)){
let
url
=
config
.
url
.
split
(
'?'
)[
1
];
let
params
=
qs
.
parse
(
url
);
Object
.
assign
(
config
,
params
);
}
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
let
total
=
mockDatas
.
length
;
let
records
:
Array
<
any
>
=
[];
if
(
!
config
.
page
||
!
config
.
size
){
records
=
mockDatas
;
}
else
{
if
((
config
.
page
-
1
)
*
config
.
size
<
total
){
records
=
mockDatas
.
slice
(
config
.
page
,
config
.
size
);
}
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
records
?
records
:
[]);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
records
?
records
:
[]];
});
// FetchOn
mock
.
onGet
(
new
RegExp
(
/^
\/
accounts
\/([
a-zA-Z0-9
\-\;]{1,35})\/
contacts
\/([
a-zA-Z0-9
\-\;]{1,35})\/
leads
\/
fetchon$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:lead 方法: FetchOn"
);
...
...
app_CRM/src/service/lead/lead-service-base.ts
浏览文件 @
9a30d8d5
...
...
@@ -953,6 +953,32 @@ export default class LeadServiceBase extends EntityService {
return
Http
.
getInstance
().
get
(
`/leads/fetchdefault`
,
tempData
,
isloading
);
}
/**
* FetchExcluded接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof LeadServiceBase
*/
public
async
FetchExcluded
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
true
){
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/leads/fetchexcluded`
,
tempData
,
isloading
);
}
if
(
context
.
contact
&&
true
){
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/contacts/
${
context
.
contact
}
/leads/fetchexcluded`
,
tempData
,
isloading
);
}
if
(
context
.
campaign
&&
true
){
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/campaigns/
${
context
.
campaign
}
/leads/fetchexcluded`
,
tempData
,
isloading
);
}
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/leads/fetchexcluded`
,
tempData
,
isloading
);
}
/**
* FetchOn接口方法
*
...
...
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/sales/mapper/LeadMapper.java
浏览文件 @
9a30d8d5
...
...
@@ -20,6 +20,7 @@ import com.alibaba.fastjson.JSONObject;
public
interface
LeadMapper
extends
BaseMapper
<
Lead
>{
Page
<
Lead
>
searchDefault
(
IPage
page
,
@Param
(
"srf"
)
LeadSearchContext
context
,
@Param
(
"ew"
)
Wrapper
<
Lead
>
wrapper
)
;
Page
<
Lead
>
searchExcluded
(
IPage
page
,
@Param
(
"srf"
)
LeadSearchContext
context
,
@Param
(
"ew"
)
Wrapper
<
Lead
>
wrapper
)
;
Page
<
Lead
>
searchOn
(
IPage
page
,
@Param
(
"srf"
)
LeadSearchContext
context
,
@Param
(
"ew"
)
Wrapper
<
Lead
>
wrapper
)
;
@Override
Lead
selectById
(
Serializable
id
);
...
...
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/sales/service/ILeadService.java
浏览文件 @
9a30d8d5
...
...
@@ -45,6 +45,7 @@ public interface ILeadService extends IService<Lead>{
void
saveBatch
(
List
<
Lead
>
list
)
;
Lead
unable
(
Lead
et
)
;
Page
<
Lead
>
searchDefault
(
LeadSearchContext
context
)
;
Page
<
Lead
>
searchExcluded
(
LeadSearchContext
context
)
;
Page
<
Lead
>
searchOn
(
LeadSearchContext
context
)
;
List
<
Lead
>
selectByParentaccountid
(
String
accountid
)
;
void
removeByParentaccountid
(
String
accountid
)
;
...
...
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/sales/service/impl/LeadServiceImpl.java
浏览文件 @
9a30d8d5
...
...
@@ -343,6 +343,15 @@ public class LeadServiceImpl extends ServiceImpl<LeadMapper, Lead> implements IL
return
new
PageImpl
<
Lead
>(
pages
.
getRecords
(),
context
.
getPageable
(),
pages
.
getTotal
());
}
/**
* 查询集合 已排除潜在顾客
*/
@Override
public
Page
<
Lead
>
searchExcluded
(
LeadSearchContext
context
)
{
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
Lead
>
pages
=
baseMapper
.
searchExcluded
(
context
.
getPages
(),
context
,
context
.
getSelectCond
());
return
new
PageImpl
<
Lead
>(
pages
.
getRecords
(),
context
.
getPageable
(),
pages
.
getTotal
());
}
/**
* 查询集合 已开启潜在顾客
*/
...
...
businesscentral-core/src/main/resources/mapper/sales/lead/LeadMapper.xml
浏览文件 @
9a30d8d5
...
...
@@ -157,6 +157,15 @@
<if
test=
"ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere"
>
${ew.sqlSegment}
</if>
</select>
<!--数据集合[Excluded]-->
<select
id=
"searchExcluded"
parameterType=
"cn.ibizlab.businesscentral.core.sales.filter.LeadSearchContext"
resultMap=
"LeadResultMap"
>
select t1.* from (
<include
refid=
"Excluded"
/>
)t1
<where><if
test=
"ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere"
>
${ew.sqlSegment}
</if></where>
<if
test=
"ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere"
>
${ew.sqlSegment}
</if>
</select>
<!--数据集合[On]-->
<select
id=
"searchOn"
parameterType=
"cn.ibizlab.businesscentral.core.sales.filter.LeadSearchContext"
resultMap=
"LeadResultMap"
>
select t1.* from (
...
...
businesscentral-core/src/main/resources/permission/systemResource.json
浏览文件 @
9a30d8d5
...
...
@@ -127,7 +127,7 @@
"dename"
:
"Lead"
,
"delogicname"
:
"潜在顾客"
,
"sysmoudle"
:{
"id"
:
"SALES"
,
"name"
:
"Sales"
},
"dedataset"
:[{
"id"
:
"Default"
,
"name"
:
"DEFAULT"
},{
"id"
:
"On"
,
"name"
:
"已开启潜在顾客"
}],
"dedataset"
:[{
"id"
:
"Default"
,
"name"
:
"DEFAULT"
},{
"id"
:
"
Excluded"
,
"name"
:
"已排除潜在顾客"
},{
"id"
:
"
On"
,
"name"
:
"已开启潜在顾客"
}],
"deaction"
:[{
"id"
:
"Create"
,
"name"
:
"Create"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Update"
,
"name"
:
"Update"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Remove"
,
"name"
:
"Remove"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Get"
,
"name"
:
"Get"
,
"type"
:
"BUILTIN"
},{
"id"
:
"GetDraft"
,
"name"
:
"GetDraft"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Active"
,
"name"
:
"重新激活"
,
"type"
:
"USERCUSTOM"
},{
"id"
:
"AddList"
,
"name"
:
"添加到市场营销列表"
,
"type"
:
"USERCUSTOM"
},{
"id"
:
"Cancel"
,
"name"
:
"取消"
,
"type"
:
"DELOGIC"
},{
"id"
:
"CheckKey"
,
"name"
:
"CheckKey"
,
"type"
:
"BUILTIN"
},{
"id"
:
"DisQualification"
,
"name"
:
"取消资格"
,
"type"
:
"USERCUSTOM"
},{
"id"
:
"LostOrder"
,
"name"
:
"丢单"
,
"type"
:
"DELOGIC"
},{
"id"
:
"NoInterested"
,
"name"
:
"不再感兴趣"
,
"type"
:
"DELOGIC"
},{
"id"
:
"Qualification"
,
"name"
:
"授予资格"
,
"type"
:
"USERCUSTOM"
},{
"id"
:
"Save"
,
"name"
:
"Save"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Unable"
,
"name"
:
"无法联系"
,
"type"
:
"DELOGIC"
}],
"datascope"
:[{
"id"
:
"all"
,
"name"
:
"全部数据"
},
{
"id"
:
"createman"
,
"name"
:
"创建人"
}]
}
...
...
businesscentral-provider/businesscentral-provider-centralapi/src/main/java/cn/ibizlab/businesscentral/centralapi/rest/LeadResource.java
浏览文件 @
9a30d8d5
此差异已折叠。
点击以展开。
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录