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

ibiz4j 发布系统代码 [ibz-disk,存储]

上级 c519de88
......@@ -13,7 +13,7 @@
<template v-else>
<i v-if="isFirst" class='fa fa-cogs app-menu-icon'></i>
</template>
<span ref="circleText" :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name}`)">{{$t(`app.menus.${ctrlName}.${item.name}`)}}</span>
<span ref="circleText" :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)">{{$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)}}</span>
</template>
<app-menu-item :isCollapse="isCollapse" :menus="item.items" :ctrlName="ctrlName" :isFirst="false" :counterdata="counterdata" :popper-class="popperClass"></app-menu-item>
</el-submenu>
......@@ -23,18 +23,18 @@
<el-menu-item :class="[{'isFirst' : isFirst},item.textcls]" v-show="!item.hidden" :index="item.name" :key="item.id">
<template v-if="item.icon && item.icon != ''">
<img :src="item.icon" class='app-menu-icon' />
<span v-if="(isFirst && isCollapse) ? true : false" ref="circleText" :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name}`)">{{$t(`app.menus.${ctrlName}.${item.name}`)}}</span>
<span v-if="(isFirst && isCollapse) ? true : false" ref="circleText" :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)">{{$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)}}</span>
</template>
<template v-else-if="item.iconcls && item.iconcls != ''">
<i :class="[item.iconcls, 'app-menu-icon']"></i>
<span v-if="(isFirst && isCollapse) ? true : false" ref="circleText" :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name}`)">{{$t(`app.menus.${ctrlName}.${item.name}`)}}</span>
<span v-if="(isFirst && isCollapse) ? true : false" ref="circleText" :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)">{{$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)}}</span>
</template>
<template v-else>
<i v-if="isFirst" class='fa fa-cogs app-menu-icon'></i>
<span v-if="(isFirst && isCollapse) ? true : false" ref="circleText" :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name}`)">{{$t(`app.menus.${ctrlName}.${item.name}`)}}</span>
<span v-if="(isFirst && isCollapse) ? true : false" ref="circleText" :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)">{{$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)}}</span>
</template>
<template slot="title">
<span :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name}`)">{{$t(`app.menus.${ctrlName}.${item.name}`)}}</span>
<span :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)">{{$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)}}</span>
<template v-if="counterdata && counterdata[item.counterid] && counterdata[item.counterid] > 0">
<span class="pull-right">
<badge :count="counterdata[item.counterid]" :overflow-count="9999"></badge>
......
......@@ -8,7 +8,7 @@
<img :src="item.iconcls" v-else-if="!Object.is(item.iconcls, '')" />
<i class="fa fa-cogs" v-else></i>
</span>
<span>{{$t(`app.menus.${ctrlName}.${item.name}`)}}</span>
<span>{{$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)}}</span>
<span class="line"></span>
</p>
<p style=" display: 'flex' ">
......@@ -37,7 +37,7 @@
<img :src="item.iconcls" v-else-if="!Object.is(item.iconcls, '')" />
<i class="fa fa-cogs" v-else></i>
</span>
<h4>{{$t(`app.menus.${ctrlName}.${item.name}`)}}</h4>
<h4>{{$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)}}</h4>
</div>
</card>
</template>
......
......@@ -9,14 +9,6 @@ import GridViewEngine from './grid-view-engine';
*/
export default class GridView8Engine extends GridViewEngine {
/**
* 表格部件
*
* @type {*}
* @memberof GridView8Engine
*/
protected grid: any;
/**
* 表格部件
*
......
......@@ -31,6 +31,8 @@ function getAppLocale(){
nomore:"དེ་ལས་མང་བ་མི་འདུག",
other:"གཞན་དག",
valueNotEmpty:"སྟོང་མི་ཆོག",
createFailed:"གསར་འཛུགས་ཕམ་པ།",
isExist:"གནས་པ་",
},
local:{
new: "གསར་འཛུགས།",
......
......@@ -31,6 +31,8 @@ function getAppLocale(){
nomore:"No more",
other:"other",
valueNotEmpty:"The value cannot be null",
createFailed:"Create Failed",
isExist:"Exist",
},
local:{
new: "New",
......
......@@ -31,6 +31,8 @@ function getAppLocale(){
nomore:"没有更多了",
other:"其他",
valueNotEmpty:"值不能为空",
createFailed:"创建失败",
isExist:"已存在",
},
local:{
new: "新建",
......
......@@ -87,16 +87,16 @@ mock.onDelete(new RegExp(/^\/metadynamicmodels\/batch$/)).reply((config: any) =>
});
// Select
mock.onGet(new RegExp(/^\/metadynamicmodels\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:metadynamicmodel 方法: Select");
// CheckKey
mock.onPost(new RegExp(/^\/metadynamicmodels\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:metadynamicmodel 方法: 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> = ['configid'];
const matchArray:any = new RegExp(/^\/metadynamicmodels\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
const matchArray:any = new RegExp(/^\/metadynamicmodels\/([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) => {
......@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/metadynamicmodels\/([a-zA-Z0-9\-\;]{1,35})\/select$/))
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.configid, tempValue.configid));
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.configid, tempValue.configid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['configid'] == tempValue['configid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, _items];
return [status, data];
});
// Create
......@@ -141,44 +151,6 @@ mock.onPost(new RegExp(/^\/metadynamicmodels\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply
return [status, mockDatas[0]];
});
// Update
mock.onPut(new RegExp(/^\/metadynamicmodels\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:metadynamicmodel 方法: 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> = ['configid'];
const matchArray:any = new RegExp(/^\/metadynamicmodels\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.configid, tempValue.configid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['configid'] == tempValue['configid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/metadynamicmodels\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:metadynamicmodel 方法: GetDraft");
......@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/metadynamicmodels\/getdraft$/)).reply((config: any) =>
return [status, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/metadynamicmodels\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:metadynamicmodel 方法: CheckKey");
// Init
mock.onPost(new RegExp(/^\/metadynamicmodels\/?([a-zA-Z0-9\-\;]{0,35})\/init$/)).reply((config: any) => {
console.groupCollapsed("实体:metadynamicmodel 方法: Init");
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> = ['configid'];
const matchArray:any = new RegExp(/^\/metadynamicmodels\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/metadynamicmodels\/([a-zA-Z0-9\-\;]{1,35})\/init$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/metadynamicmodels\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey
return [status, data];
});
// Init
mock.onPost(new RegExp(/^\/metadynamicmodels\/?([a-zA-Z0-9\-\;]{0,35})\/init$/)).reply((config: any) => {
console.groupCollapsed("实体:metadynamicmodel 方法: Init");
// Publish
mock.onPost(new RegExp(/^\/metadynamicmodels\/?([a-zA-Z0-9\-\;]{0,35})\/publish$/)).reply((config: any) => {
console.groupCollapsed("实体:metadynamicmodel 方法: Publish");
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> = ['configid'];
const matchArray:any = new RegExp(/^\/metadynamicmodels\/([a-zA-Z0-9\-\;]{1,35})\/init$/).exec(config.url);
const matchArray:any = new RegExp(/^\/metadynamicmodels\/([a-zA-Z0-9\-\;]{1,35})\/publish$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -271,16 +243,16 @@ mock.onPost(new RegExp(/^\/metadynamicmodels\/?([a-zA-Z0-9\-\;]{0,35})\/init$/))
return [status, data];
});
// Publish
mock.onPost(new RegExp(/^\/metadynamicmodels\/?([a-zA-Z0-9\-\;]{0,35})\/publish$/)).reply((config: any) => {
console.groupCollapsed("实体:metadynamicmodel 方法: Publish");
// Save
mock.onPost(new RegExp(/^\/metadynamicmodels\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:metadynamicmodel 方法: 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> = ['configid'];
const matchArray:any = new RegExp(/^\/metadynamicmodels\/([a-zA-Z0-9\-\;]{1,35})\/publish$/).exec(config.url);
const matchArray:any = new RegExp(/^\/metadynamicmodels\/([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) => {
......@@ -309,16 +281,16 @@ mock.onPost(new RegExp(/^\/metadynamicmodels\/?([a-zA-Z0-9\-\;]{0,35})\/publish$
return [status, data];
});
// Save
mock.onPost(new RegExp(/^\/metadynamicmodels\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:metadynamicmodel 方法: Save");
// Update
mock.onPut(new RegExp(/^\/metadynamicmodels\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:metadynamicmodel 方法: 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> = ['configid'];
const matchArray:any = new RegExp(/^\/metadynamicmodels\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/metadynamicmodels\/([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) => {
......@@ -442,10 +414,38 @@ mock.onGet(new RegExp(/^\/metadynamicmodels\/fetchdynainst(\?[\w-./?%&=,]*)*$/))
// URI参数传递情况未实现
// URI参数传递情况未实现
// Select
mock.onGet(new RegExp(/^\/metadynamicmodels\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:metadynamicmodel 方法: Select");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['configid'];
const matchArray:any = new RegExp(/^\/metadynamicmodels\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.configid, tempValue.configid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Remove
mock.onDelete(new RegExp(/^\/metadynamicmodels\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:metadynamicmodel 方法: Remove");
// Get
mock.onGet(new RegExp(/^\/metadynamicmodels\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:metadynamicmodel 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -471,9 +471,9 @@ mock.onDelete(new RegExp(/^\/metadynamicmodels\/([a-zA-Z0-9\-\;]{1,35})$/)).repl
return [status, _items?_items:{}];
});
// Get
mock.onGet(new RegExp(/^\/metadynamicmodels\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:metadynamicmodel 方法: Get");
// Remove
mock.onDelete(new RegExp(/^\/metadynamicmodels\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:metadynamicmodel 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......
......@@ -87,16 +87,16 @@ mock.onDelete(new RegExp(/^\/sdfiles\/batch$/)).reply((config: any) => {
});
// Select
mock.onGet(new RegExp(/^\/sdfiles\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:sdfile 方法: Select");
// CheckKey
mock.onPost(new RegExp(/^\/sdfiles\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:sdfile 方法: 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> = ['id'];
const matchArray:any = new RegExp(/^\/sdfiles\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
const matchArray:any = new RegExp(/^\/sdfiles\/([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) => {
......@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/sdfiles\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((co
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, _items];
return [status, data];
});
// Create
......@@ -141,44 +151,6 @@ mock.onPost(new RegExp(/^\/sdfiles\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
return [status, mockDatas[0]];
});
// Update
mock.onPut(new RegExp(/^\/sdfiles\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sdfile 方法: 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(/^\/sdfiles\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/sdfiles\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sdfile 方法: GetDraft");
......@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/sdfiles\/getdraft$/)).reply((config: any) => {
return [status, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/sdfiles\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:sdfile 方法: CheckKey");
// Save
mock.onPost(new RegExp(/^\/sdfiles\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:sdfile 方法: 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(/^\/sdfiles\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/sdfiles\/([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) => {
......@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/sdfiles\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply
return [status, data];
});
// Save
mock.onPost(new RegExp(/^\/sdfiles\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:sdfile 方法: Save");
// Update
mock.onPut(new RegExp(/^\/sdfiles\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sdfile 方法: 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(/^\/sdfiles\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/sdfiles\/([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) => {
......@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/sdfiles\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((con
// URI参数传递情况未实现
// URI参数传递情况未实现
// Select
mock.onGet(new RegExp(/^\/sdfiles\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:sdfile 方法: Select");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/sdfiles\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Remove
mock.onDelete(new RegExp(/^\/sdfiles\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sdfile 方法: Remove");
// Get
mock.onGet(new RegExp(/^\/sdfiles\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sdfile 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/sdfiles\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config:
return [status, _items?_items:{}];
});
// Get
mock.onGet(new RegExp(/^\/sdfiles\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sdfile 方法: Get");
// Remove
mock.onDelete(new RegExp(/^\/sdfiles\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sdfile 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......
......@@ -39,7 +39,7 @@ export default class MetaDynamicModelServiceBase extends EntityService {
// 实体接口
/**
* Select接口方法
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -47,9 +47,8 @@ export default class MetaDynamicModelServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof MetaDynamicModelServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().get(`/metadynamicmodels/${context.metadynamicmodel}/select`,isloading);
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/metadynamicmodels/${context.metadynamicmodel}/checkkey`,data,isloading);
return res;
}
......@@ -78,37 +77,6 @@ export default class MetaDynamicModelServiceBase extends EntityService {
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MetaDynamicModelServiceBase
*/
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(`/metadynamicmodels/${context.metadynamicmodel}`,data,isloading);
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MetaDynamicModelServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().delete(`/metadynamicmodels/${context.metadynamicmodel}`,isloading);
return res;
}
/**
* Get接口方法
*
......@@ -140,20 +108,6 @@ export default class MetaDynamicModelServiceBase extends EntityService {
return res;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MetaDynamicModelServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/metadynamicmodels/${context.metadynamicmodel}/checkkey`,data,isloading);
return res;
}
/**
* Init接口方法
*
......@@ -210,6 +164,20 @@ export default class MetaDynamicModelServiceBase extends EntityService {
return await Http.getInstance().post(`/metadynamicmodels/publishbatch`,tempData,isloading);
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MetaDynamicModelServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().delete(`/metadynamicmodels/${context.metadynamicmodel}`,isloading);
return res;
}
/**
* Save接口方法
*
......@@ -227,6 +195,23 @@ export default class MetaDynamicModelServiceBase extends EntityService {
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MetaDynamicModelServiceBase
*/
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(`/metadynamicmodels/${context.metadynamicmodel}`,data,isloading);
return res;
}
/**
* FetchDefault接口方法
*
......@@ -284,4 +269,19 @@ export default class MetaDynamicModelServiceBase extends EntityService {
let tempData:any = JSON.parse(JSON.stringify(data));
return await Http.getInstance().post(`/metadynamicmodels/searchdynainst`,tempData,isloading);
}
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MetaDynamicModelServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().get(`/metadynamicmodels/${context.metadynamicmodel}/select`,isloading);
return res;
}
}
\ No newline at end of file
......@@ -39,7 +39,7 @@ export default class SDFileServiceBase extends EntityService {
// 实体接口
/**
* Select接口方法
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -47,9 +47,8 @@ export default class SDFileServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SDFileServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().get(`/sdfiles/${context.sdfile}/select`,isloading);
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/sdfiles/${context.sdfile}/checkkey`,data,isloading);
return res;
}
......@@ -78,7 +77,7 @@ export default class SDFileServiceBase extends EntityService {
}
/**
* Update接口方法
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -86,30 +85,14 @@ export default class SDFileServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SDFileServiceBase
*/
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(`/sdfiles/${context.sdfile}`,data,isloading);
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/sdfiles/${context.sdfile}`,isloading);
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SDFileServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().delete(`/sdfiles/${context.sdfile}`,isloading);
return res;
}
/**
* Get接口方法
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -117,14 +100,15 @@ export default class SDFileServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SDFileServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/sdfiles/${context.sdfile}`,isloading);
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/sdfiles/getdraft`,isloading);
res.data.sdfile = data.sdfile;
return res;
}
/**
* GetDraft接口方法
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -132,15 +116,13 @@ export default class SDFileServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SDFileServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/sdfiles/getdraft`,isloading);
res.data.sdfile = data.sdfile;
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().delete(`/sdfiles/${context.sdfile}`,isloading);
return res;
}
/**
* CheckKey接口方法
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -148,13 +130,16 @@ export default class SDFileServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SDFileServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/sdfiles/${context.sdfile}/checkkey`,data,isloading);
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(`/sdfiles/${context.sdfile}/save`,data,isloading);
return res;
}
/**
* Save接口方法
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -162,10 +147,10 @@ export default class SDFileServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof SDFileServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/sdfiles/${context.sdfile}/save`,data,isloading);
let res:any = await Http.getInstance().put(`/sdfiles/${context.sdfile}`,data,isloading);
return res;
}
......@@ -198,4 +183,19 @@ export default class SDFileServiceBase extends EntityService {
let tempData:any = JSON.parse(JSON.stringify(data));
return await Http.getInstance().post(`/sdfiles/searchdefault`,tempData,isloading);
}
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SDFileServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().get(`/sdfiles/${context.sdfile}/select`,isloading);
return res;
}
}
\ No newline at end of file
......@@ -23,7 +23,7 @@
<template v-else>
<i class='fa fa-cogs app-menu-icon'></i>
</template>
<span class='text' :title="$t('app.menus.sdindexview.' + item0.name)">{{$t('app.menus.sdindexview.' + item0.name)}}</span>
<span class='text' :title="$t('app.menus.sdindexview.' + item0.name.toLowerCase())">{{$t('app.menus.sdindexview.' + item0.name.toLowerCase())}}</span>
</template>
<template v-for="item1 in item0.items">
<template v-if="item1.items && Array.isArray(item1.items) && item1.items.length > 0">
......@@ -35,7 +35,7 @@
<template v-else-if="item1.iconcls && item1.iconcls != ''">
<i :class="[item1.iconcls, 'app-menu-icon']"></i>
</template>
<span class='text' :title="$t('app.menus.sdindexview.' + item1.name)">{{$t('app.menus.sdindexview.' + item1.name)}}</span>
<span class='text' :title="$t('app.menus.sdindexview.' + item1.name.toLowerCase())">{{$t('app.menus.sdindexview.' + item1.name.toLowerCase())}}</span>
</template>
<template v-for="item2 in item1.items">
<template v-if="item2.type =='MENUITEM'">
......@@ -47,7 +47,7 @@
<i :class="[item2.iconcls, 'app-menu-icon']"></i>
</template>
<template slot="title">
<span class="text" :title="$t('app.menus.sdindexview.' + item2.name)">{{$t('app.menus.sdindexview.' + item2.name)}}</span>
<span class="text" :title="$t('app.menus.sdindexview.' + item2.name.toLowerCase())">{{$t('app.menus.sdindexview.' + item2.name.toLowerCase())}}</span>
<template v-if="counterdata && counterdata[item2.counterid] && counterdata[item2.counterid] > 0">
<span class="pull-right">
<badge :count="counterdata[item2.counterid]" :overflow-count="9999"></badge>
......@@ -69,7 +69,7 @@
<i :class="[item1.iconcls, 'app-menu-icon']"></i>
</template>
<template slot="title">
<span class="text" :title="$t('app.menus.sdindexview.' + item1.name)">{{$t('app.menus.sdindexview.' + item1.name)}} </span>
<span class="text" :title="$t('app.menus.sdindexview.' + item1.name.toLowerCase())">{{$t('app.menus.sdindexview.' + item1.name.toLowerCase())}} </span>
<template v-if="counterdata && counterdata[item1.counterid] && counterdata[item1.counterid] > 0">
<span class="pull-right">
<badge :count="counterdata[item1.counterid]" :overflow-count="9999"></badge>
......@@ -95,7 +95,7 @@
<i class='fa fa-cogs app-menu-icon'></i>
</template>
<template slot="title">
<span class="text" :title="$t('app.menus.sdindexview.' + item0.name)">{{$t('app.menus.sdindexview.' + item0.name)}}</span>
<span class="text" :title="$t('app.menus.sdindexview.' + item0.name.toLowerCase())">{{$t('app.menus.sdindexview.' + item0.name.toLowerCase())}}</span>
<template v-if="counterdata && counterdata[item0.counterid] && counterdata[item0.counterid] > 0">
<span class="pull-right">
<badge :count="counterdata[item0.counterid]" :overflow-count="9999"></badge>
......
......@@ -634,8 +634,8 @@ export default class DefaultBase extends Vue implements ControlInterface {
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
......
......@@ -868,8 +868,8 @@ export default class MainBase extends Vue implements ControlInterface {
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
......@@ -919,7 +919,7 @@ export default class MainBase extends Vue implements ControlInterface {
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data && response.data.message ? response.data.message : "" });
});
}
......@@ -1004,7 +1004,7 @@ export default class MainBase extends Vue implements ControlInterface {
resolve(response);
}).catch((response: any) => {
if (response && response.status != 200) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.message});
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data && response.data.message ? response.data.message : "" });
return;
}
if (!response || !response.status || !response.data) {
......@@ -1125,6 +1125,9 @@ export default class MainBase extends Vue implements ControlInterface {
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
let tempViewParams:any = parentdata.viewparams?parentdata.viewparams:{};
Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams)));
Object.assign(arg,{viewparams:tempViewParams});
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response || response.status !== 200) {
......@@ -1997,8 +2000,8 @@ export default class MainBase extends Vue implements ControlInterface {
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction, JSON.parse(JSON.stringify(this.context)), args[0], this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
......
......@@ -670,8 +670,8 @@ export default class DefaultBase extends Vue implements ControlInterface {
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
......
......@@ -992,8 +992,8 @@ export default class MainBase extends Vue implements ControlInterface {
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
......@@ -1043,7 +1043,7 @@ export default class MainBase extends Vue implements ControlInterface {
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data && response.data.message ? response.data.message : "" });
});
}
......@@ -1128,7 +1128,7 @@ export default class MainBase extends Vue implements ControlInterface {
resolve(response);
}).catch((response: any) => {
if (response && response.status != 200) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.message});
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data && response.data.message ? response.data.message : "" });
return;
}
if (!response || !response.status || !response.data) {
......@@ -1249,6 +1249,9 @@ export default class MainBase extends Vue implements ControlInterface {
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
let tempViewParams:any = parentdata.viewparams?parentdata.viewparams:{};
Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams)));
Object.assign(arg,{viewparams:tempViewParams});
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response || response.status !== 200) {
......@@ -2137,8 +2140,8 @@ export default class MainBase extends Vue implements ControlInterface {
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction, JSON.parse(JSON.stringify(this.context)), args[0], this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
......
......@@ -77,6 +77,32 @@
<workingDirectory>../../app_web</workingDirectory>
</configuration>
</execution>
<execution>
<id>prepare</id>
<configuration>
<executable>cp</executable>
<arguments>
<argument>../../${project.artifactId}.jar</argument>
<argument>${project.basedir}/src/main/docker/</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>buildpush</id>
<configuration>
<executable>docker</executable>
<arguments>
<argument>buildx</argument>
<argument>build</argument>
<argument>--platform</argument>
<argument>linux/amd64,linux/arm64</argument>
<argument>-t</argument>
<argument>${docker.image.prefix}/${project.artifactId}:latest</argument>
<argument>${project.basedir}/src/main/docker</argument>
<argument>--push</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
......
FROM openjdk:8-jre-alpine
FROM adoptopenjdk/openjdk8:jdk8u242-b08-centos
ENV TZ=Asia/Shanghai \
SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
......
......@@ -7,14 +7,6 @@ logging:
#zuul网关路由设置
zuul:
routes:
meta_dynamicmodel:
path: /metadynamicmodels/**
serviceId: ${ibiz.ref.service.ibzdisk-api:ibzdisk-api}
stripPrefix: false
sd_file:
path: /sdfiles/**
serviceId: ${ibiz.ref.service.ibzdisk-api:ibzdisk-api}
stripPrefix: false
loginv7:
path: /v7/login
serviceId: ${ibiz.ref.service.uaa:ibzuaa-api}
......@@ -71,5 +63,13 @@ zuul:
path: /sysauthlogs
serviceId: ${ibiz.ref.service.uaa:ibzuaa-api}
stripPrefix: false
meta_dynamicmodel:
path: /metadynamicmodels/**
serviceId: ${ibiz.ref.service.ibzdisk-api:ibzdisk-api}
stripPrefix: false
sd_file:
path: /sdfiles/**
serviceId: ${ibiz.ref.service.ibzdisk-api:ibzdisk-api}
stripPrefix: false
sensitive-headers:
- Cookie,Set-Cookie,Authorization
......@@ -132,7 +132,7 @@ public class SDFile extends EntityMP implements Serializable {
/**
* 创建人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@DEField(name = "createman", preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman", fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
......
package cn.ibizlab.core.util.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
/**
* 通用配置类
*/
@Configuration
public class CommonAutoConfig {
@Value("${jbpm.enable.multi.con:true}")
private String flag;
/**
* 处理逻辑节点支持多来源配置
*/
@Component
public class InstallSystemParamsCommandLineRunner implements CommandLineRunner {
@Override
public void run(String... var1){
System.setProperty("jbpm.enable.multi.con", flag);
}
}
}
......@@ -4,7 +4,7 @@
<!--输出实体[META_DYNAMICMODEL]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-meta_dynamicmodel-4-1">
<changeSet author="root" id="tab-meta_dynamicmodel-4-1">
<createTable tableName="IBZDYNAMICMODEL">
<column name="DYNAINSTID" remarks="" type="VARCHAR(100)">
</column>
......@@ -27,7 +27,7 @@
<!--输出实体[META_DYNAMICMODEL]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-meta_dynamicmodel-4-2">
<changeSet author="root" id="fk-meta_dynamicmodel-4-2">
<addForeignKeyConstraint baseColumnNames="PDYNAINSTID" baseTableName="IBZDYNAMICMODEL" constraintName="DER1N_META_DYNAMICMODEL_META_D" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CONFIGID" referencedTableName="IBZDYNAMICMODEL" validate="true"/>
</changeSet>
......
......@@ -74,6 +74,40 @@
</resources>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>prepare</id>
<configuration>
<executable>cp</executable>
<arguments>
<argument>../../${project.artifactId}.jar</argument>
<argument>${project.basedir}/src/main/docker/</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>buildpush</id>
<configuration>
<executable>docker</executable>
<arguments>
<argument>buildx</argument>
<argument>build</argument>
<argument>--platform</argument>
<argument>linux/amd64,linux/arm64</argument>
<argument>-t</argument>
<argument>${docker.image.prefix}/${project.artifactId}:latest</argument>
<argument>${project.basedir}/src/main/docker</argument>
<argument>--push</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
......
FROM openjdk:8-jre-alpine
FROM adoptopenjdk/openjdk8:jdk8u242-b08-centos
ENV TZ=Asia/Shanghai \
SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
......
......@@ -65,25 +65,15 @@ public class MetaDynamicModelResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzdisk-MetaDynamicModel-Update-all')")
@ApiOperation(value = "更新动态模型", tags = {"动态模型" }, notes = "更新动态模型")
@RequestMapping(method = RequestMethod.PUT, value = "/metadynamicmodels/{metadynamicmodel_id}")
public ResponseEntity<MetaDynamicModelDTO> update(@PathVariable("metadynamicmodel_id") String metadynamicmodel_id, @RequestBody MetaDynamicModelDTO metadynamicmodeldto) {
MetaDynamicModel domain = metadynamicmodelMapping.toDomain(metadynamicmodeldto);
domain .setConfigid(metadynamicmodel_id);
metadynamicmodelService.update(domain );
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzdisk-MetaDynamicModel-Get-all')")
@ApiOperation(value = "获取动态模型", tags = {"动态模型" }, notes = "获取动态模型")
@RequestMapping(method = RequestMethod.GET, value = "/metadynamicmodels/{metadynamicmodel_id}")
public ResponseEntity<MetaDynamicModelDTO> get(@PathVariable("metadynamicmodel_id") String metadynamicmodel_id) {
MetaDynamicModel domain = metadynamicmodelService.get(metadynamicmodel_id);
MetaDynamicModelDTO dto = metadynamicmodelMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzdisk-MetaDynamicModel-Update-all')")
@ApiOperation(value = "批量更新动态模型", tags = {"动态模型" }, notes = "批量更新动态模型")
@RequestMapping(method = RequestMethod.PUT, value = "/metadynamicmodels/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<MetaDynamicModelDTO> metadynamicmodeldtos) {
metadynamicmodelService.updateBatch(metadynamicmodelMapping.toDomain(metadynamicmodeldtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzdisk-MetaDynamicModel-Remove-all')")
@ApiOperation(value = "删除动态模型", tags = {"动态模型" }, notes = "删除动态模型")
@RequestMapping(method = RequestMethod.DELETE, value = "/metadynamicmodels/{metadynamicmodel_id}")
......@@ -99,20 +89,23 @@ public class MetaDynamicModelResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzdisk-MetaDynamicModel-Get-all')")
@ApiOperation(value = "获取动态模型", tags = {"动态模型" }, notes = "获取动态模型")
@RequestMapping(method = RequestMethod.GET, value = "/metadynamicmodels/{metadynamicmodel_id}")
public ResponseEntity<MetaDynamicModelDTO> get(@PathVariable("metadynamicmodel_id") String metadynamicmodel_id) {
MetaDynamicModel domain = metadynamicmodelService.get(metadynamicmodel_id);
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzdisk-MetaDynamicModel-Update-all')")
@ApiOperation(value = "更新动态模型", tags = {"动态模型" }, notes = "更新动态模型")
@RequestMapping(method = RequestMethod.PUT, value = "/metadynamicmodels/{metadynamicmodel_id}")
public ResponseEntity<MetaDynamicModelDTO> update(@PathVariable("metadynamicmodel_id") String metadynamicmodel_id, @RequestBody MetaDynamicModelDTO metadynamicmodeldto) {
MetaDynamicModel domain = metadynamicmodelMapping.toDomain(metadynamicmodeldto);
domain .setConfigid(metadynamicmodel_id);
metadynamicmodelService.update(domain );
MetaDynamicModelDTO dto = metadynamicmodelMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取动态模型草稿", tags = {"动态模型" }, notes = "获取动态模型草稿")
@RequestMapping(method = RequestMethod.GET, value = "/metadynamicmodels/getdraft")
public ResponseEntity<MetaDynamicModelDTO> getDraft(MetaDynamicModelDTO dto) {
MetaDynamicModel domain = metadynamicmodelMapping.toDomain(dto);
return ResponseEntity.status(HttpStatus.OK).body(metadynamicmodelMapping.toDto(metadynamicmodelService.getDraft(domain)));
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzdisk-MetaDynamicModel-Update-all')")
@ApiOperation(value = "批量更新动态模型", tags = {"动态模型" }, notes = "批量更新动态模型")
@RequestMapping(method = RequestMethod.PUT, value = "/metadynamicmodels/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<MetaDynamicModelDTO> metadynamicmodeldtos) {
metadynamicmodelService.updateBatch(metadynamicmodelMapping.toDomain(metadynamicmodeldtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "检查动态模型", tags = {"动态模型" }, notes = "检查动态模型")
......@@ -121,6 +114,13 @@ public class MetaDynamicModelResource {
return ResponseEntity.status(HttpStatus.OK).body(metadynamicmodelService.checkKey(metadynamicmodelMapping.toDomain(metadynamicmodeldto)));
}
@ApiOperation(value = "获取动态模型草稿", tags = {"动态模型" }, notes = "获取动态模型草稿")
@RequestMapping(method = RequestMethod.GET, value = "/metadynamicmodels/getdraft")
public ResponseEntity<MetaDynamicModelDTO> getDraft(MetaDynamicModelDTO dto) {
MetaDynamicModel domain = metadynamicmodelMapping.toDomain(dto);
return ResponseEntity.status(HttpStatus.OK).body(metadynamicmodelMapping.toDto(metadynamicmodelService.getDraft(domain)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzdisk-MetaDynamicModel-Init-all')")
@ApiOperation(value = "初始化副本实例", tags = {"动态模型" }, notes = "初始化副本实例")
@RequestMapping(method = RequestMethod.POST, value = "/metadynamicmodels/{metadynamicmodel_id}/init")
......
......@@ -65,26 +65,15 @@ public class SDFileResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "sdfile" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.sdfileService.get(#sdfile_id),'ibzdisk-SDFile-Update')")
@ApiOperation(value = "更新文件", tags = {"文件" }, notes = "更新文件")
@RequestMapping(method = RequestMethod.PUT, value = "/sdfiles/{sdfile_id}")
public ResponseEntity<SDFileDTO> update(@PathVariable("sdfile_id") String sdfile_id, @RequestBody SDFileDTO sdfiledto) {
SDFile domain = sdfileMapping.toDomain(sdfiledto);
domain .setId(sdfile_id);
sdfileService.update(domain );
@PostAuthorize("hasPermission(this.sdfileMapping.toDomain(returnObject.body),'ibzdisk-SDFile-Get')")
@ApiOperation(value = "获取文件", tags = {"文件" }, notes = "获取文件")
@RequestMapping(method = RequestMethod.GET, value = "/sdfiles/{sdfile_id}")
public ResponseEntity<SDFileDTO> get(@PathVariable("sdfile_id") String sdfile_id) {
SDFile domain = sdfileService.get(sdfile_id);
SDFileDTO dto = sdfileMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.sdfileService.getSdfileByEntities(this.sdfileMapping.toDomain(#sdfiledtos)),'ibzdisk-SDFile-Update')")
@ApiOperation(value = "批量更新文件", tags = {"文件" }, notes = "批量更新文件")
@RequestMapping(method = RequestMethod.PUT, value = "/sdfiles/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<SDFileDTO> sdfiledtos) {
sdfileService.updateBatch(sdfileMapping.toDomain(sdfiledtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.sdfileService.get(#sdfile_id),'ibzdisk-SDFile-Remove')")
@ApiOperation(value = "删除文件", tags = {"文件" }, notes = "删除文件")
@RequestMapping(method = RequestMethod.DELETE, value = "/sdfiles/{sdfile_id}")
......@@ -100,20 +89,24 @@ public class SDFileResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.sdfileMapping.toDomain(returnObject.body),'ibzdisk-SDFile-Get')")
@ApiOperation(value = "获取文件", tags = {"文件" }, notes = "获取文件")
@RequestMapping(method = RequestMethod.GET, value = "/sdfiles/{sdfile_id}")
public ResponseEntity<SDFileDTO> get(@PathVariable("sdfile_id") String sdfile_id) {
SDFile domain = sdfileService.get(sdfile_id);
@VersionCheck(entity = "sdfile" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.sdfileService.get(#sdfile_id),'ibzdisk-SDFile-Update')")
@ApiOperation(value = "更新文件", tags = {"文件" }, notes = "更新文件")
@RequestMapping(method = RequestMethod.PUT, value = "/sdfiles/{sdfile_id}")
public ResponseEntity<SDFileDTO> update(@PathVariable("sdfile_id") String sdfile_id, @RequestBody SDFileDTO sdfiledto) {
SDFile domain = sdfileMapping.toDomain(sdfiledto);
domain .setId(sdfile_id);
sdfileService.update(domain );
SDFileDTO dto = sdfileMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取文件草稿", tags = {"文件" }, notes = "获取文件草稿")
@RequestMapping(method = RequestMethod.GET, value = "/sdfiles/getdraft")
public ResponseEntity<SDFileDTO> getDraft(SDFileDTO dto) {
SDFile domain = sdfileMapping.toDomain(dto);
return ResponseEntity.status(HttpStatus.OK).body(sdfileMapping.toDto(sdfileService.getDraft(domain)));
@PreAuthorize("hasPermission(this.sdfileService.getSdfileByEntities(this.sdfileMapping.toDomain(#sdfiledtos)),'ibzdisk-SDFile-Update')")
@ApiOperation(value = "批量更新文件", tags = {"文件" }, notes = "批量更新文件")
@RequestMapping(method = RequestMethod.PUT, value = "/sdfiles/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<SDFileDTO> sdfiledtos) {
sdfileService.updateBatch(sdfileMapping.toDomain(sdfiledtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "检查文件", tags = {"文件" }, notes = "检查文件")
......@@ -122,6 +115,13 @@ public class SDFileResource {
return ResponseEntity.status(HttpStatus.OK).body(sdfileService.checkKey(sdfileMapping.toDomain(sdfiledto)));
}
@ApiOperation(value = "获取文件草稿", tags = {"文件" }, notes = "获取文件草稿")
@RequestMapping(method = RequestMethod.GET, value = "/sdfiles/getdraft")
public ResponseEntity<SDFileDTO> getDraft(SDFileDTO dto) {
SDFile domain = sdfileMapping.toDomain(dto);
return ResponseEntity.status(HttpStatus.OK).body(sdfileMapping.toDto(sdfileService.getDraft(domain)));
}
@PreAuthorize("hasPermission(this.sdfileMapping.toDomain(#sdfiledto),'ibzdisk-SDFile-Save')")
@ApiOperation(value = "保存文件", tags = {"文件" }, notes = "保存文件")
@RequestMapping(method = RequestMethod.POST, value = "/sdfiles/save")
......
......@@ -28,9 +28,11 @@ import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.expression.spel.support.StandardEvaluationContext;
import org.springframework.stereotype.Component;
import org.springframework.util.ClassUtils;
import org.springframework.util.DigestUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.core.annotation.Order;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamReader;
......@@ -51,6 +53,7 @@ import java.util.concurrent.ConcurrentMap;
@Aspect
@Component
@Slf4j
@Order(100)
public class DELogicAspect {
private static BpmnXMLConverter bpmnXMLConverter = new BpmnXMLConverter();
......@@ -80,7 +83,7 @@ public class DELogicAspect {
if(!ObjectUtils.isEmpty(entity)) {
String id = DEFieldCacheMap.getDEKeyField(entity.getClass());
if(StringUtils.isEmpty(id)) {
log.debug("无法获取实体主键属性[{}]",entity.getClass().getSimpleName());
log.debug("无法获取实体主键属性[{}]",getEntityName(entity));
return point.proceed();
}
entity.set(id, arg);
......@@ -101,6 +104,17 @@ public class DELogicAspect {
return point.proceed();
}
/**
* 判断类是否被代理类代理
*/
private String getEntityName(Object entity){
String entityName = entity.getClass().getSimpleName();
if(entityName.contains("$$")){
entityName = ClassUtils.getUserClass(entity.getClass()).getSimpleName();
}
return entityName;
}
/**
* 前附加逻辑
*
......@@ -108,7 +122,7 @@ public class DELogicAspect {
* @param action
*/
private void executeBeforeLogic(EntityBase entity, String action) {
Resource bpmnFile = getLocalModel(entity.getClass().getSimpleName(), action, LogicExecMode.BEFORE);
Resource bpmnFile = getLocalModel(getEntityName(entity), action, LogicExecMode.BEFORE);
if (bpmnFile != null && bpmnFile.exists() && isValid(bpmnFile, entity, action)) {
executeLogic(bpmnFile, entity, action);
}
......@@ -121,7 +135,7 @@ public class DELogicAspect {
* @param action
*/
private void executeAfterLogic(EntityBase entity, String action) {
Resource bpmnFile = getLocalModel(entity.getClass().getSimpleName(), action, LogicExecMode.AFTER);
Resource bpmnFile = getLocalModel(getEntityName(entity), action, LogicExecMode.AFTER);
if (bpmnFile != null && bpmnFile.exists() && isValid(bpmnFile, entity, action)) {
executeLogic(bpmnFile, entity, action);
}
......@@ -134,7 +148,7 @@ public class DELogicAspect {
* @param action
*/
private void executeLogic(EntityBase entity, String action) {
Resource bpmnFile = getLocalModel(entity.getClass().getSimpleName(), action, LogicExecMode.EXEC);
Resource bpmnFile = getLocalModel(getEntityName(entity), action, LogicExecMode.EXEC);
if (bpmnFile != null && bpmnFile.exists() && isValid(bpmnFile, entity, action)) {
executeLogic(bpmnFile, entity, action);
}
......@@ -148,7 +162,7 @@ public class DELogicAspect {
*/
private void executeLogic(Resource bpmnFile, Object entity, String action) {
try {
log.debug("开始执行实体处理逻辑[{}:{}:{}:本地模式]", entity.getClass().getSimpleName(), action, bpmnFile.getFilename());
log.debug("开始执行实体处理逻辑[{}:{}:{}:本地模式]", getEntityName(entity), action, bpmnFile.getFilename());
String bpmnId = DigestUtils.md5DigestAsHex(bpmnFile.getURL().getPath().getBytes());
DELogic logic = getDELogic(bpmnFile);
if (logic == null) {
......@@ -172,9 +186,9 @@ public class DELogicAspect {
}
}
kieSession.startProcess(mainProcess.getId());
log.debug("实体处理逻辑[{}:{}:{}:本地模式]执行结束", entity.getClass().getSimpleName(), action, bpmnFile.getFilename());
} catch (IOException e) {
log.error("实体处理逻辑[{}:{}:{}:本地模式]发生异常", entity.getClass().getSimpleName(), action, bpmnFile.getFilename());
log.debug("实体处理逻辑[{}:{}:{}:本地模式]执行结束", getEntityName(entity), action, bpmnFile.getFilename());
} catch (Exception e) {
log.error("实体处理逻辑[{}:{}:{}:本地模式]发生异常", getEntityName(entity), action, bpmnFile.getFilename());
throw new BadRequestAlertException("执行实体处理逻辑发生异常" + e.getMessage(), "DELogicAspect", "executeLogic");
}
}
......@@ -414,7 +428,7 @@ public class DELogicAspect {
* @return
*/
private boolean isValid(Resource bpmn, Object entity, Object action) {
String logicId = String.format("%s%s%s", entity.getClass().getSimpleName(), action, bpmn.getFilename()).toLowerCase();
String logicId = String.format("%s%s%s", getEntityName(entity), action, bpmn.getFilename()).toLowerCase();
if (validLogic.containsKey(logicId)) {
return true;
} else {
......
package cn.ibizlab.util.cache.cache;
import cn.ibizlab.util.helper.Globs;
import org.springframework.cache.caffeine.CaffeineCache;
import com.github.benmanes.caffeine.cache.Cache;
import javax.validation.constraints.NotNull;
import java.util.Set;
import java.util.stream.Collectors;
/**
* 自定义的Caffeine缓存
*/
public class CusCaffeineCache extends CaffeineCache{
public CusCaffeineCache(String name, Cache<Object, Object> cache) {
super(name,cache);
}
public CusCaffeineCache(String name, Cache<Object, Object> cache, boolean allowNullValues) {
super(name,cache,allowNullValues);
}
@Override
public void evict(@NotNull Object key) {
if (key instanceof String && ((String) key).startsWith("glob:")) {
String globPattern = ((String)key).split("glob:")[1];
// 将Glob匹配转换成正则匹配
String regexPattern = Globs.toUnixRegexPattern(globPattern);
// String regexPattern = Globs.toWindowsRegexPattern(globPattern);
Cache<Object,Object> cache = super.getNativeCache();
Set<Object> keySet = cache.asMap().keySet();
keySet = keySet.stream().filter(o->o.toString().matches(regexPattern)).collect(Collectors.toSet());
cache.invalidateAll(keySet);
}else{
super.evict(key);
}
}
}
......@@ -4,6 +4,8 @@ import org.springframework.data.redis.cache.RedisCache;
import org.springframework.data.redis.cache.RedisCacheConfiguration;
import org.springframework.data.redis.cache.RedisCacheWriter;
import javax.validation.constraints.NotNull;
/**
* 自定义的redis缓存
*/
......@@ -12,4 +14,18 @@ public class CusRedisCache extends RedisCache {
public CusRedisCache(String name, RedisCacheWriter redisCacheWriter, RedisCacheConfiguration configuration) {
super(name, redisCacheWriter, configuration);
}
@Override
public void evict(@NotNull Object key) {
if (key instanceof String && ((String) key).startsWith("glob:")) {
String globPattern = ((String)key).split("glob:")[1];
byte[] globPatternBytes = super.getCacheConfiguration().getConversionService().convert(globPattern,byte[].class);
if(globPatternBytes!=null){
super.getNativeCache().clean(super.getName(),globPatternBytes);
}
}else{
super.evict(key);
}
}
}
......@@ -15,6 +15,7 @@ import java.util.Collections;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.TimeUnit;
import cn.ibizlab.util.cache.cache.CusCaffeineCache;
import cn.ibizlab.util.cache.cache.CusRedisCache;
import cn.ibizlab.util.cache.cache.LayeringCache;
......@@ -80,7 +81,7 @@ public class LayeringCacheManager implements CacheManager {
* @return
*/
protected Cache createCache(String cacheName) {
return new LayeringCache(cacheName,new CaffeineCache(cacheName, this.cacheBuilder.build(), true),new CusRedisCache(cacheName, redisCacheWriter, redisConfiguration),redisTemplate);
return new LayeringCache(cacheName,new CusCaffeineCache(cacheName, this.cacheBuilder.build(), true),new CusRedisCache(cacheName, redisCacheWriter, redisConfiguration),redisTemplate);
}
/**
......
......@@ -17,4 +17,6 @@ public class DELogic implements Serializable {
List<DELogic> refLogic;
List<Resource> refRuleFiles;
String md5;
int logicMode;
long loadedTime;
}
......@@ -43,5 +43,21 @@ public enum DEFieldDefaultValueType {
/**
* 默认值
*/
NONE
NONE,
/**
* 用户自定义
*/
USER,
/**
* 用户自定义2
*/
USER2,
/**
* 用户自定义3
*/
USER3,
/**
* 用户自定义4
*/
USER4
}
......@@ -55,5 +55,17 @@ public enum DEPredefinedFieldType {
/**
* 不处理
*/
NONE
NONE,
/**
* 动态父类型
*/
PARENTTYPE,
/**
* 动态父标识
*/
PARENTID,
/**
* 动态父名称
*/
PARENTNAME
}
......@@ -9,6 +9,8 @@ import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.multipart.MaxUploadSizeExceededException;
import org.zalando.problem.DefaultProblem;
import org.zalando.problem.Problem;
import org.zalando.problem.ProblemBuilder;
......@@ -105,4 +107,31 @@ public class ExceptionTranslator implements ProblemHandling {
headers.add("X-ibz-params", entityName);
return headers;
}
/**
* 上传文件大小超出限制异常
*/
@Value("${spring.servlet.multipart.max-file-size}")
private String maxFileSize;
@ExceptionHandler(MaxUploadSizeExceededException.class)
public ResponseEntity<Problem> handlerMaxUploadFile(MaxUploadSizeExceededException ex,NativeWebRequest request){
Problem problem = Problem.builder()
.withStatus(Status.BAD_REQUEST)
.withDetail("上传文件不能大于"+maxFileSize)
.with("message", "上传文件不能大于"+maxFileSize)
.with("exmessage",""+ex.getMessage())
.build();
return create(ex, problem, request);
}
@ExceptionHandler(Exception.class)
public ResponseEntity<Problem> handlerTest(Exception ex,NativeWebRequest request){
Problem problem = Problem.builder()
.withStatus(Status.INTERNAL_SERVER_ERROR)
.withDetail("内部服务器异常")
.with("message", "内部服务器异常")
.with("exmessage",""+ex.getMessage())
.build();
return create(ex, problem, request);
}
}
......@@ -67,6 +67,11 @@ public class SearchContextBase implements ISearchContext{
* 工作流流程标识
*/
public String processDefinitionKey;
/**
* 工作流标识
*/
@JsonProperty("srfwf")
public String srfWF;
/**
* 获取工作流步骤标识
......
package cn.ibizlab.util.helper;
import java.util.regex.PatternSyntaxException;
/**
* Copy from class sun.nio.fs.Globs
*/
public class Globs {
private Globs() { }
private static final String regexMetaChars = ".^$+{[]|()";
private static final String globMetaChars = "\\*?[{";
private static boolean isRegexMeta(char c) {
return regexMetaChars.indexOf(c) != -1;
}
private static boolean isGlobMeta(char c) {
return globMetaChars.indexOf(c) != -1;
}
private static char EOL = 0; //TBD
private static char next(String glob, int i) {
if (i < glob.length()) {
return glob.charAt(i);
}
return EOL;
}
/**
* Creates a regex pattern from the given glob expression.
*
* @throws PatternSyntaxException
*/
private static String toRegexPattern(String globPattern, boolean isDos) {
boolean inGroup = false;
StringBuilder regex = new StringBuilder("^");
int i = 0;
while (i < globPattern.length()) {
char c = globPattern.charAt(i++);
switch (c) {
case '\\':
// escape special characters
if (i == globPattern.length()) {
throw new PatternSyntaxException("No character to escape",
globPattern, i - 1);
}
char next = globPattern.charAt(i++);
if (isGlobMeta(next) || isRegexMeta(next)) {
regex.append('\\');
}
regex.append(next);
break;
case '/':
if (isDos) {
regex.append("\\\\");
} else {
regex.append(c);
}
break;
case '[':
// don't match name separator in class
if (isDos) {
regex.append("[[^\\\\]&&[");
} else {
regex.append("[[^/]&&[");
}
if (next(globPattern, i) == '^') {
// escape the regex negation char if it appears
regex.append("\\^");
i++;
} else {
// negation
if (next(globPattern, i) == '!') {
regex.append('^');
i++;
}
// hyphen allowed at start
if (next(globPattern, i) == '-') {
regex.append('-');
i++;
}
}
boolean hasRangeStart = false;
char last = 0;
while (i < globPattern.length()) {
c = globPattern.charAt(i++);
if (c == ']') {
break;
}
if (c == '/' || (isDos && c == '\\')) {
throw new PatternSyntaxException("Explicit 'name separator' in class",
globPattern, i - 1);
}
// TBD: how to specify ']' in a class?
if (c == '\\' || c == '[' ||
c == '&' && next(globPattern, i) == '&') {
// escape '\', '[' or "&&" for regex class
regex.append('\\');
}
regex.append(c);
if (c == '-') {
if (!hasRangeStart) {
throw new PatternSyntaxException("Invalid range",
globPattern, i - 1);
}
if ((c = next(globPattern, i++)) == EOL || c == ']') {
break;
}
if (c < last) {
throw new PatternSyntaxException("Invalid range",
globPattern, i - 3);
}
regex.append(c);
hasRangeStart = false;
} else {
hasRangeStart = true;
last = c;
}
}
if (c != ']') {
throw new PatternSyntaxException("Missing ']", globPattern, i - 1);
}
regex.append("]]");
break;
case '{':
if (inGroup) {
throw new PatternSyntaxException("Cannot nest groups",
globPattern, i - 1);
}
regex.append("(?:(?:");
inGroup = true;
break;
case '}':
if (inGroup) {
regex.append("))");
inGroup = false;
} else {
regex.append('}');
}
break;
case ',':
if (inGroup) {
regex.append(")|(?:");
} else {
regex.append(',');
}
break;
case '*':
if (next(globPattern, i) == '*') {
// crosses directory boundaries
regex.append(".*");
i++;
} else {
// within directory boundary
if (isDos) {
regex.append("[^\\\\]*");
} else {
regex.append("[^/]*");
}
}
break;
case '?':
if (isDos) {
regex.append("[^\\\\]");
} else {
regex.append("[^/]");
}
break;
default:
if (isRegexMeta(c)) {
regex.append('\\');
}
regex.append(c);
}
}
if (inGroup) {
throw new PatternSyntaxException("Missing '}", globPattern, i - 1);
}
return regex.append('$').toString();
}
public static String toUnixRegexPattern(String globPattern) {
return toRegexPattern(globPattern, false);
}
public static String toWindowsRegexPattern(String globPattern) {
return toRegexPattern(globPattern, true);
}
}
......@@ -282,20 +282,24 @@ public class RuleUtils
}
else if (finalObject instanceof Integer)
{
return (((Integer) finalObject).intValue() < ((Integer)exp).intValue());
return Integer.parseInt(finalObject.toString()) < Integer.parseInt(exp.toString());
}
else if (finalObject instanceof Double)
{
return (((Double) finalObject).doubleValue() < ((Double)exp).doubleValue());
return Double.parseDouble(finalObject.toString()) < Double.parseDouble(exp.toString());
}
else if (finalObject instanceof Float)
{
return (((Float) finalObject).floatValue() < ((Float)exp).floatValue());
return Float.parseFloat(finalObject.toString()) < Float.parseFloat(exp.toString());
}
else if (finalObject instanceof String)
{
return finalObject.toString().compareToIgnoreCase(exp.toString())<0;
}
else if (finalObject instanceof Long)
{
return Long.parseLong(finalObject.toString()) < Long.parseLong(exp.toString());
}
else
return false;
}
......
......@@ -12,6 +12,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import java.util.*;
@RestController
......@@ -95,6 +96,26 @@ public class AppController {
return ResponseEntity.ok(ibzConfigService.getConfig(configType,targetType,userId));
}
@RequestMapping(method = RequestMethod.GET, value = "/configs/share/{id}")
public ResponseEntity<JSONObject> getShareConfig(@PathVariable("id") String id) {
JSONObject jo = ibzConfigService.getShareConfig(id);
if (jo == null) {
throw new BadRequestAlertException("无效的共享配置数据", "IBZConfig", id);
}
return ResponseEntity.ok(jo);
}
@RequestMapping(method = RequestMethod.GET, value = "/configs/share/{configType}/{targetType}")
public ResponseEntity<String> shareConfig(@PathVariable("configType") String configType, @PathVariable("targetType") String targetType) {
String userId = AuthenticationUser.getAuthenticationUser().getUserid();
if (StringUtils.isEmpty(userId)) {
throw new BadRequestAlertException("分享配置失败,参数缺失", "IBZConfig", configType);
}
String id = IdWorker.get32UUID();
ibzConfigService.saveShareConfig(id, configType, targetType, userId);
return ResponseEntity.ok(id);
}
/**
* 应用参数扩展
* @param appData
......
......@@ -13,6 +13,7 @@ import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import java.io.Serializable;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
......@@ -300,9 +301,10 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
Map <String, DEField> preFields= DEFieldCacheMap.getDEFields(entityBase.getClass()); //从缓存中获取当前类预置属性
for (Map.Entry<String,DEField> entry : preFields.entrySet()){
String fieldName=entry.getKey();//获取注解字段
DEField fieldAnnotation=entry.getValue();//获取注解值
String fieldName=fieldAnnotation.name();//获取注解字段
DEPredefinedFieldType prefieldType=fieldAnnotation.preType();
if(!StringUtils.isEmpty(fieldName)){
//用户配置系统预置属性-组织机构标识
if(prefieldType==prefieldType.ORGID){
orgField=fieldName;
......@@ -316,6 +318,7 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
createManField=fieldName;
}
}
}
permissionFiled.put("orgfield",orgField);
permissionFiled.put("orgsecfield",orgDeptField);
permissionFiled.put("createmanfield",createManField);
......
......@@ -20,7 +20,7 @@ public class AuthenticationEntryPoint implements org.springframework.security.we
/**
* 当用户尝试访问安全的REST资源而不提供任何凭据时,将调用此方法发送401 响应
*/
response.sendError(HttpServletResponse.SC_UNAUTHORIZED, authException==null?"Unauthorized":authException.getMessage());
response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "账号身份已过期,请重新登录。");
}
......
......@@ -9,6 +9,10 @@ import java.io.Serializable;
@AllArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class AuthenticationInfo implements Serializable {
private final String token;
private final AuthenticationUser user;
private String token;
private AuthenticationUser user;
public AuthenticationInfo() {
}
}
......@@ -260,7 +260,6 @@ public class AuthenticationUser implements UserDetails
{
sessionParams = getUserSessionParam();
sessionParams.put("srfsystemid",this.getSrfsystemid());
sessionParams.put("srfdynainstid",this.getSrfdynainstid());
sessionParams.put("srfpersonid", this.getUserid());
sessionParams.put("srfpersonname", this.getPersonname());
sessionParams.put("srforgsectorid", this.getMdeptid());
......
......@@ -24,7 +24,7 @@ public interface AuthenticationUserService extends UserDetailsService {
@Cacheable( value="ibzuaa_users", key = "'getByUsername:'+#p0")
AuthenticationUser loadUserByLogin(String username,String password);
@CacheEvict( value="ibzuaa_users", key = "'getByUsername:'+#p0")
@CacheEvict( value="ibzuaa_users", key = "'glob:*getByUsername:'+#p0")
default void resetByUsername(String username){}
......
......@@ -64,4 +64,14 @@ public class IBZConfigService extends ServiceImpl<IBZConfigMapper, IBZConfig> im
this.remove(Wrappers.query(IBZConfig.builder().systemId(systemId).cfgType(cfgType).targetType(targetType).userId(userId).build()));
}
@Cacheable(value="ibzrt_shareconfigs",key = "'cfgid:'+#p0")
public JSONObject saveShareConfig(String id, String cfgType,String targetType,String userId){
return this.getConfig(cfgType, targetType, userId);
}
@Cacheable(value="ibzrt_shareconfigs",key = "'cfgid:'+#p0")
public JSONObject getShareConfig(String id){
return null;
}
}
\ No newline at end of file
package cn.ibizlab.util.web;
import cn.ibizlab.util.filter.SearchContextBase;
import cn.ibizlab.util.domain.DTOBase;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.MethodParameter;
......@@ -24,7 +25,7 @@ public class SearchContextHandlerMethodArgumentResolver implements HandlerMethod
@Override
public boolean supportsParameter(MethodParameter parameter) {
return SearchContextBase.class.isAssignableFrom(parameter.getParameterType());
return SearchContextBase.class.isAssignableFrom(parameter.getParameterType()) || DTOBase.class.isAssignableFrom(parameter.getParameterType());
}
@Override
......@@ -35,7 +36,7 @@ public class SearchContextHandlerMethodArgumentResolver implements HandlerMethod
for (String key : params.keySet()) {
set.put(key,params.get(key)[0]);
}
if((!set.containsKey("size")) ){
if(SearchContextBase.class.isAssignableFrom(parameter.getParameterType()) && (!set.containsKey("size"))){
set.put("size", pageLimit);
}
String json = objectMapper.writeValueAsString(set);
......
......@@ -23,7 +23,7 @@ spring:
datasource:
username: a_A_5d9d78509
password: '@6dEfb3@'
url: jdbc:mysql://172.16.180.232:3306/a_A_5d9d78509?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true
url: jdbc:mysql://172.16.180.232:3306/a_A_5d9d78509?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true&serverTimezone=GMT%2B8
driver-class-name: com.mysql.jdbc.Driver
isSyncDBSchema: false
defaultSchema: a_A_5d9d78509
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册