Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
iBiz企业中心
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz企业套件
iBiz企业中心
提交
205355df
提交
205355df
编写于
7月 10, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xignzi006 部署微服务应用
上级
5aa09206
变更
10
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
799 行增加
和
766 行删除
+799
-766
campaign-service-base.ts
app_CRM/src/service/campaign/campaign-service-base.ts
+47
-47
competitor-service-base.ts
app_CRM/src/service/competitor/competitor-service-base.ts
+41
-41
ibiz-list-service-base.ts
app_CRM/src/service/ibiz-list/ibiz-list-service-base.ts
+82
-82
lead-service-base.ts
app_CRM/src/service/lead/lead-service-base.ts
+369
-369
opportunity-service-base.ts
app_CRM/src/service/opportunity/opportunity-service-base.ts
+223
-223
Dockerfile
...al-app/businesscentral-app-crm/src/main/docker/Dockerfile
+1
-1
businesscentral-app-crm.yaml
...tral-app-crm/src/main/docker/businesscentral-app-crm.yaml
+15
-1
Dockerfile
...pp/businesscentral-app-website/src/main/docker/Dockerfile
+1
-1
businesscentral-app-website.yaml
...-website/src/main/docker/businesscentral-app-website.yaml
+15
-1
config.xml
config.xml
+5
-0
未找到文件。
app_CRM/src/service/campaign/campaign-service-base.ts
浏览文件 @
205355df
...
...
@@ -77,36 +77,36 @@ export default class CampaignServiceBase extends EntityService {
}
}
masterData
.
campaignlists
=
campaignlistsData
;
let
campaigncampaign
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
campaigncampaign
s'
),
'undefined'
)){
campaigncampaignsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaign
s'
)
as
any
);
if
(
campaigncampaignsData
&&
campaigncampaignsData
.
length
&&
campaigncampaign
sData
.
length
>
0
){
campaigncampaign
sData
.
forEach
((
item
:
any
)
=>
{
let
lead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
lead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
lead
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
campaigncampaigns
=
campaigncampaign
sData
;
let
lead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
lead
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
leads
=
lead
sData
;
let
campaigncampaign
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
campaigncampaign
s'
),
'undefined'
)){
campaigncampaignsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaign
s'
)
as
any
);
if
(
campaigncampaignsData
&&
campaigncampaignsData
.
length
&&
campaigncampaign
sData
.
length
>
0
){
campaigncampaign
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
lead
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leads
=
lead
sData
;
masterData
.
campaigncampaigns
=
campaigncampaign
sData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
...
...
@@ -117,8 +117,8 @@ 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
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_campaigncampaigns'
,
JSON
.
stringify
(
res
.
data
.
campaigncampaigns
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_campaigncampaigns'
,
JSON
.
stringify
(
res
.
data
.
campaigncampaigns
));
return
res
;
}
...
...
@@ -148,41 +148,41 @@ export default class CampaignServiceBase extends EntityService {
}
}
masterData
.
campaignlists
=
campaignlistsData
;
let
campaigncampaign
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
campaigncampaign
s'
),
'undefined'
)){
campaigncampaignsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaign
s'
)
as
any
);
if
(
campaigncampaignsData
&&
campaigncampaignsData
.
length
&&
campaigncampaign
sData
.
length
>
0
){
campaigncampaign
sData
.
forEach
((
item
:
any
)
=>
{
let
lead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
lead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
lead
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
campaigncampaigns
=
campaigncampaign
sData
;
let
lead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
lead
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
leads
=
lead
sData
;
let
campaigncampaign
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
campaigncampaign
s'
),
'undefined'
)){
campaigncampaignsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaign
s'
)
as
any
);
if
(
campaigncampaignsData
&&
campaigncampaignsData
.
length
&&
campaigncampaign
sData
.
length
>
0
){
campaigncampaign
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
lead
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leads
=
lead
sData
;
masterData
.
campaigncampaigns
=
campaigncampaign
sData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/campaigns/
${
context
.
campaign
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
,
JSON
.
stringify
(
res
.
data
.
campaigncampaigns
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
,
JSON
.
stringify
(
res
.
data
.
campaigncampaigns
));
return
res
;
}
...
...
@@ -211,8 +211,8 @@ 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
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
,
JSON
.
stringify
(
res
.
data
.
campaigncampaigns
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
,
JSON
.
stringify
(
res
.
data
.
campaigncampaigns
));
return
res
;
}
...
...
@@ -229,8 +229,8 @@ export default class CampaignServiceBase extends EntityService {
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/campaigns/getdraft`
,
isloading
);
res
.
data
.
campaign
=
data
.
campaign
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
,
JSON
.
stringify
(
res
.
data
.
campaigncampaigns
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
,
JSON
.
stringify
(
res
.
data
.
campaigncampaigns
));
return
res
;
}
...
...
@@ -273,41 +273,41 @@ export default class CampaignServiceBase extends EntityService {
}
}
masterData
.
campaignlists
=
campaignlistsData
;
let
campaigncampaign
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
campaigncampaign
s'
),
'undefined'
)){
campaigncampaignsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaign
s'
)
as
any
);
if
(
campaigncampaignsData
&&
campaigncampaignsData
.
length
&&
campaigncampaign
sData
.
length
>
0
){
campaigncampaign
sData
.
forEach
((
item
:
any
)
=>
{
let
lead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
lead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
lead
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
campaigncampaigns
=
campaigncampaign
sData
;
let
lead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
lead
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
leads
=
lead
sData
;
let
campaigncampaign
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
campaigncampaign
s'
),
'undefined'
)){
campaigncampaignsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaign
s'
)
as
any
);
if
(
campaigncampaignsData
&&
campaigncampaignsData
.
length
&&
campaigncampaign
sData
.
length
>
0
){
campaigncampaign
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
lead
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leads
=
lead
sData
;
masterData
.
campaigncampaigns
=
campaigncampaign
sData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/campaigns/
${
context
.
campaign
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
,
JSON
.
stringify
(
res
.
data
.
campaigncampaigns
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
,
JSON
.
stringify
(
res
.
data
.
campaigncampaigns
));
return
res
;
}
...
...
app_CRM/src/service/competitor/competitor-service-base.ts
浏览文件 @
205355df
...
...
@@ -77,11 +77,11 @@ export default class CompetitorServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
let
competitorproduct
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
competitorproduct
s'
),
'undefined'
)){
competitorproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorproduct
s'
)
as
any
);
if
(
competitorproductsData
&&
competitorproductsData
.
length
&&
competitorproduct
sData
.
length
>
0
){
competitorproduct
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunitycompetitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunitycompetitor
s'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunitycompetitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunitycompetitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -91,12 +91,12 @@ export default class CompetitorServiceBase extends EntityService {
});
}
}
masterData
.
competitorproducts
=
competitorproduct
sData
;
let
opportunitycompetitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunitycompetitor
s'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunitycompetitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunitycompetitor
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
opportunitycompetitors
=
opportunitycompetitor
sData
;
let
competitorproduct
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
competitorproduct
s'
),
'undefined'
)){
competitorproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorproduct
s'
)
as
any
);
if
(
competitorproductsData
&&
competitorproductsData
.
length
&&
competitorproduct
sData
.
length
>
0
){
competitorproduct
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -106,7 +106,7 @@ export default class CompetitorServiceBase extends EntityService {
});
}
}
masterData
.
opportunitycompetitors
=
opportunitycompetitor
sData
;
masterData
.
competitorproducts
=
competitorproduct
sData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
...
...
@@ -117,8 +117,8 @@ export default class CompetitorServiceBase extends EntityService {
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/competitors`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_competitorproducts'
,
JSON
.
stringify
(
res
.
data
.
competitorproducts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_competitorproducts'
,
JSON
.
stringify
(
res
.
data
.
competitorproducts
));
return
res
;
}
...
...
@@ -148,11 +148,11 @@ export default class CompetitorServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
let
competitorproduct
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
competitorproduct
s'
),
'undefined'
)){
competitorproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorproduct
s'
)
as
any
);
if
(
competitorproductsData
&&
competitorproductsData
.
length
&&
competitorproduct
sData
.
length
>
0
){
competitorproduct
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunitycompetitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunitycompetitor
s'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunitycompetitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunitycompetitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -162,12 +162,12 @@ export default class CompetitorServiceBase extends EntityService {
});
}
}
masterData
.
competitorproducts
=
competitorproduct
sData
;
let
opportunitycompetitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunitycompetitor
s'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunitycompetitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunitycompetitor
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
opportunitycompetitors
=
opportunitycompetitor
sData
;
let
competitorproduct
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
competitorproduct
s'
),
'undefined'
)){
competitorproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorproduct
s'
)
as
any
);
if
(
competitorproductsData
&&
competitorproductsData
.
length
&&
competitorproduct
sData
.
length
>
0
){
competitorproduct
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -177,12 +177,12 @@ export default class CompetitorServiceBase extends EntityService {
});
}
}
masterData
.
opportunitycompetitors
=
opportunitycompetitor
sData
;
masterData
.
competitorproducts
=
competitorproduct
sData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/competitors/
${
context
.
competitor
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorproducts'
,
JSON
.
stringify
(
res
.
data
.
competitorproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorproducts'
,
JSON
.
stringify
(
res
.
data
.
competitorproducts
));
return
res
;
}
...
...
@@ -211,8 +211,8 @@ export default class CompetitorServiceBase extends EntityService {
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/competitors/
${
context
.
competitor
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorproducts'
,
JSON
.
stringify
(
res
.
data
.
competitorproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorproducts'
,
JSON
.
stringify
(
res
.
data
.
competitorproducts
));
return
res
;
}
...
...
@@ -229,8 +229,8 @@ export default class CompetitorServiceBase extends EntityService {
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/competitors/getdraft`
,
isloading
);
res
.
data
.
competitor
=
data
.
competitor
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorproducts'
,
JSON
.
stringify
(
res
.
data
.
competitorproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorproducts'
,
JSON
.
stringify
(
res
.
data
.
competitorproducts
));
return
res
;
}
...
...
@@ -273,11 +273,11 @@ export default class CompetitorServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
let
competitorproduct
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
competitorproduct
s'
),
'undefined'
)){
competitorproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorproduct
s'
)
as
any
);
if
(
competitorproductsData
&&
competitorproductsData
.
length
&&
competitorproduct
sData
.
length
>
0
){
competitorproduct
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunitycompetitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunitycompetitor
s'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunitycompetitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunitycompetitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -287,12 +287,12 @@ export default class CompetitorServiceBase extends EntityService {
});
}
}
masterData
.
competitorproducts
=
competitorproduct
sData
;
let
opportunitycompetitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunitycompetitor
s'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunitycompetitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunitycompetitor
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
opportunitycompetitors
=
opportunitycompetitor
sData
;
let
competitorproduct
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
competitorproduct
s'
),
'undefined'
)){
competitorproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorproduct
s'
)
as
any
);
if
(
competitorproductsData
&&
competitorproductsData
.
length
&&
competitorproduct
sData
.
length
>
0
){
competitorproduct
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -302,12 +302,12 @@ export default class CompetitorServiceBase extends EntityService {
});
}
}
masterData
.
opportunitycompetitors
=
opportunitycompetitor
sData
;
masterData
.
competitorproducts
=
competitorproduct
sData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/competitors/
${
context
.
competitor
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorproducts'
,
JSON
.
stringify
(
res
.
data
.
competitorproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorproducts'
,
JSON
.
stringify
(
res
.
data
.
competitorproducts
));
return
res
;
}
...
...
app_CRM/src/service/ibiz-list/ibiz-list-service-base.ts
浏览文件 @
205355df
...
...
@@ -62,11 +62,11 @@ export default class IBizListServiceBase extends EntityService {
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
listcontac
tsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
listcontac
ts'
),
'undefined'
)){
listcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontac
ts'
)
as
any
);
if
(
listcontactsData
&&
listcontactsData
.
length
&&
listcontac
tsData
.
length
>
0
){
listcontac
tsData
.
forEach
((
item
:
any
)
=>
{
let
campaignlis
tsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
campaignlis
ts'
),
'undefined'
)){
campaignlistsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaignlis
ts'
)
as
any
);
if
(
campaignlistsData
&&
campaignlistsData
.
length
&&
campaignlis
tsData
.
length
>
0
){
campaignlis
tsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -76,12 +76,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData
.
listcontacts
=
listcontac
tsData
;
let
list
lead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_list
lead
s'
),
'undefined'
)){
list
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listlead
s'
)
as
any
);
if
(
list
leadsData
&&
listleadsData
.
length
&&
listlead
sData
.
length
>
0
){
list
lead
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
campaignlists
=
campaignlis
tsData
;
let
list
contact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_list
contact
s'
),
'undefined'
)){
list
contactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
list
contactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
list
contact
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -91,12 +91,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData
.
list
leads
=
listlead
sData
;
let
campaignlis
tsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
campaignlis
ts'
),
'undefined'
)){
campaignlistsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaignlis
ts'
)
as
any
);
if
(
campaignlistsData
&&
campaignlistsData
.
length
&&
campaignlis
tsData
.
length
>
0
){
campaignlis
tsData
.
forEach
((
item
:
any
)
=>
{
masterData
.
list
contacts
=
listcontact
sData
;
let
listaccoun
tsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
listaccoun
ts'
),
'undefined'
)){
listaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccoun
ts'
)
as
any
);
if
(
listaccountsData
&&
listaccountsData
.
length
&&
listaccoun
tsData
.
length
>
0
){
listaccoun
tsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -106,12 +106,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData
.
campaignlists
=
campaignlis
tsData
;
let
list
account
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_list
account
s'
),
'undefined'
)){
list
accountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccount
s'
)
as
any
);
if
(
list
accountsData
&&
listaccountsData
.
length
&&
listaccount
sData
.
length
>
0
){
list
account
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
listaccounts
=
listaccoun
tsData
;
let
list
lead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_list
lead
s'
),
'undefined'
)){
list
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listlead
s'
)
as
any
);
if
(
list
leadsData
&&
listleadsData
.
length
&&
listlead
sData
.
length
>
0
){
list
lead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -121,7 +121,7 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData
.
list
accounts
=
listaccount
sData
;
masterData
.
list
leads
=
listlead
sData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
...
...
@@ -131,10 +131,10 @@ export default class IBizListServiceBase extends EntityService {
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/ibizlists`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
...
...
@@ -149,11 +149,11 @@ export default class IBizListServiceBase extends EntityService {
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
listcontac
tsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
listcontac
ts'
),
'undefined'
)){
listcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontac
ts'
)
as
any
);
if
(
listcontactsData
&&
listcontactsData
.
length
&&
listcontac
tsData
.
length
>
0
){
listcontac
tsData
.
forEach
((
item
:
any
)
=>
{
let
campaignlis
tsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
campaignlis
ts'
),
'undefined'
)){
campaignlistsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaignlis
ts'
)
as
any
);
if
(
campaignlistsData
&&
campaignlistsData
.
length
&&
campaignlis
tsData
.
length
>
0
){
campaignlis
tsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -163,12 +163,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData
.
listcontacts
=
listcontac
tsData
;
let
list
lead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_list
lead
s'
),
'undefined'
)){
list
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listlead
s'
)
as
any
);
if
(
list
leadsData
&&
listleadsData
.
length
&&
listlead
sData
.
length
>
0
){
list
lead
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
campaignlists
=
campaignlis
tsData
;
let
list
contact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_list
contact
s'
),
'undefined'
)){
list
contactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
list
contactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
list
contact
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -178,12 +178,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData
.
list
leads
=
listlead
sData
;
let
campaignlis
tsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
campaignlis
ts'
),
'undefined'
)){
campaignlistsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaignlis
ts'
)
as
any
);
if
(
campaignlistsData
&&
campaignlistsData
.
length
&&
campaignlis
tsData
.
length
>
0
){
campaignlis
tsData
.
forEach
((
item
:
any
)
=>
{
masterData
.
list
contacts
=
listcontact
sData
;
let
listaccoun
tsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
listaccoun
ts'
),
'undefined'
)){
listaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccoun
ts'
)
as
any
);
if
(
listaccountsData
&&
listaccountsData
.
length
&&
listaccoun
tsData
.
length
>
0
){
listaccoun
tsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -193,12 +193,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData
.
campaignlists
=
campaignlis
tsData
;
let
list
account
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_list
account
s'
),
'undefined'
)){
list
accountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccount
s'
)
as
any
);
if
(
list
accountsData
&&
listaccountsData
.
length
&&
listaccount
sData
.
length
>
0
){
list
account
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
listaccounts
=
listaccoun
tsData
;
let
list
lead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_list
lead
s'
),
'undefined'
)){
list
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listlead
s'
)
as
any
);
if
(
list
leadsData
&&
listleadsData
.
length
&&
listlead
sData
.
length
>
0
){
list
lead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -208,13 +208,13 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData
.
list
accounts
=
listaccount
sData
;
masterData
.
list
leads
=
listlead
sData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/ibizlists/
${
context
.
ibizlist
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
...
...
@@ -242,10 +242,10 @@ export default class IBizListServiceBase extends EntityService {
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/ibizlists/
${
context
.
ibizlist
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
...
...
@@ -261,10 +261,10 @@ export default class IBizListServiceBase extends EntityService {
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/ibizlists/getdraft`
,
isloading
);
res
.
data
.
ibizlist
=
data
.
ibizlist
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
...
...
@@ -292,11 +292,11 @@ export default class IBizListServiceBase extends EntityService {
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
listcontac
tsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
listcontac
ts'
),
'undefined'
)){
listcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontac
ts'
)
as
any
);
if
(
listcontactsData
&&
listcontactsData
.
length
&&
listcontac
tsData
.
length
>
0
){
listcontac
tsData
.
forEach
((
item
:
any
)
=>
{
let
campaignlis
tsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
campaignlis
ts'
),
'undefined'
)){
campaignlistsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaignlis
ts'
)
as
any
);
if
(
campaignlistsData
&&
campaignlistsData
.
length
&&
campaignlis
tsData
.
length
>
0
){
campaignlis
tsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -306,12 +306,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData
.
listcontacts
=
listcontac
tsData
;
let
list
lead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_list
lead
s'
),
'undefined'
)){
list
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listlead
s'
)
as
any
);
if
(
list
leadsData
&&
listleadsData
.
length
&&
listlead
sData
.
length
>
0
){
list
lead
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
campaignlists
=
campaignlis
tsData
;
let
list
contact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_list
contact
s'
),
'undefined'
)){
list
contactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
list
contactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
list
contact
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -321,12 +321,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData
.
list
leads
=
listlead
sData
;
let
campaignlis
tsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
campaignlis
ts'
),
'undefined'
)){
campaignlistsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaignlis
ts'
)
as
any
);
if
(
campaignlistsData
&&
campaignlistsData
.
length
&&
campaignlis
tsData
.
length
>
0
){
campaignlis
tsData
.
forEach
((
item
:
any
)
=>
{
masterData
.
list
contacts
=
listcontact
sData
;
let
listaccoun
tsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
listaccoun
ts'
),
'undefined'
)){
listaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccoun
ts'
)
as
any
);
if
(
listaccountsData
&&
listaccountsData
.
length
&&
listaccoun
tsData
.
length
>
0
){
listaccoun
tsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -336,12 +336,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData
.
campaignlists
=
campaignlis
tsData
;
let
list
account
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_list
account
s'
),
'undefined'
)){
list
accountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccount
s'
)
as
any
);
if
(
list
accountsData
&&
listaccountsData
.
length
&&
listaccount
sData
.
length
>
0
){
list
account
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
listaccounts
=
listaccoun
tsData
;
let
list
lead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_list
lead
s'
),
'undefined'
)){
list
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listlead
s'
)
as
any
);
if
(
list
leadsData
&&
listleadsData
.
length
&&
listlead
sData
.
length
>
0
){
list
lead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -351,13 +351,13 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData
.
list
accounts
=
listaccount
sData
;
masterData
.
list
leads
=
listlead
sData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/ibizlists/
${
context
.
ibizlist
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
...
...
app_CRM/src/service/lead/lead-service-base.ts
浏览文件 @
205355df
...
...
@@ -79,11 +79,11 @@ export default class LeadServiceBase extends EntityService {
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
true
){
let
masterData
:
any
=
{};
let
l
eadcompetitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
eadcompetitor
s'
),
'undefined'
)){
l
eadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitor
s'
)
as
any
);
if
(
l
eadcompetitorsData
&&
leadcompetitorsData
.
length
&&
leadcompetitor
sData
.
length
>
0
){
l
eadcompetitor
sData
.
forEach
((
item
:
any
)
=>
{
let
l
istlead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istlead
s'
),
'undefined'
)){
l
istleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listlead
s'
)
as
any
);
if
(
l
istleadsData
&&
listleadsData
.
length
&&
listlead
sData
.
length
>
0
){
l
istlead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -93,12 +93,12 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData
.
l
eadcompetitors
=
leadcompetitor
sData
;
let
l
istlead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istlead
s'
),
'undefined'
)){
l
istleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listlead
s'
)
as
any
);
if
(
l
istleadsData
&&
listleadsData
.
length
&&
listlead
sData
.
length
>
0
){
l
istlead
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
l
istleads
=
listlead
sData
;
let
l
eadcompetitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
eadcompetitor
s'
),
'undefined'
)){
l
eadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitor
s'
)
as
any
);
if
(
l
eadcompetitorsData
&&
leadcompetitorsData
.
length
&&
leadcompetitor
sData
.
length
>
0
){
l
eadcompetitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -108,7 +108,7 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData
.
l
istleads
=
listlead
sData
;
masterData
.
l
eadcompetitors
=
leadcompetitor
sData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
...
...
@@ -118,17 +118,17 @@ export default class LeadServiceBase extends EntityService {
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/leads`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
contact
&&
true
){
let
masterData
:
any
=
{};
let
l
eadcompetitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
eadcompetitor
s'
),
'undefined'
)){
l
eadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitor
s'
)
as
any
);
if
(
l
eadcompetitorsData
&&
leadcompetitorsData
.
length
&&
leadcompetitor
sData
.
length
>
0
){
l
eadcompetitor
sData
.
forEach
((
item
:
any
)
=>
{
let
l
istlead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istlead
s'
),
'undefined'
)){
l
istleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listlead
s'
)
as
any
);
if
(
l
istleadsData
&&
listleadsData
.
length
&&
listlead
sData
.
length
>
0
){
l
istlead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -138,12 +138,12 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData
.
l
eadcompetitors
=
leadcompetitor
sData
;
let
l
istlead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istlead
s'
),
'undefined'
)){
l
istleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listlead
s'
)
as
any
);
if
(
l
istleadsData
&&
listleadsData
.
length
&&
listlead
sData
.
length
>
0
){
l
istlead
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
l
istleads
=
listlead
sData
;
let
l
eadcompetitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
eadcompetitor
s'
),
'undefined'
)){
l
eadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitor
s'
)
as
any
);
if
(
l
eadcompetitorsData
&&
leadcompetitorsData
.
length
&&
leadcompetitor
sData
.
length
>
0
){
l
eadcompetitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -153,7 +153,7 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData
.
l
istleads
=
listlead
sData
;
masterData
.
l
eadcompetitors
=
leadcompetitor
sData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
...
...
@@ -163,17 +163,17 @@ export default class LeadServiceBase extends EntityService {
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/leads`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
campaign
&&
true
){
let
masterData
:
any
=
{};
let
l
eadcompetitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
eadcompetitor
s'
),
'undefined'
)){
l
eadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitor
s'
)
as
any
);
if
(
l
eadcompetitorsData
&&
leadcompetitorsData
.
length
&&
leadcompetitor
sData
.
length
>
0
){
l
eadcompetitor
sData
.
forEach
((
item
:
any
)
=>
{
let
l
istlead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istlead
s'
),
'undefined'
)){
l
istleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listlead
s'
)
as
any
);
if
(
l
istleadsData
&&
listleadsData
.
length
&&
listlead
sData
.
length
>
0
){
l
istlead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -183,12 +183,12 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData
.
l
eadcompetitors
=
leadcompetitor
sData
;
let
l
istlead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istlead
s'
),
'undefined'
)){
l
istleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listlead
s'
)
as
any
);
if
(
l
istleadsData
&&
listleadsData
.
length
&&
listlead
sData
.
length
>
0
){
l
istlead
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
l
istleads
=
listlead
sData
;
let
l
eadcompetitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
eadcompetitor
s'
),
'undefined'
)){
l
eadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitor
s'
)
as
any
);
if
(
l
eadcompetitorsData
&&
leadcompetitorsData
.
length
&&
leadcompetitor
sData
.
length
>
0
){
l
eadcompetitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -198,7 +198,7 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData
.
l
istleads
=
listlead
sData
;
masterData
.
l
eadcompetitors
=
leadcompetitor
sData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
...
...
@@ -208,17 +208,17 @@ export default class LeadServiceBase extends EntityService {
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/campaigns/
${
context
.
campaign
}
/leads`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
account
&&
true
){
let
masterData
:
any
=
{};
let
l
eadcompetitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
eadcompetitor
s'
),
'undefined'
)){
l
eadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitor
s'
)
as
any
);
if
(
l
eadcompetitorsData
&&
leadcompetitorsData
.
length
&&
leadcompetitor
sData
.
length
>
0
){
l
eadcompetitor
sData
.
forEach
((
item
:
any
)
=>
{
let
l
istlead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istlead
s'
),
'undefined'
)){
l
istleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listlead
s'
)
as
any
);
if
(
l
istleadsData
&&
listleadsData
.
length
&&
listlead
sData
.
length
>
0
){
l
istlead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -228,12 +228,12 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData
.
l
eadcompetitors
=
leadcompetitor
sData
;
let
l
istlead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istlead
s'
),
'undefined'
)){
l
istleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listlead
s'
)
as
any
);
if
(
l
istleadsData
&&
listleadsData
.
length
&&
listlead
sData
.
length
>
0
){
l
istlead
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
l
istleads
=
listlead
sData
;
let
l
eadcompetitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
eadcompetitor
s'
),
'undefined'
)){
l
eadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitor
s'
)
as
any
);
if
(
l
eadcompetitorsData
&&
leadcompetitorsData
.
length
&&
leadcompetitor
sData
.
length
>
0
){
l
eadcompetitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -243,7 +243,7 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData
.
l
istleads
=
listlead
sData
;
masterData
.
l
eadcompetitors
=
leadcompetitor
sData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
...
...
@@ -253,16 +253,16 @@ export default class LeadServiceBase extends EntityService {
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/leads`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
let
masterData
:
any
=
{};
let
l
eadcompetitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
eadcompetitor
s'
),
'undefined'
)){
l
eadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitor
s'
)
as
any
);
if
(
l
eadcompetitorsData
&&
leadcompetitorsData
.
length
&&
leadcompetitor
sData
.
length
>
0
){
l
eadcompetitor
sData
.
forEach
((
item
:
any
)
=>
{
let
l
istlead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istlead
s'
),
'undefined'
)){
l
istleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listlead
s'
)
as
any
);
if
(
l
istleadsData
&&
listleadsData
.
length
&&
listlead
sData
.
length
>
0
){
l
istlead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -272,12 +272,12 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData
.
l
eadcompetitors
=
leadcompetitor
sData
;
let
l
istlead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istlead
s'
),
'undefined'
)){
l
istleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listlead
s'
)
as
any
);
if
(
l
istleadsData
&&
listleadsData
.
length
&&
listlead
sData
.
length
>
0
){
l
istlead
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
l
istleads
=
listlead
sData
;
let
l
eadcompetitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
eadcompetitor
s'
),
'undefined'
)){
l
eadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitor
s'
)
as
any
);
if
(
l
eadcompetitorsData
&&
leadcompetitorsData
.
length
&&
leadcompetitor
sData
.
length
>
0
){
l
eadcompetitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -287,7 +287,7 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData
.
l
istleads
=
listlead
sData
;
masterData
.
l
eadcompetitors
=
leadcompetitor
sData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
...
...
@@ -297,8 +297,8 @@ export default class LeadServiceBase extends EntityService {
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/leads`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
...
...
@@ -314,21 +314,6 @@ export default class LeadServiceBase extends EntityService {
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
if
(
leadcompetitorsData
&&
leadcompetitorsData
.
length
&&
leadcompetitorsData
.
length
>
0
){
leadcompetitorsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -344,14 +329,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
if
(
context
.
contact
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
...
...
@@ -367,6 +344,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
contact
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -382,14 +367,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
if
(
context
.
campaign
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
...
...
@@ -405,6 +382,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
campaign
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -420,14 +405,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/campaigns/
${
context
.
campaign
}
/leads/
${
context
.
lead
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
if
(
context
.
account
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
...
...
@@ -443,6 +420,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/campaigns/
${
context
.
campaign
}
/leads/
${
context
.
lead
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
account
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -458,13 +443,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/leads/
${
context
.
lead
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
...
...
@@ -480,6 +458,13 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/leads/
${
context
.
lead
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
let
masterData
:
any
=
{};
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -495,10 +480,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
if
(
leadcompetitorsData
&&
leadcompetitorsData
.
length
&&
leadcompetitorsData
.
length
>
0
){
leadcompetitorsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/leads/
${
context
.
lead
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
...
...
@@ -539,31 +539,31 @@ export default class LeadServiceBase extends EntityService {
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
lead
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
contact
&&
context
.
lead
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
campaign
&&
context
.
lead
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/campaigns/
${
context
.
campaign
}
/leads/
${
context
.
lead
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
account
&&
context
.
lead
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/leads/
${
context
.
lead
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/leads/
${
context
.
lead
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
...
...
@@ -580,35 +580,35 @@ export default class LeadServiceBase extends EntityService {
if
(
context
.
account
&&
context
.
contact
&&
true
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/leads/getdraft`
,
isloading
);
res
.
data
.
lead
=
data
.
lead
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
contact
&&
true
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/
${
context
.
contact
}
/leads/getdraft`
,
isloading
);
res
.
data
.
lead
=
data
.
lead
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
campaign
&&
true
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/campaigns/
${
context
.
campaign
}
/leads/getdraft`
,
isloading
);
res
.
data
.
lead
=
data
.
lead
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
account
&&
true
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/leads/getdraft`
,
isloading
);
res
.
data
.
lead
=
data
.
lead
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/leads/getdraft`
,
isloading
);
res
.
data
.
lead
=
data
.
lead
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
...
...
@@ -624,21 +624,6 @@ export default class LeadServiceBase extends EntityService {
public
async
Active
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
if
(
leadcompetitorsData
&&
leadcompetitorsData
.
length
&&
leadcompetitorsData
.
length
>
0
){
leadcompetitorsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -654,14 +639,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
/active`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
if
(
context
.
contact
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
...
...
@@ -677,6 +654,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
/active`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
contact
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -692,14 +677,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
/active`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
if
(
context
.
campaign
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
...
...
@@ -715,6 +692,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
/active`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
campaign
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -730,14 +715,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/campaigns/
${
context
.
campaign
}
/leads/
${
context
.
lead
}
/active`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
if
(
context
.
account
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
...
...
@@ -753,6 +730,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/campaigns/
${
context
.
campaign
}
/leads/
${
context
.
lead
}
/active`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
account
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -768,10 +753,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
if
(
leadcompetitorsData
&&
leadcompetitorsData
.
length
&&
leadcompetitorsData
.
length
>
0
){
leadcompetitorsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/leads/
${
context
.
lead
}
/active`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
return
Http
.
getInstance
().
post
(
`/leads/
${
context
.
lead
}
/active`
,
data
,
isloading
);
...
...
@@ -789,21 +789,6 @@ export default class LeadServiceBase extends EntityService {
public
async
AddList
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
if
(
leadcompetitorsData
&&
leadcompetitorsData
.
length
&&
leadcompetitorsData
.
length
>
0
){
leadcompetitorsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -819,14 +804,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
/addlist`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
if
(
context
.
contact
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
...
...
@@ -842,6 +819,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
/addlist`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
contact
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -857,14 +842,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
/addlist`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
if
(
context
.
campaign
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
...
...
@@ -880,6 +857,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
/addlist`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
campaign
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -895,14 +880,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/campaigns/
${
context
.
campaign
}
/leads/
${
context
.
lead
}
/addlist`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
if
(
context
.
account
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
...
...
@@ -918,6 +895,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/campaigns/
${
context
.
campaign
}
/leads/
${
context
.
lead
}
/addlist`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
account
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -933,10 +918,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
if
(
leadcompetitorsData
&&
leadcompetitorsData
.
length
&&
leadcompetitorsData
.
length
>
0
){
leadcompetitorsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/leads/
${
context
.
lead
}
/addlist`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
return
Http
.
getInstance
().
post
(
`/leads/
${
context
.
lead
}
/addlist`
,
data
,
isloading
);
...
...
@@ -969,21 +969,6 @@ export default class LeadServiceBase extends EntityService {
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
if
(
leadcompetitorsData
&&
leadcompetitorsData
.
length
&&
leadcompetitorsData
.
length
>
0
){
leadcompetitorsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -999,14 +984,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
if
(
context
.
contact
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
...
...
@@ -1022,6 +999,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
contact
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -1037,14 +1022,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
if
(
context
.
campaign
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
...
...
@@ -1060,6 +1037,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
campaign
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -1075,14 +1060,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/campaigns/
${
context
.
campaign
}
/leads/
${
context
.
lead
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
if
(
context
.
account
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
...
...
@@ -1098,6 +1075,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/campaigns/
${
context
.
campaign
}
/leads/
${
context
.
lead
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
account
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -1113,10 +1098,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
if
(
leadcompetitorsData
&&
leadcompetitorsData
.
length
&&
leadcompetitorsData
.
length
>
0
){
leadcompetitorsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/leads/
${
context
.
lead
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
return
Http
.
getInstance
().
post
(
`/leads/
${
context
.
lead
}
/checkkey`
,
data
,
isloading
);
...
...
@@ -1134,21 +1134,6 @@ export default class LeadServiceBase extends EntityService {
public
async
DisQualification
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
if
(
leadcompetitorsData
&&
leadcompetitorsData
.
length
&&
leadcompetitorsData
.
length
>
0
){
leadcompetitorsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -1164,14 +1149,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
/disqualification`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
if
(
context
.
contact
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
...
...
@@ -1187,6 +1164,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
/disqualification`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
contact
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -1202,14 +1187,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
/disqualification`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
if
(
context
.
campaign
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
...
...
@@ -1225,6 +1202,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
/disqualification`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
campaign
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -1240,14 +1225,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/campaigns/
${
context
.
campaign
}
/leads/
${
context
.
lead
}
/disqualification`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
if
(
context
.
account
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
...
...
@@ -1263,6 +1240,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/campaigns/
${
context
.
campaign
}
/leads/
${
context
.
lead
}
/disqualification`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
account
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -1278,10 +1263,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
if
(
leadcompetitorsData
&&
leadcompetitorsData
.
length
&&
leadcompetitorsData
.
length
>
0
){
leadcompetitorsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/leads/
${
context
.
lead
}
/disqualification`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
return
Http
.
getInstance
().
post
(
`/leads/
${
context
.
lead
}
/disqualification`
,
data
,
isloading
);
...
...
@@ -1329,21 +1329,6 @@ export default class LeadServiceBase extends EntityService {
public
async
Qualification
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
if
(
leadcompetitorsData
&&
leadcompetitorsData
.
length
&&
leadcompetitorsData
.
length
>
0
){
leadcompetitorsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -1359,14 +1344,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
/qualification`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
if
(
context
.
contact
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
...
...
@@ -1382,6 +1359,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
/qualification`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
contact
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -1397,14 +1382,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
/qualification`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
if
(
context
.
campaign
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
...
...
@@ -1420,6 +1397,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
/qualification`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
campaign
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -1435,14 +1420,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/campaigns/
${
context
.
campaign
}
/leads/
${
context
.
lead
}
/qualification`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
if
(
context
.
account
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
...
...
@@ -1458,6 +1435,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/campaigns/
${
context
.
campaign
}
/leads/
${
context
.
lead
}
/qualification`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
account
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -1473,10 +1458,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
if
(
leadcompetitorsData
&&
leadcompetitorsData
.
length
&&
leadcompetitorsData
.
length
>
0
){
leadcompetitorsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/leads/
${
context
.
lead
}
/qualification`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
return
Http
.
getInstance
().
post
(
`/leads/
${
context
.
lead
}
/qualification`
,
data
,
isloading
);
...
...
@@ -1494,21 +1494,6 @@ export default class LeadServiceBase extends EntityService {
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
if
(
leadcompetitorsData
&&
leadcompetitorsData
.
length
&&
leadcompetitorsData
.
length
>
0
){
leadcompetitorsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -1524,14 +1509,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
if
(
context
.
contact
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
...
...
@@ -1547,6 +1524,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
contact
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -1562,14 +1547,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
if
(
context
.
campaign
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
...
...
@@ -1585,6 +1562,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/leads/
${
context
.
lead
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
campaign
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -1600,14 +1585,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/campaigns/
${
context
.
campaign
}
/leads/
${
context
.
lead
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
if
(
context
.
account
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
...
...
@@ -1623,6 +1600,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/campaigns/
${
context
.
campaign
}
/leads/
${
context
.
lead
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
if
(
context
.
account
&&
context
.
lead
){
let
masterData
:
any
=
{};
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -1638,13 +1623,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/leads/
${
context
.
lead
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
return
res
;
}
let
masterData
:
any
=
{};
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
...
...
@@ -1660,6 +1638,13 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/leads/
${
context
.
lead
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
let
masterData
:
any
=
{};
let
listleadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
),
'undefined'
)){
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listleads'
)
as
any
);
...
...
@@ -1675,10 +1660,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData
.
listleads
=
listleadsData
;
let
leadcompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
)
as
any
);
if
(
leadcompetitorsData
&&
leadcompetitorsData
.
length
&&
leadcompetitorsData
.
length
>
0
){
leadcompetitorsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leadcompetitors
=
leadcompetitorsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/leads/
${
context
.
lead
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
return
res
;
}
...
...
app_CRM/src/service/opportunity/opportunity-service-base.ts
浏览文件 @
205355df
...
...
@@ -74,6 +74,21 @@ export default class OpportunityServiceBase extends EntityService {
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
true
){
let
masterData
:
any
=
{};
let
opportunityproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproductsData
.
length
>
0
){
opportunityproductsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproductid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunityproducts
=
opportunityproductsData
;
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
...
@@ -104,21 +119,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
let
opportunityproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproductsData
.
length
>
0
){
opportunityproductsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproductid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunityproducts
=
opportunityproductsData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
...
...
@@ -128,13 +128,28 @@ export default class OpportunityServiceBase extends EntityService {
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
if
(
context
.
contact
&&
true
){
let
masterData
:
any
=
{};
let
opportunityproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproductsData
.
length
>
0
){
opportunityproductsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproductid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunityproducts
=
opportunityproductsData
;
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
...
@@ -165,21 +180,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
let
opportunityproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproductsData
.
length
>
0
){
opportunityproductsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproductid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunityproducts
=
opportunityproductsData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
...
...
@@ -189,13 +189,28 @@ export default class OpportunityServiceBase extends EntityService {
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
if
(
context
.
account
&&
true
){
let
masterData
:
any
=
{};
let
opportunityproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproductsData
.
length
>
0
){
opportunityproductsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproductid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunityproducts
=
opportunityproductsData
;
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
...
@@ -226,6 +241,21 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
}
let
masterData
:
any
=
{};
let
opportunityproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
)
as
any
);
...
...
@@ -241,21 +271,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
opportunityproducts
=
opportunityproductsData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
let
masterData
:
any
=
{};
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
...
@@ -286,21 +301,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
let
opportunityproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproductsData
.
length
>
0
){
opportunityproductsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproductid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunityproducts
=
opportunityproductsData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
...
...
@@ -310,9 +310,9 @@ export default class OpportunityServiceBase extends EntityService {
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/opportunities`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
...
...
@@ -328,6 +328,21 @@ export default class OpportunityServiceBase extends EntityService {
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunityproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproductsData
.
length
>
0
){
opportunityproductsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproductid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunityproducts
=
opportunityproductsData
;
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
...
@@ -358,6 +373,15 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunityproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
)
as
any
);
...
...
@@ -373,15 +397,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
opportunityproducts
=
opportunityproductsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
...
@@ -412,6 +427,15 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunityproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
)
as
any
);
...
...
@@ -427,15 +451,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
opportunityproducts
=
opportunityproductsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
...
@@ -466,6 +481,14 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
}
let
masterData
:
any
=
{};
let
opportunityproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
)
as
any
);
...
...
@@ -481,14 +504,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
opportunityproducts
=
opportunityproductsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
let
masterData
:
any
=
{};
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
...
@@ -519,26 +534,11 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
let
opportunityproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproductsData
.
length
>
0
){
opportunityproductsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproductid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunityproducts
=
opportunityproductsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/opportunities/
${
context
.
opportunity
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
...
...
@@ -576,29 +576,29 @@ export default class OpportunityServiceBase extends EntityService {
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/opportunities/
${
context
.
opportunity
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
...
...
@@ -615,32 +615,32 @@ export default class OpportunityServiceBase extends EntityService {
if
(
context
.
account
&&
context
.
contact
&&
true
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/getdraft`
,
isloading
);
res
.
data
.
opportunity
=
data
.
opportunity
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
if
(
context
.
contact
&&
true
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/
${
context
.
contact
}
/opportunities/getdraft`
,
isloading
);
res
.
data
.
opportunity
=
data
.
opportunity
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
if
(
context
.
account
&&
true
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/opportunities/getdraft`
,
isloading
);
res
.
data
.
opportunity
=
data
.
opportunity
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/opportunities/getdraft`
,
isloading
);
res
.
data
.
opportunity
=
data
.
opportunity
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
...
...
@@ -656,6 +656,21 @@ export default class OpportunityServiceBase extends EntityService {
public
async
Active
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunityproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproductsData
.
length
>
0
){
opportunityproductsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproductid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunityproducts
=
opportunityproductsData
;
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
...
@@ -686,6 +701,15 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/active`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunityproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
)
as
any
);
...
...
@@ -701,15 +725,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
opportunityproducts
=
opportunityproductsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/active`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
...
@@ -740,6 +755,15 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/active`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunityproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
)
as
any
);
...
...
@@ -755,15 +779,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
opportunityproducts
=
opportunityproductsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/active`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
...
@@ -794,26 +809,11 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
let
opportunityproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproductsData
.
length
>
0
){
opportunityproductsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproductid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunityproducts
=
opportunityproductsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/active`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
return
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/active`
,
data
,
isloading
);
...
...
@@ -831,6 +831,21 @@ export default class OpportunityServiceBase extends EntityService {
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunityproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproductsData
.
length
>
0
){
opportunityproductsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproductid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunityproducts
=
opportunityproductsData
;
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
...
@@ -861,6 +876,15 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunityproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
)
as
any
);
...
...
@@ -876,15 +900,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
opportunityproducts
=
opportunityproductsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
...
@@ -915,6 +930,15 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunityproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
)
as
any
);
...
...
@@ -930,15 +954,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
opportunityproducts
=
opportunityproductsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
...
@@ -969,26 +984,11 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
let
opportunityproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproductsData
.
length
>
0
){
opportunityproductsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproductid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunityproducts
=
opportunityproductsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
return
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/checkkey`
,
data
,
isloading
);
...
...
@@ -1021,6 +1021,21 @@ export default class OpportunityServiceBase extends EntityService {
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunityproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproductsData
.
length
>
0
){
opportunityproductsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproductid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunityproducts
=
opportunityproductsData
;
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
...
@@ -1051,6 +1066,15 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunityproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
)
as
any
);
...
...
@@ -1066,15 +1090,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
opportunityproducts
=
opportunityproductsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
...
@@ -1105,6 +1120,15 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunityproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
)
as
any
);
...
...
@@ -1120,15 +1144,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
opportunityproducts
=
opportunityproductsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
...
@@ -1159,6 +1174,14 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
}
let
masterData
:
any
=
{};
let
opportunityproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
)
as
any
);
...
...
@@ -1174,14 +1197,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
opportunityproducts
=
opportunityproductsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
let
masterData
:
any
=
{};
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
...
@@ -1212,26 +1227,11 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
let
opportunityproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproductsData
.
length
>
0
){
opportunityproductsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproductid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunityproducts
=
opportunityproductsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
...
...
businesscentral-app/businesscentral-app-crm/src/main/docker/Dockerfile
浏览文件 @
205355df
...
...
@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /businesscentral-app-crm.jar
EXPOSE
808
0
EXPOSE
1032
0
ADD
businesscentral-app-crm.jar /businesscentral-app-crm.jar
businesscentral-app/businesscentral-app-crm/src/main/docker/businesscentral-app-crm.yaml
浏览文件 @
205355df
...
...
@@ -3,9 +3,23 @@ services:
businesscentral-app-crm
:
image
:
registry.cn-shanghai.aliyuncs.com/ibizsys/businesscentral-app-crm:latest
ports
:
-
"
8080:808
0"
-
"
10320:1032
0"
networks
:
-
agent_network
environment
:
-
SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.240.110
-
SERVER_PORT=10320
-
SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.240.110:8848
-
SPRING_REDIS_HOST=172.16.240.110
-
SPRING_REDIS_PORT=6379
-
SPRING_REDIS_DATABASE=0
-
SPRING_DATASOURCE_USERNAME=a_LAB01_e85d8801c
-
SPRING_DATASOURCE_PASSWORD=b1@@@772
-
SPRING_DATASOURCE_URL=jdbc:mysql://172.16.186.185:3306/a_LAB01_e85d8801c?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true
-
SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
-
SPRING_DATASOURCE_DEFAULTSCHEMA=a_LAB01_e85d8801c
-
CAS=https://passport.ibizlab.cn
-
NACOS=172.16.240.110:8848
deploy
:
resources
:
limits
:
...
...
businesscentral-app/businesscentral-app-website/src/main/docker/Dockerfile
浏览文件 @
205355df
...
...
@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /businesscentral-app-website.jar
EXPOSE
808
0
EXPOSE
1032
0
ADD
businesscentral-app-website.jar /businesscentral-app-website.jar
businesscentral-app/businesscentral-app-website/src/main/docker/businesscentral-app-website.yaml
浏览文件 @
205355df
...
...
@@ -3,9 +3,23 @@ services:
businesscentral-app-website
:
image
:
registry.cn-shanghai.aliyuncs.com/ibizsys/businesscentral-app-website:latest
ports
:
-
"
8080:808
0"
-
"
10320:1032
0"
networks
:
-
agent_network
environment
:
-
SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.240.110
-
SERVER_PORT=10320
-
SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.240.110:8848
-
SPRING_REDIS_HOST=172.16.240.110
-
SPRING_REDIS_PORT=6379
-
SPRING_REDIS_DATABASE=0
-
SPRING_DATASOURCE_USERNAME=a_LAB01_e85d8801c
-
SPRING_DATASOURCE_PASSWORD=b1@@@772
-
SPRING_DATASOURCE_URL=jdbc:mysql://172.16.186.185:3306/a_LAB01_e85d8801c?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true
-
SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
-
SPRING_DATASOURCE_DEFAULTSCHEMA=a_LAB01_e85d8801c
-
CAS=https://passport.ibizlab.cn
-
NACOS=172.16.240.110:8848
deploy
:
resources
:
limits
:
...
...
config.xml
浏览文件 @
205355df
...
...
@@ -37,6 +37,11 @@
git clone -b master $para2 ibizbusinesscentral/
export NODE_OPTIONS=--max-old-space-size=4096
cd ibizbusinesscentral/
mvn clean package -Pcrm
cd businesscentral-app/businesscentral-app-crm
mvn -Pcrm docker:build
mvn -Pcrm docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/businesscentral-app-crm.yaml iBizEE --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录