Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
iBiz企业中心
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz企业套件
iBiz企业中心
提交
f329c977
提交
f329c977
编写于
6月 17, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xignzi006 发布系统代码
上级
dfc9d5f0
变更
7
展开全部
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
577 行增加
和
22 行删除
+577
-22
leads.ts
app_BusinessCentral/src/mock/entity/leads/leads.ts
+271
-0
lead-grid-view-base.vue
...al/src/pages/sales/lead-grid-view/lead-grid-view-base.vue
+12
-2
router.ts
app_BusinessCentral/src/pages/ungroup/central/router.ts
+58
-0
campaign-service-base.ts
...nessCentral/src/service/campaign/campaign-service-base.ts
+50
-0
lead-service-base.ts
app_BusinessCentral/src/service/lead/lead-service-base.ts
+34
-0
h2_table.xml
...esscentral-core/src/main/resources/liquibase/h2_table.xml
+20
-20
LeadResource.java
...ibizlab/businesscentral/centralapi/rest/LeadResource.java
+132
-0
未找到文件。
app_BusinessCentral/src/mock/entity/leads/leads.ts
浏览文件 @
f329c977
此差异已折叠。
点击以展开。
app_BusinessCentral/src/pages/sales/lead-grid-view/lead-grid-view-base.vue
浏览文件 @
f329c977
...
...
@@ -930,7 +930,12 @@ export default class LeadGridViewBase extends Vue {
if
(
args
.
length
>
0
){
Object
.
assign
(
tempContext
,
args
[
0
]);
}
const
deResParameters
:
any
[]
=
[];
let
deResParameters
:
any
[]
=
[];
if
(
tempContext
.
campaign
&&
true
){
deResParameters
=
[
{
pathName
:
'campaigns'
,
parameterName
:
'campaign'
},
]
}
const
parameters
:
any
[]
=
[
{
pathName
:
'leads'
,
parameterName
:
'lead'
},
{
pathName
:
'editview'
,
parameterName
:
'editview'
},
...
...
@@ -964,7 +969,12 @@ export default class LeadGridViewBase extends Vue {
if
(
args
.
length
>
0
){
Object
.
assign
(
tempContext
,
args
[
0
]);
}
const
deResParameters
:
any
[]
=
[];
let
deResParameters
:
any
[]
=
[];
if
(
tempContext
.
campaign
&&
true
){
deResParameters
=
[
{
pathName
:
'campaigns'
,
parameterName
:
'campaign'
},
]
}
const
parameters
:
any
[]
=
[
{
pathName
:
'leads'
,
parameterName
:
'lead'
},
{
pathName
:
'editview'
,
parameterName
:
'editview'
},
...
...
app_BusinessCentral/src/pages/ungroup/central/router.ts
浏览文件 @
f329c977
...
...
@@ -189,6 +189,21 @@ const router = new Router({
},
component
:
()
=>
import
(
'@pages/base/activity-pointer-edit-view/activity-pointer-edit-view.vue'
),
},
{
path
:
'campaigns/:campaign?/leads/:lead?/gridview/:gridview?'
,
meta
:
{
caption
:
'entities.lead.views.gridview.title'
,
info
:
''
,
parameters
:
[
{
pathName
:
'central'
,
parameterName
:
'central'
},
{
pathName
:
'campaigns'
,
parameterName
:
'campaign'
},
{
pathName
:
'leads'
,
parameterName
:
'lead'
},
{
pathName
:
'gridview'
,
parameterName
:
'gridview'
},
],
requireAuth
:
true
,
},
component
:
()
=>
import
(
'@pages/sales/lead-grid-view/lead-grid-view.vue'
),
},
{
path
:
'leads/:lead?/gridview/:gridview?'
,
meta
:
{
...
...
@@ -916,6 +931,21 @@ const router = new Router({
},
component
:
()
=>
import
(
'@pages/base/activity-pointer-by-parent-key/activity-pointer-by-parent-key.vue'
),
},
{
path
:
'campaigns/:campaign?/leads/:lead?/editview/:editview?'
,
meta
:
{
caption
:
'entities.lead.views.editview.title'
,
info
:
''
,
parameters
:
[
{
pathName
:
'central'
,
parameterName
:
'central'
},
{
pathName
:
'campaigns'
,
parameterName
:
'campaign'
},
{
pathName
:
'leads'
,
parameterName
:
'lead'
},
{
pathName
:
'editview'
,
parameterName
:
'editview'
},
],
requireAuth
:
true
,
},
component
:
()
=>
import
(
'@pages/sales/lead-edit-view/lead-edit-view.vue'
),
},
{
path
:
'leads/:lead?/editview/:editview?'
,
meta
:
{
...
...
@@ -1190,6 +1220,20 @@ const router = new Router({
},
component
:
()
=>
import
(
'@pages/marketing/campaign-info-campagin/campaign-info-campagin.vue'
),
},
{
path
:
'/campaigns/:campaign?/leads/:lead?/gridview/:gridview?'
,
meta
:
{
caption
:
'entities.lead.views.gridview.title'
,
info
:
''
,
parameters
:
[
{
pathName
:
'campaigns'
,
parameterName
:
'campaign'
},
{
pathName
:
'leads'
,
parameterName
:
'lead'
},
{
pathName
:
'gridview'
,
parameterName
:
'gridview'
},
],
requireAuth
:
true
,
},
component
:
()
=>
import
(
'@pages/sales/lead-grid-view/lead-grid-view.vue'
),
},
{
path
:
'/leads/:lead?/gridview/:gridview?'
,
meta
:
{
...
...
@@ -1255,6 +1299,20 @@ const router = new Router({
},
component
:
()
=>
import
(
'@pages/base/account-pickup-view/account-pickup-view.vue'
),
},
{
path
:
'/campaigns/:campaign?/leads/:lead?/editview/:editview?'
,
meta
:
{
caption
:
'entities.lead.views.editview.title'
,
info
:
''
,
parameters
:
[
{
pathName
:
'campaigns'
,
parameterName
:
'campaign'
},
{
pathName
:
'leads'
,
parameterName
:
'lead'
},
{
pathName
:
'editview'
,
parameterName
:
'editview'
},
],
requireAuth
:
true
,
},
component
:
()
=>
import
(
'@pages/sales/lead-edit-view/lead-edit-view.vue'
),
},
{
path
:
'/leads/:lead?/editview/:editview?'
,
meta
:
{
...
...
app_BusinessCentral/src/service/campaign/campaign-service-base.ts
浏览文件 @
f329c977
...
...
@@ -62,6 +62,21 @@ export default class CampaignServiceBase extends EntityService {
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
leadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
leadsData
.
length
>
0
){
leadsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
leadid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leads
=
leadsData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
...
...
@@ -71,6 +86,7 @@ export default class CampaignServiceBase extends EntityService {
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/campaigns`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
return
res
;
}
...
...
@@ -85,8 +101,24 @@ export default class CampaignServiceBase extends EntityService {
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
leadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
leadsData
.
length
>
0
){
leadsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
leadid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leads
=
leadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/campaigns/
${
context
.
campaign
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
return
res
;
}
...
...
@@ -102,6 +134,7 @@ export default class CampaignServiceBase extends EntityService {
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/campaigns/getdraft`
,
isloading
);
res
.
data
.
campaign
=
data
.
campaign
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
return
res
;
}
...
...
@@ -116,8 +149,24 @@ export default class CampaignServiceBase extends EntityService {
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
leadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
leadsData
.
length
>
0
){
leadsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
leadid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leads
=
leadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/campaigns/
${
context
.
campaign
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
return
res
;
}
...
...
@@ -132,6 +181,7 @@ export default class CampaignServiceBase extends EntityService {
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/campaigns/
${
context
.
campaign
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
return
res
;
}
...
...
app_BusinessCentral/src/service/lead/lead-service-base.ts
浏览文件 @
f329c977
...
...
@@ -48,6 +48,9 @@ export default class LeadServiceBase extends EntityService {
* @memberof LeadServiceBase
*/
public
async
Select
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
campaign
&&
context
.
lead
){
return
Http
.
getInstance
().
get
(
`/campaigns/
${
context
.
campaign
}
/leads/
${
context
.
lead
}
/select`
,
isloading
);
}
return
Http
.
getInstance
().
get
(
`/leads/
${
context
.
lead
}
/select`
,
isloading
);
}
...
...
@@ -61,6 +64,9 @@ export default class LeadServiceBase extends EntityService {
* @memberof LeadServiceBase
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
campaign
&&
context
.
lead
){
return
Http
.
getInstance
().
put
(
`/campaigns/
${
context
.
campaign
}
/leads/
${
context
.
lead
}
`
,
data
,
isloading
);
}
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/leads/
${
context
.
lead
}
`
,
data
,
isloading
);
...
...
@@ -77,6 +83,9 @@ export default class LeadServiceBase extends EntityService {
* @memberof LeadServiceBase
*/
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
campaign
&&
true
){
return
Http
.
getInstance
().
get
(
`/campaigns/
${
context
.
campaign
}
/leads/getdraft`
,
isloading
);
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/leads/getdraft`
,
isloading
);
res
.
data
.
lead
=
data
.
lead
;
return
res
;
...
...
@@ -92,6 +101,9 @@ export default class LeadServiceBase extends EntityService {
* @memberof LeadServiceBase
*/
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
campaign
&&
context
.
lead
){
return
Http
.
getInstance
().
post
(
`/campaigns/
${
context
.
campaign
}
/leads/
${
context
.
lead
}
/checkkey`
,
data
,
isloading
);
}
return
Http
.
getInstance
().
post
(
`/leads/
${
context
.
lead
}
/checkkey`
,
data
,
isloading
);
}
...
...
@@ -105,6 +117,9 @@ export default class LeadServiceBase extends EntityService {
* @memberof LeadServiceBase
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
campaign
&&
context
.
lead
){
return
Http
.
getInstance
().
get
(
`/campaigns/
${
context
.
campaign
}
/leads/
${
context
.
lead
}
`
,
isloading
);
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/leads/
${
context
.
lead
}
`
,
isloading
);
return
res
;
...
...
@@ -120,6 +135,9 @@ export default class LeadServiceBase extends EntityService {
* @memberof LeadServiceBase
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
campaign
&&
context
.
lead
){
return
Http
.
getInstance
().
post
(
`/campaigns/
${
context
.
campaign
}
/leads/
${
context
.
lead
}
/save`
,
data
,
isloading
);
}
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/leads/
${
context
.
lead
}
/save`
,
data
,
isloading
);
...
...
@@ -136,6 +154,15 @@ export default class LeadServiceBase extends EntityService {
* @memberof LeadServiceBase
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
campaign
&&
true
){
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
return
Http
.
getInstance
().
post
(
`/campaigns/
${
context
.
campaign
}
/leads`
,
data
,
isloading
);
}
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
...
...
@@ -159,6 +186,9 @@ export default class LeadServiceBase extends EntityService {
* @memberof LeadServiceBase
*/
public
async
Remove
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
campaign
&&
context
.
lead
){
return
Http
.
getInstance
().
delete
(
`/campaigns/
${
context
.
campaign
}
/leads/
${
context
.
lead
}
`
,
isloading
);
}
return
Http
.
getInstance
().
delete
(
`/leads/
${
context
.
lead
}
`
,
isloading
);
}
...
...
@@ -173,6 +203,10 @@ export default class LeadServiceBase extends EntityService {
* @memberof LeadServiceBase
*/
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
campaign
&&
true
){
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/campaigns/
${
context
.
campaign
}
/leads/fetchdefault`
,
tempData
,
isloading
);
}
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/leads/fetchdefault`
,
tempData
,
isloading
);
}
...
...
businesscentral-core/src/main/resources/liquibase/h2_table.xml
浏览文件 @
f329c977
此差异已折叠。
点击以展开。
businesscentral-provider/businesscentral-provider-centralapi/src/main/java/cn/ibizlab/businesscentral/centralapi/rest/LeadResource.java
浏览文件 @
f329c977
...
...
@@ -158,5 +158,137 @@ public class LeadResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
body
(
new
PageImpl
(
leadMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
@PreAuthorize
(
"hasPermission(this.leadService.get(#lead_id),'iBizBusinessCentral-Lead-Update')"
)
@ApiOperation
(
value
=
"根据市场活动更新潜在顾客"
,
tags
=
{
"潜在顾客"
},
notes
=
"根据市场活动更新潜在顾客"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/campaigns/{campaign_id}/leads/{lead_id}"
)
@Transactional
public
ResponseEntity
<
LeadDTO
>
updateByCampaign
(
@PathVariable
(
"campaign_id"
)
String
campaign_id
,
@PathVariable
(
"lead_id"
)
String
lead_id
,
@RequestBody
LeadDTO
leaddto
)
{
Lead
domain
=
leadMapping
.
toDomain
(
leaddto
);
domain
.
setCampaignid
(
campaign_id
);
domain
.
setLeadid
(
lead_id
);
leadService
.
update
(
domain
);
LeadDTO
dto
=
leadMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission(this.leadService.getLeadByEntities(this.leadMapping.toDomain(#leaddtos)),'iBizBusinessCentral-Lead-Update')"
)
@ApiOperation
(
value
=
"根据市场活动批量更新潜在顾客"
,
tags
=
{
"潜在顾客"
},
notes
=
"根据市场活动批量更新潜在顾客"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/campaigns/{campaign_id}/leads/batch"
)
public
ResponseEntity
<
Boolean
>
updateBatchByCampaign
(
@PathVariable
(
"campaign_id"
)
String
campaign_id
,
@RequestBody
List
<
LeadDTO
>
leaddtos
)
{
List
<
Lead
>
domainlist
=
leadMapping
.
toDomain
(
leaddtos
);
for
(
Lead
domain:
domainlist
){
domain
.
setCampaignid
(
campaign_id
);
}
leadService
.
updateBatch
(
domainlist
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"根据市场活动获取潜在顾客草稿"
,
tags
=
{
"潜在顾客"
},
notes
=
"根据市场活动获取潜在顾客草稿"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/campaigns/{campaign_id}/leads/getdraft"
)
public
ResponseEntity
<
LeadDTO
>
getDraftByCampaign
(
@PathVariable
(
"campaign_id"
)
String
campaign_id
)
{
Lead
domain
=
new
Lead
();
domain
.
setCampaignid
(
campaign_id
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
leadMapping
.
toDto
(
leadService
.
getDraft
(
domain
)));
}
@ApiOperation
(
value
=
"根据市场活动检查潜在顾客"
,
tags
=
{
"潜在顾客"
},
notes
=
"根据市场活动检查潜在顾客"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/campaigns/{campaign_id}/leads/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKeyByCampaign
(
@PathVariable
(
"campaign_id"
)
String
campaign_id
,
@RequestBody
LeadDTO
leaddto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
leadService
.
checkKey
(
leadMapping
.
toDomain
(
leaddto
)));
}
@PostAuthorize
(
"hasPermission(this.leadMapping.toDomain(returnObject.body),'iBizBusinessCentral-Lead-Get')"
)
@ApiOperation
(
value
=
"根据市场活动获取潜在顾客"
,
tags
=
{
"潜在顾客"
},
notes
=
"根据市场活动获取潜在顾客"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/campaigns/{campaign_id}/leads/{lead_id}"
)
public
ResponseEntity
<
LeadDTO
>
getByCampaign
(
@PathVariable
(
"campaign_id"
)
String
campaign_id
,
@PathVariable
(
"lead_id"
)
String
lead_id
)
{
Lead
domain
=
leadService
.
get
(
lead_id
);
LeadDTO
dto
=
leadMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission(this.leadMapping.toDomain(#leaddto),'iBizBusinessCentral-Lead-Save')"
)
@ApiOperation
(
value
=
"根据市场活动保存潜在顾客"
,
tags
=
{
"潜在顾客"
},
notes
=
"根据市场活动保存潜在顾客"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/campaigns/{campaign_id}/leads/save"
)
public
ResponseEntity
<
Boolean
>
saveByCampaign
(
@PathVariable
(
"campaign_id"
)
String
campaign_id
,
@RequestBody
LeadDTO
leaddto
)
{
Lead
domain
=
leadMapping
.
toDomain
(
leaddto
);
domain
.
setCampaignid
(
campaign_id
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
leadService
.
save
(
domain
));
}
@PreAuthorize
(
"hasPermission(this.leadMapping.toDomain(#leaddtos),'iBizBusinessCentral-Lead-Save')"
)
@ApiOperation
(
value
=
"根据市场活动批量保存潜在顾客"
,
tags
=
{
"潜在顾客"
},
notes
=
"根据市场活动批量保存潜在顾客"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/campaigns/{campaign_id}/leads/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatchByCampaign
(
@PathVariable
(
"campaign_id"
)
String
campaign_id
,
@RequestBody
List
<
LeadDTO
>
leaddtos
)
{
List
<
Lead
>
domainlist
=
leadMapping
.
toDomain
(
leaddtos
);
for
(
Lead
domain:
domainlist
){
domain
.
setCampaignid
(
campaign_id
);
}
leadService
.
saveBatch
(
domainlist
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission(this.leadMapping.toDomain(#leaddto),'iBizBusinessCentral-Lead-Create')"
)
@ApiOperation
(
value
=
"根据市场活动建立潜在顾客"
,
tags
=
{
"潜在顾客"
},
notes
=
"根据市场活动建立潜在顾客"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/campaigns/{campaign_id}/leads"
)
@Transactional
public
ResponseEntity
<
LeadDTO
>
createByCampaign
(
@PathVariable
(
"campaign_id"
)
String
campaign_id
,
@RequestBody
LeadDTO
leaddto
)
{
Lead
domain
=
leadMapping
.
toDomain
(
leaddto
);
domain
.
setCampaignid
(
campaign_id
);
leadService
.
create
(
domain
);
LeadDTO
dto
=
leadMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission(this.leadMapping.toDomain(#leaddtos),'iBizBusinessCentral-Lead-Create')"
)
@ApiOperation
(
value
=
"根据市场活动批量建立潜在顾客"
,
tags
=
{
"潜在顾客"
},
notes
=
"根据市场活动批量建立潜在顾客"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/campaigns/{campaign_id}/leads/batch"
)
public
ResponseEntity
<
Boolean
>
createBatchByCampaign
(
@PathVariable
(
"campaign_id"
)
String
campaign_id
,
@RequestBody
List
<
LeadDTO
>
leaddtos
)
{
List
<
Lead
>
domainlist
=
leadMapping
.
toDomain
(
leaddtos
);
for
(
Lead
domain:
domainlist
){
domain
.
setCampaignid
(
campaign_id
);
}
leadService
.
createBatch
(
domainlist
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission(this.leadService.get(#lead_id),'iBizBusinessCentral-Lead-Remove')"
)
@ApiOperation
(
value
=
"根据市场活动删除潜在顾客"
,
tags
=
{
"潜在顾客"
},
notes
=
"根据市场活动删除潜在顾客"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/campaigns/{campaign_id}/leads/{lead_id}"
)
@Transactional
public
ResponseEntity
<
Boolean
>
removeByCampaign
(
@PathVariable
(
"campaign_id"
)
String
campaign_id
,
@PathVariable
(
"lead_id"
)
String
lead_id
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
leadService
.
remove
(
lead_id
));
}
@PreAuthorize
(
"hasPermission(this.leadService.getLeadByIds(#ids),'iBizBusinessCentral-Lead-Remove')"
)
@ApiOperation
(
value
=
"根据市场活动批量删除潜在顾客"
,
tags
=
{
"潜在顾客"
},
notes
=
"根据市场活动批量删除潜在顾客"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/campaigns/{campaign_id}/leads/batch"
)
public
ResponseEntity
<
Boolean
>
removeBatchByCampaign
(
@RequestBody
List
<
String
>
ids
)
{
leadService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Lead-Default-all')"
)
@ApiOperation
(
value
=
"根据市场活动获取DEFAULT"
,
tags
=
{
"潜在顾客"
}
,
notes
=
"根据市场活动获取DEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/campaigns/{campaign_id}/leads/fetchdefault"
)
public
ResponseEntity
<
List
<
LeadDTO
>>
fetchLeadDefaultByCampaign
(
@PathVariable
(
"campaign_id"
)
String
campaign_id
,
LeadSearchContext
context
)
{
context
.
setN_campaignid_eq
(
campaign_id
);
Page
<
Lead
>
domains
=
leadService
.
searchDefault
(
context
)
;
List
<
LeadDTO
>
list
=
leadMapping
.
toDto
(
domains
.
getContent
());
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
header
(
"x-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageNumber
()))
.
header
(
"x-per-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageSize
()))
.
header
(
"x-total"
,
String
.
valueOf
(
domains
.
getTotalElements
()))
.
body
(
list
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Lead-Default-all')"
)
@ApiOperation
(
value
=
"根据市场活动查询DEFAULT"
,
tags
=
{
"潜在顾客"
}
,
notes
=
"根据市场活动查询DEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/campaigns/{campaign_id}/leads/searchdefault"
)
public
ResponseEntity
<
Page
<
LeadDTO
>>
searchLeadDefaultByCampaign
(
@PathVariable
(
"campaign_id"
)
String
campaign_id
,
@RequestBody
LeadSearchContext
context
)
{
context
.
setN_campaignid_eq
(
campaign_id
);
Page
<
Lead
>
domains
=
leadService
.
searchDefault
(
context
)
;
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
body
(
new
PageImpl
(
leadMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
}
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录