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

xignzi006 发布系统代码

上级 cef9606d
......@@ -3408,6 +3408,33 @@
}
]
},
{
"srfkey": "Knowledgearticleincident__StateCode",
"emptytext": "未定义",
"codelisttype":"static",
"items": [
{
"id": "1",
"label": "停用",
"text": "停用",
"data":"",
"codename":"Item_1",
"value": "1",
"disabled": false
}
, {
"id": "0",
"label": "有效",
"text": "有效",
"data":"",
"codename":"Item_0",
"value": "0",
"disabled": false
}
]
},
{
"srfkey": "Goal__FiscalPeriod",
"emptytext": "未定义",
......
......@@ -6,9 +6,15 @@
:count="item.counterService.counterData[item.counterId]"
type="info"
>
<i-button type="text" ghost @click="handleClick(item.viewlogicname)">{{item.actionName}}</i-button>
<i-button type="text" ghost @click="handleClick(item.viewlogicname)">
<i v-if="item.iconcls != ''" :class="item.iconcls" />
{{item.text}}
</i-button>
</Badge>
<i-button v-else type="text" ghost @click="handleClick(item.viewlogicname)">{{item.actionName}}</i-button>
<i-button v-else type="text" ghost @click="handleClick(item.viewlogicname)">
<i v-if="item.iconcls != ''" :class="item.iconcls" />
{{item.text}}
</i-button>
</div>
</div>
</template>
......@@ -33,6 +39,7 @@ export default class AppActionBar extends Vue {
* @memberof AppActionBar
*/
public handleClick($event: any) {
console.log(this.items);
this.$emit("itemClick", $event);
}
}
......
......@@ -441,6 +441,11 @@ export default {
"2": "难题",
"empty": ""
},
Knowledgearticleincident__StateCode: {
"1": "停用",
"0": "有效",
"empty": ""
},
Goal__FiscalPeriod: {
"1": "1 季度",
"2": "2 季度",
......
......@@ -441,6 +441,11 @@ export default {
"2": "难题",
"empty": "",
},
Knowledgearticleincident__StateCode: {
"1": "停用",
"0": "有效",
"empty": "",
},
Goal__FiscalPeriod: {
"1": "1 季度",
"2": "2 季度",
......
......@@ -41,6 +41,7 @@ export default {
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "KnowledgeArticle 事件",
srfmajortext: "状态",
srftempmode: "",
srfuf: "",
srfdeid: "",
......
......@@ -40,6 +40,7 @@ export default {
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "KnowledgeArticle 事件",
srfmajortext: "状态",
srftempmode: "",
srfuf: "",
srfdeid: "",
......
......@@ -44,6 +44,7 @@ export default {
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "产品关联 ID",
srfmajortext: "产品名称",
srftempmode: "",
srfuf: "",
srfdeid: "",
......
......@@ -43,6 +43,7 @@ export default {
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "产品关联 ID",
srfmajortext: "产品名称",
srftempmode: "",
srfuf: "",
srfdeid: "",
......
......@@ -56,6 +56,7 @@ export default {
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "产品价目表",
srfmajortext: "产品名称",
srftempmode: "",
srfuf: "",
srfdeid: "",
......
......@@ -55,6 +55,7 @@ export default {
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "产品价目表",
srfmajortext: "产品名称",
srftempmode: "",
srfuf: "",
srfdeid: "",
......
......@@ -3416,6 +3416,33 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
},
]
},
{
srfkey: "Knowledgearticleincident__StateCode",
emptytext: "未定义",
"codelisttype":"static",
items: [
{
id: "1",
label: "停用",
text: "停用",
"data":"",
"codename":"Item_1",
value: "1",
disabled: false,
},
{
id: "0",
label: "有效",
text: "有效",
"data":"",
"codename":"Item_0",
value: "0",
disabled: false,
},
]
},
{
srfkey: "Goal__FiscalPeriod",
emptytext: "未定义",
......
......@@ -24,7 +24,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -3,7 +3,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:selectedData="selectedData"
:showBusyIndicator="true"
updateAction=""
......
......@@ -21,7 +21,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:selectedData="selectedData"
:showBusyIndicator="true"
updateAction=""
......
......@@ -27,7 +27,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -30,7 +30,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -3,7 +3,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -27,7 +27,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -21,7 +21,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:selectedData="selectedData"
:showBusyIndicator="true"
updateAction=""
......
......@@ -27,7 +27,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -21,7 +21,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:selectedData="selectedData"
:showBusyIndicator="true"
updateAction=""
......
......@@ -21,7 +21,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:selectedData="selectedData"
:showBusyIndicator="true"
updateAction=""
......
......@@ -21,7 +21,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:selectedData="selectedData"
:showBusyIndicator="true"
updateAction=""
......
......@@ -21,7 +21,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:selectedData="selectedData"
:showBusyIndicator="true"
updateAction=""
......
......@@ -24,7 +24,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -27,7 +27,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -24,7 +24,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -27,7 +27,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -24,7 +24,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -24,7 +24,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -27,7 +27,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -24,7 +24,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -6,7 +6,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -24,7 +24,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -5,7 +5,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -6,7 +6,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -21,7 +21,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:selectedData="selectedData"
:showBusyIndicator="true"
updateAction=""
......
......@@ -102,6 +102,7 @@ export class ProductAssociationEditViewBase extends EditViewBase {
form: this.$refs.form,
p2k: '0',
keyPSDEField: 'productassociation',
majorPSDEField: 'productname',
isLoadDefault: true,
});
}
......
......@@ -122,6 +122,7 @@ export class ProductAssociationGridViewBase extends GridViewBase {
grid: this.$refs.grid,
searchform: this.$refs.searchform,
keyPSDEField: 'productassociation',
majorPSDEField: 'productname',
isLoadDefault: true,
});
}
......
......@@ -24,7 +24,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -27,7 +27,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -21,7 +21,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:selectedData="selectedData"
:showBusyIndicator="true"
updateAction=""
......
......@@ -102,6 +102,7 @@ export class ProductPriceLevelProPrilvEditViewBase extends EditViewBase {
form: this.$refs.form,
p2k: '0',
keyPSDEField: 'productpricelevel',
majorPSDEField: 'productname',
isLoadDefault: true,
});
}
......
......@@ -122,6 +122,7 @@ export class ProductPriceLevelProPrilvGridViewBase extends GridViewBase {
grid: this.$refs.grid,
searchform: this.$refs.searchform,
keyPSDEField: 'productpricelevel',
majorPSDEField: 'productname',
isLoadDefault: true,
});
}
......
......@@ -24,7 +24,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -24,7 +24,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -27,7 +27,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -21,7 +21,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:selectedData="selectedData"
:showBusyIndicator="true"
updateAction=""
......
......@@ -24,7 +24,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -21,7 +21,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:selectedData="selectedData"
:showBusyIndicator="true"
updateAction=""
......
......@@ -24,7 +24,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -27,7 +27,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -21,7 +21,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:selectedData="selectedData"
:showBusyIndicator="true"
updateAction=""
......
......@@ -24,7 +24,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -27,7 +27,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -21,7 +21,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:selectedData="selectedData"
:showBusyIndicator="true"
updateAction=""
......
......@@ -24,7 +24,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -24,7 +24,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -27,7 +27,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -21,7 +21,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:selectedData="selectedData"
:showBusyIndicator="true"
updateAction=""
......
......@@ -24,7 +24,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -24,7 +24,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -24,7 +24,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -27,7 +27,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -24,7 +24,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -27,7 +27,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -24,7 +24,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -24,7 +24,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -27,7 +27,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -21,7 +21,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:selectedData="selectedData"
:showBusyIndicator="true"
updateAction=""
......
......@@ -24,7 +24,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -27,7 +27,7 @@
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
......
......@@ -62,11 +62,11 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
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.relationshipsid = null;
......@@ -76,12 +76,12 @@ 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) => {
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);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -91,7 +91,7 @@ export default class CampaignServiceBase extends EntityService {
});
}
}
masterData.campaigncampaigns = campaigncampaignsData;
masterData.campaignlists = campaignlistsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -116,8 +116,8 @@ export default class CampaignServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/campaigns`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -133,11 +133,11 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
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.relationshipsid = null;
......@@ -147,12 +147,12 @@ 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) => {
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);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -162,7 +162,7 @@ export default class CampaignServiceBase extends EntityService {
});
}
}
masterData.campaigncampaigns = campaigncampaignsData;
masterData.campaignlists = campaignlistsData;
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 CampaignServiceBase extends EntityService {
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/campaigns/${context.campaign}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -210,8 +210,8 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/campaigns/${context.campaign}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -228,8 +228,8 @@ export default class CampaignServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/campaigns/getdraft`,isloading);
res.data.campaign = data.campaign;
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
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,11 +258,11 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
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.relationshipsid = null;
......@@ -272,12 +272,12 @@ 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) => {
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);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -287,7 +287,7 @@ export default class CampaignServiceBase extends EntityService {
});
}
}
masterData.campaigncampaigns = campaigncampaignsData;
masterData.campaignlists = campaignlistsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -305,8 +305,8 @@ export default class CampaignServiceBase extends EntityService {
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+'_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;
}
......
......@@ -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 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) => {
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;
......@@ -76,12 +76,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.campaignlists = campaignlistsData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
masterData.listleads = listleadsData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -91,12 +91,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listaccounts = listaccountsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
masterData.listcontacts = listcontactsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -106,12 +106,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
masterData.campaignlists = campaignlistsData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -121,7 +121,7 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listcontacts = listcontactsData;
masterData.listaccounts = listaccountsData;
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+'_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+'_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));
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 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) => {
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;
......@@ -163,12 +163,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.campaignlists = campaignlistsData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
masterData.listleads = listleadsData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -178,12 +178,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listaccounts = listaccountsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
masterData.listcontacts = listcontactsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -193,12 +193,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
masterData.campaignlists = campaignlistsData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -208,13 +208,13 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listcontacts = listcontactsData;
masterData.listaccounts = listaccountsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/ibizlists/${context.ibizlist}`,data,isloading);
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+'_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));
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+'_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+'_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));
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+'_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+'_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));
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 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) => {
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;
......@@ -306,12 +306,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.campaignlists = campaignlistsData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
masterData.listleads = listleadsData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -321,12 +321,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listaccounts = listaccountsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
masterData.listcontacts = listcontactsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -336,12 +336,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
masterData.campaignlists = campaignlistsData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -351,13 +351,13 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listcontacts = listcontactsData;
masterData.listaccounts = listaccountsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/ibizlists/${context.ibizlist}/save`,data,isloading);
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+'_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));
return res;
}
......
......@@ -31,7 +31,7 @@ export default class KnowledgeArticleIncidentServiceBase extends EntityService {
this.APPLYDEKEY ='knowledgearticleincident';
this.APPDEKEY = 'knowledgearticleincidentid';
this.APPDENAME = 'knowledgearticleincidents';
this.APPDETEXT = '';
this.APPDETEXT = 'statecode';
this.APPNAME = 'crm';
this.SYSTEMNAME = 'ibizbusinesscentral';
}
......
......@@ -84,36 +84,36 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
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) => {
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -124,8 +124,8 @@ export default class OpportunityServiceBase extends EntityService {
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && true){
......@@ -145,36 +145,36 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
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) => {
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -185,8 +185,8 @@ export default class OpportunityServiceBase extends EntityService {
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
let masterData:any = {};
......@@ -205,36 +205,36 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
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) => {
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -245,8 +245,8 @@ export default class OpportunityServiceBase extends EntityService {
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/opportunities`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......@@ -277,41 +277,41 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
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) => {
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
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));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
......@@ -331,41 +331,41 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
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) => {
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
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));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
let masterData:any = {};
......@@ -384,41 +384,41 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
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) => {
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......@@ -454,21 +454,21 @@ export default class OpportunityServiceBase extends EntityService {
if(context.account && context.contact && context.opportunity){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
let res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......@@ -486,23 +486,23 @@ export default class OpportunityServiceBase extends EntityService {
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/getdraft`,isloading);
res.data.opportunity = data.opportunity;
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && true){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/getdraft`,isloading);
res.data.opportunity = data.opportunity;
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
let res:any = await Http.getInstance().get(`/opportunities/getdraft`,isloading);
res.data.opportunity = data.opportunity;
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......@@ -533,41 +533,41 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
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) => {
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
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));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
......@@ -587,41 +587,41 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
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) => {
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
return Http.getInstance().post(`/opportunities/${context.opportunity}/checkkey`,data,isloading);
......@@ -654,41 +654,41 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
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) => {
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
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));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
......@@ -708,41 +708,41 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
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) => {
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
return Http.getInstance().post(`/opportunities/${context.opportunity}/lose`,data,isloading);
......@@ -775,41 +775,41 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
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) => {
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
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));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
......@@ -829,41 +829,41 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
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) => {
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
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));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
let masterData:any = {};
......@@ -882,41 +882,41 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
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) => {
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......@@ -947,41 +947,41 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
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) => {
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
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));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
......@@ -1001,41 +1001,41 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
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) => {
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunitycompetitors = opportunitycompetitorsData;
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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
return Http.getInstance().post(`/opportunities/${context.opportunity}/win`,data,isloading);
......
......@@ -31,7 +31,7 @@ export default class ProductAssociationServiceBase extends EntityService {
this.APPLYDEKEY ='productassociation';
this.APPDEKEY = 'productassociationid';
this.APPDENAME = 'productassociations';
this.APPDETEXT = '';
this.APPDETEXT = 'productname';
this.APPNAME = 'crm';
this.SYSTEMNAME = 'ibizbusinesscentral';
}
......
......@@ -31,7 +31,7 @@ export default class ProductPriceLevelServiceBase extends EntityService {
this.APPLYDEKEY ='productpricelevel';
this.APPDEKEY = 'productpricelevelid';
this.APPDENAME = 'productpricelevels';
this.APPDETEXT = '';
this.APPDETEXT = 'productname';
this.APPNAME = 'crm';
this.SYSTEMNAME = 'ibizbusinesscentral';
}
......
......@@ -62,21 +62,21 @@ export default class ProductServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){
productsubstitutesData.forEach((item:any) => {
let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productassociationsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productsubstituteid = null;
item.productassociationid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productsubstitutes = productsubstitutesData;
masterData.productassociations = productassociationsData;
let productpricelevelsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){
productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any);
......@@ -92,21 +92,21 @@ export default class ProductServiceBase extends EntityService {
}
}
masterData.productpricelevels = productpricelevelsData;
let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productassociationsData.forEach((item:any) => {
let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){
productsubstitutesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productassociationid = null;
item.productsubstituteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productassociations = productassociationsData;
masterData.productsubstitutes = productsubstitutesData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -116,9 +116,9 @@ export default class ProductServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/products`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
return res;
}
......@@ -133,21 +133,21 @@ export default class ProductServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){
productsubstitutesData.forEach((item:any) => {
let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productassociationsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productsubstituteid = null;
item.productassociationid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productsubstitutes = productsubstitutesData;
masterData.productassociations = productassociationsData;
let productpricelevelsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){
productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any);
......@@ -163,26 +163,26 @@ export default class ProductServiceBase extends EntityService {
}
}
masterData.productpricelevels = productpricelevelsData;
let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productassociationsData.forEach((item:any) => {
let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){
productsubstitutesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productassociationid = null;
item.productsubstituteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productassociations = productassociationsData;
masterData.productsubstitutes = productsubstitutesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/products/${context.product}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
return res;
}
......@@ -210,9 +210,9 @@ export default class ProductServiceBase extends EntityService {
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/products/${context.product}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
return res;
}
......@@ -228,9 +228,9 @@ export default class ProductServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/products/getdraft`,isloading);
res.data.product = data.product;
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
return res;
}
......@@ -258,21 +258,21 @@ export default class ProductServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){
productsubstitutesData.forEach((item:any) => {
let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productassociationsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productsubstituteid = null;
item.productassociationid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productsubstitutes = productsubstitutesData;
masterData.productassociations = productassociationsData;
let productpricelevelsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){
productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any);
......@@ -288,26 +288,26 @@ export default class ProductServiceBase extends EntityService {
}
}
masterData.productpricelevels = productpricelevelsData;
let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productassociationsData.forEach((item:any) => {
let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){
productsubstitutesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productassociationid = null;
item.productsubstituteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productassociations = productassociationsData;
masterData.productsubstitutes = productsubstitutesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/products/${context.product}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
return res;
}
......
......@@ -77,36 +77,36 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
let salesliteratureitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){
salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any);
if(salesliteratureitemsData && salesliteratureitemsData.length && salesliteratureitemsData.length > 0){
salesliteratureitemsData.forEach((item:any) => {
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;
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) => {
masterData.productsalesliteratures = productsalesliteraturesData;
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;
......@@ -117,8 +117,8 @@ 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+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
return res;
}
......@@ -148,41 +148,41 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
let salesliteratureitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){
salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any);
if(salesliteratureitemsData && salesliteratureitemsData.length && salesliteratureitemsData.length > 0){
salesliteratureitemsData.forEach((item:any) => {
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;
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) => {
masterData.productsalesliteratures = productsalesliteraturesData;
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+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
return res;
}
......@@ -211,8 +211,8 @@ 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+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
return res;
}
......@@ -229,8 +229,8 @@ export default class SalesLiteratureServiceBase extends EntityService {
let res:any = await Http.getInstance().get(`/salesliteratures/getdraft`,isloading);
res.data.salesliterature = data.salesliterature;
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
return res;
}
......@@ -273,41 +273,41 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
let salesliteratureitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){
salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any);
if(salesliteratureitemsData && salesliteratureitemsData.length && salesliteratureitemsData.length > 0){
salesliteratureitemsData.forEach((item:any) => {
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;
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) => {
masterData.productsalesliteratures = productsalesliteraturesData;
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+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
return res;
}
......
import { PropOptions } from 'vue';
import { Constructor } from 'vue/types/options';
/**
* Vue多层继承生命周期处理装饰器
*
......@@ -13,12 +16,12 @@ export function VueLifeCycleProcessing(params?: any): any {
// 原型
const p = constructor.prototype;
// 方法名数组
const methodNames: string[] = ['beforeCreate', 'created', 'beforeMount', 'mounted', 'beforeUpdate', 'updated', 'activated', 'deactivated', 'beforeDestroy', 'destroyed', 'errorCaptured'];
const methodNames: string[] = ['beforeCreate', 'beforeMount', 'mounted', 'beforeUpdate', 'updated', 'activated', 'deactivated', 'beforeDestroy', 'destroyed', 'errorCaptured'];
methodNames.forEach((name: string) => {
if (!p.hasOwnProperty(name) && p[name]) {
p[name] = function () {
if (this[name]) {
this[name]();
this[name].apply(this, arguments);
}
}
}
......@@ -30,6 +33,31 @@ export function VueLifeCycleProcessing(params?: any): any {
}
}
}
// 替换原生Prop注解
// if (p.___vuePropArr && p.___vuePropArr.length > 0) {
// const arr: any[] = JSON.parse(JSON.stringify(p.___vuePropArr));
// delete p.___vuePropArr;
// const fun = p['beforeCreate'];
// p['beforeCreate'] = function() {
// const props = this.$options.props || {};
// arr.forEach((item: any) => {
// props[item.key] = item.params || {};
// });
// console.log(props);
// this.$options.props = props;
// if (fun) {
// fun.apply(this, arguments);
// }
// }
// } else if (!p.hasOwnProperty('beforeCreate') && p['beforeCreate']) {
// p['beforeCreate'] = function () {
// if (this['beforeCreate']) {
// this['beforeCreate'].apply(this, arguments);
// }
// }
// }
// 替换原生Watch注解
if (p.___vueWatchArr && p.___vueWatchArr.length > 0) {
const arr: any[] = JSON.parse(JSON.stringify(p.___vueWatchArr));
......@@ -45,6 +73,12 @@ export function VueLifeCycleProcessing(params?: any): any {
fun.apply(this, arguments);
}
}
} else if (!p.hasOwnProperty('created') && p['created']) {
p['created'] = function () {
if (this['created']) {
this['created'].apply(this, arguments);
}
}
}
}
}
......@@ -69,3 +103,23 @@ export function Watch(key: string, params?: { deep?: boolean, immediate?: boolea
});
};
}
/**
* 企划Vue自身Prop注解,实现在继承时不出问题
*
* @export
* @param {string} key 输入属性key
* @param {(PropOptions | Constructor[] | Constructor)} [options] 参数
* @returns {*}
*/
// export function Prop(options?: PropOptions | Constructor[] | Constructor): any {
// return function (p: any, key: any) {
// if (!p.___vuePropArr) {
// p.___vuePropArr = [];
// }
// p.___vuePropArr.push({
// key,
// options
// });
// };
// }
\ No newline at end of file
......@@ -69,6 +69,7 @@ import { UserInfo } from './components/user-info/user-info';
import { StudioViewStyle2 } from './components/studio-view-style2/studio-view-style2';
import { StudioView } from './components/studio-view/studio-view';
import { StudioEmbedView } from './components/studio-embed-view/studio-embed-view';
import { StudioEmbedViewStyle2 } from './components/studio-embed-view-style2/studio-embed-view-style2';
import { ViewToolbar } from './components/view-toolbar/view-toolbar';
import { ViewConfigActions } from './components/view-config-actions/view-config-actions';
import HtmlContainer from './components/html-container/html-container.vue';
......@@ -103,6 +104,7 @@ export const StudioCore = {
v.component('studio-view-style2', StudioViewStyle2);
v.component('studio-view', StudioView);
v.component('studio-embed-view', StudioEmbedView);
v.component('studio-embed-view-style2', StudioEmbedViewStyle2);
v.component('view-toolbar', ViewToolbar);
v.component('view-config-actions', ViewConfigActions);
v.component('html-container', HtmlContainer);
......
......@@ -22,6 +22,15 @@ export class GridViewBase extends MDViewBase {
*/
protected gridRowActiveMode: 0 | 1 | 2 = 2;
/**
* 是否单选
*
* @readonly
* @type {boolean}
* @memberof GridViewBase
*/
protected isGridSingleSelect: boolean = false;
/**
* 刷新数据
*
......
......@@ -29,16 +29,6 @@ export class MDViewBase extends ViewBase {
@Prop({ default: false })
protected isformDruipart?: boolean;
/**
* 是否单选
*
* @readonly
* @type {boolean}
* @memberof MDViewBase
*/
@Prop({ default: false })
protected isSingleSelect!: boolean;
/**
* 是否展开搜索表单
*
......
......@@ -19,4 +19,14 @@ export class PickupGridViewBase extends GridView9Base {
@Prop()
public selectedData?: string;
/**
* 是否单选
*
* @readonly
* @type {boolean}
* @memberof MDViewBase
*/
@Prop({ default: false })
protected isSingleSelect!: boolean;
}
\ No newline at end of file
......@@ -165,12 +165,10 @@ export class EditFormControlBase extends FormControlBase {
* @memberof EditFormControlBase
*/
public onFormLoad(data: any = {}, action: string): void {
if (Object.is(action, "save") || Object.is(action, "autoSave") || Object.is(action, "submit")) {
// 更新context的实体主键
if (data[this.appDeName]) {
Object.assign(this.context, { [this.appDeName]: data[this.appDeName] })
}
}
this.setFormEnableCond(data);
this.fillForm(data, action);
this.oldData = {};
......
......@@ -50,6 +50,7 @@ export class MainEditFormBase extends EditFormControlBase {
srfupdatedate: null,
srforikey: null,
srfkey: null,
srfmajortext: null,
srftempmode: null,
srfuf: null,
srfdeid: null,
......@@ -94,6 +95,8 @@ export class MainEditFormBase extends EditFormControlBase {
srfkey: new FormItemModel({ caption: '产品关联 ID', detailType: 'FORMITEM', name: 'srfkey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 1 }),
srfmajortext: new FormItemModel({ caption: '产品名称', detailType: 'FORMITEM', name: 'srfmajortext', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
srftempmode: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srftempmode', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
srfuf: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfuf', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
......
......@@ -38,6 +38,11 @@ export default class MainModel {
prop: 'productassociationid',
dataType: 'GUID',
},
{
name: 'srfmajortext',
prop: 'productname',
dataType: 'PICKUPTEXT',
},
{
name: 'srftempmode',
},
......
......@@ -61,6 +61,11 @@ export default class MainModel {
prop: 'uomname',
dataType: 'PICKUPTEXT',
},
{
name: 'srfmajortext',
prop: 'productname',
dataType: 'PICKUPTEXT',
},
{
name: 'srfdataaccaction',
prop: 'productassociationid',
......
......@@ -26,29 +26,19 @@ export default class MainModel {
]
}else{
return [
{
name: 'amount',
prop: 'amount',
dataType: 'BIGDECIMAL',
},
{
name: 'pricingmethodcode',
prop: 'pricingmethodcode',
dataType: 'SSCODELIST',
},
{
name: 'uomscheduleid',
prop: 'uomscheduleid',
dataType: 'PICKUP',
},
{
name: 'pricelevelname',
prop: 'pricelevelname',
dataType: 'PICKUPTEXT',
},
{
name: 'productid',
prop: 'productid',
name: 'uomscheduleid',
prop: 'uomscheduleid',
dataType: 'PICKUP',
},
{
......@@ -56,25 +46,20 @@ export default class MainModel {
prop: 'transactioncurrencyid',
dataType: 'PICKUP',
},
{
name: 'uomid',
prop: 'uomid',
dataType: 'PICKUP',
},
{
name: 'uomname',
prop: 'uomname',
dataType: 'PICKUPTEXT',
},
{
name: 'discounttypeid',
prop: 'discounttypeid',
dataType: 'PICKUP',
name: 'srfmajortext',
prop: 'productname',
dataType: 'PICKUPTEXT',
},
{
name: 'pricelevelid',
prop: 'pricelevelid',
dataType: 'PICKUP',
name: 'srfkey',
prop: 'productpricelevelid',
dataType: 'GUID',
},
{
name: 'srfdataaccaction',
......@@ -82,9 +67,29 @@ export default class MainModel {
dataType: 'GUID',
},
{
name: 'srfkey',
prop: 'productpricelevelid',
dataType: 'GUID',
name: 'amount',
prop: 'amount',
dataType: 'BIGDECIMAL',
},
{
name: 'productid',
prop: 'productid',
dataType: 'PICKUP',
},
{
name: 'uomid',
prop: 'uomid',
dataType: 'PICKUP',
},
{
name: 'discounttypeid',
prop: 'discounttypeid',
dataType: 'PICKUP',
},
{
name: 'pricelevelid',
prop: 'pricelevelid',
dataType: 'PICKUP',
},
{
name: 'productpricelevel',
......
......@@ -50,6 +50,7 @@ export class ProPrilvEditFormBase extends EditFormControlBase {
srfupdatedate: null,
srforikey: null,
srfkey: null,
srfmajortext: null,
srftempmode: null,
srfuf: null,
srfdeid: null,
......@@ -109,6 +110,8 @@ export class ProPrilvEditFormBase extends EditFormControlBase {
srfkey: new FormItemModel({ caption: '产品价目表', detailType: 'FORMITEM', name: 'srfkey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 1 }),
srfmajortext: new FormItemModel({ caption: '产品名称', detailType: 'FORMITEM', name: 'srfmajortext', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
srftempmode: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srftempmode', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
srfuf: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfuf', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
......
......@@ -38,6 +38,11 @@ export default class ProPrilvModel {
prop: 'productpricelevelid',
dataType: 'GUID',
},
{
name: 'srfmajortext',
prop: 'productname',
dataType: 'PICKUPTEXT',
},
{
name: 'srftempmode',
},
......
......@@ -49,6 +49,9 @@ public class AuditSearchContext extends QueryWrapperContext<Audit> {
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("action", query)
);
}
}
}
......
......@@ -63,6 +63,9 @@ public class KnowledgeArticleViewsSearchContext extends QueryWrapperContext<Know
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("statecode", query)
);
}
}
}
......
......@@ -42,6 +42,9 @@ public class SiteMapSearchContext extends QueryWrapperContext<SiteMap> {
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("sitemapname", query)
);
}
}
}
......
......@@ -49,6 +49,9 @@ public class SlaItemSearchContext extends QueryWrapperContext<SlaItem> {
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("name", query)
);
}
}
}
......
......@@ -42,6 +42,9 @@ public class AnnualFiscalCalendarSearchContext extends QueryWrapperContext<Annua
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("salespersonidyominame", query)
);
}
}
}
......
......@@ -42,6 +42,9 @@ public class FixedMonthlyFiscalCalendarSearchContext extends QueryWrapperContext
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("salespersonidyominame", query)
);
}
}
}
......
......@@ -42,6 +42,9 @@ public class MonthlyFiscalCalendarSearchContext extends QueryWrapperContext<Mont
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("salespersonidyominame", query)
);
}
}
}
......
......@@ -42,6 +42,9 @@ public class QuarterlyFiscalCalendarSearchContext extends QueryWrapperContext<Qu
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("salespersonidyominame", query)
);
}
}
}
......
......@@ -42,6 +42,9 @@ public class SemiannualFiscalCalendarSearchContext extends QueryWrapperContext<S
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("salespersonidyominame", query)
);
}
}
}
......
......@@ -147,6 +147,9 @@ public class ProductAssociationSearchContext extends QueryWrapperContext<Product
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("productname", query)
);
}
}
}
......
......@@ -189,6 +189,9 @@ public class ProductPriceLevelSearchContext extends QueryWrapperContext<ProductP
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("productname", query)
);
}
}
}
......
......@@ -35,6 +35,9 @@ public class BulkDeleteFailureSearchContext extends QueryWrapperContext<BulkDele
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("errornumber", query)
);
}
}
}
......
......@@ -70,6 +70,9 @@ public class QueueItemSearchContext extends QueryWrapperContext<QueueItem> {
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("queueitemid", query)
);
}
}
}
......
......@@ -98,6 +98,9 @@ public class KnowledgeArticleIncidentSearchContext extends QueryWrapperContext<K
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("statecode", query)
);
}
}
}
......
package cn.ibizlab.businesscentral.core.website.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.businesscentral.util.domain.EntityBase;
import cn.ibizlab.businesscentral.util.annotation.DEField;
import cn.ibizlab.businesscentral.util.enums.DEPredefinedFieldType;
import cn.ibizlab.businesscentral.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.businesscentral.util.domain.EntityMP;
/**
* 实体[网站]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "WEBSITE",resultMap = "WebSiteResultMap")
public class WebSite extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 实体名称
*/
@TableField(value = "websitename")
@JSONField(name = "websitename")
@JsonProperty("websitename")
private String websitename;
/**
* 实体标识
*/
@DEField(isKeyField=true)
@TableId(value= "websiteid",type=IdType.ASSIGN_UUID)
@JSONField(name = "websiteid")
@JsonProperty("websiteid")
private String websiteid;
/**
* 更新人
*/
@DEField(preType = DEPredefinedFieldType.UPDATEMAN)
@TableField(value = "updateman")
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 建立时间
*/
@DEField(preType = DEPredefinedFieldType.CREATEDATE)
@TableField(value = "createdate" , fill = FieldFill.INSERT)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 更新时间
*/
@DEField(preType = DEPredefinedFieldType.UPDATEDATE)
@TableField(value = "updatedate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 设置 [实体名称]
*/
public void setWebsitename(String websitename){
this.websitename = websitename ;
this.modify("websitename",websitename);
}
}
package cn.ibizlab.businesscentral.core.website.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.businesscentral.util.domain.EntityBase;
import cn.ibizlab.businesscentral.util.annotation.DEField;
import cn.ibizlab.businesscentral.util.enums.DEPredefinedFieldType;
import cn.ibizlab.businesscentral.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.businesscentral.util.domain.EntityMP;
/**
* 实体[网站频道]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "WEBSITECHANNEL",resultMap = "WebSiteChannelResultMap")
public class WebSiteChannel extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 频道标识
*/
@DEField(isKeyField=true)
@TableId(value= "websitechannelid",type=IdType.ASSIGN_UUID)
@JSONField(name = "websitechannelid")
@JsonProperty("websitechannelid")
private String websitechannelid;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 频道名称
*/
@TableField(value = "websitechannelname")
@JSONField(name = "websitechannelname")
@JsonProperty("websitechannelname")
private String websitechannelname;
/**
* 更新时间
*/
@DEField(preType = DEPredefinedFieldType.UPDATEDATE)
@TableField(value = "updatedate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 建立时间
*/
@DEField(preType = DEPredefinedFieldType.CREATEDATE)
@TableField(value = "createdate" , fill = FieldFill.INSERT)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 更新人
*/
@DEField(preType = DEPredefinedFieldType.UPDATEMAN)
@TableField(value = "updateman")
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 网站标识
*/
@TableField(value = "websiteid")
@JSONField(name = "websiteid")
@JsonProperty("websiteid")
private String websiteid;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.businesscentral.core.website.domain.WebSite website;
/**
* 设置 [频道名称]
*/
public void setWebsitechannelname(String websitechannelname){
this.websitechannelname = websitechannelname ;
this.modify("websitechannelname",websitechannelname);
}
/**
* 设置 [网站标识]
*/
public void setWebsiteid(String websiteid){
this.websiteid = websiteid ;
this.modify("websiteid",websiteid);
}
}
package cn.ibizlab.businesscentral.core.website.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.businesscentral.util.domain.EntityBase;
import cn.ibizlab.businesscentral.util.annotation.DEField;
import cn.ibizlab.businesscentral.util.enums.DEPredefinedFieldType;
import cn.ibizlab.businesscentral.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.businesscentral.util.domain.EntityMP;
/**
* 实体[网站内容]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "WEBSITECONTENT",resultMap = "WebSiteContentResultMap")
public class WebSiteContent extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 内容标识
*/
@DEField(isKeyField=true)
@TableId(value= "websitecontentid",type=IdType.ASSIGN_UUID)
@JSONField(name = "websitecontentid")
@JsonProperty("websitecontentid")
private String websitecontentid;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 内容名称
*/
@TableField(value = "websitecontentname")
@JSONField(name = "websitecontentname")
@JsonProperty("websitecontentname")
private String websitecontentname;
/**
* 建立时间
*/
@DEField(preType = DEPredefinedFieldType.CREATEDATE)
@TableField(value = "createdate" , fill = FieldFill.INSERT)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 更新时间
*/
@DEField(preType = DEPredefinedFieldType.UPDATEDATE)
@TableField(value = "updatedate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 更新人
*/
@DEField(preType = DEPredefinedFieldType.UPDATEMAN)
@TableField(value = "updateman")
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 网站标识
*/
@TableField(value = "websiteid")
@JSONField(name = "websiteid")
@JsonProperty("websiteid")
private String websiteid;
/**
* 频道标识
*/
@TableField(value = "websitechannelid")
@JSONField(name = "websitechannelid")
@JsonProperty("websitechannelid")
private String websitechannelid;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.businesscentral.core.website.domain.WebSiteChannel websitechannel;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.businesscentral.core.website.domain.WebSite website;
/**
* 设置 [内容名称]
*/
public void setWebsitecontentname(String websitecontentname){
this.websitecontentname = websitecontentname ;
this.modify("websitecontentname",websitecontentname);
}
/**
* 设置 [网站标识]
*/
public void setWebsiteid(String websiteid){
this.websiteid = websiteid ;
this.modify("websiteid",websiteid);
}
/**
* 设置 [频道标识]
*/
public void setWebsitechannelid(String websitechannelid){
this.websitechannelid = websitechannelid ;
this.modify("websitechannelid",websitechannelid);
}
}
package cn.ibizlab.businesscentral.core.website.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.businesscentral.util.domain.EntityBase;
import cn.ibizlab.businesscentral.util.annotation.DEField;
import cn.ibizlab.businesscentral.util.enums.DEPredefinedFieldType;
import cn.ibizlab.businesscentral.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.businesscentral.util.domain.EntityMP;
/**
* 实体[网站资源]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "WEBSITERESOURCE",resultMap = "WebSiteResourceResultMap")
public class WebSiteResource extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 网站资源标识
*/
@DEField(isKeyField=true)
@TableId(value= "websiteresourceid",type=IdType.ASSIGN_UUID)
@JSONField(name = "websiteresourceid")
@JsonProperty("websiteresourceid")
private String websiteresourceid;
/**
* 网站资源名称
*/
@TableField(value = "websiteresourcename")
@JSONField(name = "websiteresourcename")
@JsonProperty("websiteresourcename")
private String websiteresourcename;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 建立时间
*/
@DEField(preType = DEPredefinedFieldType.CREATEDATE)
@TableField(value = "createdate" , fill = FieldFill.INSERT)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 更新人
*/
@DEField(preType = DEPredefinedFieldType.UPDATEMAN)
@TableField(value = "updateman")
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 更新时间
*/
@DEField(preType = DEPredefinedFieldType.UPDATEDATE)
@TableField(value = "updatedate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 网站标识
*/
@TableField(value = "websiteid")
@JSONField(name = "websiteid")
@JsonProperty("websiteid")
private String websiteid;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.businesscentral.core.website.domain.WebSite website;
/**
* 设置 [网站资源名称]
*/
public void setWebsiteresourcename(String websiteresourcename){
this.websiteresourcename = websiteresourcename ;
this.modify("websiteresourcename",websiteresourcename);
}
/**
* 设置 [网站标识]
*/
public void setWebsiteid(String websiteid){
this.websiteid = websiteid ;
this.modify("websiteid",websiteid);
}
}
package cn.ibizlab.businesscentral.core.website.filter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.businesscentral.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.businesscentral.core.website.domain.WebSiteChannel;
/**
* 关系型数据实体[WebSiteChannel] 查询条件对象
*/
@Slf4j
@Data
public class WebSiteChannelSearchContext extends QueryWrapperContext<WebSiteChannel> {
private String n_websitechannelname_like;//[频道名称]
public void setN_websitechannelname_like(String n_websitechannelname_like) {
this.n_websitechannelname_like = n_websitechannelname_like;
if(!ObjectUtils.isEmpty(this.n_websitechannelname_like)){
this.getSearchCond().like("websitechannelname", n_websitechannelname_like);
}
}
private String n_websiteid_eq;//[网站标识]
public void setN_websiteid_eq(String n_websiteid_eq) {
this.n_websiteid_eq = n_websiteid_eq;
if(!ObjectUtils.isEmpty(this.n_websiteid_eq)){
this.getSearchCond().eq("websiteid", n_websiteid_eq);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("websitechannelname", query)
);
}
}
}
package cn.ibizlab.businesscentral.core.website.filter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.businesscentral.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.businesscentral.core.website.domain.WebSiteContent;
/**
* 关系型数据实体[WebSiteContent] 查询条件对象
*/
@Slf4j
@Data
public class WebSiteContentSearchContext extends QueryWrapperContext<WebSiteContent> {
private String n_websitecontentname_like;//[内容名称]
public void setN_websitecontentname_like(String n_websitecontentname_like) {
this.n_websitecontentname_like = n_websitecontentname_like;
if(!ObjectUtils.isEmpty(this.n_websitecontentname_like)){
this.getSearchCond().like("websitecontentname", n_websitecontentname_like);
}
}
private String n_websiteid_eq;//[网站标识]
public void setN_websiteid_eq(String n_websiteid_eq) {
this.n_websiteid_eq = n_websiteid_eq;
if(!ObjectUtils.isEmpty(this.n_websiteid_eq)){
this.getSearchCond().eq("websiteid", n_websiteid_eq);
}
}
private String n_websitechannelid_eq;//[频道标识]
public void setN_websitechannelid_eq(String n_websitechannelid_eq) {
this.n_websitechannelid_eq = n_websitechannelid_eq;
if(!ObjectUtils.isEmpty(this.n_websitechannelid_eq)){
this.getSearchCond().eq("websitechannelid", n_websitechannelid_eq);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("websitecontentname", query)
);
}
}
}
package cn.ibizlab.businesscentral.core.website.filter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.businesscentral.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.businesscentral.core.website.domain.WebSiteResource;
/**
* 关系型数据实体[WebSiteResource] 查询条件对象
*/
@Slf4j
@Data
public class WebSiteResourceSearchContext extends QueryWrapperContext<WebSiteResource> {
private String n_websiteresourcename_like;//[网站资源名称]
public void setN_websiteresourcename_like(String n_websiteresourcename_like) {
this.n_websiteresourcename_like = n_websiteresourcename_like;
if(!ObjectUtils.isEmpty(this.n_websiteresourcename_like)){
this.getSearchCond().like("websiteresourcename", n_websiteresourcename_like);
}
}
private String n_websiteid_eq;//[网站标识]
public void setN_websiteid_eq(String n_websiteid_eq) {
this.n_websiteid_eq = n_websiteid_eq;
if(!ObjectUtils.isEmpty(this.n_websiteid_eq)){
this.getSearchCond().eq("websiteid", n_websiteid_eq);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("websiteresourcename", query)
);
}
}
}
package cn.ibizlab.businesscentral.core.website.filter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.businesscentral.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.businesscentral.core.website.domain.WebSite;
/**
* 关系型数据实体[WebSite] 查询条件对象
*/
@Slf4j
@Data
public class WebSiteSearchContext extends QueryWrapperContext<WebSite> {
private String n_websitename_like;//[实体名称]
public void setN_websitename_like(String n_websitename_like) {
this.n_websitename_like = n_websitename_like;
if(!ObjectUtils.isEmpty(this.n_websitename_like)){
this.getSearchCond().like("websitename", n_websitename_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("websitename", query)
);
}
}
}
package cn.ibizlab.businesscentral.core.website.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.businesscentral.core.website.domain.WebSiteChannel;
import cn.ibizlab.businesscentral.core.website.filter.WebSiteChannelSearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface WebSiteChannelMapper extends BaseMapper<WebSiteChannel>{
Page<WebSiteChannel> searchDefault(IPage page, @Param("srf") WebSiteChannelSearchContext context, @Param("ew") Wrapper<WebSiteChannel> wrapper) ;
@Override
WebSiteChannel selectById(Serializable id);
@Override
int insert(WebSiteChannel entity);
@Override
int updateById(@Param(Constants.ENTITY) WebSiteChannel entity);
@Override
int update(@Param(Constants.ENTITY) WebSiteChannel entity, @Param("ew") Wrapper<WebSiteChannel> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<WebSiteChannel> selectByWebsiteid(@Param("websiteid") Serializable websiteid) ;
}
package cn.ibizlab.businesscentral.core.website.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.businesscentral.core.website.domain.WebSiteContent;
import cn.ibizlab.businesscentral.core.website.filter.WebSiteContentSearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface WebSiteContentMapper extends BaseMapper<WebSiteContent>{
Page<WebSiteContent> searchDefault(IPage page, @Param("srf") WebSiteContentSearchContext context, @Param("ew") Wrapper<WebSiteContent> wrapper) ;
@Override
WebSiteContent selectById(Serializable id);
@Override
int insert(WebSiteContent entity);
@Override
int updateById(@Param(Constants.ENTITY) WebSiteContent entity);
@Override
int update(@Param(Constants.ENTITY) WebSiteContent entity, @Param("ew") Wrapper<WebSiteContent> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<WebSiteContent> selectByWebsitechannelid(@Param("websitechannelid") Serializable websitechannelid) ;
List<WebSiteContent> selectByWebsiteid(@Param("websiteid") Serializable websiteid) ;
}
package cn.ibizlab.businesscentral.core.website.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.businesscentral.core.website.domain.WebSite;
import cn.ibizlab.businesscentral.core.website.filter.WebSiteSearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface WebSiteMapper extends BaseMapper<WebSite>{
Page<WebSite> searchDefault(IPage page, @Param("srf") WebSiteSearchContext context, @Param("ew") Wrapper<WebSite> wrapper) ;
@Override
WebSite selectById(Serializable id);
@Override
int insert(WebSite entity);
@Override
int updateById(@Param(Constants.ENTITY) WebSite entity);
@Override
int update(@Param(Constants.ENTITY) WebSite entity, @Param("ew") Wrapper<WebSite> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
}
package cn.ibizlab.businesscentral.core.website.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.businesscentral.core.website.domain.WebSiteResource;
import cn.ibizlab.businesscentral.core.website.filter.WebSiteResourceSearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface WebSiteResourceMapper extends BaseMapper<WebSiteResource>{
Page<WebSiteResource> searchDefault(IPage page, @Param("srf") WebSiteResourceSearchContext context, @Param("ew") Wrapper<WebSiteResource> wrapper) ;
@Override
WebSiteResource selectById(Serializable id);
@Override
int insert(WebSiteResource entity);
@Override
int updateById(@Param(Constants.ENTITY) WebSiteResource entity);
@Override
int update(@Param(Constants.ENTITY) WebSiteResource entity, @Param("ew") Wrapper<WebSiteResource> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<WebSiteResource> selectByWebsiteid(@Param("websiteid") Serializable websiteid) ;
}
package cn.ibizlab.businesscentral.core.website.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.businesscentral.core.website.domain.WebSiteChannel;
import cn.ibizlab.businesscentral.core.website.filter.WebSiteChannelSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[WebSiteChannel] 服务对象接口
*/
public interface IWebSiteChannelService extends IService<WebSiteChannel>{
boolean create(WebSiteChannel et) ;
void createBatch(List<WebSiteChannel> list) ;
boolean update(WebSiteChannel et) ;
void updateBatch(List<WebSiteChannel> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
WebSiteChannel get(String key) ;
WebSiteChannel getDraft(WebSiteChannel et) ;
boolean checkKey(WebSiteChannel et) ;
boolean save(WebSiteChannel et) ;
void saveBatch(List<WebSiteChannel> list) ;
Page<WebSiteChannel> searchDefault(WebSiteChannelSearchContext context) ;
List<WebSiteChannel> selectByWebsiteid(String websiteid) ;
void removeByWebsiteid(String websiteid) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
List<WebSiteChannel> getWebsitechannelByIds(List<String> ids) ;
List<WebSiteChannel> getWebsitechannelByEntities(List<WebSiteChannel> entities) ;
}
package cn.ibizlab.businesscentral.core.website.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.businesscentral.core.website.domain.WebSiteContent;
import cn.ibizlab.businesscentral.core.website.filter.WebSiteContentSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[WebSiteContent] 服务对象接口
*/
public interface IWebSiteContentService extends IService<WebSiteContent>{
boolean create(WebSiteContent et) ;
void createBatch(List<WebSiteContent> list) ;
boolean update(WebSiteContent et) ;
void updateBatch(List<WebSiteContent> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
WebSiteContent get(String key) ;
WebSiteContent getDraft(WebSiteContent et) ;
boolean checkKey(WebSiteContent et) ;
boolean save(WebSiteContent et) ;
void saveBatch(List<WebSiteContent> list) ;
Page<WebSiteContent> searchDefault(WebSiteContentSearchContext context) ;
List<WebSiteContent> selectByWebsitechannelid(String websitechannelid) ;
void removeByWebsitechannelid(String websitechannelid) ;
List<WebSiteContent> selectByWebsiteid(String websiteid) ;
void removeByWebsiteid(String websiteid) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
List<WebSiteContent> getWebsitecontentByIds(List<String> ids) ;
List<WebSiteContent> getWebsitecontentByEntities(List<WebSiteContent> entities) ;
}
package cn.ibizlab.businesscentral.core.website.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.businesscentral.core.website.domain.WebSiteResource;
import cn.ibizlab.businesscentral.core.website.filter.WebSiteResourceSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[WebSiteResource] 服务对象接口
*/
public interface IWebSiteResourceService extends IService<WebSiteResource>{
boolean create(WebSiteResource et) ;
void createBatch(List<WebSiteResource> list) ;
boolean update(WebSiteResource et) ;
void updateBatch(List<WebSiteResource> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
WebSiteResource get(String key) ;
WebSiteResource getDraft(WebSiteResource et) ;
boolean checkKey(WebSiteResource et) ;
boolean save(WebSiteResource et) ;
void saveBatch(List<WebSiteResource> list) ;
Page<WebSiteResource> searchDefault(WebSiteResourceSearchContext context) ;
List<WebSiteResource> selectByWebsiteid(String websiteid) ;
void removeByWebsiteid(String websiteid) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
List<WebSiteResource> getWebsiteresourceByIds(List<String> ids) ;
List<WebSiteResource> getWebsiteresourceByEntities(List<WebSiteResource> entities) ;
}
package cn.ibizlab.businesscentral.core.website.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.businesscentral.core.website.domain.WebSite;
import cn.ibizlab.businesscentral.core.website.filter.WebSiteSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[WebSite] 服务对象接口
*/
public interface IWebSiteService extends IService<WebSite>{
boolean create(WebSite et) ;
void createBatch(List<WebSite> list) ;
boolean update(WebSite et) ;
void updateBatch(List<WebSite> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
WebSite get(String key) ;
WebSite getDraft(WebSite et) ;
boolean checkKey(WebSite et) ;
boolean save(WebSite et) ;
void saveBatch(List<WebSite> list) ;
Page<WebSite> searchDefault(WebSiteSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
List<WebSite> getWebsiteByIds(List<String> ids) ;
List<WebSite> getWebsiteByEntities(List<WebSite> entities) ;
}
package cn.ibizlab.businesscentral.core.website.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.businesscentral.core.website.domain.WebSiteChannel;
import cn.ibizlab.businesscentral.core.website.filter.WebSiteChannelSearchContext;
import cn.ibizlab.businesscentral.core.website.service.IWebSiteChannelService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.website.mapper.WebSiteChannelMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[网站频道] 服务对象接口实现
*/
@Slf4j
@Service("WebSiteChannelServiceImpl")
public class WebSiteChannelServiceImpl extends ServiceImpl<WebSiteChannelMapper, WebSiteChannel> implements IWebSiteChannelService {
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.website.service.IWebSiteContentService websitecontentService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.website.service.IWebSiteService websiteService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(WebSiteChannel et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getWebsitechannelid()),et);
return true;
}
@Override
public void createBatch(List<WebSiteChannel> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(WebSiteChannel et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("websitechannelid",et.getWebsitechannelid())))
return false;
CachedBeanCopier.copy(get(et.getWebsitechannelid()),et);
return true;
}
@Override
public void updateBatch(List<WebSiteChannel> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public WebSiteChannel get(String key) {
WebSiteChannel et = getById(key);
if(et==null){
et=new WebSiteChannel();
et.setWebsitechannelid(key);
}
else{
}
return et;
}
@Override
public WebSiteChannel getDraft(WebSiteChannel et) {
return et;
}
@Override
public boolean checkKey(WebSiteChannel et) {
return (!ObjectUtils.isEmpty(et.getWebsitechannelid()))&&(!Objects.isNull(this.getById(et.getWebsitechannelid())));
}
@Override
@Transactional
public boolean save(WebSiteChannel et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(WebSiteChannel et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<WebSiteChannel> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<WebSiteChannel> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<WebSiteChannel> selectByWebsiteid(String websiteid) {
return baseMapper.selectByWebsiteid(websiteid);
}
@Override
public void removeByWebsiteid(String websiteid) {
this.remove(new QueryWrapper<WebSiteChannel>().eq("websiteid",websiteid));
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<WebSiteChannel> searchDefault(WebSiteChannelSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<WebSiteChannel> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<WebSiteChannel>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<WebSiteChannel> getWebsitechannelByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<WebSiteChannel> getWebsitechannelByEntities(List<WebSiteChannel> entities) {
List ids =new ArrayList();
for(WebSiteChannel entity : entities){
Serializable id=entity.getWebsitechannelid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
package cn.ibizlab.businesscentral.core.website.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.businesscentral.core.website.domain.WebSiteContent;
import cn.ibizlab.businesscentral.core.website.filter.WebSiteContentSearchContext;
import cn.ibizlab.businesscentral.core.website.service.IWebSiteContentService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.website.mapper.WebSiteContentMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[网站内容] 服务对象接口实现
*/
@Slf4j
@Service("WebSiteContentServiceImpl")
public class WebSiteContentServiceImpl extends ServiceImpl<WebSiteContentMapper, WebSiteContent> implements IWebSiteContentService {
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.website.service.IWebSiteChannelService websitechannelService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.website.service.IWebSiteService websiteService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(WebSiteContent et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getWebsitecontentid()),et);
return true;
}
@Override
public void createBatch(List<WebSiteContent> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(WebSiteContent et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("websitecontentid",et.getWebsitecontentid())))
return false;
CachedBeanCopier.copy(get(et.getWebsitecontentid()),et);
return true;
}
@Override
public void updateBatch(List<WebSiteContent> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public WebSiteContent get(String key) {
WebSiteContent et = getById(key);
if(et==null){
et=new WebSiteContent();
et.setWebsitecontentid(key);
}
else{
}
return et;
}
@Override
public WebSiteContent getDraft(WebSiteContent et) {
return et;
}
@Override
public boolean checkKey(WebSiteContent et) {
return (!ObjectUtils.isEmpty(et.getWebsitecontentid()))&&(!Objects.isNull(this.getById(et.getWebsitecontentid())));
}
@Override
@Transactional
public boolean save(WebSiteContent et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(WebSiteContent et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<WebSiteContent> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<WebSiteContent> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<WebSiteContent> selectByWebsitechannelid(String websitechannelid) {
return baseMapper.selectByWebsitechannelid(websitechannelid);
}
@Override
public void removeByWebsitechannelid(String websitechannelid) {
this.remove(new QueryWrapper<WebSiteContent>().eq("websitechannelid",websitechannelid));
}
@Override
public List<WebSiteContent> selectByWebsiteid(String websiteid) {
return baseMapper.selectByWebsiteid(websiteid);
}
@Override
public void removeByWebsiteid(String websiteid) {
this.remove(new QueryWrapper<WebSiteContent>().eq("websiteid",websiteid));
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<WebSiteContent> searchDefault(WebSiteContentSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<WebSiteContent> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<WebSiteContent>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<WebSiteContent> getWebsitecontentByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<WebSiteContent> getWebsitecontentByEntities(List<WebSiteContent> entities) {
List ids =new ArrayList();
for(WebSiteContent entity : entities){
Serializable id=entity.getWebsitecontentid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
package cn.ibizlab.businesscentral.core.website.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.businesscentral.core.website.domain.WebSiteResource;
import cn.ibizlab.businesscentral.core.website.filter.WebSiteResourceSearchContext;
import cn.ibizlab.businesscentral.core.website.service.IWebSiteResourceService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.website.mapper.WebSiteResourceMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[网站资源] 服务对象接口实现
*/
@Slf4j
@Service("WebSiteResourceServiceImpl")
public class WebSiteResourceServiceImpl extends ServiceImpl<WebSiteResourceMapper, WebSiteResource> implements IWebSiteResourceService {
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.website.service.IWebSiteService websiteService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(WebSiteResource et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getWebsiteresourceid()),et);
return true;
}
@Override
public void createBatch(List<WebSiteResource> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(WebSiteResource et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("websiteresourceid",et.getWebsiteresourceid())))
return false;
CachedBeanCopier.copy(get(et.getWebsiteresourceid()),et);
return true;
}
@Override
public void updateBatch(List<WebSiteResource> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public WebSiteResource get(String key) {
WebSiteResource et = getById(key);
if(et==null){
et=new WebSiteResource();
et.setWebsiteresourceid(key);
}
else{
}
return et;
}
@Override
public WebSiteResource getDraft(WebSiteResource et) {
return et;
}
@Override
public boolean checkKey(WebSiteResource et) {
return (!ObjectUtils.isEmpty(et.getWebsiteresourceid()))&&(!Objects.isNull(this.getById(et.getWebsiteresourceid())));
}
@Override
@Transactional
public boolean save(WebSiteResource et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(WebSiteResource et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<WebSiteResource> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<WebSiteResource> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<WebSiteResource> selectByWebsiteid(String websiteid) {
return baseMapper.selectByWebsiteid(websiteid);
}
@Override
public void removeByWebsiteid(String websiteid) {
this.remove(new QueryWrapper<WebSiteResource>().eq("websiteid",websiteid));
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<WebSiteResource> searchDefault(WebSiteResourceSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<WebSiteResource> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<WebSiteResource>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<WebSiteResource> getWebsiteresourceByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<WebSiteResource> getWebsiteresourceByEntities(List<WebSiteResource> entities) {
List ids =new ArrayList();
for(WebSiteResource entity : entities){
Serializable id=entity.getWebsiteresourceid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
package cn.ibizlab.businesscentral.core.website.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.businesscentral.core.website.domain.WebSite;
import cn.ibizlab.businesscentral.core.website.filter.WebSiteSearchContext;
import cn.ibizlab.businesscentral.core.website.service.IWebSiteService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.website.mapper.WebSiteMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[网站] 服务对象接口实现
*/
@Slf4j
@Service("WebSiteServiceImpl")
public class WebSiteServiceImpl extends ServiceImpl<WebSiteMapper, WebSite> implements IWebSiteService {
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.website.service.IWebSiteChannelService websitechannelService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.website.service.IWebSiteContentService websitecontentService;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.website.service.IWebSiteResourceService websiteresourceService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(WebSite et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getWebsiteid()),et);
return true;
}
@Override
public void createBatch(List<WebSite> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(WebSite et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("websiteid",et.getWebsiteid())))
return false;
CachedBeanCopier.copy(get(et.getWebsiteid()),et);
return true;
}
@Override
public void updateBatch(List<WebSite> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public WebSite get(String key) {
WebSite et = getById(key);
if(et==null){
et=new WebSite();
et.setWebsiteid(key);
}
else{
}
return et;
}
@Override
public WebSite getDraft(WebSite et) {
return et;
}
@Override
public boolean checkKey(WebSite et) {
return (!ObjectUtils.isEmpty(et.getWebsiteid()))&&(!Objects.isNull(this.getById(et.getWebsiteid())));
}
@Override
@Transactional
public boolean save(WebSite et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(WebSite et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<WebSite> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<WebSite> list) {
saveOrUpdateBatch(list,batchSize);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<WebSite> searchDefault(WebSiteSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<WebSite> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<WebSite>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<WebSite> getWebsiteByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<WebSite> getWebsiteByEntities(List<WebSite> entities) {
List ids =new ArrayList();
for(WebSite entity : entities){
Serializable id=entity.getWebsiteid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.businesscentral.core.website.mapper.WebSiteMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="WebSiteResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WEBSITEID`, t1.`WEBSITENAME` FROM `WEBSITE` t1 ) t1 where websiteid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="WebSiteResultMap" type="cn.ibizlab.businesscentral.core.website.domain.WebSite" autoMapping="true">
<id property="websiteid" column="websiteid" /><!--主键字段映射-->
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.website.filter.WebSiteSearchContext" resultMap="WebSiteResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WEBSITEID`, t1.`WEBSITENAME` FROM `WEBSITE` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WEBSITEID`, t1.`WEBSITENAME` FROM `WEBSITE` t1
]]>
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.businesscentral.core.website.mapper.WebSiteChannelMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="WebSiteChannelResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WEBSITECHANNELID`, t1.`WEBSITECHANNELNAME`, t1.`WEBSITEID` FROM `WEBSITECHANNEL` t1 ) t1 where websitechannelid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="WebSiteChannelResultMap" type="cn.ibizlab.businesscentral.core.website.domain.WebSiteChannel" autoMapping="true">
<id property="websitechannelid" column="websitechannelid" /><!--主键字段映射-->
<result property="websiteid" column="websiteid" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="website" javaType="cn.ibizlab.businesscentral.core.website.domain.WebSite" column="websiteid" select="cn.ibizlab.businesscentral.core.website.mapper.WebSiteMapper.selectById" fetchType="lazy"></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_WEBSITECHANNEL_WEBSITE_WEBSITEID] -->
<select id="selectByWebsiteid" resultMap="WebSiteChannelResultMap">
select t1.* from (
<include refid="Default" />
) t1
where websiteid=#{websiteid}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.website.filter.WebSiteChannelSearchContext" resultMap="WebSiteChannelResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WEBSITECHANNELID`, t1.`WEBSITECHANNELNAME`, t1.`WEBSITEID` FROM `WEBSITECHANNEL` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WEBSITECHANNELID`, t1.`WEBSITECHANNELNAME`, t1.`WEBSITEID` FROM `WEBSITECHANNEL` t1
]]>
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.businesscentral.core.website.mapper.WebSiteContentMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="WebSiteContentResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WEBSITECHANNELID`, t1.`WEBSITECONTENTID`, t1.`WEBSITECONTENTNAME`, t1.`WEBSITEID` FROM `WEBSITECONTENT` t1 ) t1 where websitecontentid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="WebSiteContentResultMap" type="cn.ibizlab.businesscentral.core.website.domain.WebSiteContent" autoMapping="true">
<id property="websitecontentid" column="websitecontentid" /><!--主键字段映射-->
<result property="websiteid" column="websiteid" />
<result property="websitechannelid" column="websitechannelid" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="websitechannel" javaType="cn.ibizlab.businesscentral.core.website.domain.WebSiteChannel" column="websitechannelid" select="cn.ibizlab.businesscentral.core.website.mapper.WebSiteChannelMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="website" javaType="cn.ibizlab.businesscentral.core.website.domain.WebSite" column="websiteid" select="cn.ibizlab.businesscentral.core.website.mapper.WebSiteMapper.selectById" fetchType="lazy"></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_WEBSITECONTENT_WEBSITECHANNEL_WEBSITECHANNELID] -->
<select id="selectByWebsitechannelid" resultMap="WebSiteContentResultMap">
select t1.* from (
<include refid="Default" />
) t1
where websitechannelid=#{websitechannelid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_WEBSITECONTENT_WEBSITE_WEBSITEID] -->
<select id="selectByWebsiteid" resultMap="WebSiteContentResultMap">
select t1.* from (
<include refid="Default" />
) t1
where websiteid=#{websiteid}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.website.filter.WebSiteContentSearchContext" resultMap="WebSiteContentResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WEBSITECHANNELID`, t1.`WEBSITECONTENTID`, t1.`WEBSITECONTENTNAME`, t1.`WEBSITEID` FROM `WEBSITECONTENT` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WEBSITECHANNELID`, t1.`WEBSITECONTENTID`, t1.`WEBSITECONTENTNAME`, t1.`WEBSITEID` FROM `WEBSITECONTENT` t1
]]>
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.businesscentral.core.website.mapper.WebSiteResourceMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="WebSiteResourceResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WEBSITEID`, t1.`WEBSITERESOURCEID`, t1.`WEBSITERESOURCENAME` FROM `WEBSITERESOURCE` t1 ) t1 where websiteresourceid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="WebSiteResourceResultMap" type="cn.ibizlab.businesscentral.core.website.domain.WebSiteResource" autoMapping="true">
<id property="websiteresourceid" column="websiteresourceid" /><!--主键字段映射-->
<result property="websiteid" column="websiteid" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="website" javaType="cn.ibizlab.businesscentral.core.website.domain.WebSite" column="websiteid" select="cn.ibizlab.businesscentral.core.website.mapper.WebSiteMapper.selectById" fetchType="lazy"></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_WEBSITERESOURCE_WEBSITE_WEBSITEID] -->
<select id="selectByWebsiteid" resultMap="WebSiteResourceResultMap">
select t1.* from (
<include refid="Default" />
) t1
where websiteid=#{websiteid}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.website.filter.WebSiteResourceSearchContext" resultMap="WebSiteResourceResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WEBSITEID`, t1.`WEBSITERESOURCEID`, t1.`WEBSITERESOURCENAME` FROM `WEBSITERESOURCE` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`WEBSITEID`, t1.`WEBSITERESOURCEID`, t1.`WEBSITERESOURCENAME` FROM `WEBSITERESOURCE` t1
]]>
</sql>
</mapper>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册