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

lab_gzf 发布系统代码

上级 22fee79d
......@@ -89,15 +89,15 @@ mock.onDelete(new RegExp(/^\/salesorderdetails\/batch$/)).reply((config: any) =>
// Select
mock.onGet(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
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\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Select");
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> = ['salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
const paramArray:Array<any> = ['accountid','contactid','opportunityid','quoteid','salesorderid','salesorderdetailid'];
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\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -116,16 +116,17 @@ mock.onGet(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetail
return [status, _items];
});
// Select
mock.onGet(new RegExp(/^\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
mock.onGet(new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Select");
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> = ['salesorderdetailid'];
const matchArray:any = new RegExp(/^\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
}
const paramArray:Array<any> = ['contactid','opportunityid','quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -144,17 +145,17 @@ mock.onGet(new RegExp(/^\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/select$/))
return [status, _items];
});
// Create
mock.onPost(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Create");
// Select
mock.onGet(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Select");
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> = ['salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const paramArray:Array<any> = ['accountid','opportunityid','quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -164,23 +165,26 @@ mock.onPost(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetai
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.salesorderdetailid, tempValue.salesorderdetailid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, {}];
return [status, _items];
});
// Create
mock.onPost(new RegExp(/^\/salesorderdetails\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Create");
// Select
mock.onGet(new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Select");
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> = ['salesorderdetailid'];
const matchArray:any = new RegExp(/^\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
}
const paramArray:Array<any> = ['opportunityid','quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -190,24 +194,26 @@ mock.onPost(new RegExp(/^\/salesorderdetails\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.salesorderdetailid, tempValue.salesorderdetailid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
return [status, _items];
});
// Update
mock.onPut(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Update");
// Select
mock.onGet(new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Select");
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> = ['salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const paramArray:Array<any> = ['quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -217,23 +223,26 @@ mock.onPut(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetail
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.salesorderdetailid, tempValue.salesorderdetailid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, {}];
return [status, _items];
});
// Update
mock.onPut(new RegExp(/^\/salesorderdetails\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Update");
// Select
mock.onGet(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Select");
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> = ['salesorderdetailid'];
const matchArray:any = new RegExp(/^\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
}
const paramArray:Array<any> = ['salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -243,53 +252,63 @@ mock.onPut(new RegExp(/^\/salesorderdetails\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply(
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.salesorderdetailid, tempValue.salesorderdetailid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['salesorderdetailid'] == tempValue['salesorderdetailid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.salesorderdetailid, tempValue.salesorderdetailid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, data];
return [status, _items];
});
// GetDraft
mock.onGet(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: GetDraft");
// Select
mock.onGet(new RegExp(/^\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Select");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['salesorderdetailid'];
const matchArray:any = new RegExp(/^\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
let tempValue: any = {};
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 : [];
let _items = items.find((item: any) => Object.is(item.salesorderdetailid, tempValue.salesorderdetailid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, {}];
return [status, _items];
});
// GetDraft
mock.onGet(new RegExp(/^\/salesorderdetails\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: GetDraft");
// Create
mock.onPost(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['accountid','contactid','opportunityid','quoteid','salesorderid','salesorderdetailid'];
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\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
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]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
......@@ -298,16 +317,16 @@ mock.onGet(new RegExp(/^\/salesorderdetails\/getdraft$/)).reply((config: any) =>
});
// CheckKey
mock.onPost(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: CheckKey");
// Create
mock.onPost(new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Create");
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> = ['salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const paramArray:Array<any> = ['contactid','opportunityid','quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -323,17 +342,18 @@ mock.onPost(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetai
console.groupEnd();
return [status, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/salesorderdetails\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: CheckKey");
// Create
mock.onPost(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Create");
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> = ['salesorderdetailid'];
const matchArray:any = new RegExp(/^\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
}
const paramArray:Array<any> = ['accountid','opportunityid','quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -343,36 +363,24 @@ mock.onPost(new RegExp(/^\/salesorderdetails\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.salesorderdetailid, tempValue.salesorderdetailid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['salesorderdetailid'] == tempValue['salesorderdetailid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.table({});
console.groupEnd();
console.groupEnd();
return [status, data];
return [status, {}];
});
// Save
mock.onPost(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Save");
// Create
mock.onPost(new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Create");
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> = ['salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const paramArray:Array<any> = ['opportunityid','quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -388,17 +396,18 @@ mock.onPost(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetai
console.groupEnd();
return [status, {}];
});
// Save
mock.onPost(new RegExp(/^\/salesorderdetails\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Save");
// Create
mock.onPost(new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Create");
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> = ['salesorderdetailid'];
const matchArray:any = new RegExp(/^\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
}
const paramArray:Array<any> = ['quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -408,37 +417,25 @@ mock.onPost(new RegExp(/^\/salesorderdetails\/?([a-zA-Z0-9\-\;]{0,35})\/save$/))
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.salesorderdetailid, tempValue.salesorderdetailid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['salesorderdetailid'] == tempValue['salesorderdetailid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.table({});
console.groupEnd();
console.groupEnd();
return [status, data];
return [status, {}];
});
// FetchDefault
mock.onGet(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: FetchDefault");
// Create
mock.onPost(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Create");
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> = ['salesorderid'];
const paramArray:Array<any> = ['salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/fetchdefault$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
......@@ -447,34 +444,1042 @@ mock.onGet(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetail
});
});
}
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.table({});
console.groupEnd();
console.groupEnd();
return [status, items];
return [status, {}];
});
// FetchDefault
mock.onGet(new RegExp(/^\/salesorderdetails\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: FetchDefault");
// Create
mock.onPost(new RegExp(/^\/salesorderdetails\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Create");
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> = ['salesorderdetailid'];
const matchArray:any = new RegExp(/^\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
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]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
});
// Update
mock.onPut(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Update");
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','quoteid','salesorderid','salesorderdetailid'];
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\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
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]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// Update
mock.onPut(new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Update");
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','quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
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]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// Update
mock.onPut(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Update");
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','quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
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]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// Update
mock.onPut(new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Update");
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','quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
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]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// Update
mock.onPut(new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Update");
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> = ['quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
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]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// Update
mock.onPut(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Update");
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> = ['salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
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]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// Update
mock.onPut(new RegExp(/^\/salesorderdetails\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Update");
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> = ['salesorderdetailid'];
const matchArray:any = new RegExp(/^\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
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 : [];
//let _items = items.find((item: any) => Object.is(item.salesorderdetailid, tempValue.salesorderdetailid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['salesorderdetailid'] == tempValue['salesorderdetailid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// GetDraft
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\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// GetDraft
mock.onGet(new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// GetDraft
mock.onGet(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// GetDraft
mock.onGet(new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// GetDraft
mock.onGet(new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// GetDraft
mock.onGet(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// GetDraft
mock.onGet(new RegExp(/^\/salesorderdetails\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: CheckKey");
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','quoteid','salesorderid','salesorderdetailid'];
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\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
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]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: CheckKey");
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','quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
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]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: CheckKey");
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','quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
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]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: CheckKey");
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','quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
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]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: CheckKey");
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> = ['quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
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]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: CheckKey");
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> = ['salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
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]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/salesorderdetails\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: CheckKey");
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> = ['salesorderdetailid'];
const matchArray:any = new RegExp(/^\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
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 : [];
//let _items = items.find((item: any) => Object.is(item.salesorderdetailid, tempValue.salesorderdetailid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['salesorderdetailid'] == tempValue['salesorderdetailid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// Save
mock.onPost(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Save");
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','quoteid','salesorderid','salesorderdetailid'];
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\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
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]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// Save
mock.onPost(new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Save");
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','quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
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]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// Save
mock.onPost(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Save");
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','quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
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]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// Save
mock.onPost(new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Save");
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','quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
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]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// Save
mock.onPost(new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Save");
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> = ['quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
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]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// Save
mock.onPost(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Save");
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> = ['salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
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]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// Save
mock.onPost(new RegExp(/^\/salesorderdetails\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Save");
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> = ['salesorderdetailid'];
const matchArray:any = new RegExp(/^\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
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 : [];
//let _items = items.find((item: any) => Object.is(item.salesorderdetailid, tempValue.salesorderdetailid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['salesorderdetailid'] == tempValue['salesorderdetailid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// 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\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: FetchDefault");
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','quoteid','salesorderid'];
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\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/fetchdefault$/).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];
});
// FetchDefault
mock.onGet(new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: FetchDefault");
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','quoteid','salesorderid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/fetchdefault$/).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];
});
// FetchDefault
mock.onGet(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: FetchDefault");
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','quoteid','salesorderid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/fetchdefault$/).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];
});
// FetchDefault
mock.onGet(new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: FetchDefault");
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','quoteid','salesorderid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/fetchdefault$/).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];
});
// FetchDefault
mock.onGet(new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: FetchDefault");
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> = ['quoteid','salesorderid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/fetchdefault$/).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];
});
// FetchDefault
mock.onGet(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: FetchDefault");
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> = ['salesorderid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/fetchdefault$/).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];
});
// FetchDefault
mock.onGet(new RegExp(/^\/salesorderdetails\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -517,27 +1522,237 @@ mock.onGet(new RegExp(/^\/salesorderdetails\/fetchdefault(\?[\w-./?%&=,]*)*$/)).
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Remove
mock.onDelete(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Remove");
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','quoteid','salesorderid','salesorderdetailid'];
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\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
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 : [];
let _items = items.find((item: any) => Object.is(item.salesorderdetailid, tempValue.salesorderdetailid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Remove
mock.onDelete(new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Remove");
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','quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
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 : [];
let _items = items.find((item: any) => Object.is(item.salesorderdetailid, tempValue.salesorderdetailid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Remove
mock.onDelete(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Remove");
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','quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
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 : [];
let _items = items.find((item: any) => Object.is(item.salesorderdetailid, tempValue.salesorderdetailid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Remove
mock.onDelete(new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Remove");
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','quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
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 : [];
let _items = items.find((item: any) => Object.is(item.salesorderdetailid, tempValue.salesorderdetailid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Remove
mock.onDelete(new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Remove");
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> = ['quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
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 : [];
let _items = items.find((item: any) => Object.is(item.salesorderdetailid, tempValue.salesorderdetailid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Remove
mock.onDelete(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Remove");
......@@ -594,6 +1809,146 @@ mock.onDelete(new RegExp(/^\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).repl
return [status, _items?_items:{}];
});
// Get
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\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Get");
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','quoteid','salesorderid','salesorderdetailid'];
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\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
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 : [];
let _items = items.find((item: any) => Object.is(item.salesorderdetailid, tempValue.salesorderdetailid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Get
mock.onGet(new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Get");
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','quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
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 : [];
let _items = items.find((item: any) => Object.is(item.salesorderdetailid, tempValue.salesorderdetailid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Get
mock.onGet(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Get");
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','quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
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 : [];
let _items = items.find((item: any) => Object.is(item.salesorderdetailid, tempValue.salesorderdetailid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Get
mock.onGet(new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Get");
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','quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
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 : [];
let _items = items.find((item: any) => Object.is(item.salesorderdetailid, tempValue.salesorderdetailid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Get
mock.onGet(new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Get");
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> = ['quoteid','salesorderid','salesorderdetailid'];
const matchArray:any = new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
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 : [];
let _items = items.find((item: any) => Object.is(item.salesorderdetailid, tempValue.salesorderdetailid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Get
mock.onGet(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/salesorderdetails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:salesorderdetail 方法: Get");
......
因为 它太大了无法显示 源差异 。您可以改为 查看blob
......@@ -494,7 +494,12 @@ export class SalesOrderByParentKeyBase extends GridViewBase {
if(args.length >0){
Object.assign(tempContext,args[0]);
}
const deResParameters: any[] = [];
let deResParameters: any[] = [];
if(tempContext.quote && true){
deResParameters = [
{ pathName: 'quotes', parameterName: 'quote' },
]
}
const parameters: any[] = [
{ pathName: 'salesorders', parameterName: 'salesorder' },
];
......@@ -540,7 +545,12 @@ export class SalesOrderByParentKeyBase extends GridViewBase {
if(args.length >0){
Object.assign(tempContext,args[0]);
}
const deResParameters: any[] = [];
let deResParameters: any[] = [];
if(tempContext.quote && true){
deResParameters = [
{ pathName: 'quotes', parameterName: 'quote' },
]
}
const parameters: any[] = [
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'infoview', parameterName: 'infoview' },
......
......@@ -494,7 +494,12 @@ export class SalesOrderGridViewBase extends GridViewBase {
if(args.length >0){
Object.assign(tempContext,args[0]);
}
const deResParameters: any[] = [];
let deResParameters: any[] = [];
if(tempContext.quote && true){
deResParameters = [
{ pathName: 'quotes', parameterName: 'quote' },
]
}
const parameters: any[] = [
{ pathName: 'salesorders', parameterName: 'salesorder' },
];
......@@ -540,7 +545,12 @@ export class SalesOrderGridViewBase extends GridViewBase {
if(args.length >0){
Object.assign(tempContext,args[0]);
}
const deResParameters: any[] = [];
let deResParameters: any[] = [];
if(tempContext.quote && true){
deResParameters = [
{ pathName: 'quotes', parameterName: 'quote' },
]
}
const parameters: any[] = [
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'infoview', parameterName: 'infoview' },
......
......@@ -3427,6 +3427,94 @@ const router = new Router({
},
component: () => import('@pages/sales/lead-on-grid-view/lead-on-grid-view.vue'),
},
{
path: 'accounts/:account?/contacts/:contact?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/salesorderdetails/:salesorderdetail?/soproductgridview/:soproductgridview?',
meta: {
caption: 'entities.salesorderdetail.views.soproductgridview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'salesorderdetails', parameterName: 'salesorderdetail' },
{ pathName: 'soproductgridview', parameterName: 'soproductgridview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-detail-soproduct-grid-view/sales-order-detail-soproduct-grid-view.vue'),
},
{
path: 'contacts/:contact?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/salesorderdetails/:salesorderdetail?/soproductgridview/:soproductgridview?',
meta: {
caption: 'entities.salesorderdetail.views.soproductgridview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'salesorderdetails', parameterName: 'salesorderdetail' },
{ pathName: 'soproductgridview', parameterName: 'soproductgridview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-detail-soproduct-grid-view/sales-order-detail-soproduct-grid-view.vue'),
},
{
path: 'accounts/:account?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/salesorderdetails/:salesorderdetail?/soproductgridview/:soproductgridview?',
meta: {
caption: 'entities.salesorderdetail.views.soproductgridview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'salesorderdetails', parameterName: 'salesorderdetail' },
{ pathName: 'soproductgridview', parameterName: 'soproductgridview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-detail-soproduct-grid-view/sales-order-detail-soproduct-grid-view.vue'),
},
{
path: 'opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/salesorderdetails/:salesorderdetail?/soproductgridview/:soproductgridview?',
meta: {
caption: 'entities.salesorderdetail.views.soproductgridview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'salesorderdetails', parameterName: 'salesorderdetail' },
{ pathName: 'soproductgridview', parameterName: 'soproductgridview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-detail-soproduct-grid-view/sales-order-detail-soproduct-grid-view.vue'),
},
{
path: 'quotes/:quote?/salesorders/:salesorder?/salesorderdetails/:salesorderdetail?/soproductgridview/:soproductgridview?',
meta: {
caption: 'entities.salesorderdetail.views.soproductgridview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'salesorderdetails', parameterName: 'salesorderdetail' },
{ pathName: 'soproductgridview', parameterName: 'soproductgridview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-detail-soproduct-grid-view/sales-order-detail-soproduct-grid-view.vue'),
},
{
path: 'salesorders/:salesorder?/salesorderdetails/:salesorderdetail?/soproductgridview/:soproductgridview?',
meta: {
......@@ -3498,6 +3586,89 @@ const router = new Router({
},
component: () => import('@pages/base/account-usable-grid-view/account-usable-grid-view.vue'),
},
{
path: 'accounts/:account?/contacts/:contact?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/info_soview/:info_soview?',
meta: {
caption: 'entities.salesorder.views.info_soview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'info_soview', parameterName: 'info_soview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-info-soview/sales-order-info-soview.vue'),
},
{
path: 'contacts/:contact?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/info_soview/:info_soview?',
meta: {
caption: 'entities.salesorder.views.info_soview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'info_soview', parameterName: 'info_soview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-info-soview/sales-order-info-soview.vue'),
},
{
path: 'accounts/:account?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/info_soview/:info_soview?',
meta: {
caption: 'entities.salesorder.views.info_soview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'info_soview', parameterName: 'info_soview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-info-soview/sales-order-info-soview.vue'),
},
{
path: 'opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/info_soview/:info_soview?',
meta: {
caption: 'entities.salesorder.views.info_soview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'info_soview', parameterName: 'info_soview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-info-soview/sales-order-info-soview.vue'),
},
{
path: 'quotes/:quote?/salesorders/:salesorder?/info_soview/:info_soview?',
meta: {
caption: 'entities.salesorder.views.info_soview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'info_soview', parameterName: 'info_soview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-info-soview/sales-order-info-soview.vue'),
},
{
path: 'salesorders/:salesorder?/info_soview/:info_soview?',
meta: {
......@@ -3604,6 +3775,89 @@ const router = new Router({
},
component: () => import('@pages/sales/quote-state-tab-view/quote-state-tab-view.vue'),
},
{
path: 'accounts/:account?/contacts/:contact?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/summaryview/:summaryview?',
meta: {
caption: 'entities.salesorder.views.summaryview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'summaryview', parameterName: 'summaryview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-summary-view/sales-order-summary-view.vue'),
},
{
path: 'contacts/:contact?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/summaryview/:summaryview?',
meta: {
caption: 'entities.salesorder.views.summaryview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'summaryview', parameterName: 'summaryview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-summary-view/sales-order-summary-view.vue'),
},
{
path: 'accounts/:account?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/summaryview/:summaryview?',
meta: {
caption: 'entities.salesorder.views.summaryview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'summaryview', parameterName: 'summaryview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-summary-view/sales-order-summary-view.vue'),
},
{
path: 'opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/summaryview/:summaryview?',
meta: {
caption: 'entities.salesorder.views.summaryview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'summaryview', parameterName: 'summaryview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-summary-view/sales-order-summary-view.vue'),
},
{
path: 'quotes/:quote?/salesorders/:salesorder?/summaryview/:summaryview?',
meta: {
caption: 'entities.salesorder.views.summaryview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'summaryview', parameterName: 'summaryview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-summary-view/sales-order-summary-view.vue'),
},
{
path: 'salesorders/:salesorder?/summaryview/:summaryview?',
meta: {
......@@ -4260,32 +4514,203 @@ const router = new Router({
component: () => import('@pages/sales/lead-con-lead-grid-view/lead-con-lead-grid-view.vue'),
},
{
path: 'salesorders/:salesorder?/infoview/:infoview?',
path: 'accounts/:account?/contacts/:contact?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/infoview/:infoview?',
meta: {
caption: 'entities.salesorder.views.infoview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'infoview', parameterName: 'infoview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-info-view/sales-order-info-view.vue'),
},
{
path: 'contacts/:contact?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/infoview/:infoview?',
meta: {
caption: 'entities.salesorder.views.infoview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'infoview', parameterName: 'infoview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-info-view/sales-order-info-view.vue'),
},
{
path: 'accounts/:account?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/infoview/:infoview?',
meta: {
caption: 'entities.salesorder.views.infoview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'infoview', parameterName: 'infoview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-info-view/sales-order-info-view.vue'),
},
{
path: 'opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/infoview/:infoview?',
meta: {
caption: 'entities.salesorder.views.infoview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'infoview', parameterName: 'infoview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-info-view/sales-order-info-view.vue'),
},
{
path: 'quotes/:quote?/salesorders/:salesorder?/infoview/:infoview?',
meta: {
caption: 'entities.salesorder.views.infoview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'infoview', parameterName: 'infoview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-info-view/sales-order-info-view.vue'),
},
{
path: 'salesorders/:salesorder?/infoview/:infoview?',
meta: {
caption: 'entities.salesorder.views.infoview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'infoview', parameterName: 'infoview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-info-view/sales-order-info-view.vue'),
},
{
path: 'knowledgearticles/:knowledgearticle?/info_klartview/:info_klartview?',
meta: {
caption: 'entities.knowledgearticle.views.info_klartview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'knowledgearticles', parameterName: 'knowledgearticle' },
{ pathName: 'info_klartview', parameterName: 'info_klartview' },
],
requireAuth: true,
},
component: () => import('@pages/base/knowledge-article-info-kl-art-view/knowledge-article-info-kl-art-view.vue'),
},
{
path: 'accounts/:account?/contacts/:contact?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/salesorderdetails/:salesorderdetail?/editview/:editview?',
meta: {
caption: 'entities.salesorderdetail.views.editview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'salesorderdetails', parameterName: 'salesorderdetail' },
{ pathName: 'editview', parameterName: 'editview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-detail-edit-view/sales-order-detail-edit-view.vue'),
},
{
path: 'contacts/:contact?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/salesorderdetails/:salesorderdetail?/editview/:editview?',
meta: {
caption: 'entities.salesorderdetail.views.editview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'salesorderdetails', parameterName: 'salesorderdetail' },
{ pathName: 'editview', parameterName: 'editview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-detail-edit-view/sales-order-detail-edit-view.vue'),
},
{
path: 'accounts/:account?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/salesorderdetails/:salesorderdetail?/editview/:editview?',
meta: {
caption: 'entities.salesorderdetail.views.editview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'salesorderdetails', parameterName: 'salesorderdetail' },
{ pathName: 'editview', parameterName: 'editview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-detail-edit-view/sales-order-detail-edit-view.vue'),
},
{
path: 'opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/salesorderdetails/:salesorderdetail?/editview/:editview?',
meta: {
caption: 'entities.salesorder.views.infoview.title',
caption: 'entities.salesorderdetail.views.editview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'infoview', parameterName: 'infoview' },
{ pathName: 'salesorderdetails', parameterName: 'salesorderdetail' },
{ pathName: 'editview', parameterName: 'editview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-info-view/sales-order-info-view.vue'),
component: () => import('@pages/sales/sales-order-detail-edit-view/sales-order-detail-edit-view.vue'),
},
{
path: 'knowledgearticles/:knowledgearticle?/info_klartview/:info_klartview?',
path: 'quotes/:quote?/salesorders/:salesorder?/salesorderdetails/:salesorderdetail?/editview/:editview?',
meta: {
caption: 'entities.knowledgearticle.views.info_klartview.title',
caption: 'entities.salesorderdetail.views.editview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'knowledgearticles', parameterName: 'knowledgearticle' },
{ pathName: 'info_klartview', parameterName: 'info_klartview' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'salesorderdetails', parameterName: 'salesorderdetail' },
{ pathName: 'editview', parameterName: 'editview' },
],
requireAuth: true,
},
component: () => import('@pages/base/knowledge-article-info-kl-art-view/knowledge-article-info-kl-art-view.vue'),
component: () => import('@pages/sales/sales-order-detail-edit-view/sales-order-detail-edit-view.vue'),
},
{
path: 'salesorders/:salesorder?/salesorderdetails/:salesorderdetail?/editview/:editview?',
......@@ -4966,6 +5391,89 @@ const router = new Router({
},
component: () => import('@pages/product/product-association-edit-view/product-association-edit-view.vue'),
},
{
path: 'accounts/:account?/contacts/:contact?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/gridview/:gridview?',
meta: {
caption: 'entities.salesorder.views.gridview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'gridview', parameterName: 'gridview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-grid-view/sales-order-grid-view.vue'),
},
{
path: 'contacts/:contact?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/gridview/:gridview?',
meta: {
caption: 'entities.salesorder.views.gridview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'gridview', parameterName: 'gridview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-grid-view/sales-order-grid-view.vue'),
},
{
path: 'accounts/:account?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/gridview/:gridview?',
meta: {
caption: 'entities.salesorder.views.gridview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'gridview', parameterName: 'gridview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-grid-view/sales-order-grid-view.vue'),
},
{
path: 'opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/gridview/:gridview?',
meta: {
caption: 'entities.salesorder.views.gridview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'gridview', parameterName: 'gridview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-grid-view/sales-order-grid-view.vue'),
},
{
path: 'quotes/:quote?/salesorders/:salesorder?/gridview/:gridview?',
meta: {
caption: 'entities.salesorder.views.gridview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'gridview', parameterName: 'gridview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-grid-view/sales-order-grid-view.vue'),
},
{
path: 'salesorders/:salesorder?/gridview/:gridview?',
meta: {
......@@ -5144,6 +5652,89 @@ const router = new Router({
},
component: () => import('@pages/sales/lead-quick-create/lead-quick-create.vue'),
},
{
path: 'accounts/:account?/contacts/:contact?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/quickcreateview/:quickcreateview?',
meta: {
caption: 'entities.salesorder.views.quickcreateview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'quickcreateview', parameterName: 'quickcreateview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-quick-create-view/sales-order-quick-create-view.vue'),
},
{
path: 'contacts/:contact?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/quickcreateview/:quickcreateview?',
meta: {
caption: 'entities.salesorder.views.quickcreateview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'quickcreateview', parameterName: 'quickcreateview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-quick-create-view/sales-order-quick-create-view.vue'),
},
{
path: 'accounts/:account?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/quickcreateview/:quickcreateview?',
meta: {
caption: 'entities.salesorder.views.quickcreateview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'quickcreateview', parameterName: 'quickcreateview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-quick-create-view/sales-order-quick-create-view.vue'),
},
{
path: 'opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/quickcreateview/:quickcreateview?',
meta: {
caption: 'entities.salesorder.views.quickcreateview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'quickcreateview', parameterName: 'quickcreateview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-quick-create-view/sales-order-quick-create-view.vue'),
},
{
path: 'quotes/:quote?/salesorders/:salesorder?/quickcreateview/:quickcreateview?',
meta: {
caption: 'entities.salesorder.views.quickcreateview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'quickcreateview', parameterName: 'quickcreateview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-quick-create-view/sales-order-quick-create-view.vue'),
},
{
path: 'salesorders/:salesorder?/quickcreateview/:quickcreateview?',
meta: {
......@@ -6462,6 +7053,89 @@ const router = new Router({
},
component: () => import('@pages/base/account-pickup-grid-view/account-pickup-grid-view.vue'),
},
{
path: 'accounts/:account?/contacts/:contact?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/byparentkey/:byparentkey?',
meta: {
caption: 'entities.salesorder.views.byparentkey.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'byparentkey', parameterName: 'byparentkey' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-by-parent-key/sales-order-by-parent-key.vue'),
},
{
path: 'contacts/:contact?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/byparentkey/:byparentkey?',
meta: {
caption: 'entities.salesorder.views.byparentkey.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'byparentkey', parameterName: 'byparentkey' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-by-parent-key/sales-order-by-parent-key.vue'),
},
{
path: 'accounts/:account?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/byparentkey/:byparentkey?',
meta: {
caption: 'entities.salesorder.views.byparentkey.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'byparentkey', parameterName: 'byparentkey' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-by-parent-key/sales-order-by-parent-key.vue'),
},
{
path: 'opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/byparentkey/:byparentkey?',
meta: {
caption: 'entities.salesorder.views.byparentkey.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'byparentkey', parameterName: 'byparentkey' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-by-parent-key/sales-order-by-parent-key.vue'),
},
{
path: 'quotes/:quote?/salesorders/:salesorder?/byparentkey/:byparentkey?',
meta: {
caption: 'entities.salesorder.views.byparentkey.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'quotes', parameterName: 'quote' },
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'byparentkey', parameterName: 'byparentkey' },
],
requireAuth: true,
},
component: () => import('@pages/sales/sales-order-by-parent-key/sales-order-by-parent-key.vue'),
},
{
path: 'salesorders/:salesorder?/byparentkey/:byparentkey?',
meta: {
......
......@@ -64,36 +64,36 @@ export default class AccountServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunities = opportunitiesData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
masterData.listaccounts = listaccountsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listaccounts = listaccountsData;
masterData.opportunities = opportunitiesData;
let contactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_contacts'),'undefined')){
contactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_contacts') as any);
......@@ -133,8 +133,8 @@ export default class AccountServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
......@@ -151,36 +151,36 @@ export default class AccountServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunities = opportunitiesData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
masterData.listaccounts = listaccountsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listaccounts = listaccountsData;
masterData.opportunities = opportunitiesData;
let contactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_contacts'),'undefined')){
contactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_contacts') as any);
......@@ -213,8 +213,8 @@ export default class AccountServiceBase extends EntityService {
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
......@@ -244,8 +244,8 @@ export default class AccountServiceBase extends EntityService {
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/accounts/${context.account}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
......@@ -263,8 +263,8 @@ export default class AccountServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/accounts/getdraft`,isloading);
res.data.account = data.account;
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
......@@ -337,36 +337,36 @@ export default class AccountServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunities = opportunitiesData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
masterData.listaccounts = listaccountsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listaccounts = listaccountsData;
masterData.opportunities = opportunitiesData;
let contactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_contacts'),'undefined')){
contactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_contacts') as any);
......@@ -399,8 +399,8 @@ export default class AccountServiceBase extends EntityService {
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
......
......@@ -62,36 +62,36 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
masterData.campaignlists = campaignlistsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaignlists = campaignlistsData;
masterData.leads = leadsData;
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
......@@ -116,8 +116,8 @@ export default class CampaignServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/campaigns`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
return res;
}
......@@ -133,36 +133,36 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
masterData.campaignlists = campaignlistsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaignlists = campaignlistsData;
masterData.leads = leadsData;
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
......@@ -180,8 +180,8 @@ export default class CampaignServiceBase extends EntityService {
masterData.campaigncampaigns = campaigncampaignsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/campaigns/${context.campaign}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
return res;
}
......@@ -210,8 +210,8 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/campaigns/${context.campaign}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
return res;
}
......@@ -228,8 +228,8 @@ export default class CampaignServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/campaigns/getdraft`,isloading);
res.data.campaign = data.campaign;
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
return res;
}
......@@ -258,36 +258,36 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
masterData.campaignlists = campaignlistsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaignlists = campaignlistsData;
masterData.leads = leadsData;
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
......@@ -305,8 +305,8 @@ export default class CampaignServiceBase extends EntityService {
masterData.campaigncampaigns = campaigncampaignsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
return res;
}
......
......@@ -62,11 +62,11 @@ export default class CompetitorServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
let competitorproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts'),'undefined')){
competitorproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts') as any);
if(competitorproductsData && competitorproductsData.length && competitorproductsData.length > 0){
competitorproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -76,12 +76,12 @@ export default class CompetitorServiceBase extends EntityService {
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let competitorproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts'),'undefined')){
competitorproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts') as any);
if(competitorproductsData && competitorproductsData.length && competitorproductsData.length > 0){
competitorproductsData.forEach((item:any) => {
masterData.competitorproducts = competitorproductsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -91,7 +91,7 @@ export default class CompetitorServiceBase extends EntityService {
});
}
}
masterData.competitorproducts = competitorproductsData;
masterData.leadcompetitors = leadcompetitorsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -116,8 +116,8 @@ export default class CompetitorServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/competitors`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......@@ -133,11 +133,11 @@ export default class CompetitorServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
let competitorproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts'),'undefined')){
competitorproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts') as any);
if(competitorproductsData && competitorproductsData.length && competitorproductsData.length > 0){
competitorproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -147,12 +147,12 @@ export default class CompetitorServiceBase extends EntityService {
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let competitorproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts'),'undefined')){
competitorproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts') as any);
if(competitorproductsData && competitorproductsData.length && competitorproductsData.length > 0){
competitorproductsData.forEach((item:any) => {
masterData.competitorproducts = competitorproductsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -162,7 +162,7 @@ export default class CompetitorServiceBase extends EntityService {
});
}
}
masterData.competitorproducts = competitorproductsData;
masterData.leadcompetitors = leadcompetitorsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -180,8 +180,8 @@ export default class CompetitorServiceBase extends EntityService {
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/competitors/${context.competitor}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......@@ -210,8 +210,8 @@ export default class CompetitorServiceBase extends EntityService {
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/competitors/${context.competitor}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......@@ -228,8 +228,8 @@ export default class CompetitorServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/competitors/getdraft`,isloading);
res.data.competitor = data.competitor;
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......@@ -258,11 +258,11 @@ export default class CompetitorServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
let competitorproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts'),'undefined')){
competitorproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts') as any);
if(competitorproductsData && competitorproductsData.length && competitorproductsData.length > 0){
competitorproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -272,12 +272,12 @@ export default class CompetitorServiceBase extends EntityService {
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let competitorproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts'),'undefined')){
competitorproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts') as any);
if(competitorproductsData && competitorproductsData.length && competitorproductsData.length > 0){
competitorproductsData.forEach((item:any) => {
masterData.competitorproducts = competitorproductsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -287,7 +287,7 @@ export default class CompetitorServiceBase extends EntityService {
});
}
}
masterData.competitorproducts = competitorproductsData;
masterData.leadcompetitors = leadcompetitorsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -305,8 +305,8 @@ export default class CompetitorServiceBase extends EntityService {
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/competitors/${context.competitor}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......
......@@ -68,21 +68,21 @@ export default class ContactServiceBase extends EntityService {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && true){
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
masterData.listcontacts = listcontactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
......@@ -98,21 +98,21 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
masterData.leads = leadsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -122,27 +122,27 @@ export default class ContactServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
masterData.listcontacts = listcontactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
......@@ -158,21 +158,21 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
masterData.leads = leadsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -182,9 +182,9 @@ export default class ContactServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/contacts`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -200,21 +200,21 @@ export default class ContactServiceBase extends EntityService {
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
masterData.listcontacts = listcontactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
......@@ -230,44 +230,44 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
masterData.listcontacts = listcontactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
......@@ -283,26 +283,26 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -334,15 +334,15 @@ export default class ContactServiceBase extends EntityService {
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
let res:any = await Http.getInstance().get(`/contacts/${context.contact}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -359,16 +359,16 @@ export default class ContactServiceBase extends EntityService {
if(context.account && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/getdraft`,isloading);
res.data.contact = data.contact;
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
let res:any = await Http.getInstance().get(`/contacts/getdraft`,isloading);
res.data.contact = data.contact;
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -399,21 +399,21 @@ export default class ContactServiceBase extends EntityService {
public async AddList(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
masterData.listcontacts = listcontactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
......@@ -429,26 +429,26 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
return Http.getInstance().post(`/contacts/${context.contact}/addlist`,data,isloading);
......@@ -466,21 +466,21 @@ export default class ContactServiceBase extends EntityService {
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
masterData.listcontacts = listcontactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
......@@ -496,26 +496,26 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
return Http.getInstance().post(`/contacts/${context.contact}/checkkey`,data,isloading);
......@@ -548,21 +548,21 @@ export default class ContactServiceBase extends EntityService {
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
masterData.listcontacts = listcontactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
......@@ -578,44 +578,44 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
masterData.listcontacts = listcontactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
......@@ -631,26 +631,26 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -666,21 +666,21 @@ export default class ContactServiceBase extends EntityService {
public async SetPrimary(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
masterData.listcontacts = listcontactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
......@@ -696,26 +696,26 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/setprimary`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
return Http.getInstance().post(`/contacts/${context.contact}/setprimary`,data,isloading);
......
......@@ -77,36 +77,36 @@ export default class ProductServiceBase extends EntityService {
}
}
masterData.productpricelevels = productpricelevelsData;
let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){
productsubstitutesData.forEach((item:any) => {
let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productassociationsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productsubstituteid = null;
item.productassociationid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productsubstitutes = productsubstitutesData;
let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productassociationsData.forEach((item:any) => {
masterData.productassociations = productassociationsData;
let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){
productsubstitutesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productassociationid = null;
item.productsubstituteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productassociations = productassociationsData;
masterData.productsubstitutes = productsubstitutesData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -117,8 +117,8 @@ export default class ProductServiceBase extends EntityService {
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/products`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
return res;
}
......@@ -148,41 +148,41 @@ export default class ProductServiceBase extends EntityService {
}
}
masterData.productpricelevels = productpricelevelsData;
let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){
productsubstitutesData.forEach((item:any) => {
let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productassociationsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productsubstituteid = null;
item.productassociationid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productsubstitutes = productsubstitutesData;
let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productassociationsData.forEach((item:any) => {
masterData.productassociations = productassociationsData;
let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){
productsubstitutesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productassociationid = null;
item.productsubstituteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productassociations = productassociationsData;
masterData.productsubstitutes = productsubstitutesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/products/${context.product}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
return res;
}
......@@ -211,8 +211,8 @@ export default class ProductServiceBase extends EntityService {
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/products/${context.product}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
return res;
}
......@@ -229,8 +229,8 @@ export default class ProductServiceBase extends EntityService {
let res:any = await Http.getInstance().get(`/products/getdraft`,isloading);
res.data.product = data.product;
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
return res;
}
......@@ -273,41 +273,41 @@ export default class ProductServiceBase extends EntityService {
}
}
masterData.productpricelevels = productpricelevelsData;
let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){
productsubstitutesData.forEach((item:any) => {
let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productassociationsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productsubstituteid = null;
item.productassociationid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productsubstitutes = productsubstitutesData;
let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productassociationsData.forEach((item:any) => {
masterData.productassociations = productassociationsData;
let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){
productsubstitutesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productassociationid = null;
item.productsubstituteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productassociations = productassociationsData;
masterData.productsubstitutes = productsubstitutesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/products/${context.product}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
return res;
}
......
......@@ -93,6 +93,21 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -103,6 +118,7 @@ export default class QuoteServiceBase extends EntityService {
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.contact && context.opportunity && true){
......@@ -122,6 +138,21 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -132,6 +163,7 @@ export default class QuoteServiceBase extends EntityService {
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.account && context.opportunity && true){
......@@ -151,6 +183,21 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -161,6 +208,7 @@ export default class QuoteServiceBase extends EntityService {
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.opportunity && true){
......@@ -180,6 +228,21 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -190,6 +253,7 @@ export default class QuoteServiceBase extends EntityService {
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
let masterData:any = {};
......@@ -208,6 +272,21 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -218,6 +297,7 @@ export default class QuoteServiceBase extends EntityService {
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/quotes`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
......@@ -248,9 +328,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.contact && context.opportunity && context.quote){
......@@ -270,9 +366,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.account && context.opportunity && context.quote){
......@@ -292,9 +404,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.opportunity && context.quote){
......@@ -314,9 +442,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/opportunities/${context.opportunity}/quotes/${context.quote}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
let masterData:any = {};
......@@ -335,9 +479,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/quotes/${context.quote}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
......@@ -379,25 +539,30 @@ export default class QuoteServiceBase extends EntityService {
if(context.account && context.contact && context.opportunity && context.quote){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.contact && context.opportunity && context.quote){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.account && context.opportunity && context.quote){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.opportunity && context.quote){
let res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/${context.quote}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
let res:any = await Http.getInstance().get(`/quotes/${context.quote}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
......@@ -415,29 +580,34 @@ export default class QuoteServiceBase extends EntityService {
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/getdraft`,isloading);
res.data.quote = data.quote;
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.contact && context.opportunity && true){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/getdraft`,isloading);
res.data.quote = data.quote;
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.account && context.opportunity && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/getdraft`,isloading);
res.data.quote = data.quote;
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.opportunity && true){
let res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/getdraft`,isloading);
res.data.quote = data.quote;
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
let res:any = await Http.getInstance().get(`/quotes/getdraft`,isloading);
res.data.quote = data.quote;
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
......@@ -483,9 +653,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.contact && context.opportunity && context.quote){
......@@ -505,9 +691,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.account && context.opportunity && context.quote){
......@@ -527,9 +729,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.opportunity && context.quote){
......@@ -549,9 +767,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
return Http.getInstance().post(`/quotes/${context.quote}/checkkey`,data,isloading);
......@@ -599,9 +833,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/gensalesorder`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.contact && context.opportunity && context.quote){
......@@ -621,9 +871,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/gensalesorder`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.account && context.opportunity && context.quote){
......@@ -643,9 +909,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/gensalesorder`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.opportunity && context.quote){
......@@ -665,9 +947,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/gensalesorder`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
return Http.getInstance().post(`/quotes/${context.quote}/gensalesorder`,data,isloading);
......@@ -700,9 +998,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.contact && context.opportunity && context.quote){
......@@ -722,9 +1036,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.account && context.opportunity && context.quote){
......@@ -744,9 +1074,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.opportunity && context.quote){
......@@ -766,9 +1112,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
let masterData:any = {};
......@@ -787,9 +1149,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/quotes/${context.quote}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
......
......@@ -62,21 +62,6 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
if(productsalesliteraturesData && productsalesliteraturesData.length && productsalesliteraturesData.length > 0){
productsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productsalesliteratures = productsalesliteraturesData;
let competitorsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures'),'undefined')){
competitorsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures') as any);
......@@ -107,6 +92,21 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
masterData.salesliteratureitems = salesliteratureitemsData;
let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
if(productsalesliteraturesData && productsalesliteraturesData.length && productsalesliteraturesData.length > 0){
productsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productsalesliteratures = productsalesliteraturesData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -116,9 +116,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/salesliteratures`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(tempContext.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
return res;
}
......@@ -133,21 +133,6 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
if(productsalesliteraturesData && productsalesliteraturesData.length && productsalesliteraturesData.length > 0){
productsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productsalesliteratures = productsalesliteraturesData;
let competitorsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures'),'undefined')){
competitorsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures') as any);
......@@ -178,11 +163,26 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
masterData.salesliteratureitems = salesliteratureitemsData;
let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
if(productsalesliteraturesData && productsalesliteraturesData.length && productsalesliteraturesData.length > 0){
productsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productsalesliteratures = productsalesliteraturesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/salesliteratures/${context.salesliterature}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
return res;
}
......@@ -210,9 +210,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/salesliteratures/${context.salesliterature}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
return res;
}
......@@ -228,9 +228,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/salesliteratures/getdraft`,isloading);
res.data.salesliterature = data.salesliterature;
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
return res;
}
......@@ -258,21 +258,6 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
if(productsalesliteraturesData && productsalesliteraturesData.length && productsalesliteraturesData.length > 0){
productsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productsalesliteratures = productsalesliteraturesData;
let competitorsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures'),'undefined')){
competitorsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures') as any);
......@@ -303,11 +288,26 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
masterData.salesliteratureitems = salesliteratureitemsData;
let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
if(productsalesliteraturesData && productsalesliteraturesData.length && productsalesliteraturesData.length > 0){
productsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productsalesliteratures = productsalesliteraturesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/salesliteratures/${context.salesliterature}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
return res;
}
......
......@@ -48,6 +48,21 @@ export default class SalesOrderDetailServiceBase extends EntityService {
* @memberof SalesOrderDetailServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder && context.salesorderdetail){
return Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}/select`,isloading);
}
if(context.contact && context.opportunity && context.quote && context.salesorder && context.salesorderdetail){
return Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}/select`,isloading);
}
if(context.account && context.opportunity && context.quote && context.salesorder && context.salesorderdetail){
return Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}/select`,isloading);
}
if(context.opportunity && context.quote && context.salesorder && context.salesorderdetail){
return Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}/select`,isloading);
}
if(context.quote && context.salesorder && context.salesorderdetail){
return Http.getInstance().get(`/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}/select`,isloading);
}
if(context.salesorder && context.salesorderdetail){
return Http.getInstance().get(`/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}/select`,isloading);
}
......@@ -64,6 +79,71 @@ export default class SalesOrderDetailServiceBase extends EntityService {
* @memberof SalesOrderDetailServiceBase
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder && true){
let masterData:any = {};
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails`,data,isloading);
return res;
}
if(context.contact && context.opportunity && context.quote && context.salesorder && true){
let masterData:any = {};
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails`,data,isloading);
return res;
}
if(context.account && context.opportunity && context.quote && context.salesorder && true){
let masterData:any = {};
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails`,data,isloading);
return res;
}
if(context.opportunity && context.quote && context.salesorder && true){
let masterData:any = {};
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails`,data,isloading);
return res;
}
if(context.quote && context.salesorder && true){
let masterData:any = {};
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails`,data,isloading);
return res;
}
if(context.salesorder && true){
let masterData:any = {};
Object.assign(data,masterData);
......@@ -100,6 +180,36 @@ export default class SalesOrderDetailServiceBase extends EntityService {
* @memberof SalesOrderDetailServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder && context.salesorderdetail){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}`,data,isloading);
return res;
}
if(context.contact && context.opportunity && context.quote && context.salesorder && context.salesorderdetail){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}`,data,isloading);
return res;
}
if(context.account && context.opportunity && context.quote && context.salesorder && context.salesorderdetail){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}`,data,isloading);
return res;
}
if(context.opportunity && context.quote && context.salesorder && context.salesorderdetail){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}`,data,isloading);
return res;
}
if(context.quote && context.salesorder && context.salesorderdetail){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}`,data,isloading);
return res;
}
if(context.salesorder && context.salesorderdetail){
let masterData:any = {};
Object.assign(data,masterData);
......@@ -122,6 +232,21 @@ export default class SalesOrderDetailServiceBase extends EntityService {
* @memberof SalesOrderDetailServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder && context.salesorderdetail){
return Http.getInstance().delete(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}`,isloading);
}
if(context.contact && context.opportunity && context.quote && context.salesorder && context.salesorderdetail){
return Http.getInstance().delete(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}`,isloading);
}
if(context.account && context.opportunity && context.quote && context.salesorder && context.salesorderdetail){
return Http.getInstance().delete(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}`,isloading);
}
if(context.opportunity && context.quote && context.salesorder && context.salesorderdetail){
return Http.getInstance().delete(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}`,isloading);
}
if(context.quote && context.salesorder && context.salesorderdetail){
return Http.getInstance().delete(`/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}`,isloading);
}
if(context.salesorder && context.salesorderdetail){
return Http.getInstance().delete(`/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}`,isloading);
}
......@@ -138,6 +263,26 @@ export default class SalesOrderDetailServiceBase extends EntityService {
* @memberof SalesOrderDetailServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder && context.salesorderdetail){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}`,isloading);
return res;
}
if(context.contact && context.opportunity && context.quote && context.salesorder && context.salesorderdetail){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}`,isloading);
return res;
}
if(context.account && context.opportunity && context.quote && context.salesorder && context.salesorderdetail){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}`,isloading);
return res;
}
if(context.opportunity && context.quote && context.salesorder && context.salesorderdetail){
let res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}`,isloading);
return res;
}
if(context.quote && context.salesorder && context.salesorderdetail){
let res:any = await Http.getInstance().get(`/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}`,isloading);
return res;
}
if(context.salesorder && context.salesorderdetail){
let res:any = await Http.getInstance().get(`/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}`,isloading);
return res;
......@@ -156,6 +301,31 @@ export default class SalesOrderDetailServiceBase extends EntityService {
* @memberof SalesOrderDetailServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/getdraft`,isloading);
res.data.salesorderdetail = data.salesorderdetail;
return res;
}
if(context.contact && context.opportunity && context.quote && context.salesorder && true){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/getdraft`,isloading);
res.data.salesorderdetail = data.salesorderdetail;
return res;
}
if(context.account && context.opportunity && context.quote && context.salesorder && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/getdraft`,isloading);
res.data.salesorderdetail = data.salesorderdetail;
return res;
}
if(context.opportunity && context.quote && context.salesorder && true){
let res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/getdraft`,isloading);
res.data.salesorderdetail = data.salesorderdetail;
return res;
}
if(context.quote && context.salesorder && true){
let res:any = await Http.getInstance().get(`/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/getdraft`,isloading);
res.data.salesorderdetail = data.salesorderdetail;
return res;
}
if(context.salesorder && true){
let res:any = await Http.getInstance().get(`/salesorders/${context.salesorder}/salesorderdetails/getdraft`,isloading);
res.data.salesorderdetail = data.salesorderdetail;
......@@ -176,6 +346,36 @@ export default class SalesOrderDetailServiceBase extends EntityService {
* @memberof SalesOrderDetailServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder && context.salesorderdetail){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}/checkkey`,data,isloading);
return res;
}
if(context.contact && context.opportunity && context.quote && context.salesorder && context.salesorderdetail){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}/checkkey`,data,isloading);
return res;
}
if(context.account && context.opportunity && context.quote && context.salesorder && context.salesorderdetail){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}/checkkey`,data,isloading);
return res;
}
if(context.opportunity && context.quote && context.salesorder && context.salesorderdetail){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}/checkkey`,data,isloading);
return res;
}
if(context.quote && context.salesorder && context.salesorderdetail){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}/checkkey`,data,isloading);
return res;
}
if(context.salesorder && context.salesorderdetail){
let masterData:any = {};
Object.assign(data,masterData);
......@@ -195,6 +395,36 @@ export default class SalesOrderDetailServiceBase extends EntityService {
* @memberof SalesOrderDetailServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder && context.salesorderdetail){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}/save`,data,isloading);
return res;
}
if(context.contact && context.opportunity && context.quote && context.salesorder && context.salesorderdetail){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}/save`,data,isloading);
return res;
}
if(context.account && context.opportunity && context.quote && context.salesorder && context.salesorderdetail){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}/save`,data,isloading);
return res;
}
if(context.opportunity && context.quote && context.salesorder && context.salesorderdetail){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}/save`,data,isloading);
return res;
}
if(context.quote && context.salesorder && context.salesorderdetail){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/${context.salesorderdetail}/save`,data,isloading);
return res;
}
if(context.salesorder && context.salesorderdetail){
let masterData:any = {};
Object.assign(data,masterData);
......@@ -217,6 +447,26 @@ export default class SalesOrderDetailServiceBase extends EntityService {
* @memberof SalesOrderDetailServiceBase
*/
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/fetchdefault`,tempData,isloading);
}
if(context.contact && context.opportunity && context.quote && context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/fetchdefault`,tempData,isloading);
}
if(context.account && context.opportunity && context.quote && context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/fetchdefault`,tempData,isloading);
}
if(context.opportunity && context.quote && context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/fetchdefault`,tempData,isloading);
}
if(context.quote && context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/quotes/${context.quote}/salesorders/${context.salesorder}/salesorderdetails/fetchdefault`,tempData,isloading);
}
if(context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/salesorders/${context.salesorder}/salesorderdetails/fetchdefault`,tempData,isloading);
......
......@@ -48,6 +48,21 @@ export default class SalesOrderServiceBase extends EntityService {
* @memberof SalesOrderServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder){
return Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/select`,isloading);
}
if(context.contact && context.opportunity && context.quote && context.salesorder){
return Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/select`,isloading);
}
if(context.account && context.opportunity && context.quote && context.salesorder){
return Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/select`,isloading);
}
if(context.opportunity && context.quote && context.salesorder){
return Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/select`,isloading);
}
if(context.quote && context.salesorder){
return Http.getInstance().get(`/quotes/${context.quote}/salesorders/${context.salesorder}/select`,isloading);
}
return Http.getInstance().get(`/salesorders/${context.salesorder}/select`,isloading);
}
......@@ -61,6 +76,151 @@ export default class SalesOrderServiceBase extends EntityService {
* @memberof SalesOrderServiceBase
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && true){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.contact && context.opportunity && context.quote && true){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.account && context.opportunity && context.quote && true){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.opportunity && context.quote && true){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.quote && true){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/quotes/${context.quote}/salesorders`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
......@@ -100,6 +260,116 @@ export default class SalesOrderServiceBase extends EntityService {
* @memberof SalesOrderServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.account && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/quotes/${context.quote}/salesorders/${context.salesorder}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
......@@ -132,6 +402,21 @@ export default class SalesOrderServiceBase extends EntityService {
* @memberof SalesOrderServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder){
return Http.getInstance().delete(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,isloading);
}
if(context.contact && context.opportunity && context.quote && context.salesorder){
return Http.getInstance().delete(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,isloading);
}
if(context.account && context.opportunity && context.quote && context.salesorder){
return Http.getInstance().delete(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,isloading);
}
if(context.opportunity && context.quote && context.salesorder){
return Http.getInstance().delete(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,isloading);
}
if(context.quote && context.salesorder){
return Http.getInstance().delete(`/quotes/${context.quote}/salesorders/${context.salesorder}`,isloading);
}
return Http.getInstance().delete(`/salesorders/${context.salesorder}`,isloading);
}
......@@ -145,6 +430,31 @@ export default class SalesOrderServiceBase extends EntityService {
* @memberof SalesOrderServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.contact && context.opportunity && context.quote && context.salesorder){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.account && context.opportunity && context.quote && context.salesorder){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.opportunity && context.quote && context.salesorder){
let res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.quote && context.salesorder){
let res:any = await Http.getInstance().get(`/quotes/${context.quote}/salesorders/${context.salesorder}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
let res:any = await Http.getInstance().get(`/salesorders/${context.salesorder}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
......@@ -160,6 +470,36 @@ export default class SalesOrderServiceBase extends EntityService {
* @memberof SalesOrderServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/getdraft`,isloading);
res.data.salesorder = data.salesorder;
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.contact && context.opportunity && context.quote && true){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/getdraft`,isloading);
res.data.salesorder = data.salesorder;
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.account && context.opportunity && context.quote && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/getdraft`,isloading);
res.data.salesorder = data.salesorder;
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.opportunity && context.quote && true){
let res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/getdraft`,isloading);
res.data.salesorder = data.salesorder;
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.quote && true){
let res:any = await Http.getInstance().get(`/quotes/${context.quote}/salesorders/getdraft`,isloading);
res.data.salesorder = data.salesorder;
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
let res:any = await Http.getInstance().get(`/salesorders/getdraft`,isloading);
res.data.salesorder = data.salesorder;
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
......@@ -176,37 +516,367 @@ export default class SalesOrderServiceBase extends EntityService {
* @memberof SalesOrderServiceBase
*/
public async Cancel(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().post(`/salesorders/${context.salesorder}/cancel`,data,isloading);
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SalesOrderServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().post(`/salesorders/${context.salesorder}/checkkey`,data,isloading);
}
/**
* Finish接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SalesOrderServiceBase
*/
public async Finish(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().post(`/salesorders/${context.salesorder}/finish`,data,isloading);
}
/**
* GenInvoice接口方法
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/cancel`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/cancel`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.account && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/cancel`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/cancel`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/quotes/${context.quote}/salesorders/${context.salesorder}/cancel`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
return Http.getInstance().post(`/salesorders/${context.salesorder}/cancel`,data,isloading);
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SalesOrderServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.account && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/quotes/${context.quote}/salesorders/${context.salesorder}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
return Http.getInstance().post(`/salesorders/${context.salesorder}/checkkey`,data,isloading);
}
/**
* Finish接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SalesOrderServiceBase
*/
public async Finish(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/finish`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/finish`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.account && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/finish`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/finish`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/quotes/${context.quote}/salesorders/${context.salesorder}/finish`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
return Http.getInstance().post(`/salesorders/${context.salesorder}/finish`,data,isloading);
}
/**
* GenInvoice接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -215,6 +885,116 @@ export default class SalesOrderServiceBase extends EntityService {
* @memberof SalesOrderServiceBase
*/
public async GenInvoice(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/geninvoice`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/geninvoice`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.account && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/geninvoice`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/geninvoice`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/quotes/${context.quote}/salesorders/${context.salesorder}/geninvoice`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
return Http.getInstance().post(`/salesorders/${context.salesorder}/geninvoice`,data,isloading);
}
......@@ -228,6 +1008,116 @@ export default class SalesOrderServiceBase extends EntityService {
* @memberof SalesOrderServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.account && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/quotes/${context.quote}/salesorders/${context.salesorder}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
......@@ -260,6 +1150,26 @@ export default class SalesOrderServiceBase extends EntityService {
* @memberof SalesOrderServiceBase
*/
public async FetchByParentKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/fetchbyparentkey`,tempData,isloading);
}
if(context.contact && context.opportunity && context.quote && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/fetchbyparentkey`,tempData,isloading);
}
if(context.account && context.opportunity && context.quote && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/fetchbyparentkey`,tempData,isloading);
}
if(context.opportunity && context.quote && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/fetchbyparentkey`,tempData,isloading);
}
if(context.quote && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/quotes/${context.quote}/salesorders/fetchbyparentkey`,tempData,isloading);
}
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/salesorders/fetchbyparentkey`,tempData,isloading);
}
......@@ -274,6 +1184,26 @@ export default class SalesOrderServiceBase extends EntityService {
* @memberof SalesOrderServiceBase
*/
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/fetchdefault`,tempData,isloading);
}
if(context.contact && context.opportunity && context.quote && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/fetchdefault`,tempData,isloading);
}
if(context.account && context.opportunity && context.quote && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/fetchdefault`,tempData,isloading);
}
if(context.opportunity && context.quote && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/fetchdefault`,tempData,isloading);
}
if(context.quote && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/quotes/${context.quote}/salesorders/fetchdefault`,tempData,isloading);
}
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/salesorders/fetchdefault`,tempData,isloading);
}
......
......@@ -134,6 +134,11 @@ export default class SalesOrderUIServiceBase extends UIService {
Object.assign(data,parentObj);
Object.assign(context,parentObj);
let deResParameters: any[] = [];
if(context.quote && true){
deResParameters = [
{ pathName: 'quotes', parameterName: 'quote' },
]
}
const parameters: any[] = [
{ pathName: 'salesorders', parameterName: 'salesorder' },
{ pathName: 'infoview', parameterName: 'infoview' },
......@@ -383,6 +388,11 @@ export default class SalesOrderUIServiceBase extends UIService {
Object.assign(data,parentObj);
Object.assign(context,parentObj);
let deResParameters: any[] = [];
if(context.quote && true){
deResParameters = [
{ pathName: 'quotes', parameterName: 'quote' },
]
}
const parameters: any[] = [
{ pathName: 'salesorders', parameterName: 'salesorder' },
];
......
......@@ -293,5 +293,670 @@ public class SalesOrderDetailResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(salesorderdetailMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.salesorderdetailMapping.toDomain(#salesorderdetaildto),'iBizBusinessCentral-SalesOrderDetail-Create')")
@ApiOperation(value = "根据报价单订单建立订单产品", tags = {"订单产品" }, notes = "根据报价单订单建立订单产品")
@RequestMapping(method = RequestMethod.POST, value = "/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails")
@Transactional
public ResponseEntity<SalesOrderDetailDTO> createByQuoteSalesOrder(@PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDetailDTO salesorderdetaildto) {
SalesOrderDetail domain = salesorderdetailMapping.toDomain(salesorderdetaildto);
domain.setSalesorderid(salesorder_id);
salesorderdetailService.create(domain);
SalesOrderDetailDTO dto = salesorderdetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.salesorderdetailMapping.toDomain(#salesorderdetaildtos),'iBizBusinessCentral-SalesOrderDetail-Create')")
@ApiOperation(value = "根据报价单订单批量建立订单产品", tags = {"订单产品" }, notes = "根据报价单订单批量建立订单产品")
@RequestMapping(method = RequestMethod.POST, value = "/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/batch")
public ResponseEntity<Boolean> createBatchByQuoteSalesOrder(@PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody List<SalesOrderDetailDTO> salesorderdetaildtos) {
List<SalesOrderDetail> domainlist=salesorderdetailMapping.toDomain(salesorderdetaildtos);
for(SalesOrderDetail domain:domainlist){
domain.setSalesorderid(salesorder_id);
}
salesorderdetailService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "salesorderdetail" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.salesorderdetailService.get(#salesorderdetail_id),'iBizBusinessCentral-SalesOrderDetail-Update')")
@ApiOperation(value = "根据报价单订单更新订单产品", tags = {"订单产品" }, notes = "根据报价单订单更新订单产品")
@RequestMapping(method = RequestMethod.PUT, value = "/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/{salesorderdetail_id}")
@Transactional
public ResponseEntity<SalesOrderDetailDTO> updateByQuoteSalesOrder(@PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @PathVariable("salesorderdetail_id") String salesorderdetail_id, @RequestBody SalesOrderDetailDTO salesorderdetaildto) {
SalesOrderDetail domain = salesorderdetailMapping.toDomain(salesorderdetaildto);
domain.setSalesorderid(salesorder_id);
domain.setSalesorderdetailid(salesorderdetail_id);
salesorderdetailService.update(domain);
SalesOrderDetailDTO dto = salesorderdetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.salesorderdetailService.getSalesorderdetailByEntities(this.salesorderdetailMapping.toDomain(#salesorderdetaildtos)),'iBizBusinessCentral-SalesOrderDetail-Update')")
@ApiOperation(value = "根据报价单订单批量更新订单产品", tags = {"订单产品" }, notes = "根据报价单订单批量更新订单产品")
@RequestMapping(method = RequestMethod.PUT, value = "/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/batch")
public ResponseEntity<Boolean> updateBatchByQuoteSalesOrder(@PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody List<SalesOrderDetailDTO> salesorderdetaildtos) {
List<SalesOrderDetail> domainlist=salesorderdetailMapping.toDomain(salesorderdetaildtos);
for(SalesOrderDetail domain:domainlist){
domain.setSalesorderid(salesorder_id);
}
salesorderdetailService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.salesorderdetailService.get(#salesorderdetail_id),'iBizBusinessCentral-SalesOrderDetail-Remove')")
@ApiOperation(value = "根据报价单订单删除订单产品", tags = {"订单产品" }, notes = "根据报价单订单删除订单产品")
@RequestMapping(method = RequestMethod.DELETE, value = "/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/{salesorderdetail_id}")
@Transactional
public ResponseEntity<Boolean> removeByQuoteSalesOrder(@PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @PathVariable("salesorderdetail_id") String salesorderdetail_id) {
return ResponseEntity.status(HttpStatus.OK).body(salesorderdetailService.remove(salesorderdetail_id));
}
@PreAuthorize("hasPermission(this.salesorderdetailService.getSalesorderdetailByIds(#ids),'iBizBusinessCentral-SalesOrderDetail-Remove')")
@ApiOperation(value = "根据报价单订单批量删除订单产品", tags = {"订单产品" }, notes = "根据报价单订单批量删除订单产品")
@RequestMapping(method = RequestMethod.DELETE, value = "/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/batch")
public ResponseEntity<Boolean> removeBatchByQuoteSalesOrder(@RequestBody List<String> ids) {
salesorderdetailService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.salesorderdetailMapping.toDomain(returnObject.body),'iBizBusinessCentral-SalesOrderDetail-Get')")
@ApiOperation(value = "根据报价单订单获取订单产品", tags = {"订单产品" }, notes = "根据报价单订单获取订单产品")
@RequestMapping(method = RequestMethod.GET, value = "/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/{salesorderdetail_id}")
public ResponseEntity<SalesOrderDetailDTO> getByQuoteSalesOrder(@PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @PathVariable("salesorderdetail_id") String salesorderdetail_id) {
SalesOrderDetail domain = salesorderdetailService.get(salesorderdetail_id);
SalesOrderDetailDTO dto = salesorderdetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据报价单订单获取订单产品草稿", tags = {"订单产品" }, notes = "根据报价单订单获取订单产品草稿")
@RequestMapping(method = RequestMethod.GET, value = "/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/getdraft")
public ResponseEntity<SalesOrderDetailDTO> getDraftByQuoteSalesOrder(@PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id) {
SalesOrderDetail domain = new SalesOrderDetail();
domain.setSalesorderid(salesorder_id);
return ResponseEntity.status(HttpStatus.OK).body(salesorderdetailMapping.toDto(salesorderdetailService.getDraft(domain)));
}
@ApiOperation(value = "根据报价单订单检查订单产品", tags = {"订单产品" }, notes = "根据报价单订单检查订单产品")
@RequestMapping(method = RequestMethod.POST, value = "/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/checkkey")
public ResponseEntity<Boolean> checkKeyByQuoteSalesOrder(@PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDetailDTO salesorderdetaildto) {
return ResponseEntity.status(HttpStatus.OK).body(salesorderdetailService.checkKey(salesorderdetailMapping.toDomain(salesorderdetaildto)));
}
@PreAuthorize("hasPermission(this.salesorderdetailMapping.toDomain(#salesorderdetaildto),'iBizBusinessCentral-SalesOrderDetail-Save')")
@ApiOperation(value = "根据报价单订单保存订单产品", tags = {"订单产品" }, notes = "根据报价单订单保存订单产品")
@RequestMapping(method = RequestMethod.POST, value = "/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/save")
public ResponseEntity<Boolean> saveByQuoteSalesOrder(@PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDetailDTO salesorderdetaildto) {
SalesOrderDetail domain = salesorderdetailMapping.toDomain(salesorderdetaildto);
domain.setSalesorderid(salesorder_id);
return ResponseEntity.status(HttpStatus.OK).body(salesorderdetailService.save(domain));
}
@PreAuthorize("hasPermission(this.salesorderdetailMapping.toDomain(#salesorderdetaildtos),'iBizBusinessCentral-SalesOrderDetail-Save')")
@ApiOperation(value = "根据报价单订单批量保存订单产品", tags = {"订单产品" }, notes = "根据报价单订单批量保存订单产品")
@RequestMapping(method = RequestMethod.POST, value = "/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/savebatch")
public ResponseEntity<Boolean> saveBatchByQuoteSalesOrder(@PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody List<SalesOrderDetailDTO> salesorderdetaildtos) {
List<SalesOrderDetail> domainlist=salesorderdetailMapping.toDomain(salesorderdetaildtos);
for(SalesOrderDetail domain:domainlist){
domain.setSalesorderid(salesorder_id);
}
salesorderdetailService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrderDetail-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrderDetail-Get')")
@ApiOperation(value = "根据报价单订单获取DEFAULT", tags = {"订单产品" } ,notes = "根据报价单订单获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/fetchdefault")
public ResponseEntity<List<SalesOrderDetailDTO>> fetchSalesOrderDetailDefaultByQuoteSalesOrder(@PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id,SalesOrderDetailSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<SalesOrderDetail> domains = salesorderdetailService.searchDefault(context) ;
List<SalesOrderDetailDTO> list = salesorderdetailMapping.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-SalesOrderDetail-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrderDetail-Get')")
@ApiOperation(value = "根据报价单订单查询DEFAULT", tags = {"订单产品" } ,notes = "根据报价单订单查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/searchdefault")
public ResponseEntity<Page<SalesOrderDetailDTO>> searchSalesOrderDetailDefaultByQuoteSalesOrder(@PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDetailSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<SalesOrderDetail> domains = salesorderdetailService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(salesorderdetailMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.salesorderdetailMapping.toDomain(#salesorderdetaildto),'iBizBusinessCentral-SalesOrderDetail-Create')")
@ApiOperation(value = "根据商机报价单订单建立订单产品", tags = {"订单产品" }, notes = "根据商机报价单订单建立订单产品")
@RequestMapping(method = RequestMethod.POST, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails")
@Transactional
public ResponseEntity<SalesOrderDetailDTO> createByOpportunityQuoteSalesOrder(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDetailDTO salesorderdetaildto) {
SalesOrderDetail domain = salesorderdetailMapping.toDomain(salesorderdetaildto);
domain.setSalesorderid(salesorder_id);
salesorderdetailService.create(domain);
SalesOrderDetailDTO dto = salesorderdetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.salesorderdetailMapping.toDomain(#salesorderdetaildtos),'iBizBusinessCentral-SalesOrderDetail-Create')")
@ApiOperation(value = "根据商机报价单订单批量建立订单产品", tags = {"订单产品" }, notes = "根据商机报价单订单批量建立订单产品")
@RequestMapping(method = RequestMethod.POST, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/batch")
public ResponseEntity<Boolean> createBatchByOpportunityQuoteSalesOrder(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody List<SalesOrderDetailDTO> salesorderdetaildtos) {
List<SalesOrderDetail> domainlist=salesorderdetailMapping.toDomain(salesorderdetaildtos);
for(SalesOrderDetail domain:domainlist){
domain.setSalesorderid(salesorder_id);
}
salesorderdetailService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "salesorderdetail" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.salesorderdetailService.get(#salesorderdetail_id),'iBizBusinessCentral-SalesOrderDetail-Update')")
@ApiOperation(value = "根据商机报价单订单更新订单产品", tags = {"订单产品" }, notes = "根据商机报价单订单更新订单产品")
@RequestMapping(method = RequestMethod.PUT, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/{salesorderdetail_id}")
@Transactional
public ResponseEntity<SalesOrderDetailDTO> updateByOpportunityQuoteSalesOrder(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @PathVariable("salesorderdetail_id") String salesorderdetail_id, @RequestBody SalesOrderDetailDTO salesorderdetaildto) {
SalesOrderDetail domain = salesorderdetailMapping.toDomain(salesorderdetaildto);
domain.setSalesorderid(salesorder_id);
domain.setSalesorderdetailid(salesorderdetail_id);
salesorderdetailService.update(domain);
SalesOrderDetailDTO dto = salesorderdetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.salesorderdetailService.getSalesorderdetailByEntities(this.salesorderdetailMapping.toDomain(#salesorderdetaildtos)),'iBizBusinessCentral-SalesOrderDetail-Update')")
@ApiOperation(value = "根据商机报价单订单批量更新订单产品", tags = {"订单产品" }, notes = "根据商机报价单订单批量更新订单产品")
@RequestMapping(method = RequestMethod.PUT, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/batch")
public ResponseEntity<Boolean> updateBatchByOpportunityQuoteSalesOrder(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody List<SalesOrderDetailDTO> salesorderdetaildtos) {
List<SalesOrderDetail> domainlist=salesorderdetailMapping.toDomain(salesorderdetaildtos);
for(SalesOrderDetail domain:domainlist){
domain.setSalesorderid(salesorder_id);
}
salesorderdetailService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.salesorderdetailService.get(#salesorderdetail_id),'iBizBusinessCentral-SalesOrderDetail-Remove')")
@ApiOperation(value = "根据商机报价单订单删除订单产品", tags = {"订单产品" }, notes = "根据商机报价单订单删除订单产品")
@RequestMapping(method = RequestMethod.DELETE, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/{salesorderdetail_id}")
@Transactional
public ResponseEntity<Boolean> removeByOpportunityQuoteSalesOrder(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @PathVariable("salesorderdetail_id") String salesorderdetail_id) {
return ResponseEntity.status(HttpStatus.OK).body(salesorderdetailService.remove(salesorderdetail_id));
}
@PreAuthorize("hasPermission(this.salesorderdetailService.getSalesorderdetailByIds(#ids),'iBizBusinessCentral-SalesOrderDetail-Remove')")
@ApiOperation(value = "根据商机报价单订单批量删除订单产品", tags = {"订单产品" }, notes = "根据商机报价单订单批量删除订单产品")
@RequestMapping(method = RequestMethod.DELETE, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/batch")
public ResponseEntity<Boolean> removeBatchByOpportunityQuoteSalesOrder(@RequestBody List<String> ids) {
salesorderdetailService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.salesorderdetailMapping.toDomain(returnObject.body),'iBizBusinessCentral-SalesOrderDetail-Get')")
@ApiOperation(value = "根据商机报价单订单获取订单产品", tags = {"订单产品" }, notes = "根据商机报价单订单获取订单产品")
@RequestMapping(method = RequestMethod.GET, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/{salesorderdetail_id}")
public ResponseEntity<SalesOrderDetailDTO> getByOpportunityQuoteSalesOrder(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @PathVariable("salesorderdetail_id") String salesorderdetail_id) {
SalesOrderDetail domain = salesorderdetailService.get(salesorderdetail_id);
SalesOrderDetailDTO dto = salesorderdetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据商机报价单订单获取订单产品草稿", tags = {"订单产品" }, notes = "根据商机报价单订单获取订单产品草稿")
@RequestMapping(method = RequestMethod.GET, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/getdraft")
public ResponseEntity<SalesOrderDetailDTO> getDraftByOpportunityQuoteSalesOrder(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id) {
SalesOrderDetail domain = new SalesOrderDetail();
domain.setSalesorderid(salesorder_id);
return ResponseEntity.status(HttpStatus.OK).body(salesorderdetailMapping.toDto(salesorderdetailService.getDraft(domain)));
}
@ApiOperation(value = "根据商机报价单订单检查订单产品", tags = {"订单产品" }, notes = "根据商机报价单订单检查订单产品")
@RequestMapping(method = RequestMethod.POST, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/checkkey")
public ResponseEntity<Boolean> checkKeyByOpportunityQuoteSalesOrder(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDetailDTO salesorderdetaildto) {
return ResponseEntity.status(HttpStatus.OK).body(salesorderdetailService.checkKey(salesorderdetailMapping.toDomain(salesorderdetaildto)));
}
@PreAuthorize("hasPermission(this.salesorderdetailMapping.toDomain(#salesorderdetaildto),'iBizBusinessCentral-SalesOrderDetail-Save')")
@ApiOperation(value = "根据商机报价单订单保存订单产品", tags = {"订单产品" }, notes = "根据商机报价单订单保存订单产品")
@RequestMapping(method = RequestMethod.POST, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/save")
public ResponseEntity<Boolean> saveByOpportunityQuoteSalesOrder(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDetailDTO salesorderdetaildto) {
SalesOrderDetail domain = salesorderdetailMapping.toDomain(salesorderdetaildto);
domain.setSalesorderid(salesorder_id);
return ResponseEntity.status(HttpStatus.OK).body(salesorderdetailService.save(domain));
}
@PreAuthorize("hasPermission(this.salesorderdetailMapping.toDomain(#salesorderdetaildtos),'iBizBusinessCentral-SalesOrderDetail-Save')")
@ApiOperation(value = "根据商机报价单订单批量保存订单产品", tags = {"订单产品" }, notes = "根据商机报价单订单批量保存订单产品")
@RequestMapping(method = RequestMethod.POST, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/savebatch")
public ResponseEntity<Boolean> saveBatchByOpportunityQuoteSalesOrder(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody List<SalesOrderDetailDTO> salesorderdetaildtos) {
List<SalesOrderDetail> domainlist=salesorderdetailMapping.toDomain(salesorderdetaildtos);
for(SalesOrderDetail domain:domainlist){
domain.setSalesorderid(salesorder_id);
}
salesorderdetailService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrderDetail-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrderDetail-Get')")
@ApiOperation(value = "根据商机报价单订单获取DEFAULT", tags = {"订单产品" } ,notes = "根据商机报价单订单获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/fetchdefault")
public ResponseEntity<List<SalesOrderDetailDTO>> fetchSalesOrderDetailDefaultByOpportunityQuoteSalesOrder(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id,SalesOrderDetailSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<SalesOrderDetail> domains = salesorderdetailService.searchDefault(context) ;
List<SalesOrderDetailDTO> list = salesorderdetailMapping.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-SalesOrderDetail-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrderDetail-Get')")
@ApiOperation(value = "根据商机报价单订单查询DEFAULT", tags = {"订单产品" } ,notes = "根据商机报价单订单查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/searchdefault")
public ResponseEntity<Page<SalesOrderDetailDTO>> searchSalesOrderDetailDefaultByOpportunityQuoteSalesOrder(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDetailSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<SalesOrderDetail> domains = salesorderdetailService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(salesorderdetailMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.salesorderdetailMapping.toDomain(#salesorderdetaildto),'iBizBusinessCentral-SalesOrderDetail-Create')")
@ApiOperation(value = "根据客户商机报价单订单建立订单产品", tags = {"订单产品" }, notes = "根据客户商机报价单订单建立订单产品")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails")
@Transactional
public ResponseEntity<SalesOrderDetailDTO> createByAccountOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDetailDTO salesorderdetaildto) {
SalesOrderDetail domain = salesorderdetailMapping.toDomain(salesorderdetaildto);
domain.setSalesorderid(salesorder_id);
salesorderdetailService.create(domain);
SalesOrderDetailDTO dto = salesorderdetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.salesorderdetailMapping.toDomain(#salesorderdetaildtos),'iBizBusinessCentral-SalesOrderDetail-Create')")
@ApiOperation(value = "根据客户商机报价单订单批量建立订单产品", tags = {"订单产品" }, notes = "根据客户商机报价单订单批量建立订单产品")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/batch")
public ResponseEntity<Boolean> createBatchByAccountOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody List<SalesOrderDetailDTO> salesorderdetaildtos) {
List<SalesOrderDetail> domainlist=salesorderdetailMapping.toDomain(salesorderdetaildtos);
for(SalesOrderDetail domain:domainlist){
domain.setSalesorderid(salesorder_id);
}
salesorderdetailService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "salesorderdetail" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.salesorderdetailService.get(#salesorderdetail_id),'iBizBusinessCentral-SalesOrderDetail-Update')")
@ApiOperation(value = "根据客户商机报价单订单更新订单产品", tags = {"订单产品" }, notes = "根据客户商机报价单订单更新订单产品")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/{salesorderdetail_id}")
@Transactional
public ResponseEntity<SalesOrderDetailDTO> updateByAccountOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @PathVariable("salesorderdetail_id") String salesorderdetail_id, @RequestBody SalesOrderDetailDTO salesorderdetaildto) {
SalesOrderDetail domain = salesorderdetailMapping.toDomain(salesorderdetaildto);
domain.setSalesorderid(salesorder_id);
domain.setSalesorderdetailid(salesorderdetail_id);
salesorderdetailService.update(domain);
SalesOrderDetailDTO dto = salesorderdetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.salesorderdetailService.getSalesorderdetailByEntities(this.salesorderdetailMapping.toDomain(#salesorderdetaildtos)),'iBizBusinessCentral-SalesOrderDetail-Update')")
@ApiOperation(value = "根据客户商机报价单订单批量更新订单产品", tags = {"订单产品" }, notes = "根据客户商机报价单订单批量更新订单产品")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/batch")
public ResponseEntity<Boolean> updateBatchByAccountOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody List<SalesOrderDetailDTO> salesorderdetaildtos) {
List<SalesOrderDetail> domainlist=salesorderdetailMapping.toDomain(salesorderdetaildtos);
for(SalesOrderDetail domain:domainlist){
domain.setSalesorderid(salesorder_id);
}
salesorderdetailService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.salesorderdetailService.get(#salesorderdetail_id),'iBizBusinessCentral-SalesOrderDetail-Remove')")
@ApiOperation(value = "根据客户商机报价单订单删除订单产品", tags = {"订单产品" }, notes = "根据客户商机报价单订单删除订单产品")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/{salesorderdetail_id}")
@Transactional
public ResponseEntity<Boolean> removeByAccountOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @PathVariable("salesorderdetail_id") String salesorderdetail_id) {
return ResponseEntity.status(HttpStatus.OK).body(salesorderdetailService.remove(salesorderdetail_id));
}
@PreAuthorize("hasPermission(this.salesorderdetailService.getSalesorderdetailByIds(#ids),'iBizBusinessCentral-SalesOrderDetail-Remove')")
@ApiOperation(value = "根据客户商机报价单订单批量删除订单产品", tags = {"订单产品" }, notes = "根据客户商机报价单订单批量删除订单产品")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/batch")
public ResponseEntity<Boolean> removeBatchByAccountOpportunityQuoteSalesOrder(@RequestBody List<String> ids) {
salesorderdetailService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.salesorderdetailMapping.toDomain(returnObject.body),'iBizBusinessCentral-SalesOrderDetail-Get')")
@ApiOperation(value = "根据客户商机报价单订单获取订单产品", tags = {"订单产品" }, notes = "根据客户商机报价单订单获取订单产品")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/{salesorderdetail_id}")
public ResponseEntity<SalesOrderDetailDTO> getByAccountOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @PathVariable("salesorderdetail_id") String salesorderdetail_id) {
SalesOrderDetail domain = salesorderdetailService.get(salesorderdetail_id);
SalesOrderDetailDTO dto = salesorderdetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据客户商机报价单订单获取订单产品草稿", tags = {"订单产品" }, notes = "根据客户商机报价单订单获取订单产品草稿")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/getdraft")
public ResponseEntity<SalesOrderDetailDTO> getDraftByAccountOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id) {
SalesOrderDetail domain = new SalesOrderDetail();
domain.setSalesorderid(salesorder_id);
return ResponseEntity.status(HttpStatus.OK).body(salesorderdetailMapping.toDto(salesorderdetailService.getDraft(domain)));
}
@ApiOperation(value = "根据客户商机报价单订单检查订单产品", tags = {"订单产品" }, notes = "根据客户商机报价单订单检查订单产品")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/checkkey")
public ResponseEntity<Boolean> checkKeyByAccountOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDetailDTO salesorderdetaildto) {
return ResponseEntity.status(HttpStatus.OK).body(salesorderdetailService.checkKey(salesorderdetailMapping.toDomain(salesorderdetaildto)));
}
@PreAuthorize("hasPermission(this.salesorderdetailMapping.toDomain(#salesorderdetaildto),'iBizBusinessCentral-SalesOrderDetail-Save')")
@ApiOperation(value = "根据客户商机报价单订单保存订单产品", tags = {"订单产品" }, notes = "根据客户商机报价单订单保存订单产品")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/save")
public ResponseEntity<Boolean> saveByAccountOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDetailDTO salesorderdetaildto) {
SalesOrderDetail domain = salesorderdetailMapping.toDomain(salesorderdetaildto);
domain.setSalesorderid(salesorder_id);
return ResponseEntity.status(HttpStatus.OK).body(salesorderdetailService.save(domain));
}
@PreAuthorize("hasPermission(this.salesorderdetailMapping.toDomain(#salesorderdetaildtos),'iBizBusinessCentral-SalesOrderDetail-Save')")
@ApiOperation(value = "根据客户商机报价单订单批量保存订单产品", tags = {"订单产品" }, notes = "根据客户商机报价单订单批量保存订单产品")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/savebatch")
public ResponseEntity<Boolean> saveBatchByAccountOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody List<SalesOrderDetailDTO> salesorderdetaildtos) {
List<SalesOrderDetail> domainlist=salesorderdetailMapping.toDomain(salesorderdetaildtos);
for(SalesOrderDetail domain:domainlist){
domain.setSalesorderid(salesorder_id);
}
salesorderdetailService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrderDetail-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrderDetail-Get')")
@ApiOperation(value = "根据客户商机报价单订单获取DEFAULT", tags = {"订单产品" } ,notes = "根据客户商机报价单订单获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/fetchdefault")
public ResponseEntity<List<SalesOrderDetailDTO>> fetchSalesOrderDetailDefaultByAccountOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id,SalesOrderDetailSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<SalesOrderDetail> domains = salesorderdetailService.searchDefault(context) ;
List<SalesOrderDetailDTO> list = salesorderdetailMapping.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-SalesOrderDetail-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrderDetail-Get')")
@ApiOperation(value = "根据客户商机报价单订单查询DEFAULT", tags = {"订单产品" } ,notes = "根据客户商机报价单订单查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/searchdefault")
public ResponseEntity<Page<SalesOrderDetailDTO>> searchSalesOrderDetailDefaultByAccountOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDetailSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<SalesOrderDetail> domains = salesorderdetailService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(salesorderdetailMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.salesorderdetailMapping.toDomain(#salesorderdetaildto),'iBizBusinessCentral-SalesOrderDetail-Create')")
@ApiOperation(value = "根据联系人商机报价单订单建立订单产品", tags = {"订单产品" }, notes = "根据联系人商机报价单订单建立订单产品")
@RequestMapping(method = RequestMethod.POST, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails")
@Transactional
public ResponseEntity<SalesOrderDetailDTO> createByContactOpportunityQuoteSalesOrder(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDetailDTO salesorderdetaildto) {
SalesOrderDetail domain = salesorderdetailMapping.toDomain(salesorderdetaildto);
domain.setSalesorderid(salesorder_id);
salesorderdetailService.create(domain);
SalesOrderDetailDTO dto = salesorderdetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.salesorderdetailMapping.toDomain(#salesorderdetaildtos),'iBizBusinessCentral-SalesOrderDetail-Create')")
@ApiOperation(value = "根据联系人商机报价单订单批量建立订单产品", tags = {"订单产品" }, notes = "根据联系人商机报价单订单批量建立订单产品")
@RequestMapping(method = RequestMethod.POST, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/batch")
public ResponseEntity<Boolean> createBatchByContactOpportunityQuoteSalesOrder(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody List<SalesOrderDetailDTO> salesorderdetaildtos) {
List<SalesOrderDetail> domainlist=salesorderdetailMapping.toDomain(salesorderdetaildtos);
for(SalesOrderDetail domain:domainlist){
domain.setSalesorderid(salesorder_id);
}
salesorderdetailService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "salesorderdetail" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.salesorderdetailService.get(#salesorderdetail_id),'iBizBusinessCentral-SalesOrderDetail-Update')")
@ApiOperation(value = "根据联系人商机报价单订单更新订单产品", tags = {"订单产品" }, notes = "根据联系人商机报价单订单更新订单产品")
@RequestMapping(method = RequestMethod.PUT, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/{salesorderdetail_id}")
@Transactional
public ResponseEntity<SalesOrderDetailDTO> updateByContactOpportunityQuoteSalesOrder(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @PathVariable("salesorderdetail_id") String salesorderdetail_id, @RequestBody SalesOrderDetailDTO salesorderdetaildto) {
SalesOrderDetail domain = salesorderdetailMapping.toDomain(salesorderdetaildto);
domain.setSalesorderid(salesorder_id);
domain.setSalesorderdetailid(salesorderdetail_id);
salesorderdetailService.update(domain);
SalesOrderDetailDTO dto = salesorderdetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.salesorderdetailService.getSalesorderdetailByEntities(this.salesorderdetailMapping.toDomain(#salesorderdetaildtos)),'iBizBusinessCentral-SalesOrderDetail-Update')")
@ApiOperation(value = "根据联系人商机报价单订单批量更新订单产品", tags = {"订单产品" }, notes = "根据联系人商机报价单订单批量更新订单产品")
@RequestMapping(method = RequestMethod.PUT, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/batch")
public ResponseEntity<Boolean> updateBatchByContactOpportunityQuoteSalesOrder(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody List<SalesOrderDetailDTO> salesorderdetaildtos) {
List<SalesOrderDetail> domainlist=salesorderdetailMapping.toDomain(salesorderdetaildtos);
for(SalesOrderDetail domain:domainlist){
domain.setSalesorderid(salesorder_id);
}
salesorderdetailService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.salesorderdetailService.get(#salesorderdetail_id),'iBizBusinessCentral-SalesOrderDetail-Remove')")
@ApiOperation(value = "根据联系人商机报价单订单删除订单产品", tags = {"订单产品" }, notes = "根据联系人商机报价单订单删除订单产品")
@RequestMapping(method = RequestMethod.DELETE, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/{salesorderdetail_id}")
@Transactional
public ResponseEntity<Boolean> removeByContactOpportunityQuoteSalesOrder(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @PathVariable("salesorderdetail_id") String salesorderdetail_id) {
return ResponseEntity.status(HttpStatus.OK).body(salesorderdetailService.remove(salesorderdetail_id));
}
@PreAuthorize("hasPermission(this.salesorderdetailService.getSalesorderdetailByIds(#ids),'iBizBusinessCentral-SalesOrderDetail-Remove')")
@ApiOperation(value = "根据联系人商机报价单订单批量删除订单产品", tags = {"订单产品" }, notes = "根据联系人商机报价单订单批量删除订单产品")
@RequestMapping(method = RequestMethod.DELETE, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/batch")
public ResponseEntity<Boolean> removeBatchByContactOpportunityQuoteSalesOrder(@RequestBody List<String> ids) {
salesorderdetailService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.salesorderdetailMapping.toDomain(returnObject.body),'iBizBusinessCentral-SalesOrderDetail-Get')")
@ApiOperation(value = "根据联系人商机报价单订单获取订单产品", tags = {"订单产品" }, notes = "根据联系人商机报价单订单获取订单产品")
@RequestMapping(method = RequestMethod.GET, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/{salesorderdetail_id}")
public ResponseEntity<SalesOrderDetailDTO> getByContactOpportunityQuoteSalesOrder(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @PathVariable("salesorderdetail_id") String salesorderdetail_id) {
SalesOrderDetail domain = salesorderdetailService.get(salesorderdetail_id);
SalesOrderDetailDTO dto = salesorderdetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据联系人商机报价单订单获取订单产品草稿", tags = {"订单产品" }, notes = "根据联系人商机报价单订单获取订单产品草稿")
@RequestMapping(method = RequestMethod.GET, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/getdraft")
public ResponseEntity<SalesOrderDetailDTO> getDraftByContactOpportunityQuoteSalesOrder(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id) {
SalesOrderDetail domain = new SalesOrderDetail();
domain.setSalesorderid(salesorder_id);
return ResponseEntity.status(HttpStatus.OK).body(salesorderdetailMapping.toDto(salesorderdetailService.getDraft(domain)));
}
@ApiOperation(value = "根据联系人商机报价单订单检查订单产品", tags = {"订单产品" }, notes = "根据联系人商机报价单订单检查订单产品")
@RequestMapping(method = RequestMethod.POST, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/checkkey")
public ResponseEntity<Boolean> checkKeyByContactOpportunityQuoteSalesOrder(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDetailDTO salesorderdetaildto) {
return ResponseEntity.status(HttpStatus.OK).body(salesorderdetailService.checkKey(salesorderdetailMapping.toDomain(salesorderdetaildto)));
}
@PreAuthorize("hasPermission(this.salesorderdetailMapping.toDomain(#salesorderdetaildto),'iBizBusinessCentral-SalesOrderDetail-Save')")
@ApiOperation(value = "根据联系人商机报价单订单保存订单产品", tags = {"订单产品" }, notes = "根据联系人商机报价单订单保存订单产品")
@RequestMapping(method = RequestMethod.POST, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/save")
public ResponseEntity<Boolean> saveByContactOpportunityQuoteSalesOrder(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDetailDTO salesorderdetaildto) {
SalesOrderDetail domain = salesorderdetailMapping.toDomain(salesorderdetaildto);
domain.setSalesorderid(salesorder_id);
return ResponseEntity.status(HttpStatus.OK).body(salesorderdetailService.save(domain));
}
@PreAuthorize("hasPermission(this.salesorderdetailMapping.toDomain(#salesorderdetaildtos),'iBizBusinessCentral-SalesOrderDetail-Save')")
@ApiOperation(value = "根据联系人商机报价单订单批量保存订单产品", tags = {"订单产品" }, notes = "根据联系人商机报价单订单批量保存订单产品")
@RequestMapping(method = RequestMethod.POST, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/savebatch")
public ResponseEntity<Boolean> saveBatchByContactOpportunityQuoteSalesOrder(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody List<SalesOrderDetailDTO> salesorderdetaildtos) {
List<SalesOrderDetail> domainlist=salesorderdetailMapping.toDomain(salesorderdetaildtos);
for(SalesOrderDetail domain:domainlist){
domain.setSalesorderid(salesorder_id);
}
salesorderdetailService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrderDetail-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrderDetail-Get')")
@ApiOperation(value = "根据联系人商机报价单订单获取DEFAULT", tags = {"订单产品" } ,notes = "根据联系人商机报价单订单获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/fetchdefault")
public ResponseEntity<List<SalesOrderDetailDTO>> fetchSalesOrderDetailDefaultByContactOpportunityQuoteSalesOrder(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id,SalesOrderDetailSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<SalesOrderDetail> domains = salesorderdetailService.searchDefault(context) ;
List<SalesOrderDetailDTO> list = salesorderdetailMapping.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-SalesOrderDetail-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrderDetail-Get')")
@ApiOperation(value = "根据联系人商机报价单订单查询DEFAULT", tags = {"订单产品" } ,notes = "根据联系人商机报价单订单查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/searchdefault")
public ResponseEntity<Page<SalesOrderDetailDTO>> searchSalesOrderDetailDefaultByContactOpportunityQuoteSalesOrder(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDetailSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<SalesOrderDetail> domains = salesorderdetailService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(salesorderdetailMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.salesorderdetailMapping.toDomain(#salesorderdetaildto),'iBizBusinessCentral-SalesOrderDetail-Create')")
@ApiOperation(value = "根据客户联系人商机报价单订单建立订单产品", tags = {"订单产品" }, notes = "根据客户联系人商机报价单订单建立订单产品")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails")
@Transactional
public ResponseEntity<SalesOrderDetailDTO> createByAccountContactOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDetailDTO salesorderdetaildto) {
SalesOrderDetail domain = salesorderdetailMapping.toDomain(salesorderdetaildto);
domain.setSalesorderid(salesorder_id);
salesorderdetailService.create(domain);
SalesOrderDetailDTO dto = salesorderdetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.salesorderdetailMapping.toDomain(#salesorderdetaildtos),'iBizBusinessCentral-SalesOrderDetail-Create')")
@ApiOperation(value = "根据客户联系人商机报价单订单批量建立订单产品", tags = {"订单产品" }, notes = "根据客户联系人商机报价单订单批量建立订单产品")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/batch")
public ResponseEntity<Boolean> createBatchByAccountContactOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody List<SalesOrderDetailDTO> salesorderdetaildtos) {
List<SalesOrderDetail> domainlist=salesorderdetailMapping.toDomain(salesorderdetaildtos);
for(SalesOrderDetail domain:domainlist){
domain.setSalesorderid(salesorder_id);
}
salesorderdetailService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "salesorderdetail" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.salesorderdetailService.get(#salesorderdetail_id),'iBizBusinessCentral-SalesOrderDetail-Update')")
@ApiOperation(value = "根据客户联系人商机报价单订单更新订单产品", tags = {"订单产品" }, notes = "根据客户联系人商机报价单订单更新订单产品")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/{salesorderdetail_id}")
@Transactional
public ResponseEntity<SalesOrderDetailDTO> updateByAccountContactOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @PathVariable("salesorderdetail_id") String salesorderdetail_id, @RequestBody SalesOrderDetailDTO salesorderdetaildto) {
SalesOrderDetail domain = salesorderdetailMapping.toDomain(salesorderdetaildto);
domain.setSalesorderid(salesorder_id);
domain.setSalesorderdetailid(salesorderdetail_id);
salesorderdetailService.update(domain);
SalesOrderDetailDTO dto = salesorderdetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.salesorderdetailService.getSalesorderdetailByEntities(this.salesorderdetailMapping.toDomain(#salesorderdetaildtos)),'iBizBusinessCentral-SalesOrderDetail-Update')")
@ApiOperation(value = "根据客户联系人商机报价单订单批量更新订单产品", tags = {"订单产品" }, notes = "根据客户联系人商机报价单订单批量更新订单产品")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/batch")
public ResponseEntity<Boolean> updateBatchByAccountContactOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody List<SalesOrderDetailDTO> salesorderdetaildtos) {
List<SalesOrderDetail> domainlist=salesorderdetailMapping.toDomain(salesorderdetaildtos);
for(SalesOrderDetail domain:domainlist){
domain.setSalesorderid(salesorder_id);
}
salesorderdetailService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.salesorderdetailService.get(#salesorderdetail_id),'iBizBusinessCentral-SalesOrderDetail-Remove')")
@ApiOperation(value = "根据客户联系人商机报价单订单删除订单产品", tags = {"订单产品" }, notes = "根据客户联系人商机报价单订单删除订单产品")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/{salesorderdetail_id}")
@Transactional
public ResponseEntity<Boolean> removeByAccountContactOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @PathVariable("salesorderdetail_id") String salesorderdetail_id) {
return ResponseEntity.status(HttpStatus.OK).body(salesorderdetailService.remove(salesorderdetail_id));
}
@PreAuthorize("hasPermission(this.salesorderdetailService.getSalesorderdetailByIds(#ids),'iBizBusinessCentral-SalesOrderDetail-Remove')")
@ApiOperation(value = "根据客户联系人商机报价单订单批量删除订单产品", tags = {"订单产品" }, notes = "根据客户联系人商机报价单订单批量删除订单产品")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/batch")
public ResponseEntity<Boolean> removeBatchByAccountContactOpportunityQuoteSalesOrder(@RequestBody List<String> ids) {
salesorderdetailService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.salesorderdetailMapping.toDomain(returnObject.body),'iBizBusinessCentral-SalesOrderDetail-Get')")
@ApiOperation(value = "根据客户联系人商机报价单订单获取订单产品", tags = {"订单产品" }, notes = "根据客户联系人商机报价单订单获取订单产品")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/{salesorderdetail_id}")
public ResponseEntity<SalesOrderDetailDTO> getByAccountContactOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @PathVariable("salesorderdetail_id") String salesorderdetail_id) {
SalesOrderDetail domain = salesorderdetailService.get(salesorderdetail_id);
SalesOrderDetailDTO dto = salesorderdetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据客户联系人商机报价单订单获取订单产品草稿", tags = {"订单产品" }, notes = "根据客户联系人商机报价单订单获取订单产品草稿")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/getdraft")
public ResponseEntity<SalesOrderDetailDTO> getDraftByAccountContactOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id) {
SalesOrderDetail domain = new SalesOrderDetail();
domain.setSalesorderid(salesorder_id);
return ResponseEntity.status(HttpStatus.OK).body(salesorderdetailMapping.toDto(salesorderdetailService.getDraft(domain)));
}
@ApiOperation(value = "根据客户联系人商机报价单订单检查订单产品", tags = {"订单产品" }, notes = "根据客户联系人商机报价单订单检查订单产品")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/checkkey")
public ResponseEntity<Boolean> checkKeyByAccountContactOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDetailDTO salesorderdetaildto) {
return ResponseEntity.status(HttpStatus.OK).body(salesorderdetailService.checkKey(salesorderdetailMapping.toDomain(salesorderdetaildto)));
}
@PreAuthorize("hasPermission(this.salesorderdetailMapping.toDomain(#salesorderdetaildto),'iBizBusinessCentral-SalesOrderDetail-Save')")
@ApiOperation(value = "根据客户联系人商机报价单订单保存订单产品", tags = {"订单产品" }, notes = "根据客户联系人商机报价单订单保存订单产品")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/save")
public ResponseEntity<Boolean> saveByAccountContactOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDetailDTO salesorderdetaildto) {
SalesOrderDetail domain = salesorderdetailMapping.toDomain(salesorderdetaildto);
domain.setSalesorderid(salesorder_id);
return ResponseEntity.status(HttpStatus.OK).body(salesorderdetailService.save(domain));
}
@PreAuthorize("hasPermission(this.salesorderdetailMapping.toDomain(#salesorderdetaildtos),'iBizBusinessCentral-SalesOrderDetail-Save')")
@ApiOperation(value = "根据客户联系人商机报价单订单批量保存订单产品", tags = {"订单产品" }, notes = "根据客户联系人商机报价单订单批量保存订单产品")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/savebatch")
public ResponseEntity<Boolean> saveBatchByAccountContactOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody List<SalesOrderDetailDTO> salesorderdetaildtos) {
List<SalesOrderDetail> domainlist=salesorderdetailMapping.toDomain(salesorderdetaildtos);
for(SalesOrderDetail domain:domainlist){
domain.setSalesorderid(salesorder_id);
}
salesorderdetailService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrderDetail-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrderDetail-Get')")
@ApiOperation(value = "根据客户联系人商机报价单订单获取DEFAULT", tags = {"订单产品" } ,notes = "根据客户联系人商机报价单订单获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/fetchdefault")
public ResponseEntity<List<SalesOrderDetailDTO>> fetchSalesOrderDetailDefaultByAccountContactOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id,SalesOrderDetailSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<SalesOrderDetail> domains = salesorderdetailService.searchDefault(context) ;
List<SalesOrderDetailDTO> list = salesorderdetailMapping.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-SalesOrderDetail-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrderDetail-Get')")
@ApiOperation(value = "根据客户联系人商机报价单订单查询DEFAULT", tags = {"订单产品" } ,notes = "根据客户联系人商机报价单订单查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/salesorderdetails/searchdefault")
public ResponseEntity<Page<SalesOrderDetailDTO>> searchSalesOrderDetailDefaultByAccountContactOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDetailSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<SalesOrderDetail> domains = salesorderdetailService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(salesorderdetailMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -217,5 +217,965 @@ public class SalesOrderResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(salesorderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.salesorderMapping.toDomain(#salesorderdto),'iBizBusinessCentral-SalesOrder-Create')")
@ApiOperation(value = "根据报价单建立订单", tags = {"订单" }, notes = "根据报价单建立订单")
@RequestMapping(method = RequestMethod.POST, value = "/quotes/{quote_id}/salesorders")
@Transactional
public ResponseEntity<SalesOrderDTO> createByQuote(@PathVariable("quote_id") String quote_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
salesorderService.create(domain);
SalesOrderDTO dto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.salesorderMapping.toDomain(#salesorderdtos),'iBizBusinessCentral-SalesOrder-Create')")
@ApiOperation(value = "根据报价单批量建立订单", tags = {"订单" }, notes = "根据报价单批量建立订单")
@RequestMapping(method = RequestMethod.POST, value = "/quotes/{quote_id}/salesorders/batch")
public ResponseEntity<Boolean> createBatchByQuote(@PathVariable("quote_id") String quote_id, @RequestBody List<SalesOrderDTO> salesorderdtos) {
List<SalesOrder> domainlist=salesorderMapping.toDomain(salesorderdtos);
for(SalesOrder domain:domainlist){
domain.setQuoteid(quote_id);
}
salesorderService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "salesorder" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.salesorderService.get(#salesorder_id),'iBizBusinessCentral-SalesOrder-Update')")
@ApiOperation(value = "根据报价单更新订单", tags = {"订单" }, notes = "根据报价单更新订单")
@RequestMapping(method = RequestMethod.PUT, value = "/quotes/{quote_id}/salesorders/{salesorder_id}")
@Transactional
public ResponseEntity<SalesOrderDTO> updateByQuote(@PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
domain.setSalesorderid(salesorder_id);
salesorderService.update(domain);
SalesOrderDTO dto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.salesorderService.getSalesorderByEntities(this.salesorderMapping.toDomain(#salesorderdtos)),'iBizBusinessCentral-SalesOrder-Update')")
@ApiOperation(value = "根据报价单批量更新订单", tags = {"订单" }, notes = "根据报价单批量更新订单")
@RequestMapping(method = RequestMethod.PUT, value = "/quotes/{quote_id}/salesorders/batch")
public ResponseEntity<Boolean> updateBatchByQuote(@PathVariable("quote_id") String quote_id, @RequestBody List<SalesOrderDTO> salesorderdtos) {
List<SalesOrder> domainlist=salesorderMapping.toDomain(salesorderdtos);
for(SalesOrder domain:domainlist){
domain.setQuoteid(quote_id);
}
salesorderService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.salesorderService.get(#salesorder_id),'iBizBusinessCentral-SalesOrder-Remove')")
@ApiOperation(value = "根据报价单删除订单", tags = {"订单" }, notes = "根据报价单删除订单")
@RequestMapping(method = RequestMethod.DELETE, value = "/quotes/{quote_id}/salesorders/{salesorder_id}")
@Transactional
public ResponseEntity<Boolean> removeByQuote(@PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id) {
return ResponseEntity.status(HttpStatus.OK).body(salesorderService.remove(salesorder_id));
}
@PreAuthorize("hasPermission(this.salesorderService.getSalesorderByIds(#ids),'iBizBusinessCentral-SalesOrder-Remove')")
@ApiOperation(value = "根据报价单批量删除订单", tags = {"订单" }, notes = "根据报价单批量删除订单")
@RequestMapping(method = RequestMethod.DELETE, value = "/quotes/{quote_id}/salesorders/batch")
public ResponseEntity<Boolean> removeBatchByQuote(@RequestBody List<String> ids) {
salesorderService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.salesorderMapping.toDomain(returnObject.body),'iBizBusinessCentral-SalesOrder-Get')")
@ApiOperation(value = "根据报价单获取订单", tags = {"订单" }, notes = "根据报价单获取订单")
@RequestMapping(method = RequestMethod.GET, value = "/quotes/{quote_id}/salesorders/{salesorder_id}")
public ResponseEntity<SalesOrderDTO> getByQuote(@PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id) {
SalesOrder domain = salesorderService.get(salesorder_id);
SalesOrderDTO dto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据报价单获取订单草稿", tags = {"订单" }, notes = "根据报价单获取订单草稿")
@RequestMapping(method = RequestMethod.GET, value = "/quotes/{quote_id}/salesorders/getdraft")
public ResponseEntity<SalesOrderDTO> getDraftByQuote(@PathVariable("quote_id") String quote_id) {
SalesOrder domain = new SalesOrder();
domain.setQuoteid(quote_id);
return ResponseEntity.status(HttpStatus.OK).body(salesorderMapping.toDto(salesorderService.getDraft(domain)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrder-Cancel-all')")
@ApiOperation(value = "根据报价单订单", tags = {"订单" }, notes = "根据报价单订单")
@RequestMapping(method = RequestMethod.POST, value = "/quotes/{quote_id}/salesorders/{salesorder_id}/cancel")
@Transactional
public ResponseEntity<SalesOrderDTO> cancelByQuote(@PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
domain = salesorderService.cancel(domain) ;
salesorderdto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(salesorderdto);
}
@ApiOperation(value = "根据报价单检查订单", tags = {"订单" }, notes = "根据报价单检查订单")
@RequestMapping(method = RequestMethod.POST, value = "/quotes/{quote_id}/salesorders/checkkey")
public ResponseEntity<Boolean> checkKeyByQuote(@PathVariable("quote_id") String quote_id, @RequestBody SalesOrderDTO salesorderdto) {
return ResponseEntity.status(HttpStatus.OK).body(salesorderService.checkKey(salesorderMapping.toDomain(salesorderdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrder-Finish-all')")
@ApiOperation(value = "根据报价单订单", tags = {"订单" }, notes = "根据报价单订单")
@RequestMapping(method = RequestMethod.POST, value = "/quotes/{quote_id}/salesorders/{salesorder_id}/finish")
@Transactional
public ResponseEntity<SalesOrderDTO> finishByQuote(@PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
domain = salesorderService.finish(domain) ;
salesorderdto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(salesorderdto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrder-GenInvoice-all')")
@ApiOperation(value = "根据报价单订单", tags = {"订单" }, notes = "根据报价单订单")
@RequestMapping(method = RequestMethod.POST, value = "/quotes/{quote_id}/salesorders/{salesorder_id}/geninvoice")
@Transactional
public ResponseEntity<SalesOrderDTO> genInvoiceByQuote(@PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
domain = salesorderService.genInvoice(domain) ;
salesorderdto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(salesorderdto);
}
@PreAuthorize("hasPermission(this.salesorderMapping.toDomain(#salesorderdto),'iBizBusinessCentral-SalesOrder-Save')")
@ApiOperation(value = "根据报价单保存订单", tags = {"订单" }, notes = "根据报价单保存订单")
@RequestMapping(method = RequestMethod.POST, value = "/quotes/{quote_id}/salesorders/save")
public ResponseEntity<Boolean> saveByQuote(@PathVariable("quote_id") String quote_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
return ResponseEntity.status(HttpStatus.OK).body(salesorderService.save(domain));
}
@PreAuthorize("hasPermission(this.salesorderMapping.toDomain(#salesorderdtos),'iBizBusinessCentral-SalesOrder-Save')")
@ApiOperation(value = "根据报价单批量保存订单", tags = {"订单" }, notes = "根据报价单批量保存订单")
@RequestMapping(method = RequestMethod.POST, value = "/quotes/{quote_id}/salesorders/savebatch")
public ResponseEntity<Boolean> saveBatchByQuote(@PathVariable("quote_id") String quote_id, @RequestBody List<SalesOrderDTO> salesorderdtos) {
List<SalesOrder> domainlist=salesorderMapping.toDomain(salesorderdtos);
for(SalesOrder domain:domainlist){
domain.setQuoteid(quote_id);
}
salesorderService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrder-searchByParentKey-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrder-Get')")
@ApiOperation(value = "根据报价单获取ByParentKey", tags = {"订单" } ,notes = "根据报价单获取ByParentKey")
@RequestMapping(method= RequestMethod.GET , value="/quotes/{quote_id}/salesorders/fetchbyparentkey")
public ResponseEntity<List<SalesOrderDTO>> fetchSalesOrderByParentKeyByQuote(@PathVariable("quote_id") String quote_id,SalesOrderSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<SalesOrder> domains = salesorderService.searchByParentKey(context) ;
List<SalesOrderDTO> list = salesorderMapping.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-SalesOrder-searchByParentKey-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrder-Get')")
@ApiOperation(value = "根据报价单查询ByParentKey", tags = {"订单" } ,notes = "根据报价单查询ByParentKey")
@RequestMapping(method= RequestMethod.POST , value="/quotes/{quote_id}/salesorders/searchbyparentkey")
public ResponseEntity<Page<SalesOrderDTO>> searchSalesOrderByParentKeyByQuote(@PathVariable("quote_id") String quote_id, @RequestBody SalesOrderSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<SalesOrder> domains = salesorderService.searchByParentKey(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(salesorderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrder-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrder-Get')")
@ApiOperation(value = "根据报价单获取DEFAULT", tags = {"订单" } ,notes = "根据报价单获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/quotes/{quote_id}/salesorders/fetchdefault")
public ResponseEntity<List<SalesOrderDTO>> fetchSalesOrderDefaultByQuote(@PathVariable("quote_id") String quote_id,SalesOrderSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<SalesOrder> domains = salesorderService.searchDefault(context) ;
List<SalesOrderDTO> list = salesorderMapping.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-SalesOrder-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrder-Get')")
@ApiOperation(value = "根据报价单查询DEFAULT", tags = {"订单" } ,notes = "根据报价单查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/quotes/{quote_id}/salesorders/searchdefault")
public ResponseEntity<Page<SalesOrderDTO>> searchSalesOrderDefaultByQuote(@PathVariable("quote_id") String quote_id, @RequestBody SalesOrderSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<SalesOrder> domains = salesorderService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(salesorderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.salesorderMapping.toDomain(#salesorderdto),'iBizBusinessCentral-SalesOrder-Create')")
@ApiOperation(value = "根据商机报价单建立订单", tags = {"订单" }, notes = "根据商机报价单建立订单")
@RequestMapping(method = RequestMethod.POST, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders")
@Transactional
public ResponseEntity<SalesOrderDTO> createByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
salesorderService.create(domain);
SalesOrderDTO dto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.salesorderMapping.toDomain(#salesorderdtos),'iBizBusinessCentral-SalesOrder-Create')")
@ApiOperation(value = "根据商机报价单批量建立订单", tags = {"订单" }, notes = "根据商机报价单批量建立订单")
@RequestMapping(method = RequestMethod.POST, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/batch")
public ResponseEntity<Boolean> createBatchByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody List<SalesOrderDTO> salesorderdtos) {
List<SalesOrder> domainlist=salesorderMapping.toDomain(salesorderdtos);
for(SalesOrder domain:domainlist){
domain.setQuoteid(quote_id);
}
salesorderService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "salesorder" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.salesorderService.get(#salesorder_id),'iBizBusinessCentral-SalesOrder-Update')")
@ApiOperation(value = "根据商机报价单更新订单", tags = {"订单" }, notes = "根据商机报价单更新订单")
@RequestMapping(method = RequestMethod.PUT, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}")
@Transactional
public ResponseEntity<SalesOrderDTO> updateByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
domain.setSalesorderid(salesorder_id);
salesorderService.update(domain);
SalesOrderDTO dto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.salesorderService.getSalesorderByEntities(this.salesorderMapping.toDomain(#salesorderdtos)),'iBizBusinessCentral-SalesOrder-Update')")
@ApiOperation(value = "根据商机报价单批量更新订单", tags = {"订单" }, notes = "根据商机报价单批量更新订单")
@RequestMapping(method = RequestMethod.PUT, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/batch")
public ResponseEntity<Boolean> updateBatchByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody List<SalesOrderDTO> salesorderdtos) {
List<SalesOrder> domainlist=salesorderMapping.toDomain(salesorderdtos);
for(SalesOrder domain:domainlist){
domain.setQuoteid(quote_id);
}
salesorderService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.salesorderService.get(#salesorder_id),'iBizBusinessCentral-SalesOrder-Remove')")
@ApiOperation(value = "根据商机报价单删除订单", tags = {"订单" }, notes = "根据商机报价单删除订单")
@RequestMapping(method = RequestMethod.DELETE, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}")
@Transactional
public ResponseEntity<Boolean> removeByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id) {
return ResponseEntity.status(HttpStatus.OK).body(salesorderService.remove(salesorder_id));
}
@PreAuthorize("hasPermission(this.salesorderService.getSalesorderByIds(#ids),'iBizBusinessCentral-SalesOrder-Remove')")
@ApiOperation(value = "根据商机报价单批量删除订单", tags = {"订单" }, notes = "根据商机报价单批量删除订单")
@RequestMapping(method = RequestMethod.DELETE, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/batch")
public ResponseEntity<Boolean> removeBatchByOpportunityQuote(@RequestBody List<String> ids) {
salesorderService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.salesorderMapping.toDomain(returnObject.body),'iBizBusinessCentral-SalesOrder-Get')")
@ApiOperation(value = "根据商机报价单获取订单", tags = {"订单" }, notes = "根据商机报价单获取订单")
@RequestMapping(method = RequestMethod.GET, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}")
public ResponseEntity<SalesOrderDTO> getByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id) {
SalesOrder domain = salesorderService.get(salesorder_id);
SalesOrderDTO dto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据商机报价单获取订单草稿", tags = {"订单" }, notes = "根据商机报价单获取订单草稿")
@RequestMapping(method = RequestMethod.GET, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/getdraft")
public ResponseEntity<SalesOrderDTO> getDraftByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id) {
SalesOrder domain = new SalesOrder();
domain.setQuoteid(quote_id);
return ResponseEntity.status(HttpStatus.OK).body(salesorderMapping.toDto(salesorderService.getDraft(domain)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrder-Cancel-all')")
@ApiOperation(value = "根据商机报价单订单", tags = {"订单" }, notes = "根据商机报价单订单")
@RequestMapping(method = RequestMethod.POST, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/cancel")
@Transactional
public ResponseEntity<SalesOrderDTO> cancelByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
domain = salesorderService.cancel(domain) ;
salesorderdto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(salesorderdto);
}
@ApiOperation(value = "根据商机报价单检查订单", tags = {"订单" }, notes = "根据商机报价单检查订单")
@RequestMapping(method = RequestMethod.POST, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/checkkey")
public ResponseEntity<Boolean> checkKeyByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody SalesOrderDTO salesorderdto) {
return ResponseEntity.status(HttpStatus.OK).body(salesorderService.checkKey(salesorderMapping.toDomain(salesorderdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrder-Finish-all')")
@ApiOperation(value = "根据商机报价单订单", tags = {"订单" }, notes = "根据商机报价单订单")
@RequestMapping(method = RequestMethod.POST, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/finish")
@Transactional
public ResponseEntity<SalesOrderDTO> finishByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
domain = salesorderService.finish(domain) ;
salesorderdto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(salesorderdto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrder-GenInvoice-all')")
@ApiOperation(value = "根据商机报价单订单", tags = {"订单" }, notes = "根据商机报价单订单")
@RequestMapping(method = RequestMethod.POST, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/geninvoice")
@Transactional
public ResponseEntity<SalesOrderDTO> genInvoiceByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
domain = salesorderService.genInvoice(domain) ;
salesorderdto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(salesorderdto);
}
@PreAuthorize("hasPermission(this.salesorderMapping.toDomain(#salesorderdto),'iBizBusinessCentral-SalesOrder-Save')")
@ApiOperation(value = "根据商机报价单保存订单", tags = {"订单" }, notes = "根据商机报价单保存订单")
@RequestMapping(method = RequestMethod.POST, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/save")
public ResponseEntity<Boolean> saveByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
return ResponseEntity.status(HttpStatus.OK).body(salesorderService.save(domain));
}
@PreAuthorize("hasPermission(this.salesorderMapping.toDomain(#salesorderdtos),'iBizBusinessCentral-SalesOrder-Save')")
@ApiOperation(value = "根据商机报价单批量保存订单", tags = {"订单" }, notes = "根据商机报价单批量保存订单")
@RequestMapping(method = RequestMethod.POST, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/savebatch")
public ResponseEntity<Boolean> saveBatchByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody List<SalesOrderDTO> salesorderdtos) {
List<SalesOrder> domainlist=salesorderMapping.toDomain(salesorderdtos);
for(SalesOrder domain:domainlist){
domain.setQuoteid(quote_id);
}
salesorderService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrder-searchByParentKey-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrder-Get')")
@ApiOperation(value = "根据商机报价单获取ByParentKey", tags = {"订单" } ,notes = "根据商机报价单获取ByParentKey")
@RequestMapping(method= RequestMethod.GET , value="/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/fetchbyparentkey")
public ResponseEntity<List<SalesOrderDTO>> fetchSalesOrderByParentKeyByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id,SalesOrderSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<SalesOrder> domains = salesorderService.searchByParentKey(context) ;
List<SalesOrderDTO> list = salesorderMapping.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-SalesOrder-searchByParentKey-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrder-Get')")
@ApiOperation(value = "根据商机报价单查询ByParentKey", tags = {"订单" } ,notes = "根据商机报价单查询ByParentKey")
@RequestMapping(method= RequestMethod.POST , value="/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/searchbyparentkey")
public ResponseEntity<Page<SalesOrderDTO>> searchSalesOrderByParentKeyByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody SalesOrderSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<SalesOrder> domains = salesorderService.searchByParentKey(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(salesorderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrder-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrder-Get')")
@ApiOperation(value = "根据商机报价单获取DEFAULT", tags = {"订单" } ,notes = "根据商机报价单获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/fetchdefault")
public ResponseEntity<List<SalesOrderDTO>> fetchSalesOrderDefaultByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id,SalesOrderSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<SalesOrder> domains = salesorderService.searchDefault(context) ;
List<SalesOrderDTO> list = salesorderMapping.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-SalesOrder-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrder-Get')")
@ApiOperation(value = "根据商机报价单查询DEFAULT", tags = {"订单" } ,notes = "根据商机报价单查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/searchdefault")
public ResponseEntity<Page<SalesOrderDTO>> searchSalesOrderDefaultByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody SalesOrderSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<SalesOrder> domains = salesorderService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(salesorderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.salesorderMapping.toDomain(#salesorderdto),'iBizBusinessCentral-SalesOrder-Create')")
@ApiOperation(value = "根据客户商机报价单建立订单", tags = {"订单" }, notes = "根据客户商机报价单建立订单")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders")
@Transactional
public ResponseEntity<SalesOrderDTO> createByAccountOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
salesorderService.create(domain);
SalesOrderDTO dto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.salesorderMapping.toDomain(#salesorderdtos),'iBizBusinessCentral-SalesOrder-Create')")
@ApiOperation(value = "根据客户商机报价单批量建立订单", tags = {"订单" }, notes = "根据客户商机报价单批量建立订单")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/batch")
public ResponseEntity<Boolean> createBatchByAccountOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody List<SalesOrderDTO> salesorderdtos) {
List<SalesOrder> domainlist=salesorderMapping.toDomain(salesorderdtos);
for(SalesOrder domain:domainlist){
domain.setQuoteid(quote_id);
}
salesorderService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "salesorder" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.salesorderService.get(#salesorder_id),'iBizBusinessCentral-SalesOrder-Update')")
@ApiOperation(value = "根据客户商机报价单更新订单", tags = {"订单" }, notes = "根据客户商机报价单更新订单")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}")
@Transactional
public ResponseEntity<SalesOrderDTO> updateByAccountOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
domain.setSalesorderid(salesorder_id);
salesorderService.update(domain);
SalesOrderDTO dto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.salesorderService.getSalesorderByEntities(this.salesorderMapping.toDomain(#salesorderdtos)),'iBizBusinessCentral-SalesOrder-Update')")
@ApiOperation(value = "根据客户商机报价单批量更新订单", tags = {"订单" }, notes = "根据客户商机报价单批量更新订单")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/batch")
public ResponseEntity<Boolean> updateBatchByAccountOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody List<SalesOrderDTO> salesorderdtos) {
List<SalesOrder> domainlist=salesorderMapping.toDomain(salesorderdtos);
for(SalesOrder domain:domainlist){
domain.setQuoteid(quote_id);
}
salesorderService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.salesorderService.get(#salesorder_id),'iBizBusinessCentral-SalesOrder-Remove')")
@ApiOperation(value = "根据客户商机报价单删除订单", tags = {"订单" }, notes = "根据客户商机报价单删除订单")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}")
@Transactional
public ResponseEntity<Boolean> removeByAccountOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id) {
return ResponseEntity.status(HttpStatus.OK).body(salesorderService.remove(salesorder_id));
}
@PreAuthorize("hasPermission(this.salesorderService.getSalesorderByIds(#ids),'iBizBusinessCentral-SalesOrder-Remove')")
@ApiOperation(value = "根据客户商机报价单批量删除订单", tags = {"订单" }, notes = "根据客户商机报价单批量删除订单")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/batch")
public ResponseEntity<Boolean> removeBatchByAccountOpportunityQuote(@RequestBody List<String> ids) {
salesorderService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.salesorderMapping.toDomain(returnObject.body),'iBizBusinessCentral-SalesOrder-Get')")
@ApiOperation(value = "根据客户商机报价单获取订单", tags = {"订单" }, notes = "根据客户商机报价单获取订单")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}")
public ResponseEntity<SalesOrderDTO> getByAccountOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id) {
SalesOrder domain = salesorderService.get(salesorder_id);
SalesOrderDTO dto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据客户商机报价单获取订单草稿", tags = {"订单" }, notes = "根据客户商机报价单获取订单草稿")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/getdraft")
public ResponseEntity<SalesOrderDTO> getDraftByAccountOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id) {
SalesOrder domain = new SalesOrder();
domain.setQuoteid(quote_id);
return ResponseEntity.status(HttpStatus.OK).body(salesorderMapping.toDto(salesorderService.getDraft(domain)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrder-Cancel-all')")
@ApiOperation(value = "根据客户商机报价单订单", tags = {"订单" }, notes = "根据客户商机报价单订单")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/cancel")
@Transactional
public ResponseEntity<SalesOrderDTO> cancelByAccountOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
domain = salesorderService.cancel(domain) ;
salesorderdto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(salesorderdto);
}
@ApiOperation(value = "根据客户商机报价单检查订单", tags = {"订单" }, notes = "根据客户商机报价单检查订单")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/checkkey")
public ResponseEntity<Boolean> checkKeyByAccountOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody SalesOrderDTO salesorderdto) {
return ResponseEntity.status(HttpStatus.OK).body(salesorderService.checkKey(salesorderMapping.toDomain(salesorderdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrder-Finish-all')")
@ApiOperation(value = "根据客户商机报价单订单", tags = {"订单" }, notes = "根据客户商机报价单订单")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/finish")
@Transactional
public ResponseEntity<SalesOrderDTO> finishByAccountOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
domain = salesorderService.finish(domain) ;
salesorderdto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(salesorderdto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrder-GenInvoice-all')")
@ApiOperation(value = "根据客户商机报价单订单", tags = {"订单" }, notes = "根据客户商机报价单订单")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/geninvoice")
@Transactional
public ResponseEntity<SalesOrderDTO> genInvoiceByAccountOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
domain = salesorderService.genInvoice(domain) ;
salesorderdto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(salesorderdto);
}
@PreAuthorize("hasPermission(this.salesorderMapping.toDomain(#salesorderdto),'iBizBusinessCentral-SalesOrder-Save')")
@ApiOperation(value = "根据客户商机报价单保存订单", tags = {"订单" }, notes = "根据客户商机报价单保存订单")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/save")
public ResponseEntity<Boolean> saveByAccountOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
return ResponseEntity.status(HttpStatus.OK).body(salesorderService.save(domain));
}
@PreAuthorize("hasPermission(this.salesorderMapping.toDomain(#salesorderdtos),'iBizBusinessCentral-SalesOrder-Save')")
@ApiOperation(value = "根据客户商机报价单批量保存订单", tags = {"订单" }, notes = "根据客户商机报价单批量保存订单")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/savebatch")
public ResponseEntity<Boolean> saveBatchByAccountOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody List<SalesOrderDTO> salesorderdtos) {
List<SalesOrder> domainlist=salesorderMapping.toDomain(salesorderdtos);
for(SalesOrder domain:domainlist){
domain.setQuoteid(quote_id);
}
salesorderService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrder-searchByParentKey-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrder-Get')")
@ApiOperation(value = "根据客户商机报价单获取ByParentKey", tags = {"订单" } ,notes = "根据客户商机报价单获取ByParentKey")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/fetchbyparentkey")
public ResponseEntity<List<SalesOrderDTO>> fetchSalesOrderByParentKeyByAccountOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id,SalesOrderSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<SalesOrder> domains = salesorderService.searchByParentKey(context) ;
List<SalesOrderDTO> list = salesorderMapping.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-SalesOrder-searchByParentKey-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrder-Get')")
@ApiOperation(value = "根据客户商机报价单查询ByParentKey", tags = {"订单" } ,notes = "根据客户商机报价单查询ByParentKey")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/searchbyparentkey")
public ResponseEntity<Page<SalesOrderDTO>> searchSalesOrderByParentKeyByAccountOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody SalesOrderSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<SalesOrder> domains = salesorderService.searchByParentKey(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(salesorderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrder-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrder-Get')")
@ApiOperation(value = "根据客户商机报价单获取DEFAULT", tags = {"订单" } ,notes = "根据客户商机报价单获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/fetchdefault")
public ResponseEntity<List<SalesOrderDTO>> fetchSalesOrderDefaultByAccountOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id,SalesOrderSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<SalesOrder> domains = salesorderService.searchDefault(context) ;
List<SalesOrderDTO> list = salesorderMapping.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-SalesOrder-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrder-Get')")
@ApiOperation(value = "根据客户商机报价单查询DEFAULT", tags = {"订单" } ,notes = "根据客户商机报价单查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/searchdefault")
public ResponseEntity<Page<SalesOrderDTO>> searchSalesOrderDefaultByAccountOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody SalesOrderSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<SalesOrder> domains = salesorderService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(salesorderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.salesorderMapping.toDomain(#salesorderdto),'iBizBusinessCentral-SalesOrder-Create')")
@ApiOperation(value = "根据联系人商机报价单建立订单", tags = {"订单" }, notes = "根据联系人商机报价单建立订单")
@RequestMapping(method = RequestMethod.POST, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders")
@Transactional
public ResponseEntity<SalesOrderDTO> createByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
salesorderService.create(domain);
SalesOrderDTO dto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.salesorderMapping.toDomain(#salesorderdtos),'iBizBusinessCentral-SalesOrder-Create')")
@ApiOperation(value = "根据联系人商机报价单批量建立订单", tags = {"订单" }, notes = "根据联系人商机报价单批量建立订单")
@RequestMapping(method = RequestMethod.POST, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/batch")
public ResponseEntity<Boolean> createBatchByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody List<SalesOrderDTO> salesorderdtos) {
List<SalesOrder> domainlist=salesorderMapping.toDomain(salesorderdtos);
for(SalesOrder domain:domainlist){
domain.setQuoteid(quote_id);
}
salesorderService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "salesorder" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.salesorderService.get(#salesorder_id),'iBizBusinessCentral-SalesOrder-Update')")
@ApiOperation(value = "根据联系人商机报价单更新订单", tags = {"订单" }, notes = "根据联系人商机报价单更新订单")
@RequestMapping(method = RequestMethod.PUT, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}")
@Transactional
public ResponseEntity<SalesOrderDTO> updateByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
domain.setSalesorderid(salesorder_id);
salesorderService.update(domain);
SalesOrderDTO dto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.salesorderService.getSalesorderByEntities(this.salesorderMapping.toDomain(#salesorderdtos)),'iBizBusinessCentral-SalesOrder-Update')")
@ApiOperation(value = "根据联系人商机报价单批量更新订单", tags = {"订单" }, notes = "根据联系人商机报价单批量更新订单")
@RequestMapping(method = RequestMethod.PUT, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/batch")
public ResponseEntity<Boolean> updateBatchByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody List<SalesOrderDTO> salesorderdtos) {
List<SalesOrder> domainlist=salesorderMapping.toDomain(salesorderdtos);
for(SalesOrder domain:domainlist){
domain.setQuoteid(quote_id);
}
salesorderService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.salesorderService.get(#salesorder_id),'iBizBusinessCentral-SalesOrder-Remove')")
@ApiOperation(value = "根据联系人商机报价单删除订单", tags = {"订单" }, notes = "根据联系人商机报价单删除订单")
@RequestMapping(method = RequestMethod.DELETE, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}")
@Transactional
public ResponseEntity<Boolean> removeByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id) {
return ResponseEntity.status(HttpStatus.OK).body(salesorderService.remove(salesorder_id));
}
@PreAuthorize("hasPermission(this.salesorderService.getSalesorderByIds(#ids),'iBizBusinessCentral-SalesOrder-Remove')")
@ApiOperation(value = "根据联系人商机报价单批量删除订单", tags = {"订单" }, notes = "根据联系人商机报价单批量删除订单")
@RequestMapping(method = RequestMethod.DELETE, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/batch")
public ResponseEntity<Boolean> removeBatchByContactOpportunityQuote(@RequestBody List<String> ids) {
salesorderService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.salesorderMapping.toDomain(returnObject.body),'iBizBusinessCentral-SalesOrder-Get')")
@ApiOperation(value = "根据联系人商机报价单获取订单", tags = {"订单" }, notes = "根据联系人商机报价单获取订单")
@RequestMapping(method = RequestMethod.GET, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}")
public ResponseEntity<SalesOrderDTO> getByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id) {
SalesOrder domain = salesorderService.get(salesorder_id);
SalesOrderDTO dto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据联系人商机报价单获取订单草稿", tags = {"订单" }, notes = "根据联系人商机报价单获取订单草稿")
@RequestMapping(method = RequestMethod.GET, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/getdraft")
public ResponseEntity<SalesOrderDTO> getDraftByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id) {
SalesOrder domain = new SalesOrder();
domain.setQuoteid(quote_id);
return ResponseEntity.status(HttpStatus.OK).body(salesorderMapping.toDto(salesorderService.getDraft(domain)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrder-Cancel-all')")
@ApiOperation(value = "根据联系人商机报价单订单", tags = {"订单" }, notes = "根据联系人商机报价单订单")
@RequestMapping(method = RequestMethod.POST, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/cancel")
@Transactional
public ResponseEntity<SalesOrderDTO> cancelByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
domain = salesorderService.cancel(domain) ;
salesorderdto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(salesorderdto);
}
@ApiOperation(value = "根据联系人商机报价单检查订单", tags = {"订单" }, notes = "根据联系人商机报价单检查订单")
@RequestMapping(method = RequestMethod.POST, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/checkkey")
public ResponseEntity<Boolean> checkKeyByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody SalesOrderDTO salesorderdto) {
return ResponseEntity.status(HttpStatus.OK).body(salesorderService.checkKey(salesorderMapping.toDomain(salesorderdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrder-Finish-all')")
@ApiOperation(value = "根据联系人商机报价单订单", tags = {"订单" }, notes = "根据联系人商机报价单订单")
@RequestMapping(method = RequestMethod.POST, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/finish")
@Transactional
public ResponseEntity<SalesOrderDTO> finishByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
domain = salesorderService.finish(domain) ;
salesorderdto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(salesorderdto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrder-GenInvoice-all')")
@ApiOperation(value = "根据联系人商机报价单订单", tags = {"订单" }, notes = "根据联系人商机报价单订单")
@RequestMapping(method = RequestMethod.POST, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/geninvoice")
@Transactional
public ResponseEntity<SalesOrderDTO> genInvoiceByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
domain = salesorderService.genInvoice(domain) ;
salesorderdto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(salesorderdto);
}
@PreAuthorize("hasPermission(this.salesorderMapping.toDomain(#salesorderdto),'iBizBusinessCentral-SalesOrder-Save')")
@ApiOperation(value = "根据联系人商机报价单保存订单", tags = {"订单" }, notes = "根据联系人商机报价单保存订单")
@RequestMapping(method = RequestMethod.POST, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/save")
public ResponseEntity<Boolean> saveByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
return ResponseEntity.status(HttpStatus.OK).body(salesorderService.save(domain));
}
@PreAuthorize("hasPermission(this.salesorderMapping.toDomain(#salesorderdtos),'iBizBusinessCentral-SalesOrder-Save')")
@ApiOperation(value = "根据联系人商机报价单批量保存订单", tags = {"订单" }, notes = "根据联系人商机报价单批量保存订单")
@RequestMapping(method = RequestMethod.POST, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/savebatch")
public ResponseEntity<Boolean> saveBatchByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody List<SalesOrderDTO> salesorderdtos) {
List<SalesOrder> domainlist=salesorderMapping.toDomain(salesorderdtos);
for(SalesOrder domain:domainlist){
domain.setQuoteid(quote_id);
}
salesorderService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrder-searchByParentKey-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrder-Get')")
@ApiOperation(value = "根据联系人商机报价单获取ByParentKey", tags = {"订单" } ,notes = "根据联系人商机报价单获取ByParentKey")
@RequestMapping(method= RequestMethod.GET , value="/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/fetchbyparentkey")
public ResponseEntity<List<SalesOrderDTO>> fetchSalesOrderByParentKeyByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id,SalesOrderSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<SalesOrder> domains = salesorderService.searchByParentKey(context) ;
List<SalesOrderDTO> list = salesorderMapping.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-SalesOrder-searchByParentKey-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrder-Get')")
@ApiOperation(value = "根据联系人商机报价单查询ByParentKey", tags = {"订单" } ,notes = "根据联系人商机报价单查询ByParentKey")
@RequestMapping(method= RequestMethod.POST , value="/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/searchbyparentkey")
public ResponseEntity<Page<SalesOrderDTO>> searchSalesOrderByParentKeyByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody SalesOrderSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<SalesOrder> domains = salesorderService.searchByParentKey(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(salesorderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrder-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrder-Get')")
@ApiOperation(value = "根据联系人商机报价单获取DEFAULT", tags = {"订单" } ,notes = "根据联系人商机报价单获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/fetchdefault")
public ResponseEntity<List<SalesOrderDTO>> fetchSalesOrderDefaultByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id,SalesOrderSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<SalesOrder> domains = salesorderService.searchDefault(context) ;
List<SalesOrderDTO> list = salesorderMapping.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-SalesOrder-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrder-Get')")
@ApiOperation(value = "根据联系人商机报价单查询DEFAULT", tags = {"订单" } ,notes = "根据联系人商机报价单查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/searchdefault")
public ResponseEntity<Page<SalesOrderDTO>> searchSalesOrderDefaultByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody SalesOrderSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<SalesOrder> domains = salesorderService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(salesorderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.salesorderMapping.toDomain(#salesorderdto),'iBizBusinessCentral-SalesOrder-Create')")
@ApiOperation(value = "根据客户联系人商机报价单建立订单", tags = {"订单" }, notes = "根据客户联系人商机报价单建立订单")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders")
@Transactional
public ResponseEntity<SalesOrderDTO> createByAccountContactOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
salesorderService.create(domain);
SalesOrderDTO dto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.salesorderMapping.toDomain(#salesorderdtos),'iBizBusinessCentral-SalesOrder-Create')")
@ApiOperation(value = "根据客户联系人商机报价单批量建立订单", tags = {"订单" }, notes = "根据客户联系人商机报价单批量建立订单")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/batch")
public ResponseEntity<Boolean> createBatchByAccountContactOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody List<SalesOrderDTO> salesorderdtos) {
List<SalesOrder> domainlist=salesorderMapping.toDomain(salesorderdtos);
for(SalesOrder domain:domainlist){
domain.setQuoteid(quote_id);
}
salesorderService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "salesorder" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.salesorderService.get(#salesorder_id),'iBizBusinessCentral-SalesOrder-Update')")
@ApiOperation(value = "根据客户联系人商机报价单更新订单", tags = {"订单" }, notes = "根据客户联系人商机报价单更新订单")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}")
@Transactional
public ResponseEntity<SalesOrderDTO> updateByAccountContactOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
domain.setSalesorderid(salesorder_id);
salesorderService.update(domain);
SalesOrderDTO dto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.salesorderService.getSalesorderByEntities(this.salesorderMapping.toDomain(#salesorderdtos)),'iBizBusinessCentral-SalesOrder-Update')")
@ApiOperation(value = "根据客户联系人商机报价单批量更新订单", tags = {"订单" }, notes = "根据客户联系人商机报价单批量更新订单")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/batch")
public ResponseEntity<Boolean> updateBatchByAccountContactOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody List<SalesOrderDTO> salesorderdtos) {
List<SalesOrder> domainlist=salesorderMapping.toDomain(salesorderdtos);
for(SalesOrder domain:domainlist){
domain.setQuoteid(quote_id);
}
salesorderService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.salesorderService.get(#salesorder_id),'iBizBusinessCentral-SalesOrder-Remove')")
@ApiOperation(value = "根据客户联系人商机报价单删除订单", tags = {"订单" }, notes = "根据客户联系人商机报价单删除订单")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}")
@Transactional
public ResponseEntity<Boolean> removeByAccountContactOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id) {
return ResponseEntity.status(HttpStatus.OK).body(salesorderService.remove(salesorder_id));
}
@PreAuthorize("hasPermission(this.salesorderService.getSalesorderByIds(#ids),'iBizBusinessCentral-SalesOrder-Remove')")
@ApiOperation(value = "根据客户联系人商机报价单批量删除订单", tags = {"订单" }, notes = "根据客户联系人商机报价单批量删除订单")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/batch")
public ResponseEntity<Boolean> removeBatchByAccountContactOpportunityQuote(@RequestBody List<String> ids) {
salesorderService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.salesorderMapping.toDomain(returnObject.body),'iBizBusinessCentral-SalesOrder-Get')")
@ApiOperation(value = "根据客户联系人商机报价单获取订单", tags = {"订单" }, notes = "根据客户联系人商机报价单获取订单")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}")
public ResponseEntity<SalesOrderDTO> getByAccountContactOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id) {
SalesOrder domain = salesorderService.get(salesorder_id);
SalesOrderDTO dto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据客户联系人商机报价单获取订单草稿", tags = {"订单" }, notes = "根据客户联系人商机报价单获取订单草稿")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/getdraft")
public ResponseEntity<SalesOrderDTO> getDraftByAccountContactOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id) {
SalesOrder domain = new SalesOrder();
domain.setQuoteid(quote_id);
return ResponseEntity.status(HttpStatus.OK).body(salesorderMapping.toDto(salesorderService.getDraft(domain)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrder-Cancel-all')")
@ApiOperation(value = "根据客户联系人商机报价单订单", tags = {"订单" }, notes = "根据客户联系人商机报价单订单")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/cancel")
@Transactional
public ResponseEntity<SalesOrderDTO> cancelByAccountContactOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
domain = salesorderService.cancel(domain) ;
salesorderdto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(salesorderdto);
}
@ApiOperation(value = "根据客户联系人商机报价单检查订单", tags = {"订单" }, notes = "根据客户联系人商机报价单检查订单")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/checkkey")
public ResponseEntity<Boolean> checkKeyByAccountContactOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody SalesOrderDTO salesorderdto) {
return ResponseEntity.status(HttpStatus.OK).body(salesorderService.checkKey(salesorderMapping.toDomain(salesorderdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrder-Finish-all')")
@ApiOperation(value = "根据客户联系人商机报价单订单", tags = {"订单" }, notes = "根据客户联系人商机报价单订单")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/finish")
@Transactional
public ResponseEntity<SalesOrderDTO> finishByAccountContactOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
domain = salesorderService.finish(domain) ;
salesorderdto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(salesorderdto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrder-GenInvoice-all')")
@ApiOperation(value = "根据客户联系人商机报价单订单", tags = {"订单" }, notes = "根据客户联系人商机报价单订单")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/geninvoice")
@Transactional
public ResponseEntity<SalesOrderDTO> genInvoiceByAccountContactOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
domain = salesorderService.genInvoice(domain) ;
salesorderdto = salesorderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(salesorderdto);
}
@PreAuthorize("hasPermission(this.salesorderMapping.toDomain(#salesorderdto),'iBizBusinessCentral-SalesOrder-Save')")
@ApiOperation(value = "根据客户联系人商机报价单保存订单", tags = {"订单" }, notes = "根据客户联系人商机报价单保存订单")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/save")
public ResponseEntity<Boolean> saveByAccountContactOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody SalesOrderDTO salesorderdto) {
SalesOrder domain = salesorderMapping.toDomain(salesorderdto);
domain.setQuoteid(quote_id);
return ResponseEntity.status(HttpStatus.OK).body(salesorderService.save(domain));
}
@PreAuthorize("hasPermission(this.salesorderMapping.toDomain(#salesorderdtos),'iBizBusinessCentral-SalesOrder-Save')")
@ApiOperation(value = "根据客户联系人商机报价单批量保存订单", tags = {"订单" }, notes = "根据客户联系人商机报价单批量保存订单")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/savebatch")
public ResponseEntity<Boolean> saveBatchByAccountContactOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody List<SalesOrderDTO> salesorderdtos) {
List<SalesOrder> domainlist=salesorderMapping.toDomain(salesorderdtos);
for(SalesOrder domain:domainlist){
domain.setQuoteid(quote_id);
}
salesorderService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrder-searchByParentKey-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrder-Get')")
@ApiOperation(value = "根据客户联系人商机报价单获取ByParentKey", tags = {"订单" } ,notes = "根据客户联系人商机报价单获取ByParentKey")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/fetchbyparentkey")
public ResponseEntity<List<SalesOrderDTO>> fetchSalesOrderByParentKeyByAccountContactOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id,SalesOrderSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<SalesOrder> domains = salesorderService.searchByParentKey(context) ;
List<SalesOrderDTO> list = salesorderMapping.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-SalesOrder-searchByParentKey-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrder-Get')")
@ApiOperation(value = "根据客户联系人商机报价单查询ByParentKey", tags = {"订单" } ,notes = "根据客户联系人商机报价单查询ByParentKey")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/searchbyparentkey")
public ResponseEntity<Page<SalesOrderDTO>> searchSalesOrderByParentKeyByAccountContactOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody SalesOrderSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<SalesOrder> domains = salesorderService.searchByParentKey(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(salesorderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesOrder-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrder-Get')")
@ApiOperation(value = "根据客户联系人商机报价单获取DEFAULT", tags = {"订单" } ,notes = "根据客户联系人商机报价单获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/fetchdefault")
public ResponseEntity<List<SalesOrderDTO>> fetchSalesOrderDefaultByAccountContactOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id,SalesOrderSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<SalesOrder> domains = salesorderService.searchDefault(context) ;
List<SalesOrderDTO> list = salesorderMapping.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-SalesOrder-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-SalesOrder-Get')")
@ApiOperation(value = "根据客户联系人商机报价单查询DEFAULT", tags = {"订单" } ,notes = "根据客户联系人商机报价单查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/searchdefault")
public ResponseEntity<Page<SalesOrderDTO>> searchSalesOrderDefaultByAccountContactOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody SalesOrderSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<SalesOrder> domains = salesorderService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(salesorderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册