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

lab_gzf 发布系统代码

上级 5fe0b2e4
......@@ -499,6 +499,16 @@
"viewtag": "2eba43abd437c023437f1f2effb1fccb",
"memo": ""
},
"goalstatetabview": {
"title": "目标分页状态",
"caption": "目标",
"viewtype": "DETABEXPVIEW",
"viewmodule": "Sales",
"viewname": "GoalStateTabView",
"viewfilename": "goal-state-tab-view",
"viewtag": "2f0540af5db76052cee0e8e91f0204c4",
"memo": ""
},
"salesliteratureeditview": {
"title": "销售宣传资料编辑视图",
"caption": "销售宣传资料",
......
......@@ -146,6 +146,7 @@ export default {
menuitem25: "目标",
menuitem31: "目标度量",
menuitem26: "预测",
menuitem33: "目标分页",
menuitem27: "服务",
menuitem28: "服务案例",
menuitem32: "知识文章",
......
......@@ -146,6 +146,7 @@ export default {
menuitem25: "目标",
menuitem31: "目标度量",
menuitem26: "预测",
menuitem33: "目标分页",
menuitem27: "服务",
menuitem28: "服务案例",
menuitem32: "知识文章",
......
......@@ -92,6 +92,10 @@ export default {
caption: "目标",
title: "目标选择表格视图",
},
statetabview: {
caption: "目标",
title: "目标分页状态",
},
info_goalview: {
caption: "目标",
title: "目标信息视图",
......@@ -125,13 +129,9 @@ export default {
title: "子目标表格视图",
},
},
info_goal_form: {
quickcreate_form: {
details: {
group1: "基本信息",
grouppanel2: "分组面板",
grouppanel3: "分组面板",
grouppanel1: "时间段",
grouppanel4: "详细信息",
group1: "目标基本信息",
formpage1: "基本信息",
srfupdatedate: "更新时间",
srforikey: "",
......@@ -143,24 +143,17 @@ export default {
srfsourcekey: "",
title: "名称",
parentgoalname: "上级目标",
metricname: "目标度量",
goalownerid: "目标负责人",
metricname: "目标度量",
ownerid: "经理",
fiscalperiodgoal: "目标期间类型",
fiscalyear: "会计年度",
fiscalperiod: "会计期间",
goalstartdate: "从",
goalenddate: "到",
targetmoney: "目标值(金额)",
actualmoney: "实际值(金额)",
percentage: "已实现百分比",
inprogressmoney: "过程值(金额)",
parentgoalid: "上级目标",
goalid: "目标",
metricid: "目标度量",
},
uiactions: {
},
},
edit_childgoal_form: {
info_goal_form: {
details: {
group1: "基本信息",
grouppanel2: "分组面板",
......@@ -190,16 +183,18 @@ export default {
actualmoney: "实际值(金额)",
percentage: "已实现百分比",
inprogressmoney: "过程值(金额)",
parentgoalid: "上级目标",
goalid: "目标",
metricid: "目标度量",
},
uiactions: {
},
},
quickcreate_form: {
edit_childgoal_form: {
details: {
group1: "目标基本信息",
group1: "基本信息",
grouppanel2: "分组面板",
grouppanel3: "分组面板",
grouppanel1: "时间段",
grouppanel4: "详细信息",
formpage1: "基本信息",
srfupdatedate: "更新时间",
srforikey: "",
......@@ -211,9 +206,18 @@ export default {
srfsourcekey: "",
title: "名称",
parentgoalname: "上级目标",
goalownerid: "目标负责人",
metricname: "目标度量",
goalownerid: "目标负责人",
ownerid: "经理",
fiscalperiodgoal: "目标期间类型",
fiscalyear: "会计年度",
fiscalperiod: "会计期间",
goalstartdate: "从",
goalenddate: "到",
targetmoney: "目标值(金额)",
actualmoney: "实际值(金额)",
percentage: "已实现百分比",
inprogressmoney: "过程值(金额)",
parentgoalid: "上级目标",
goalid: "目标",
metricid: "目标度量",
......
......@@ -91,6 +91,10 @@ export default {
caption: "目标",
title: "目标选择表格视图",
},
statetabview: {
caption: "目标",
title: "目标分页状态",
},
info_goalview: {
caption: "目标",
title: "目标信息视图",
......@@ -124,13 +128,9 @@ export default {
title: "子目标表格视图",
},
},
info_goal_form: {
quickcreate_form: {
details: {
group1: "基本信息",
grouppanel2: "分组面板",
grouppanel3: "分组面板",
grouppanel1: "时间段",
grouppanel4: "详细信息",
group1: "目标基本信息",
formpage1: "基本信息",
srfupdatedate: "更新时间",
srforikey: "",
......@@ -142,24 +142,17 @@ export default {
srfsourcekey: "",
title: "名称",
parentgoalname: "上级目标",
metricname: "目标度量",
goalownerid: "目标负责人",
metricname: "目标度量",
ownerid: "经理",
fiscalperiodgoal: "目标期间类型",
fiscalyear: "会计年度",
fiscalperiod: "会计期间",
goalstartdate: "从",
goalenddate: "到",
targetmoney: "目标值(金额)",
actualmoney: "实际值(金额)",
percentage: "已实现百分比",
inprogressmoney: "过程值(金额)",
parentgoalid: "上级目标",
goalid: "目标",
metricid: "目标度量",
},
uiactions: {
},
},
edit_childgoal_form: {
info_goal_form: {
details: {
group1: "基本信息",
grouppanel2: "分组面板",
......@@ -189,16 +182,18 @@ export default {
actualmoney: "实际值(金额)",
percentage: "已实现百分比",
inprogressmoney: "过程值(金额)",
parentgoalid: "上级目标",
goalid: "目标",
metricid: "目标度量",
},
uiactions: {
},
},
quickcreate_form: {
edit_childgoal_form: {
details: {
group1: "目标基本信息",
group1: "基本信息",
grouppanel2: "分组面板",
grouppanel3: "分组面板",
grouppanel1: "时间段",
grouppanel4: "详细信息",
formpage1: "基本信息",
srfupdatedate: "更新时间",
srforikey: "",
......@@ -210,9 +205,18 @@ export default {
srfsourcekey: "",
title: "名称",
parentgoalname: "上级目标",
goalownerid: "目标负责人",
metricname: "目标度量",
goalownerid: "目标负责人",
ownerid: "经理",
fiscalperiodgoal: "目标期间类型",
fiscalyear: "会计年度",
fiscalperiod: "会计期间",
goalstartdate: "从",
goalenddate: "到",
targetmoney: "目标值(金额)",
actualmoney: "实际值(金额)",
percentage: "已实现百分比",
inprogressmoney: "过程值(金额)",
parentgoalid: "上级目标",
goalid: "目标",
metricid: "目标度量",
......
......@@ -577,7 +577,7 @@ mock.onGet('v7/centralappmenu').reply((config: any) => {
iconcls: 'fa fa-line-chart',
icon: '',
textcls: '',
appfunctag: '_2',
appfunctag: '_3',
resourcetag: '',
},
{
......@@ -597,6 +597,24 @@ mock.onGet('v7/centralappmenu').reply((config: any) => {
textcls: '',
appfunctag: '',
resourcetag: '',
},
{
id: '9865490D-A150-450A-9695-3F4610E9A5BE',
name: 'menuitem33',
text: '目标分页',
type: 'MENUITEM',
counterid: '',
tooltip: '目标分页',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '_2',
resourcetag: '',
},
],
},
......
......@@ -407,6 +407,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname": "IBizListInfo_Abstract",
"viewtag": "2eba43abd437c023437f1f2effb1fccb"
},
"goalstatetabview": {
"title": "目标分页状态",
"caption": "目标",
"viewtype": "DETABEXPVIEW",
"viewmodule": "Sales",
"viewname": "GoalStateTabView",
"viewtag": "2f0540af5db76052cee0e8e91f0204c4"
},
"salesliteratureeditview": {
"title": "销售宣传资料编辑视图",
"caption": "销售宣传资料",
......
import { Subject } from 'rxjs';
import { TabExpViewBase } from '@/studio-core';
import GoalService from '@/service/goal/goal-service';
import TabExpViewEngine from '@engine/view/tab-exp-view-engine';
/**
* 目标分页状态视图基类
*
* @export
* @class GoalStateTabViewBase
* @extends {TabExpViewBase}
*/
export class GoalStateTabViewBase extends TabExpViewBase {
/**
* 实体服务对象
*
* @type {GoalService}
* @memberof GoalStateTabViewBase
*/
protected appEntityService: GoalService = new GoalService;
/**
* 计数器服务对象集合
*
* @protected
* @type {Array<*>}
* @memberof GoalStateTabViewBase
*/
protected counterServiceArray: Array<any> = [];
/**
* 视图模型数据
*
* @protected
* @type {*}
* @memberof GoalStateTabViewBase
*/
protected model: any = {
srfCaption: 'entities.goal.views.statetabview.caption',
srfTitle: 'entities.goal.views.statetabview.title',
srfSubTitle: 'entities.goal.views.statetabview.subtitle',
dataInfo: ''
}
/**
* 容器模型
*
* @protected
* @type {*}
* @memberof GoalStateTabViewBase
*/
protected containerModel: any = {
view_tabexppanel: { name: 'tabexppanel', type: 'TABEXPPANEL' },
};
/**
* 视图唯一标识
*
* @protected
* @type {string}
* @memberof ViewBase
*/
protected viewtag: string = '2f0540af5db76052cee0e8e91f0204c4';
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof GoalStateTabViewBase
*/
public engine: TabExpViewEngine = new TabExpViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof GoalStateTabViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
keyPSDEField: 'goal',
majorPSDEField: 'title',
isLoadDefault: true,
});
}
/**
* 加载模型
*
* @protected
* @memberof GoalStateTabViewBase
*/
protected async loadModel(): Promise<any> {
if(this.context.goal){
this.appEntityService.getDataInfo(JSON.parse(JSON.stringify(this.context)),{},false).then((response:any) =>{
if (!response || response.status !== 200) {
return;
}
const { data: _data } = response;
if (_data.title) {
Object.assign(this.model, { dataInfo: _data.title });
if (this.$tabPageExp) {
this.$tabPageExp.setCurPageCaption(this.model.srfTitle, this.model.srfTitle, this.model.dataInfo);
}
if(this.$route){
this.$route.meta.info = this.model.dataInfo;
}
Object.assign(this.model, { srfTitle: `${this.$t(this.model.srfTitle)} - ${this.model.dataInfo}` });
this.$appService.navHistory.setCaption({ route: this.$route, info: this.model.dataInfo });
}
})
}
}
}
\ No newline at end of file
<studio-view-style2 viewName="goalstatetabview" viewTitle="目标分页状态" class='detabexpview goal-state-tab-view'>
<view_tabexppanel
:viewState="viewState"
:viewparams="viewparams"
:context="context"
name="tabexppanel"
ref='tabexppanel'
@closeview="closeView($event)">
</view_tabexppanel>
</studio-view-style2>
\ No newline at end of file
<template src="./goal-state-tab-view.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { GoalStateTabViewBase } from './goal-state-tab-view-base';
import view_tabexppanel from '@widgets/goal/state-tab-viewtabexppanel-tabexppanel/state-tab-viewtabexppanel-tabexppanel.vue';
/**
* 目标分页状态视图
*
* @export
* @class GoalStateTabView
* @extends {GoalStateTabViewBase}
*/
@Component({
components: {
view_tabexppanel,
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
vm.$appService.navHistory.setViewTag(vm.viewtag, to);
vm.$appService.navHistory.setViewContext(vm.context, to);
});
}
})
@VueLifeCycleProcessing()
export default class GoalStateTabView extends GoalStateTabViewBase { }
</script>
......@@ -74,6 +74,7 @@ export const PageComponents = {
Vue.component('lead-quick-create', () => import('@pages/sales/lead-quick-create/lead-quick-create.vue'));
Vue.component('competitor-pickup-grid-view', () => import('@pages/sales/competitor-pickup-grid-view/competitor-pickup-grid-view.vue'));
Vue.component('price-level-pickup-view', () => import('@pages/product/price-level-pickup-view/price-level-pickup-view.vue'));
Vue.component('goal-state-tab-view', () => import('@pages/sales/goal-state-tab-view/goal-state-tab-view.vue'));
Vue.component('invoice-summary-view', () => import('@pages/finance/invoice-summary-view/invoice-summary-view.vue'));
Vue.component('opportunity-edit-view', () => import('@pages/sales/opportunity-edit-view/opportunity-edit-view.vue'));
Vue.component('lead-info-contact', () => import('@pages/sales/lead-info-contact/lead-info-contact.vue'));
......
......@@ -1872,6 +1872,20 @@ const router = new Router({
},
component: () => import('@pages/product/price-level-pickup-view/price-level-pickup-view.vue'),
},
{
path: 'goals/:goal?/statetabview/:statetabview?',
meta: {
caption: 'entities.goal.views.statetabview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'goals', parameterName: 'goal' },
{ pathName: 'statetabview', parameterName: 'statetabview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/goal-state-tab-view/goal-state-tab-view.vue'),
},
{
path: 'invoices/:invoice?/summaryview/:summaryview?',
meta: {
......
......@@ -62,21 +62,21 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaigncampaignsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
masterData.campaigncampaigns = campaigncampaignsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
......@@ -92,21 +92,21 @@ export default class CampaignServiceBase extends EntityService {
}
}
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);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaigncampaignsData.forEach((item: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.relationshipsid = null;
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaigncampaigns = campaigncampaignsData;
masterData.leads = leadsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -116,9 +116,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+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -133,21 +133,21 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaigncampaignsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
masterData.campaigncampaigns = campaigncampaignsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
......@@ -163,26 +163,26 @@ export default class CampaignServiceBase extends EntityService {
}
}
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);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaigncampaignsData.forEach((item: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.relationshipsid = null;
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaigncampaigns = campaigncampaignsData;
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/campaigns/${context.campaign}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -210,9 +210,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+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -228,9 +228,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+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -258,21 +258,21 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaigncampaignsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
masterData.campaigncampaigns = campaigncampaignsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
......@@ -288,26 +288,26 @@ export default class CampaignServiceBase extends EntityService {
}
}
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);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaigncampaignsData.forEach((item: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.relationshipsid = null;
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaigncampaigns = campaigncampaignsData;
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......
......@@ -66,36 +66,36 @@ 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 opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
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.opportunityid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
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) => {
masterData.listcontacts = listcontactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
masterData.opportunities = opportunitiesData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -120,42 +120,42 @@ export default class ContactServiceBase extends EntityService {
}
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+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
let masterData:any = {};
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
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.opportunityid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
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) => {
masterData.listcontacts = listcontactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
masterData.opportunities = opportunitiesData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -180,8 +180,8 @@ 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+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -198,36 +198,36 @@ 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 opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
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.opportunityid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
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) => {
masterData.listcontacts = listcontactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
masterData.opportunities = opportunitiesData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -245,42 +245,42 @@ export default class ContactServiceBase extends EntityService {
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
let masterData:any = {};
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
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.opportunityid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
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) => {
masterData.listcontacts = listcontactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
masterData.opportunities = opportunitiesData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -298,8 +298,8 @@ export default class ContactServiceBase extends EntityService {
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -332,14 +332,14 @@ 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+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
let res:any = await Http.getInstance().get(`/contacts/${context.contact}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -357,15 +357,15 @@ 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+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
let res:any = await Http.getInstance().get(`/contacts/getdraft`,isloading);
res.data.contact = data.contact;
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -382,36 +382,36 @@ export default class ContactServiceBase extends EntityService {
public async Active(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let masterData:any = {};
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
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.opportunityid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
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) => {
masterData.listcontacts = listcontactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
masterData.opportunities = opportunitiesData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -429,8 +429,8 @@ export default class ContactServiceBase extends EntityService {
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -449,36 +449,36 @@ 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 opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
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.opportunityid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
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) => {
masterData.listcontacts = listcontactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
masterData.opportunities = opportunitiesData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -496,8 +496,8 @@ export default class ContactServiceBase extends EntityService {
masterData.leads = leadsData;
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+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -516,36 +516,36 @@ 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 opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
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.opportunityid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
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) => {
masterData.listcontacts = listcontactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
masterData.opportunities = opportunitiesData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -563,8 +563,8 @@ export default class ContactServiceBase extends EntityService {
masterData.leads = leadsData;
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+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -583,36 +583,36 @@ export default class ContactServiceBase extends EntityService {
public async Inactive(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let masterData:any = {};
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
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.opportunityid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
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) => {
masterData.listcontacts = listcontactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
masterData.opportunities = opportunitiesData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -630,8 +630,8 @@ export default class ContactServiceBase extends EntityService {
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/inactive`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -650,36 +650,36 @@ 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 opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
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.opportunityid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
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) => {
masterData.listcontacts = listcontactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
masterData.opportunities = opportunitiesData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -697,42 +697,42 @@ export default class ContactServiceBase extends EntityService {
masterData.leads = leadsData;
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+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
let masterData:any = {};
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
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.opportunityid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
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) => {
masterData.listcontacts = listcontactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
masterData.opportunities = opportunitiesData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -750,8 +750,8 @@ export default class ContactServiceBase extends EntityService {
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -768,36 +768,36 @@ 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 opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
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.opportunityid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
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) => {
masterData.listcontacts = listcontactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
masterData.opportunities = opportunitiesData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -815,8 +815,8 @@ export default class ContactServiceBase extends EntityService {
masterData.leads = leadsData;
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+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......
......@@ -62,11 +62,11 @@ export default class IBizListServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -76,12 +76,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;
......@@ -91,12 +91,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 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;
......@@ -106,12 +106,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listaccounts = listaccountsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
masterData.campaignlists = campaignlistsData;
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;
......@@ -121,7 +121,7 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -131,10 +131,10 @@ export default class IBizListServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/ibizlists`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
......@@ -149,11 +149,11 @@ export default class IBizListServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -163,12 +163,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;
......@@ -178,12 +178,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 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;
......@@ -193,12 +193,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listaccounts = listaccountsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
masterData.campaignlists = campaignlistsData;
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;
......@@ -208,13 +208,13 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/ibizlists/${context.ibizlist}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
......@@ -242,10 +242,10 @@ export default class IBizListServiceBase extends EntityService {
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/ibizlists/${context.ibizlist}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
......@@ -261,10 +261,10 @@ export default class IBizListServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/ibizlists/getdraft`,isloading);
res.data.ibizlist = data.ibizlist;
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
......@@ -292,11 +292,11 @@ export default class IBizListServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -306,12 +306,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;
......@@ -321,12 +321,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 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;
......@@ -336,12 +336,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listaccounts = listaccountsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
masterData.campaignlists = campaignlistsData;
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;
......@@ -351,13 +351,13 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
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+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
......
......@@ -69,21 +69,6 @@ export default class OpportunityServiceBase extends EntityService {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && true){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -114,22 +99,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
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/${context.contact}/opportunities`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && true){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
......@@ -145,6 +114,22 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.contact && true){
let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -175,21 +160,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
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(`/contacts/${context.contact}/opportunities`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
......@@ -205,6 +175,21 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -235,6 +220,21 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -244,9 +244,9 @@ export default class OpportunityServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/opportunities`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
......@@ -262,21 +262,6 @@ export default class OpportunityServiceBase extends EntityService {
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -307,15 +292,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
......@@ -331,6 +307,15 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -361,14 +346,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
......@@ -384,6 +361,14 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -414,11 +399,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
......@@ -453,22 +453,22 @@ export default class OpportunityServiceBase extends EntityService {
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.contact && context.opportunity){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
let res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
......@@ -485,24 +485,24 @@ export default class OpportunityServiceBase extends EntityService {
if(context.account && context.contact && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/getdraft`,isloading);
res.data.opportunity = data.opportunity;
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.contact && true){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/getdraft`,isloading);
res.data.opportunity = data.opportunity;
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
let res:any = await Http.getInstance().get(`/opportunities/getdraft`,isloading);
res.data.opportunity = data.opportunity;
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
......@@ -518,21 +518,6 @@ export default class OpportunityServiceBase extends EntityService {
public async Active(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -563,15 +548,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
......@@ -587,6 +563,15 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -617,11 +602,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
return Http.getInstance().post(`/opportunities/${context.opportunity}/active`,data,isloading);
......@@ -639,21 +639,6 @@ export default class OpportunityServiceBase extends EntityService {
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -684,15 +669,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
......@@ -708,6 +684,15 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -738,11 +723,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
return Http.getInstance().post(`/opportunities/${context.opportunity}/checkkey`,data,isloading);
......@@ -760,21 +760,6 @@ export default class OpportunityServiceBase extends EntityService {
public async Lose(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -805,15 +790,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/lose`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
......@@ -829,6 +805,15 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/lose`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -859,11 +844,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/lose`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
return Http.getInstance().post(`/opportunities/${context.opportunity}/lose`,data,isloading);
......@@ -881,21 +881,6 @@ export default class OpportunityServiceBase extends EntityService {
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -926,15 +911,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
......@@ -950,6 +926,15 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -980,14 +965,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
......@@ -1003,6 +980,14 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -1033,11 +1018,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
......@@ -1053,21 +1053,6 @@ export default class OpportunityServiceBase extends EntityService {
public async Win(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -1098,15 +1083,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/win`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
......@@ -1122,6 +1098,15 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/win`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -1152,11 +1137,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/win`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
return Http.getInstance().post(`/opportunities/${context.opportunity}/win`,data,isloading);
......
......@@ -62,21 +62,21 @@ 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) => {
let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
if(productsalesliteraturesData && productsalesliteraturesData.length && productsalesliteraturesData.length > 0){
productsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesliteratureitemid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesliteratureitems = salesliteratureitemsData;
masterData.productsalesliteratures = productsalesliteraturesData;
let competitorsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures'),'undefined')){
competitorsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures') as any);
......@@ -92,21 +92,21 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
if(productsalesliteraturesData && productsalesliteraturesData.length && productsalesliteraturesData.length > 0){
productsalesliteraturesData.forEach((item: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.relationshipsid = null;
item.salesliteratureitemid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productsalesliteratures = productsalesliteraturesData;
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));
this.tempStorage.setItem(tempContext.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(tempContext.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
return res;
}
......@@ -133,21 +133,21 @@ 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) => {
let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
if(productsalesliteraturesData && productsalesliteraturesData.length && productsalesliteraturesData.length > 0){
productsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesliteratureitemid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesliteratureitems = salesliteratureitemsData;
masterData.productsalesliteratures = productsalesliteraturesData;
let competitorsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures'),'undefined')){
competitorsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures') as any);
......@@ -163,26 +163,26 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
if(productsalesliteraturesData && productsalesliteraturesData.length && productsalesliteraturesData.length > 0){
productsalesliteraturesData.forEach((item: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.relationshipsid = null;
item.salesliteratureitemid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productsalesliteratures = productsalesliteraturesData;
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));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(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));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(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));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
return res;
}
......@@ -258,21 +258,21 @@ 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) => {
let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
if(productsalesliteraturesData && productsalesliteraturesData.length && productsalesliteraturesData.length > 0){
productsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesliteratureitemid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesliteratureitems = salesliteratureitemsData;
masterData.productsalesliteratures = productsalesliteraturesData;
let competitorsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures'),'undefined')){
competitorsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures') as any);
......@@ -288,26 +288,26 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
if(productsalesliteraturesData && productsalesliteraturesData.length && productsalesliteraturesData.length > 0){
productsalesliteraturesData.forEach((item: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.relationshipsid = null;
item.salesliteratureitemid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productsalesliteratures = productsalesliteraturesData;
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));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
return res;
}
......
......@@ -431,6 +431,16 @@ export const viewstate: any = {
'44a690a1d62a390708480cb43f67d98b',
],
},
{
viewtag: '2f0540af5db76052cee0e8e91f0204c4',
viewmodule: 'Sales',
viewname: 'GoalStateTabView',
viewaction: '',
viewdatachange: false,
refviews: [
'631a4276161c551802f3aaf4bd7e607c',
],
},
{
viewtag: '30458f00562fda145be535e56948b067',
viewmodule: 'Marketing',
......@@ -1093,6 +1103,7 @@ export const viewstate: any = {
'b38bc0256ecd5be1a58a3c2210a98d05',
'5f8f689d5dccc3db6d2b74a24a8b24ef',
'dfc0051ae4813115e03f3d095f8cd7d3',
'2f0540af5db76052cee0e8e91f0204c4',
'631a4276161c551802f3aaf4bd7e607c',
'15d12c1173fcb6e742b6a6d92cbc53ed',
'0326a502bb574cddc41da4323786dcb5',
......
......@@ -81,6 +81,7 @@ export default class GoalUIServiceBase extends UIService {
public initViewMap(){
this.allViewMap.set('PICKUPVIEW:',{viewname:'pickupview',srfappde:'goals'});
this.allViewMap.set(':',{viewname:'pickupgridview',srfappde:'goals'});
this.allViewMap.set(':',{viewname:'statetabview',srfappde:'goals'});
this.allViewMap.set(':',{viewname:'info_goalview',srfappde:'goals'});
this.allViewMap.set(':',{viewname:'infoview',srfappde:'goals'});
this.allViewMap.set('MDATAVIEW:',{viewname:'gridview',srfappde:'goals'});
......
......@@ -30,12 +30,14 @@ export class CentralBase extends Vue {
this.clickAuto3(item); break;
case 'Auto6':
this.clickAuto6(item); break;
case '_2':
this.click_2(item); break;
case '_3':
this.click_3(item); break;
case 'Auto15':
this.clickAuto15(item); break;
case 'Auto11':
this.clickAuto11(item); break;
case '_2':
this.click_2(item); break;
case 'Auto14':
this.clickAuto14(item); break;
case 'Auto10':
......@@ -227,7 +229,7 @@ export class CentralBase extends Vue {
* @param {*} [item={}]
* @memberof Central
*/
public click_2(item: any = {}) {
public click_3(item: any = {}) {
const viewparam: any = {};
Object.assign(viewparam, {});
const deResParameters: any[] = [];
......@@ -290,6 +292,29 @@ export class CentralBase extends Vue {
})
}
/**
* 目标分页状态
*
* @param {*} [item={}]
* @memberof Central
*/
public click_2(item: any = {}) {
const viewparam: any = {};
Object.assign(viewparam, {});
const deResParameters: any[] = [];
const parameters: any[] = [
{ pathName: 'goals', parameterName: 'goal' },
{ pathName: 'statetabview', parameterName: 'statetabview' },
];
const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam);
if(Object.is(this.$route.fullPath,path)){
return;
}
this.$nextTick(function(){
this.$router.push(path);
})
}
/**
* 潜在客户管理
*
......
......@@ -639,7 +639,7 @@ export default class CentralModel {
iconcls: 'fa fa-line-chart',
icon: '',
textcls: '',
appfunctag: '_2',
appfunctag: '_3',
appfuncyype: 'APPVIEW',
viewname: 'metric-grid-view',
resourcetag: '',
......@@ -663,6 +663,27 @@ export default class CentralModel {
appfunctag: '',
resourcetag: '',
}
,
{
id: '9865490D-A150-450A-9695-3F4610E9A5BE',
name: 'menuitem33',
text: '目标分页',
type: 'MENUITEM',
counterid: '',
tooltip: '目标分页',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '_2',
appfuncyype: 'APPVIEW',
viewname: 'goal-state-tab-view',
resourcetag: '',
}
,
],
}
......@@ -902,7 +923,7 @@ export default class CentralModel {
],
},
{
appfunctag: '_2',
appfunctag: '_3',
appfuncyype: 'APPVIEW',
openmode: '',
codename: 'metricgridview',
......@@ -937,6 +958,18 @@ export default class CentralModel {
{ pathName: 'gridview', parameterName: 'gridview' },
],
},
{
appfunctag: '_2',
appfuncyype: 'APPVIEW',
openmode: '',
codename: 'goalstatetabview',
deResParameters: [],
routepath: '/central/:central?/goals/:goal?/statetabview/:statetabview?',
parameters: [
{ pathName: 'goals', parameterName: 'goal' },
{ pathName: 'statetabview', parameterName: 'statetabview' },
],
},
{
appfunctag: 'Auto14',
appfuncyype: 'APPVIEW',
......
import { Prop, Provide, Emit, Model } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs';
import { Watch, TabExpPanelControlBase } from '@/studio-core';
import GoalService from '@/service/goal/goal-service';
import StateTabViewtabexppanelService from './state-tab-viewtabexppanel-tabexppanel-service';
/**
* tabexppanel部件基类
*
* @export
* @class TabExpPanelControlBase
* @extends {StateTabViewtabexppanelTabexppanelBase}
*/
export class StateTabViewtabexppanelTabexppanelBase extends TabExpPanelControlBase {
/**
* 建构部件服务对象
*
* @type {StateTabViewtabexppanelService}
* @memberof StateTabViewtabexppanelTabexppanelBase
*/
public service: StateTabViewtabexppanelService = new StateTabViewtabexppanelService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {GoalService}
* @memberof StateTabViewtabexppanelTabexppanelBase
*/
public appEntityService: GoalService = new GoalService({ $store: this.$store });
/**
* 应用实体名称
*
* @protected
* @type {string}
* @memberof StateTabViewtabexppanelTabexppanelBase
*/
protected appDeName: string = 'goal';
/**
* 是否初始化
*
* @protected
* @returns {any}
* @memberof StateTabViewtabexppanel
*/
protected isInit: any = {
tabviewpanel: true ,
tabviewpanel2: false ,
}
/**
* 被激活的分页面板
*
* @protected
* @type {string}
* @memberof StateTabViewtabexppanel
*/
protected activatedTabViewPanel: string = 'tabviewpanel';
/**
* 组件创建完毕
*
* @protected
* @memberof StateTabViewtabexppanel
*/
protected ctrlCreated(): void {
//设置分页导航srfparentdename和srfparentkey
if (this.context.goal) {
Object.assign(this.context, { srfparentdename: 'Goal', srfparentkey: this.context.goal });
}
super.ctrlCreated();
}
}
\ No newline at end of file
/**
* StateTabViewtabexppanel 部件模型
*
* @export
* @class StateTabViewtabexppanelModel
*/
export default class StateTabViewtabexppanelModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof StateTabViewtabexppanelModel
*/
public getDataItems(): any[] {
return [
{
name: 'inprogressdecimal',
},
{
name: 'goal',
prop: 'goalid',
},
{
name: 'stretchtargetmoney',
},
{
name: 'actualdecimal',
},
{
name: 'computedtargetasoftodayinteger',
},
{
name: 'timezoneruleversionnumber',
},
{
name: 'exchangerate',
},
{
name: 'entityimageid',
},
{
name: 'targetinteger',
},
{
name: 'customrollupfieldmoney_base',
},
{
name: 'entityimage_url',
},
{
name: 'actualmoney_base',
},
{
name: 'utcconversiontimezonecode',
},
{
name: 'inprogressinteger',
},
{
name: 'statecode',
},
{
name: 'targetmoney_base',
},
{
name: 'inprogressstring',
},
{
name: 'entityimage_timestamp',
},
{
name: 'goalstartdate',
},
{
name: 'percentage',
},
{
name: 'ownerid',
},
{
name: 'goalowneridyominame',
},
{
name: 'targetdecimal',
},
{
name: 'amount',
},
{
name: 'statuscode',
},
{
name: 'amountdatatype',
},
{
name: 'customrollupfieldinteger',
},
{
name: 'owneridtype',
},
{
name: 'updatedate',
},
{
name: 'inprogressmoney',
},
{
name: 'fiscalyear',
},
{
name: 'fiscalperiod',
},
{
name: 'title',
},
{
name: 'stretchtargetdecimal',
},
{
name: 'customrollupfielddecimal',
},
{
name: 'consideronlygoalownersrecords',
},
{
name: 'overriddencreatedon',
},
{
name: 'actualmoney',
},
{
name: 'rolluponlyfromchildgoals',
},
{
name: 'goalenddate',
},
{
name: 'createdate',
},
{
name: 'customrollupfieldmoney',
},
{
name: 'rolluperrorcode',
},
{
name: 'versionnumber',
},
{
name: 'stretchtargetmoney_base',
},
{
name: 'treeid',
},
{
name: 'entityimage',
},
{
name: 'stretchtargetstring',
},
{
name: 'stretchtargetinteger',
},
{
name: 'fiscalperiodgoal',
},
{
name: 'inprogressmoney_base',
},
{
name: 'overridden',
},
{
name: 'actualstring',
},
{
name: 'actualinteger',
},
{
name: 'goalowneridtype',
},
{
name: 'importsequencenumber',
},
{
name: 'goalownerid',
},
{
name: 'computedtargetasoftodaydecimal',
},
{
name: 'createman',
},
{
name: 'targetstring',
},
{
name: 'customrollupfieldstring',
},
{
name: 'targetmoney',
},
{
name: 'lastrolledupdate',
},
{
name: 'updateman',
},
{
name: 'override',
},
{
name: 'computedtargetasoftodaymoney',
},
{
name: 'owneridyominame',
},
{
name: 'parentgoalid',
},
{
name: 'rollupqueryinprogressmoneyid',
},
{
name: 'rollupquerycustommoneyid',
},
{
name: 'rollupqueryinprogressintegerid',
},
{
name: 'rollupquerycustomdecimalid',
},
{
name: 'rollupqueryactualmoneyid',
},
{
name: 'rollupquerycustomintegerid',
},
{
name: 'goalwitherrorid',
},
{
name: 'metricid',
},
{
name: 'rollupqueryinprogressdecimalid',
},
{
name: 'rollupqueryactualintegerid',
},
{
name: 'rollupqueryactualdecimalid',
},
{
name: 'parentgoalname',
},
{
name: 'metricname',
},
]
}
}
\ No newline at end of file
import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import GoalService from '@/service/goal/goal-service';
import StateTabViewtabexppanelModel from './state-tab-viewtabexppanel-tabexppanel-model';
/**
* StateTabViewtabexppanel 部件服务对象
*
* @export
* @class StateTabViewtabexppanelService
*/
export default class StateTabViewtabexppanelService extends ControlService {
/**
* 目标服务对象
*
* @type {GoalService}
* @memberof StateTabViewtabexppanelService
*/
public appEntityService: GoalService = new GoalService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof StateTabViewtabexppanelService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of StateTabViewtabexppanelService.
*
* @param {*} [opts={}]
* @memberof StateTabViewtabexppanelService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new StateTabViewtabexppanelModel();
}
}
\ No newline at end of file
<div class='tabviewpanel'>
<tabs :value="activatedTabViewPanel" :animated="false" class='tabexppanel' name='statetabviewtabexppanel' @on-click="tabPanelClick($event)">
<tab-pane :index="0" name='tabviewpanel' tab='statetabviewtabexppanel' class=''
:label="(h) =>{
return h('div', [
h('span', '全部目标'),
h('Badge', {
props: {
count: undefined,
type: 'primary'
}
})
])
}" >
<view_tabviewpanel
:viewState="viewState"
:viewparams="JSON.parse(JSON.stringify(viewparams))"
:context="JSON.parse(JSON.stringify(context))"
v-if="isInit.tabviewpanel"
name="tabviewpanel"
ref='tabviewpanel'
:expActive="activatedTabViewPanel === 'tabviewpanel'"
@viewpanelDatasChange = "tabViewPanelDatasChange"
@closeview="closeView($event)">
</view_tabviewpanel>
</tab-pane>
<tab-pane :index="1" name='tabviewpanel2' tab='statetabviewtabexppanel' class=''
:label="(h) =>{
return h('div', [
h('span', '我的目标'),
h('Badge', {
props: {
count: undefined,
type: 'primary'
}
})
])
}" >
<view_tabviewpanel2
:viewState="viewState"
:viewparams="JSON.parse(JSON.stringify(viewparams))"
:context="JSON.parse(JSON.stringify(context))"
v-if="isInit.tabviewpanel2"
name="tabviewpanel2"
ref='tabviewpanel2'
:expActive="activatedTabViewPanel === 'tabviewpanel2'"
@viewpanelDatasChange = "tabViewPanelDatasChange"
@closeview="closeView($event)">
</view_tabviewpanel2>
</tab-pane>
</tabs>
</div>
\ No newline at end of file
<template src="./state-tab-viewtabexppanel-tabexppanel.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { StateTabViewtabexppanelTabexppanelBase } from './state-tab-viewtabexppanel-tabexppanel-base';
import view_tabviewpanel from '@widgets/goal/state-tab-viewtabviewpanel-tabviewpanel/state-tab-viewtabviewpanel-tabviewpanel.vue';
import view_tabviewpanel2 from '@widgets/goal/state-tab-viewtabviewpanel2-tabviewpanel/state-tab-viewtabviewpanel2-tabviewpanel.vue';
/**
* tabexppanel部件
*
* @export
* @class StateTabViewtabexppanelTabexppanel
* @extends {StateTabViewtabexppanelTabexppanelBase}
*/
@Component({
components: {
view_tabviewpanel,
view_tabviewpanel2,
}
})
@VueLifeCycleProcessing()
export default class StateTabViewtabexppanelTabexppanel extends StateTabViewtabexppanelTabexppanelBase { }
</script>
import { Prop, Provide, Emit, Model } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs';
import { Watch, MainControlBase } from '@/studio-core';
import GoalService from '@/service/goal/goal-service';
import StateTabViewtabviewpanelService from './state-tab-viewtabviewpanel-tabviewpanel-service';
/**
* tabviewpanel部件基类
*
* @export
* @class MainControlBase
* @extends {StateTabViewtabviewpanelTabviewpanelBase}
*/
export class StateTabViewtabviewpanelTabviewpanelBase extends MainControlBase {
/**
* 建构部件服务对象
*
* @type {StateTabViewtabviewpanelService}
* @memberof StateTabViewtabviewpanelTabviewpanelBase
*/
public service: StateTabViewtabviewpanelService = new StateTabViewtabviewpanelService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {GoalService}
* @memberof StateTabViewtabviewpanelTabviewpanelBase
*/
public appEntityService: GoalService = new GoalService({ $store: this.$store });
/**
* 应用实体名称
*
* @protected
* @type {string}
* @memberof StateTabViewtabviewpanelTabviewpanelBase
*/
protected appDeName: string = 'goal';
/**
* 导航模式下项是否激活
*
* @type {*}
* @memberof StateTabViewtabviewpanel
*/
@Prop()
public expActive!: any;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof StateTabViewtabviewpanel
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof StateTabViewtabviewpanel
*/
public getData(): any {
return null;
}
/**
* 是否被激活
*
* @type {boolean}
* @memberof StateTabViewtabviewpanel
*/
public isActivied: boolean = true;
/**
* 局部上下文
*
* @type {*}
* @memberof StateTabViewtabviewpanel
*/
public localContext: any = null;
/**
* 局部视图参数
*
* @type {*}
* @memberof StateTabViewtabviewpanel
*/
public localViewParam: any = null;
/**
* 传入上下文
*
* @type {string}
* @memberof TabExpViewtabviewpanel
*/
public viewdata: string = JSON.stringify(this.context);
/**
* 传入视图参数
*
* @type {string}
* @memberof PickupViewpickupviewpanel
*/
public viewparam: string = JSON.stringify(this.viewparams);
/**
* 视图面板过滤项
*
* @type {string}
* @memberof StateTabViewtabviewpanel
*/
public navfilter: string = "";
/**
* vue 生命周期
*
* @returns
* @memberof StateTabViewtabviewpanel
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof StateTabViewtabviewpanel
*/
public afterCreated(){
this.initNavParam();
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
this.$forceUpdate();
this.initNavParam();
});
}
}
/**
* 初始化导航参数
*
* @memberof StateTabViewtabviewpanel
*/
public initNavParam(){
if(!Object.is(this.navfilter,"")){
Object.assign(this.viewparams,{[this.navfilter]:this.context['majorentity']})
}
if(this.localContext && Object.keys(this.localContext).length >0){
let _context:any = this.$util.computedNavData({},this.context,this.viewparams,this.localContext);
Object.assign(this.context,_context);
}
if(this.localViewParam && Object.keys(this.localViewParam).length >0){
let _param:any = this.$util.computedNavData({},this.context,this.viewparams,this.localViewParam);
Object.assign(this.viewparams,_param);
}
this.viewdata =JSON.stringify(this.context);
this.viewparam = JSON.stringify(this.viewparams);
}
/**
* 视图数据变化
*
* @memberof StateTabViewtabviewpanel
*/
public viewDatasChange($event:any){
this.$emit('viewpanelDatasChange',$event);
}
/**
* vue 生命周期
*
* @memberof StateTabViewtabviewpanel
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof StateTabViewtabviewpanel
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
}
\ No newline at end of file
/**
* StateTabViewtabviewpanel 部件模型
*
* @export
* @class StateTabViewtabviewpanelModel
*/
export default class StateTabViewtabviewpanelModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof StateTabViewtabviewpanelModel
*/
public getDataItems(): any[] {
return [
{
name: 'inprogressdecimal',
},
{
name: 'goal',
prop: 'goalid',
},
{
name: 'stretchtargetmoney',
},
{
name: 'actualdecimal',
},
{
name: 'computedtargetasoftodayinteger',
},
{
name: 'timezoneruleversionnumber',
},
{
name: 'exchangerate',
},
{
name: 'entityimageid',
},
{
name: 'targetinteger',
},
{
name: 'customrollupfieldmoney_base',
},
{
name: 'entityimage_url',
},
{
name: 'actualmoney_base',
},
{
name: 'utcconversiontimezonecode',
},
{
name: 'inprogressinteger',
},
{
name: 'statecode',
},
{
name: 'targetmoney_base',
},
{
name: 'inprogressstring',
},
{
name: 'entityimage_timestamp',
},
{
name: 'goalstartdate',
},
{
name: 'percentage',
},
{
name: 'ownerid',
},
{
name: 'goalowneridyominame',
},
{
name: 'targetdecimal',
},
{
name: 'amount',
},
{
name: 'statuscode',
},
{
name: 'amountdatatype',
},
{
name: 'customrollupfieldinteger',
},
{
name: 'owneridtype',
},
{
name: 'updatedate',
},
{
name: 'inprogressmoney',
},
{
name: 'fiscalyear',
},
{
name: 'fiscalperiod',
},
{
name: 'title',
},
{
name: 'stretchtargetdecimal',
},
{
name: 'customrollupfielddecimal',
},
{
name: 'consideronlygoalownersrecords',
},
{
name: 'overriddencreatedon',
},
{
name: 'actualmoney',
},
{
name: 'rolluponlyfromchildgoals',
},
{
name: 'goalenddate',
},
{
name: 'createdate',
},
{
name: 'customrollupfieldmoney',
},
{
name: 'rolluperrorcode',
},
{
name: 'versionnumber',
},
{
name: 'stretchtargetmoney_base',
},
{
name: 'treeid',
},
{
name: 'entityimage',
},
{
name: 'stretchtargetstring',
},
{
name: 'stretchtargetinteger',
},
{
name: 'fiscalperiodgoal',
},
{
name: 'inprogressmoney_base',
},
{
name: 'overridden',
},
{
name: 'actualstring',
},
{
name: 'actualinteger',
},
{
name: 'goalowneridtype',
},
{
name: 'importsequencenumber',
},
{
name: 'goalownerid',
},
{
name: 'computedtargetasoftodaydecimal',
},
{
name: 'createman',
},
{
name: 'targetstring',
},
{
name: 'customrollupfieldstring',
},
{
name: 'targetmoney',
},
{
name: 'lastrolledupdate',
},
{
name: 'updateman',
},
{
name: 'override',
},
{
name: 'computedtargetasoftodaymoney',
},
{
name: 'owneridyominame',
},
{
name: 'parentgoalid',
},
{
name: 'rollupqueryinprogressmoneyid',
},
{
name: 'rollupquerycustommoneyid',
},
{
name: 'rollupqueryinprogressintegerid',
},
{
name: 'rollupquerycustomdecimalid',
},
{
name: 'rollupqueryactualmoneyid',
},
{
name: 'rollupquerycustomintegerid',
},
{
name: 'goalwitherrorid',
},
{
name: 'metricid',
},
{
name: 'rollupqueryinprogressdecimalid',
},
{
name: 'rollupqueryactualintegerid',
},
{
name: 'rollupqueryactualdecimalid',
},
{
name: 'parentgoalname',
},
{
name: 'metricname',
},
]
}
}
\ No newline at end of file
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* StateTabViewtabviewpanel 部件服务对象
*
* @export
* @class StateTabViewtabviewpanelService
*/
export default class StateTabViewtabviewpanelService extends ControlService {
}
\ No newline at end of file
<div class='tabviewpanel' v-if='isActivied'>
<goal-grid-view
class='viewcontainer2'
:viewdata="viewdata"
:viewparam="viewparam"
@viewload="viewDatasChange($event)"
:viewDefaultUsage="false"
:viewUsage="7"
:expActive="expActive"
/>
</div>
\ No newline at end of file
<template src="./state-tab-viewtabviewpanel-tabviewpanel.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { StateTabViewtabviewpanelTabviewpanelBase } from './state-tab-viewtabviewpanel-tabviewpanel-base';
/**
* tabviewpanel部件
*
* @export
* @class StateTabViewtabviewpanelTabviewpanel
* @extends {StateTabViewtabviewpanelTabviewpanelBase}
*/
@Component({
components: {
}
})
@VueLifeCycleProcessing()
export default class StateTabViewtabviewpanelTabviewpanel extends StateTabViewtabviewpanelTabviewpanelBase { }
</script>
import { Prop, Provide, Emit, Model } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs';
import { Watch, MainControlBase } from '@/studio-core';
import GoalService from '@/service/goal/goal-service';
import StateTabViewtabviewpanel2Service from './state-tab-viewtabviewpanel2-tabviewpanel-service';
/**
* tabviewpanel2部件基类
*
* @export
* @class MainControlBase
* @extends {StateTabViewtabviewpanel2TabviewpanelBase}
*/
export class StateTabViewtabviewpanel2TabviewpanelBase extends MainControlBase {
/**
* 建构部件服务对象
*
* @type {StateTabViewtabviewpanel2Service}
* @memberof StateTabViewtabviewpanel2TabviewpanelBase
*/
public service: StateTabViewtabviewpanel2Service = new StateTabViewtabviewpanel2Service({ $store: this.$store });
/**
* 实体服务对象
*
* @type {GoalService}
* @memberof StateTabViewtabviewpanel2TabviewpanelBase
*/
public appEntityService: GoalService = new GoalService({ $store: this.$store });
/**
* 应用实体名称
*
* @protected
* @type {string}
* @memberof StateTabViewtabviewpanel2TabviewpanelBase
*/
protected appDeName: string = 'goal';
/**
* 导航模式下项是否激活
*
* @type {*}
* @memberof StateTabViewtabviewpanel2
*/
@Prop()
public expActive!: any;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof StateTabViewtabviewpanel2
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof StateTabViewtabviewpanel2
*/
public getData(): any {
return null;
}
/**
* 是否被激活
*
* @type {boolean}
* @memberof StateTabViewtabviewpanel2
*/
public isActivied: boolean = true;
/**
* 局部上下文
*
* @type {*}
* @memberof StateTabViewtabviewpanel2
*/
public localContext: any = null;
/**
* 局部视图参数
*
* @type {*}
* @memberof StateTabViewtabviewpanel2
*/
public localViewParam: any = null;
/**
* 传入上下文
*
* @type {string}
* @memberof TabExpViewtabviewpanel
*/
public viewdata: string = JSON.stringify(this.context);
/**
* 传入视图参数
*
* @type {string}
* @memberof PickupViewpickupviewpanel
*/
public viewparam: string = JSON.stringify(this.viewparams);
/**
* 视图面板过滤项
*
* @type {string}
* @memberof StateTabViewtabviewpanel2
*/
public navfilter: string = "";
/**
* vue 生命周期
*
* @returns
* @memberof StateTabViewtabviewpanel2
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof StateTabViewtabviewpanel2
*/
public afterCreated(){
this.initNavParam();
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
this.$forceUpdate();
this.initNavParam();
});
}
}
/**
* 初始化导航参数
*
* @memberof StateTabViewtabviewpanel2
*/
public initNavParam(){
if(!Object.is(this.navfilter,"")){
Object.assign(this.viewparams,{[this.navfilter]:this.context['majorentity']})
}
if(this.localContext && Object.keys(this.localContext).length >0){
let _context:any = this.$util.computedNavData({},this.context,this.viewparams,this.localContext);
Object.assign(this.context,_context);
}
if(this.localViewParam && Object.keys(this.localViewParam).length >0){
let _param:any = this.$util.computedNavData({},this.context,this.viewparams,this.localViewParam);
Object.assign(this.viewparams,_param);
}
this.viewdata =JSON.stringify(this.context);
this.viewparam = JSON.stringify(this.viewparams);
}
/**
* 视图数据变化
*
* @memberof StateTabViewtabviewpanel2
*/
public viewDatasChange($event:any){
this.$emit('viewpanelDatasChange',$event);
}
/**
* vue 生命周期
*
* @memberof StateTabViewtabviewpanel2
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof StateTabViewtabviewpanel2
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
}
\ No newline at end of file
/**
* StateTabViewtabviewpanel2 部件模型
*
* @export
* @class StateTabViewtabviewpanel2Model
*/
export default class StateTabViewtabviewpanel2Model {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof StateTabViewtabviewpanel2Model
*/
public getDataItems(): any[] {
return [
{
name: 'inprogressdecimal',
},
{
name: 'goal',
prop: 'goalid',
},
{
name: 'stretchtargetmoney',
},
{
name: 'actualdecimal',
},
{
name: 'computedtargetasoftodayinteger',
},
{
name: 'timezoneruleversionnumber',
},
{
name: 'exchangerate',
},
{
name: 'entityimageid',
},
{
name: 'targetinteger',
},
{
name: 'customrollupfieldmoney_base',
},
{
name: 'entityimage_url',
},
{
name: 'actualmoney_base',
},
{
name: 'utcconversiontimezonecode',
},
{
name: 'inprogressinteger',
},
{
name: 'statecode',
},
{
name: 'targetmoney_base',
},
{
name: 'inprogressstring',
},
{
name: 'entityimage_timestamp',
},
{
name: 'goalstartdate',
},
{
name: 'percentage',
},
{
name: 'ownerid',
},
{
name: 'goalowneridyominame',
},
{
name: 'targetdecimal',
},
{
name: 'amount',
},
{
name: 'statuscode',
},
{
name: 'amountdatatype',
},
{
name: 'customrollupfieldinteger',
},
{
name: 'owneridtype',
},
{
name: 'updatedate',
},
{
name: 'inprogressmoney',
},
{
name: 'fiscalyear',
},
{
name: 'fiscalperiod',
},
{
name: 'title',
},
{
name: 'stretchtargetdecimal',
},
{
name: 'customrollupfielddecimal',
},
{
name: 'consideronlygoalownersrecords',
},
{
name: 'overriddencreatedon',
},
{
name: 'actualmoney',
},
{
name: 'rolluponlyfromchildgoals',
},
{
name: 'goalenddate',
},
{
name: 'createdate',
},
{
name: 'customrollupfieldmoney',
},
{
name: 'rolluperrorcode',
},
{
name: 'versionnumber',
},
{
name: 'stretchtargetmoney_base',
},
{
name: 'treeid',
},
{
name: 'entityimage',
},
{
name: 'stretchtargetstring',
},
{
name: 'stretchtargetinteger',
},
{
name: 'fiscalperiodgoal',
},
{
name: 'inprogressmoney_base',
},
{
name: 'overridden',
},
{
name: 'actualstring',
},
{
name: 'actualinteger',
},
{
name: 'goalowneridtype',
},
{
name: 'importsequencenumber',
},
{
name: 'goalownerid',
},
{
name: 'computedtargetasoftodaydecimal',
},
{
name: 'createman',
},
{
name: 'targetstring',
},
{
name: 'customrollupfieldstring',
},
{
name: 'targetmoney',
},
{
name: 'lastrolledupdate',
},
{
name: 'updateman',
},
{
name: 'override',
},
{
name: 'computedtargetasoftodaymoney',
},
{
name: 'owneridyominame',
},
{
name: 'parentgoalid',
},
{
name: 'rollupqueryinprogressmoneyid',
},
{
name: 'rollupquerycustommoneyid',
},
{
name: 'rollupqueryinprogressintegerid',
},
{
name: 'rollupquerycustomdecimalid',
},
{
name: 'rollupqueryactualmoneyid',
},
{
name: 'rollupquerycustomintegerid',
},
{
name: 'goalwitherrorid',
},
{
name: 'metricid',
},
{
name: 'rollupqueryinprogressdecimalid',
},
{
name: 'rollupqueryactualintegerid',
},
{
name: 'rollupqueryactualdecimalid',
},
{
name: 'parentgoalname',
},
{
name: 'metricname',
},
]
}
}
\ No newline at end of file
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* StateTabViewtabviewpanel2 部件服务对象
*
* @export
* @class StateTabViewtabviewpanel2Service
*/
export default class StateTabViewtabviewpanel2Service extends ControlService {
}
\ No newline at end of file
<div class='tabviewpanel' v-if='isActivied'>
<goal-grid-view
class='viewcontainer2'
:viewdata="viewdata"
:viewparam="viewparam"
@viewload="viewDatasChange($event)"
:viewDefaultUsage="false"
:viewUsage="7"
:expActive="expActive"
/>
</div>
\ No newline at end of file
<template src="./state-tab-viewtabviewpanel2-tabviewpanel.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { StateTabViewtabviewpanel2TabviewpanelBase } from './state-tab-viewtabviewpanel2-tabviewpanel-base';
/**
* tabviewpanel2部件
*
* @export
* @class StateTabViewtabviewpanel2Tabviewpanel
* @extends {StateTabViewtabviewpanel2TabviewpanelBase}
*/
@Component({
components: {
}
})
@VueLifeCycleProcessing()
export default class StateTabViewtabviewpanel2Tabviewpanel extends StateTabViewtabviewpanel2TabviewpanelBase { }
</script>
......@@ -84,7 +84,7 @@ export class QualificationEditFormBase extends EditFormControlBase {
* @memberof QualificationEditFormBase
*/
public detailsModel: any = {
group1: new FormGroupPanelModel({ caption: '潜在顾客基本信息', detailType: 'GROUPPANEL', name: 'group1', visible: true, isShowCaption: true, form: this, uiActionGroup: { caption: '', langbase: 'entities.lead.qualification_form', extractMode: 'ITEM', details: [] } }),
group1: new FormGroupPanelModel({ caption: '潜在顾客基本信息', detailType: 'GROUPPANEL', name: 'group1', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', langbase: 'entities.lead.qualification_form', extractMode: 'ITEM', details: [] } }),
formpage1: new FormPageModel({ caption: '基本信息', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this }),
......
......@@ -3,7 +3,7 @@
<row >
<i-col v-show="detailsModel.group1.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.lead.qualification_form.details.group1')" :isShowCaption="true" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.lead.qualification_form.details.group1')" :isShowCaption="false" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<row>
<i-col v-show="detailsModel.parentcontactname.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='parentcontactname' :itemRules="this.rules.parentcontactname" class='' :caption="$t('entities.lead.qualification_form.details.parentcontactname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.parentcontactname.error" :isEmptyCaption="false" labelPos="LEFT">
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>businesscentral-app</artifactId>
<groupId>cn.ibizlab.businesscentral</groupId>
<version>1.0.0.0</version>
</parent>
<artifactId>businesscentral-app-website</artifactId>
<name>Businesscentral Gateway WebSite</name>
<description>Businesscentral WebSite</description>
<dependencies>
<dependency>
<groupId>cn.ibizlab.businesscentral</groupId>
<artifactId>businesscentral-util</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<properties>
<docker.image.prefix>registry.cn-shanghai.aliyuncs.com/ibizsys</docker.image.prefix>
</properties>
<profiles>
<profile>
<id>website</id>
<build>
<resources>
<resource>
<directory>${basedir}/src/main/webapp</directory>
<!--注意此次必须要放在此目录下才能被访问到 -->
<targetPath>META-INF/resources</targetPath>
<includes>
<include>**/**</include>
</includes>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>**/**</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>exec-yarn-run-install</id>
<phase>prepare-package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>yarn</executable>
<workingDirectory>../../app_WebSite</workingDirectory>
</configuration>
</execution>
<execution>
<id>exec-yarn-run-build</id>
<phase>prepare-package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>yarn</executable>
<arguments>
<argument>build</argument>
</arguments>
<workingDirectory>../../app_WebSite</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<finalName>businesscentral-app-website</finalName>
<jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
<mainClass>cn.ibizlab.businesscentral.website.WebSiteApplication</mainClass>
<outputDirectory>../../</outputDirectory>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.13</version>
<configuration>
<serverId>ibiz-dev</serverId>
<imageName>${docker.image.prefix}/${project.artifactId}:latest</imageName>
<dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>../../</directory>
<include>${project.artifactId}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
FROM openjdk:8-jre-alpine
ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
IBIZ_SLEEP=0 \
JAVA_OPTS=""
CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /businesscentral-app-website.jar
EXPOSE 8080
ADD businesscentral-app-website.jar /businesscentral-app-website.jar
version: "3.2"
services:
businesscentral-app-website:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/businesscentral-app-website:latest
ports:
- "8080:8080"
networks:
- agent_network
deploy:
resources:
limits:
memory: 800M
reservations:
memory: 400M
mode: replicated
replicas: 1
volumes:
- "nfs:/app/file"
volumes:
nfs:
driver: local
driver_opts:
type: "nfs"
o: "addr=172.16.240.109,rw"
device: ":/nfs"
networks:
agent_network:
driver: overlay
attachable: true
package cn.ibizlab.businesscentral.website;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.openfeign.FeignClientsConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import java.util.List;
@Slf4j
@Import({
FeignClientsConfiguration.class
})
@EnableDiscoveryClient
@Configuration
@EnableFeignClients(basePackages = {"cn.ibizlab.businesscentral" })
@EnableZuulProxy
@ComponentScan(basePackages = {"cn.ibizlab.businesscentral.website","cn.ibizlab.businesscentral.util"})
@MapperScan("cn.ibizlab.businesscentral.*.mapper")
@SpringBootApplication(exclude = {
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class,
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class,
})
public class WebSiteApplication extends WebMvcConfigurerAdapter{
public static void main(String[] args) {
SpringApplication.run(WebSiteApplication.class,args);
}
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
super.addArgumentResolvers(argumentResolvers);
argumentResolvers.add(new cn.ibizlab.businesscentral.util.web.SearchContextHandlerMethodArgumentResolver());
}
}
package cn.ibizlab.businesscentral.website.config;
import cn.ibizlab.businesscentral.util.security.AuthenticationEntryPoint;
import cn.ibizlab.businesscentral.util.security.AuthorizationTokenFilter;
import cn.ibizlab.businesscentral.util.service.AuthenticationUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.core.GrantedAuthorityDefaults;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.context.annotation.Profile;
import org.springframework.beans.factory.annotation.Qualifier;
@Profile("website-prod")
@Configuration
@EnableWebSecurity
public class WebSiteSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private AuthenticationEntryPoint unauthorizedHandler;
@Autowired
private AuthenticationUserService userDetailsService;
/**
* 自定义基于JWT的安全过滤器
*/
@Autowired
AuthorizationTokenFilter authenticationTokenFilter;
@Value("${ibiz.auth.path:v7/login}")
private String loginPath;
@Value("${ibiz.auth.logoutpath:v7/logout}")
private String logoutPath;
@Value("${ibiz.file.uploadpath:ibizutil/upload}")
private String uploadpath;
@Value("${ibiz.file.downloadpath:ibizutil/download}")
private String downloadpath;
@Value("${ibiz.file.previewpath:ibizutil/preview}")
private String previewpath;
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth
.userDetailsService(userDetailsService)
.passwordEncoder(passwordEncoderBean());
}
@Bean
GrantedAuthorityDefaults grantedAuthorityDefaults() {
// Remove the ROLE_ prefix
return new GrantedAuthorityDefaults("");
}
@Bean
public PasswordEncoder passwordEncoderBean() {
return new BCryptPasswordEncoder();
}
@Bean
@Override
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
@Override
protected void configure(HttpSecurity httpSecurity) throws Exception {
httpSecurity
// 禁用 CSRF
.csrf().disable()
// 授权异常
.exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and()
// 不创建会话
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
// 过滤请求
.authorizeRequests()
.antMatchers(
HttpMethod.GET,
"/*.html",
"/**/*.html",
"/**/*.css",
"/**/*.js",
"/**/*.ico",
"/**/assets/**",
"/**/css/**",
"/**/fonts/**",
"/**/js/**",
"/**/img/**",
"/"
).permitAll()
//放行登录请求
.antMatchers( HttpMethod.POST,"/"+loginPath).permitAll()
//放行注销请求
.antMatchers( HttpMethod.GET,"/"+logoutPath).permitAll()
// 文件操作
.antMatchers("/"+downloadpath+"/**").permitAll()
.antMatchers("/"+uploadpath).permitAll()
.antMatchers("/"+previewpath+"/**").permitAll()
// 所有请求都需要认证
.anyRequest().authenticated()
// 防止iframe 造成跨域
.and().headers().frameOptions().disable();
httpSecurity
.addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class);
}
}
server:
port: 10324
#Log配置
logging:
level:
cn.ibizlab.businesscentral: info
#zuul网关路由设置
zuul:
routes:
websiteresource:
path: /websiteresources/**
serviceId: ibizbusinesscentral-centralapi
stripPrefix: false
website:
path: /websites/**
serviceId: ibizbusinesscentral-centralapi
stripPrefix: false
websitecontent:
path: /websitecontents/**
serviceId: ibizbusinesscentral-centralapi
stripPrefix: false
websitechannel:
path: /websitechannels/**
serviceId: ibizbusinesscentral-centralapi
stripPrefix: false
sensitive-headers:
- Cookie,Set-Cookie,Authorization
spring:
profiles:
include: sys , website-prod
application:
name: ibizbusinesscentral-website
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
<property name="LOG_PATH" value="logs" />
<property name="LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] %-40.40logger{39} : %msg%n" />
<!-- 彩色日志 -->
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
<!-- 彩色日志格式 -->
<property name="LOG_PATTERN2" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr([${LOG_LEVEL_PATTERN:-%5p}]) %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}" />
<!-- 控制台输出 -->
<appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
<!-- 按照每天生成日志文件 -->
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_PATH}/ibizbusinesscentral-website.%d{yyyy-MM-dd}.log</FileNamePattern>
<!--日志文件保留天数-->
<MaxHistory>30</MaxHistory>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${LOG_PATTERN}</pattern>
</encoder>
<!--日志文件最大的大小-->
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>100MB</MaxFileSize>
</triggeringPolicy>
</appender>
<!-- 日志输出级别 -->
<root level="INFO">
<appender-ref ref="Console" />
<appender-ref ref="file" />
</root>
</configuration>
......@@ -16,6 +16,7 @@
<modules>
<module>businesscentral-app-crm</module>
<module>businesscentral-app-website</module>
</modules>
<dependencies>
......
......@@ -29,6 +29,11 @@
<artifactId>businesscentral-app-crm</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>cn.ibizlab.businesscentral</groupId>
<artifactId>businesscentral-app-website</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<!--由于boot是通过dependency来关联所有子项目,页面和配置等信息都存在与子项目中,
......
spring:
profiles:
include: sys , crm-dev, centralapi-dev, dev
include: sys , crm-dev,website-dev, centralapi-dev, dev
application:
name: ibizbusinesscentral
main:
......
......@@ -2060,7 +2060,7 @@
<!--输出实体[WEBSITERESOURCE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-websiteresource-7-28">
<changeSet author="a_LAB01_e85d8801c" id="tab-websiteresource-9-28">
<createTable tableName="WEBSITERESOURCE">
<column name="WEBSITERESOURCEID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_WEBSITERESOURCE_WEBSITERESO"/>
......@@ -2838,7 +2838,7 @@
<!--输出实体[WEBSITECONTENT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-websitecontent-10-38">
<changeSet author="a_LAB01_e85d8801c" id="tab-websitecontent-12-38">
<createTable tableName="WEBSITECONTENT">
<column name="WEBSITECONTENTID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_WEBSITECONTENT_WEBSITECONTE"/>
......@@ -4456,7 +4456,7 @@
<!--输出实体[GOAL]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-goal-50-56">
<changeSet author="a_LAB01_e85d8801c" id="tab-goal-53-56">
<createTable tableName="GOAL">
<column name="INPROGRESSDECIMAL" remarks="" type="VARCHAR">
</column>
......@@ -5364,7 +5364,7 @@
<!--输出实体[WEBSITECHANNEL]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-websitechannel-12-62">
<changeSet author="a_LAB01_e85d8801c" id="tab-websitechannel-14-62">
<createTable tableName="WEBSITECHANNEL">
<column name="WEBSITECHANNELID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_WEBSITECHANNEL_WEBSITECHANN"/>
......@@ -5638,7 +5638,7 @@
<!--输出实体[WEBSITE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-website-10-65">
<changeSet author="a_LAB01_e85d8801c" id="tab-website-12-65">
<createTable tableName="WEBSITE">
<column name="WEBSITENAME" remarks="" type="VARCHAR(200)">
</column>
......@@ -6589,7 +6589,7 @@
<!--输出实体[LEAD]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-lead-139-79">
<changeSet author="a_LAB01_e85d8801c" id="tab-lead-141-79">
<createTable tableName="LEAD">
<column name="ADDRESS1_FAX" remarks="" type="VARCHAR(50)">
</column>
......@@ -11114,7 +11114,7 @@
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="FAX" constraintName="DER1N_FAX__TRANSACTIONCURRENCY" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[WEBSITERESOURCE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-websiteresource-7-184">
<changeSet author="a_LAB01_e85d8801c" id="fk-websiteresource-9-184">
<addForeignKeyConstraint baseColumnNames="WEBSITEID" baseTableName="WEBSITERESOURCE" constraintName="DER1N_WEBSITERESOURCE_WEBSITE_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="WEBSITEID" referencedTableName="WEBSITE" validate="true"/>
</changeSet>
<!--输出实体[KNOWLEDGEARTICLE]外键关系 -->
......@@ -11187,10 +11187,10 @@
<addForeignKeyConstraint baseColumnNames="BASEUOM" baseTableName="UOM" constraintName="DER1N_UOM__UOM__BASEUOM" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="UOMID" referencedTableName="UOM" validate="true"/>
</changeSet>
<!--输出实体[WEBSITECONTENT]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-websitecontent-10-207">
<changeSet author="a_LAB01_e85d8801c" id="fk-websitecontent-12-207">
<addForeignKeyConstraint baseColumnNames="WEBSITECHANNELID" baseTableName="WEBSITECONTENT" constraintName="DER1N_WEBSITECONTENT_WEBSITECH" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="WEBSITECHANNELID" referencedTableName="WEBSITECHANNEL" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-websitecontent-10-208">
<changeSet author="a_LAB01_e85d8801c" id="fk-websitecontent-12-208">
<addForeignKeyConstraint baseColumnNames="WEBSITEID" baseTableName="WEBSITECONTENT" constraintName="DER1N_WEBSITECONTENT_WEBSITE_W" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="WEBSITEID" referencedTableName="WEBSITE" validate="true"/>
</changeSet>
<!--输出实体[CALENDAR]外键关系 -->
......@@ -11340,16 +11340,16 @@
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="QUEUE" constraintName="DER1N_QUEUE__TRANSACTIONCURREN" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[GOAL]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-goal-50-255">
<changeSet author="a_LAB01_e85d8801c" id="fk-goal-53-255">
<addForeignKeyConstraint baseColumnNames="ROLLUPQUERYACTUALDECIMALID" baseTableName="GOAL" constraintName="DER1N_GOAL__GOALROLLUPQUERY__R" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="GOALROLLUPQUERYID" referencedTableName="GOALROLLUPQUERY" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-goal-50-264">
<changeSet author="a_LAB01_e85d8801c" id="fk-goal-53-264">
<addForeignKeyConstraint baseColumnNames="GOALWITHERRORID" baseTableName="GOAL" constraintName="DER1N_GOAL__GOAL__GOALWITHERRO" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="GOALID" referencedTableName="GOAL" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-goal-50-265">
<changeSet author="a_LAB01_e85d8801c" id="fk-goal-53-265">
<addForeignKeyConstraint baseColumnNames="PARENTGOALID" baseTableName="GOAL" constraintName="DER1N_GOAL__GOAL__PARENTGOALID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="GOALID" referencedTableName="GOAL" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-goal-50-266">
<changeSet author="a_LAB01_e85d8801c" id="fk-goal-53-266">
<addForeignKeyConstraint baseColumnNames="METRICID" baseTableName="GOAL" constraintName="DER1N_GOAL__METRIC__METRICID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="METRICID" referencedTableName="METRIC" validate="true"/>
</changeSet>
<!--输出实体[ACCOUNT]外键关系 -->
......@@ -11409,7 +11409,7 @@
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="ENTITLEMENTTEMPLATE" constraintName="DER1N_ENTITLEMENTTEMPLATE__TRA" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[WEBSITECHANNEL]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-websitechannel-12-284">
<changeSet author="a_LAB01_e85d8801c" id="fk-websitechannel-14-284">
<addForeignKeyConstraint baseColumnNames="WEBSITEID" baseTableName="WEBSITECHANNEL" constraintName="DER1N_WEBSITECHANNEL_WEBSITE_W" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="WEBSITEID" referencedTableName="WEBSITE" validate="true"/>
</changeSet>
<!--输出实体[EMAIL]外键关系 -->
......@@ -11528,28 +11528,28 @@
</changeSet>
<!--输出实体[METRIC]外键关系 -->
<!--输出实体[LEAD]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-139-322">
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-141-322">
<addForeignKeyConstraint baseColumnNames="PARENTACCOUNTID" baseTableName="LEAD" constraintName="DER1N_LEAD__ACCOUNT__PARENTACC" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ACCOUNTID" referencedTableName="ACCOUNT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-139-323">
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-141-323">
<addForeignKeyConstraint baseColumnNames="RELATEDOBJECTID" baseTableName="LEAD" constraintName="DER1N_LEAD__CAMPAIGNRESPONSE__" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ACTIVITYID" referencedTableName="CAMPAIGNRESPONSE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-139-324">
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-141-324">
<addForeignKeyConstraint baseColumnNames="CAMPAIGNID" baseTableName="LEAD" constraintName="DER1N_LEAD__CAMPAIGN__CAMPAIGN" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CAMPAIGNID" referencedTableName="CAMPAIGN" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-139-325">
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-141-325">
<addForeignKeyConstraint baseColumnNames="PARENTCONTACTID" baseTableName="LEAD" constraintName="DER1N_LEAD__CONTACT__PARENTCON" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CONTACTID" referencedTableName="CONTACT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-139-326">
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-141-326">
<addForeignKeyConstraint baseColumnNames="ORIGINATINGCASEID" baseTableName="LEAD" constraintName="DER1N_LEAD__INCIDENT__ORIGINAT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="INCIDENTID" referencedTableName="INCIDENT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-139-327">
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-141-327">
<addForeignKeyConstraint baseColumnNames="QUALIFYINGOPPORTUNITYID" baseTableName="LEAD" constraintName="DER1N_LEAD__OPPORTUNITY__QUALI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="OPPORTUNITYID" referencedTableName="OPPORTUNITY" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-139-328">
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-141-328">
<addForeignKeyConstraint baseColumnNames="SLAID" baseTableName="LEAD" constraintName="DER1N_LEAD__SLA__SLAID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SLAID" referencedTableName="SLA" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-139-329">
<changeSet author="a_LAB01_e85d8801c" id="fk-lead-141-329">
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="LEAD" constraintName="DER1N_LEAD__TRANSACTIONCURRENC" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[TERRITORY]外键关系 -->
......
......@@ -417,6 +417,38 @@
"sysmoudle":{"id":"BASE","name":"Base"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"WebSiteResource",
"delogicname":"网站资源",
"sysmoudle":{"id":"WEBSITE","name":"WebSite"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"WebSite",
"delogicname":"网站",
"sysmoudle":{"id":"WEBSITE","name":"WebSite"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"WebSiteContent",
"delogicname":"网站内容",
"sysmoudle":{"id":"WEBSITE","name":"WebSite"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"WebSiteChannel",
"delogicname":"网站频道",
"sysmoudle":{"id":"WEBSITE","name":"WebSite"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
],
......@@ -425,7 +457,13 @@
{
"appid":"CRM",
"appname":"客户管理",
"appmenu":[{"menuid":"Central", "menuname":"Central", "menuitem":[{ "id":"user_menus" , "name":"用户菜单" , "items":[{ "id":"menuitem3" , "name":"设置" },{ "id":"menuitem4" , "name":"注销" }]},{ "id":"top_menus" , "name":"顶部菜单" },{ "id":"left_exp" , "name":"左侧菜单" , "items":[{ "id":"menuitem17" , "name":"主页" },{ "id":"menuitem18" , "name":"最近" },{ "id":"menuitem19" , "name":"固定" },{ "id":"menuitem16" , "name":"我的工作" , "items":[{ "id":"menuitem1" , "name":"仪表盘" },{ "id":"menuitem2" , "name":"活动" }]},{ "id":"menuitem20" , "name":"客户" , "items":[{ "id":"menuitem5" , "name":"客户" },{ "id":"menuitem7" , "name":"联系人" }]},{ "id":"menuitem21" , "name":"销售" , "items":[{ "id":"menuitem8" , "name":"潜在客户" },{ "id":"menuitem9" , "name":"商机" },{ "id":"menuitem10" , "name":"竞争对手" }]},{ "id":"menuitem22" , "name":"宣传资料" , "items":[{ "id":"menuitem11" , "name":"报价单" },{ "id":"menuitem12" , "name":"订单" },{ "id":"menuitem13" , "name":"发票" },{ "id":"menuitem6" , "name":"产品" },{ "id":"menuitem14" , "name":"销售宣传资料" }]},{ "id":"menuitem23" , "name":"市场营销" , "items":[{ "id":"menuitem30" , "name":"市场活动" },{ "id":"menuitem15" , "name":"市场营销列表" },{ "id":"menuitem29" , "name":"快速市场活动" }]},{ "id":"menuitem24" , "name":"绩效" , "items":[{ "id":"menuitem25" , "name":"目标" },{ "id":"menuitem31" , "name":"目标度量" },{ "id":"menuitem26" , "name":"预测" }]},{ "id":"menuitem27" , "name":"服务" , "items":[{ "id":"menuitem28" , "name":"服务案例" },{ "id":"menuitem32" , "name":"知识文章" }]}]},{ "id":"bottom_exp" , "name":"底部内容" },{ "id":"footer_left" , "name":"底部左侧" },{ "id":"footer_center" , "name":"底部中间" },{ "id":"footer_right" , "name":"底部右侧" }] }]
"appmenu":[{"menuid":"Central", "menuname":"Central", "menuitem":[{ "id":"user_menus" , "name":"用户菜单" , "items":[{ "id":"menuitem3" , "name":"设置" },{ "id":"menuitem4" , "name":"注销" }]},{ "id":"top_menus" , "name":"顶部菜单" },{ "id":"left_exp" , "name":"左侧菜单" , "items":[{ "id":"menuitem17" , "name":"主页" },{ "id":"menuitem18" , "name":"最近" },{ "id":"menuitem19" , "name":"固定" },{ "id":"menuitem16" , "name":"我的工作" , "items":[{ "id":"menuitem1" , "name":"仪表盘" },{ "id":"menuitem2" , "name":"活动" }]},{ "id":"menuitem20" , "name":"客户" , "items":[{ "id":"menuitem5" , "name":"客户" },{ "id":"menuitem7" , "name":"联系人" }]},{ "id":"menuitem21" , "name":"销售" , "items":[{ "id":"menuitem8" , "name":"潜在客户" },{ "id":"menuitem9" , "name":"商机" },{ "id":"menuitem10" , "name":"竞争对手" }]},{ "id":"menuitem22" , "name":"宣传资料" , "items":[{ "id":"menuitem11" , "name":"报价单" },{ "id":"menuitem12" , "name":"订单" },{ "id":"menuitem13" , "name":"发票" },{ "id":"menuitem6" , "name":"产品" },{ "id":"menuitem14" , "name":"销售宣传资料" }]},{ "id":"menuitem23" , "name":"市场营销" , "items":[{ "id":"menuitem30" , "name":"市场活动" },{ "id":"menuitem15" , "name":"市场营销列表" },{ "id":"menuitem29" , "name":"快速市场活动" }]},{ "id":"menuitem24" , "name":"绩效" , "items":[{ "id":"menuitem25" , "name":"目标" },{ "id":"menuitem31" , "name":"目标度量" },{ "id":"menuitem26" , "name":"预测" },{ "id":"menuitem33" , "name":"目标分页" }]},{ "id":"menuitem27" , "name":"服务" , "items":[{ "id":"menuitem28" , "name":"服务案例" },{ "id":"menuitem32" , "name":"知识文章" }]}]},{ "id":"bottom_exp" , "name":"底部内容" },{ "id":"footer_left" , "name":"底部左侧" },{ "id":"footer_center" , "name":"底部中间" },{ "id":"footer_right" , "name":"底部右侧" }] }]
}
,
{
"appid":"WebSite",
"appname":"站点内容管理",
"appmenu":[{"menuid":"WebSite", "menuname":"WebSite", "menuitem":[{ "id":"user_menus" , "name":"用户菜单" , "items":[{ "id":"menuitem3" , "name":"设置" }]},{ "id":"top_menus" , "name":"顶部菜单" },{ "id":"left_exp" , "name":"左侧菜单" , "items":[{ "id":"menuitem17" , "name":"站点管理" },{ "id":"menuitem1" , "name":"站点频道" },{ "id":"menuitem5" , "name":"站点内容" },{ "id":"menuitem2" , "name":"站点资源" }]},{ "id":"bottom_exp" , "name":"底部内容" },{ "id":"footer_left" , "name":"底部左侧" },{ "id":"footer_center" , "name":"底部中间" },{ "id":"footer_right" , "name":"底部右侧" }] }]
}
]
}
package cn.ibizlab.businesscentral.centralapi.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.businesscentral.util.domain.DTOBase;
import lombok.Data;
/**
* 服务DTO对象[WebSiteChannelDTO]
*/
@Data
public class WebSiteChannelDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [WEBSITECHANNELID]
*
*/
@JSONField(name = "websitechannelid")
@JsonProperty("websitechannelid")
private String websitechannelid;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [WEBSITECHANNELNAME]
*
*/
@JSONField(name = "websitechannelname")
@JsonProperty("websitechannelname")
private String websitechannelname;
/**
* 属性 [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;
/**
* 属性 [CREATEDATE]
*
*/
@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;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [WEBSITEID]
*
*/
@JSONField(name = "websiteid")
@JsonProperty("websiteid")
private String websiteid;
/**
* 设置 [WEBSITECHANNELNAME]
*/
public void setWebsitechannelname(String websitechannelname){
this.websitechannelname = websitechannelname ;
this.modify("websitechannelname",websitechannelname);
}
/**
* 设置 [WEBSITEID]
*/
public void setWebsiteid(String websiteid){
this.websiteid = websiteid ;
this.modify("websiteid",websiteid);
}
}
package cn.ibizlab.businesscentral.centralapi.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.businesscentral.util.domain.DTOBase;
import lombok.Data;
/**
* 服务DTO对象[WebSiteContentDTO]
*/
@Data
public class WebSiteContentDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [WEBSITECONTENTID]
*
*/
@JSONField(name = "websitecontentid")
@JsonProperty("websitecontentid")
private String websitecontentid;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [WEBSITECONTENTNAME]
*
*/
@JSONField(name = "websitecontentname")
@JsonProperty("websitecontentname")
private String websitecontentname;
/**
* 属性 [CREATEDATE]
*
*/
@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;
/**
* 属性 [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;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [WEBSITEID]
*
*/
@JSONField(name = "websiteid")
@JsonProperty("websiteid")
private String websiteid;
/**
* 属性 [WEBSITECHANNELID]
*
*/
@JSONField(name = "websitechannelid")
@JsonProperty("websitechannelid")
private String websitechannelid;
/**
* 设置 [WEBSITECONTENTNAME]
*/
public void setWebsitecontentname(String websitecontentname){
this.websitecontentname = websitecontentname ;
this.modify("websitecontentname",websitecontentname);
}
/**
* 设置 [WEBSITEID]
*/
public void setWebsiteid(String websiteid){
this.websiteid = websiteid ;
this.modify("websiteid",websiteid);
}
/**
* 设置 [WEBSITECHANNELID]
*/
public void setWebsitechannelid(String websitechannelid){
this.websitechannelid = websitechannelid ;
this.modify("websitechannelid",websitechannelid);
}
}
package cn.ibizlab.businesscentral.centralapi.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.businesscentral.util.domain.DTOBase;
import lombok.Data;
/**
* 服务DTO对象[WebSiteDTO]
*/
@Data
public class WebSiteDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [WEBSITENAME]
*
*/
@JSONField(name = "websitename")
@JsonProperty("websitename")
private String websitename;
/**
* 属性 [WEBSITEID]
*
*/
@JSONField(name = "websiteid")
@JsonProperty("websiteid")
private String websiteid;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [CREATEDATE]
*
*/
@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;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [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;
/**
* 设置 [WEBSITENAME]
*/
public void setWebsitename(String websitename){
this.websitename = websitename ;
this.modify("websitename",websitename);
}
}
package cn.ibizlab.businesscentral.centralapi.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.businesscentral.util.domain.DTOBase;
import lombok.Data;
/**
* 服务DTO对象[WebSiteResourceDTO]
*/
@Data
public class WebSiteResourceDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [WEBSITERESOURCEID]
*
*/
@JSONField(name = "websiteresourceid")
@JsonProperty("websiteresourceid")
private String websiteresourceid;
/**
* 属性 [WEBSITERESOURCENAME]
*
*/
@JSONField(name = "websiteresourcename")
@JsonProperty("websiteresourcename")
private String websiteresourcename;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [CREATEDATE]
*
*/
@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;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [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;
/**
* 属性 [WEBSITEID]
*
*/
@JSONField(name = "websiteid")
@JsonProperty("websiteid")
private String websiteid;
/**
* 设置 [WEBSITERESOURCENAME]
*/
public void setWebsiteresourcename(String websiteresourcename){
this.websiteresourcename = websiteresourcename ;
this.modify("websiteresourcename",websiteresourcename);
}
/**
* 设置 [WEBSITEID]
*/
public void setWebsiteid(String websiteid){
this.websiteid = websiteid ;
this.modify("websiteid",websiteid);
}
}
package cn.ibizlab.businesscentral.centralapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.businesscentral.core.website.domain.WebSiteChannel;
import cn.ibizlab.businesscentral.centralapi.dto.WebSiteChannelDTO;
import cn.ibizlab.businesscentral.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface WebSiteChannelMapping extends MappingBase<WebSiteChannelDTO, WebSiteChannel> {
}
package cn.ibizlab.businesscentral.centralapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.businesscentral.core.website.domain.WebSiteContent;
import cn.ibizlab.businesscentral.centralapi.dto.WebSiteContentDTO;
import cn.ibizlab.businesscentral.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface WebSiteContentMapping extends MappingBase<WebSiteContentDTO, WebSiteContent> {
}
package cn.ibizlab.businesscentral.centralapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.businesscentral.core.website.domain.WebSite;
import cn.ibizlab.businesscentral.centralapi.dto.WebSiteDTO;
import cn.ibizlab.businesscentral.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface WebSiteMapping extends MappingBase<WebSiteDTO, WebSite> {
}
package cn.ibizlab.businesscentral.centralapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.businesscentral.core.website.domain.WebSiteResource;
import cn.ibizlab.businesscentral.centralapi.dto.WebSiteResourceDTO;
import cn.ibizlab.businesscentral.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface WebSiteResourceMapping extends MappingBase<WebSiteResourceDTO, WebSiteResource> {
}
package cn.ibizlab.businesscentral.centralapi.rest;
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 lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.businesscentral.centralapi.dto.*;
import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.website.domain.WebSiteChannel;
import cn.ibizlab.businesscentral.core.website.service.IWebSiteChannelService;
import cn.ibizlab.businesscentral.core.website.filter.WebSiteChannelSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"网站频道" })
@RestController("CentralApi-websitechannel")
@RequestMapping("")
public class WebSiteChannelResource {
@Autowired
public IWebSiteChannelService websitechannelService;
@Autowired
@Lazy
public WebSiteChannelMapping websitechannelMapping;
@PreAuthorize("hasPermission(this.websitechannelMapping.toDomain(#websitechanneldto),'iBizBusinessCentral-WebSiteChannel-Create')")
@ApiOperation(value = "新建网站频道", tags = {"网站频道" }, notes = "新建网站频道")
@RequestMapping(method = RequestMethod.POST, value = "/websitechannels")
@Transactional
public ResponseEntity<WebSiteChannelDTO> create(@RequestBody WebSiteChannelDTO websitechanneldto) {
WebSiteChannel domain = websitechannelMapping.toDomain(websitechanneldto);
websitechannelService.create(domain);
WebSiteChannelDTO dto = websitechannelMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.websitechannelMapping.toDomain(#websitechanneldtos),'iBizBusinessCentral-WebSiteChannel-Create')")
@ApiOperation(value = "批量新建网站频道", tags = {"网站频道" }, notes = "批量新建网站频道")
@RequestMapping(method = RequestMethod.POST, value = "/websitechannels/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<WebSiteChannelDTO> websitechanneldtos) {
websitechannelService.createBatch(websitechannelMapping.toDomain(websitechanneldtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "websitechannel" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.websitechannelService.get(#websitechannel_id),'iBizBusinessCentral-WebSiteChannel-Update')")
@ApiOperation(value = "更新网站频道", tags = {"网站频道" }, notes = "更新网站频道")
@RequestMapping(method = RequestMethod.PUT, value = "/websitechannels/{websitechannel_id}")
@Transactional
public ResponseEntity<WebSiteChannelDTO> update(@PathVariable("websitechannel_id") String websitechannel_id, @RequestBody WebSiteChannelDTO websitechanneldto) {
WebSiteChannel domain = websitechannelMapping.toDomain(websitechanneldto);
domain .setWebsitechannelid(websitechannel_id);
websitechannelService.update(domain );
WebSiteChannelDTO dto = websitechannelMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.websitechannelService.getWebsitechannelByEntities(this.websitechannelMapping.toDomain(#websitechanneldtos)),'iBizBusinessCentral-WebSiteChannel-Update')")
@ApiOperation(value = "批量更新网站频道", tags = {"网站频道" }, notes = "批量更新网站频道")
@RequestMapping(method = RequestMethod.PUT, value = "/websitechannels/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<WebSiteChannelDTO> websitechanneldtos) {
websitechannelService.updateBatch(websitechannelMapping.toDomain(websitechanneldtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.websitechannelService.get(#websitechannel_id),'iBizBusinessCentral-WebSiteChannel-Remove')")
@ApiOperation(value = "删除网站频道", tags = {"网站频道" }, notes = "删除网站频道")
@RequestMapping(method = RequestMethod.DELETE, value = "/websitechannels/{websitechannel_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("websitechannel_id") String websitechannel_id) {
return ResponseEntity.status(HttpStatus.OK).body(websitechannelService.remove(websitechannel_id));
}
@PreAuthorize("hasPermission(this.websitechannelService.getWebsitechannelByIds(#ids),'iBizBusinessCentral-WebSiteChannel-Remove')")
@ApiOperation(value = "批量删除网站频道", tags = {"网站频道" }, notes = "批量删除网站频道")
@RequestMapping(method = RequestMethod.DELETE, value = "/websitechannels/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
websitechannelService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.websitechannelMapping.toDomain(returnObject.body),'iBizBusinessCentral-WebSiteChannel-Get')")
@ApiOperation(value = "获取网站频道", tags = {"网站频道" }, notes = "获取网站频道")
@RequestMapping(method = RequestMethod.GET, value = "/websitechannels/{websitechannel_id}")
public ResponseEntity<WebSiteChannelDTO> get(@PathVariable("websitechannel_id") String websitechannel_id) {
WebSiteChannel domain = websitechannelService.get(websitechannel_id);
WebSiteChannelDTO dto = websitechannelMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取网站频道草稿", tags = {"网站频道" }, notes = "获取网站频道草稿")
@RequestMapping(method = RequestMethod.GET, value = "/websitechannels/getdraft")
public ResponseEntity<WebSiteChannelDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(websitechannelMapping.toDto(websitechannelService.getDraft(new WebSiteChannel())));
}
@ApiOperation(value = "检查网站频道", tags = {"网站频道" }, notes = "检查网站频道")
@RequestMapping(method = RequestMethod.POST, value = "/websitechannels/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody WebSiteChannelDTO websitechanneldto) {
return ResponseEntity.status(HttpStatus.OK).body(websitechannelService.checkKey(websitechannelMapping.toDomain(websitechanneldto)));
}
@PreAuthorize("hasPermission(this.websitechannelMapping.toDomain(#websitechanneldto),'iBizBusinessCentral-WebSiteChannel-Save')")
@ApiOperation(value = "保存网站频道", tags = {"网站频道" }, notes = "保存网站频道")
@RequestMapping(method = RequestMethod.POST, value = "/websitechannels/save")
public ResponseEntity<Boolean> save(@RequestBody WebSiteChannelDTO websitechanneldto) {
return ResponseEntity.status(HttpStatus.OK).body(websitechannelService.save(websitechannelMapping.toDomain(websitechanneldto)));
}
@PreAuthorize("hasPermission(this.websitechannelMapping.toDomain(#websitechanneldtos),'iBizBusinessCentral-WebSiteChannel-Save')")
@ApiOperation(value = "批量保存网站频道", tags = {"网站频道" }, notes = "批量保存网站频道")
@RequestMapping(method = RequestMethod.POST, value = "/websitechannels/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<WebSiteChannelDTO> websitechanneldtos) {
websitechannelService.saveBatch(websitechannelMapping.toDomain(websitechanneldtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-WebSiteChannel-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-WebSiteChannel-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"网站频道" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/websitechannels/fetchdefault")
public ResponseEntity<List<WebSiteChannelDTO>> fetchDefault(WebSiteChannelSearchContext context) {
Page<WebSiteChannel> domains = websitechannelService.searchDefault(context) ;
List<WebSiteChannelDTO> list = websitechannelMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-WebSiteChannel-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-WebSiteChannel-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"网站频道" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/websitechannels/searchdefault")
public ResponseEntity<Page<WebSiteChannelDTO>> searchDefault(@RequestBody WebSiteChannelSearchContext context) {
Page<WebSiteChannel> domains = websitechannelService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(websitechannelMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.businesscentral.centralapi.rest;
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 lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.businesscentral.centralapi.dto.*;
import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.website.domain.WebSiteContent;
import cn.ibizlab.businesscentral.core.website.service.IWebSiteContentService;
import cn.ibizlab.businesscentral.core.website.filter.WebSiteContentSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"网站内容" })
@RestController("CentralApi-websitecontent")
@RequestMapping("")
public class WebSiteContentResource {
@Autowired
public IWebSiteContentService websitecontentService;
@Autowired
@Lazy
public WebSiteContentMapping websitecontentMapping;
@PreAuthorize("hasPermission(this.websitecontentMapping.toDomain(#websitecontentdto),'iBizBusinessCentral-WebSiteContent-Create')")
@ApiOperation(value = "新建网站内容", tags = {"网站内容" }, notes = "新建网站内容")
@RequestMapping(method = RequestMethod.POST, value = "/websitecontents")
@Transactional
public ResponseEntity<WebSiteContentDTO> create(@RequestBody WebSiteContentDTO websitecontentdto) {
WebSiteContent domain = websitecontentMapping.toDomain(websitecontentdto);
websitecontentService.create(domain);
WebSiteContentDTO dto = websitecontentMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.websitecontentMapping.toDomain(#websitecontentdtos),'iBizBusinessCentral-WebSiteContent-Create')")
@ApiOperation(value = "批量新建网站内容", tags = {"网站内容" }, notes = "批量新建网站内容")
@RequestMapping(method = RequestMethod.POST, value = "/websitecontents/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<WebSiteContentDTO> websitecontentdtos) {
websitecontentService.createBatch(websitecontentMapping.toDomain(websitecontentdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "websitecontent" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.websitecontentService.get(#websitecontent_id),'iBizBusinessCentral-WebSiteContent-Update')")
@ApiOperation(value = "更新网站内容", tags = {"网站内容" }, notes = "更新网站内容")
@RequestMapping(method = RequestMethod.PUT, value = "/websitecontents/{websitecontent_id}")
@Transactional
public ResponseEntity<WebSiteContentDTO> update(@PathVariable("websitecontent_id") String websitecontent_id, @RequestBody WebSiteContentDTO websitecontentdto) {
WebSiteContent domain = websitecontentMapping.toDomain(websitecontentdto);
domain .setWebsitecontentid(websitecontent_id);
websitecontentService.update(domain );
WebSiteContentDTO dto = websitecontentMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.websitecontentService.getWebsitecontentByEntities(this.websitecontentMapping.toDomain(#websitecontentdtos)),'iBizBusinessCentral-WebSiteContent-Update')")
@ApiOperation(value = "批量更新网站内容", tags = {"网站内容" }, notes = "批量更新网站内容")
@RequestMapping(method = RequestMethod.PUT, value = "/websitecontents/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<WebSiteContentDTO> websitecontentdtos) {
websitecontentService.updateBatch(websitecontentMapping.toDomain(websitecontentdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.websitecontentService.get(#websitecontent_id),'iBizBusinessCentral-WebSiteContent-Remove')")
@ApiOperation(value = "删除网站内容", tags = {"网站内容" }, notes = "删除网站内容")
@RequestMapping(method = RequestMethod.DELETE, value = "/websitecontents/{websitecontent_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("websitecontent_id") String websitecontent_id) {
return ResponseEntity.status(HttpStatus.OK).body(websitecontentService.remove(websitecontent_id));
}
@PreAuthorize("hasPermission(this.websitecontentService.getWebsitecontentByIds(#ids),'iBizBusinessCentral-WebSiteContent-Remove')")
@ApiOperation(value = "批量删除网站内容", tags = {"网站内容" }, notes = "批量删除网站内容")
@RequestMapping(method = RequestMethod.DELETE, value = "/websitecontents/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
websitecontentService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.websitecontentMapping.toDomain(returnObject.body),'iBizBusinessCentral-WebSiteContent-Get')")
@ApiOperation(value = "获取网站内容", tags = {"网站内容" }, notes = "获取网站内容")
@RequestMapping(method = RequestMethod.GET, value = "/websitecontents/{websitecontent_id}")
public ResponseEntity<WebSiteContentDTO> get(@PathVariable("websitecontent_id") String websitecontent_id) {
WebSiteContent domain = websitecontentService.get(websitecontent_id);
WebSiteContentDTO dto = websitecontentMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取网站内容草稿", tags = {"网站内容" }, notes = "获取网站内容草稿")
@RequestMapping(method = RequestMethod.GET, value = "/websitecontents/getdraft")
public ResponseEntity<WebSiteContentDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(websitecontentMapping.toDto(websitecontentService.getDraft(new WebSiteContent())));
}
@ApiOperation(value = "检查网站内容", tags = {"网站内容" }, notes = "检查网站内容")
@RequestMapping(method = RequestMethod.POST, value = "/websitecontents/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody WebSiteContentDTO websitecontentdto) {
return ResponseEntity.status(HttpStatus.OK).body(websitecontentService.checkKey(websitecontentMapping.toDomain(websitecontentdto)));
}
@PreAuthorize("hasPermission(this.websitecontentMapping.toDomain(#websitecontentdto),'iBizBusinessCentral-WebSiteContent-Save')")
@ApiOperation(value = "保存网站内容", tags = {"网站内容" }, notes = "保存网站内容")
@RequestMapping(method = RequestMethod.POST, value = "/websitecontents/save")
public ResponseEntity<Boolean> save(@RequestBody WebSiteContentDTO websitecontentdto) {
return ResponseEntity.status(HttpStatus.OK).body(websitecontentService.save(websitecontentMapping.toDomain(websitecontentdto)));
}
@PreAuthorize("hasPermission(this.websitecontentMapping.toDomain(#websitecontentdtos),'iBizBusinessCentral-WebSiteContent-Save')")
@ApiOperation(value = "批量保存网站内容", tags = {"网站内容" }, notes = "批量保存网站内容")
@RequestMapping(method = RequestMethod.POST, value = "/websitecontents/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<WebSiteContentDTO> websitecontentdtos) {
websitecontentService.saveBatch(websitecontentMapping.toDomain(websitecontentdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-WebSiteContent-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-WebSiteContent-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"网站内容" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/websitecontents/fetchdefault")
public ResponseEntity<List<WebSiteContentDTO>> fetchDefault(WebSiteContentSearchContext context) {
Page<WebSiteContent> domains = websitecontentService.searchDefault(context) ;
List<WebSiteContentDTO> list = websitecontentMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-WebSiteContent-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-WebSiteContent-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"网站内容" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/websitecontents/searchdefault")
public ResponseEntity<Page<WebSiteContentDTO>> searchDefault(@RequestBody WebSiteContentSearchContext context) {
Page<WebSiteContent> domains = websitecontentService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(websitecontentMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.businesscentral.centralapi.rest;
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 lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.businesscentral.centralapi.dto.*;
import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.website.domain.WebSite;
import cn.ibizlab.businesscentral.core.website.service.IWebSiteService;
import cn.ibizlab.businesscentral.core.website.filter.WebSiteSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"网站" })
@RestController("CentralApi-website")
@RequestMapping("")
public class WebSiteResource {
@Autowired
public IWebSiteService websiteService;
@Autowired
@Lazy
public WebSiteMapping websiteMapping;
@PreAuthorize("hasPermission(this.websiteMapping.toDomain(#websitedto),'iBizBusinessCentral-WebSite-Create')")
@ApiOperation(value = "新建网站", tags = {"网站" }, notes = "新建网站")
@RequestMapping(method = RequestMethod.POST, value = "/websites")
@Transactional
public ResponseEntity<WebSiteDTO> create(@RequestBody WebSiteDTO websitedto) {
WebSite domain = websiteMapping.toDomain(websitedto);
websiteService.create(domain);
WebSiteDTO dto = websiteMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.websiteMapping.toDomain(#websitedtos),'iBizBusinessCentral-WebSite-Create')")
@ApiOperation(value = "批量新建网站", tags = {"网站" }, notes = "批量新建网站")
@RequestMapping(method = RequestMethod.POST, value = "/websites/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<WebSiteDTO> websitedtos) {
websiteService.createBatch(websiteMapping.toDomain(websitedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "website" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.websiteService.get(#website_id),'iBizBusinessCentral-WebSite-Update')")
@ApiOperation(value = "更新网站", tags = {"网站" }, notes = "更新网站")
@RequestMapping(method = RequestMethod.PUT, value = "/websites/{website_id}")
@Transactional
public ResponseEntity<WebSiteDTO> update(@PathVariable("website_id") String website_id, @RequestBody WebSiteDTO websitedto) {
WebSite domain = websiteMapping.toDomain(websitedto);
domain .setWebsiteid(website_id);
websiteService.update(domain );
WebSiteDTO dto = websiteMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.websiteService.getWebsiteByEntities(this.websiteMapping.toDomain(#websitedtos)),'iBizBusinessCentral-WebSite-Update')")
@ApiOperation(value = "批量更新网站", tags = {"网站" }, notes = "批量更新网站")
@RequestMapping(method = RequestMethod.PUT, value = "/websites/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<WebSiteDTO> websitedtos) {
websiteService.updateBatch(websiteMapping.toDomain(websitedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.websiteService.get(#website_id),'iBizBusinessCentral-WebSite-Remove')")
@ApiOperation(value = "删除网站", tags = {"网站" }, notes = "删除网站")
@RequestMapping(method = RequestMethod.DELETE, value = "/websites/{website_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("website_id") String website_id) {
return ResponseEntity.status(HttpStatus.OK).body(websiteService.remove(website_id));
}
@PreAuthorize("hasPermission(this.websiteService.getWebsiteByIds(#ids),'iBizBusinessCentral-WebSite-Remove')")
@ApiOperation(value = "批量删除网站", tags = {"网站" }, notes = "批量删除网站")
@RequestMapping(method = RequestMethod.DELETE, value = "/websites/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
websiteService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.websiteMapping.toDomain(returnObject.body),'iBizBusinessCentral-WebSite-Get')")
@ApiOperation(value = "获取网站", tags = {"网站" }, notes = "获取网站")
@RequestMapping(method = RequestMethod.GET, value = "/websites/{website_id}")
public ResponseEntity<WebSiteDTO> get(@PathVariable("website_id") String website_id) {
WebSite domain = websiteService.get(website_id);
WebSiteDTO dto = websiteMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取网站草稿", tags = {"网站" }, notes = "获取网站草稿")
@RequestMapping(method = RequestMethod.GET, value = "/websites/getdraft")
public ResponseEntity<WebSiteDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(websiteMapping.toDto(websiteService.getDraft(new WebSite())));
}
@ApiOperation(value = "检查网站", tags = {"网站" }, notes = "检查网站")
@RequestMapping(method = RequestMethod.POST, value = "/websites/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody WebSiteDTO websitedto) {
return ResponseEntity.status(HttpStatus.OK).body(websiteService.checkKey(websiteMapping.toDomain(websitedto)));
}
@PreAuthorize("hasPermission(this.websiteMapping.toDomain(#websitedto),'iBizBusinessCentral-WebSite-Save')")
@ApiOperation(value = "保存网站", tags = {"网站" }, notes = "保存网站")
@RequestMapping(method = RequestMethod.POST, value = "/websites/save")
public ResponseEntity<Boolean> save(@RequestBody WebSiteDTO websitedto) {
return ResponseEntity.status(HttpStatus.OK).body(websiteService.save(websiteMapping.toDomain(websitedto)));
}
@PreAuthorize("hasPermission(this.websiteMapping.toDomain(#websitedtos),'iBizBusinessCentral-WebSite-Save')")
@ApiOperation(value = "批量保存网站", tags = {"网站" }, notes = "批量保存网站")
@RequestMapping(method = RequestMethod.POST, value = "/websites/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<WebSiteDTO> websitedtos) {
websiteService.saveBatch(websiteMapping.toDomain(websitedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-WebSite-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-WebSite-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"网站" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/websites/fetchdefault")
public ResponseEntity<List<WebSiteDTO>> fetchDefault(WebSiteSearchContext context) {
Page<WebSite> domains = websiteService.searchDefault(context) ;
List<WebSiteDTO> list = websiteMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-WebSite-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-WebSite-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"网站" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/websites/searchdefault")
public ResponseEntity<Page<WebSiteDTO>> searchDefault(@RequestBody WebSiteSearchContext context) {
Page<WebSite> domains = websiteService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(websiteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.businesscentral.centralapi.rest;
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 lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.businesscentral.centralapi.dto.*;
import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.website.domain.WebSiteResource;
import cn.ibizlab.businesscentral.core.website.service.IWebSiteResourceService;
import cn.ibizlab.businesscentral.core.website.filter.WebSiteResourceSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"网站资源" })
@RestController("CentralApi-websiteresource")
@RequestMapping("")
public class WebSiteResourceResource {
@Autowired
public IWebSiteResourceService websiteresourceService;
@Autowired
@Lazy
public WebSiteResourceMapping websiteresourceMapping;
@PreAuthorize("hasPermission(this.websiteresourceMapping.toDomain(#websiteresourcedto),'iBizBusinessCentral-WebSiteResource-Create')")
@ApiOperation(value = "新建网站资源", tags = {"网站资源" }, notes = "新建网站资源")
@RequestMapping(method = RequestMethod.POST, value = "/websiteresources")
@Transactional
public ResponseEntity<WebSiteResourceDTO> create(@RequestBody WebSiteResourceDTO websiteresourcedto) {
WebSiteResource domain = websiteresourceMapping.toDomain(websiteresourcedto);
websiteresourceService.create(domain);
WebSiteResourceDTO dto = websiteresourceMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.websiteresourceMapping.toDomain(#websiteresourcedtos),'iBizBusinessCentral-WebSiteResource-Create')")
@ApiOperation(value = "批量新建网站资源", tags = {"网站资源" }, notes = "批量新建网站资源")
@RequestMapping(method = RequestMethod.POST, value = "/websiteresources/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<WebSiteResourceDTO> websiteresourcedtos) {
websiteresourceService.createBatch(websiteresourceMapping.toDomain(websiteresourcedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "websiteresource" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.websiteresourceService.get(#websiteresource_id),'iBizBusinessCentral-WebSiteResource-Update')")
@ApiOperation(value = "更新网站资源", tags = {"网站资源" }, notes = "更新网站资源")
@RequestMapping(method = RequestMethod.PUT, value = "/websiteresources/{websiteresource_id}")
@Transactional
public ResponseEntity<WebSiteResourceDTO> update(@PathVariable("websiteresource_id") String websiteresource_id, @RequestBody WebSiteResourceDTO websiteresourcedto) {
WebSiteResource domain = websiteresourceMapping.toDomain(websiteresourcedto);
domain .setWebsiteresourceid(websiteresource_id);
websiteresourceService.update(domain );
WebSiteResourceDTO dto = websiteresourceMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.websiteresourceService.getWebsiteresourceByEntities(this.websiteresourceMapping.toDomain(#websiteresourcedtos)),'iBizBusinessCentral-WebSiteResource-Update')")
@ApiOperation(value = "批量更新网站资源", tags = {"网站资源" }, notes = "批量更新网站资源")
@RequestMapping(method = RequestMethod.PUT, value = "/websiteresources/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<WebSiteResourceDTO> websiteresourcedtos) {
websiteresourceService.updateBatch(websiteresourceMapping.toDomain(websiteresourcedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.websiteresourceService.get(#websiteresource_id),'iBizBusinessCentral-WebSiteResource-Remove')")
@ApiOperation(value = "删除网站资源", tags = {"网站资源" }, notes = "删除网站资源")
@RequestMapping(method = RequestMethod.DELETE, value = "/websiteresources/{websiteresource_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("websiteresource_id") String websiteresource_id) {
return ResponseEntity.status(HttpStatus.OK).body(websiteresourceService.remove(websiteresource_id));
}
@PreAuthorize("hasPermission(this.websiteresourceService.getWebsiteresourceByIds(#ids),'iBizBusinessCentral-WebSiteResource-Remove')")
@ApiOperation(value = "批量删除网站资源", tags = {"网站资源" }, notes = "批量删除网站资源")
@RequestMapping(method = RequestMethod.DELETE, value = "/websiteresources/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
websiteresourceService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.websiteresourceMapping.toDomain(returnObject.body),'iBizBusinessCentral-WebSiteResource-Get')")
@ApiOperation(value = "获取网站资源", tags = {"网站资源" }, notes = "获取网站资源")
@RequestMapping(method = RequestMethod.GET, value = "/websiteresources/{websiteresource_id}")
public ResponseEntity<WebSiteResourceDTO> get(@PathVariable("websiteresource_id") String websiteresource_id) {
WebSiteResource domain = websiteresourceService.get(websiteresource_id);
WebSiteResourceDTO dto = websiteresourceMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取网站资源草稿", tags = {"网站资源" }, notes = "获取网站资源草稿")
@RequestMapping(method = RequestMethod.GET, value = "/websiteresources/getdraft")
public ResponseEntity<WebSiteResourceDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(websiteresourceMapping.toDto(websiteresourceService.getDraft(new WebSiteResource())));
}
@ApiOperation(value = "检查网站资源", tags = {"网站资源" }, notes = "检查网站资源")
@RequestMapping(method = RequestMethod.POST, value = "/websiteresources/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody WebSiteResourceDTO websiteresourcedto) {
return ResponseEntity.status(HttpStatus.OK).body(websiteresourceService.checkKey(websiteresourceMapping.toDomain(websiteresourcedto)));
}
@PreAuthorize("hasPermission(this.websiteresourceMapping.toDomain(#websiteresourcedto),'iBizBusinessCentral-WebSiteResource-Save')")
@ApiOperation(value = "保存网站资源", tags = {"网站资源" }, notes = "保存网站资源")
@RequestMapping(method = RequestMethod.POST, value = "/websiteresources/save")
public ResponseEntity<Boolean> save(@RequestBody WebSiteResourceDTO websiteresourcedto) {
return ResponseEntity.status(HttpStatus.OK).body(websiteresourceService.save(websiteresourceMapping.toDomain(websiteresourcedto)));
}
@PreAuthorize("hasPermission(this.websiteresourceMapping.toDomain(#websiteresourcedtos),'iBizBusinessCentral-WebSiteResource-Save')")
@ApiOperation(value = "批量保存网站资源", tags = {"网站资源" }, notes = "批量保存网站资源")
@RequestMapping(method = RequestMethod.POST, value = "/websiteresources/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<WebSiteResourceDTO> websiteresourcedtos) {
websiteresourceService.saveBatch(websiteresourceMapping.toDomain(websiteresourcedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-WebSiteResource-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-WebSiteResource-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"网站资源" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/websiteresources/fetchdefault")
public ResponseEntity<List<WebSiteResourceDTO>> fetchDefault(WebSiteResourceSearchContext context) {
Page<WebSiteResource> domains = websiteresourceService.searchDefault(context) ;
List<WebSiteResourceDTO> list = websiteresourceMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-WebSiteResource-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-WebSiteResource-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"网站资源" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/websiteresources/searchdefault")
public ResponseEntity<Page<WebSiteResourceDTO>> searchDefault(@RequestBody WebSiteResourceSearchContext context) {
Page<WebSiteResource> domains = websiteresourceService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(websiteresourceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册