提交 ea2c0df4 编写于 作者: ibizdev's avatar ibizdev

lab_gzf 部署微服务应用

上级 c0202ad9
......@@ -65,21 +65,6 @@ export default class AccountServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunities = opportunitiesData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -125,6 +110,21 @@ export default class AccountServiceBase extends EntityService {
}
}
masterData.contacts = contactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunities = opportunitiesData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -134,10 +134,10 @@ export default class AccountServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts ? res.data.listaccounts : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts ? res.data.contacts : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
return res;
}
......@@ -152,21 +152,6 @@ export default class AccountServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunities = opportunitiesData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -212,12 +197,27 @@ export default class AccountServiceBase extends EntityService {
}
}
masterData.contacts = contactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunities = opportunitiesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts ? res.data.listaccounts : []));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts ? res.data.contacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
return res;
}
......@@ -245,10 +245,10 @@ export default class AccountServiceBase extends EntityService {
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/accounts/${context.account}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts ? res.data.listaccounts : []));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts ? res.data.contacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
return res;
}
......@@ -264,10 +264,10 @@ export default class AccountServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/accounts/getdraft`,isloading);
res.data.account = data.account;
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts ? res.data.listaccounts : []));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts ? res.data.contacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
return res;
}
......@@ -338,21 +338,6 @@ export default class AccountServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunities = opportunitiesData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -398,12 +383,27 @@ export default class AccountServiceBase extends EntityService {
}
}
masterData.contacts = contactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunities = opportunitiesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts ? res.data.listaccounts : []));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts ? res.data.contacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
return res;
}
......
......@@ -62,21 +62,6 @@ export default class CompetitorServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let competitorproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts'),'undefined')){
competitorproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts') as any);
if(competitorproductsData && competitorproductsData.length && competitorproductsData.length > 0){
competitorproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.competitorproducts = competitorproductsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -107,6 +92,21 @@ export default class CompetitorServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
let competitorproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts'),'undefined')){
competitorproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts') as any);
if(competitorproductsData && competitorproductsData.length && competitorproductsData.length > 0){
competitorproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.competitorproducts = competitorproductsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -116,9 +116,9 @@ 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+'_competitorproducts',JSON.stringify(res.data.competitorproducts ? res.data.competitorproducts : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts ? res.data.competitorproducts : []));
return res;
}
......@@ -133,21 +133,6 @@ export default class CompetitorServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let competitorproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts'),'undefined')){
competitorproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts') as any);
if(competitorproductsData && competitorproductsData.length && competitorproductsData.length > 0){
competitorproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.competitorproducts = competitorproductsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -178,11 +163,26 @@ export default class CompetitorServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
let competitorproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts'),'undefined')){
competitorproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts') as any);
if(competitorproductsData && competitorproductsData.length && competitorproductsData.length > 0){
competitorproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.competitorproducts = competitorproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/competitors/${context.competitor}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts ? res.data.competitorproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts ? res.data.competitorproducts : []));
return res;
}
......@@ -210,9 +210,9 @@ 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+'_competitorproducts',JSON.stringify(res.data.competitorproducts ? res.data.competitorproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts ? res.data.competitorproducts : []));
return res;
}
......@@ -228,9 +228,9 @@ export default class CompetitorServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/competitors/getdraft`,isloading);
res.data.competitor = data.competitor;
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts ? res.data.competitorproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts ? res.data.competitorproducts : []));
return res;
}
......@@ -258,21 +258,6 @@ export default class CompetitorServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let competitorproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts'),'undefined')){
competitorproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts') as any);
if(competitorproductsData && competitorproductsData.length && competitorproductsData.length > 0){
competitorproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.competitorproducts = competitorproductsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -303,11 +288,26 @@ export default class CompetitorServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
let competitorproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts'),'undefined')){
competitorproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts') as any);
if(competitorproductsData && competitorproductsData.length && competitorproductsData.length > 0){
competitorproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.competitorproducts = competitorproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/competitors/${context.competitor}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts ? res.data.competitorproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts ? res.data.competitorproducts : []));
return res;
}
......
......@@ -68,6 +68,21 @@ export default class ContactServiceBase extends EntityService {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && true){
let masterData:any = {};
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -98,6 +113,21 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
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}/contacts`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
return res;
}
let masterData:any = {};
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
......@@ -113,21 +143,6 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.listcontacts = listcontactsData;
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}/contacts`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
return res;
}
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -158,21 +173,6 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -182,9 +182,9 @@ export default class ContactServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/contacts`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
return res;
}
......@@ -200,6 +200,21 @@ export default class ContactServiceBase extends EntityService {
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let masterData:any = {};
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -230,6 +245,14 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
return res;
}
let masterData:any = {};
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
......@@ -245,14 +268,6 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
return res;
}
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -283,26 +298,11 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
return res;
}
......@@ -334,15 +334,15 @@ export default class ContactServiceBase extends EntityService {
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
return res;
}
let res:any = await Http.getInstance().get(`/contacts/${context.contact}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
return res;
}
......@@ -359,16 +359,16 @@ export default class ContactServiceBase extends EntityService {
if(context.account && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/getdraft`,isloading);
res.data.contact = data.contact;
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
return res;
}
let res:any = await Http.getInstance().get(`/contacts/getdraft`,isloading);
res.data.contact = data.contact;
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
return res;
}
......@@ -399,6 +399,21 @@ export default class ContactServiceBase extends EntityService {
public async AddList(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let masterData:any = {};
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -429,26 +444,11 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
return res;
}
return Http.getInstance().post(`/contacts/${context.contact}/addlist`,data,isloading);
......@@ -466,6 +466,21 @@ export default class ContactServiceBase extends EntityService {
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let masterData:any = {};
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -496,26 +511,11 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
return res;
}
return Http.getInstance().post(`/contacts/${context.contact}/checkkey`,data,isloading);
......@@ -548,6 +548,21 @@ export default class ContactServiceBase extends EntityService {
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let masterData:any = {};
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -578,6 +593,14 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
return res;
}
let masterData:any = {};
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
......@@ -593,14 +616,6 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
return res;
}
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -631,26 +646,11 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
return res;
}
......@@ -666,6 +666,21 @@ export default class ContactServiceBase extends EntityService {
public async SetPrimary(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let masterData:any = {};
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -696,26 +711,11 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/setprimary`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
return res;
}
return Http.getInstance().post(`/contacts/${context.contact}/setprimary`,data,isloading);
......
......@@ -64,11 +64,11 @@ export default class IBizListServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -78,12 +78,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listcontacts = listcontactsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
masterData.listaccounts = listaccountsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -93,12 +93,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.campaignlists = campaignlistsData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
masterData.listleads = listleadsData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -108,12 +108,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listaccounts = listaccountsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
masterData.listcontacts = listcontactsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -123,7 +123,7 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
masterData.campaignlists = campaignlistsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -133,10 +133,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 ? res.data.listcontacts : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists ? res.data.campaignlists : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts ? res.data.listaccounts : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists ? res.data.campaignlists : []));
return res;
}
......@@ -151,11 +151,11 @@ export default class IBizListServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -165,12 +165,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listcontacts = listcontactsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
masterData.listaccounts = listaccountsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -180,12 +180,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.campaignlists = campaignlistsData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
masterData.listleads = listleadsData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -195,12 +195,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listaccounts = listaccountsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
masterData.listcontacts = listcontactsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -210,13 +210,13 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
masterData.campaignlists = campaignlistsData;
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 ? res.data.listcontacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists ? res.data.campaignlists : []));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts ? res.data.listaccounts : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists ? res.data.campaignlists : []));
return res;
}
......@@ -244,10 +244,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 ? res.data.listcontacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists ? res.data.campaignlists : []));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts ? res.data.listaccounts : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists ? res.data.campaignlists : []));
return res;
}
......@@ -263,10 +263,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 ? res.data.listcontacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists ? res.data.campaignlists : []));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts ? res.data.listaccounts : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists ? res.data.campaignlists : []));
return res;
}
......@@ -309,11 +309,11 @@ export default class IBizListServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -323,12 +323,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listcontacts = listcontactsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
masterData.listaccounts = listaccountsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -338,12 +338,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.campaignlists = campaignlistsData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
masterData.listleads = listleadsData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -353,12 +353,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listaccounts = listaccountsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
masterData.listcontacts = listcontactsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -368,13 +368,13 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
masterData.campaignlists = campaignlistsData;
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 ? res.data.listcontacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists ? res.data.campaignlists : []));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts ? res.data.listaccounts : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts ? res.data.listcontacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists ? res.data.campaignlists : []));
return res;
}
......
import LeadService from '@/service/lead/lead-service';
import { Verify } from '@/utils/verify/verify';
......@@ -58,6 +59,24 @@ export default class ActiveLogicBase {
}
/**
* 计算0节点结果
*
* @param params 传入参数
*/
public compute0Cond(params:any):boolean{
return true;
}
/**
* 计算1节点结果
*
* @param params 传入参数
*/
public compute1Cond(params:any):boolean{
return true;
}
/**
* 执行逻辑
*
......@@ -69,6 +88,26 @@ export default class ActiveLogicBase {
}
/**
* 更新潜在顾客状态
*
* @param context 应用上下文
* @param params 传入参数
*/
private async executeDeaction1(context:any,params:any,isloading:boolean){
// 行为处理节点
let result: any;
let actionParam:any = this.paramsMap.get('Default');
const targetService:LeadService = new LeadService();
if (targetService['Update'] && targetService['Update'] instanceof Function) {
result = await targetService['Update'](actionParam.context,actionParam.data, false);
}
if(result && result.status == 200){
Object.assign(actionParam.data,result.data);
return this.paramsMap.get(this.defaultParamName).data;
}
}
/**
* 开始
*
......@@ -76,7 +115,26 @@ export default class ActiveLogicBase {
*/
private async executeBegin(context:any,params:any,isloading:boolean){
//开始节点
return this.paramsMap.get(this.defaultParamName).data;
if(this.compute1Cond(params)){
return this.executePrepareparam1(context,params,isloading);
}
}
/**
* 准备参数
*
* @param context 应用上下文
* @param params 传入参数
*/
private async executePrepareparam1(context:any,params:any,isloading:boolean){
// 准备参数节点
let tempDstParam0Context:any = this.paramsMap.get('Default').context?this.paramsMap.get('Default').context:{};
let tempDstParam0Data:any = this.paramsMap.get('Default').data?this.paramsMap.get('Default').data:{};
Object.assign(tempDstParam0Data,{statecode:"0"});
this.paramsMap.set('Default',{data:tempDstParam0Data,context:tempDstParam0Context});
if(this.compute0Cond(params)){
return this.executeDeaction1(context,params,isloading);
}
}
......
......@@ -623,159 +623,9 @@ export default class LeadServiceBase extends EntityService {
* @memberof LeadServiceBase
*/
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);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
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 ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? 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);
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);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
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 ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? 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);
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);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
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 ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? 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);
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);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listleads = listleadsData;
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 ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
return res;
}
return Http.getInstance().post(`/leads/${context.lead}/active`,data,isloading);
let appLogic:ActiveLogic = new ActiveLogic({context:JSON.parse(JSON.stringify(context)),data:JSON.parse(JSON.stringify(data))});
const result = await appLogic.onExecute(context,data,isloading?true:false);
return {status:200,data:result};
}
/**
......
......@@ -75,21 +75,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 quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item: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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -105,21 +105,21 @@ export default class OpportunityServiceBase extends EntityService {
}
}
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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
masterData.quotes = quotesData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -129,28 +129,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+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
return res;
}
if(context.contact && true){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item: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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -166,21 +166,21 @@ export default class OpportunityServiceBase extends EntityService {
}
}
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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
masterData.quotes = quotesData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -190,28 +190,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+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
return res;
}
if(context.account && true){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item: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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -227,21 +227,21 @@ export default class OpportunityServiceBase extends EntityService {
}
}
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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
masterData.quotes = quotesData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -251,27 +251,27 @@ export default class OpportunityServiceBase extends EntityService {
}
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+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
return res;
}
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item: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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -287,21 +287,21 @@ export default class OpportunityServiceBase extends EntityService {
}
}
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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
masterData.quotes = quotesData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -311,9 +311,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+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
return res;
}
......@@ -329,21 +329,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 quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item: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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -359,45 +359,45 @@ export default class OpportunityServiceBase extends EntityService {
}
}
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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
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+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item: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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -413,45 +413,45 @@ export default class OpportunityServiceBase extends EntityService {
}
}
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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
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+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
return res;
}
if(context.account && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item: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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -467,44 +467,44 @@ export default class OpportunityServiceBase extends EntityService {
}
}
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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
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+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
return res;
}
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item: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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -520,26 +520,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
return res;
}
......@@ -577,29 +577,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+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
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+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
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+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
return res;
}
let res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
return res;
}
......@@ -616,32 +616,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+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
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+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
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+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
return res;
}
let res:any = await Http.getInstance().get(`/opportunities/getdraft`,isloading);
res.data.opportunity = data.opportunity;
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
return res;
}
......@@ -672,21 +672,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 quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item: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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -702,45 +702,45 @@ export default class OpportunityServiceBase extends EntityService {
}
}
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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
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+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item: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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -756,45 +756,45 @@ export default class OpportunityServiceBase extends EntityService {
}
}
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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
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+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
return res;
}
if(context.account && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item: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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -810,26 +810,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
masterData.quotes = quotesData;
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+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
return res;
}
return Http.getInstance().post(`/opportunities/${context.opportunity}/checkkey`,data,isloading);
......@@ -862,21 +862,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 quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item: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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -892,45 +892,45 @@ export default class OpportunityServiceBase extends EntityService {
}
}
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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
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+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item: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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -946,45 +946,45 @@ export default class OpportunityServiceBase extends EntityService {
}
}
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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
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+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
return res;
}
if(context.account && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item: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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -1000,44 +1000,44 @@ export default class OpportunityServiceBase extends EntityService {
}
}
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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
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+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
return res;
}
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item: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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -1053,26 +1053,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
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);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors ? res.data.opportunitycompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts ? res.data.opportunityproducts : []));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes ? res.data.quotes : []));
return res;
}
......
......@@ -25,13 +25,9 @@
.form-btn-noborder-transparent {
background-color:rgba(255, 0, 0, 0);border-style:none;margin:0px 10px 0px 0px
}
.form-btn-noborder-transparent {
.form-btn-noborder-transparent.ivu-btn.ivu-btn-primary {
background-color:transparent!important;
border-style:none;
margin:0px 5px 0px 5px;
.ivu-btn.ivu-btn-primary {
color: var(--view-font-color-bright);
}
}
......@@ -25,13 +25,9 @@
.form-btn-noborder-transparent {
background-color:rgba(255, 0, 0, 0);border-style:none;margin:0px 10px 0px 0px
}
.form-btn-noborder-transparent {
.form-btn-noborder-transparent.ivu-btn.ivu-btn-primary {
background-color:transparent!important;
border-style:none;
margin:0px 5px 0px 5px;
.ivu-btn.ivu-btn-primary {
color: var(--view-font-color-bright);
}
}
......@@ -25,13 +25,9 @@
.form-btn-noborder-transparent {
background-color:rgba(255, 0, 0, 0);border-style:none;margin:0px 10px 0px 0px
}
.form-btn-noborder-transparent {
.form-btn-noborder-transparent.ivu-btn.ivu-btn-primary {
background-color:transparent!important;
border-style:none;
margin:0px 5px 0px 5px;
.ivu-btn.ivu-btn-primary {
color: var(--view-font-color-bright);
}
}
......@@ -25,15 +25,11 @@
.form-btn-noborder-transparent {
background-color:rgba(255, 0, 0, 0);border-style:none;margin:0px 10px 0px 0px
}
.form-btn-noborder-transparent {
.form-btn-noborder-transparent.ivu-btn.ivu-btn-primary {
background-color:transparent!important;
border-style:none;
margin:0px 5px 0px 5px;
.ivu-btn.ivu-btn-primary {
color: var(--view-font-color-bright);
}
}
.datapanel-label-style {
color:rgba(245, 244, 244, 1);font-size:12px;margin:0px 0px 0px 0px
......
......@@ -25,13 +25,9 @@
.form-btn-noborder-transparent {
background-color:rgba(255, 0, 0, 0);border-style:none;margin:0px 10px 0px 0px
}
.form-btn-noborder-transparent {
.form-btn-noborder-transparent.ivu-btn.ivu-btn-primary {
background-color:transparent!important;
border-style:none;
margin:0px 5px 0px 5px;
.ivu-btn.ivu-btn-primary {
color: var(--view-font-color-bright);
}
}
......@@ -25,13 +25,9 @@
.form-btn-noborder-transparent {
background-color:rgba(255, 0, 0, 0);border-style:none;margin:0px 10px 0px 0px
}
.form-btn-noborder-transparent {
.form-btn-noborder-transparent.ivu-btn.ivu-btn-primary {
background-color:transparent!important;
border-style:none;
margin:0px 5px 0px 5px;
.ivu-btn.ivu-btn-primary {
color: var(--view-font-color-bright);
}
}
......@@ -25,13 +25,9 @@
.form-btn-noborder-transparent {
background-color:rgba(255, 0, 0, 0);border-style:none;margin:0px 10px 0px 0px
}
.form-btn-noborder-transparent {
.form-btn-noborder-transparent.ivu-btn.ivu-btn-primary {
background-color:transparent!important;
border-style:none;
margin:0px 5px 0px 5px;
.ivu-btn.ivu-btn-primary {
color: var(--view-font-color-bright);
}
}
......@@ -25,13 +25,9 @@
.form-btn-noborder-transparent {
background-color:rgba(255, 0, 0, 0);border-style:none;margin:0px 10px 0px 0px
}
.form-btn-noborder-transparent {
.form-btn-noborder-transparent.ivu-btn.ivu-btn-primary {
background-color:transparent!important;
border-style:none;
margin:0px 5px 0px 5px;
.ivu-btn.ivu-btn-primary {
color: var(--view-font-color-bright);
}
}
......@@ -25,13 +25,9 @@
.form-btn-noborder-transparent {
background-color:rgba(255, 0, 0, 0);border-style:none;margin:0px 10px 0px 0px
}
.form-btn-noborder-transparent {
.form-btn-noborder-transparent.ivu-btn.ivu-btn-primary {
background-color:transparent!important;
border-style:none;
margin:0px 5px 0px 5px;
.ivu-btn.ivu-btn-primary {
color: var(--view-font-color-bright);
}
}
......@@ -25,13 +25,9 @@
.form-btn-noborder-transparent {
background-color:rgba(255, 0, 0, 0);border-style:none;margin:0px 10px 0px 0px
}
.form-btn-noborder-transparent {
.form-btn-noborder-transparent.ivu-btn.ivu-btn-primary {
background-color:transparent!important;
border-style:none;
margin:0px 5px 0px 5px;
.ivu-btn.ivu-btn-primary {
color: var(--view-font-color-bright);
}
}
......@@ -25,13 +25,9 @@
.form-btn-noborder-transparent {
background-color:rgba(255, 0, 0, 0);border-style:none;margin:0px 10px 0px 0px
}
.form-btn-noborder-transparent {
.form-btn-noborder-transparent.ivu-btn.ivu-btn-primary {
background-color:transparent!important;
border-style:none;
margin:0px 5px 0px 5px;
.ivu-btn.ivu-btn-primary {
color: var(--view-font-color-bright);
}
}
......@@ -25,13 +25,9 @@
.form-btn-noborder-transparent {
background-color:rgba(255, 0, 0, 0);border-style:none;margin:0px 10px 0px 0px
}
.form-btn-noborder-transparent {
.form-btn-noborder-transparent.ivu-btn.ivu-btn-primary {
background-color:transparent!important;
border-style:none;
margin:0px 5px 0px 5px;
.ivu-btn.ivu-btn-primary {
color: var(--view-font-color-bright);
}
}
......@@ -78,6 +78,10 @@ public class LeadServiceImpl extends ServiceImpl<LeadMapper, Lead> implements IL
@Lazy
protected cn.ibizlab.businesscentral.core.base.service.ITransactionCurrencyService transactioncurrencyService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.sales.service.logic.ILeadActiveLogic activeLogic;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.sales.service.logic.ILeadCancelLogic cancelLogic;
......@@ -162,8 +166,8 @@ public class LeadServiceImpl extends ServiceImpl<LeadMapper, Lead> implements IL
@Override
@Transactional
public Lead active(Lead et) {
//自定义代码
return et;
activeLogic.execute(et);
return et ;
}
@Override
......
......@@ -26,6 +26,13 @@ public class LeadActiveLogicImpl implements ILeadActiveLogic{
@Autowired
private KieContainer kieContainer;
@Autowired
private cn.ibizlab.businesscentral.core.sales.service.ILeadService leadservice;
public cn.ibizlab.businesscentral.core.sales.service.ILeadService getLeadService() {
return this.leadservice;
}
@Autowired
private cn.ibizlab.businesscentral.core.sales.service.ILeadService iBzSysDefaultService;
......@@ -41,6 +48,7 @@ public class LeadActiveLogicImpl implements ILeadActiveLogic{
kieSession=kieContainer.newKieSession();
kieSession.insert(et);
kieSession.setGlobal("leadactivedefault",et);
kieSession.setGlobal("leadservice",leadservice);
kieSession.setGlobal("iBzSysLeadDefaultService",iBzSysDefaultService);
kieSession.setGlobal("curuser", cn.ibizlab.businesscentral.util.security.AuthenticationUser.getAuthenticationUser());
kieSession.startProcess("cn.ibizlab.businesscentral.core.sales.service.logic.leadactive");
......
......@@ -5798,7 +5798,7 @@
<!--输出实体[LEAD]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-lead-255-70">
<changeSet author="a_LAB01_e85d8801c" id="tab-lead-259-70">
<createTable tableName="LEAD">
<column name="ADDRESS1_FAX" remarks="" type="VARCHAR(50)">
</column>
......@@ -11475,28 +11475,28 @@
</changeSet>
<!--输出实体[LANGUAGELOCALE]外键关系 -->
<!--输出实体[LEAD]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-255-302">
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-259-302">
<addForeignKeyConstraint baseColumnNames="PARENTACCOUNTID" baseTableName="LEAD" constraintName="DER1N_LEAD__ACCOUNT__PARENTACC" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ACCOUNTID" referencedTableName="ACCOUNT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-255-303">
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-259-303">
<addForeignKeyConstraint baseColumnNames="RELATEDOBJECTID" baseTableName="LEAD" constraintName="DER1N_LEAD__CAMPAIGNRESPONSE__" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ACTIVITYID" referencedTableName="CAMPAIGNRESPONSE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-255-304">
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-259-304">
<addForeignKeyConstraint baseColumnNames="CAMPAIGNID" baseTableName="LEAD" constraintName="DER1N_LEAD__CAMPAIGN__CAMPAIGN" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CAMPAIGNID" referencedTableName="CAMPAIGN" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-255-305">
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-259-305">
<addForeignKeyConstraint baseColumnNames="PARENTCONTACTID" baseTableName="LEAD" constraintName="DER1N_LEAD__CONTACT__PARENTCON" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CONTACTID" referencedTableName="CONTACT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-255-306">
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-259-306">
<addForeignKeyConstraint baseColumnNames="ORIGINATINGCASEID" baseTableName="LEAD" constraintName="DER1N_LEAD__INCIDENT__ORIGINAT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="INCIDENTID" referencedTableName="INCIDENT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-255-307">
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-259-307">
<addForeignKeyConstraint baseColumnNames="QUALIFYINGOPPORTUNITYID" baseTableName="LEAD" constraintName="DER1N_LEAD__OPPORTUNITY__QUALI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="OPPORTUNITYID" referencedTableName="OPPORTUNITY" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-255-308">
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-259-308">
<addForeignKeyConstraint baseColumnNames="SLAID" baseTableName="LEAD" constraintName="DER1N_LEAD__SLA__SLAID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SLAID" referencedTableName="SLA" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-255-309">
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-259-309">
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="LEAD" constraintName="DER1N_LEAD__TRANSACTIONCURRENC" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[LEADADDRESS]外键关系 -->
......
......@@ -136,7 +136,7 @@
"delogicname":"潜在顾客",
"sysmoudle":{"id":"SALES","name":"销售"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"},{"id":"Excluded" , "name":"已排除潜在顾客"},{"id":"On" , "name":"已开启潜在顾客"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Active" , "name":"重新激活" , "type":"USERCUSTOM" },{"id":"AddList" , "name":"添加到市场营销列表" , "type":"USERCUSTOM" },{"id":"Cancel" , "name":"取消" , "type":"DELOGIC" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"DisQualification" , "name":"取消资格" , "type":"USERCUSTOM" },{"id":"LostOrder" , "name":"丢单" , "type":"DELOGIC" },{"id":"NoInterested" , "name":"不再感兴趣" , "type":"DELOGIC" },{"id":"Qualification" , "name":"授予资格" , "type":"USERCUSTOM" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Unable" , "name":"无法联系" , "type":"DELOGIC" }],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Active" , "name":"重新激活" , "type":"DELOGIC" },{"id":"AddList" , "name":"添加到市场营销列表" , "type":"USERCUSTOM" },{"id":"Cancel" , "name":"取消" , "type":"DELOGIC" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"DisQualification" , "name":"取消资格" , "type":"USERCUSTOM" },{"id":"LostOrder" , "name":"丢单" , "type":"DELOGIC" },{"id":"NoInterested" , "name":"不再感兴趣" , "type":"DELOGIC" },{"id":"Qualification" , "name":"授予资格" , "type":"USERCUSTOM" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Unable" , "name":"无法联系" , "type":"DELOGIC" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
......
......@@ -4,11 +4,21 @@ import java.util.Map;
import java.util.HashMap;
import com.alibaba.fastjson.JSONObject;
global cn.ibizlab.businesscentral.core.sales.domain.Lead leadactivedefault;
global cn.ibizlab.businesscentral.core.sales.service.ILeadService leadservice;
global cn.ibizlab.businesscentral.core.sales.service.ILeadService iBzSysLeadDefaultService;
global cn.ibizlab.businesscentral.util.security.AuthenticationUser curuser;
no-loop
//逻辑处理节点[更新潜在顾客状态]
rule "deaction1"
ruleflow-group "leadactivedeaction1"
when
then
leadservice.update(leadactivedefault);
update(leadactivedefault);//更新fact中变量值
end
//逻辑处理节点[开始]
rule "begin"
ruleflow-group "leadactivebegin"
......@@ -16,3 +26,12 @@ ruleflow-group "leadactivebegin"
then
end
//逻辑处理节点[准备参数]
rule "prepareparam1"
ruleflow-group "leadactiveprepareparam1"
when
then
leadactivedefault.set("statecode","0");
update(leadactivedefault);//更新fact中变量值
end
......@@ -7,9 +7,15 @@
<tns:import name="cn.ibizlab.businesscentral.util.helper.RuleUtils"/>
<tns:global identifier="leadactivedefault" type="cn.ibizlab.businesscentral.core.sales.domain.Lead" />
</extensionElements>
<businessRuleTask activiti:exclusive="true" g:ruleFlowGroup="leadactivedeaction1" id="BCCBF258-8EE1-4F3A-8E79-3C1A6D6C14F0" implementation="http://www.jboss.org/drools/rule" name="更新潜在顾客状态"/>
<endEvent id="BCCBF258-8EE1-4F3A-8E79-3C1A6D6C14F0_End" name="End"/>
<sequenceFlow id="BCCBF258-8EE1-4F3A-8E79-3C1A6D6C14F0_End_Line" sourceRef="BCCBF258-8EE1-4F3A-8E79-3C1A6D6C14F0" targetRef="BCCBF258-8EE1-4F3A-8E79-3C1A6D6C14F0_End"/>
<startEvent id="81D6EDE3-E088-4D8E-8C5F-B0CA7BDD124F" isInterrupting="true"/>
<endEvent id="81D6EDE3-E088-4D8E-8C5F-B0CA7BDD124F_End" name="End"/>
<sequenceFlow id="81D6EDE3-E088-4D8E-8C5F-B0CA7BDD124F_End_Line" sourceRef="81D6EDE3-E088-4D8E-8C5F-B0CA7BDD124F" targetRef="81D6EDE3-E088-4D8E-8C5F-B0CA7BDD124F_End"/>
<businessRuleTask activiti:exclusive="true" g:ruleFlowGroup="leadactiveprepareparam1" id="670B49AD-25A3-40B2-B155-558EF4078E39" implementation="http://www.jboss.org/drools/rule" name="准备参数"/>
<sequenceFlow id="F73B7F17-6D1A-4F15-8798-7C3D05604B39" sourceRef="670B49AD-25A3-40B2-B155-558EF4078E39" targetRef="BCCBF258-8EE1-4F3A-8E79-3C1A6D6C14F0">
</sequenceFlow>
<sequenceFlow id="DE6578DD-C03E-4847-94FE-8B32A40C7B25" sourceRef="81D6EDE3-E088-4D8E-8C5F-B0CA7BDD124F" targetRef="670B49AD-25A3-40B2-B155-558EF4078E39">
</sequenceFlow>
</process>
</definitions>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册