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

xignzi006 发布系统代码

上级 361c3675
......@@ -58,17 +58,7 @@ export default class DropDownList extends Vue {
@Watch('itemValue')
public valueWatch() {
try {
if (this.$util.typeOf(this.itemValue) === this.valueType) {
this.value = this.itemValue;
} else if (this.valueType === 'number') {
if (this.itemValue.indexOf('.') === -1) {
this.value = parseInt(this.itemValue);
} else {
this.value = parseFloat(this.itemValue);
}
} else {
this.value = this.itemValue.toString();
}
this.readyValue();
// 代码表集合中不存在改选项,重新准备集合
if(this.value && !this.items.find((item: any) => Object.is(this.value, item.value))) {
this.readyCodelist();
......@@ -193,7 +183,7 @@ export default class DropDownList extends Vue {
* @memberof DropDownList
*/
get currentVal() {
return this.itemValue;
return this.value;
}
/**
......@@ -269,8 +259,32 @@ export default class DropDownList extends Vue {
*/
public created() {
this.readyCodelist();
this.readyValue();
}
/**
* 准备值
*
* @memberof DropDownList
*/
public readyValue() {
if(this.itemValue == null) {
this.value = null;
return;
}
if (this.$util.typeOf(this.itemValue) === this.valueType) {
this.value = this.itemValue;
} else if (this.valueType === 'number') {
if (this.itemValue.indexOf('.') === -1) {
this.value = parseInt(this.itemValue);
} else {
this.value = parseFloat(this.itemValue);
}
} else {
this.value = this.itemValue.toString();
}
}
/**
* 准备代码表
*
......
......@@ -221,9 +221,11 @@ export class CentralBase extends Vue {
if (params?.central) {
this.context.central = params.central;
}
if (this.$store.getters.getAppData() && this.$store.getters.getAppData().context) {
Object.assign(this.context, this.$store.getters.getAppData().context);
this.$store.getters.getAppData().context = this.context;
const context = this.$appService.contextStore.appContext;
if (context) {
Object.assign(this.context, context);
context.clearAll();
Object.assign(context, this.context);
}
}
......
......@@ -17,7 +17,7 @@ const router = new Router({
const routerParamsName = 'central';
const params: any = {};
if (to.params && to.params[routerParamsName]) {
Object.assign(params, qs.parse(to.params[routerParamsName], { delimiter: ';' }));
params[routerParamsName] = to.params[routerParamsName];
}
const url: string = '/appdata';
await AuthGuard.getInstance().authGuard(url, params, router);
......
......@@ -65,6 +65,21 @@ export default class AccountServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
......@@ -110,21 +125,6 @@ export default class AccountServiceBase extends EntityService {
}
}
masterData.contacts = contactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -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+'_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+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts ? res.data.contacts : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
return res;
}
......@@ -152,6 +152,21 @@ export default class AccountServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
......@@ -197,27 +212,12 @@ export default class AccountServiceBase extends EntityService {
}
}
masterData.contacts = contactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}`,data,isloading);
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+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts ? res.data.contacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
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+'_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+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts ? res.data.contacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
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+'_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+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts ? res.data.contacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
return res;
}
......@@ -338,6 +338,21 @@ export default class AccountServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
......@@ -383,27 +398,12 @@ export default class AccountServiceBase extends EntityService {
}
}
masterData.contacts = contactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/save`,data,isloading);
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+'_opportunities',JSON.stringify(res.data.opportunities ? res.data.opportunities : []));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts ? res.data.contacts : []));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
return res;
}
......
......@@ -64,6 +64,21 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
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;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaignlists = campaignlistsData;
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
......@@ -94,21 +109,6 @@ export default class CampaignServiceBase extends EntityService {
}
}
masterData.leads = leadsData;
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;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaignlists = campaignlistsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -118,9 +118,9 @@ export default class CampaignServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/campaigns`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists ? res.data.campaignlists : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns ? res.data.campaigncampaigns : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists ? res.data.campaignlists : []));
return res;
}
......@@ -135,6 +135,21 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
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;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaignlists = campaignlistsData;
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
......@@ -165,26 +180,11 @@ export default class CampaignServiceBase extends EntityService {
}
}
masterData.leads = leadsData;
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;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaignlists = campaignlistsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/campaigns/${context.campaign}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists ? res.data.campaignlists : []));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns ? res.data.campaigncampaigns : []));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists ? res.data.campaignlists : []));
return res;
}
......@@ -212,9 +212,9 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/campaigns/${context.campaign}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists ? res.data.campaignlists : []));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns ? res.data.campaigncampaigns : []));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists ? res.data.campaignlists : []));
return res;
}
......@@ -230,9 +230,9 @@ export default class CampaignServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/campaigns/getdraft`,isloading);
res.data.campaign = data.campaign;
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists ? res.data.campaignlists : []));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns ? res.data.campaigncampaigns : []));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists ? res.data.campaignlists : []));
return res;
}
......@@ -275,6 +275,21 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
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;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaignlists = campaignlistsData;
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
......@@ -305,26 +320,11 @@ export default class CampaignServiceBase extends EntityService {
}
}
masterData.leads = leadsData;
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;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaignlists = campaignlistsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists ? res.data.campaignlists : []));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns ? res.data.campaigncampaigns : []));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads ? res.data.leads : []));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists ? res.data.campaignlists : []));
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 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 opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -107,6 +92,21 @@ export default class CompetitorServiceBase extends EntityService {
}
}
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);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
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+'_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 : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
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 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 opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -178,11 +163,26 @@ export default class CompetitorServiceBase extends EntityService {
}
}
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);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/competitors/${context.competitor}`,data,isloading);
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 : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
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+'_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 : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
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+'_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 : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
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 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 opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -303,11 +288,26 @@ export default class CompetitorServiceBase extends EntityService {
}
}
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);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/competitors/${context.competitor}/save`,data,isloading);
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 : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
......
......@@ -68,21 +68,6 @@ 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);
......@@ -113,21 +98,6 @@ 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);
......@@ -143,6 +113,21 @@ 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);
......@@ -173,6 +158,21 @@ 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,21 +200,6 @@ 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);
......@@ -245,14 +230,6 @@ 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);
......@@ -268,6 +245,14 @@ 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);
......@@ -298,11 +283,26 @@ 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,21 +399,6 @@ 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);
......@@ -444,11 +429,26 @@ 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,21 +466,6 @@ 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);
......@@ -511,11 +496,26 @@ 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,21 +548,6 @@ 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);
......@@ -593,14 +578,6 @@ 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);
......@@ -616,6 +593,14 @@ 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);
......@@ -646,11 +631,26 @@ 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,21 +666,6 @@ 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);
......@@ -711,11 +696,26 @@ 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 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) => {
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;
......@@ -78,12 +78,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
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) => {
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) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -93,12 +93,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;
......@@ -108,12 +108,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;
......@@ -123,7 +123,7 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listaccounts = listaccountsData;
masterData.listcontacts = listcontactsData;
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+'_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 : []));
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 : []));
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 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) => {
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;
......@@ -165,12 +165,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
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) => {
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) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -180,12 +180,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;
......@@ -195,12 +195,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;
......@@ -210,13 +210,13 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listaccounts = listaccountsData;
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/ibizlists/${context.ibizlist}`,data,isloading);
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 : []));
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 : []));
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+'_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 : []));
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 : []));
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+'_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 : []));
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 : []));
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 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) => {
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;
......@@ -323,12 +323,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
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) => {
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) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -338,12 +338,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;
......@@ -353,12 +353,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;
......@@ -368,13 +368,13 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listaccounts = listaccountsData;
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/ibizlists/${context.ibizlist}/save`,data,isloading);
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 : []));
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 : []));
return res;
}
......
......@@ -80,11 +80,11 @@ export default class LeadServiceBase extends EntityService {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && true){
let masterData:any = {};
let 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) => {
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;
......@@ -94,12 +94,12 @@ export default class LeadServiceBase extends EntityService {
});
}
}
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) => {
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -109,7 +109,7 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -119,17 +119,17 @@ export default class LeadServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.contact && true){
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) => {
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;
......@@ -139,12 +139,12 @@ export default class LeadServiceBase extends EntityService {
});
}
}
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) => {
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -154,7 +154,7 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -164,17 +164,17 @@ export default class LeadServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.campaign && true){
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) => {
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;
......@@ -184,12 +184,12 @@ export default class LeadServiceBase extends EntityService {
});
}
}
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) => {
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -199,7 +199,7 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -209,17 +209,17 @@ export default class LeadServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.account && true){
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) => {
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;
......@@ -229,12 +229,12 @@ export default class LeadServiceBase extends EntityService {
});
}
}
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) => {
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -244,7 +244,7 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -254,16 +254,16 @@ export default class LeadServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/leads`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -273,12 +273,12 @@ export default class LeadServiceBase extends EntityService {
});
}
}
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) => {
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -288,7 +288,7 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -298,8 +298,8 @@ export default class LeadServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/leads`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
......@@ -315,21 +315,6 @@ export default class LeadServiceBase extends EntityService {
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -345,14 +330,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? 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);
......@@ -368,6 +345,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -383,14 +368,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? 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);
......@@ -406,6 +383,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -421,14 +406,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/campaigns/${context.campaign}/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? 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);
......@@ -444,6 +421,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/campaigns/${context.campaign}/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -459,13 +444,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
return res;
}
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -481,6 +459,13 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -496,10 +481,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
......@@ -540,31 +540,31 @@ export default class LeadServiceBase extends EntityService {
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.lead){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.contact && context.lead){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/leads/${context.lead}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.campaign && context.lead){
let res:any = await Http.getInstance().get(`/campaigns/${context.campaign}/leads/${context.lead}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.account && context.lead){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/leads/${context.lead}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
let res:any = await Http.getInstance().get(`/leads/${context.lead}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
......@@ -581,35 +581,35 @@ export default class LeadServiceBase extends EntityService {
if(context.account && context.contact && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/leads/getdraft`,isloading);
res.data.lead = data.lead;
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.contact && true){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/leads/getdraft`,isloading);
res.data.lead = data.lead;
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.campaign && true){
let res:any = await Http.getInstance().get(`/campaigns/${context.campaign}/leads/getdraft`,isloading);
res.data.lead = data.lead;
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.account && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/leads/getdraft`,isloading);
res.data.lead = data.lead;
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
let res:any = await Http.getInstance().get(`/leads/getdraft`,isloading);
res.data.lead = data.lead;
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
......@@ -640,26 +640,11 @@ export default class LeadServiceBase extends EntityService {
public async AddList(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -670,14 +655,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? 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);
......@@ -693,6 +670,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -708,14 +693,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? 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);
......@@ -731,6 +708,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -746,14 +731,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? 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);
......@@ -769,6 +746,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -784,10 +769,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/leads/${context.lead}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
return Http.getInstance().post(`/leads/${context.lead}/addlist`,data,isloading);
......@@ -820,21 +820,6 @@ export default class LeadServiceBase extends EntityService {
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -850,14 +835,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? 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);
......@@ -873,6 +850,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -888,14 +873,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? 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);
......@@ -911,6 +888,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -926,14 +911,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? 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);
......@@ -949,6 +926,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -964,10 +949,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/leads/${context.lead}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
return Http.getInstance().post(`/leads/${context.lead}/checkkey`,data,isloading);
......@@ -985,21 +985,6 @@ export default class LeadServiceBase extends EntityService {
public async DisQualification(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1015,14 +1000,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/disqualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? 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);
......@@ -1038,6 +1015,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/disqualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1053,14 +1038,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/disqualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? 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);
......@@ -1076,6 +1053,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/disqualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1091,14 +1076,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/disqualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? 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);
......@@ -1114,6 +1091,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/disqualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1129,10 +1114,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/leads/${context.lead}/disqualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
return Http.getInstance().post(`/leads/${context.lead}/disqualification`,data,isloading);
......@@ -1180,21 +1180,6 @@ export default class LeadServiceBase extends EntityService {
public async Qualification(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1210,14 +1195,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/qualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? 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);
......@@ -1233,6 +1210,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/qualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1248,14 +1233,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/qualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? 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);
......@@ -1271,6 +1248,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/qualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1286,14 +1271,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/qualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? 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);
......@@ -1309,6 +1286,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/qualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1324,10 +1309,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/leads/${context.lead}/qualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
return Http.getInstance().post(`/leads/${context.lead}/qualification`,data,isloading);
......@@ -1345,21 +1345,6 @@ export default class LeadServiceBase extends EntityService {
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1375,14 +1360,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? 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);
......@@ -1398,6 +1375,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1413,14 +1398,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? 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);
......@@ -1436,6 +1413,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1451,14 +1436,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? 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);
......@@ -1474,6 +1451,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1489,13 +1474,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
return res;
}
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -1511,6 +1489,13 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1526,10 +1511,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads ? res.data.listleads : []));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors ? res.data.leadcompetitors : []));
return res;
}
......
......@@ -62,21 +62,6 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let salesliteratureitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){
salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any);
if(salesliteratureitemsData && salesliteratureitemsData.length && salesliteratureitemsData.length > 0){
salesliteratureitemsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesliteratureitemid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesliteratureitems = salesliteratureitemsData;
let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
......@@ -107,6 +92,21 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
let salesliteratureitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){
salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any);
if(salesliteratureitemsData && salesliteratureitemsData.length && salesliteratureitemsData.length > 0){
salesliteratureitemsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesliteratureitemid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesliteratureitems = salesliteratureitemsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -116,9 +116,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/salesliteratures`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems ? res.data.salesliteratureitems : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures ? res.data.productsalesliteratures : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures ? res.data.competitorsalesliteratures : []));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems ? res.data.salesliteratureitems : []));
return res;
}
......@@ -133,21 +133,6 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let salesliteratureitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){
salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any);
if(salesliteratureitemsData && salesliteratureitemsData.length && salesliteratureitemsData.length > 0){
salesliteratureitemsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesliteratureitemid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesliteratureitems = salesliteratureitemsData;
let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
......@@ -178,11 +163,26 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
let salesliteratureitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){
salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any);
if(salesliteratureitemsData && salesliteratureitemsData.length && salesliteratureitemsData.length > 0){
salesliteratureitemsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesliteratureitemid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesliteratureitems = salesliteratureitemsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/salesliteratures/${context.salesliterature}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems ? res.data.salesliteratureitems : []));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures ? res.data.productsalesliteratures : []));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures ? res.data.competitorsalesliteratures : []));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems ? res.data.salesliteratureitems : []));
return res;
}
......@@ -210,9 +210,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/salesliteratures/${context.salesliterature}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems ? res.data.salesliteratureitems : []));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures ? res.data.productsalesliteratures : []));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures ? res.data.competitorsalesliteratures : []));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems ? res.data.salesliteratureitems : []));
return res;
}
......@@ -228,9 +228,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/salesliteratures/getdraft`,isloading);
res.data.salesliterature = data.salesliterature;
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems ? res.data.salesliteratureitems : []));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures ? res.data.productsalesliteratures : []));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures ? res.data.competitorsalesliteratures : []));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems ? res.data.salesliteratureitems : []));
return res;
}
......@@ -258,21 +258,6 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let salesliteratureitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){
salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any);
if(salesliteratureitemsData && salesliteratureitemsData.length && salesliteratureitemsData.length > 0){
salesliteratureitemsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesliteratureitemid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesliteratureitems = salesliteratureitemsData;
let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
......@@ -303,11 +288,26 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
let salesliteratureitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){
salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any);
if(salesliteratureitemsData && salesliteratureitemsData.length && salesliteratureitemsData.length > 0){
salesliteratureitemsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesliteratureitemid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesliteratureitems = salesliteratureitemsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/salesliteratures/${context.salesliterature}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems ? res.data.salesliteratureitems : []));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures ? res.data.productsalesliteratures : []));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures ? res.data.competitorsalesliteratures : []));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems ? res.data.salesliteratureitems : []));
return res;
}
......
......@@ -75,6 +75,7 @@ export class AppContentLeftExp extends Vue {
if (this.activeIndex === index) {
this.uiState.leftExpContentShowChange();
} else {
this.uiState.leftExpContentShowChange(true);
this.changeActiveItem(item, index);
}
}
......
......@@ -71,7 +71,7 @@ export class AppContent extends Vue {
*/
protected renderContent(isSlot: boolean): any {
return <div slot={isSlot ? 'right' : null} class={{ 'app-content-right': true, 'hidden-bottom': (!this.$uiState.layoutState.contentBottomShow || !this.$slots.content_bottom) }}>
<split mode="vertical" v-model={this.$uiState.layoutState.contentVerticalSplit}>
<split mode="vertical" v-model={this.$uiState.layoutState.contentVerticalSplit} max={0.1}>
<div slot="top" class="app-content-exp">
{this.$slots.default}
</div>
......@@ -99,7 +99,7 @@ export class AppContent extends Vue {
this.renderContent(false)
]
} else {
content = this.$slots.content_left ? <split class={{ 'app-content-split': true, 'hidden-left': !this.$uiState.layoutState.leftExpContentShow }} v-model={this.$uiState.layoutState.contentHorizontalSplit}>
content = this.$slots.content_left ? <split class={{ 'app-content-split': true, 'hidden-left': !this.$uiState.layoutState.leftExpContentShow }} v-model={this.$uiState.layoutState.contentHorizontalSplit} min={0.1} max={0.5}>
<div slot="left" class="app-content-left">
{this.$slots.content_left}
</div>
......
......@@ -224,6 +224,7 @@
height: 28px;
line-height: 28px;
color: var(--view-button-color);
background-color: var(--view-button-background-color);
}
}
}
......
......@@ -30,6 +30,7 @@
height: 28px;
line-height: 28px;
color: var(--view-button-color);
background-color: var(--view-button-background-color);
}
}
......
......@@ -213,7 +213,7 @@ export class ViewToolbar extends Vue {
}
return <i-button title={item.tooltip} v-show={item.visabled} disabled={item.disabled} class={item.class} on-click={(e: any) => this.itemClick({ tag: item.name }, e)}>
<menu-icon item={item} />
<span class='caption'>{item.caption}</span>
<span class='caption' v-show={item.isShowCaption}>{item.caption}</span>
</i-button>;
});
}
......
export { ServiceInjector } from './service/ServiceInjector';
export { ServiceProvide } from './service/ServiceProvide';
export { SingletonMode } from './SingletonMode';
export { VueLifeCycleProcessing } from './VueLifeCycleProcessing';
\ No newline at end of file
class ServiceData {
/**
* 全局服务
*
* @private
* @type {*}
* @memberof ServiceData
*/
private readonly service: any = {};
/**
* 模块服务
*
* @private
* @type {*}
* @memberof ServiceData
*/
private readonly modules: any = {};
/**
* 新增服务
*
* @param {*} service
* @param {string} name
* @param {string} [module]
* @returns {*}
* @memberof ServiceData
*/
public add(service: any, name: string, module?: string): any {
if (module && !isEmpty(module)) {
const m = this.modules[module];
if (m && !m[name]) {
m[name] = service;
}
} else if (!this.service[name]) {
this.service[name] = service;
}
}
/**
* 获取服务
*
* @param {string} name
* @param {string} [module]
* @returns {*}
* @memberof ServiceData
*/
public get(name: string, module?: string): any {
if (module && !isEmpty(module)) {
const m = this.modules[module];
if (m) {
return m[name];
}
}
return this.service[name];
}
}
// 导出实例
export const serviceData = new ServiceData();
\ No newline at end of file
import { serviceData } from './ServiceData'
/**
* 服务注入器
*
* @export
* @param {string} name
* @param {string} [module]
* @returns {*}
*/
export function ServiceInjector(name: string, module?: string): any {
/**
* 装饰器处理
*/
return function(target: any, fileName: string) {
const service = serviceData.get(name, module);
if (service) {
target[fileName] = service;
}
}
}
\ No newline at end of file
import { serviceData } from './ServiceData'
/**
* 服务注入器
*
* @export
* @param {string} name 服务名称
* @param {string} [module] 模块名称
* @returns {*}
*/
export function ServiceProvide(name: string, module?: string): any {
/**
* 装饰器处理
*/
return function(target: any) {
serviceData.add(new target(), name, module);
}
}
\ No newline at end of file
......@@ -261,7 +261,7 @@ export class EditFormControlBase extends FormControlBase {
const action: any = Object.is(data.srfuf, '1') ? this.updateAction : this.createAction;
if (!action) {
let actionName: any = Object.is(data.srfuf, '1') ? "updateAction" : "createAction";
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.formpage.notconfig.actionname') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.formpage.notconfig.actionname') as string) });
return;
}
Object.assign(arg, { viewparams: this.viewparams });
......@@ -333,7 +333,7 @@ export class EditFormControlBase extends FormControlBase {
const action: any = Object.is(data.srfuf, '1') ? this.updateAction : this.createAction;
if (!action) {
let actionName: any = Object.is(data.srfuf, '1') ? "updateAction" : "createAction";
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.formpage.notconfig.actionname') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.formpage.notconfig.actionname') as string) });
return;
}
Object.assign(arg, { viewparams: this.viewparams });
......@@ -394,7 +394,7 @@ export class EditFormControlBase extends FormControlBase {
public remove(opt: Array<any> = [], showResultInfo?: boolean): Promise<any> {
return new Promise((resolve: any, reject: any) => {
if (!this.removeAction) {
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表单removeAction参数未配置' });
this.$Notice.error({ title: '错误', desc: `${this.name}表单removeAction参数未配置` });
return;
}
const arg: any = opt[0];
......
......@@ -463,7 +463,7 @@ export class FormControlBase extends MainControlBase {
*/
public load(opt: any = {}): void {
if (!this.loadAction) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.formpage.notconfig.loadaction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.formpage.notconfig.loadaction') as string) });
return;
}
const arg: any = { ...opt };
......@@ -499,7 +499,7 @@ export class FormControlBase extends MainControlBase {
*/
public loadDraft(opt: any = {}): void {
if (!this.loaddraftAction) {
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表单loaddraftAction参数未配置' });
this.$Notice.error({ title: '错误', desc: `${this.name}表单loaddraftAction参数未配置` });
return;
}
const arg: any = { ...opt };
......
......@@ -370,7 +370,7 @@ export class GridControllerBase extends MDControlBase {
try {
if (Object.is(item.rowDataState, 'create')) {
if (!this.createAction) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.gridpage.notConfig.createAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.gridpage.notConfig.createAction') as string) });
} else {
Object.assign(item, { viewparams: this.viewparams });
let response = await this.service.add(this.createAction, JSON.parse(JSON.stringify(this.context)), item, this.showBusyIndicator);
......@@ -378,7 +378,7 @@ export class GridControllerBase extends MDControlBase {
}
} else if (Object.is(item.rowDataState, 'update')) {
if (!this.updateAction) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.gridpage.notConfig.updateAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.gridpage.notConfig.updateAction') as string) });
} else {
Object.assign(item, { viewparams: this.viewparams });
if (item[this.appDeName]) {
......@@ -416,7 +416,7 @@ export class GridControllerBase extends MDControlBase {
*/
public load(opt: any = {}, pageReset: boolean = false): void {
if (!this.fetchAction) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.gridpage.notConfig.fetchAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.gridpage.notConfig.fetchAction') as string) });
return;
}
if (pageReset) {
......@@ -500,7 +500,7 @@ export class GridControllerBase extends MDControlBase {
*/
public async remove(items: any[]): Promise<any> {
if (!this.removeAction) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.gridpage.notConfig.removeAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.gridpage.notConfig.removeAction') as string) });
return;
}
const arr: any[] = [];
......@@ -1030,7 +1030,7 @@ export class GridControllerBase extends MDControlBase {
*/
public newRow(args: any[], params?: any, $event?: any, xData?: any): void {
if (!this.loaddraftAction) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.gridpage.notConfig.loaddraftAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.gridpage.notConfig.loaddraftAction') as string) });
return;
}
Object.assign(args[0], { viewparams: this.viewparams });
......@@ -1045,6 +1045,7 @@ export class GridControllerBase extends MDControlBase {
const data = response.data;
this.createDefault(data);
data.rowDataState = "create";
Object.assign(data, this.getActionState(data));
this.items.push(data);
this.gridItemsModel.push(this.getGridRowModel());
}).catch((response: any) => {
......
......@@ -96,7 +96,7 @@ export class ListControllerBase extends MDControlBase {
*/
public load(opt: any = {}): void {
if (!this.fetchAction) {
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图列表fetchAction参数未配置' });
this.$Notice.error({ title: '错误', desc: '视图列表fetchAction参数未配置' });
return;
}
const arg: any = { ...opt };
......@@ -160,7 +160,7 @@ export class ListControllerBase extends MDControlBase {
*/
public async remove(items: any[]): Promise<any> {
if (!this.removeAction) {
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表格removeAction参数未配置' });
this.$Notice.error({ title: '错误', desc: `${this.name}列表removeAction参数未配置` });
return;
}
if (items.length === 0) {
......
......@@ -211,7 +211,12 @@ div::-webkit-scrollbar-thumb {
>.el-checkbox__inner {
background-color: var(--form-editor-background-color);
border: 1px solid var(--view-background-color-bright);
border: 1px solid var(--form-editor-border-color);
}
>.el-checkbox__inner::after{
border: 1px solid var(--form-editor-font-color);
border-left: 0;
border-top: 0;
}
}
}
......@@ -253,6 +258,12 @@ div::-webkit-scrollbar-thumb {
background-color: var(--form-editor-background-color);
border: 1px solid var(--view-background-color-bright);
}
>.el-checkbox__inner::after{
border: 1px solid var(--form-editor-font-color);
border-left: 0;
border-top: 0;
}
}
}
}
......@@ -343,7 +354,7 @@ div::-webkit-scrollbar-thumb {
.ivu-page-item-active {
>a {
color: var(--view-font-color-bright);
color: var(--view-button-color);
}
}
......@@ -355,9 +366,9 @@ div::-webkit-scrollbar-thumb {
>.ivu-select-selection {
height: 22px;
background-color: var(--form-editor-background-color);
border: 1px solid var(--form-editor-background-color);
color: var(--form-editor-font-color);
background-color: var(--view-button-background-color);
border: 1px solid var(--form-editor-border-color);
color: var(--view-button-color);
>div {
......@@ -369,8 +380,9 @@ div::-webkit-scrollbar-thumb {
}
>.ivu-select-selection:hover {
border-color: var(--form-editor-active-color);
background-color: var(--form-editor-active-color);
border-color: var(--view-button-background-color-active);
background-color: var(--view-button-background-color-active);
color: var(--view-button-color-active);
}
}
}
......@@ -645,7 +657,7 @@ div::-webkit-scrollbar-thumb {
>.ivu-select-selection {
background: var(--form-editor-background-color);
border-color: transparent;
border-color: var(--form-editor-border-color);;
.ivu-select-placeholder {
color: var(--form-editor-placeholder-font-color);
......@@ -673,7 +685,7 @@ div::-webkit-scrollbar-thumb {
}
.ivu-input-number {
border-color: transparent;
border-color: var(--form-editor-border-color);
.ivu-input-number-input {
text-align: left;
......
<!DOCTYPE html>
<html lang="en" class="app-theme-light">
<html lang="en" class="app-theme-dark-white">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
......
......@@ -51,7 +51,8 @@ export class AuthGuard {
*/
public async authGuard(url: string, params: any = {}, router: any): Promise<boolean> {
try {
const response = await Http.getInstance().get(url);
let appContext = {};
const response = await Http.getInstance().get(url, params);
if (response && response.status === 200) {
let { data }: { data: any } = response;
if (data) {
......@@ -66,11 +67,14 @@ export class AuthGuard {
data = JSON.parse(JSON.stringify(localAppData));
}
this.formatAppData(data);
new AppService().contextStore.appContext = data.context;
if (data.context) {
appContext = data.context;
}
router.app.$store.commit('addAppData', data);
// 提交统一资源数据
router.app.$store.dispatch('authresource/commitAuthData', data);
}
new AppService().contextStore.appContext = appContext;
}
return true;
} catch (err) {
......
......@@ -89,8 +89,8 @@ public class AppointmentServiceImpl extends ServiceImpl<AppointmentMapper, Appoi
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
activitypointerService.remove(key);
boolean result=removeById(key);
return result ;
}
......
......@@ -94,8 +94,8 @@ public class EmailServiceImpl extends ServiceImpl<EmailMapper, Email> implements
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
activitypointerService.remove(key);
boolean result=removeById(key);
return result ;
}
......
......@@ -89,8 +89,8 @@ public class FaxServiceImpl extends ServiceImpl<FaxMapper, Fax> implements IFaxS
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
activitypointerService.remove(key);
boolean result=removeById(key);
return result ;
}
......
......@@ -89,8 +89,8 @@ public class LetterServiceImpl extends ServiceImpl<LetterMapper, Letter> impleme
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
activitypointerService.remove(key);
boolean result=removeById(key);
return result ;
}
......
......@@ -89,8 +89,8 @@ public class PhoneCallServiceImpl extends ServiceImpl<PhoneCallMapper, PhoneCall
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
activitypointerService.remove(key);
boolean result=removeById(key);
return result ;
}
......
......@@ -89,8 +89,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements IT
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
activitypointerService.remove(key);
boolean result=removeById(key);
return result ;
}
......
package cn.ibizlab.businesscentral.core.humanresource.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.businesscentral.util.domain.EntityBase;
import cn.ibizlab.businesscentral.util.annotation.DEField;
import cn.ibizlab.businesscentral.util.enums.DEPredefinedFieldType;
import cn.ibizlab.businesscentral.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.businesscentral.util.annotation.Audit;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.businesscentral.util.domain.EntityMP;
/**
* 实体[考勤]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "ATTENDANCE",resultMap = "AttendanceResultMap")
public class Attendance extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 考勤标识
*/
@DEField(isKeyField=true)
@TableId(value= "attendanceid",type=IdType.ASSIGN_UUID)
@JSONField(name = "attendanceid")
@JsonProperty("attendanceid")
private String attendanceid;
/**
* 考勤名称
*/
@TableField(value = "attendancename")
@JSONField(name = "attendancename")
@JsonProperty("attendancename")
private String attendancename;
/**
* 建立时间
*/
@DEField(preType = DEPredefinedFieldType.CREATEDATE)
@TableField(value = "createdate" , fill = FieldFill.INSERT)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 更新人
*/
@DEField(preType = DEPredefinedFieldType.UPDATEMAN)
@TableField(value = "updateman")
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 更新时间
*/
@DEField(preType = DEPredefinedFieldType.UPDATEDATE)
@TableField(value = "updatedate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 设置 [考勤名称]
*/
public void setAttendancename(String attendancename){
this.attendancename = attendancename ;
this.modify("attendancename",attendancename);
}
}
package cn.ibizlab.businesscentral.core.humanresource.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.businesscentral.util.domain.EntityBase;
import cn.ibizlab.businesscentral.util.annotation.DEField;
import cn.ibizlab.businesscentral.util.enums.DEPredefinedFieldType;
import cn.ibizlab.businesscentral.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.businesscentral.util.annotation.Audit;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.businesscentral.util.domain.EntityMP;
/**
* 实体[公司]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "COMPANY",resultMap = "CompanyResultMap")
public class Company extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 公司标识
*/
@DEField(isKeyField=true)
@TableId(value= "companyid",type=IdType.ASSIGN_UUID)
@JSONField(name = "companyid")
@JsonProperty("companyid")
private String companyid;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 公司名称
*/
@TableField(value = "companyname")
@JSONField(name = "companyname")
@JsonProperty("companyname")
private String companyname;
/**
* 更新人
*/
@DEField(preType = DEPredefinedFieldType.UPDATEMAN)
@TableField(value = "updateman")
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 建立时间
*/
@DEField(preType = DEPredefinedFieldType.CREATEDATE)
@TableField(value = "createdate" , fill = FieldFill.INSERT)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 更新时间
*/
@DEField(preType = DEPredefinedFieldType.UPDATEDATE)
@TableField(value = "updatedate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 设置 [公司名称]
*/
public void setCompanyname(String companyname){
this.companyname = companyname ;
this.modify("companyname",companyname);
}
}
package cn.ibizlab.businesscentral.core.humanresource.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.businesscentral.util.domain.EntityBase;
import cn.ibizlab.businesscentral.util.annotation.DEField;
import cn.ibizlab.businesscentral.util.enums.DEPredefinedFieldType;
import cn.ibizlab.businesscentral.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.businesscentral.util.annotation.Audit;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.businesscentral.util.domain.EntityMP;
/**
* 实体[员工]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "EMPLOYEE",resultMap = "EmployeeResultMap")
public class Employee extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 员工标识
*/
@DEField(isKeyField=true)
@TableId(value= "employeeid",type=IdType.ASSIGN_UUID)
@JSONField(name = "employeeid")
@JsonProperty("employeeid")
private String employeeid;
/**
* 员工名称
*/
@TableField(value = "employeename")
@JSONField(name = "employeename")
@JsonProperty("employeename")
private String employeename;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 更新人
*/
@DEField(preType = DEPredefinedFieldType.UPDATEMAN)
@TableField(value = "updateman")
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 更新时间
*/
@DEField(preType = DEPredefinedFieldType.UPDATEDATE)
@TableField(value = "updatedate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 建立时间
*/
@DEField(preType = DEPredefinedFieldType.CREATEDATE)
@TableField(value = "createdate" , fill = FieldFill.INSERT)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 设置 [员工名称]
*/
public void setEmployeename(String employeename){
this.employeename = employeename ;
this.modify("employeename",employeename);
}
}
package cn.ibizlab.businesscentral.core.humanresource.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.businesscentral.util.domain.EntityBase;
import cn.ibizlab.businesscentral.util.annotation.DEField;
import cn.ibizlab.businesscentral.util.enums.DEPredefinedFieldType;
import cn.ibizlab.businesscentral.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.businesscentral.util.annotation.Audit;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.businesscentral.util.domain.EntityMP;
/**
* 实体[请假]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "LEAVE",resultMap = "LeaveResultMap")
public class Leave extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 请假名称
*/
@TableField(value = "leavename")
@JSONField(name = "leavename")
@JsonProperty("leavename")
private String leavename;
/**
* 请假标识
*/
@DEField(isKeyField=true)
@TableId(value= "leaveid",type=IdType.ASSIGN_UUID)
@JSONField(name = "leaveid")
@JsonProperty("leaveid")
private String leaveid;
/**
* 更新人
*/
@DEField(preType = DEPredefinedFieldType.UPDATEMAN)
@TableField(value = "updateman")
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 建立时间
*/
@DEField(preType = DEPredefinedFieldType.CREATEDATE)
@TableField(value = "createdate" , fill = FieldFill.INSERT)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 更新时间
*/
@DEField(preType = DEPredefinedFieldType.UPDATEDATE)
@TableField(value = "updatedate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 设置 [请假名称]
*/
public void setLeavename(String leavename){
this.leavename = leavename ;
this.modify("leavename",leavename);
}
}
package cn.ibizlab.businesscentral.core.humanresource.filter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.businesscentral.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.businesscentral.core.humanresource.domain.Attendance;
/**
* 关系型数据实体[Attendance] 查询条件对象
*/
@Slf4j
@Data
public class AttendanceSearchContext extends QueryWrapperContext<Attendance> {
private String n_attendancename_like;//[考勤名称]
public void setN_attendancename_like(String n_attendancename_like) {
this.n_attendancename_like = n_attendancename_like;
if(!ObjectUtils.isEmpty(this.n_attendancename_like)){
this.getSearchCond().like("attendancename", n_attendancename_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("attendancename", query)
);
}
}
}
package cn.ibizlab.businesscentral.core.humanresource.filter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.businesscentral.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.businesscentral.core.humanresource.domain.Company;
/**
* 关系型数据实体[Company] 查询条件对象
*/
@Slf4j
@Data
public class CompanySearchContext extends QueryWrapperContext<Company> {
private String n_companyname_like;//[公司名称]
public void setN_companyname_like(String n_companyname_like) {
this.n_companyname_like = n_companyname_like;
if(!ObjectUtils.isEmpty(this.n_companyname_like)){
this.getSearchCond().like("companyname", n_companyname_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("companyname", query)
);
}
}
}
package cn.ibizlab.businesscentral.core.humanresource.filter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.businesscentral.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.businesscentral.core.humanresource.domain.Employee;
/**
* 关系型数据实体[Employee] 查询条件对象
*/
@Slf4j
@Data
public class EmployeeSearchContext extends QueryWrapperContext<Employee> {
private String n_employeename_like;//[员工名称]
public void setN_employeename_like(String n_employeename_like) {
this.n_employeename_like = n_employeename_like;
if(!ObjectUtils.isEmpty(this.n_employeename_like)){
this.getSearchCond().like("employeename", n_employeename_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("employeename", query)
);
}
}
}
package cn.ibizlab.businesscentral.core.humanresource.filter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.businesscentral.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.businesscentral.core.humanresource.domain.Leave;
/**
* 关系型数据实体[Leave] 查询条件对象
*/
@Slf4j
@Data
public class LeaveSearchContext extends QueryWrapperContext<Leave> {
private String n_leavename_like;//[请假名称]
public void setN_leavename_like(String n_leavename_like) {
this.n_leavename_like = n_leavename_like;
if(!ObjectUtils.isEmpty(this.n_leavename_like)){
this.getSearchCond().like("leavename", n_leavename_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("leavename", query)
);
}
}
}
package cn.ibizlab.businesscentral.core.humanresource.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.businesscentral.core.humanresource.domain.Attendance;
import cn.ibizlab.businesscentral.core.humanresource.filter.AttendanceSearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface AttendanceMapper extends BaseMapper<Attendance>{
Page<Attendance> searchDefault(IPage page, @Param("srf") AttendanceSearchContext context, @Param("ew") Wrapper<Attendance> wrapper) ;
@Override
Attendance selectById(Serializable id);
@Override
int insert(Attendance entity);
@Override
int updateById(@Param(Constants.ENTITY) Attendance entity);
@Override
int update(@Param(Constants.ENTITY) Attendance entity, @Param("ew") Wrapper<Attendance> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
}
package cn.ibizlab.businesscentral.core.humanresource.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.businesscentral.core.humanresource.domain.Company;
import cn.ibizlab.businesscentral.core.humanresource.filter.CompanySearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface CompanyMapper extends BaseMapper<Company>{
Page<Company> searchDefault(IPage page, @Param("srf") CompanySearchContext context, @Param("ew") Wrapper<Company> wrapper) ;
@Override
Company selectById(Serializable id);
@Override
int insert(Company entity);
@Override
int updateById(@Param(Constants.ENTITY) Company entity);
@Override
int update(@Param(Constants.ENTITY) Company entity, @Param("ew") Wrapper<Company> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
}
package cn.ibizlab.businesscentral.core.humanresource.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.businesscentral.core.humanresource.domain.Employee;
import cn.ibizlab.businesscentral.core.humanresource.filter.EmployeeSearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface EmployeeMapper extends BaseMapper<Employee>{
Page<Employee> searchDefault(IPage page, @Param("srf") EmployeeSearchContext context, @Param("ew") Wrapper<Employee> wrapper) ;
@Override
Employee selectById(Serializable id);
@Override
int insert(Employee entity);
@Override
int updateById(@Param(Constants.ENTITY) Employee entity);
@Override
int update(@Param(Constants.ENTITY) Employee entity, @Param("ew") Wrapper<Employee> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
}
package cn.ibizlab.businesscentral.core.humanresource.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.businesscentral.core.humanresource.domain.Leave;
import cn.ibizlab.businesscentral.core.humanresource.filter.LeaveSearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface LeaveMapper extends BaseMapper<Leave>{
Page<Leave> searchDefault(IPage page, @Param("srf") LeaveSearchContext context, @Param("ew") Wrapper<Leave> wrapper) ;
@Override
Leave selectById(Serializable id);
@Override
int insert(Leave entity);
@Override
int updateById(@Param(Constants.ENTITY) Leave entity);
@Override
int update(@Param(Constants.ENTITY) Leave entity, @Param("ew") Wrapper<Leave> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
}
package cn.ibizlab.businesscentral.core.humanresource.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.businesscentral.core.humanresource.domain.Attendance;
import cn.ibizlab.businesscentral.core.humanresource.filter.AttendanceSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[Attendance] 服务对象接口
*/
public interface IAttendanceService extends IService<Attendance>{
boolean create(Attendance et) ;
void createBatch(List<Attendance> list) ;
boolean update(Attendance et) ;
void updateBatch(List<Attendance> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
Attendance get(String key) ;
Attendance getDraft(Attendance et) ;
boolean checkKey(Attendance et) ;
boolean save(Attendance et) ;
void saveBatch(List<Attendance> list) ;
Page<Attendance> searchDefault(AttendanceSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
List<Attendance> getAttendanceByIds(List<String> ids) ;
List<Attendance> getAttendanceByEntities(List<Attendance> entities) ;
}
package cn.ibizlab.businesscentral.core.humanresource.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.businesscentral.core.humanresource.domain.Company;
import cn.ibizlab.businesscentral.core.humanresource.filter.CompanySearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[Company] 服务对象接口
*/
public interface ICompanyService extends IService<Company>{
boolean create(Company et) ;
void createBatch(List<Company> list) ;
boolean update(Company et) ;
void updateBatch(List<Company> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
Company get(String key) ;
Company getDraft(Company et) ;
boolean checkKey(Company et) ;
boolean save(Company et) ;
void saveBatch(List<Company> list) ;
Page<Company> searchDefault(CompanySearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
List<Company> getCompanyByIds(List<String> ids) ;
List<Company> getCompanyByEntities(List<Company> entities) ;
}
package cn.ibizlab.businesscentral.core.humanresource.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.businesscentral.core.humanresource.domain.Employee;
import cn.ibizlab.businesscentral.core.humanresource.filter.EmployeeSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[Employee] 服务对象接口
*/
public interface IEmployeeService extends IService<Employee>{
boolean create(Employee et) ;
void createBatch(List<Employee> list) ;
boolean update(Employee et) ;
void updateBatch(List<Employee> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
Employee get(String key) ;
Employee getDraft(Employee et) ;
boolean checkKey(Employee et) ;
boolean save(Employee et) ;
void saveBatch(List<Employee> list) ;
Page<Employee> searchDefault(EmployeeSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
List<Employee> getEmployeeByIds(List<String> ids) ;
List<Employee> getEmployeeByEntities(List<Employee> entities) ;
}
package cn.ibizlab.businesscentral.core.humanresource.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.businesscentral.core.humanresource.domain.Leave;
import cn.ibizlab.businesscentral.core.humanresource.filter.LeaveSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[Leave] 服务对象接口
*/
public interface ILeaveService extends IService<Leave>{
boolean create(Leave et) ;
void createBatch(List<Leave> list) ;
boolean update(Leave et) ;
void updateBatch(List<Leave> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
Leave get(String key) ;
Leave getDraft(Leave et) ;
boolean checkKey(Leave et) ;
boolean save(Leave et) ;
void saveBatch(List<Leave> list) ;
Page<Leave> searchDefault(LeaveSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
List<Leave> getLeaveByIds(List<String> ids) ;
List<Leave> getLeaveByEntities(List<Leave> entities) ;
}
package cn.ibizlab.businesscentral.core.humanresource.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.businesscentral.core.humanresource.domain.Attendance;
import cn.ibizlab.businesscentral.core.humanresource.filter.AttendanceSearchContext;
import cn.ibizlab.businesscentral.core.humanresource.service.IAttendanceService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.humanresource.mapper.AttendanceMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[考勤] 服务对象接口实现
*/
@Slf4j
@Service("AttendanceServiceImpl")
public class AttendanceServiceImpl extends ServiceImpl<AttendanceMapper, Attendance> implements IAttendanceService {
protected int batchSize = 500;
@Override
@Transactional
public boolean create(Attendance et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getAttendanceid()),et);
return true;
}
@Override
public void createBatch(List<Attendance> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(Attendance et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("attendanceid",et.getAttendanceid())))
return false;
CachedBeanCopier.copy(get(et.getAttendanceid()),et);
return true;
}
@Override
public void updateBatch(List<Attendance> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public Attendance get(String key) {
Attendance et = getById(key);
if(et==null){
et=new Attendance();
et.setAttendanceid(key);
}
else{
}
return et;
}
@Override
public Attendance getDraft(Attendance et) {
return et;
}
@Override
public boolean checkKey(Attendance et) {
return (!ObjectUtils.isEmpty(et.getAttendanceid()))&&(!Objects.isNull(this.getById(et.getAttendanceid())));
}
@Override
@Transactional
public boolean save(Attendance et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(Attendance et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<Attendance> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<Attendance> list) {
saveOrUpdateBatch(list,batchSize);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<Attendance> searchDefault(AttendanceSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Attendance> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Attendance>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<Attendance> getAttendanceByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<Attendance> getAttendanceByEntities(List<Attendance> entities) {
List ids =new ArrayList();
for(Attendance entity : entities){
Serializable id=entity.getAttendanceid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
package cn.ibizlab.businesscentral.core.humanresource.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.businesscentral.core.humanresource.domain.Company;
import cn.ibizlab.businesscentral.core.humanresource.filter.CompanySearchContext;
import cn.ibizlab.businesscentral.core.humanresource.service.ICompanyService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.humanresource.mapper.CompanyMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[公司] 服务对象接口实现
*/
@Slf4j
@Service("CompanyServiceImpl")
public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> implements ICompanyService {
protected int batchSize = 500;
@Override
@Transactional
public boolean create(Company et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getCompanyid()),et);
return true;
}
@Override
public void createBatch(List<Company> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(Company et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("companyid",et.getCompanyid())))
return false;
CachedBeanCopier.copy(get(et.getCompanyid()),et);
return true;
}
@Override
public void updateBatch(List<Company> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public Company get(String key) {
Company et = getById(key);
if(et==null){
et=new Company();
et.setCompanyid(key);
}
else{
}
return et;
}
@Override
public Company getDraft(Company et) {
return et;
}
@Override
public boolean checkKey(Company et) {
return (!ObjectUtils.isEmpty(et.getCompanyid()))&&(!Objects.isNull(this.getById(et.getCompanyid())));
}
@Override
@Transactional
public boolean save(Company et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(Company et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<Company> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<Company> list) {
saveOrUpdateBatch(list,batchSize);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<Company> searchDefault(CompanySearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Company> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Company>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<Company> getCompanyByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<Company> getCompanyByEntities(List<Company> entities) {
List ids =new ArrayList();
for(Company entity : entities){
Serializable id=entity.getCompanyid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
package cn.ibizlab.businesscentral.core.humanresource.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.businesscentral.core.humanresource.domain.Employee;
import cn.ibizlab.businesscentral.core.humanresource.filter.EmployeeSearchContext;
import cn.ibizlab.businesscentral.core.humanresource.service.IEmployeeService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.humanresource.mapper.EmployeeMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[员工] 服务对象接口实现
*/
@Slf4j
@Service("EmployeeServiceImpl")
public class EmployeeServiceImpl extends ServiceImpl<EmployeeMapper, Employee> implements IEmployeeService {
protected int batchSize = 500;
@Override
@Transactional
public boolean create(Employee et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getEmployeeid()),et);
return true;
}
@Override
public void createBatch(List<Employee> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(Employee et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("employeeid",et.getEmployeeid())))
return false;
CachedBeanCopier.copy(get(et.getEmployeeid()),et);
return true;
}
@Override
public void updateBatch(List<Employee> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public Employee get(String key) {
Employee et = getById(key);
if(et==null){
et=new Employee();
et.setEmployeeid(key);
}
else{
}
return et;
}
@Override
public Employee getDraft(Employee et) {
return et;
}
@Override
public boolean checkKey(Employee et) {
return (!ObjectUtils.isEmpty(et.getEmployeeid()))&&(!Objects.isNull(this.getById(et.getEmployeeid())));
}
@Override
@Transactional
public boolean save(Employee et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(Employee et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<Employee> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<Employee> list) {
saveOrUpdateBatch(list,batchSize);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<Employee> searchDefault(EmployeeSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Employee> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Employee>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<Employee> getEmployeeByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<Employee> getEmployeeByEntities(List<Employee> entities) {
List ids =new ArrayList();
for(Employee entity : entities){
Serializable id=entity.getEmployeeid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
package cn.ibizlab.businesscentral.core.humanresource.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.businesscentral.core.humanresource.domain.Leave;
import cn.ibizlab.businesscentral.core.humanresource.filter.LeaveSearchContext;
import cn.ibizlab.businesscentral.core.humanresource.service.ILeaveService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.humanresource.mapper.LeaveMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[请假] 服务对象接口实现
*/
@Slf4j
@Service("LeaveServiceImpl")
public class LeaveServiceImpl extends ServiceImpl<LeaveMapper, Leave> implements ILeaveService {
protected int batchSize = 500;
@Override
@Transactional
public boolean create(Leave et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getLeaveid()),et);
return true;
}
@Override
public void createBatch(List<Leave> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(Leave et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("leaveid",et.getLeaveid())))
return false;
CachedBeanCopier.copy(get(et.getLeaveid()),et);
return true;
}
@Override
public void updateBatch(List<Leave> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public Leave get(String key) {
Leave et = getById(key);
if(et==null){
et=new Leave();
et.setLeaveid(key);
}
else{
}
return et;
}
@Override
public Leave getDraft(Leave et) {
return et;
}
@Override
public boolean checkKey(Leave et) {
return (!ObjectUtils.isEmpty(et.getLeaveid()))&&(!Objects.isNull(this.getById(et.getLeaveid())));
}
@Override
@Transactional
public boolean save(Leave et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(Leave et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<Leave> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<Leave> list) {
saveOrUpdateBatch(list,batchSize);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<Leave> searchDefault(LeaveSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Leave> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Leave>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<Leave> getLeaveByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<Leave> getLeaveByEntities(List<Leave> entities) {
List ids =new ArrayList();
for(Leave entity : entities){
Serializable id=entity.getLeaveid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
......@@ -83,8 +83,8 @@ public class CampaignActivityServiceImpl extends ServiceImpl<CampaignActivityMap
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
activitypointerService.remove(key);
boolean result=removeById(key);
return result ;
}
......
......@@ -89,8 +89,8 @@ public class CampaignResponseServiceImpl extends ServiceImpl<CampaignResponseMap
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
activitypointerService.remove(key);
boolean result=removeById(key);
return result ;
}
......
......@@ -92,8 +92,8 @@ public class ServiceAppointmentServiceImpl extends ServiceImpl<ServiceAppointmen
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
activitypointerService.remove(key);
boolean result=removeById(key);
return result ;
}
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.businesscentral.core.humanresource.mapper.AttendanceMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="AttendanceResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`ATTENDANCEID`, t1.`ATTENDANCENAME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `ATTENDANCE` t1 ) t1 where attendanceid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="AttendanceResultMap" type="cn.ibizlab.businesscentral.core.humanresource.domain.Attendance" autoMapping="true">
<id property="attendanceid" column="attendanceid" /><!--主键字段映射-->
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.humanresource.filter.AttendanceSearchContext" resultMap="AttendanceResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`ATTENDANCEID`, t1.`ATTENDANCENAME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `ATTENDANCE` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`ATTENDANCEID`, t1.`ATTENDANCENAME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `ATTENDANCE` t1
]]>
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.businesscentral.core.humanresource.mapper.CompanyMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="CompanyResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`COMPANYID`, t1.`COMPANYNAME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `COMPANY` t1 ) t1 where companyid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="CompanyResultMap" type="cn.ibizlab.businesscentral.core.humanresource.domain.Company" autoMapping="true">
<id property="companyid" column="companyid" /><!--主键字段映射-->
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.humanresource.filter.CompanySearchContext" resultMap="CompanyResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`COMPANYID`, t1.`COMPANYNAME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `COMPANY` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`COMPANYID`, t1.`COMPANYNAME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `COMPANY` t1
]]>
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.businesscentral.core.humanresource.mapper.EmployeeMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="EmployeeResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EMPLOYEEID`, t1.`EMPLOYEENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EMPLOYEE` t1 ) t1 where employeeid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="EmployeeResultMap" type="cn.ibizlab.businesscentral.core.humanresource.domain.Employee" autoMapping="true">
<id property="employeeid" column="employeeid" /><!--主键字段映射-->
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.humanresource.filter.EmployeeSearchContext" resultMap="EmployeeResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EMPLOYEEID`, t1.`EMPLOYEENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EMPLOYEE` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EMPLOYEEID`, t1.`EMPLOYEENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EMPLOYEE` t1
]]>
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.businesscentral.core.humanresource.mapper.LeaveMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="LeaveResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`LEAVEID`, t1.`LEAVENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `LEAVE` t1 ) t1 where leaveid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="LeaveResultMap" type="cn.ibizlab.businesscentral.core.humanresource.domain.Leave" autoMapping="true">
<id property="leaveid" column="leaveid" /><!--主键字段映射-->
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.humanresource.filter.LeaveSearchContext" resultMap="LeaveResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`LEAVEID`, t1.`LEAVENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `LEAVE` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`LEAVEID`, t1.`LEAVENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `LEAVE` t1
]]>
</sql>
</mapper>
......@@ -29,6 +29,8 @@ public class FeignRequestInterceptor implements RequestInterceptor {
if (headerNames != null) {
while (headerNames.hasMoreElements()) {
String name = headerNames.nextElement();
if(name.equalsIgnoreCase("transfer-encoding"))
continue;
String values = request.getHeader(name);
requestTemplate.header(name, values);
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册