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

ibiz4j 发布系统代码

上级 95b79a19
......@@ -115,16 +115,42 @@ mock.onGet(new RegExp(/^\/sysapps\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((co
return [status, _items];
});
// Save
mock.onPost(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:sysapp 方法: Save");
// Create
mock.onPost(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysapp 方法: 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> = ['id'];
const matchArray:any = new RegExp(/^\/sysapps\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/sysapps\/([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(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysapp 方法: 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> = ['id'];
const matchArray:any = new RegExp(/^\/sysapps\/([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) => {
......@@ -207,16 +233,16 @@ mock.onPost(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply
return [status, data];
});
// Update
mock.onPut(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysapp 方法: Update");
// Save
mock.onPost(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:sysapp 方法: 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> = ['id'];
const matchArray:any = new RegExp(/^\/sysapps\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const matchArray:any = new RegExp(/^\/sysapps\/([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) => {
......@@ -245,32 +271,6 @@ mock.onPut(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: a
return [status, data];
});
// Create
mock.onPost(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysapp 方法: 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> = ['id'];
const matchArray:any = new RegExp(/^\/sysapps\/([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]];
});
// FetchDefault
mock.onGet(new RegExp(/^\/sysapps\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:sysapp 方法: FetchDefault");
......
......@@ -115,20 +115,30 @@ mock.onGet(new RegExp(/^\/sysauthlogs\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply
return [status, _items];
});
// GetDraft
mock.onGet(new RegExp(/^\/sysauthlogs\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sysauthlog 方法: GetDraft");
// Create
mock.onPost(new RegExp(/^\/sysauthlogs\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysauthlog 方法: 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> = ['logid'];
const matchArray:any = new RegExp(/^\/sysauthlogs\/([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.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, {}];
return [status, mockDatas[0]];
});
// Update
......@@ -169,30 +179,20 @@ mock.onPut(new RegExp(/^\/sysauthlogs\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((confi
return [status, data];
});
// Create
mock.onPost(new RegExp(/^\/sysauthlogs\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysauthlog 方法: Create");
// GetDraft
mock.onGet(new RegExp(/^\/sysauthlogs\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sysauthlog 方法: GetDraft");
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> = ['logid'];
const matchArray:any = new RegExp(/^\/sysauthlogs\/([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.table({});
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
return [status, {}];
});
// CheckKey
......
......@@ -115,16 +115,42 @@ mock.onGet(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).re
return [status, _items];
});
// Save
mock.onPost(new RegExp(/^\/syspermissions\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:syspermission 方法: Save");
// Create
mock.onPost(new RegExp(/^\/syspermissions\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:syspermission 方法: 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> = ['permissionid'];
const matchArray:any = new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/syspermissions\/([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(/^\/syspermissions\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:syspermission 方法: 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> = ['permissionid'];
const matchArray:any = new RegExp(/^\/syspermissions\/([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) => {
......@@ -169,16 +195,16 @@ mock.onGet(new RegExp(/^\/syspermissions\/getdraft$/)).reply((config: any) => {
return [status, {}];
});
// Update
mock.onPut(new RegExp(/^\/syspermissions\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:syspermission 方法: Update");
// CheckKey
mock.onPost(new RegExp(/^\/syspermissions\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:syspermission 方法: 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> = ['permissionid'];
const matchArray:any = new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const matchArray:any = new RegExp(/^\/syspermissions\/([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) => {
......@@ -207,42 +233,16 @@ mock.onPut(new RegExp(/^\/syspermissions\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((co
return [status, data];
});
// Create
mock.onPost(new RegExp(/^\/syspermissions\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:syspermission 方法: 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> = ['permissionid'];
const matchArray:any = new RegExp(/^\/syspermissions\/([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]];
});
// CheckKey
mock.onPost(new RegExp(/^\/syspermissions\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:syspermission 方法: CheckKey");
// Save
mock.onPost(new RegExp(/^\/syspermissions\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:syspermission 方法: 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> = ['permissionid'];
const matchArray:any = new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/syspermissions\/([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) => {
......
......@@ -115,16 +115,16 @@ mock.onGet(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((c
return [status, _items];
});
// Save
mock.onPost(new RegExp(/^\/sysroles\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrole 方法: Save");
// Create
mock.onPost(new RegExp(/^\/sysroles\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrole 方法: 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> = ['roleid'];
const matchArray:any = new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/sysroles\/([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) => {
......@@ -134,23 +134,11 @@ mock.onPost(new RegExp(/^\/sysroles\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((c
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.roleid, tempValue.roleid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['roleid'] == tempValue['roleid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, data];
return [status, mockDatas[0]];
});
// Update
......@@ -191,16 +179,32 @@ mock.onPut(new RegExp(/^\/sysroles\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
return [status, data];
});
// Create
mock.onPost(new RegExp(/^\/sysroles\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrole 方法: Create");
// GetDraft
mock.onGet(new RegExp(/^\/sysroles\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrole 方法: 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(/^\/sysroles\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrole 方法: 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> = ['roleid'];
const matchArray:any = new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const matchArray:any = new RegExp(/^\/sysroles\/([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) => {
......@@ -210,39 +214,35 @@ mock.onPost(new RegExp(/^\/sysroles\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
});
// GetDraft
mock.onGet(new RegExp(/^\/sysroles\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrole 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.roleid, tempValue.roleid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['roleid'] == tempValue['roleid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, {}];
return [status, data];
});
// CheckKey
mock.onPost(new RegExp(/^\/sysroles\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrole 方法: CheckKey");
// Save
mock.onPost(new RegExp(/^\/sysroles\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrole 方法: 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> = ['roleid'];
const matchArray:any = new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/sysroles\/([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) => {
......@@ -323,9 +323,9 @@ mock.onGet(new RegExp(/^\/sysroles\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((co
// URI参数传递情况未实现
// Get
mock.onGet(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrole 方法: Get");
// Remove
mock.onDelete(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrole 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -351,9 +351,9 @@ mock.onGet(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: a
return [status, _items?_items:{}];
});
// Remove
mock.onDelete(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrole 方法: Remove");
// Get
mock.onGet(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrole 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......
......@@ -115,6 +115,32 @@ mock.onGet(new RegExp(/^\/sysusers\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((c
return [status, _items];
});
// Create
mock.onPost(new RegExp(/^\/sysusers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuser 方法: 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> = ['userid'];
const matchArray:any = new RegExp(/^\/sysusers\/([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(/^\/sysusers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuser 方法: Update");
......@@ -153,6 +179,22 @@ mock.onPut(new RegExp(/^\/sysusers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/sysusers\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuser 方法: 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(/^\/sysusers\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuser 方法: CheckKey");
......@@ -229,48 +271,6 @@ mock.onPost(new RegExp(/^\/sysusers\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((c
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/sysusers\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuser 方法: 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, {}];
});
// Create
mock.onPost(new RegExp(/^\/sysusers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuser 方法: 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> = ['userid'];
const matchArray:any = new RegExp(/^\/sysusers\/([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]];
});
// FetchDefault
mock.onGet(new RegExp(/^\/sysusers\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuser 方法: FetchDefault");
......
......@@ -747,9 +747,18 @@ export default class SYS_PERMISSIONMPickupViewBase extends Vue {
newSelections.push(this.viewSelections[index]);
}
});
this.viewSelections = newSelections;
this.viewSelections = this.removeDuplicates([...newSelections,...this.viewSelections]);
});
this.selectedData = JSON.stringify(this.viewSelections);
}
/**
* 去重
*
* @memberof SYS_PERMISSIONMPickupViewBase
*/
public removeDuplicates(data:any):Array<any> {
const uniqueSet = new Set(data);
return [...uniqueSet];
}
/**
......
......@@ -747,9 +747,18 @@ export default class SYS_ROLE_PERMISSIONMPickupViewBase extends Vue {
newSelections.push(this.viewSelections[index]);
}
});
this.viewSelections = newSelections;
this.viewSelections = this.removeDuplicates([...newSelections,...this.viewSelections]);
});
this.selectedData = JSON.stringify(this.viewSelections);
}
/**
* 去重
*
* @memberof SYS_ROLE_PERMISSIONMPickupViewBase
*/
public removeDuplicates(data:any):Array<any> {
const uniqueSet = new Set(data);
return [...uniqueSet];
}
/**
......
......@@ -747,9 +747,18 @@ export default class SYS_ROLEMPickupViewBase extends Vue {
newSelections.push(this.viewSelections[index]);
}
});
this.viewSelections = newSelections;
this.viewSelections = this.removeDuplicates([...newSelections,...this.viewSelections]);
});
this.selectedData = JSON.stringify(this.viewSelections);
}
/**
* 去重
*
* @memberof SYS_ROLEMPickupViewBase
*/
public removeDuplicates(data:any):Array<any> {
const uniqueSet = new Set(data);
return [...uniqueSet];
}
/**
......
......@@ -747,9 +747,18 @@ export default class SYS_USER_ROLEMPickupViewBase extends Vue {
newSelections.push(this.viewSelections[index]);
}
});
this.viewSelections = newSelections;
this.viewSelections = this.removeDuplicates([...newSelections,...this.viewSelections]);
});
this.selectedData = JSON.stringify(this.viewSelections);
}
/**
* 去重
*
* @memberof SYS_USER_ROLEMPickupViewBase
*/
public removeDuplicates(data:any):Array<any> {
const uniqueSet = new Set(data);
return [...uniqueSet];
}
/**
......
......@@ -747,9 +747,18 @@ export default class SYS_USERMPickupViewBase extends Vue {
newSelections.push(this.viewSelections[index]);
}
});
this.viewSelections = newSelections;
this.viewSelections = this.removeDuplicates([...newSelections,...this.viewSelections]);
});
this.selectedData = JSON.stringify(this.viewSelections);
}
/**
* 去重
*
* @memberof SYS_USERMPickupViewBase
*/
public removeDuplicates(data:any):Array<any> {
const uniqueSet = new Set(data);
return [...uniqueSet];
}
/**
......
......@@ -53,7 +53,7 @@ export default class SysAppServiceBase extends EntityService {
}
/**
* Remove接口方法
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -61,13 +61,22 @@ export default class SysAppServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysAppServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().delete(`/sysapps/${context.sysapp}`,isloading);
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
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(`/sysapps`,data,isloading);
return res;
}
/**
* Get接口方法
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -75,13 +84,15 @@ export default class SysAppServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysAppServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/sysapps/${context.sysapp}`,isloading);
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/sysapps/${context.sysapp}`,data,isloading);
return res;
}
/**
* Save接口方法
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -89,15 +100,13 @@ export default class SysAppServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysAppServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/sysapps/${context.sysapp}/save`,data,isloading);
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().delete(`/sysapps/${context.sysapp}`,isloading);
return res;
}
/**
* GetDraft接口方法
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -105,14 +114,13 @@ export default class SysAppServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysAppServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/sysapps/getdraft`,isloading);
res.data.sysapp = data.sysapp;
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/sysapps/${context.sysapp}`,isloading);
return res;
}
/**
* CheckKey接口方法
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -120,13 +128,14 @@ export default class SysAppServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysAppServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().post(`/sysapps/${context.sysapp}/checkkey`,data,isloading);
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/sysapps/getdraft`,isloading);
res.data.sysapp = data.sysapp;
return res;
}
/**
* Update接口方法
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -134,15 +143,13 @@ export default class SysAppServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysAppServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/sysapps/${context.sysapp}`,data,isloading);
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().post(`/sysapps/${context.sysapp}/checkkey`,data,isloading);
return res;
}
/**
* Create接口方法
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -150,17 +157,10 @@ export default class SysAppServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysAppServiceBase
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
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(`/sysapps`,data,isloading);
let res:any = await Http.getInstance().post(`/sysapps/${context.sysapp}/save`,data,isloading);
return res;
}
......
......@@ -53,7 +53,7 @@ export default class SysAuthLogServiceBase extends EntityService {
}
/**
* GetDraft接口方法
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -61,9 +61,17 @@ export default class SysAuthLogServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysAuthLogServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/sysauthlogs/getdraft`,isloading);
res.data.sysauthlog = data.sysauthlog;
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
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(`/sysauthlogs`,data,isloading);
return res;
}
......@@ -98,7 +106,7 @@ export default class SysAuthLogServiceBase extends EntityService {
}
/**
* Create接口方法
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -106,22 +114,13 @@ export default class SysAuthLogServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysAuthLogServiceBase
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
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(`/sysauthlogs`,data,isloading);
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/sysauthlogs/${context.sysauthlog}`,isloading);
return res;
}
/**
* CheckKey接口方法
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -129,13 +128,14 @@ export default class SysAuthLogServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysAuthLogServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().post(`/sysauthlogs/${context.sysauthlog}/checkkey`,data,isloading);
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/sysauthlogs/getdraft`,isloading);
res.data.sysauthlog = data.sysauthlog;
return res;
}
/**
* Get接口方法
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -143,8 +143,8 @@ export default class SysAuthLogServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysAuthLogServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/sysauthlogs/${context.sysauthlog}`,isloading);
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().post(`/sysauthlogs/${context.sysauthlog}/checkkey`,data,isloading);
return res;
}
......
......@@ -53,7 +53,7 @@ export default class SysPermissionServiceBase extends EntityService {
}
/**
* Save接口方法
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -61,7 +61,7 @@ export default class SysPermissionServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysPermissionServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let sysrolepermissionsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions'),'undefined')){
......@@ -79,13 +79,20 @@ export default class SysPermissionServiceBase extends EntityService {
}
masterData.sysrolepermissions = sysrolepermissionsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/syspermissions/${context.syspermission}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions));
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(`/syspermissions`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions));
return res;
}
/**
* GetDraft接口方法
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -93,9 +100,25 @@ export default class SysPermissionServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysPermissionServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/syspermissions/getdraft`,isloading);
res.data.syspermission = data.syspermission;
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let sysrolepermissionsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions'),'undefined')){
sysrolepermissionsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions') as any);
if(sysrolepermissionsData && sysrolepermissionsData.length && sysrolepermissionsData.length > 0){
sysrolepermissionsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.rolepermissionid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.sysrolepermissions = sysrolepermissionsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/syspermissions/${context.syspermission}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions));
return res;
}
......@@ -115,7 +138,7 @@ export default class SysPermissionServiceBase extends EntityService {
}
/**
* Update接口方法
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -123,31 +146,14 @@ export default class SysPermissionServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysPermissionServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let sysrolepermissionsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions'),'undefined')){
sysrolepermissionsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions') as any);
if(sysrolepermissionsData && sysrolepermissionsData.length && sysrolepermissionsData.length > 0){
sysrolepermissionsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.rolepermissionid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.sysrolepermissions = sysrolepermissionsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/syspermissions/${context.syspermission}`,data,isloading);
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/syspermissions/${context.syspermission}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions));
return res;
}
/**
* Create接口方法
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -155,33 +161,10 @@ export default class SysPermissionServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysPermissionServiceBase
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let sysrolepermissionsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions'),'undefined')){
sysrolepermissionsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions') as any);
if(sysrolepermissionsData && sysrolepermissionsData.length && sysrolepermissionsData.length > 0){
sysrolepermissionsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.rolepermissionid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.sysrolepermissions = sysrolepermissionsData;
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(`/syspermissions`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions));
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/syspermissions/getdraft`,isloading);
res.data.syspermission = data.syspermission;
this.tempStorage.setItem(context.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions));
return res;
}
......@@ -200,7 +183,7 @@ export default class SysPermissionServiceBase extends EntityService {
}
/**
* Get接口方法
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -208,8 +191,25 @@ export default class SysPermissionServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysPermissionServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/syspermissions/${context.syspermission}`,isloading);
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let sysrolepermissionsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions'),'undefined')){
sysrolepermissionsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions') as any);
if(sysrolepermissionsData && sysrolepermissionsData.length && sysrolepermissionsData.length > 0){
sysrolepermissionsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.rolepermissionid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.sysrolepermissions = sysrolepermissionsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/syspermissions/${context.syspermission}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions));
return res;
}
......
......@@ -59,7 +59,7 @@ export default class SysRolePermissionServiceBase extends EntityService {
}
/**
* Get接口方法
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -67,14 +67,67 @@ export default class SysRolePermissionServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysRolePermissionServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sysrole && 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(`/sysroles/${context.sysrole}/sysrolepermissions`,data,isloading);
}
if(context.syspermission && 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(`/syspermissions/${context.syspermission}/sysrolepermissions`,data,isloading);
}
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(`/sysrolepermissions`,data,isloading);
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysRolePermissionServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sysrole && context.sysrolepermission){
let res:any = await Http.getInstance().get(`/sysroles/${context.sysrole}/sysrolepermissions/${context.sysrolepermission}`,isloading);
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/sysroles/${context.sysrole}/sysrolepermissions/${context.sysrolepermission}`,data,isloading);
}
if(context.syspermission && context.sysrolepermission){
let res:any = await Http.getInstance().get(`/syspermissions/${context.syspermission}/sysrolepermissions/${context.sysrolepermission}`,isloading);
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/syspermissions/${context.syspermission}/sysrolepermissions/${context.sysrolepermission}`,data,isloading);
}
let res:any = await Http.getInstance().get(`/sysrolepermissions/${context.sysrolepermission}`,isloading);
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/sysrolepermissions/${context.sysrolepermission}`,data,isloading);
return res;
}
......@@ -99,7 +152,7 @@ export default class SysRolePermissionServiceBase extends EntityService {
}
/**
* GetDraft接口方法
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -107,22 +160,19 @@ export default class SysRolePermissionServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysRolePermissionServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sysrole && true){
let res:any = await Http.getInstance().get(`/sysroles/${context.sysrole}/sysrolepermissions/getdraft`,isloading);
res.data.sysrolepermission = data.sysrolepermission;
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sysrole && context.sysrolepermission){
let res:any = await Http.getInstance().get(`/sysroles/${context.sysrole}/sysrolepermissions/${context.sysrolepermission}`,isloading);
}
if(context.syspermission && true){
let res:any = await Http.getInstance().get(`/syspermissions/${context.syspermission}/sysrolepermissions/getdraft`,isloading);
res.data.sysrolepermission = data.sysrolepermission;
if(context.syspermission && context.sysrolepermission){
let res:any = await Http.getInstance().get(`/syspermissions/${context.syspermission}/sysrolepermissions/${context.sysrolepermission}`,isloading);
}
let res:any = await Http.getInstance().get(`/sysrolepermissions/getdraft`,isloading);
res.data.sysrolepermission = data.sysrolepermission;
let res:any = await Http.getInstance().get(`/sysrolepermissions/${context.sysrolepermission}`,isloading);
return res;
}
/**
* Create接口方法
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -130,41 +180,17 @@ export default class SysRolePermissionServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysRolePermissionServiceBase
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sysrole && 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(`/sysroles/${context.sysrole}/sysrolepermissions`,data,isloading);
let res:any = await Http.getInstance().get(`/sysroles/${context.sysrole}/sysrolepermissions/getdraft`,isloading);
res.data.sysrolepermission = data.sysrolepermission;
}
if(context.syspermission && 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(`/syspermissions/${context.syspermission}/sysrolepermissions`,data,isloading);
}
let masterData:any = {};
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
let res:any = await Http.getInstance().get(`/syspermissions/${context.syspermission}/sysrolepermissions/getdraft`,isloading);
res.data.sysrolepermission = data.sysrolepermission;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/sysrolepermissions`,data,isloading);
let res:any = await Http.getInstance().get(`/sysrolepermissions/getdraft`,isloading);
res.data.sysrolepermission = data.sysrolepermission;
return res;
}
......@@ -218,32 +244,6 @@ export default class SysRolePermissionServiceBase extends EntityService {
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysRolePermissionServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sysrole && context.sysrolepermission){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/sysroles/${context.sysrole}/sysrolepermissions/${context.sysrolepermission}`,data,isloading);
}
if(context.syspermission && context.sysrolepermission){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/syspermissions/${context.syspermission}/sysrolepermissions/${context.sysrolepermission}`,data,isloading);
}
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/sysrolepermissions/${context.sysrolepermission}`,data,isloading);
return res;
}
/**
* FetchDefault接口方法
*
......
......@@ -53,7 +53,7 @@ export default class SysRoleServiceBase extends EntityService {
}
/**
* Save接口方法
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -61,7 +61,7 @@ export default class SysRoleServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysRoleServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let sysrolepermissionsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions'),'undefined')){
......@@ -94,9 +94,16 @@ export default class SysRoleServiceBase extends EntityService {
}
masterData.sysuserroles = sysuserrolesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/sysroles/${context.sysrole}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions));
this.tempStorage.setItem(context.srfsessionkey+'_sysuserroles',JSON.stringify(res.data.sysuserroles));
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(`/sysroles`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions));
this.tempStorage.setItem(tempContext.srfsessionkey+'_sysuserroles',JSON.stringify(res.data.sysuserroles));
return res;
}
......@@ -149,7 +156,7 @@ export default class SysRoleServiceBase extends EntityService {
}
/**
* Create接口方法
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -157,49 +164,8 @@ export default class SysRoleServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysRoleServiceBase
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let sysrolepermissionsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions'),'undefined')){
sysrolepermissionsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions') as any);
if(sysrolepermissionsData && sysrolepermissionsData.length && sysrolepermissionsData.length > 0){
sysrolepermissionsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.rolepermissionid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.sysrolepermissions = sysrolepermissionsData;
let sysuserrolesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysuserroles'),'undefined')){
sysuserrolesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_sysuserroles') as any);
if(sysuserrolesData && sysuserrolesData.length && sysuserrolesData.length > 0){
sysuserrolesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.userroleid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.sysuserroles = sysuserrolesData;
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(`/sysroles`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions));
this.tempStorage.setItem(tempContext.srfsessionkey+'_sysuserroles',JSON.stringify(res.data.sysuserroles));
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().delete(`/sysroles/${context.sysrole}`,isloading);
return res;
}
......@@ -220,7 +186,7 @@ export default class SysRoleServiceBase extends EntityService {
}
/**
* Remove接口方法
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -228,13 +194,16 @@ export default class SysRoleServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysRoleServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().delete(`/sysroles/${context.sysrole}`,isloading);
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/sysroles/getdraft`,isloading);
res.data.sysrole = data.sysrole;
this.tempStorage.setItem(context.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions));
this.tempStorage.setItem(context.srfsessionkey+'_sysuserroles',JSON.stringify(res.data.sysuserroles));
return res;
}
/**
* GetDraft接口方法
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -242,16 +211,13 @@ export default class SysRoleServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysRoleServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/sysroles/getdraft`,isloading);
res.data.sysrole = data.sysrole;
this.tempStorage.setItem(context.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions));
this.tempStorage.setItem(context.srfsessionkey+'_sysuserroles',JSON.stringify(res.data.sysuserroles));
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().post(`/sysroles/${context.sysrole}/checkkey`,data,isloading);
return res;
}
/**
* CheckKey接口方法
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -259,8 +225,42 @@ export default class SysRoleServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysRoleServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().post(`/sysroles/${context.sysrole}/checkkey`,data,isloading);
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let sysrolepermissionsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions'),'undefined')){
sysrolepermissionsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions') as any);
if(sysrolepermissionsData && sysrolepermissionsData.length && sysrolepermissionsData.length > 0){
sysrolepermissionsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.rolepermissionid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.sysrolepermissions = sysrolepermissionsData;
let sysuserrolesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysuserroles'),'undefined')){
sysuserrolesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_sysuserroles') as any);
if(sysuserrolesData && sysuserrolesData.length && sysuserrolesData.length > 0){
sysuserrolesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.userroleid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.sysuserroles = sysuserrolesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/sysroles/${context.sysrole}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions));
this.tempStorage.setItem(context.srfsessionkey+'_sysuserroles',JSON.stringify(res.data.sysuserroles));
return res;
}
......
......@@ -59,7 +59,7 @@ export default class SysUserRoleServiceBase extends EntityService {
}
/**
* CheckKey接口方法
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -67,41 +67,41 @@ export default class SysUserRoleServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysUserRoleServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sysuser && context.sysuserrole){
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sysuser && true){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/sysusers/${context.sysuser}/sysuserroles/${context.sysuserrole}/checkkey`,data,isloading);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(context.sysrole && context.sysuserrole){
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/sysusers/${context.sysuser}/sysuserroles`,data,isloading);
}
if(context.sysrole && true){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/sysroles/${context.sysrole}/sysuserroles/${context.sysuserrole}/checkkey`,data,isloading);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
let res:any = await Http.getInstance().post(`/sysuserroles/${context.sysuserrole}/checkkey`,data,isloading);
return res;
if(data.srffrontuf){
delete data.srffrontuf;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysUserRoleServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sysuser && true){
let res:any = await Http.getInstance().get(`/sysusers/${context.sysuser}/sysuserroles/getdraft`,isloading);
res.data.sysuserrole = data.sysuserrole;
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/sysroles/${context.sysrole}/sysuserroles`,data,isloading);
}
if(context.sysrole && true){
let res:any = await Http.getInstance().get(`/sysroles/${context.sysrole}/sysuserroles/getdraft`,isloading);
res.data.sysuserrole = data.sysuserrole;
let masterData:any = {};
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
let res:any = await Http.getInstance().get(`/sysuserroles/getdraft`,isloading);
res.data.sysuserrole = data.sysuserrole;
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/sysuserroles`,data,isloading);
return res;
}
......@@ -152,7 +152,7 @@ export default class SysUserRoleServiceBase extends EntityService {
}
/**
* Create接口方法
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -160,46 +160,42 @@ export default class SysUserRoleServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysUserRoleServiceBase
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sysuser && 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(`/sysusers/${context.sysuser}/sysuserroles`,data,isloading);
}
if(context.sysrole && true){
let masterData:any = {};
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sysuser && context.sysuserrole){
let res:any = await Http.getInstance().get(`/sysusers/${context.sysuser}/sysuserroles/${context.sysuserrole}`,isloading);
}
if(data.srffrontuf){
delete data.srffrontuf;
if(context.sysrole && context.sysuserrole){
let res:any = await Http.getInstance().get(`/sysroles/${context.sysrole}/sysuserroles/${context.sysuserrole}`,isloading);
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/sysroles/${context.sysrole}/sysuserroles`,data,isloading);
let res:any = await Http.getInstance().get(`/sysuserroles/${context.sysuserrole}`,isloading);
return res;
}
let masterData:any = {};
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysUserRoleServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sysuser && true){
let res:any = await Http.getInstance().get(`/sysusers/${context.sysuser}/sysuserroles/getdraft`,isloading);
res.data.sysuserrole = data.sysuserrole;
}
if(data.srffrontuf){
delete data.srffrontuf;
if(context.sysrole && true){
let res:any = await Http.getInstance().get(`/sysroles/${context.sysrole}/sysuserroles/getdraft`,isloading);
res.data.sysuserrole = data.sysuserrole;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/sysuserroles`,data,isloading);
let res:any = await Http.getInstance().get(`/sysuserroles/getdraft`,isloading);
res.data.sysuserrole = data.sysuserrole;
return res;
}
/**
* Get接口方法
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -207,14 +203,18 @@ export default class SysUserRoleServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysUserRoleServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sysuser && context.sysuserrole){
let res:any = await Http.getInstance().get(`/sysusers/${context.sysuser}/sysuserroles/${context.sysuserrole}`,isloading);
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/sysusers/${context.sysuser}/sysuserroles/${context.sysuserrole}/checkkey`,data,isloading);
}
if(context.sysrole && context.sysuserrole){
let res:any = await Http.getInstance().get(`/sysroles/${context.sysrole}/sysuserroles/${context.sysuserrole}`,isloading);
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/sysroles/${context.sysrole}/sysuserroles/${context.sysuserrole}/checkkey`,data,isloading);
}
let res:any = await Http.getInstance().get(`/sysuserroles/${context.sysuserrole}`,isloading);
let res:any = await Http.getInstance().post(`/sysuserroles/${context.sysuserrole}/checkkey`,data,isloading);
return res;
}
......
......@@ -53,7 +53,7 @@ export default class SysUserServiceBase extends EntityService {
}
/**
* Remove接口方法
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -61,8 +61,33 @@ export default class SysUserServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysUserServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().delete(`/sysusers/${context.sysuser}`,isloading);
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let sysuserrolesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysuserroles'),'undefined')){
sysuserrolesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_sysuserroles') as any);
if(sysuserrolesData && sysuserrolesData.length && sysuserrolesData.length > 0){
sysuserrolesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.userroleid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.sysuserroles = sysuserrolesData;
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(`/sysusers`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_sysuserroles',JSON.stringify(res.data.sysuserroles));
return res;
}
......@@ -99,7 +124,7 @@ export default class SysUserServiceBase extends EntityService {
}
/**
* CheckKey接口方法
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -107,8 +132,8 @@ export default class SysUserServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysUserServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().post(`/sysusers/${context.sysuser}/checkkey`,data,isloading);
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().delete(`/sysusers/${context.sysuser}`,isloading);
return res;
}
......@@ -128,7 +153,7 @@ export default class SysUserServiceBase extends EntityService {
}
/**
* Save接口方法
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -136,31 +161,15 @@ export default class SysUserServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysUserServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let sysuserrolesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysuserroles'),'undefined')){
sysuserrolesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_sysuserroles') as any);
if(sysuserrolesData && sysuserrolesData.length && sysuserrolesData.length > 0){
sysuserrolesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.userroleid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.sysuserroles = sysuserrolesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/sysusers/${context.sysuser}/save`,data,isloading);
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/sysusers/getdraft`,isloading);
res.data.sysuser = data.sysuser;
this.tempStorage.setItem(context.srfsessionkey+'_sysuserroles',JSON.stringify(res.data.sysuserroles));
return res;
}
/**
* GetDraft接口方法
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -168,15 +177,13 @@ export default class SysUserServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysUserServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/sysusers/getdraft`,isloading);
res.data.sysuser = data.sysuser;
this.tempStorage.setItem(context.srfsessionkey+'_sysuserroles',JSON.stringify(res.data.sysuserroles));
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().post(`/sysusers/${context.sysuser}/checkkey`,data,isloading);
return res;
}
/**
* Create接口方法
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -184,7 +191,7 @@ export default class SysUserServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SysUserServiceBase
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let sysuserrolesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysuserroles'),'undefined')){
......@@ -202,15 +209,8 @@ export default class SysUserServiceBase extends EntityService {
}
masterData.sysuserroles = sysuserrolesData;
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(`/sysusers`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_sysuserroles',JSON.stringify(res.data.sysuserroles));
let res:any = await Http.getInstance().post(`/sysusers/${context.sysuser}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_sysuserroles',JSON.stringify(res.data.sysuserroles));
return res;
}
......
package cn.ibizlab.core.extensions.service;
import cn.ibizlab.core.uaa.service.impl.SysPSSystemServiceImpl;
import lombok.extern.slf4j.Slf4j;
import cn.ibizlab.core.uaa.domain.SysPSSystem;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Primary;
import java.util.*;
/**
* 实体[系统] 自定义服务对象
*/
@Slf4j
@Primary
@Service("SysPSSystemServiceEx")
public class SysPSSystemServiceEx extends SysPSSystemServiceImpl {
@Override
protected Class currentModelClass() {
return com.baomidou.mybatisplus.core.toolkit.ReflectionKit.getSuperClassGenericType(this.getClass().getSuperclass(), 1);
}
/**
* 自定义行为[PrepareApps]用户扩展
* @param et
* @return
*/
@Override
@Transactional
public SysPSSystem prepareApps(SysPSSystem et) {
return super.prepareApps(et);
}
/**
* 自定义行为[SyncPermission]用户扩展
* @param et
* @return
*/
@Override
@Transactional
public SysPSSystem syncPermission(SysPSSystem et) {
return super.syncPermission(et);
}
}
......@@ -19,8 +19,8 @@ import com.alibaba.fastjson.JSONObject;
public interface SysPSSystemMapper extends BaseMapper<SysPSSystem>{
Page<SysPSSystem> searchPick(IPage page, @Param("srf") SysPSSystemSearchContext context, @Param("ew") Wrapper<SysPSSystem> wrapper) ;
Page<SysPSSystem> searchDefault(IPage page, @Param("srf") SysPSSystemSearchContext context, @Param("ew") Wrapper<SysPSSystem> wrapper) ;
Page<SysPSSystem> searchPick(IPage page, @Param("srf") SysPSSystemSearchContext context, @Param("ew") Wrapper<SysPSSystem> wrapper) ;
@Override
SysPSSystem selectById(Serializable id);
@Override
......
......@@ -23,17 +23,17 @@ import cn.ibizlab.core.uaa.filter.SysAppSearchContext;
*/
public interface ISysAppService{
boolean create(SysApp et) ;
void createBatch(List<SysApp> list) ;
boolean update(SysApp et) ;
void updateBatch(List<SysApp> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
SysApp get(String key) ;
boolean save(SysApp et) ;
void saveBatch(List<SysApp> list) ;
SysApp getDraft(SysApp et) ;
boolean checkKey(SysApp et) ;
boolean update(SysApp et) ;
void updateBatch(List<SysApp> list) ;
boolean create(SysApp et) ;
void createBatch(List<SysApp> list) ;
boolean save(SysApp et) ;
void saveBatch(List<SysApp> list) ;
Page<SysApp> searchDefault(SysAppSearchContext context) ;
List<SysApp> selectBySystemid(String pssystemid) ;
void removeBySystemid(String pssystemid) ;
......
......@@ -25,15 +25,15 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface ISysAuthLogService extends IService<SysAuthLog>{
SysAuthLog getDraft(SysAuthLog et) ;
boolean create(SysAuthLog et) ;
void createBatch(List<SysAuthLog> list) ;
boolean update(SysAuthLog et) ;
void updateBatch(List<SysAuthLog> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
boolean create(SysAuthLog et) ;
void createBatch(List<SysAuthLog> list) ;
boolean checkKey(SysAuthLog et) ;
SysAuthLog get(String key) ;
SysAuthLog getDraft(SysAuthLog et) ;
boolean checkKey(SysAuthLog et) ;
boolean save(SysAuthLog et) ;
void saveBatch(List<SysAuthLog> list) ;
Page<SysAuthLog> searchDefault(SysAuthLogSearchContext context) ;
......
......@@ -25,19 +25,21 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface ISysPSSystemService extends IService<SysPSSystem>{
boolean checkKey(SysPSSystem et) ;
SysPSSystem get(String key) ;
boolean create(SysPSSystem et) ;
void createBatch(List<SysPSSystem> list) ;
SysPSSystem getDraft(SysPSSystem et) ;
boolean update(SysPSSystem et) ;
void updateBatch(List<SysPSSystem> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
SysPSSystem get(String key) ;
SysPSSystem getDraft(SysPSSystem et) ;
boolean checkKey(SysPSSystem et) ;
SysPSSystem prepareApps(SysPSSystem et) ;
boolean save(SysPSSystem et) ;
void saveBatch(List<SysPSSystem> list) ;
boolean update(SysPSSystem et) ;
void updateBatch(List<SysPSSystem> list) ;
Page<SysPSSystem> searchPick(SysPSSystemSearchContext context) ;
SysPSSystem syncPermission(SysPSSystem et) ;
Page<SysPSSystem> searchDefault(SysPSSystemSearchContext context) ;
Page<SysPSSystem> searchPick(SysPSSystemSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
......
......@@ -25,17 +25,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface ISysPermissionService extends IService<SysPermission>{
boolean save(SysPermission et) ;
void saveBatch(List<SysPermission> list) ;
SysPermission getDraft(SysPermission et) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
boolean update(SysPermission et) ;
void updateBatch(List<SysPermission> list) ;
boolean create(SysPermission et) ;
void createBatch(List<SysPermission> list) ;
boolean checkKey(SysPermission et) ;
boolean update(SysPermission et) ;
void updateBatch(List<SysPermission> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
SysPermission get(String key) ;
SysPermission getDraft(SysPermission et) ;
boolean checkKey(SysPermission et) ;
boolean save(SysPermission et) ;
void saveBatch(List<SysPermission> list) ;
Page<SysPermission> searchDefault(SysPermissionSearchContext context) ;
/**
*自定义查询SQL
......
......@@ -25,17 +25,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface ISysRolePermissionService extends IService<SysRolePermission>{
SysRolePermission get(String key) ;
boolean create(SysRolePermission et) ;
void createBatch(List<SysRolePermission> list) ;
boolean update(SysRolePermission et) ;
void updateBatch(List<SysRolePermission> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
SysRolePermission get(String key) ;
SysRolePermission getDraft(SysRolePermission et) ;
boolean create(SysRolePermission et) ;
void createBatch(List<SysRolePermission> list) ;
boolean checkKey(SysRolePermission et) ;
boolean save(SysRolePermission et) ;
void saveBatch(List<SysRolePermission> list) ;
boolean update(SysRolePermission et) ;
void updateBatch(List<SysRolePermission> list) ;
Page<SysRolePermission> searchDefault(SysRolePermissionSearchContext context) ;
List<SysRolePermission> selectByPermissionid(String permissionid) ;
void removeByPermissionid(String permissionid) ;
......
......@@ -25,21 +25,21 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface ISysRoleService extends IService<SysRole>{
boolean save(SysRole et) ;
boolean create(SysRole et) ;
@CacheEvict(value="sysrole",allEntries=true)
void saveBatch(List<SysRole> list) ;
void createBatch(List<SysRole> list) ;
boolean update(SysRole et) ;
@CacheEvict(value="sysrole",allEntries=true)
void updateBatch(List<SysRole> list) ;
boolean create(SysRole et) ;
@CacheEvict(value="sysrole",allEntries=true)
void createBatch(List<SysRole> list) ;
SysRole get(String key) ;
boolean remove(String key) ;
@CacheEvict(value="sysrole",allEntries=true)
void removeBatch(Collection<String> idList) ;
SysRole get(String key) ;
SysRole getDraft(SysRole et) ;
boolean checkKey(SysRole et) ;
boolean save(SysRole et) ;
@CacheEvict(value="sysrole",allEntries=true)
void saveBatch(List<SysRole> list) ;
Page<SysRole> searchDefault(SysRoleSearchContext context) ;
/**
*自定义查询SQL
......
......@@ -25,15 +25,15 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface ISysUserRoleService extends IService<SysUserRole>{
boolean checkKey(SysUserRole et) ;
SysUserRole getDraft(SysUserRole et) ;
boolean create(SysUserRole et) ;
void createBatch(List<SysUserRole> list) ;
boolean update(SysUserRole et) ;
void updateBatch(List<SysUserRole> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
boolean create(SysUserRole et) ;
void createBatch(List<SysUserRole> list) ;
SysUserRole get(String key) ;
SysUserRole getDraft(SysUserRole et) ;
boolean checkKey(SysUserRole et) ;
boolean save(SysUserRole et) ;
void saveBatch(List<SysUserRole> list) ;
Page<SysUserRole> searchDefault(SysUserRoleSearchContext context) ;
......
......@@ -25,21 +25,21 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface ISysUserService extends IService<SysUser>{
boolean remove(String key) ;
boolean create(SysUser et) ;
@CacheEvict(value="sysuser",allEntries=true)
void removeBatch(Collection<String> idList) ;
void createBatch(List<SysUser> list) ;
boolean update(SysUser et) ;
@CacheEvict(value="sysuser",allEntries=true)
void updateBatch(List<SysUser> list) ;
boolean checkKey(SysUser et) ;
boolean remove(String key) ;
@CacheEvict(value="sysuser",allEntries=true)
void removeBatch(Collection<String> idList) ;
SysUser get(String key) ;
SysUser getDraft(SysUser et) ;
boolean checkKey(SysUser et) ;
boolean save(SysUser et) ;
@CacheEvict(value="sysuser",allEntries=true)
void saveBatch(List<SysUser> list) ;
SysUser getDraft(SysUser et) ;
boolean create(SysUser et) ;
@CacheEvict(value="sysuser",allEntries=true)
void createBatch(List<SysUser> list) ;
Page<SysUser> searchDefault(SysUserSearchContext context) ;
/**
*自定义查询SQL
......
......@@ -39,33 +39,41 @@ public class SysAppServiceImpl implements ISysAppService {
@Override
public boolean remove(String key) {
public boolean create(SysApp et) {
//代码实现
return true;
}
public void removeBatch(Collection<String> idList){
public void createBatch(List<SysApp> list){
}
@Override
public SysApp get(String key) {
SysApp et = new SysApp();
et.setId(key);
return et;
public boolean update(SysApp et) {
//代码实现
return true;
}
public void updateBatch(List<SysApp> list){
}
@Override
@Transactional
public boolean save(SysApp et) {
//代码实现
public boolean remove(String key) {
return true;
}
@Override
public void saveBatch(List<SysApp> list) {
public void removeBatch(Collection<String> idList){
}
@Override
public SysApp get(String key) {
SysApp et = new SysApp();
et.setId(key);
return et;
}
@Override
public SysApp getDraft(SysApp et) {
return et;
......@@ -76,22 +84,14 @@ public class SysAppServiceImpl implements ISysAppService {
return false;
}
@Override
public boolean update(SysApp et) {
@Transactional
public boolean save(SysApp et) {
//代码实现
return true;
}
public void updateBatch(List<SysApp> list){
}
@Override
public boolean create(SysApp et) {
//代码实现
return true;
}
public void createBatch(List<SysApp> list){
public void saveBatch(List<SysApp> list) {
}
......
......@@ -48,8 +48,17 @@ public class SysAuthLogServiceImpl extends ServiceImpl<SysAuthLogMapper, SysAuth
protected int batchSize = 500;
@Override
public SysAuthLog getDraft(SysAuthLog et) {
return et;
@Transactional
public boolean create(SysAuthLog et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getLogid()),et);
return true;
}
@Override
public void createBatch(List<SysAuthLog> list) {
this.saveBatch(list,batchSize);
}
@Override
......@@ -78,24 +87,6 @@ public class SysAuthLogServiceImpl extends ServiceImpl<SysAuthLogMapper, SysAuth
removeByIds(idList);
}
@Override
@Transactional
public boolean create(SysAuthLog et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getLogid()),et);
return true;
}
@Override
public void createBatch(List<SysAuthLog> list) {
this.saveBatch(list,batchSize);
}
@Override
public boolean checkKey(SysAuthLog et) {
return (!ObjectUtils.isEmpty(et.getLogid()))&&(!Objects.isNull(this.getById(et.getLogid())));
}
@Override
@Transactional
public SysAuthLog get(String key) {
......@@ -109,6 +100,15 @@ public class SysAuthLogServiceImpl extends ServiceImpl<SysAuthLogMapper, SysAuth
return et;
}
@Override
public SysAuthLog getDraft(SysAuthLog et) {
return et;
}
@Override
public boolean checkKey(SysAuthLog et) {
return (!ObjectUtils.isEmpty(et.getLogid()))&&(!Objects.isNull(this.getById(et.getLogid())));
}
@Override
@Transactional
public boolean save(SysAuthLog et) {
......
......@@ -47,23 +47,6 @@ public class SysPSSystemServiceImpl extends ServiceImpl<SysPSSystemMapper, SysPS
protected int batchSize = 500;
@Override
public boolean checkKey(SysPSSystem et) {
return (!ObjectUtils.isEmpty(et.getPssystemid()))&&(!Objects.isNull(this.getById(et.getPssystemid())));
}
@Override
@Transactional
public SysPSSystem get(String key) {
SysPSSystem et = getById(key);
if(et==null){
et=new SysPSSystem();
et.setPssystemid(key);
}
else{
}
return et;
}
@Override
@Transactional
public boolean create(SysPSSystem et) {
......@@ -79,8 +62,17 @@ public class SysPSSystemServiceImpl extends ServiceImpl<SysPSSystemMapper, SysPS
}
@Override
public SysPSSystem getDraft(SysPSSystem et) {
return et;
@Transactional
public boolean update(SysPSSystem et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("pssystemid",et.getPssystemid())))
return false;
CachedBeanCopier.copy(get(et.getPssystemid()),et);
return true;
}
@Override
public void updateBatch(List<SysPSSystem> list) {
updateBatchById(list,batchSize);
}
@Override
......@@ -95,6 +87,35 @@ public class SysPSSystemServiceImpl extends ServiceImpl<SysPSSystemMapper, SysPS
removeByIds(idList);
}
@Override
@Transactional
public SysPSSystem get(String key) {
SysPSSystem et = getById(key);
if(et==null){
et=new SysPSSystem();
et.setPssystemid(key);
}
else{
}
return et;
}
@Override
public SysPSSystem getDraft(SysPSSystem et) {
return et;
}
@Override
public boolean checkKey(SysPSSystem et) {
return (!ObjectUtils.isEmpty(et.getPssystemid()))&&(!Objects.isNull(this.getById(et.getPssystemid())));
}
@Override
@Transactional
public SysPSSystem prepareApps(SysPSSystem et) {
//自定义代码
return et;
}
@Override
@Transactional
public boolean save(SysPSSystem et) {
......@@ -128,35 +149,28 @@ public class SysPSSystemServiceImpl extends ServiceImpl<SysPSSystemMapper, SysPS
@Override
@Transactional
public boolean update(SysPSSystem et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("pssystemid",et.getPssystemid())))
return false;
CachedBeanCopier.copy(get(et.getPssystemid()),et);
return true;
}
@Override
public void updateBatch(List<SysPSSystem> list) {
updateBatchById(list,batchSize);
public SysPSSystem syncPermission(SysPSSystem et) {
//自定义代码
return et;
}
/**
* 查询集合 Pick
* 查询集合 DEFAULT
*/
@Override
public Page<SysPSSystem> searchPick(SysPSSystemSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<SysPSSystem> pages=baseMapper.searchPick(context.getPages(),context,context.getSelectCond());
public Page<SysPSSystem> searchDefault(SysPSSystemSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<SysPSSystem> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<SysPSSystem>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 DEFAULT
* 查询集合 Pick
*/
@Override
public Page<SysPSSystem> searchDefault(SysPSSystemSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<SysPSSystem> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
public Page<SysPSSystem> searchPick(SysPSSystemSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<SysPSSystem> pages=baseMapper.searchPick(context.getPages(),context,context.getSelectCond());
return new PageImpl<SysPSSystem>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
......
......@@ -52,38 +52,30 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
@Override
@Transactional
public boolean save(SysPermission et) {
if(!saveOrUpdate(et))
public boolean create(SysPermission et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getPermissionid()),et);
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(SysPermission et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
public void createBatch(List<SysPermission> list) {
this.saveBatch(list,batchSize);
}
@Override
public boolean saveBatch(Collection<SysPermission> list) {
saveOrUpdateBatch(list,batchSize);
@Transactional
public boolean update(SysPermission et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("sys_permissionid",et.getPermissionid())))
return false;
CachedBeanCopier.copy(get(et.getPermissionid()),et);
return true;
}
@Override
public void saveBatch(List<SysPermission> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
public SysPermission getDraft(SysPermission et) {
return et;
public void updateBatch(List<SysPermission> list) {
updateBatchById(list,batchSize);
}
@Override
......@@ -100,47 +92,55 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
@Override
@Transactional
public boolean update(SysPermission et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("sys_permissionid",et.getPermissionid())))
return false;
CachedBeanCopier.copy(get(et.getPermissionid()),et);
return true;
public SysPermission get(String key) {
SysPermission et = getById(key);
if(et==null){
et=new SysPermission();
et.setPermissionid(key);
}
else{
}
return et;
}
@Override
public void updateBatch(List<SysPermission> list) {
updateBatchById(list,batchSize);
public SysPermission getDraft(SysPermission et) {
return et;
}
@Override
public boolean checkKey(SysPermission et) {
return (!ObjectUtils.isEmpty(et.getPermissionid()))&&(!Objects.isNull(this.getById(et.getPermissionid())));
}
@Override
@Transactional
public boolean create(SysPermission et) {
if(!this.retBool(this.baseMapper.insert(et)))
public boolean save(SysPermission et) {
if(!saveOrUpdate(et))
return false;
CachedBeanCopier.copy(get(et.getPermissionid()),et);
return true;
}
@Override
public void createBatch(List<SysPermission> list) {
this.saveBatch(list,batchSize);
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(SysPermission et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean checkKey(SysPermission et) {
return (!ObjectUtils.isEmpty(et.getPermissionid()))&&(!Objects.isNull(this.getById(et.getPermissionid())));
public boolean saveBatch(Collection<SysPermission> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
@Transactional
public SysPermission get(String key) {
SysPermission et = getById(key);
if(et==null){
et=new SysPermission();
et.setPermissionid(key);
}
else{
}
return et;
public void saveBatch(List<SysPermission> list) {
saveOrUpdateBatch(list,batchSize);
}
......
......@@ -55,15 +55,34 @@ public class SysRolePermissionServiceImpl extends ServiceImpl<SysRolePermissionM
@Override
@Transactional
public SysRolePermission get(String key) {
SysRolePermission et = getById(key);
if(et==null){
et=new SysRolePermission();
et.setRolepermissionid(key);
public boolean create(SysRolePermission et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getRolepermissionid()),et);
return true;
}
else{
@Override
public void createBatch(List<SysRolePermission> list) {
list.forEach(item->fillParentData(item));
this.saveOrUpdateBatch(list,batchSize);
}
return et;
@Override
@Transactional
public boolean update(SysRolePermission et) {
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("sys_role_permissionid",et.getRolepermissionid())))
return false;
CachedBeanCopier.copy(get(et.getRolepermissionid()),et);
return true;
}
@Override
public void updateBatch(List<SysRolePermission> list) {
list.forEach(item->fillParentData(item));
updateBatchById(list,batchSize);
}
@Override
......@@ -79,25 +98,22 @@ public class SysRolePermissionServiceImpl extends ServiceImpl<SysRolePermissionM
}
@Override
public SysRolePermission getDraft(SysRolePermission et) {
fillParentData(et);
@Transactional
public SysRolePermission get(String key) {
SysRolePermission et = getById(key);
if(et==null){
et=new SysRolePermission();
et.setRolepermissionid(key);
}
else{
}
return et;
}
@Override
@Transactional
public boolean create(SysRolePermission et) {
public SysRolePermission getDraft(SysRolePermission et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getRolepermissionid()),et);
return true;
}
@Override
public void createBatch(List<SysRolePermission> list) {
list.forEach(item->fillParentData(item));
this.saveOrUpdateBatch(list,batchSize);
return et;
}
@Override
......@@ -137,22 +153,6 @@ public class SysRolePermissionServiceImpl extends ServiceImpl<SysRolePermissionM
saveOrUpdateBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(SysRolePermission et) {
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("sys_role_permissionid",et.getRolepermissionid())))
return false;
CachedBeanCopier.copy(get(et.getRolepermissionid()),et);
return true;
}
@Override
public void updateBatch(List<SysRolePermission> list) {
list.forEach(item->fillParentData(item));
updateBatchById(list,batchSize);
}
@Override
public List<SysRolePermission> selectByPermissionid(String permissionid) {
......
......@@ -55,33 +55,16 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
@Override
@Transactional
public boolean save(SysRole et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(SysRole et) {
if (null == et) {
public boolean create(SysRole et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<SysRole> list) {
saveOrUpdateBatch(list,batchSize);
CachedBeanCopier.copy(get(et.getRoleid()),et);
return true;
}
@Override
public void saveBatch(List<SysRole> list) {
saveOrUpdateBatch(list,batchSize);
public void createBatch(List<SysRole> list) {
this.saveBatch(list,batchSize);
}
@Override
......@@ -100,16 +83,14 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
@Override
@Transactional
public boolean create(SysRole et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getRoleid()),et);
return true;
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void createBatch(List<SysRole> list) {
this.saveBatch(list,batchSize);
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
......@@ -125,29 +106,48 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
return et;
}
@Override
public SysRole getDraft(SysRole et) {
return et;
}
@Override
public boolean checkKey(SysRole et) {
return (!ObjectUtils.isEmpty(et.getRoleid()))&&(!Objects.isNull(this.getById(et.getRoleid())));
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
public boolean save(SysRole et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(SysRole et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public SysRole getDraft(SysRole et) {
return et;
public boolean saveBatch(Collection<SysRole> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public boolean checkKey(SysRole et) {
return (!ObjectUtils.isEmpty(et.getRoleid()))&&(!Objects.isNull(this.getById(et.getRoleid())));
public void saveBatch(List<SysRole> list) {
saveOrUpdateBatch(list,batchSize);
}
/**
* 查询集合 DEFAULT
*/
......
......@@ -54,13 +54,19 @@ public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUs
protected int batchSize = 500;
@Override
public boolean checkKey(SysUserRole et) {
return (!ObjectUtils.isEmpty(et.getUserroleid()))&&(!Objects.isNull(this.getById(et.getUserroleid())));
@Transactional
public boolean create(SysUserRole et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getUserroleid()),et);
return true;
}
@Override
public SysUserRole getDraft(SysUserRole et) {
fillParentData(et);
return et;
public void createBatch(List<SysUserRole> list) {
list.forEach(item->fillParentData(item));
this.saveOrUpdateBatch(list,batchSize);
}
@Override
......@@ -91,22 +97,6 @@ public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUs
removeByIds(idList);
}
@Override
@Transactional
public boolean create(SysUserRole et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getUserroleid()),et);
return true;
}
@Override
public void createBatch(List<SysUserRole> list) {
list.forEach(item->fillParentData(item));
this.saveOrUpdateBatch(list,batchSize);
}
@Override
@Transactional
public SysUserRole get(String key) {
......@@ -120,6 +110,16 @@ public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUs
return et;
}
@Override
public SysUserRole getDraft(SysUserRole et) {
fillParentData(et);
return et;
}
@Override
public boolean checkKey(SysUserRole et) {
return (!ObjectUtils.isEmpty(et.getUserroleid()))&&(!Objects.isNull(this.getById(et.getUserroleid())));
}
@Override
@Transactional
public boolean save(SysUserRole et) {
......
......@@ -52,14 +52,16 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
public boolean create(SysUser et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getUserid()),et);
return true;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
public void createBatch(List<SysUser> list) {
this.saveBatch(list,batchSize);
}
@Override
......@@ -77,9 +79,17 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
}
@Override
public boolean checkKey(SysUser et) {
return (!ObjectUtils.isEmpty(et.getUserid()))&&(!Objects.isNull(this.getById(et.getUserid())));
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public SysUser get(String key) {
......@@ -93,6 +103,15 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
return et;
}
@Override
public SysUser getDraft(SysUser et) {
return et;
}
@Override
public boolean checkKey(SysUser et) {
return (!ObjectUtils.isEmpty(et.getUserid()))&&(!Objects.isNull(this.getById(et.getUserid())));
}
@Override
@Transactional
public boolean save(SysUser et) {
......@@ -124,25 +143,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
saveOrUpdateBatch(list,batchSize);
}
@Override
public SysUser getDraft(SysUser et) {
return et;
}
@Override
@Transactional
public boolean create(SysUser et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getUserid()),et);
return true;
}
@Override
public void createBatch(List<SysUser> list) {
this.saveBatch(list,batchSize);
}
/**
......
......@@ -88,7 +88,7 @@
<!--输出实体[SYS_PSSYSTEM]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_pssystem-36-5">
<changeSet author="a_A_5d9d78509" id="tab-sys_pssystem-39-5">
<createTable tableName="IBZPSSYSTEM">
<column name="PSSYSTEMID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_PSSYSTEM_PSSYSTEMID"/>
......
......@@ -8,7 +8,7 @@
"delogicname":"认证日志",
"sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}]
}
, {
......@@ -16,7 +16,7 @@
"delogicname":"应用",
"sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" }],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}]
}
, {
......@@ -24,7 +24,7 @@
"delogicname":"角色权限关系",
"sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" }],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}]
}
, {
......@@ -32,7 +32,7 @@
"delogicname":"权限/资源",
"sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" }],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}]
}
, {
......@@ -40,7 +40,7 @@
"delogicname":"用户角色关系",
"sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}]
}
, {
......@@ -48,7 +48,7 @@
"delogicname":"系统用户",
"sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" }],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}]
}
, {
......@@ -56,7 +56,7 @@
"delogicname":"系统角色",
"sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" }],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}]
}
],
......
......@@ -47,6 +47,41 @@ public class SysAppResource {
@Lazy
public SysAppMapping sysappMapping;
@ApiOperation(value = "新建应用", tags = {"应用" }, notes = "新建应用")
@RequestMapping(method = RequestMethod.POST, value = "/sysapps")
@Transactional
public ResponseEntity<SysAppDTO> create(@RequestBody SysAppDTO sysappdto) {
SysApp domain = sysappMapping.toDomain(sysappdto);
sysappService.create(domain);
SysAppDTO dto = sysappMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "批量新建应用", tags = {"应用" }, notes = "批量新建应用")
@RequestMapping(method = RequestMethod.POST, value = "/sysapps/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<SysAppDTO> sysappdtos) {
sysappService.createBatch(sysappMapping.toDomain(sysappdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "更新应用", tags = {"应用" }, notes = "更新应用")
@RequestMapping(method = RequestMethod.PUT, value = "/sysapps/{sysapp_id}")
@Transactional
public ResponseEntity<SysAppDTO> update(@PathVariable("sysapp_id") String sysapp_id, @RequestBody SysAppDTO sysappdto) {
SysApp domain = sysappMapping.toDomain(sysappdto);
domain .setId(sysapp_id);
sysappService.update(domain );
SysAppDTO dto = sysappMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "批量更新应用", tags = {"应用" }, notes = "批量更新应用")
@RequestMapping(method = RequestMethod.PUT, value = "/sysapps/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<SysAppDTO> sysappdtos) {
sysappService.updateBatch(sysappMapping.toDomain(sysappdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "删除应用", tags = {"应用" }, notes = "删除应用")
@RequestMapping(method = RequestMethod.DELETE, value = "/sysapps/{sysapp_id}")
@Transactional
......@@ -69,19 +104,6 @@ public class SysAppResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "保存应用", tags = {"应用" }, notes = "保存应用")
@RequestMapping(method = RequestMethod.POST, value = "/sysapps/save")
public ResponseEntity<Boolean> save(@RequestBody SysAppDTO sysappdto) {
return ResponseEntity.status(HttpStatus.OK).body(sysappService.save(sysappMapping.toDomain(sysappdto)));
}
@ApiOperation(value = "批量保存应用", tags = {"应用" }, notes = "批量保存应用")
@RequestMapping(method = RequestMethod.POST, value = "/sysapps/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<SysAppDTO> sysappdtos) {
sysappService.saveBatch(sysappMapping.toDomain(sysappdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "获取应用草稿", tags = {"应用" }, notes = "获取应用草稿")
@RequestMapping(method = RequestMethod.GET, value = "/sysapps/getdraft")
public ResponseEntity<SysAppDTO> getDraft() {
......@@ -94,42 +116,20 @@ public class SysAppResource {
return ResponseEntity.status(HttpStatus.OK).body(sysappService.checkKey(sysappMapping.toDomain(sysappdto)));
}
@ApiOperation(value = "更新应用", tags = {"应用" }, notes = "更新应用")
@RequestMapping(method = RequestMethod.PUT, value = "/sysapps/{sysapp_id}")
@Transactional
public ResponseEntity<SysAppDTO> update(@PathVariable("sysapp_id") String sysapp_id, @RequestBody SysAppDTO sysappdto) {
SysApp domain = sysappMapping.toDomain(sysappdto);
domain .setId(sysapp_id);
sysappService.update(domain );
SysAppDTO dto = sysappMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "批量更新应用", tags = {"应用" }, notes = "批量更新应用")
@RequestMapping(method = RequestMethod.PUT, value = "/sysapps/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<SysAppDTO> sysappdtos) {
sysappService.updateBatch(sysappMapping.toDomain(sysappdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "新建应用", tags = {"应用" }, notes = "新建应用")
@RequestMapping(method = RequestMethod.POST, value = "/sysapps")
@Transactional
public ResponseEntity<SysAppDTO> create(@RequestBody SysAppDTO sysappdto) {
SysApp domain = sysappMapping.toDomain(sysappdto);
sysappService.create(domain);
SysAppDTO dto = sysappMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
@ApiOperation(value = "保存应用", tags = {"应用" }, notes = "保存应用")
@RequestMapping(method = RequestMethod.POST, value = "/sysapps/save")
public ResponseEntity<Boolean> save(@RequestBody SysAppDTO sysappdto) {
return ResponseEntity.status(HttpStatus.OK).body(sysappService.save(sysappMapping.toDomain(sysappdto)));
}
@ApiOperation(value = "批量新建应用", tags = {"应用" }, notes = "批量新建应用")
@RequestMapping(method = RequestMethod.POST, value = "/sysapps/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<SysAppDTO> sysappdtos) {
sysappService.createBatch(sysappMapping.toDomain(sysappdtos));
@ApiOperation(value = "批量保存应用", tags = {"应用" }, notes = "批量保存应用")
@RequestMapping(method = RequestMethod.POST, value = "/sysapps/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<SysAppDTO> sysappdtos) {
sysappService.saveBatch(sysappMapping.toDomain(sysappdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysApp-searchDefault-all')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysApp-searchDefault-all') and hasPermission(#context,'ibzuaa-SysApp-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"应用" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/sysapps/fetchdefault")
public ResponseEntity<List<SysAppDTO>> fetchDefault(SysAppSearchContext context) {
......@@ -142,7 +142,7 @@ public class SysAppResource {
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysApp-searchDefault-all')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysApp-searchDefault-all') and hasPermission(#context,'ibzuaa-SysApp-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"应用" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/sysapps/searchdefault")
public ResponseEntity<Page<SysAppDTO>> searchDefault(@RequestBody SysAppSearchContext context) {
......
......@@ -47,10 +47,23 @@ public class SysAuthLogResource {
@Lazy
public SysAuthLogMapping sysauthlogMapping;
@ApiOperation(value = "获取认证日志草稿", tags = {"认证日志" }, notes = "获取认证日志草稿")
@RequestMapping(method = RequestMethod.GET, value = "/sysauthlogs/getdraft")
public ResponseEntity<SysAuthLogDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(sysauthlogMapping.toDto(sysauthlogService.getDraft(new SysAuthLog())));
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-Create-all')")
@ApiOperation(value = "新建认证日志", tags = {"认证日志" }, notes = "新建认证日志")
@RequestMapping(method = RequestMethod.POST, value = "/sysauthlogs")
@Transactional
public ResponseEntity<SysAuthLogDTO> create(@RequestBody SysAuthLogDTO sysauthlogdto) {
SysAuthLog domain = sysauthlogMapping.toDomain(sysauthlogdto);
sysauthlogService.create(domain);
SysAuthLogDTO dto = sysauthlogMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-Create-all')")
@ApiOperation(value = "批量新建认证日志", tags = {"认证日志" }, notes = "批量新建认证日志")
@RequestMapping(method = RequestMethod.POST, value = "/sysauthlogs/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<SysAuthLogDTO> sysauthlogdtos) {
sysauthlogService.createBatch(sysauthlogMapping.toDomain(sysauthlogdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-Update-all')")
......@@ -89,23 +102,19 @@ public class SysAuthLogResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-Create-all')")
@ApiOperation(value = "新建认证日志", tags = {"认证日志" }, notes = "新建认证日志")
@RequestMapping(method = RequestMethod.POST, value = "/sysauthlogs")
@Transactional
public ResponseEntity<SysAuthLogDTO> create(@RequestBody SysAuthLogDTO sysauthlogdto) {
SysAuthLog domain = sysauthlogMapping.toDomain(sysauthlogdto);
sysauthlogService.create(domain);
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-Get-all')")
@ApiOperation(value = "获取认证日志", tags = {"认证日志" }, notes = "获取认证日志")
@RequestMapping(method = RequestMethod.GET, value = "/sysauthlogs/{sysauthlog_id}")
public ResponseEntity<SysAuthLogDTO> get(@PathVariable("sysauthlog_id") String sysauthlog_id) {
SysAuthLog domain = sysauthlogService.get(sysauthlog_id);
SysAuthLogDTO dto = sysauthlogMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-Create-all')")
@ApiOperation(value = "批量新建认证日志", tags = {"认证日志" }, notes = "批量新建认证日志")
@RequestMapping(method = RequestMethod.POST, value = "/sysauthlogs/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<SysAuthLogDTO> sysauthlogdtos) {
sysauthlogService.createBatch(sysauthlogMapping.toDomain(sysauthlogdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
@ApiOperation(value = "获取认证日志草稿", tags = {"认证日志" }, notes = "获取认证日志草稿")
@RequestMapping(method = RequestMethod.GET, value = "/sysauthlogs/getdraft")
public ResponseEntity<SysAuthLogDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(sysauthlogMapping.toDto(sysauthlogService.getDraft(new SysAuthLog())));
}
@ApiOperation(value = "检查认证日志", tags = {"认证日志" }, notes = "检查认证日志")
......@@ -114,15 +123,6 @@ public class SysAuthLogResource {
return ResponseEntity.status(HttpStatus.OK).body(sysauthlogService.checkKey(sysauthlogMapping.toDomain(sysauthlogdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-Get-all')")
@ApiOperation(value = "获取认证日志", tags = {"认证日志" }, notes = "获取认证日志")
@RequestMapping(method = RequestMethod.GET, value = "/sysauthlogs/{sysauthlog_id}")
public ResponseEntity<SysAuthLogDTO> get(@PathVariable("sysauthlog_id") String sysauthlog_id) {
SysAuthLog domain = sysauthlogService.get(sysauthlog_id);
SysAuthLogDTO dto = sysauthlogMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-Save-all')")
@ApiOperation(value = "保存认证日志", tags = {"认证日志" }, notes = "保存认证日志")
@RequestMapping(method = RequestMethod.POST, value = "/sysauthlogs/save")
......@@ -138,7 +138,7 @@ public class SysAuthLogResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-searchDefault-all')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-searchDefault-all') and hasPermission(#context,'ibzuaa-SysAuthLog-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"认证日志" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/sysauthlogs/fetchdefault")
public ResponseEntity<List<SysAuthLogDTO>> fetchDefault(SysAuthLogSearchContext context) {
......@@ -151,7 +151,7 @@ public class SysAuthLogResource {
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-searchDefault-all')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-searchDefault-all') and hasPermission(#context,'ibzuaa-SysAuthLog-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"认证日志" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/sysauthlogs/searchdefault")
public ResponseEntity<Page<SysAuthLogDTO>> searchDefault(@RequestBody SysAuthLogSearchContext context) {
......
......@@ -47,40 +47,22 @@ public class SysPermissionResource {
@Lazy
public SysPermissionMapping syspermissionMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Save-all')")
@ApiOperation(value = "保存权限/资源", tags = {"权限/资源" }, notes = "保存权限/资源")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions/save")
public ResponseEntity<Boolean> save(@RequestBody SysPermissionDTO syspermissiondto) {
return ResponseEntity.status(HttpStatus.OK).body(syspermissionService.save(syspermissionMapping.toDomain(syspermissiondto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Save-all')")
@ApiOperation(value = "批量保存权限/资源", tags = {"权限/资源" }, notes = "批量保存权限/资源")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<SysPermissionDTO> syspermissiondtos) {
syspermissionService.saveBatch(syspermissionMapping.toDomain(syspermissiondtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "获取权限/资源草稿", tags = {"权限/资源" }, notes = "获取权限/资源草稿")
@RequestMapping(method = RequestMethod.GET, value = "/syspermissions/getdraft")
public ResponseEntity<SysPermissionDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(syspermissionMapping.toDto(syspermissionService.getDraft(new SysPermission())));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Remove-all')")
@ApiOperation(value = "删除权限/资源", tags = {"权限/资源" }, notes = "删除权限/资源")
@RequestMapping(method = RequestMethod.DELETE, value = "/syspermissions/{syspermission_id}")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Create-all')")
@ApiOperation(value = "新建权限/资源", tags = {"权限/资源" }, notes = "新建权限/资源")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("syspermission_id") String syspermission_id) {
return ResponseEntity.status(HttpStatus.OK).body(syspermissionService.remove(syspermission_id));
public ResponseEntity<SysPermissionDTO> create(@RequestBody SysPermissionDTO syspermissiondto) {
SysPermission domain = syspermissionMapping.toDomain(syspermissiondto);
syspermissionService.create(domain);
SysPermissionDTO dto = syspermissionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Remove-all')")
@ApiOperation(value = "批量删除权限/资源", tags = {"权限/资源" }, notes = "批量删除权限/资源")
@RequestMapping(method = RequestMethod.DELETE, value = "/syspermissions/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
syspermissionService.removeBatch(ids);
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Create-all')")
@ApiOperation(value = "批量新建权限/资源", tags = {"权限/资源" }, notes = "批量新建权限/资源")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<SysPermissionDTO> syspermissiondtos) {
syspermissionService.createBatch(syspermissionMapping.toDomain(syspermissiondtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
......@@ -105,31 +87,22 @@ public class SysPermissionResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Create-all')")
@ApiOperation(value = "新建权限/资源", tags = {"权限/资源" }, notes = "新建权限/资源")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Remove-all')")
@ApiOperation(value = "删除权限/资源", tags = {"权限/资源" }, notes = "删除权限/资源")
@RequestMapping(method = RequestMethod.DELETE, value = "/syspermissions/{syspermission_id}")
@Transactional
public ResponseEntity<SysPermissionDTO> create(@RequestBody SysPermissionDTO syspermissiondto) {
SysPermission domain = syspermissionMapping.toDomain(syspermissiondto);
syspermissionService.create(domain);
SysPermissionDTO dto = syspermissionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
public ResponseEntity<Boolean> remove(@PathVariable("syspermission_id") String syspermission_id) {
return ResponseEntity.status(HttpStatus.OK).body(syspermissionService.remove(syspermission_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Create-all')")
@ApiOperation(value = "批量新建权限/资源", tags = {"权限/资源" }, notes = "批量新建权限/资源")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<SysPermissionDTO> syspermissiondtos) {
syspermissionService.createBatch(syspermissionMapping.toDomain(syspermissiondtos));
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Remove-all')")
@ApiOperation(value = "批量删除权限/资源", tags = {"权限/资源" }, notes = "批量删除权限/资源")
@RequestMapping(method = RequestMethod.DELETE, value = "/syspermissions/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
syspermissionService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "检查权限/资源", tags = {"权限/资源" }, notes = "检查权限/资源")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody SysPermissionDTO syspermissiondto) {
return ResponseEntity.status(HttpStatus.OK).body(syspermissionService.checkKey(syspermissionMapping.toDomain(syspermissiondto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Get-all')")
@ApiOperation(value = "获取权限/资源", tags = {"权限/资源" }, notes = "获取权限/资源")
@RequestMapping(method = RequestMethod.GET, value = "/syspermissions/{syspermission_id}")
......@@ -139,7 +112,34 @@ public class SysPermissionResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-searchDefault-all')")
@ApiOperation(value = "获取权限/资源草稿", tags = {"权限/资源" }, notes = "获取权限/资源草稿")
@RequestMapping(method = RequestMethod.GET, value = "/syspermissions/getdraft")
public ResponseEntity<SysPermissionDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(syspermissionMapping.toDto(syspermissionService.getDraft(new SysPermission())));
}
@ApiOperation(value = "检查权限/资源", tags = {"权限/资源" }, notes = "检查权限/资源")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody SysPermissionDTO syspermissiondto) {
return ResponseEntity.status(HttpStatus.OK).body(syspermissionService.checkKey(syspermissionMapping.toDomain(syspermissiondto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Save-all')")
@ApiOperation(value = "保存权限/资源", tags = {"权限/资源" }, notes = "保存权限/资源")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions/save")
public ResponseEntity<Boolean> save(@RequestBody SysPermissionDTO syspermissiondto) {
return ResponseEntity.status(HttpStatus.OK).body(syspermissionService.save(syspermissionMapping.toDomain(syspermissiondto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Save-all')")
@ApiOperation(value = "批量保存权限/资源", tags = {"权限/资源" }, notes = "批量保存权限/资源")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<SysPermissionDTO> syspermissiondtos) {
syspermissionService.saveBatch(syspermissionMapping.toDomain(syspermissiondtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-searchDefault-all') and hasPermission(#context,'ibzuaa-SysPermission-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"权限/资源" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/syspermissions/fetchdefault")
public ResponseEntity<List<SysPermissionDTO>> fetchDefault(SysPermissionSearchContext context) {
......@@ -152,7 +152,7 @@ public class SysPermissionResource {
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-searchDefault-all')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-searchDefault-all') and hasPermission(#context,'ibzuaa-SysPermission-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"权限/资源" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/syspermissions/searchdefault")
public ResponseEntity<Page<SysPermissionDTO>> searchDefault(@RequestBody SysPermissionSearchContext context) {
......
......@@ -47,18 +47,22 @@ public class SysRoleResource {
@Lazy
public SysRoleMapping sysroleMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-Save-all')")
@ApiOperation(value = "保存系统角色", tags = {"系统角色" }, notes = "保存系统角色")
@RequestMapping(method = RequestMethod.POST, value = "/sysroles/save")
public ResponseEntity<Boolean> save(@RequestBody SysRoleDTO sysroledto) {
return ResponseEntity.status(HttpStatus.OK).body(sysroleService.save(sysroleMapping.toDomain(sysroledto)));
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-Create-all')")
@ApiOperation(value = "新建系统角色", tags = {"系统角色" }, notes = "新建系统角色")
@RequestMapping(method = RequestMethod.POST, value = "/sysroles")
@Transactional
public ResponseEntity<SysRoleDTO> create(@RequestBody SysRoleDTO sysroledto) {
SysRole domain = sysroleMapping.toDomain(sysroledto);
sysroleService.create(domain);
SysRoleDTO dto = sysroleMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-Save-all')")
@ApiOperation(value = "批量保存系统角色", tags = {"系统角色" }, notes = "批量保存系统角色")
@RequestMapping(method = RequestMethod.POST, value = "/sysroles/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<SysRoleDTO> sysroledtos) {
sysroleService.saveBatch(sysroleMapping.toDomain(sysroledtos));
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-Create-all')")
@ApiOperation(value = "批量新建系统角色", tags = {"系统角色" }, notes = "批量新建系统角色")
@RequestMapping(method = RequestMethod.POST, value = "/sysroles/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<SysRoleDTO> sysroledtos) {
sysroleService.createBatch(sysroleMapping.toDomain(sysroledtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
......@@ -83,34 +87,6 @@ public class SysRoleResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-Create-all')")
@ApiOperation(value = "新建系统角色", tags = {"系统角色" }, notes = "新建系统角色")
@RequestMapping(method = RequestMethod.POST, value = "/sysroles")
@Transactional
public ResponseEntity<SysRoleDTO> create(@RequestBody SysRoleDTO sysroledto) {
SysRole domain = sysroleMapping.toDomain(sysroledto);
sysroleService.create(domain);
SysRoleDTO dto = sysroleMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-Create-all')")
@ApiOperation(value = "批量新建系统角色", tags = {"系统角色" }, notes = "批量新建系统角色")
@RequestMapping(method = RequestMethod.POST, value = "/sysroles/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<SysRoleDTO> sysroledtos) {
sysroleService.createBatch(sysroleMapping.toDomain(sysroledtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-Get-all')")
@ApiOperation(value = "获取系统角色", tags = {"系统角色" }, notes = "获取系统角色")
@RequestMapping(method = RequestMethod.GET, value = "/sysroles/{sysrole_id}")
public ResponseEntity<SysRoleDTO> get(@PathVariable("sysrole_id") String sysrole_id) {
SysRole domain = sysroleService.get(sysrole_id);
SysRoleDTO dto = sysroleMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-Remove-all')")
@ApiOperation(value = "删除系统角色", tags = {"系统角色" }, notes = "删除系统角色")
@RequestMapping(method = RequestMethod.DELETE, value = "/sysroles/{sysrole_id}")
......@@ -127,6 +103,15 @@ public class SysRoleResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-Get-all')")
@ApiOperation(value = "获取系统角色", tags = {"系统角色" }, notes = "获取系统角色")
@RequestMapping(method = RequestMethod.GET, value = "/sysroles/{sysrole_id}")
public ResponseEntity<SysRoleDTO> get(@PathVariable("sysrole_id") String sysrole_id) {
SysRole domain = sysroleService.get(sysrole_id);
SysRoleDTO dto = sysroleMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取系统角色草稿", tags = {"系统角色" }, notes = "获取系统角色草稿")
@RequestMapping(method = RequestMethod.GET, value = "/sysroles/getdraft")
public ResponseEntity<SysRoleDTO> getDraft() {
......@@ -139,7 +124,22 @@ public class SysRoleResource {
return ResponseEntity.status(HttpStatus.OK).body(sysroleService.checkKey(sysroleMapping.toDomain(sysroledto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-searchDefault-all')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-Save-all')")
@ApiOperation(value = "保存系统角色", tags = {"系统角色" }, notes = "保存系统角色")
@RequestMapping(method = RequestMethod.POST, value = "/sysroles/save")
public ResponseEntity<Boolean> save(@RequestBody SysRoleDTO sysroledto) {
return ResponseEntity.status(HttpStatus.OK).body(sysroleService.save(sysroleMapping.toDomain(sysroledto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-Save-all')")
@ApiOperation(value = "批量保存系统角色", tags = {"系统角色" }, notes = "批量保存系统角色")
@RequestMapping(method = RequestMethod.POST, value = "/sysroles/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<SysRoleDTO> sysroledtos) {
sysroleService.saveBatch(sysroleMapping.toDomain(sysroledtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-searchDefault-all') and hasPermission(#context,'ibzuaa-SysRole-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"系统角色" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/sysroles/fetchdefault")
public ResponseEntity<List<SysRoleDTO>> fetchDefault(SysRoleSearchContext context) {
......@@ -152,7 +152,7 @@ public class SysRoleResource {
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-searchDefault-all')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-searchDefault-all') and hasPermission(#context,'ibzuaa-SysRole-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"系统角色" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/sysroles/searchdefault")
public ResponseEntity<Page<SysRoleDTO>> searchDefault(@RequestBody SysRoleSearchContext context) {
......
......@@ -47,19 +47,22 @@ public class SysUserResource {
@Lazy
public SysUserMapping sysuserMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-Remove-all')")
@ApiOperation(value = "删除系统用户", tags = {"系统用户" }, notes = "删除系统用户")
@RequestMapping(method = RequestMethod.DELETE, value = "/sysusers/{sysuser_id}")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-Create-all')")
@ApiOperation(value = "新建系统用户", tags = {"系统用户" }, notes = "新建系统用户")
@RequestMapping(method = RequestMethod.POST, value = "/sysusers")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("sysuser_id") String sysuser_id) {
return ResponseEntity.status(HttpStatus.OK).body(sysuserService.remove(sysuser_id));
public ResponseEntity<SysUserDTO> create(@RequestBody SysUserDTO sysuserdto) {
SysUser domain = sysuserMapping.toDomain(sysuserdto);
sysuserService.create(domain);
SysUserDTO dto = sysuserMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-Remove-all')")
@ApiOperation(value = "批量删除系统用户", tags = {"系统用户" }, notes = "批量删除系统用户")
@RequestMapping(method = RequestMethod.DELETE, value = "/sysusers/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
sysuserService.removeBatch(ids);
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-Create-all')")
@ApiOperation(value = "批量新建系统用户", tags = {"系统用户" }, notes = "批量新建系统用户")
@RequestMapping(method = RequestMethod.POST, value = "/sysusers/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<SysUserDTO> sysuserdtos) {
sysuserService.createBatch(sysuserMapping.toDomain(sysuserdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
......@@ -83,10 +86,20 @@ public class SysUserResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "检查系统用户", tags = {"系统用户" }, notes = "检查系统用户")
@RequestMapping(method = RequestMethod.POST, value = "/sysusers/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody SysUserDTO sysuserdto) {
return ResponseEntity.status(HttpStatus.OK).body(sysuserService.checkKey(sysuserMapping.toDomain(sysuserdto)));
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-Remove-all')")
@ApiOperation(value = "删除系统用户", tags = {"系统用户" }, notes = "删除系统用户")
@RequestMapping(method = RequestMethod.DELETE, value = "/sysusers/{sysuser_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("sysuser_id") String sysuser_id) {
return ResponseEntity.status(HttpStatus.OK).body(sysuserService.remove(sysuser_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-Remove-all')")
@ApiOperation(value = "批量删除系统用户", tags = {"系统用户" }, notes = "批量删除系统用户")
@RequestMapping(method = RequestMethod.DELETE, value = "/sysusers/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
sysuserService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-Get-all')")
......@@ -98,6 +111,18 @@ public class SysUserResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取系统用户草稿", tags = {"系统用户" }, notes = "获取系统用户草稿")
@RequestMapping(method = RequestMethod.GET, value = "/sysusers/getdraft")
public ResponseEntity<SysUserDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(sysuserMapping.toDto(sysuserService.getDraft(new SysUser())));
}
@ApiOperation(value = "检查系统用户", tags = {"系统用户" }, notes = "检查系统用户")
@RequestMapping(method = RequestMethod.POST, value = "/sysusers/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody SysUserDTO sysuserdto) {
return ResponseEntity.status(HttpStatus.OK).body(sysuserService.checkKey(sysuserMapping.toDomain(sysuserdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-Save-all')")
@ApiOperation(value = "保存系统用户", tags = {"系统用户" }, notes = "保存系统用户")
@RequestMapping(method = RequestMethod.POST, value = "/sysusers/save")
......@@ -113,32 +138,7 @@ public class SysUserResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "获取系统用户草稿", tags = {"系统用户" }, notes = "获取系统用户草稿")
@RequestMapping(method = RequestMethod.GET, value = "/sysusers/getdraft")
public ResponseEntity<SysUserDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(sysuserMapping.toDto(sysuserService.getDraft(new SysUser())));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-Create-all')")
@ApiOperation(value = "新建系统用户", tags = {"系统用户" }, notes = "新建系统用户")
@RequestMapping(method = RequestMethod.POST, value = "/sysusers")
@Transactional
public ResponseEntity<SysUserDTO> create(@RequestBody SysUserDTO sysuserdto) {
SysUser domain = sysuserMapping.toDomain(sysuserdto);
sysuserService.create(domain);
SysUserDTO dto = sysuserMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-Create-all')")
@ApiOperation(value = "批量新建系统用户", tags = {"系统用户" }, notes = "批量新建系统用户")
@RequestMapping(method = RequestMethod.POST, value = "/sysusers/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<SysUserDTO> sysuserdtos) {
sysuserService.createBatch(sysuserMapping.toDomain(sysuserdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-searchDefault-all')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-searchDefault-all') and hasPermission(#context,'ibzuaa-SysUser-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"系统用户" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/sysusers/fetchdefault")
public ResponseEntity<List<SysUserDTO>> fetchDefault(SysUserSearchContext context) {
......@@ -151,7 +151,7 @@ public class SysUserResource {
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-searchDefault-all')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-searchDefault-all') and hasPermission(#context,'ibzuaa-SysUser-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"系统用户" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/sysusers/searchdefault")
public ResponseEntity<Page<SysUserDTO>> searchDefault(@RequestBody SysUserSearchContext context) {
......
package cn.ibizlab.util.security;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.SneakyThrows;
import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.domain.EntityBase;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.filter.QueryWrapperContext;
import cn.ibizlab.util.helper.DEFieldCacheMap;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.access.PermissionEvaluator;
......@@ -11,7 +14,10 @@ import org.springframework.security.core.GrantedAuthority;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import java.io.Serializable;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.*;
import java.util.function.Consumer;
/**
* spring security 权限管理类
......@@ -23,44 +29,144 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
@Value("${ibiz.enablePermissionValid:false}")
boolean enablePermissionValid; //是否开启权限校验
/**
* 实体行为鉴权
* @param authentication
* @param entity
* @param action
* 服务接口鉴权
* @param authentication 用户
* @param entity 实体
* @param action 操作
* @return
*/
@Override
@SneakyThrows
public boolean hasPermission(Authentication authentication, Object entity, Object action) {
//未开启权限校验、超级管理员则不进行权限检查
if(AuthenticationUser.getAuthenticationUser().getSuperuser()==1 || !enablePermissionValid)
if(!enablePermissionValid)
return true;
Object principal = authentication.getPrincipal();
if(ObjectUtils.isEmpty(principal))
return false;
AuthenticationUser authenticationUser= (AuthenticationUser) authentication.getPrincipal();
if(authenticationUser.getSuperuser()==1)
return true;
String strAction=String.valueOf(action);
Set<String> userAuthorities = getAuthorities(authentication,strAction);
if(userAuthorities.size()==0)
return false;
//拥有全部数据访问权限时,则跳过权限检查
if(isAllData(strAction,userAuthorities)){
return true;
}
if(entity instanceof ArrayList){
List<EntityBase> entities= (List<EntityBase>) entity;
for(EntityBase entityBase: entities){
boolean result=actionValid(entityBase, strAction ,userAuthorities);
boolean result=actionValid(entityBase, strAction ,userAuthorities,authenticationUser);
if(!result){
return false;
}
}
}
else if (entity instanceof QueryWrapperContext){
QueryWrapperContext queryWrapperContext= (QueryWrapperContext) entity;
setPermissionCondToSearchContext(getEntity(queryWrapperContext),queryWrapperContext,userAuthorities,authenticationUser);
}
else{
EntityBase entityBase= (EntityBase) entity;
return actionValid(entityBase , strAction ,userAuthorities);
return actionValid(entityBase , strAction ,userAuthorities,authenticationUser);
}
return true;
}
/**
* 获取实体信息
* @param qc
* @return
*/
@SneakyThrows
private EntityBase getEntity(QueryWrapperContext qc){
EntityBase entity=null;
Type type =qc.getClass().getGenericSuperclass();
if(type instanceof ParameterizedType){
ParameterizedType parameterizedType= (ParameterizedType) qc.getClass().getGenericSuperclass();
Type [] typeArr= parameterizedType.getActualTypeArguments();
if(typeArr.length>0){
Class<EntityBase> entityClass = (Class) typeArr[0];
return entityClass.newInstance();
}
}
return entity;
}
/**
* 在searchContext中拼接权限条件
* @param entity 实体
* @param qc 查询上下文
* @param userAuthorities 用户权限
* @param authenticationUser 当前用户
*/
@SneakyThrows
private void setPermissionCondToSearchContext(EntityBase entity, QueryWrapperContext qc , Set<String> userAuthorities ,AuthenticationUser authenticationUser){
if(entity==null)
return ;
Map<String,String> permissionField=getPermissionField(entity);//获取组织、部门预置属性
String orgField=permissionField.get("orgfield");
String orgDeptField=permissionField.get("orgsecfield");
String createManField=permissionField.get("createmanfield");
Map<String, Set<String>> userInfo = authenticationUser.getOrgInfo();
Set<String> orgParent = userInfo.get("parentorg");
Set<String> orgChild = userInfo.get("suborg");
Set<String> orgDeptParent = userInfo.get("parentdept");
Set<String> orgDeptChild = userInfo.get("subdept");
Set<String> userOrg = new HashSet<>();
Set<String> userOrgDept = new HashSet<>();
Set<String> userCreateMan = new HashSet<>();
for(String authority:userAuthorities){
if(authority.endsWith("curorg")){ //本单位
userOrg.add(authenticationUser.getOrgid());
}
else if(authority.endsWith("porg")){//上级单位
userOrg.addAll(orgParent);
}
else if(authority.endsWith("sorg")){//下级单位
userOrg.addAll(orgChild);
}
else if(authority.endsWith("curorgdept")){//本部门
userOrgDept.add(authenticationUser.getMdeptid());
}
else if(authority.endsWith("porgdept")){//上级部门
userOrgDept.addAll(orgDeptParent);
}
else if(authority.endsWith("sorgdept")){//下级部门
userOrgDept.addAll(orgDeptChild);
}
else if (authority.endsWith("createman")){
userCreateMan.add(authority);
}
}
if(userOrg.size()==0 && userOrgDept.size()==0 && userCreateMan.size()==0){
qc.getSelectCond().apply("1<>1");
}
else{
Consumer<QueryWrapper> consumer = qw -> {
if(userOrg.size()>0){
Consumer<QueryWrapper> org = orgQw -> {
orgQw.in(orgField,userOrg);
};
qw.or(org);
}
if(userOrgDept.size()>0){
Consumer<QueryWrapper> dept = deptQw -> {
deptQw.in(orgDeptField,userOrgDept);
};
qw.or(dept);
}
if(userCreateMan.size()>0){
Consumer<QueryWrapper> createMan = createManQw -> {
createManQw.eq(createManField,authenticationUser.getUserid());
};
qw.or(createMan);
}
};
qc.getSelectCond().and(consumer);
}
}
@Override
public boolean hasPermission(Authentication authentication, Serializable id, String action, Object params) {
......@@ -106,13 +212,12 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
* @param userAuthorities
* @return
*/
private boolean actionValid(EntityBase entity, String action , Set<String> userAuthorities){
private boolean actionValid(EntityBase entity, String action , Set<String> userAuthorities ,AuthenticationUser authenticationUser){
Map<String,String> permissionField=getPermissionField(entity);//获取组织、部门预置属性
String orgField=permissionField.get("orgfield");
String orgDeptField=permissionField.get("orgsecfield");
String createManField=permissionField.get("createmanfield");
AuthenticationUser authenticationUser = AuthenticationUser.getAuthenticationUser();
Map<String, Set<String>> userInfo = authenticationUser.getOrgInfo();
Set<String> orgParent = userInfo.get("parentorg");
Set<String> orgChild = userInfo.get("suborg");
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册