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

xignzi006 发布系统代码

上级 6459f6b4
import { Subject } from 'rxjs';
import { PickupGridViewBase } from '@/studio-core';
import UomService from '@/service/uom/uom-service';
import PickupGridViewEngine from '@engine/view/pickup-grid-view-engine';
/**
* 计价单位选择表格视图视图基类
*
* @export
* @class UomPickupGridViewBase
* @extends {PickupGridViewBase}
*/
export class UomPickupGridViewBase extends PickupGridViewBase {
/**
* 实体服务对象
*
* @type {UomService}
* @memberof UomPickupGridViewBase
*/
protected appEntityService: UomService = new UomService;
/**
* 计数器服务对象集合
*
* @protected
* @type {Array<*>}
* @memberof UomPickupGridViewBase
*/
protected counterServiceArray: Array<any> = [];
/**
* 视图模型数据
*
* @protected
* @type {*}
* @memberof UomPickupGridViewBase
*/
protected model: any = {
srfCaption: 'entities.uom.views.pickupgridview.caption',
srfTitle: 'entities.uom.views.pickupgridview.title',
srfSubTitle: 'entities.uom.views.pickupgridview.subtitle',
dataInfo: ''
}
/**
* 容器模型
*
* @protected
* @type {*}
* @memberof UomPickupGridViewBase
*/
protected containerModel: any = {
view_grid: { name: 'grid', type: 'GRID' },
view_searchform: { name: 'searchform', type: 'SEARCHFORM' },
};
/**
* 视图唯一标识
*
* @protected
* @type {string}
* @memberof ViewBase
*/
protected viewtag: string = '94d961edd298073d53ca3239c092fac4';
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof UomPickupGridViewBase
*/
public engine: PickupGridViewEngine = new PickupGridViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof UomPickupGridViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
grid: this.$refs.grid,
searchform: this.$refs.searchform,
keyPSDEField: 'uom',
majorPSDEField: 'uomname',
isLoadDefault: true,
});
}
/**
* grid 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof UomPickupGridViewBase
*/
public grid_selectionchange($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'selectionchange', $event);
}
/**
* grid 部件 beforeload 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof UomPickupGridViewBase
*/
public grid_beforeload($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'beforeload', $event);
}
/**
* grid 部件 rowdblclick 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof UomPickupGridViewBase
*/
public grid_rowdblclick($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'rowdblclick', $event);
}
/**
* grid 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof UomPickupGridViewBase
*/
public grid_load($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'load', $event);
}
/**
* searchform 部件 save 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof UomPickupGridViewBase
*/
public searchform_save($event: any, $event2?: any): void {
this.engine.onCtrlEvent('searchform', 'save', $event);
}
/**
* searchform 部件 search 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof UomPickupGridViewBase
*/
public searchform_search($event: any, $event2?: any): void {
this.engine.onCtrlEvent('searchform', 'search', $event);
}
/**
* searchform 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof UomPickupGridViewBase
*/
public searchform_load($event: any, $event2?: any): void {
this.engine.onCtrlEvent('searchform', 'load', $event);
}
/**
* 是否展开搜索表单
*
* @protected
* @type {boolean}
* @memberof UomPickupGridViewBase
*/
protected isExpandSearchForm: boolean = true;
}
\ No newline at end of file
<studio-view-style2 viewName="uompickupgridview" viewTitle="计价单位选择表格视图" class='depickupgridview uom-pickup-grid-view'>
<template slot="searchForm">
<view_searchform
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:showBusyIndicator="true"
v-show="isExpandSearchForm"
loaddraftAction="FilterGetDraft"
loadAction="FilterGet"
name="searchform"
ref='searchform'
@save="searchform_save($event)"
@search="searchform_search($event)"
@load="searchform_load($event)"
@closeview="closeView($event)">
</view_searchform>
</template>
<view_grid
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:selectedData="selectedData"
:showBusyIndicator="true"
updateAction=""
removeAction="Remove"
loaddraftAction=""
loadAction=""
createAction=""
fetchAction="FetchDefault"
name="grid"
ref='grid'
@selectionchange="grid_selectionchange($event)"
@beforeload="grid_beforeload($event)"
@rowdblclick="grid_rowdblclick($event)"
@load="grid_load($event)"
@closeview="closeView($event)">
</view_grid>
</studio-view-style2>
\ No newline at end of file
<template src="./uom-pickup-grid-view.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { UomPickupGridViewBase } from './uom-pickup-grid-view-base';
import view_grid from '@widgets/uom/main-grid/main-grid.vue';
import view_searchform from '@widgets/uom/default-searchform/default-searchform.vue';
/**
* 计价单位选择表格视图视图
*
* @export
* @class UomPickupGridView
* @extends {UomPickupGridViewBase}
*/
@Component({
components: {
view_grid,
view_searchform,
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
vm.$store.commit('addCurPageViewtag', { route: to, viewtag: vm.viewtag });
});
}
})
@VueLifeCycleProcessing()
export default class UomPickupGridView extends UomPickupGridViewBase { }
</script>
import { Subject } from 'rxjs';
import { PickupViewBase } from '@/studio-core';
import UomService from '@/service/uom/uom-service';
import PickupViewEngine from '@engine/view/pickup-view-engine';
/**
* 计价单位数据选择视图视图基类
*
* @export
* @class UomPickupViewBase
* @extends {PickupViewBase}
*/
export class UomPickupViewBase extends PickupViewBase {
/**
* 实体服务对象
*
* @type {UomService}
* @memberof UomPickupViewBase
*/
protected appEntityService: UomService = new UomService;
/**
* 计数器服务对象集合
*
* @protected
* @type {Array<*>}
* @memberof UomPickupViewBase
*/
protected counterServiceArray: Array<any> = [];
/**
* 视图模型数据
*
* @protected
* @type {*}
* @memberof UomPickupViewBase
*/
protected model: any = {
srfCaption: 'entities.uom.views.pickupview.caption',
srfTitle: 'entities.uom.views.pickupview.title',
srfSubTitle: 'entities.uom.views.pickupview.subtitle',
dataInfo: ''
}
/**
* 容器模型
*
* @protected
* @type {*}
* @memberof UomPickupViewBase
*/
protected containerModel: any = {
view_pickupviewpanel: { name: 'pickupviewpanel', type: 'PICKUPVIEWPANEL' },
view_okbtn: { name: 'okbtn', type: 'button', text: '确定', disabled: true },
view_cancelbtn: { name: 'cancelbtn', type: 'button', text: '取消', disabled: false },
view_leftbtn: { name: 'leftbtn', type: 'button', text: '左移', disabled: true },
view_rightbtn: { name: 'rightbtn', type: 'button', text: '右移', disabled: true },
view_allleftbtn: { name: 'allleftbtn', type: 'button', text: '全部左移', disabled: true },
view_allrightbtn: { name: 'allrightbtn', type: 'button', text: '全部右移', disabled: true },
};
/**
* 视图唯一标识
*
* @protected
* @type {string}
* @memberof ViewBase
*/
protected viewtag: string = 'd3692664b9e2e150526e1ce4b969f15b';
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof UomPickupViewBase
*/
public engine: PickupViewEngine = new PickupViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof UomPickupViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
pickupviewpanel: this.$refs.pickupviewpanel,
keyPSDEField: 'uom',
majorPSDEField: 'uomname',
isLoadDefault: true,
});
}
/**
* pickupviewpanel 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof UomPickupViewBase
*/
public pickupviewpanel_selectionchange($event: any, $event2?: any): void {
this.engine.onCtrlEvent('pickupviewpanel', 'selectionchange', $event);
}
/**
* pickupviewpanel 部件 activated 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof UomPickupViewBase
*/
public pickupviewpanel_activated($event: any, $event2?: any): void {
this.engine.onCtrlEvent('pickupviewpanel', 'activated', $event);
}
/**
* pickupviewpanel 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof UomPickupViewBase
*/
public pickupviewpanel_load($event: any, $event2?: any): void {
this.engine.onCtrlEvent('pickupviewpanel', 'load', $event);
}
}
\ No newline at end of file
<studio-view-style2 viewName="uompickupview" viewTitle="计价单位数据选择视图" class='depickupview uom-pickup-view'>
<div class="content-container pickup-view">
<view_pickupviewpanel
:viewState="viewState"
:viewparams="JSON.parse(JSON.stringify(viewparams))"
:context="JSON.parse(JSON.stringify(context))"
:isSingleSelect="isSingleSelect"
:selectedData="selectedData"
:isShowButton="isShowButton"
name="pickupviewpanel"
ref='pickupviewpanel'
@selectionchange="pickupviewpanel_selectionchange($event)"
@activated="pickupviewpanel_activated($event)"
@load="pickupviewpanel_load($event)"
@closeview="closeView($event)">
</view_pickupviewpanel>
</div>
<template slot="footer">
<div v-if="isShowButton" :style="{ textAlign: 'right' }">
<i-button type="primary" :disabled="this.viewSelections.length > 0 ? false : true" @click="onClickOk.apply(_self, arguments)">{{this.containerModel.view_okbtn.text}}</i-button>
&nbsp;&nbsp;
<i-button @click="onClickCancel.apply(_self, arguments)">{{this.containerModel.view_cancelbtn.text}}</i-button>
</div>
</template>
</studio-view-style2>
\ No newline at end of file
<template src="./uom-pickup-view.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { UomPickupViewBase } from './uom-pickup-view-base';
import view_pickupviewpanel from '@widgets/uom/pickup-viewpickupviewpanel-pickupviewpanel/pickup-viewpickupviewpanel-pickupviewpanel.vue';
/**
* 计价单位数据选择视图视图
*
* @export
* @class UomPickupView
* @extends {UomPickupViewBase}
*/
@Component({
components: {
view_pickupviewpanel,
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
vm.$store.commit('addCurPageViewtag', { route: to, viewtag: vm.viewtag });
});
}
})
@VueLifeCycleProcessing()
export default class UomPickupView extends UomPickupViewBase { }
</script>
import { Subject } from 'rxjs';
import { PickupGridViewBase } from '@/studio-core';
import ProductService from '@/service/product/product-service';
import PickupGridViewEngine from '@engine/view/pickup-grid-view-engine';
/**
* 产品选择表格视图视图基类
*
* @export
* @class ProductPickupGridViewBase
* @extends {PickupGridViewBase}
*/
export class ProductPickupGridViewBase extends PickupGridViewBase {
/**
* 实体服务对象
*
* @type {ProductService}
* @memberof ProductPickupGridViewBase
*/
protected appEntityService: ProductService = new ProductService;
/**
* 计数器服务对象集合
*
* @protected
* @type {Array<*>}
* @memberof ProductPickupGridViewBase
*/
protected counterServiceArray: Array<any> = [];
/**
* 视图模型数据
*
* @protected
* @type {*}
* @memberof ProductPickupGridViewBase
*/
protected model: any = {
srfCaption: 'entities.product.views.pickupgridview.caption',
srfTitle: 'entities.product.views.pickupgridview.title',
srfSubTitle: 'entities.product.views.pickupgridview.subtitle',
dataInfo: ''
}
/**
* 容器模型
*
* @protected
* @type {*}
* @memberof ProductPickupGridViewBase
*/
protected containerModel: any = {
view_grid: { name: 'grid', type: 'GRID' },
view_searchform: { name: 'searchform', type: 'SEARCHFORM' },
};
/**
* 视图唯一标识
*
* @protected
* @type {string}
* @memberof ViewBase
*/
protected viewtag: string = 'a1c97c8a22bb4e7af8a0a4f28a2a6a9b';
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof ProductPickupGridViewBase
*/
public engine: PickupGridViewEngine = new PickupGridViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof ProductPickupGridViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
grid: this.$refs.grid,
searchform: this.$refs.searchform,
keyPSDEField: 'product',
majorPSDEField: 'productname',
isLoadDefault: true,
});
}
/**
* grid 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ProductPickupGridViewBase
*/
public grid_selectionchange($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'selectionchange', $event);
}
/**
* grid 部件 beforeload 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ProductPickupGridViewBase
*/
public grid_beforeload($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'beforeload', $event);
}
/**
* grid 部件 rowdblclick 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ProductPickupGridViewBase
*/
public grid_rowdblclick($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'rowdblclick', $event);
}
/**
* grid 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ProductPickupGridViewBase
*/
public grid_load($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'load', $event);
}
/**
* searchform 部件 save 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ProductPickupGridViewBase
*/
public searchform_save($event: any, $event2?: any): void {
this.engine.onCtrlEvent('searchform', 'save', $event);
}
/**
* searchform 部件 search 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ProductPickupGridViewBase
*/
public searchform_search($event: any, $event2?: any): void {
this.engine.onCtrlEvent('searchform', 'search', $event);
}
/**
* searchform 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ProductPickupGridViewBase
*/
public searchform_load($event: any, $event2?: any): void {
this.engine.onCtrlEvent('searchform', 'load', $event);
}
/**
* 是否展开搜索表单
*
* @protected
* @type {boolean}
* @memberof ProductPickupGridViewBase
*/
protected isExpandSearchForm: boolean = true;
}
\ No newline at end of file
<studio-view-style2 viewName="productpickupgridview" viewTitle="产品选择表格视图" class='depickupgridview product-pickup-grid-view'>
<template slot="searchForm">
<view_searchform
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:showBusyIndicator="true"
v-show="isExpandSearchForm"
loaddraftAction="FilterGetDraft"
loadAction="FilterGet"
name="searchform"
ref='searchform'
@save="searchform_save($event)"
@search="searchform_search($event)"
@load="searchform_load($event)"
@closeview="closeView($event)">
</view_searchform>
</template>
<view_grid
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:selectedData="selectedData"
:showBusyIndicator="true"
updateAction=""
removeAction="Remove"
loaddraftAction=""
loadAction=""
createAction=""
fetchAction="FetchDefault"
name="grid"
ref='grid'
@selectionchange="grid_selectionchange($event)"
@beforeload="grid_beforeload($event)"
@rowdblclick="grid_rowdblclick($event)"
@load="grid_load($event)"
@closeview="closeView($event)">
</view_grid>
</studio-view-style2>
\ No newline at end of file
<template src="./product-pickup-grid-view.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { ProductPickupGridViewBase } from './product-pickup-grid-view-base';
import view_grid from '@widgets/product/main-grid/main-grid.vue';
import view_searchform from '@widgets/product/default-searchform/default-searchform.vue';
/**
* 产品选择表格视图视图
*
* @export
* @class ProductPickupGridView
* @extends {ProductPickupGridViewBase}
*/
@Component({
components: {
view_grid,
view_searchform,
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
vm.$store.commit('addCurPageViewtag', { route: to, viewtag: vm.viewtag });
});
}
})
@VueLifeCycleProcessing()
export default class ProductPickupGridView extends ProductPickupGridViewBase { }
</script>
import { Subject } from 'rxjs';
import { PickupViewBase } from '@/studio-core';
import ProductService from '@/service/product/product-service';
import PickupViewEngine from '@engine/view/pickup-view-engine';
/**
* 产品数据选择视图视图基类
*
* @export
* @class ProductPickupViewBase
* @extends {PickupViewBase}
*/
export class ProductPickupViewBase extends PickupViewBase {
/**
* 实体服务对象
*
* @type {ProductService}
* @memberof ProductPickupViewBase
*/
protected appEntityService: ProductService = new ProductService;
/**
* 计数器服务对象集合
*
* @protected
* @type {Array<*>}
* @memberof ProductPickupViewBase
*/
protected counterServiceArray: Array<any> = [];
/**
* 视图模型数据
*
* @protected
* @type {*}
* @memberof ProductPickupViewBase
*/
protected model: any = {
srfCaption: 'entities.product.views.pickupview.caption',
srfTitle: 'entities.product.views.pickupview.title',
srfSubTitle: 'entities.product.views.pickupview.subtitle',
dataInfo: ''
}
/**
* 容器模型
*
* @protected
* @type {*}
* @memberof ProductPickupViewBase
*/
protected containerModel: any = {
view_pickupviewpanel: { name: 'pickupviewpanel', type: 'PICKUPVIEWPANEL' },
view_okbtn: { name: 'okbtn', type: 'button', text: '确定', disabled: true },
view_cancelbtn: { name: 'cancelbtn', type: 'button', text: '取消', disabled: false },
view_leftbtn: { name: 'leftbtn', type: 'button', text: '左移', disabled: true },
view_rightbtn: { name: 'rightbtn', type: 'button', text: '右移', disabled: true },
view_allleftbtn: { name: 'allleftbtn', type: 'button', text: '全部左移', disabled: true },
view_allrightbtn: { name: 'allrightbtn', type: 'button', text: '全部右移', disabled: true },
};
/**
* 视图唯一标识
*
* @protected
* @type {string}
* @memberof ViewBase
*/
protected viewtag: string = 'ba34ee36c1d0de288403607e17e7eb3e';
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof ProductPickupViewBase
*/
public engine: PickupViewEngine = new PickupViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof ProductPickupViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
pickupviewpanel: this.$refs.pickupviewpanel,
keyPSDEField: 'product',
majorPSDEField: 'productname',
isLoadDefault: true,
});
}
/**
* pickupviewpanel 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ProductPickupViewBase
*/
public pickupviewpanel_selectionchange($event: any, $event2?: any): void {
this.engine.onCtrlEvent('pickupviewpanel', 'selectionchange', $event);
}
/**
* pickupviewpanel 部件 activated 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ProductPickupViewBase
*/
public pickupviewpanel_activated($event: any, $event2?: any): void {
this.engine.onCtrlEvent('pickupviewpanel', 'activated', $event);
}
/**
* pickupviewpanel 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ProductPickupViewBase
*/
public pickupviewpanel_load($event: any, $event2?: any): void {
this.engine.onCtrlEvent('pickupviewpanel', 'load', $event);
}
}
\ No newline at end of file
<studio-view-style2 viewName="productpickupview" viewTitle="产品数据选择视图" class='depickupview product-pickup-view'>
<div class="content-container pickup-view">
<view_pickupviewpanel
:viewState="viewState"
:viewparams="JSON.parse(JSON.stringify(viewparams))"
:context="JSON.parse(JSON.stringify(context))"
:isSingleSelect="isSingleSelect"
:selectedData="selectedData"
:isShowButton="isShowButton"
name="pickupviewpanel"
ref='pickupviewpanel'
@selectionchange="pickupviewpanel_selectionchange($event)"
@activated="pickupviewpanel_activated($event)"
@load="pickupviewpanel_load($event)"
@closeview="closeView($event)">
</view_pickupviewpanel>
</div>
<template slot="footer">
<div v-if="isShowButton" :style="{ textAlign: 'right' }">
<i-button type="primary" :disabled="this.viewSelections.length > 0 ? false : true" @click="onClickOk.apply(_self, arguments)">{{this.containerModel.view_okbtn.text}}</i-button>
&nbsp;&nbsp;
<i-button @click="onClickCancel.apply(_self, arguments)">{{this.containerModel.view_cancelbtn.text}}</i-button>
</div>
</template>
</studio-view-style2>
\ No newline at end of file
<template src="./product-pickup-view.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { ProductPickupViewBase } from './product-pickup-view-base';
import view_pickupviewpanel from '@widgets/product/pickup-viewpickupviewpanel-pickupviewpanel/pickup-viewpickupviewpanel-pickupviewpanel.vue';
/**
* 产品数据选择视图视图
*
* @export
* @class ProductPickupView
* @extends {ProductPickupViewBase}
*/
@Component({
components: {
view_pickupviewpanel,
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
vm.$store.commit('addCurPageViewtag', { route: to, viewtag: vm.viewtag });
});
}
})
@VueLifeCycleProcessing()
export default class ProductPickupView extends ProductPickupViewBase { }
</script>
......@@ -947,6 +947,15 @@ export const viewstate: any = {
refviews: [
],
},
{
viewtag: '94d961edd298073d53ca3239c092fac4',
viewmodule: 'Base',
viewname: 'UomPickupGridView',
viewaction: '',
viewdatachange: false,
refviews: [
],
},
{
viewtag: '95a02c7480abd6ddb76e14dc079f7508',
viewmodule: 'Sales',
......@@ -1041,6 +1050,15 @@ export const viewstate: any = {
'054fb10ed157549dc619f06af1c21a31',
],
},
{
viewtag: 'a1c97c8a22bb4e7af8a0a4f28a2a6a9b',
viewmodule: 'Product',
viewname: 'ProductPickupGridView',
viewaction: '',
viewdatachange: false,
refviews: [
],
},
{
viewtag: 'a243cd62accb02ceba4fb128703128f0',
viewmodule: 'Sales',
......@@ -1256,6 +1274,16 @@ export const viewstate: any = {
'85781d107d628dfc6cdf9693797f073e',
],
},
{
viewtag: 'ba34ee36c1d0de288403607e17e7eb3e',
viewmodule: 'Product',
viewname: 'ProductPickupView',
viewaction: '',
viewdatachange: false,
refviews: [
'a1c97c8a22bb4e7af8a0a4f28a2a6a9b',
],
},
{
viewtag: 'bae77557d2f7a7852b634dc5d5a93435',
viewmodule: 'Base',
......@@ -1336,6 +1364,16 @@ export const viewstate: any = {
'ad5b5579442b2a90900b62803059a029',
],
},
{
viewtag: 'd3692664b9e2e150526e1ce4b969f15b',
viewmodule: 'Base',
viewname: 'UomPickupView',
viewaction: '',
viewdatachange: false,
refviews: [
'94d961edd298073d53ca3239c092fac4',
],
},
{
viewtag: 'd8b664607bd727900320b23da3fafaf2',
viewmodule: 'Marketing',
......
import { Prop, Provide, Emit, Model } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs';
import { Watch, MainControlBase } from '@/studio-core';
import ProductService from '@/service/product/product-service';
import PickupViewpickupviewpanelService from './pickup-viewpickupviewpanel-pickupviewpanel-service';
import PickupViewpickupviewpanelModel from './pickup-viewpickupviewpanel-pickupviewpanel-model';
/**
* pickupviewpanel部件基类
*
* @export
* @class MainControlBase
* @extends {PickupViewpickupviewpanelPickupviewpanelBase}
*/
export class PickupViewpickupviewpanelPickupviewpanelBase extends MainControlBase {
/**
* 建构部件服务对象
*
* @type {PickupViewpickupviewpanelService}
* @memberof PickupViewpickupviewpanelPickupviewpanelBase
*/
public service: PickupViewpickupviewpanelService = new PickupViewpickupviewpanelService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {ProductService}
* @memberof PickupViewpickupviewpanelPickupviewpanelBase
*/
public appEntityService: ProductService = new ProductService({ $store: this.$store });
/**
* 应用实体名称
*
* @protected
* @type {string}
* @memberof PickupViewpickupviewpanelPickupviewpanelBase
*/
protected appDeName: string = 'product';
/**
* 选中数据字符串
*
* @type {string}
* @memberof PickupViewpickupviewpanel
*/
@Prop() public selectedData?: string;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof PickupViewpickupviewpanel
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof PickupViewpickupviewpanel
*/
public getData(): any {
return {};
}
/**
* 视图名称
*
* @type {*}
* @memberof PickupViewpickupviewpanel
*/
public view: any = {
viewname: 'product-pickup-grid-view',
data: {},
}
/**
* 局部上下文
*
* @type {*}
* @memberof PickupViewpickupviewpanel
*/
public localContext: any = null;
/**
* 局部视图参数
*
* @type {*}
* @memberof PickupViewpickupviewpanel
*/
public localViewParam: any = null;
/**
* 视图数据
*
* @type {*}
* @memberof PickupViewpickupviewpanel
*/
public viewdata: string = JSON.stringify(this.context);
/**
* 视图参数
*
* @type {*}
* @memberof PickupViewpickupviewpanel
*/
public viewparam: string = JSON.stringify(this.viewparams);
/**
* 是否显示按钮
*
* @type {boolean}
* @memberof PickupViewpickupviewpanel
*/
@Prop({default: true}) public isShowButton!: boolean;
/**
* 是否单选
*
* @type {boolean}
* @memberof PickupViewpickupviewpanel
*/
@Prop() public isSingleSelect?: boolean;
/**
* 初始化完成
*
* @type {boolean}
* @memberof PickupViewpickupviewpanel
*/
public inited: boolean = false;
/**
* 视图数据变化
*
* @param {*} $event
* @memberof PickupViewpickupviewpanel
*/
public onViewDatasChange($event: any): void {
if($event.length>0){
$event.forEach((item:any,index:any) => {
let srfmajortext = item['productname'];
if(srfmajortext){
Object.assign($event[index],{srfmajortext: srfmajortext});
}
});
}
this.$emit('selectionchange', $event);
}
/**
* 视图数据被激活
*
* @param {*} $event
* @memberof PickupViewpickupviewpanel
*/
public viewDatasActivated($event: any): void {
this.$emit('activated', $event);
}
/**
* 视图加载完成
*
* @param {*} $event
* @memberof PickupViewpickupviewpanel
*/
public onViewLoad($event: any): void {
this.$emit('load', $event);
}
/**
* vue 生命周期
*
* @memberof PickupViewpickupviewpanel
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof PickupViewpickupviewpanel
*/
public afterCreated(){
this.initNavParam();
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
if (Object.is('load', action)) {
this.viewdata = JSON.stringify(this.context);
this.viewparam = JSON.stringify(Object.assign(data, this.viewparams));
this.inited = true;
}
});
}
}
/**
* 初始化导航参数
*
* @memberof PickupViewpickupviewpanel
*/
public initNavParam(){
if(this.localContext && Object.keys(this.localContext).length >0){
let _context:any = this.$util.computedNavData({},this.context,this.viewparams,this.localContext);
Object.assign(this.context,_context);
}
if(this.localViewParam && Object.keys(this.localViewParam).length >0){
let _param:any = this.$util.computedNavData({},this.context,this.viewparams,this.localViewParam);
Object.assign(this.viewparams,_param);
}
this.viewdata = JSON.stringify(this.context);
this.viewparam = JSON.stringify(this.viewparams);
}
/**
* vue 生命周期
*
* @memberof PickupViewpickupviewpanel
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof PickupViewpickupviewpanel
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
}
\ No newline at end of file
/**
* PickupViewpickupviewpanel 部件模型
*
* @export
* @class PickupViewpickupviewpanelModel
*/
export default class PickupViewpickupviewpanelModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof PickupViewpickupviewpanelModel
*/
public getDataItems(): any[] {
return [
{
name: 'vendorid',
},
{
name: 'productstructure',
},
{
name: 'versionnumber',
},
{
name: 'stageid',
},
{
name: 'statuscode',
},
{
name: 'entityimage',
},
{
name: 'overriddencreatedon',
},
{
name: 'stockitem',
},
{
name: 'importsequencenumber',
},
{
name: 'validfromdate',
},
{
name: 'suppliername',
},
{
name: 'producttypecode',
},
{
name: 'entityimageid',
},
{
name: 'entityimage_timestamp',
},
{
name: 'producturl',
},
{
name: 'standardcost',
},
{
name: 'quantityonhand',
},
{
name: 'currentcost',
},
{
name: 'exchangerate',
},
{
name: 'product',
prop: 'productid',
},
{
name: 'description',
},
{
name: 'vendorname',
},
{
name: 'dmtimportstate',
},
{
name: 'entityimage_url',
},
{
name: 'stockvolume',
},
{
name: 'quantitydecimal',
},
{
name: 'vendorpartnumber',
},
{
name: 'validtodate',
},
{
name: 'reparented',
},
{
name: 'createman',
},
{
name: 'processid',
},
{
name: 'createdate',
},
{
name: 'productnumber',
},
{
name: 'kit',
},
{
name: 'updatedate',
},
{
name: 'currentcost_base',
},
{
name: 'updateman',
},
{
name: 'stockweight',
},
{
name: 'size',
},
{
name: 'timezoneruleversionnumber',
},
{
name: 'utcconversiontimezonecode',
},
{
name: 'productname',
},
{
name: 'price_base',
},
{
name: 'price',
},
{
name: 'traversedpath',
},
{
name: 'hierarchypath',
},
{
name: 'standardcost_base',
},
{
name: 'statecode',
},
{
name: 'parentproductid',
},
{
name: 'transactioncurrencyid',
},
{
name: 'pricelevelid',
},
{
name: 'defaultuomid',
},
{
name: 'defaultuomscheduleid',
},
{
name: 'subjectid',
},
{
name: 'parentproductname',
},
{
name: 'transactioncurrencyname',
},
{
name: 'pricelevelname',
},
{
name: 'defaultuomname',
},
{
name: 'defaultuomschedulename',
},
{
name: 'subjectname',
},
]
}
}
\ No newline at end of file
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* PickupViewpickupviewpanel 部件服务对象
*
* @export
* @class PickupViewpickupviewpanelService
*/
export default class PickupViewpickupviewpanelService extends ControlService {
}
\ No newline at end of file
<div class='pickupviewpanel'>
<component
v-if="inited && view.viewname && !Object.is(view.viewname, '')"
:is="view.viewname"
class="viewcontainer3"
:viewdata="viewdata"
:viewparam="viewparam"
:viewDefaultUsage="false"
:isSingleSelect="isSingleSelect"
:selectedData="selectedData"
:isShowButton="isShowButton"
@viewdataschange="onViewDatasChange.apply(_self, arguments)"
@viewdatasactivated="viewDatasActivated.apply(_self, arguments)"
@viewload="onViewLoad.apply(_self, arguments)">
</component>
</div>
\ No newline at end of file
<template src="./pickup-viewpickupviewpanel-pickupviewpanel.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { PickupViewpickupviewpanelPickupviewpanelBase } from './pickup-viewpickupviewpanel-pickupviewpanel-base';
/**
* pickupviewpanel部件
*
* @export
* @class PickupViewpickupviewpanelPickupviewpanel
* @extends {PickupViewpickupviewpanelPickupviewpanelBase}
*/
@Component({
components: {
}
})
@VueLifeCycleProcessing()
export default class PickupViewpickupviewpanelPickupviewpanel extends PickupViewpickupviewpanelPickupviewpanelBase { }
</script>
import { Prop, Provide, Emit, Model } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs';
import { Watch, SearchFormControlBase } from '@/studio-core';
import UomService from '@/service/uom/uom-service';
import DefaultService from './default-searchform-service';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
/**
* searchform部件基类
*
* @export
* @class SearchFormControlBase
* @extends {DefaultSearchFormBase}
*/
export class DefaultSearchFormBase extends SearchFormControlBase {
/**
* 建构部件服务对象
*
* @type {DefaultService}
* @memberof DefaultSearchFormBase
*/
public service: DefaultService = new DefaultService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {UomService}
* @memberof DefaultSearchFormBase
*/
public appEntityService: UomService = new UomService({ $store: this.$store });
/**
* 应用实体名称
*
* @protected
* @type {string}
* @memberof DefaultSearchFormBase
*/
protected appDeName: string = 'uom';
/**
* 表单数据对象
*
* @type {*}
* @memberof DefaultSearchFormBase
*/
public data: any = {
};
/**
* 详情模型集合
*
* @type {*}
* @memberof DefaultSearchFormBase
*/
public detailsModel: any = {
formpage1: new FormPageModel({ caption: '常规条件', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this })
,
};
}
\ No newline at end of file
/**
* Default 部件模型
*
* @export
* @class DefaultModel
*/
export default class DefaultModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof DefaultModel
*/
public getDataItems(): any[] {
return [
{
name: 'srfwfmemo',
prop: 'srfwfmemo',
dataType: 'TEXT',
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name: 'srffrontuf',
prop: 'srffrontuf',
dataType: 'TEXT',
},
]
}
}
\ No newline at end of file
<i-form :model="this.data" class='app-search-form' ref='searchform' style="">
<input style="display:none;"/>
<div class="search-button">
<i-button size="small" type="primary" ghost @click="onSearch.apply(_self, arguments)">{{$t('app.searchButton.search')}}</i-button>
<i-button size="small" type="default" ghost @click="onReset.apply(_self, arguments)">{{this.$t('app.searchButton.reset')}}</i-button>
</div>
<div class="form-content">
</div>
</i-form>
\ No newline at end of file
<template src="./default-searchform.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { DefaultSearchFormBase } from './default-searchform-base';
/**
* searchform部件
*
* @export
* @class DefaultSearchForm
* @extends {DefaultSearchFormBase}
*/
@Component({
components: {
}
})
@VueLifeCycleProcessing()
export default class DefaultSearchForm extends DefaultSearchFormBase { }
</script>
import { Prop, Provide, Emit, Model } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs';
import { Watch, GridControllerBase } from '@/studio-core';
import UomService from '@/service/uom/uom-service';
import MainService from './main-grid-service';
import { FormItemModel } from '@/model/form-detail';
/**
* grid部件基类
*
* @export
* @class GridControllerBase
* @extends {MainGridBase}
*/
export class MainGridBase extends GridControllerBase {
/**
* 建构部件服务对象
*
* @type {MainService}
* @memberof MainGridBase
*/
public service: MainService = new MainService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {UomService}
* @memberof MainGridBase
*/
public appEntityService: UomService = new UomService({ $store: this.$store });
/**
* 应用实体名称
*
* @protected
* @type {string}
* @memberof MainGridBase
*/
protected appDeName: string = 'uom';
/**
* 本地缓存标识
*
* @protected
* @type {string}
* @memberof GridControllerBase
*/
protected localStorageTag: string = 'uom_main_grid';
/**
* 所有列成员
*
* @type {any[]}
* @memberof MainGridBase
*/
public allColumns: any[] = [
{
name: 'uomname',
label: '计量单位名称',
langtag: 'entities.uom.main_grid.columns.uomname',
show: true,
util: 'PX'
},
{
name: 'updateman',
label: '更新人',
langtag: 'entities.uom.main_grid.columns.updateman',
show: true,
util: 'PX'
},
{
name: 'updatedate',
label: '更新时间',
langtag: 'entities.uom.main_grid.columns.updatedate',
show: true,
util: 'PX'
},
]
/**
* 获取表格行模型
*
* @type {*}
* @memberof MainGridBase
*/
public getGridRowModel(){
return {
srfkey: new FormItemModel(),
}
}
/**
* 属性值规则
*
* @type {*}
* @memberof MainGridBase
*/
public rules: any = {
srfkey: [
{ required: false, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: '计价单位 值不能为空', trigger: 'change' },
{ required: false, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: '计价单位 值不能为空', trigger: 'blur' },
],
}
/**
* 获取对应列class
*
* @type {*}
* @memberof MainBase
*/
public hasRowEdit: any = {
'uomname':false,
'updateman':false,
'updatedate':false,
};
/**
* 获取对应列class
*
* @param {*} $args row 行数据,column 列数据,rowIndex 行索引,列索引
* @returns {void}
* @memberof MainBase
*/
public getCellClassName(args: {row: any, column: any, rowIndex: number, columnIndex: number}): any {
return ( this.hasRowEdit[args.column.property] && this.actualIsOpenEdit ) ? "edit-cell" : "info-cell";
}
}
\ No newline at end of file
/**
* Main 部件模型
*
* @export
* @class MainModel
*/
export default class MainModel {
/**
* 是否是实体数据导出
*
* @returns {any[]}
* @memberof MainGridMode
*/
public isDEExport: boolean = false;
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof MainGridMode
*/
public getDataItems(): any[] {
if(this.isDEExport){
return [
]
}else{
return [
{
name: 'baseuom',
prop: 'baseuom',
dataType: 'PICKUP',
},
{
name: 'uomscheduleid',
prop: 'uomscheduleid',
dataType: 'PICKUP',
},
{
name: 'updateman',
prop: 'updateman',
dataType: 'TEXT',
},
{
name: 'uomname',
prop: 'uomname',
dataType: 'TEXT',
},
{
name: 'updatedate',
prop: 'updatedate',
dataType: 'DATETIME',
},
{
name: 'srfmajortext',
prop: 'uomname',
dataType: 'TEXT',
},
{
name: 'srfdataaccaction',
prop: 'uomid',
dataType: 'GUID',
},
{
name: 'srfkey',
prop: 'uomid',
dataType: 'GUID',
},
{
name: 'uom',
prop: 'uomid',
},
{
name:'size',
prop:'size'
},
{
name:'query',
prop:'query'
},
{
name:'page',
prop:'page'
},
{
name:'sort',
prop:'sort'
},
{
name:'srfparentdata',
prop:'srfparentdata'
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name: 'srffrontuf',
prop: 'srffrontuf',
dataType: 'TEXT',
},
]
}
}
}
\ No newline at end of file
此差异已折叠。
<div :class="{ 'grid': true, 'show-paging-bar': isEnablePagingBar, 'hidden-paging-bar': !isEnablePagingBar }">
<i-form>
<el-table v-if="isDisplay === true"
:default-sort="{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }"
@sort-change="onSortChange($event)"
:border="isDragendCol"
:highlight-current-row ="isSingleSelect"
:row-class-name="getRowClassName.bind(_self)"
:cell-class-name="getCellClassName.bind(_self)"
size="mini"
stripe
@row-click="rowClick($event)"
@select-all="selectAll($event)"
@select="select($event)"
@row-class-name="onRowClassName($event)"
@row-dblclick="rowDBLClick($event)"
ref='multipleTable' :data="items" :show-header="!isHideHeader">
<template slot="empty">
无数据
<span class="quick-toolbar">
</span>
</template>
<template v-if="!isSingleSelect">
<el-table-column align="center" type='selection' :width="checkboxColWidth"></el-table-column>
</template>
<template v-if="getColumnState('uomname')">
<el-table-column show-overflow-tooltip :prop="'uomname'" :label="$t('entities.uom.main_grid.columns.uomname')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot:header="{column}">
<span class="column-header ">
{{$t('entities.uom.main_grid.columns.uomname')}}
</span>
</template>
<template v-slot="{row,column,$index}">
<span>{{row.uomname}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('updateman')">
<el-table-column show-overflow-tooltip :prop="'updateman'" :label="$t('entities.uom.main_grid.columns.updateman')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot:header="{column}">
<span class="column-header ">
{{$t('entities.uom.main_grid.columns.updateman')}}
</span>
</template>
<template v-slot="{row,column,$index}">
<template >
<codelist :value="row.updateman" tag='SysOperator' codelistType='DYNAMIC' ></codelist>
</template>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('updatedate')">
<el-table-column show-overflow-tooltip :prop="'updatedate'" :label="$t('entities.uom.main_grid.columns.updatedate')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot:header="{column}">
<span class="column-header ">
{{$t('entities.uom.main_grid.columns.updatedate')}}
</span>
</template>
<template v-slot="{row,column,$index}">
<app-format-data format="YYYY-MM-DD hh:mm:ss" :data="row.updatedate"></app-format-data>
</template>
</el-table-column>
</template>
<template v-if="adaptiveState">
<el-table-column></el-table-column>
</template>
</el-table>
<row class='grid-pagination' v-show="items.length > 0">
<page class='pull-right' @on-change="pageOnChange($event)"
@on-page-size-change="onPageSizeChange($event)"
:transfer="true" :total="totalRecord"
show-sizer :current="curPage" :page-size="limit"
:page-size-opts="[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]" show-elevator show-total>
<span>
<span class="page-column">
<poptip transfer placement="top-start">
<i-button icon="md-menu">{{$t('app.gridpage.choicecolumns')}}</i-button>
<div slot="content">
<template v-for="col in allColumns">
<div :key="col.name"><el-checkbox v-model="col.show" @change="onColChange()">{{$t(col.langtag)}}</el-checkbox></div>
</template>
</div>
</poptip>
</span>
<span v-if="selections.length > 0" class="batch-toolbar">
</span>
<span class="page-button"><i-button icon="md-refresh" :title="$t('app.gridpage.refresh')" @click="pageRefresh()"></i-button></span>&nbsp;
<span>
{{$t('app.gridpage.show')}}&nbsp;
<span>
<template v-if="items.length === 1">
1
</template>
<template v-else>
<span>{{(curPage - 1) * limit + 1}}&nbsp;-&nbsp;{{totalRecord > curPage * limit ? curPage * limit : totalRecord}}</span>
</template>
</span>&nbsp;
{{$t('app.gridpage.records')}},{{$t('app.gridpage.totle')}}&nbsp;{{totalRecord}}&nbsp;{{$t('app.gridpage.records')}}
</span>
</span>
</page>
</row>
</i-form>
</div>
\ No newline at end of file
<template src="./main-grid.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { MainGridBase } from './main-grid-base';
/**
* grid部件
*
* @export
* @class MainGrid
* @extends {MainGridBase}
*/
@Component({
components: {
}
})
@VueLifeCycleProcessing()
export default class MainGrid extends MainGridBase { }
</script>
import { Prop, Provide, Emit, Model } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs';
import { Watch, MainControlBase } from '@/studio-core';
import UomService from '@/service/uom/uom-service';
import PickupViewpickupviewpanelService from './pickup-viewpickupviewpanel-pickupviewpanel-service';
import PickupViewpickupviewpanelModel from './pickup-viewpickupviewpanel-pickupviewpanel-model';
/**
* pickupviewpanel部件基类
*
* @export
* @class MainControlBase
* @extends {PickupViewpickupviewpanelPickupviewpanelBase}
*/
export class PickupViewpickupviewpanelPickupviewpanelBase extends MainControlBase {
/**
* 建构部件服务对象
*
* @type {PickupViewpickupviewpanelService}
* @memberof PickupViewpickupviewpanelPickupviewpanelBase
*/
public service: PickupViewpickupviewpanelService = new PickupViewpickupviewpanelService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {UomService}
* @memberof PickupViewpickupviewpanelPickupviewpanelBase
*/
public appEntityService: UomService = new UomService({ $store: this.$store });
/**
* 应用实体名称
*
* @protected
* @type {string}
* @memberof PickupViewpickupviewpanelPickupviewpanelBase
*/
protected appDeName: string = 'uom';
/**
* 选中数据字符串
*
* @type {string}
* @memberof PickupViewpickupviewpanel
*/
@Prop() public selectedData?: string;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof PickupViewpickupviewpanel
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof PickupViewpickupviewpanel
*/
public getData(): any {
return {};
}
/**
* 视图名称
*
* @type {*}
* @memberof PickupViewpickupviewpanel
*/
public view: any = {
viewname: 'uom-pickup-grid-view',
data: {},
}
/**
* 局部上下文
*
* @type {*}
* @memberof PickupViewpickupviewpanel
*/
public localContext: any = null;
/**
* 局部视图参数
*
* @type {*}
* @memberof PickupViewpickupviewpanel
*/
public localViewParam: any = null;
/**
* 视图数据
*
* @type {*}
* @memberof PickupViewpickupviewpanel
*/
public viewdata: string = JSON.stringify(this.context);
/**
* 视图参数
*
* @type {*}
* @memberof PickupViewpickupviewpanel
*/
public viewparam: string = JSON.stringify(this.viewparams);
/**
* 是否显示按钮
*
* @type {boolean}
* @memberof PickupViewpickupviewpanel
*/
@Prop({default: true}) public isShowButton!: boolean;
/**
* 是否单选
*
* @type {boolean}
* @memberof PickupViewpickupviewpanel
*/
@Prop() public isSingleSelect?: boolean;
/**
* 初始化完成
*
* @type {boolean}
* @memberof PickupViewpickupviewpanel
*/
public inited: boolean = false;
/**
* 视图数据变化
*
* @param {*} $event
* @memberof PickupViewpickupviewpanel
*/
public onViewDatasChange($event: any): void {
if($event.length>0){
$event.forEach((item:any,index:any) => {
let srfmajortext = item['uomname'];
if(srfmajortext){
Object.assign($event[index],{srfmajortext: srfmajortext});
}
});
}
this.$emit('selectionchange', $event);
}
/**
* 视图数据被激活
*
* @param {*} $event
* @memberof PickupViewpickupviewpanel
*/
public viewDatasActivated($event: any): void {
this.$emit('activated', $event);
}
/**
* 视图加载完成
*
* @param {*} $event
* @memberof PickupViewpickupviewpanel
*/
public onViewLoad($event: any): void {
this.$emit('load', $event);
}
/**
* vue 生命周期
*
* @memberof PickupViewpickupviewpanel
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof PickupViewpickupviewpanel
*/
public afterCreated(){
this.initNavParam();
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
if (Object.is('load', action)) {
this.viewdata = JSON.stringify(this.context);
this.viewparam = JSON.stringify(Object.assign(data, this.viewparams));
this.inited = true;
}
});
}
}
/**
* 初始化导航参数
*
* @memberof PickupViewpickupviewpanel
*/
public initNavParam(){
if(this.localContext && Object.keys(this.localContext).length >0){
let _context:any = this.$util.computedNavData({},this.context,this.viewparams,this.localContext);
Object.assign(this.context,_context);
}
if(this.localViewParam && Object.keys(this.localViewParam).length >0){
let _param:any = this.$util.computedNavData({},this.context,this.viewparams,this.localViewParam);
Object.assign(this.viewparams,_param);
}
this.viewdata = JSON.stringify(this.context);
this.viewparam = JSON.stringify(this.viewparams);
}
/**
* vue 生命周期
*
* @memberof PickupViewpickupviewpanel
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof PickupViewpickupviewpanel
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
}
\ No newline at end of file
/**
* PickupViewpickupviewpanel 部件模型
*
* @export
* @class PickupViewpickupviewpanelModel
*/
export default class PickupViewpickupviewpanelModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof PickupViewpickupviewpanelModel
*/
public getDataItems(): any[] {
return [
{
name: 'overriddencreatedon',
},
{
name: 'baseuomname',
},
{
name: 'updateman',
},
{
name: 'createman',
},
{
name: 'versionnumber',
},
{
name: 'quantity',
},
{
name: 'uom',
prop: 'uomid',
},
{
name: 'schedulebaseuom',
},
{
name: 'organizationid',
},
{
name: 'createdate',
},
{
name: 'updatedate',
},
{
name: 'uomname',
},
{
name: 'utcconversiontimezonecode',
},
{
name: 'timezoneruleversionnumber',
},
{
name: 'importsequencenumber',
},
{
name: 'uomscheduleid',
},
{
name: 'baseuom',
},
]
}
}
\ No newline at end of file
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* PickupViewpickupviewpanel 部件服务对象
*
* @export
* @class PickupViewpickupviewpanelService
*/
export default class PickupViewpickupviewpanelService extends ControlService {
}
\ No newline at end of file
<div class='pickupviewpanel'>
<component
v-if="inited && view.viewname && !Object.is(view.viewname, '')"
:is="view.viewname"
class="viewcontainer3"
:viewdata="viewdata"
:viewparam="viewparam"
:viewDefaultUsage="false"
:isSingleSelect="isSingleSelect"
:selectedData="selectedData"
:isShowButton="isShowButton"
@viewdataschange="onViewDatasChange.apply(_self, arguments)"
@viewdatasactivated="viewDatasActivated.apply(_self, arguments)"
@viewload="onViewLoad.apply(_self, arguments)">
</component>
</div>
\ No newline at end of file
<template src="./pickup-viewpickupviewpanel-pickupviewpanel.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { PickupViewpickupviewpanelPickupviewpanelBase } from './pickup-viewpickupviewpanel-pickupviewpanel-base';
/**
* pickupviewpanel部件
*
* @export
* @class PickupViewpickupviewpanelPickupviewpanel
* @extends {PickupViewpickupviewpanelPickupviewpanelBase}
*/
@Component({
components: {
}
})
@VueLifeCycleProcessing()
export default class PickupViewpickupviewpanelPickupviewpanel extends PickupViewpickupviewpanelPickupviewpanelBase { }
</script>
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.base.domain.Account;
import cn.ibizlab.businesscentral.core.base.service.IAccountService;
import cn.ibizlab.businesscentral.core.base.filter.AccountSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"客户" })
......@@ -65,6 +66,7 @@ public class AccountResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "account" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.accountService.get(#account_id),'iBizBusinessCentral-Account-Update')")
@ApiOperation(value = "更新客户", tags = {"客户" }, notes = "更新客户")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.base.domain.ActivityPointer;
import cn.ibizlab.businesscentral.core.base.service.IActivityPointerService;
import cn.ibizlab.businesscentral.core.base.filter.ActivityPointerSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"活动" })
......@@ -74,6 +75,7 @@ public class ActivityPointerResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "activitypointer" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.activitypointerService.get(#activitypointer_id),'iBizBusinessCentral-ActivityPointer-Update')")
@ApiOperation(value = "更新活动", tags = {"活动" }, notes = "更新活动")
@RequestMapping(method = RequestMethod.PUT, value = "/activitypointers/{activitypointer_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.base.domain.Appointment;
import cn.ibizlab.businesscentral.core.base.service.IAppointmentService;
import cn.ibizlab.businesscentral.core.base.filter.AppointmentSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"约会" })
......@@ -117,6 +118,7 @@ public class AppointmentResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "appointment" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.appointmentService.get(#appointment_id),'iBizBusinessCentral-Appointment-Update')")
@ApiOperation(value = "更新约会", tags = {"约会" }, notes = "更新约会")
@RequestMapping(method = RequestMethod.PUT, value = "/appointments/{appointment_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.marketing.domain.CampaignActivity;
import cn.ibizlab.businesscentral.core.marketing.service.ICampaignActivityService;
import cn.ibizlab.businesscentral.core.marketing.filter.CampaignActivitySearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"市场活动项目" })
......@@ -77,6 +78,7 @@ public class CampaignActivityResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "campaignactivity" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.campaignactivityService.get(#campaignactivity_id),'iBizBusinessCentral-CampaignActivity-Update')")
@ApiOperation(value = "更新市场活动项目", tags = {"市场活动项目" }, notes = "更新市场活动项目")
@RequestMapping(method = RequestMethod.PUT, value = "/campaignactivities/{campaignactivity_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.marketing.domain.CampaignCampaign;
import cn.ibizlab.businesscentral.core.marketing.service.ICampaignCampaignService;
import cn.ibizlab.businesscentral.core.marketing.filter.CampaignCampaignSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"市场活动-市场活动" })
......@@ -61,6 +62,7 @@ public class CampaignCampaignResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@VersionCheck(entity = "campaigncampaign" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.campaigncampaignService.get(#campaigncampaign_id),'iBizBusinessCentral-CampaignCampaign-Update')")
@ApiOperation(value = "更新市场活动-市场活动", tags = {"市场活动-市场活动" }, notes = "更新市场活动-市场活动")
@RequestMapping(method = RequestMethod.PUT, value = "/campaigncampaigns/{campaigncampaign_id}")
......@@ -175,6 +177,7 @@ public class CampaignCampaignResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@VersionCheck(entity = "campaigncampaign" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.campaigncampaignService.get(#campaigncampaign_id),'iBizBusinessCentral-CampaignCampaign-Update')")
@ApiOperation(value = "根据市场活动更新市场活动-市场活动", tags = {"市场活动-市场活动" }, notes = "根据市场活动更新市场活动-市场活动")
@RequestMapping(method = RequestMethod.PUT, value = "/campaigns/{campaign_id}/campaigncampaigns/{campaigncampaign_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.marketing.domain.CampaignList;
import cn.ibizlab.businesscentral.core.marketing.service.ICampaignListService;
import cn.ibizlab.businesscentral.core.marketing.filter.CampaignListSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"市场活动-营销列表" })
......@@ -108,6 +109,7 @@ public class CampaignListResource {
return ResponseEntity.status(HttpStatus.OK).body(campaignlistService.checkKey(campaignlistMapping.toDomain(campaignlistdto)));
}
@VersionCheck(entity = "campaignlist" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.campaignlistService.get(#campaignlist_id),'iBizBusinessCentral-CampaignList-Update')")
@ApiOperation(value = "更新市场活动-营销列表", tags = {"市场活动-营销列表" }, notes = "更新市场活动-营销列表")
@RequestMapping(method = RequestMethod.PUT, value = "/campaignlists/{campaignlist_id}")
......@@ -233,6 +235,7 @@ public class CampaignListResource {
return ResponseEntity.status(HttpStatus.OK).body(campaignlistService.checkKey(campaignlistMapping.toDomain(campaignlistdto)));
}
@VersionCheck(entity = "campaignlist" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.campaignlistService.get(#campaignlist_id),'iBizBusinessCentral-CampaignList-Update')")
@ApiOperation(value = "根据市场活动更新市场活动-营销列表", tags = {"市场活动-营销列表" }, notes = "根据市场活动更新市场活动-营销列表")
@RequestMapping(method = RequestMethod.PUT, value = "/campaigns/{campaign_id}/campaignlists/{campaignlist_id}")
......@@ -365,6 +368,7 @@ public class CampaignListResource {
return ResponseEntity.status(HttpStatus.OK).body(campaignlistService.checkKey(campaignlistMapping.toDomain(campaignlistdto)));
}
@VersionCheck(entity = "campaignlist" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.campaignlistService.get(#campaignlist_id),'iBizBusinessCentral-CampaignList-Update')")
@ApiOperation(value = "根据市场营销列表更新市场活动-营销列表", tags = {"市场活动-营销列表" }, notes = "根据市场营销列表更新市场活动-营销列表")
@RequestMapping(method = RequestMethod.PUT, value = "/ibizlists/{ibizlist_id}/campaignlists/{campaignlist_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.marketing.domain.Campaign;
import cn.ibizlab.businesscentral.core.marketing.service.ICampaignService;
import cn.ibizlab.businesscentral.core.marketing.filter.CampaignSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"市场活动" })
......@@ -86,6 +87,7 @@ public class CampaignResource {
return ResponseEntity.status(HttpStatus.OK).body(campaignMapping.toDto(campaignService.getDraft(new Campaign())));
}
@VersionCheck(entity = "campaign" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.campaignService.get(#campaign_id),'iBizBusinessCentral-Campaign-Update')")
@ApiOperation(value = "更新市场活动", tags = {"市场活动" }, notes = "更新市场活动")
@RequestMapping(method = RequestMethod.PUT, value = "/campaigns/{campaign_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.marketing.domain.CampaignResponse;
import cn.ibizlab.businesscentral.core.marketing.service.ICampaignResponseService;
import cn.ibizlab.businesscentral.core.marketing.filter.CampaignResponseSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"市场活动响应" })
......@@ -102,6 +103,7 @@ public class CampaignResponseResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "campaignresponse" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.campaignresponseService.get(#campaignresponse_id),'iBizBusinessCentral-CampaignResponse-Update')")
@ApiOperation(value = "更新市场活动响应", tags = {"市场活动响应" }, notes = "更新市场活动响应")
@RequestMapping(method = RequestMethod.PUT, value = "/campaignresponses/{campaignresponse_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.sales.domain.Competitor;
import cn.ibizlab.businesscentral.core.sales.service.ICompetitorService;
import cn.ibizlab.businesscentral.core.sales.filter.CompetitorSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"竞争对手" })
......@@ -62,6 +63,7 @@ public class CompetitorResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "competitor" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.competitorService.get(#competitor_id),'iBizBusinessCentral-Competitor-Update')")
@ApiOperation(value = "更新竞争对手", tags = {"竞争对手" }, notes = "更新竞争对手")
@RequestMapping(method = RequestMethod.PUT, value = "/competitors/{competitor_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.base.domain.Contact;
import cn.ibizlab.businesscentral.core.base.service.IContactService;
import cn.ibizlab.businesscentral.core.base.filter.ContactSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"联系人" })
......@@ -92,6 +93,7 @@ public class ContactResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "contact" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.contactService.get(#contact_id),'iBizBusinessCentral-Contact-Update')")
@ApiOperation(value = "更新联系人", tags = {"联系人" }, notes = "更新联系人")
@RequestMapping(method = RequestMethod.PUT, value = "/contacts/{contact_id}")
......@@ -210,6 +212,7 @@ public class ContactResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "contact" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.contactService.get(#contact_id),'iBizBusinessCentral-Contact-Update')")
@ApiOperation(value = "根据客户更新联系人", tags = {"联系人" }, notes = "根据客户更新联系人")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/contacts/{contact_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.base.domain.Email;
import cn.ibizlab.businesscentral.core.base.service.IEmailService;
import cn.ibizlab.businesscentral.core.base.filter.EmailSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"电子邮件" })
......@@ -80,6 +81,7 @@ public class EmailResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "email" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.emailService.get(#email_id),'iBizBusinessCentral-Email-Update')")
@ApiOperation(value = "更新电子邮件", tags = {"电子邮件" }, notes = "更新电子邮件")
@RequestMapping(method = RequestMethod.PUT, value = "/emails/{email_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.base.domain.Fax;
import cn.ibizlab.businesscentral.core.base.service.IFaxService;
import cn.ibizlab.businesscentral.core.base.filter.FaxSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"传真" })
......@@ -71,6 +72,7 @@ public class FaxResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "fax" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.faxService.get(#fax_id),'iBizBusinessCentral-Fax-Update')")
@ApiOperation(value = "更新传真", tags = {"传真" }, notes = "更新传真")
@RequestMapping(method = RequestMethod.PUT, value = "/faxes/{fax_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.sales.domain.Goal;
import cn.ibizlab.businesscentral.core.sales.service.IGoalService;
import cn.ibizlab.businesscentral.core.sales.filter.GoalSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"目标" })
......@@ -105,6 +106,7 @@ public class GoalResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "goal" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.goalService.get(#goal_id),'iBizBusinessCentral-Goal-Update')")
@ApiOperation(value = "更新目标", tags = {"目标" }, notes = "更新目标")
@RequestMapping(method = RequestMethod.PUT, value = "/goals/{goal_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.marketing.domain.IBizList;
import cn.ibizlab.businesscentral.core.marketing.service.IIBizListService;
import cn.ibizlab.businesscentral.core.marketing.filter.IBizListSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"市场营销列表" })
......@@ -83,6 +84,7 @@ public class IBizListResource {
return ResponseEntity.status(HttpStatus.OK).body(ibizlistService.checkKey(ibizlistMapping.toDomain(ibizlistdto)));
}
@VersionCheck(entity = "ibizlist" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.ibizlistService.get(#ibizlist_id),'iBizBusinessCentral-IBizList-Update')")
@ApiOperation(value = "更新市场营销列表", tags = {"市场营销列表" }, notes = "更新市场营销列表")
@RequestMapping(method = RequestMethod.PUT, value = "/ibizlists/{ibizlist_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.service.domain.IBizService;
import cn.ibizlab.businesscentral.core.service.service.IIBizServiceService;
import cn.ibizlab.businesscentral.core.service.filter.IBizServiceSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"服务" })
......@@ -89,6 +90,7 @@ public class IBizServiceResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "ibizservice" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.ibizserviceService.get(#ibizservice_id),'iBizBusinessCentral-IBizService-Update')")
@ApiOperation(value = "更新服务", tags = {"服务" }, notes = "更新服务")
@RequestMapping(method = RequestMethod.PUT, value = "/ibizservices/{ibizservice_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.service.domain.Incident;
import cn.ibizlab.businesscentral.core.service.service.IIncidentService;
import cn.ibizlab.businesscentral.core.service.filter.IncidentSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"案例" })
......@@ -52,6 +53,7 @@ public class IncidentResource {
return ResponseEntity.status(HttpStatus.OK).body(incidentMapping.toDto(incidentService.getDraft(new Incident())));
}
@VersionCheck(entity = "incident" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.incidentService.get(#incident_id),'iBizBusinessCentral-Incident-Update')")
@ApiOperation(value = "更新案例", tags = {"案例" }, notes = "更新案例")
@RequestMapping(method = RequestMethod.PUT, value = "/incidents/{incident_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.finance.domain.Invoice;
import cn.ibizlab.businesscentral.core.finance.service.IInvoiceService;
import cn.ibizlab.businesscentral.core.finance.filter.InvoiceSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"发票" })
......@@ -71,6 +72,7 @@ public class InvoiceResource {
return ResponseEntity.status(HttpStatus.OK).body(invoiceMapping.toDto(invoiceService.getDraft(new Invoice())));
}
@VersionCheck(entity = "invoice" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.invoiceService.get(#invoice_id),'iBizBusinessCentral-Invoice-Update')")
@ApiOperation(value = "更新发票", tags = {"发票" }, notes = "更新发票")
@RequestMapping(method = RequestMethod.PUT, value = "/invoices/{invoice_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.sales.domain.Lead;
import cn.ibizlab.businesscentral.core.sales.service.ILeadService;
import cn.ibizlab.businesscentral.core.sales.filter.LeadSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"潜在顾客" })
......@@ -46,6 +47,7 @@ public class LeadResource {
@Lazy
public LeadMapping leadMapping;
@VersionCheck(entity = "lead" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.leadService.get(#lead_id),'iBizBusinessCentral-Lead-Update')")
@ApiOperation(value = "更新潜在顾客", tags = {"潜在顾客" }, notes = "更新潜在顾客")
@RequestMapping(method = RequestMethod.PUT, value = "/leads/{lead_id}")
......@@ -182,6 +184,7 @@ public class LeadResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(leadMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@VersionCheck(entity = "lead" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.leadService.get(#lead_id),'iBizBusinessCentral-Lead-Update')")
@ApiOperation(value = "根据市场活动更新潜在顾客", tags = {"潜在顾客" }, notes = "根据市场活动更新潜在顾客")
@RequestMapping(method = RequestMethod.PUT, value = "/campaigns/{campaign_id}/leads/{lead_id}")
......@@ -338,6 +341,7 @@ public class LeadResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(leadMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@VersionCheck(entity = "lead" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.leadService.get(#lead_id),'iBizBusinessCentral-Lead-Update')")
@ApiOperation(value = "根据联系人更新潜在顾客", tags = {"潜在顾客" }, notes = "根据联系人更新潜在顾客")
@RequestMapping(method = RequestMethod.PUT, value = "/contacts/{contact_id}/leads/{lead_id}")
......@@ -494,6 +498,7 @@ public class LeadResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(leadMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@VersionCheck(entity = "lead" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.leadService.get(#lead_id),'iBizBusinessCentral-Lead-Update')")
@ApiOperation(value = "根据客户联系人更新潜在顾客", tags = {"潜在顾客" }, notes = "根据客户联系人更新潜在顾客")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/contacts/{contact_id}/leads/{lead_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.base.domain.Letter;
import cn.ibizlab.businesscentral.core.base.service.ILetterService;
import cn.ibizlab.businesscentral.core.base.filter.LetterSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"信件" })
......@@ -96,6 +97,7 @@ public class LetterResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "letter" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.letterService.get(#letter_id),'iBizBusinessCentral-Letter-Update')")
@ApiOperation(value = "更新信件", tags = {"信件" }, notes = "更新信件")
@RequestMapping(method = RequestMethod.PUT, value = "/letters/{letter_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.marketing.domain.ListAccount;
import cn.ibizlab.businesscentral.core.marketing.service.IListAccountService;
import cn.ibizlab.businesscentral.core.marketing.filter.ListAccountSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"营销列表-账户" })
......@@ -89,6 +90,7 @@ public class ListAccountResource {
return ResponseEntity.status(HttpStatus.OK).body(listaccountMapping.toDto(listaccountService.getDraft(new ListAccount())));
}
@VersionCheck(entity = "listaccount" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.listaccountService.get(#listaccount_id),'iBizBusinessCentral-ListAccount-Update')")
@ApiOperation(value = "更新营销列表-账户", tags = {"营销列表-账户" }, notes = "更新营销列表-账户")
@RequestMapping(method = RequestMethod.PUT, value = "/listaccounts/{listaccount_id}")
......@@ -209,6 +211,7 @@ public class ListAccountResource {
return ResponseEntity.status(HttpStatus.OK).body(listaccountMapping.toDto(listaccountService.getDraft(domain)));
}
@VersionCheck(entity = "listaccount" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.listaccountService.get(#listaccount_id),'iBizBusinessCentral-ListAccount-Update')")
@ApiOperation(value = "根据客户更新营销列表-账户", tags = {"营销列表-账户" }, notes = "根据客户更新营销列表-账户")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/listaccounts/{listaccount_id}")
......@@ -341,6 +344,7 @@ public class ListAccountResource {
return ResponseEntity.status(HttpStatus.OK).body(listaccountMapping.toDto(listaccountService.getDraft(domain)));
}
@VersionCheck(entity = "listaccount" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.listaccountService.get(#listaccount_id),'iBizBusinessCentral-ListAccount-Update')")
@ApiOperation(value = "根据市场营销列表更新营销列表-账户", tags = {"营销列表-账户" }, notes = "根据市场营销列表更新营销列表-账户")
@RequestMapping(method = RequestMethod.PUT, value = "/ibizlists/{ibizlist_id}/listaccounts/{listaccount_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.marketing.domain.ListContact;
import cn.ibizlab.businesscentral.core.marketing.service.IListContactService;
import cn.ibizlab.businesscentral.core.marketing.filter.ListContactSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"营销列表-联系人" })
......@@ -74,6 +75,7 @@ public class ListContactResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "listcontact" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.listcontactService.get(#listcontact_id),'iBizBusinessCentral-ListContact-Update')")
@ApiOperation(value = "更新营销列表-联系人", tags = {"营销列表-联系人" }, notes = "更新营销列表-联系人")
@RequestMapping(method = RequestMethod.PUT, value = "/listcontacts/{listcontact_id}")
......@@ -188,6 +190,7 @@ public class ListContactResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "listcontact" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.listcontactService.get(#listcontact_id),'iBizBusinessCentral-ListContact-Update')")
@ApiOperation(value = "根据联系人更新营销列表-联系人", tags = {"营销列表-联系人" }, notes = "根据联系人更新营销列表-联系人")
@RequestMapping(method = RequestMethod.PUT, value = "/contacts/{contact_id}/listcontacts/{listcontact_id}")
......@@ -320,6 +323,7 @@ public class ListContactResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "listcontact" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.listcontactService.get(#listcontact_id),'iBizBusinessCentral-ListContact-Update')")
@ApiOperation(value = "根据市场营销列表更新营销列表-联系人", tags = {"营销列表-联系人" }, notes = "根据市场营销列表更新营销列表-联系人")
@RequestMapping(method = RequestMethod.PUT, value = "/ibizlists/{ibizlist_id}/listcontacts/{listcontact_id}")
......@@ -452,6 +456,7 @@ public class ListContactResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "listcontact" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.listcontactService.get(#listcontact_id),'iBizBusinessCentral-ListContact-Update')")
@ApiOperation(value = "根据客户联系人更新营销列表-联系人", tags = {"营销列表-联系人" }, notes = "根据客户联系人更新营销列表-联系人")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/contacts/{contact_id}/listcontacts/{listcontact_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.marketing.domain.ListLead;
import cn.ibizlab.businesscentral.core.marketing.service.IListLeadService;
import cn.ibizlab.businesscentral.core.marketing.filter.ListLeadSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"营销列表-潜在客户" })
......@@ -87,6 +88,7 @@ public class ListLeadResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "listlead" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.listleadService.get(#listlead_id),'iBizBusinessCentral-ListLead-Update')")
@ApiOperation(value = "更新营销列表-潜在客户", tags = {"营销列表-潜在客户" }, notes = "更新营销列表-潜在客户")
@RequestMapping(method = RequestMethod.PUT, value = "/listleads/{listlead_id}")
......@@ -204,6 +206,7 @@ public class ListLeadResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "listlead" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.listleadService.get(#listlead_id),'iBizBusinessCentral-ListLead-Update')")
@ApiOperation(value = "根据潜在顾客更新营销列表-潜在客户", tags = {"营销列表-潜在客户" }, notes = "根据潜在顾客更新营销列表-潜在客户")
@RequestMapping(method = RequestMethod.PUT, value = "/leads/{lead_id}/listleads/{listlead_id}")
......@@ -336,6 +339,7 @@ public class ListLeadResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "listlead" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.listleadService.get(#listlead_id),'iBizBusinessCentral-ListLead-Update')")
@ApiOperation(value = "根据市场营销列表更新营销列表-潜在客户", tags = {"营销列表-潜在客户" }, notes = "根据市场营销列表更新营销列表-潜在客户")
@RequestMapping(method = RequestMethod.PUT, value = "/ibizlists/{ibizlist_id}/listleads/{listlead_id}")
......@@ -468,6 +472,7 @@ public class ListLeadResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "listlead" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.listleadService.get(#listlead_id),'iBizBusinessCentral-ListLead-Update')")
@ApiOperation(value = "根据市场活动潜在顾客更新营销列表-潜在客户", tags = {"营销列表-潜在客户" }, notes = "根据市场活动潜在顾客更新营销列表-潜在客户")
@RequestMapping(method = RequestMethod.PUT, value = "/campaigns/{campaign_id}/leads/{lead_id}/listleads/{listlead_id}")
......@@ -600,6 +605,7 @@ public class ListLeadResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "listlead" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.listleadService.get(#listlead_id),'iBizBusinessCentral-ListLead-Update')")
@ApiOperation(value = "根据联系人潜在顾客更新营销列表-潜在客户", tags = {"营销列表-潜在客户" }, notes = "根据联系人潜在顾客更新营销列表-潜在客户")
@RequestMapping(method = RequestMethod.PUT, value = "/contacts/{contact_id}/leads/{lead_id}/listleads/{listlead_id}")
......@@ -732,6 +738,7 @@ public class ListLeadResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "listlead" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.listleadService.get(#listlead_id),'iBizBusinessCentral-ListLead-Update')")
@ApiOperation(value = "根据客户联系人潜在顾客更新营销列表-潜在客户", tags = {"营销列表-潜在客户" }, notes = "根据客户联系人潜在顾客更新营销列表-潜在客户")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/contacts/{contact_id}/leads/{lead_id}/listleads/{listlead_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.sales.domain.OpportunityCompetitor;
import cn.ibizlab.businesscentral.core.sales.service.IOpportunityCompetitorService;
import cn.ibizlab.businesscentral.core.sales.filter.OpportunityCompetitorSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"商机对手" })
......@@ -117,6 +118,7 @@ public class OpportunityCompetitorResource {
return ResponseEntity.status(HttpStatus.OK).body(opportunitycompetitorService.checkKey(opportunitycompetitorMapping.toDomain(opportunitycompetitordto)));
}
@VersionCheck(entity = "opportunitycompetitor" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.opportunitycompetitorService.get(#opportunitycompetitor_id),'iBizBusinessCentral-OpportunityCompetitor-Update')")
@ApiOperation(value = "更新商机对手", tags = {"商机对手" }, notes = "更新商机对手")
@RequestMapping(method = RequestMethod.PUT, value = "/opportunitycompetitors/{opportunitycompetitor_id}")
......@@ -242,6 +244,7 @@ public class OpportunityCompetitorResource {
return ResponseEntity.status(HttpStatus.OK).body(opportunitycompetitorService.checkKey(opportunitycompetitorMapping.toDomain(opportunitycompetitordto)));
}
@VersionCheck(entity = "opportunitycompetitor" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.opportunitycompetitorService.get(#opportunitycompetitor_id),'iBizBusinessCentral-OpportunityCompetitor-Update')")
@ApiOperation(value = "根据竞争对手更新商机对手", tags = {"商机对手" }, notes = "根据竞争对手更新商机对手")
@RequestMapping(method = RequestMethod.PUT, value = "/competitors/{competitor_id}/opportunitycompetitors/{opportunitycompetitor_id}")
......@@ -374,6 +377,7 @@ public class OpportunityCompetitorResource {
return ResponseEntity.status(HttpStatus.OK).body(opportunitycompetitorService.checkKey(opportunitycompetitorMapping.toDomain(opportunitycompetitordto)));
}
@VersionCheck(entity = "opportunitycompetitor" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.opportunitycompetitorService.get(#opportunitycompetitor_id),'iBizBusinessCentral-OpportunityCompetitor-Update')")
@ApiOperation(value = "根据商机更新商机对手", tags = {"商机对手" }, notes = "根据商机更新商机对手")
@RequestMapping(method = RequestMethod.PUT, value = "/opportunities/{opportunity_id}/opportunitycompetitors/{opportunitycompetitor_id}")
......@@ -506,6 +510,7 @@ public class OpportunityCompetitorResource {
return ResponseEntity.status(HttpStatus.OK).body(opportunitycompetitorService.checkKey(opportunitycompetitorMapping.toDomain(opportunitycompetitordto)));
}
@VersionCheck(entity = "opportunitycompetitor" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.opportunitycompetitorService.get(#opportunitycompetitor_id),'iBizBusinessCentral-OpportunityCompetitor-Update')")
@ApiOperation(value = "根据联系人商机更新商机对手", tags = {"商机对手" }, notes = "根据联系人商机更新商机对手")
@RequestMapping(method = RequestMethod.PUT, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/{opportunitycompetitor_id}")
......@@ -638,6 +643,7 @@ public class OpportunityCompetitorResource {
return ResponseEntity.status(HttpStatus.OK).body(opportunitycompetitorService.checkKey(opportunitycompetitorMapping.toDomain(opportunitycompetitordto)));
}
@VersionCheck(entity = "opportunitycompetitor" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.opportunitycompetitorService.get(#opportunitycompetitor_id),'iBizBusinessCentral-OpportunityCompetitor-Update')")
@ApiOperation(value = "根据客户联系人商机更新商机对手", tags = {"商机对手" }, notes = "根据客户联系人商机更新商机对手")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/{opportunitycompetitor_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.sales.domain.OpportunityProduct;
import cn.ibizlab.businesscentral.core.sales.service.IOpportunityProductService;
import cn.ibizlab.businesscentral.core.sales.filter.OpportunityProductSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"商机产品" })
......@@ -89,6 +90,7 @@ public class OpportunityProductResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "opportunityproduct" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.opportunityproductService.get(#opportunityproduct_id),'iBizBusinessCentral-OpportunityProduct-Update')")
@ApiOperation(value = "更新商机产品", tags = {"商机产品" }, notes = "更新商机产品")
@RequestMapping(method = RequestMethod.PUT, value = "/opportunityproducts/{opportunityproduct_id}")
......@@ -209,6 +211,7 @@ public class OpportunityProductResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "opportunityproduct" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.opportunityproductService.get(#opportunityproduct_id),'iBizBusinessCentral-OpportunityProduct-Update')")
@ApiOperation(value = "根据商机更新商机产品", tags = {"商机产品" }, notes = "根据商机更新商机产品")
@RequestMapping(method = RequestMethod.PUT, value = "/opportunities/{opportunity_id}/opportunityproducts/{opportunityproduct_id}")
......@@ -341,6 +344,7 @@ public class OpportunityProductResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "opportunityproduct" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.opportunityproductService.get(#opportunityproduct_id),'iBizBusinessCentral-OpportunityProduct-Update')")
@ApiOperation(value = "根据联系人商机更新商机产品", tags = {"商机产品" }, notes = "根据联系人商机更新商机产品")
@RequestMapping(method = RequestMethod.PUT, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/opportunityproducts/{opportunityproduct_id}")
......@@ -473,6 +477,7 @@ public class OpportunityProductResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "opportunityproduct" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.opportunityproductService.get(#opportunityproduct_id),'iBizBusinessCentral-OpportunityProduct-Update')")
@ApiOperation(value = "根据客户联系人商机更新商机产品", tags = {"商机产品" }, notes = "根据客户联系人商机更新商机产品")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunityproducts/{opportunityproduct_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.sales.domain.Opportunity;
import cn.ibizlab.businesscentral.core.sales.service.IOpportunityService;
import cn.ibizlab.businesscentral.core.sales.filter.OpportunitySearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"商机" })
......@@ -120,6 +121,7 @@ public class OpportunityResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "opportunity" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.opportunityService.get(#opportunity_id),'iBizBusinessCentral-Opportunity-Update')")
@ApiOperation(value = "更新商机", tags = {"商机" }, notes = "更新商机")
@RequestMapping(method = RequestMethod.PUT, value = "/opportunities/{opportunity_id}")
......@@ -263,6 +265,7 @@ public class OpportunityResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "opportunity" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.opportunityService.get(#opportunity_id),'iBizBusinessCentral-Opportunity-Update')")
@ApiOperation(value = "根据联系人更新商机", tags = {"商机" }, notes = "根据联系人更新商机")
@RequestMapping(method = RequestMethod.PUT, value = "/contacts/{contact_id}/opportunities/{opportunity_id}")
......@@ -419,6 +422,7 @@ public class OpportunityResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "opportunity" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.opportunityService.get(#opportunity_id),'iBizBusinessCentral-Opportunity-Update')")
@ApiOperation(value = "根据客户联系人更新商机", tags = {"商机" }, notes = "根据客户联系人更新商机")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.base.domain.PhoneCall;
import cn.ibizlab.businesscentral.core.base.service.IPhoneCallService;
import cn.ibizlab.businesscentral.core.base.filter.PhoneCallSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"电话联络" })
......@@ -80,6 +81,7 @@ public class PhoneCallResource {
return ResponseEntity.status(HttpStatus.OK).body(phonecallService.checkKey(phonecallMapping.toDomain(phonecalldto)));
}
@VersionCheck(entity = "phonecall" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.phonecallService.get(#phonecall_id),'iBizBusinessCentral-PhoneCall-Update')")
@ApiOperation(value = "更新电话联络", tags = {"电话联络" }, notes = "更新电话联络")
@RequestMapping(method = RequestMethod.PUT, value = "/phonecalls/{phonecall_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.product.domain.PriceLevel;
import cn.ibizlab.businesscentral.core.product.service.IPriceLevelService;
import cn.ibizlab.businesscentral.core.product.filter.PriceLevelSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"价目表" })
......@@ -71,6 +72,7 @@ public class PriceLevelResource {
return ResponseEntity.status(HttpStatus.OK).body(pricelevelMapping.toDto(pricelevelService.getDraft(new PriceLevel())));
}
@VersionCheck(entity = "pricelevel" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.pricelevelService.get(#pricelevel_id),'iBizBusinessCentral-PriceLevel-Update')")
@ApiOperation(value = "更新价目表", tags = {"价目表" }, notes = "更新价目表")
@RequestMapping(method = RequestMethod.PUT, value = "/pricelevels/{pricelevel_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.product.domain.Product;
import cn.ibizlab.businesscentral.core.product.service.IProductService;
import cn.ibizlab.businesscentral.core.product.filter.ProductSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"产品" })
......@@ -86,6 +87,7 @@ public class ProductResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "product" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.productService.get(#product_id),'iBizBusinessCentral-Product-Update')")
@ApiOperation(value = "更新产品", tags = {"产品" }, notes = "更新产品")
@RequestMapping(method = RequestMethod.PUT, value = "/products/{product_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.sales.domain.QuoteDetail;
import cn.ibizlab.businesscentral.core.sales.service.IQuoteDetailService;
import cn.ibizlab.businesscentral.core.sales.filter.QuoteDetailSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"报价单产品" })
......@@ -52,6 +53,7 @@ public class QuoteDetailResource {
return ResponseEntity.status(HttpStatus.OK).body(quotedetailMapping.toDto(quotedetailService.getDraft(new QuoteDetail())));
}
@VersionCheck(entity = "quotedetail" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.quotedetailService.get(#quotedetail_id),'iBizBusinessCentral-QuoteDetail-Update')")
@ApiOperation(value = "更新报价单产品", tags = {"报价单产品" }, notes = "更新报价单产品")
@RequestMapping(method = RequestMethod.PUT, value = "/quotedetails/{quotedetail_id}")
......@@ -166,6 +168,7 @@ public class QuoteDetailResource {
return ResponseEntity.status(HttpStatus.OK).body(quotedetailMapping.toDto(quotedetailService.getDraft(domain)));
}
@VersionCheck(entity = "quotedetail" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.quotedetailService.get(#quotedetail_id),'iBizBusinessCentral-QuoteDetail-Update')")
@ApiOperation(value = "根据报价单更新报价单产品", tags = {"报价单产品" }, notes = "根据报价单更新报价单产品")
@RequestMapping(method = RequestMethod.PUT, value = "/quotes/{quote_id}/quotedetails/{quotedetail_id}")
......@@ -298,6 +301,7 @@ public class QuoteDetailResource {
return ResponseEntity.status(HttpStatus.OK).body(quotedetailMapping.toDto(quotedetailService.getDraft(domain)));
}
@VersionCheck(entity = "quotedetail" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.quotedetailService.get(#quotedetail_id),'iBizBusinessCentral-QuoteDetail-Update')")
@ApiOperation(value = "根据商机报价单更新报价单产品", tags = {"报价单产品" }, notes = "根据商机报价单更新报价单产品")
@RequestMapping(method = RequestMethod.PUT, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/{quotedetail_id}")
......@@ -430,6 +434,7 @@ public class QuoteDetailResource {
return ResponseEntity.status(HttpStatus.OK).body(quotedetailMapping.toDto(quotedetailService.getDraft(domain)));
}
@VersionCheck(entity = "quotedetail" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.quotedetailService.get(#quotedetail_id),'iBizBusinessCentral-QuoteDetail-Update')")
@ApiOperation(value = "根据联系人商机报价单更新报价单产品", tags = {"报价单产品" }, notes = "根据联系人商机报价单更新报价单产品")
@RequestMapping(method = RequestMethod.PUT, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/{quotedetail_id}")
......@@ -562,6 +567,7 @@ public class QuoteDetailResource {
return ResponseEntity.status(HttpStatus.OK).body(quotedetailMapping.toDto(quotedetailService.getDraft(domain)));
}
@VersionCheck(entity = "quotedetail" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.quotedetailService.get(#quotedetail_id),'iBizBusinessCentral-QuoteDetail-Update')")
@ApiOperation(value = "根据客户联系人商机报价单更新报价单产品", tags = {"报价单产品" }, notes = "根据客户联系人商机报价单更新报价单产品")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/{quotedetail_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.sales.domain.Quote;
import cn.ibizlab.businesscentral.core.sales.service.IQuoteService;
import cn.ibizlab.businesscentral.core.sales.filter.QuoteSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"报价单" })
......@@ -96,6 +97,7 @@ public class QuoteResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "quote" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.quoteService.get(#quote_id),'iBizBusinessCentral-Quote-Update')")
@ApiOperation(value = "更新报价单", tags = {"报价单" }, notes = "更新报价单")
@RequestMapping(method = RequestMethod.PUT, value = "/quotes/{quote_id}")
......@@ -219,6 +221,7 @@ public class QuoteResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "quote" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.quoteService.get(#quote_id),'iBizBusinessCentral-Quote-Update')")
@ApiOperation(value = "根据商机更新报价单", tags = {"报价单" }, notes = "根据商机更新报价单")
@RequestMapping(method = RequestMethod.PUT, value = "/opportunities/{opportunity_id}/quotes/{quote_id}")
......@@ -351,6 +354,7 @@ public class QuoteResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "quote" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.quoteService.get(#quote_id),'iBizBusinessCentral-Quote-Update')")
@ApiOperation(value = "根据联系人商机更新报价单", tags = {"报价单" }, notes = "根据联系人商机更新报价单")
@RequestMapping(method = RequestMethod.PUT, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}")
......@@ -483,6 +487,7 @@ public class QuoteResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "quote" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.quoteService.get(#quote_id),'iBizBusinessCentral-Quote-Update')")
@ApiOperation(value = "根据客户联系人商机更新报价单", tags = {"报价单" }, notes = "根据客户联系人商机更新报价单")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.sales.domain.SalesLiterature;
import cn.ibizlab.businesscentral.core.sales.service.ISalesLiteratureService;
import cn.ibizlab.businesscentral.core.sales.filter.SalesLiteratureSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"销售宣传资料" })
......@@ -111,6 +112,7 @@ public class SalesLiteratureResource {
return ResponseEntity.status(HttpStatus.OK).body(salesliteratureService.checkKey(salesliteratureMapping.toDomain(salesliteraturedto)));
}
@VersionCheck(entity = "salesliterature" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.salesliteratureService.get(#salesliterature_id),'iBizBusinessCentral-SalesLiterature-Update')")
@ApiOperation(value = "更新销售宣传资料", tags = {"销售宣传资料" }, notes = "更新销售宣传资料")
@RequestMapping(method = RequestMethod.PUT, value = "/salesliteratures/{salesliterature_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.sales.domain.SalesOrderDetail;
import cn.ibizlab.businesscentral.core.sales.service.ISalesOrderDetailService;
import cn.ibizlab.businesscentral.core.sales.filter.SalesOrderDetailSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"订单产品" })
......@@ -86,6 +87,7 @@ public class SalesOrderDetailResource {
return ResponseEntity.status(HttpStatus.OK).body(salesorderdetailMapping.toDto(salesorderdetailService.getDraft(new SalesOrderDetail())));
}
@VersionCheck(entity = "salesorderdetail" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.salesorderdetailService.get(#salesorderdetail_id),'iBizBusinessCentral-SalesOrderDetail-Update')")
@ApiOperation(value = "更新订单产品", tags = {"订单产品" }, notes = "更新订单产品")
@RequestMapping(method = RequestMethod.PUT, value = "/salesorderdetails/{salesorderdetail_id}")
......@@ -205,6 +207,7 @@ public class SalesOrderDetailResource {
return ResponseEntity.status(HttpStatus.OK).body(salesorderdetailMapping.toDto(salesorderdetailService.getDraft(domain)));
}
@VersionCheck(entity = "salesorderdetail" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.salesorderdetailService.get(#salesorderdetail_id),'iBizBusinessCentral-SalesOrderDetail-Update')")
@ApiOperation(value = "根据订单更新订单产品", tags = {"订单产品" }, notes = "根据订单更新订单产品")
@RequestMapping(method = RequestMethod.PUT, value = "/salesorders/{salesorder_id}/salesorderdetails/{salesorderdetail_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.sales.domain.SalesOrder;
import cn.ibizlab.businesscentral.core.sales.service.ISalesOrderService;
import cn.ibizlab.businesscentral.core.sales.filter.SalesOrderSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"订单" })
......@@ -98,6 +99,7 @@ public class SalesOrderResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "salesorder" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.salesorderService.get(#salesorder_id),'iBizBusinessCentral-SalesOrder-Update')")
@ApiOperation(value = "更新订单", tags = {"订单" }, notes = "更新订单")
@RequestMapping(method = RequestMethod.PUT, value = "/salesorders/{salesorder_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.service.domain.ServiceAppointment;
import cn.ibizlab.businesscentral.core.service.service.IServiceAppointmentService;
import cn.ibizlab.businesscentral.core.service.filter.ServiceAppointmentSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"服务活动" })
......@@ -92,6 +93,7 @@ public class ServiceAppointmentResource {
return ResponseEntity.status(HttpStatus.OK).body(serviceappointmentService.checkKey(serviceappointmentMapping.toDomain(serviceappointmentdto)));
}
@VersionCheck(entity = "serviceappointment" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.serviceappointmentService.get(#serviceappointment_id),'iBizBusinessCentral-ServiceAppointment-Update')")
@ApiOperation(value = "更新服务活动", tags = {"服务活动" }, notes = "更新服务活动")
@RequestMapping(method = RequestMethod.PUT, value = "/serviceappointments/{serviceappointment_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.base.domain.Task;
import cn.ibizlab.businesscentral.core.base.service.ITaskService;
import cn.ibizlab.businesscentral.core.base.filter.TaskSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"任务" })
......@@ -117,6 +118,7 @@ public class TaskResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@VersionCheck(entity = "task" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.taskService.get(#task_id),'iBizBusinessCentral-Task-Update')")
@ApiOperation(value = "更新任务", tags = {"任务" }, notes = "更新任务")
@RequestMapping(method = RequestMethod.PUT, value = "/tasks/{task_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.base.domain.TransactionCurrency;
import cn.ibizlab.businesscentral.core.base.service.ITransactionCurrencyService;
import cn.ibizlab.businesscentral.core.base.filter.TransactionCurrencySearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"货币" })
......@@ -86,6 +87,7 @@ public class TransactionCurrencyResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "transactioncurrency" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.transactioncurrencyService.get(#transactioncurrency_id),'iBizBusinessCentral-TransactionCurrency-Update')")
@ApiOperation(value = "更新货币", tags = {"货币" }, notes = "更新货币")
@RequestMapping(method = RequestMethod.PUT, value = "/transactioncurrencies/{transactioncurrency_id}")
......
......@@ -32,6 +32,7 @@ import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.base.domain.Uom;
import cn.ibizlab.businesscentral.core.base.service.IUomService;
import cn.ibizlab.businesscentral.core.base.filter.UomSearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"计价单位" })
......@@ -117,6 +118,7 @@ public class UomResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "uom" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.uomService.get(#uom_id),'iBizBusinessCentral-Uom-Update')")
@ApiOperation(value = "更新计价单位", tags = {"计价单位" }, notes = "更新计价单位")
@RequestMapping(method = RequestMethod.PUT, value = "/uoms/{uom_id}")
......
package cn.ibizlab.businesscentral.util.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD})
public @interface VersionCheck
{
String entity();
String versionfield();
}
package cn.ibizlab.businesscentral.util.aspect;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
import cn.ibizlab.businesscentral.util.domain.EntityBase;
import cn.ibizlab.businesscentral.util.errors.BadRequestAlertException;
import cn.ibizlab.businesscentral.util.helper.RuleUtils;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.core.annotation.Order;
import org.springframework.expression.EvaluationContext;
import org.springframework.expression.Expression;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.expression.spel.support.StandardEvaluationContext;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import java.lang.reflect.Field;
/**
* 数据库版本检查
*/
@Aspect
@Order(0)
@Component
public class VersionCheckAspect
{
private final ExpressionParser parser = new SpelExpressionParser();
@SneakyThrows
@Before("execution(* cn.ibizlab.businesscentral.*.rest.*.update(..)) && @annotation(versionCheck)")
public void BeforeUpdate(JoinPoint point, VersionCheck versionCheck){
EvaluationContext context = new StandardEvaluationContext();
Object[] args = point.getArgs();
Object id=args[0];
Object dto=args[1];
if(ObjectUtils.isEmpty(id) || ObjectUtils.isEmpty(dto))
return;
String versionField=versionCheck.versionfield();
if(StringUtils.isEmpty(versionCheck))
return;
context.setVariable("dto",dto);
Expression newExp = parser.parseExpression(String.format("#dto.%s",versionField));
Object newVersion=newExp.getValue(context);
if(ObjectUtils.isEmpty(newVersion))
return;
//进行版本检查
Object oldVersion =getDBVersion(versionCheck,getService(point.getTarget(),versionCheck.entity()),id);
if(!ObjectUtils.isEmpty(oldVersion)){
if(RuleUtils.gt(newVersion,oldVersion))
throw new BadRequestAlertException("数据已变更,可能后台数据已被修改,请重新加载数据","VersionCheckAspect","versionCheck");
}
}
/**
* 获取实体服务对象
* @param resource
* @param entity
* @return
*/
@SneakyThrows
private Object getService(Object resource,String entity){
Object service = null;
Field[] fields= resource.getClass().getDeclaredFields();
for(Field field : fields){
if(field.getModifiers()==1 && field.getName().equalsIgnoreCase(String.format("%sService",entity))){
service=field.get(resource);
break;
}
}
return service;
}
/**
* 获取数据库版本
* @param versionCheck
* @param service
* @param id
* @return
*/
@SneakyThrows
private Object getDBVersion(VersionCheck versionCheck,Object service,Object id){
Object dbVersion=null;
String versionField=versionCheck.versionfield();
if(!ObjectUtils.isEmpty(service)){
EvaluationContext oldContext = new StandardEvaluationContext();
oldContext.setVariable("service",service);
oldContext.setVariable("id",id);
Expression oldExp = parser.parseExpression("#service.get(#id)");
EntityBase oldEntity =oldExp.getValue(oldContext, EntityBase.class);
return oldEntity.get(versionField);
}
return dbVersion;
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册