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

chitanda 发布系统代码

上级 6541c9ca
<template>
<el-select size="small" class="filter-mode" placeholder="条件逻辑" v-model="curVal" @change="onChange">
<el-select size="small" class="filter-mode" :placeholder="$t('components.filterMode.placeholder')" v-model="curVal" @change="onChange">
<el-option
v-for="mode in filterMode"
v-for="mode in fieldFilterMode"
:key="mode.value"
:label="getLabel(mode)"
:value="mode.value"
......@@ -11,7 +11,7 @@
</template>
<script lang="ts">
import { Vue, Component, Model } from "vue-property-decorator";
import { Vue, Component, Model, Prop, Watch } from "vue-property-decorator";
@Component({})
export default class FilterMode extends Vue {
......@@ -24,6 +24,19 @@ export default class FilterMode extends Vue {
*/
@Model('change') readonly value: any;
/**
* 自定义逻辑集合
*
* @type {*}
* @memberof FilterMode
*/
@Prop() modes!: any[];
@Watch('modes')
onModesChange(newVal: any) {
this.setDefValue();
}
get curVal() {
return this.value;
}
......@@ -34,6 +47,21 @@ export default class FilterMode extends Vue {
this.$emit('change', val);
}
get fieldFilterMode() {
if(this.modes && this.modes.length > 0) {
let index: number = this.modes.findIndex((mode: any) => Object.is(mode.mode, 'all'));
if(index < 0) {
let items: any[] = [];
this.modes.forEach((mode: any) => {
let item: any = this.filterMode.find((filter: any) => Object.is(filter['en-US'], mode.mode));
items.push(item);
})
return items;
}
}
return this.filterMode;
}
/**
* 过滤模式
*
......@@ -60,13 +88,37 @@ export default class FilterMode extends Vue {
// { 'zh-CN': '', en: 'NOTEXISTS', value: '$notExists' }
];
/**
* 生命周期
*
* @return {void}
* @memberof FilterMode
*/
public mounted() {
this.setDefValue()
}
/**
* 设置默认值
*
* @return {void}
* @memberof FilterMode
*/
public setDefValue() {
if(this.fieldFilterMode.length > 0) {
this.curVal = this.fieldFilterMode[0].value;
this.onChange();
}
}
/**
* 获取语言文本
*
* @return {string}
* @memberof FilterMode
*/
getLabel(mode: any): string {
public getLabel(mode: any): string {
if(this.$i18n.locale) {
return mode[this.$i18n.locale];
}
......@@ -79,7 +131,16 @@ export default class FilterMode extends Vue {
* @memberof FilterMode
*/
public onChange() {
this.$emit('mode-change', this.value);
this.$nextTick(() => {
let item: any = this.filterMode.find((filter: any) => Object.is(filter.value, this.curVal));
if(this.modes && this.modes.length > 0) {
let mode: any = this.modes.find((mode: any) => Object.is(mode.mode, item['en-US']));
if(!mode) {
mode = this.modes.find((mode: any) => Object.is(mode.mode, 'all'));
}
this.$emit('on-change', mode);
}
})
}
}
......
......@@ -7,25 +7,25 @@
<el-option v-for="mode in relationModes" :key="mode.value" :label="getLabel(mode)" :value="mode.value"></el-option>
</el-select>
<div class="filter-tree-action">
<i-button title="添加条件" @click="onAddItem(data)"><i class="fa fa-plus" aria-hidden="true"></i> 添加条件</i-button>
<i-button title="添加组" @click="onAddGroup(data)"><i class="fa fa-plus" aria-hidden="true"></i> 添加组</i-button>
<i-button :title="$t('components.filterTree.title1')" @click="onAddItem(data)"><i class="fa fa-plus" aria-hidden="true"></i> {{$t('components.filterTree.title1')}}</i-button>
<i-button :title="$t('components.filterTree.title2')" @click="onAddGroup(data)"><i class="fa fa-plus" aria-hidden="true"></i> {{$t('components.filterTree.title2')}}</i-button>
<icon v-if="!data.isroot" type="md-close" @click="onRemoveItem(node, data)"/>
</div>
</div>
</template>
<template v-else>
<div class="filter-tree-item">
<el-select size="small" class="filter-item-field" v-model="data.field" clearable placeholder="属性" @change="onFieldChange(data)">
<el-select size="small" class="filter-item-field" v-model="data.field" clearable :placeholder="$t('components.filterTree.placeholder')">
<el-option
v-for="item in fields"
:key="item.prop"
v-for="item in fieldItems"
:key="item.value"
:label="item.label"
:value="item.name">
:value="item.value">
</el-option>
</el-select>
<filter-mode class="filter-item-mode" v-model="data.mode"></filter-mode>
<filter-mode class="filter-item-mode" v-model="data.mode" :modes="getModes(data.field)" @on-change="onModeChange($event, data)"></filter-mode>
<div class="filter-item-value">
<i-input v-if="!data.field"></i-input>
<i-input v-if="!data.editor"></i-input>
<slot v-else :data="data"></slot>
</div>
<div class="filter-tree-action">
......@@ -64,6 +64,14 @@ export default class FilterTree extends Vue {
*/
@Prop() fields: any;
/**
* 属性项集合
*
* @type {*}
* @memberof FilterTree
*/
protected fieldItems: any[] = [];
/**
* 组条件集合
*
......@@ -89,34 +97,81 @@ export default class FilterTree extends Vue {
};
if(this.datas.length == 0) {
this.onAddItem(root);
this.onAddItem(root);
}
return [root];
}
/**
* 获取语言文本
* 生命周期
*
* @return {string}
* @return {void}
* @memberof FilterTree
*/
getLabel(mode: any): string {
if(this.$i18n.locale) {
return mode[this.$i18n.locale];
public created() {
if(!this.fields) {
return;
}
return mode['zh-CN'];
this.fields.forEach((field: any) => {
let index: number = this.fieldItems.findIndex((item: any) => Object.is(item.value, field.prop));
if(index < 0) {
this.fieldItems.push({
label: field.label,
value: field.prop,
modes: this.getFieldModes(field.prop)
})
}
});
}
/**
* 属性变化
* 获取逻辑模式集合
*
* @return {*}
* @return {void}
* @memberof FilterTree
*/
public onFieldChange(data: any) {
if(!data.mode) {
data.mode = '$eq';
public getModes(field: string) {
if(this.fieldItems.length > 0) {
let item: any = this.fieldItems.find((item: any) => Object.is(item.value, field));
if(item) {
return item.modes;
}
}
return [];
}
/**
* 获取属性逻辑模式集合
*
* @return {void}
* @memberof FilterTree
*/
public getFieldModes(name: string) {
let modes: any[] = [];
for(let i = 0; i < this.fields.length; i++) {
let field: any = this.fields[i];
if(!Object.is(field.prop, name)) {
continue;
}
modes.push({
name: field.name,
mode: field.mode ? field.mode : 'all'
})
}
return modes;
}
/**
* 获取语言文本
*
* @return {string}
* @memberof FilterTree
*/
getLabel(mode: any): string {
if(this.$i18n.locale) {
return mode[this.$i18n.locale];
}
return mode['zh-CN'];
}
/**
......@@ -129,7 +184,8 @@ export default class FilterTree extends Vue {
if(data && data.children) {
data.children.push({
field: null,
mode: null
mode: null,
editor: null
});
}
}
......@@ -163,6 +219,18 @@ export default class FilterTree extends Vue {
}
}
}
/**
* 条件逻辑变化
*
* @return {*}
* @memberof FilterTree
*/
public onModeChange(mode: any, data: any) {
if(mode && data) {
data.editor = mode.name;
}
}
}
</script>
......
......@@ -1704,6 +1704,230 @@ mock.onGet(new RegExp(/^\/quotes\/fetchbyparentkey(\?[\w-./?%&=,]*)*$/)).reply((
});
// FetchClosed
mock.onGet(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetchclosed$/)).reply((config: any) => {
console.groupCollapsed("实体:quote 方法: FetchClosed");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['accountid','contactid','opportunityid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetchclosed$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchClosed
mock.onGet(new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetchclosed$/)).reply((config: any) => {
console.groupCollapsed("实体:quote 方法: FetchClosed");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['contactid','opportunityid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetchclosed$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchClosed
mock.onGet(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetchclosed$/)).reply((config: any) => {
console.groupCollapsed("实体:quote 方法: FetchClosed");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['accountid','opportunityid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetchclosed$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchClosed
mock.onGet(new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetchclosed$/)).reply((config: any) => {
console.groupCollapsed("实体:quote 方法: FetchClosed");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['opportunityid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetchclosed$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchClosed
mock.onGet(new RegExp(/^\/quotes\/fetchclosed$/)).reply((config: any) => {
console.groupCollapsed("实体:quote 方法: FetchClosed");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas);
console.groupEnd();
console.groupEnd();
return [status, mockDatas ? mockDatas : []];
});
// FetchClosed
mock.onGet(new RegExp(/^\/quotes\/fetchclosed(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:quote 方法: FetchClosed");
console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){
let url = config.url.split('?')[1];
let params = qs.parse(url);
Object.assign(config, params);
}
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
let total = mockDatas.length;
let records: Array<any> = [];
if(!config.page || !config.size){
records = mockDatas;
}else{
if((config.page-1)*config.size < total){
records = mockDatas.slice(config.page,config.size);
}
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(records ? records : []);
console.groupEnd();
console.groupEnd();
return [status, records ? records : []];
});
// FetchDefault
mock.onGet(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:quote 方法: FetchDefault");
......@@ -1927,6 +2151,678 @@ mock.onGet(new RegExp(/^\/quotes\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((conf
return [status, records ? records : []];
});
// FetchDraft
mock.onGet(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetchdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:quote 方法: FetchDraft");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['accountid','contactid','opportunityid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetchdraft$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchDraft
mock.onGet(new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetchdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:quote 方法: FetchDraft");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['contactid','opportunityid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetchdraft$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchDraft
mock.onGet(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetchdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:quote 方法: FetchDraft");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['accountid','opportunityid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetchdraft$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchDraft
mock.onGet(new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetchdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:quote 方法: FetchDraft");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['opportunityid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetchdraft$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchDraft
mock.onGet(new RegExp(/^\/quotes\/fetchdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:quote 方法: FetchDraft");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas);
console.groupEnd();
console.groupEnd();
return [status, mockDatas ? mockDatas : []];
});
// FetchDraft
mock.onGet(new RegExp(/^\/quotes\/fetchdraft(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:quote 方法: FetchDraft");
console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){
let url = config.url.split('?')[1];
let params = qs.parse(url);
Object.assign(config, params);
}
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
let total = mockDatas.length;
let records: Array<any> = [];
if(!config.page || !config.size){
records = mockDatas;
}else{
if((config.page-1)*config.size < total){
records = mockDatas.slice(config.page,config.size);
}
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(records ? records : []);
console.groupEnd();
console.groupEnd();
return [status, records ? records : []];
});
// FetchEffective
mock.onGet(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetcheffective$/)).reply((config: any) => {
console.groupCollapsed("实体:quote 方法: FetchEffective");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['accountid','contactid','opportunityid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetcheffective$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchEffective
mock.onGet(new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetcheffective$/)).reply((config: any) => {
console.groupCollapsed("实体:quote 方法: FetchEffective");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['contactid','opportunityid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetcheffective$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchEffective
mock.onGet(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetcheffective$/)).reply((config: any) => {
console.groupCollapsed("实体:quote 方法: FetchEffective");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['accountid','opportunityid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetcheffective$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchEffective
mock.onGet(new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetcheffective$/)).reply((config: any) => {
console.groupCollapsed("实体:quote 方法: FetchEffective");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['opportunityid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetcheffective$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchEffective
mock.onGet(new RegExp(/^\/quotes\/fetcheffective$/)).reply((config: any) => {
console.groupCollapsed("实体:quote 方法: FetchEffective");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas);
console.groupEnd();
console.groupEnd();
return [status, mockDatas ? mockDatas : []];
});
// FetchEffective
mock.onGet(new RegExp(/^\/quotes\/fetcheffective(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:quote 方法: FetchEffective");
console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){
let url = config.url.split('?')[1];
let params = qs.parse(url);
Object.assign(config, params);
}
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
let total = mockDatas.length;
let records: Array<any> = [];
if(!config.page || !config.size){
records = mockDatas;
}else{
if((config.page-1)*config.size < total){
records = mockDatas.slice(config.page,config.size);
}
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(records ? records : []);
console.groupEnd();
console.groupEnd();
return [status, records ? records : []];
});
// FetchWin
mock.onGet(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetchwin$/)).reply((config: any) => {
console.groupCollapsed("实体:quote 方法: FetchWin");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['accountid','contactid','opportunityid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetchwin$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchWin
mock.onGet(new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetchwin$/)).reply((config: any) => {
console.groupCollapsed("实体:quote 方法: FetchWin");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['contactid','opportunityid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetchwin$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchWin
mock.onGet(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetchwin$/)).reply((config: any) => {
console.groupCollapsed("实体:quote 方法: FetchWin");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['accountid','opportunityid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetchwin$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchWin
mock.onGet(new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetchwin$/)).reply((config: any) => {
console.groupCollapsed("实体:quote 方法: FetchWin");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['opportunityid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/fetchwin$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchWin
mock.onGet(new RegExp(/^\/quotes\/fetchwin$/)).reply((config: any) => {
console.groupCollapsed("实体:quote 方法: FetchWin");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas);
console.groupEnd();
console.groupEnd();
return [status, mockDatas ? mockDatas : []];
});
// FetchWin
mock.onGet(new RegExp(/^\/quotes\/fetchwin(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:quote 方法: FetchWin");
console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){
let url = config.url.split('?')[1];
let params = qs.parse(url);
Object.assign(config, params);
}
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
let total = mockDatas.length;
let records: Array<any> = [];
if(!config.page || !config.size){
records = mockDatas;
}else{
if((config.page-1)*config.size < total){
records = mockDatas.slice(config.page,config.size);
}
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(records ? records : []);
console.groupEnd();
console.groupEnd();
return [status, records ? records : []];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
......
......@@ -838,6 +838,36 @@ export default class QuoteServiceBase extends EntityService {
return Http.getInstance().get(`/quotes/fetchbyparentkey`,tempData,isloading);
}
/**
* FetchClosed接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof QuoteServiceBase
*/
public async FetchClosed(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/fetchclosed`,tempData,isloading);
}
if(context.contact && context.opportunity && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/fetchclosed`,tempData,isloading);
}
if(context.account && context.opportunity && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/fetchclosed`,tempData,isloading);
}
if(context.opportunity && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/fetchclosed`,tempData,isloading);
}
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/quotes/fetchclosed`,tempData,isloading);
}
/**
* FetchDefault接口方法
*
......@@ -867,4 +897,94 @@ export default class QuoteServiceBase extends EntityService {
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/quotes/fetchdefault`,tempData,isloading);
}
/**
* FetchDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof QuoteServiceBase
*/
public async FetchDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/fetchdraft`,tempData,isloading);
}
if(context.contact && context.opportunity && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/fetchdraft`,tempData,isloading);
}
if(context.account && context.opportunity && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/fetchdraft`,tempData,isloading);
}
if(context.opportunity && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/fetchdraft`,tempData,isloading);
}
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/quotes/fetchdraft`,tempData,isloading);
}
/**
* FetchEffective接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof QuoteServiceBase
*/
public async FetchEffective(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/fetcheffective`,tempData,isloading);
}
if(context.contact && context.opportunity && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/fetcheffective`,tempData,isloading);
}
if(context.account && context.opportunity && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/fetcheffective`,tempData,isloading);
}
if(context.opportunity && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/fetcheffective`,tempData,isloading);
}
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/quotes/fetcheffective`,tempData,isloading);
}
/**
* FetchWin接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof QuoteServiceBase
*/
public async FetchWin(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/fetchwin`,tempData,isloading);
}
if(context.contact && context.opportunity && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/fetchwin`,tempData,isloading);
}
if(context.account && context.opportunity && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/fetchwin`,tempData,isloading);
}
if(context.opportunity && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/fetchwin`,tempData,isloading);
}
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/quotes/fetchwin`,tempData,isloading);
}
}
\ No newline at end of file
......@@ -213,7 +213,7 @@ export class Info_AllEditFormBase extends EditFormControlBase {
'sic',
'tickersymbol',
'ownershipcode',
]
],
, uiActionGroup: { caption: '编辑_账户信息', langbase: 'entities.account.info_all_form', extractMode: 'ITEM', details: [{ name: 'group1_uc040f39', caption: '编辑', uiactiontag: 'account_edit_accountinfo', icon: 'fa fa-pencil',isShowCaption:false,isShowIcon:true }] } }),
grouppanel1: new FormGroupPanelModel({ caption: '地址信息', detailType: 'GROUPPANEL', name: 'grouppanel1', visible: true, isShowCaption: true, form: this, showMoreMode: 0, uiActionGroup: { caption: '编辑_地址信息', langbase: 'entities.account.info_all_form', extractMode: 'ITEM', details: [{ name: 'grouppanel1_u2ccbfc9', caption: '编辑', uiactiontag: 'account_edit_address', icon: 'fa fa-pencil',isShowCaption:false,isShowIcon:true }] } }),
......
......@@ -20,7 +20,11 @@ import com.alibaba.fastjson.JSONObject;
public interface QuoteMapper extends BaseMapper<Quote>{
Page<Quote> searchByParentKey(IPage page, @Param("srf") QuoteSearchContext context, @Param("ew") Wrapper<Quote> wrapper) ;
Page<Quote> searchClosed(IPage page, @Param("srf") QuoteSearchContext context, @Param("ew") Wrapper<Quote> wrapper) ;
Page<Quote> searchDefault(IPage page, @Param("srf") QuoteSearchContext context, @Param("ew") Wrapper<Quote> wrapper) ;
Page<Quote> searchDraft(IPage page, @Param("srf") QuoteSearchContext context, @Param("ew") Wrapper<Quote> wrapper) ;
Page<Quote> searchEffective(IPage page, @Param("srf") QuoteSearchContext context, @Param("ew") Wrapper<Quote> wrapper) ;
Page<Quote> searchWin(IPage page, @Param("srf") QuoteSearchContext context, @Param("ew") Wrapper<Quote> wrapper) ;
@Override
Quote selectById(Serializable id);
@Override
......
......@@ -41,7 +41,11 @@ public interface IQuoteService extends IService<Quote>{
void saveBatch(List<Quote> list) ;
Quote win(Quote et) ;
Page<Quote> searchByParentKey(QuoteSearchContext context) ;
Page<Quote> searchClosed(QuoteSearchContext context) ;
Page<Quote> searchDefault(QuoteSearchContext context) ;
Page<Quote> searchDraft(QuoteSearchContext context) ;
Page<Quote> searchEffective(QuoteSearchContext context) ;
Page<Quote> searchWin(QuoteSearchContext context) ;
List<Quote> selectByCampaignid(String campaignid) ;
void removeByCampaignid(String campaignid) ;
List<Quote> selectByOpportunityid(String opportunityid) ;
......
......@@ -272,6 +272,15 @@ public class QuoteServiceImpl extends ServiceImpl<QuoteMapper, Quote> implements
return new PageImpl<Quote>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 已关闭
*/
@Override
public Page<Quote> searchClosed(QuoteSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Quote> pages=baseMapper.searchClosed(context.getPages(),context,context.getSelectCond());
return new PageImpl<Quote>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 DEFAULT
*/
......@@ -281,6 +290,33 @@ public class QuoteServiceImpl extends ServiceImpl<QuoteMapper, Quote> implements
return new PageImpl<Quote>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 草稿
*/
@Override
public Page<Quote> searchDraft(QuoteSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Quote> pages=baseMapper.searchDraft(context.getPages(),context,context.getSelectCond());
return new PageImpl<Quote>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 有效报价单
*/
@Override
public Page<Quote> searchEffective(QuoteSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Quote> pages=baseMapper.searchEffective(context.getPages(),context,context.getSelectCond());
return new PageImpl<Quote>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 赢单
*/
@Override
public Page<Quote> searchWin(QuoteSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Quote> pages=baseMapper.searchWin(context.getPages(),context,context.getSelectCond());
return new PageImpl<Quote>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
......
......@@ -109,6 +109,15 @@
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据集合[Closed]-->
<select id="searchClosed" parameterType="cn.ibizlab.businesscentral.core.sales.filter.QuoteSearchContext" resultMap="QuoteResultMap">
select t1.* from (
<include refid="Closed" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.sales.filter.QuoteSearchContext" resultMap="QuoteResultMap">
select t1.* from (
......@@ -118,6 +127,33 @@
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据集合[Draft]-->
<select id="searchDraft" parameterType="cn.ibizlab.businesscentral.core.sales.filter.QuoteSearchContext" resultMap="QuoteResultMap">
select t1.* from (
<include refid="Draft" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据集合[Effective]-->
<select id="searchEffective" parameterType="cn.ibizlab.businesscentral.core.sales.filter.QuoteSearchContext" resultMap="QuoteResultMap">
select t1.* from (
<include refid="Effective" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据集合[Win]-->
<select id="searchWin" parameterType="cn.ibizlab.businesscentral.core.sales.filter.QuoteSearchContext" resultMap="QuoteResultMap">
select t1.* from (
<include refid="Win" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[ByParentKey]-->
<sql id="ByParentKey" databaseId="mysql">
<![CDATA[ SELECT t1.`ACCOUNTIDYOMINAME`, t1.`BILLTO_ADDRESSID`, t1.`BILLTO_CITY`, t1.`BILLTO_COMPOSITE`, t1.`BILLTO_CONTACTNAME`, t1.`BILLTO_COUNTRY`, t1.`BILLTO_FAX`, t1.`BILLTO_LINE1`, t1.`BILLTO_LINE2`, t1.`BILLTO_LINE3`, t1.`BILLTO_NAME`, t1.`BILLTO_POSTALCODE`, t1.`BILLTO_STATEORPROVINCE`, t1.`BILLTO_TELEPHONE`, t1.`CAMPAIGNID`, t1.`CAMPAIGNNAME`, t1.`CLOSEDON`, t1.`CONTACTIDYOMINAME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`CUSTOMERID`, t1.`CUSTOMERIDTYPE`, t1.`CUSTOMERIDYOMINAME`, t1.`DESCRIPTION`, t1.`DISCOUNTAMOUNT`, t1.`DISCOUNTAMOUNT_BASE`, t1.`DISCOUNTPERCENTAGE`, t1.`EFFECTIVEFROM`, t1.`EFFECTIVETO`, t1.`EMAILADDRESS`, t1.`EXCHANGERATE`, t1.`EXPIRESON`, t1.`FREIGHTAMOUNT`, t1.`FREIGHTAMOUNT_BASE`, t1.`FREIGHTTERMSCODE`, t1.`IMPORTSEQUENCENUMBER`, t1.`LASTONHOLDTIME`, t1.`ONHOLDTIME`, t1.`OPPORTUNITYID`, t1.`OPPORTUNITYNAME`, t1.`OVERRIDDENCREATEDON`, t1.`OWNERID`, t1.`OWNERIDTYPE`, t1.`OWNERIDYOMINAME`, t1.`PAYMENTTERMSCODE`, t1.`PRICELEVELID`, t1.`PRICELEVELNAME`, t1.`PRICINGERRORCODE`, t1.`PROCESSID`, t1.`QUOTEID`, t1.`QUOTENAME`, t1.`QUOTENUMBER`, t1.`REQUESTDELIVERYBY`, t1.`REVISIONNUMBER`, t1.`SHIPPINGMETHODCODE`, t1.`SHIPTO_ADDRESSID`, t1.`SHIPTO_CITY`, t1.`SHIPTO_COMPOSITE`, t1.`SHIPTO_CONTACTNAME`, t1.`SHIPTO_COUNTRY`, t1.`SHIPTO_FAX`, t1.`SHIPTO_FREIGHTTERMSCODE`, t1.`SHIPTO_LINE1`, t1.`SHIPTO_LINE2`, t1.`SHIPTO_LINE3`, t1.`SHIPTO_NAME`, t1.`SHIPTO_POSTALCODE`, t1.`SHIPTO_STATEORPROVINCE`, t1.`SHIPTO_TELEPHONE`, t1.`SLAID`, t1.`SLANAME`, t1.`STAGEID`, t1.`STATECODE`, t1.`STATUSCODE`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TOTALAMOUNT`, t1.`TOTALAMOUNTLESSFREIGHT`, t1.`TOTALAMOUNTLESSFREIGHT_BASE`, t1.`TOTALAMOUNT_BASE`, t1.`TOTALDISCOUNTAMOUNT`, t1.`TOTALDISCOUNTAMOUNT_BASE`, t1.`TOTALLINEITEMAMOUNT`, t1.`TOTALLINEITEMAMOUNT_BASE`, t1.`TOTALLINEITEMDISCOUNTAMOUNT`, t1.`TOTALTAX`, t1.`TOTALTAX_BASE`, t1.`TRANSACTIONCURRENCYID`, t1.`TRANSACTIONCURRENCYNAME`, t1.`TRAVERSEDPATH`, t1.`UNIQUEDSCID`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER`, t1.`WILLCALL` FROM `QUOTE` t1
......
......@@ -319,7 +319,7 @@
"dename":"Quote",
"delogicname":"报价单",
"sysmoudle":{"id":"SALES","name":"Sales"},
"dedataset":[{"id":"ByParentKey" , "name":"ByParentKey"},{"id":"Default" , "name":"DEFAULT"}],
"dedataset":[{"id":"ByParentKey" , "name":"ByParentKey"},{"id":"Closed" , "name":"已关闭"},{"id":"Default" , "name":"DEFAULT"},{"id":"Draft" , "name":"草稿"},{"id":"Effective" , "name":"有效报价单"},{"id":"Win" , "name":"赢单"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Active" , "name":"激活报价单" , "type":"DELOGIC" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Close" , "name":"结束报价单" , "type":"DELOGIC" },{"id":"GenSalesOrder" , "name":"创建订单" , "type":"USERCUSTOM" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Win" , "name":"赢单" , "type":"DELOGIC" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
......
......@@ -208,6 +208,27 @@ public class QuoteResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchClosed-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "获取已关闭", tags = {"报价单" } ,notes = "获取已关闭")
@RequestMapping(method= RequestMethod.GET , value="/quotes/fetchclosed")
public ResponseEntity<List<QuoteDTO>> fetchClosed(QuoteSearchContext context) {
Page<Quote> domains = quoteService.searchClosed(context) ;
List<QuoteDTO> list = quoteMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchClosed-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "查询已关闭", tags = {"报价单" } ,notes = "查询已关闭")
@RequestMapping(method= RequestMethod.POST , value="/quotes/searchclosed")
public ResponseEntity<Page<QuoteDTO>> searchClosed(@RequestBody QuoteSearchContext context) {
Page<Quote> domains = quoteService.searchClosed(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"报价单" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/quotes/fetchdefault")
......@@ -229,6 +250,69 @@ public class QuoteResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchDraft-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "获取草稿", tags = {"报价单" } ,notes = "获取草稿")
@RequestMapping(method= RequestMethod.GET , value="/quotes/fetchdraft")
public ResponseEntity<List<QuoteDTO>> fetchDraft(QuoteSearchContext context) {
Page<Quote> domains = quoteService.searchDraft(context) ;
List<QuoteDTO> list = quoteMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchDraft-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "查询草稿", tags = {"报价单" } ,notes = "查询草稿")
@RequestMapping(method= RequestMethod.POST , value="/quotes/searchdraft")
public ResponseEntity<Page<QuoteDTO>> searchDraft(@RequestBody QuoteSearchContext context) {
Page<Quote> domains = quoteService.searchDraft(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchEffective-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "获取有效报价单", tags = {"报价单" } ,notes = "获取有效报价单")
@RequestMapping(method= RequestMethod.GET , value="/quotes/fetcheffective")
public ResponseEntity<List<QuoteDTO>> fetchEffective(QuoteSearchContext context) {
Page<Quote> domains = quoteService.searchEffective(context) ;
List<QuoteDTO> list = quoteMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchEffective-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "查询有效报价单", tags = {"报价单" } ,notes = "查询有效报价单")
@RequestMapping(method= RequestMethod.POST , value="/quotes/searcheffective")
public ResponseEntity<Page<QuoteDTO>> searchEffective(@RequestBody QuoteSearchContext context) {
Page<Quote> domains = quoteService.searchEffective(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchWin-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "获取赢单", tags = {"报价单" } ,notes = "获取赢单")
@RequestMapping(method= RequestMethod.GET , value="/quotes/fetchwin")
public ResponseEntity<List<QuoteDTO>> fetchWin(QuoteSearchContext context) {
Page<Quote> domains = quoteService.searchWin(context) ;
List<QuoteDTO> list = quoteMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchWin-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "查询赢单", tags = {"报价单" } ,notes = "查询赢单")
@RequestMapping(method= RequestMethod.POST , value="/quotes/searchwin")
public ResponseEntity<Page<QuoteDTO>> searchWin(@RequestBody QuoteSearchContext context) {
Page<Quote> domains = quoteService.searchWin(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.quoteMapping.toDomain(#quotedto),'iBizBusinessCentral-Quote-Create')")
@ApiOperation(value = "根据商机建立报价单", tags = {"报价单" }, notes = "根据商机建立报价单")
@RequestMapping(method = RequestMethod.POST, value = "/opportunities/{opportunity_id}/quotes")
......@@ -410,6 +494,29 @@ public class QuoteResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchClosed-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据商机获取已关闭", tags = {"报价单" } ,notes = "根据商机获取已关闭")
@RequestMapping(method= RequestMethod.GET , value="/opportunities/{opportunity_id}/quotes/fetchclosed")
public ResponseEntity<List<QuoteDTO>> fetchQuoteClosedByOpportunity(@PathVariable("opportunity_id") String opportunity_id,QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchClosed(context) ;
List<QuoteDTO> list = quoteMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchClosed-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据商机查询已关闭", tags = {"报价单" } ,notes = "根据商机查询已关闭")
@RequestMapping(method= RequestMethod.POST , value="/opportunities/{opportunity_id}/quotes/searchclosed")
public ResponseEntity<Page<QuoteDTO>> searchQuoteClosedByOpportunity(@PathVariable("opportunity_id") String opportunity_id, @RequestBody QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchClosed(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据商机获取DEFAULT", tags = {"报价单" } ,notes = "根据商机获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/opportunities/{opportunity_id}/quotes/fetchdefault")
......@@ -433,6 +540,75 @@ public class QuoteResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchDraft-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据商机获取草稿", tags = {"报价单" } ,notes = "根据商机获取草稿")
@RequestMapping(method= RequestMethod.GET , value="/opportunities/{opportunity_id}/quotes/fetchdraft")
public ResponseEntity<List<QuoteDTO>> fetchQuoteDraftByOpportunity(@PathVariable("opportunity_id") String opportunity_id,QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchDraft(context) ;
List<QuoteDTO> list = quoteMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchDraft-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据商机查询草稿", tags = {"报价单" } ,notes = "根据商机查询草稿")
@RequestMapping(method= RequestMethod.POST , value="/opportunities/{opportunity_id}/quotes/searchdraft")
public ResponseEntity<Page<QuoteDTO>> searchQuoteDraftByOpportunity(@PathVariable("opportunity_id") String opportunity_id, @RequestBody QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchDraft(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchEffective-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据商机获取有效报价单", tags = {"报价单" } ,notes = "根据商机获取有效报价单")
@RequestMapping(method= RequestMethod.GET , value="/opportunities/{opportunity_id}/quotes/fetcheffective")
public ResponseEntity<List<QuoteDTO>> fetchQuoteEffectiveByOpportunity(@PathVariable("opportunity_id") String opportunity_id,QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchEffective(context) ;
List<QuoteDTO> list = quoteMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchEffective-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据商机查询有效报价单", tags = {"报价单" } ,notes = "根据商机查询有效报价单")
@RequestMapping(method= RequestMethod.POST , value="/opportunities/{opportunity_id}/quotes/searcheffective")
public ResponseEntity<Page<QuoteDTO>> searchQuoteEffectiveByOpportunity(@PathVariable("opportunity_id") String opportunity_id, @RequestBody QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchEffective(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchWin-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据商机获取赢单", tags = {"报价单" } ,notes = "根据商机获取赢单")
@RequestMapping(method= RequestMethod.GET , value="/opportunities/{opportunity_id}/quotes/fetchwin")
public ResponseEntity<List<QuoteDTO>> fetchQuoteWinByOpportunity(@PathVariable("opportunity_id") String opportunity_id,QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchWin(context) ;
List<QuoteDTO> list = quoteMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchWin-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据商机查询赢单", tags = {"报价单" } ,notes = "根据商机查询赢单")
@RequestMapping(method= RequestMethod.POST , value="/opportunities/{opportunity_id}/quotes/searchwin")
public ResponseEntity<Page<QuoteDTO>> searchQuoteWinByOpportunity(@PathVariable("opportunity_id") String opportunity_id, @RequestBody QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchWin(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.quoteMapping.toDomain(#quotedto),'iBizBusinessCentral-Quote-Create')")
@ApiOperation(value = "根据客户商机建立报价单", tags = {"报价单" }, notes = "根据客户商机建立报价单")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes")
......@@ -614,6 +790,29 @@ public class QuoteResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchClosed-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据客户商机获取已关闭", tags = {"报价单" } ,notes = "根据客户商机获取已关闭")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/opportunities/{opportunity_id}/quotes/fetchclosed")
public ResponseEntity<List<QuoteDTO>> fetchQuoteClosedByAccountOpportunity(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id,QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchClosed(context) ;
List<QuoteDTO> list = quoteMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchClosed-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据客户商机查询已关闭", tags = {"报价单" } ,notes = "根据客户商机查询已关闭")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/opportunities/{opportunity_id}/quotes/searchclosed")
public ResponseEntity<Page<QuoteDTO>> searchQuoteClosedByAccountOpportunity(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchClosed(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据客户商机获取DEFAULT", tags = {"报价单" } ,notes = "根据客户商机获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/opportunities/{opportunity_id}/quotes/fetchdefault")
......@@ -637,6 +836,75 @@ public class QuoteResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchDraft-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据客户商机获取草稿", tags = {"报价单" } ,notes = "根据客户商机获取草稿")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/opportunities/{opportunity_id}/quotes/fetchdraft")
public ResponseEntity<List<QuoteDTO>> fetchQuoteDraftByAccountOpportunity(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id,QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchDraft(context) ;
List<QuoteDTO> list = quoteMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchDraft-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据客户商机查询草稿", tags = {"报价单" } ,notes = "根据客户商机查询草稿")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/opportunities/{opportunity_id}/quotes/searchdraft")
public ResponseEntity<Page<QuoteDTO>> searchQuoteDraftByAccountOpportunity(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchDraft(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchEffective-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据客户商机获取有效报价单", tags = {"报价单" } ,notes = "根据客户商机获取有效报价单")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/opportunities/{opportunity_id}/quotes/fetcheffective")
public ResponseEntity<List<QuoteDTO>> fetchQuoteEffectiveByAccountOpportunity(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id,QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchEffective(context) ;
List<QuoteDTO> list = quoteMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchEffective-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据客户商机查询有效报价单", tags = {"报价单" } ,notes = "根据客户商机查询有效报价单")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/opportunities/{opportunity_id}/quotes/searcheffective")
public ResponseEntity<Page<QuoteDTO>> searchQuoteEffectiveByAccountOpportunity(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchEffective(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchWin-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据客户商机获取赢单", tags = {"报价单" } ,notes = "根据客户商机获取赢单")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/opportunities/{opportunity_id}/quotes/fetchwin")
public ResponseEntity<List<QuoteDTO>> fetchQuoteWinByAccountOpportunity(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id,QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchWin(context) ;
List<QuoteDTO> list = quoteMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchWin-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据客户商机查询赢单", tags = {"报价单" } ,notes = "根据客户商机查询赢单")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/opportunities/{opportunity_id}/quotes/searchwin")
public ResponseEntity<Page<QuoteDTO>> searchQuoteWinByAccountOpportunity(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchWin(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.quoteMapping.toDomain(#quotedto),'iBizBusinessCentral-Quote-Create')")
@ApiOperation(value = "根据联系人商机建立报价单", tags = {"报价单" }, notes = "根据联系人商机建立报价单")
@RequestMapping(method = RequestMethod.POST, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes")
......@@ -818,6 +1086,29 @@ public class QuoteResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchClosed-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据联系人商机获取已关闭", tags = {"报价单" } ,notes = "根据联系人商机获取已关闭")
@RequestMapping(method= RequestMethod.GET , value="/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/fetchclosed")
public ResponseEntity<List<QuoteDTO>> fetchQuoteClosedByContactOpportunity(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id,QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchClosed(context) ;
List<QuoteDTO> list = quoteMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchClosed-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据联系人商机查询已关闭", tags = {"报价单" } ,notes = "根据联系人商机查询已关闭")
@RequestMapping(method= RequestMethod.POST , value="/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/searchclosed")
public ResponseEntity<Page<QuoteDTO>> searchQuoteClosedByContactOpportunity(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchClosed(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据联系人商机获取DEFAULT", tags = {"报价单" } ,notes = "根据联系人商机获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/fetchdefault")
......@@ -841,6 +1132,75 @@ public class QuoteResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchDraft-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据联系人商机获取草稿", tags = {"报价单" } ,notes = "根据联系人商机获取草稿")
@RequestMapping(method= RequestMethod.GET , value="/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/fetchdraft")
public ResponseEntity<List<QuoteDTO>> fetchQuoteDraftByContactOpportunity(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id,QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchDraft(context) ;
List<QuoteDTO> list = quoteMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchDraft-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据联系人商机查询草稿", tags = {"报价单" } ,notes = "根据联系人商机查询草稿")
@RequestMapping(method= RequestMethod.POST , value="/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/searchdraft")
public ResponseEntity<Page<QuoteDTO>> searchQuoteDraftByContactOpportunity(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchDraft(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchEffective-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据联系人商机获取有效报价单", tags = {"报价单" } ,notes = "根据联系人商机获取有效报价单")
@RequestMapping(method= RequestMethod.GET , value="/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/fetcheffective")
public ResponseEntity<List<QuoteDTO>> fetchQuoteEffectiveByContactOpportunity(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id,QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchEffective(context) ;
List<QuoteDTO> list = quoteMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchEffective-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据联系人商机查询有效报价单", tags = {"报价单" } ,notes = "根据联系人商机查询有效报价单")
@RequestMapping(method= RequestMethod.POST , value="/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/searcheffective")
public ResponseEntity<Page<QuoteDTO>> searchQuoteEffectiveByContactOpportunity(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchEffective(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchWin-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据联系人商机获取赢单", tags = {"报价单" } ,notes = "根据联系人商机获取赢单")
@RequestMapping(method= RequestMethod.GET , value="/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/fetchwin")
public ResponseEntity<List<QuoteDTO>> fetchQuoteWinByContactOpportunity(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id,QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchWin(context) ;
List<QuoteDTO> list = quoteMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchWin-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据联系人商机查询赢单", tags = {"报价单" } ,notes = "根据联系人商机查询赢单")
@RequestMapping(method= RequestMethod.POST , value="/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/searchwin")
public ResponseEntity<Page<QuoteDTO>> searchQuoteWinByContactOpportunity(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchWin(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.quoteMapping.toDomain(#quotedto),'iBizBusinessCentral-Quote-Create')")
@ApiOperation(value = "根据客户联系人商机建立报价单", tags = {"报价单" }, notes = "根据客户联系人商机建立报价单")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes")
......@@ -1022,6 +1382,29 @@ public class QuoteResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchClosed-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据客户联系人商机获取已关闭", tags = {"报价单" } ,notes = "根据客户联系人商机获取已关闭")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/fetchclosed")
public ResponseEntity<List<QuoteDTO>> fetchQuoteClosedByAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id,QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchClosed(context) ;
List<QuoteDTO> list = quoteMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchClosed-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据客户联系人商机查询已关闭", tags = {"报价单" } ,notes = "根据客户联系人商机查询已关闭")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/searchclosed")
public ResponseEntity<Page<QuoteDTO>> searchQuoteClosedByAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchClosed(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据客户联系人商机获取DEFAULT", tags = {"报价单" } ,notes = "根据客户联系人商机获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/fetchdefault")
......@@ -1045,5 +1428,74 @@ public class QuoteResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchDraft-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据客户联系人商机获取草稿", tags = {"报价单" } ,notes = "根据客户联系人商机获取草稿")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/fetchdraft")
public ResponseEntity<List<QuoteDTO>> fetchQuoteDraftByAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id,QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchDraft(context) ;
List<QuoteDTO> list = quoteMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchDraft-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据客户联系人商机查询草稿", tags = {"报价单" } ,notes = "根据客户联系人商机查询草稿")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/searchdraft")
public ResponseEntity<Page<QuoteDTO>> searchQuoteDraftByAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchDraft(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchEffective-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据客户联系人商机获取有效报价单", tags = {"报价单" } ,notes = "根据客户联系人商机获取有效报价单")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/fetcheffective")
public ResponseEntity<List<QuoteDTO>> fetchQuoteEffectiveByAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id,QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchEffective(context) ;
List<QuoteDTO> list = quoteMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchEffective-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据客户联系人商机查询有效报价单", tags = {"报价单" } ,notes = "根据客户联系人商机查询有效报价单")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/searcheffective")
public ResponseEntity<Page<QuoteDTO>> searchQuoteEffectiveByAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchEffective(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchWin-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据客户联系人商机获取赢单", tags = {"报价单" } ,notes = "根据客户联系人商机获取赢单")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/fetchwin")
public ResponseEntity<List<QuoteDTO>> fetchQuoteWinByAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id,QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchWin(context) ;
List<QuoteDTO> list = quoteMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-searchWin-all') and hasPermission(#context,'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据客户联系人商机查询赢单", tags = {"报价单" } ,notes = "根据客户联系人商机查询赢单")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/searchwin")
public ResponseEntity<Page<QuoteDTO>> searchQuoteWinByAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchWin(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册