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

ibizdev提交

上级 94e033ea
......@@ -9,6 +9,7 @@
"label": "是",
"text": "是",
"data":"",
"codename":"Item_1",
"value": "1",
"disabled": false
......@@ -18,6 +19,7 @@
"label": "否",
"text": "否",
"data":"",
"codename":"Item_0",
"value": "0",
"disabled": false
......
......@@ -70,6 +70,7 @@ import AppFormatData from './components/app-format-data/app-format-data.vue'
import AppUploadFileInfo from './components/app-upload-file-info/app-upload-file-info.vue'
import ContextMenu from './components/context-menu/context-menu'
import AppColumnFormat from './components/app-column-format/app-column-format.vue'
import AppQuickGroup from './components/app-quick-group/app-quick-group.vue'
// 全局挂载UI实体服务注册中心
window['uiServiceRegister'] = uiServiceRegister;
......@@ -149,5 +150,6 @@ export const AppComponents = {
v.component('app-upload-file-info', AppUploadFileInfo);
v.component('context-menu',ContextMenu);
v.component('app-column-format',AppColumnFormat);
v.component('app-quick-group',AppQuickGroup);
},
};
\ No newline at end of file
.app-quick-group{
padding: 4px;
background-color: #F1F1F1;
.app-quick-item{
margin-right: 8px;
padding: 8px;
cursor: pointer;
.app-quick-item-label{
margin-left:4px;
}
.app-seleted-item{
display: inline-block;
font-weight: 700;
color: #0c64eb !important;
padding: 4px;
border-bottom: 2px solid;
}
.app-seleted-item:focus {
outline: none;
}
.app-quick-item-counter{
border-radius: 12px;
padding-left: 4px;
font-size: 12px;
font-weight: 400;
vertical-align: middle;
display: inline-block;
width: 18px;
height: 18px;
margin-left: 4px;
background-color: #ddd;
}
}
.app-quick-item :hover{
color: #0c64eb !important;
}
}
\ No newline at end of file
<template>
<div class="app-quick-group">
<span class="app-quick-item" v-for="item in renderArray" :key="item.id" @click="handleClick(item)">
<span v-if="!item.children" :style="{color:item.color}" :class="{'app-seleted-item':isSelectedItem(item)}">
<i v-if=" item.iconcls && !Object.is(item.iconcls, '')" :class="item.iconcls"></i>
<img v-else-if="item.icon && !Object.is(item.icon, '')" :src="item.icon" />
<span class="app-quick-item-label">{{item.label}}</span>
<span v-show="isSelectedItem(item) && counterService && counterService.counterData && counterService.counterData[item.codename]" class="app-quick-item-counter">{{itemTag(item)}}</span>
</span>
<el-dropdown v-if="item.children" style="outline: none !important;" trigger="click" @command="handleCommand($event,item)">
<span :style="{color:item.color}" :class="{'app-seleted-item':isSelectedItem(item)}">
<i v-if=" item.iconcls && !Object.is(item.iconcls, '')" :class="item.iconcls"></i>
<img v-else-if="item.icon && !Object.is(item.icon, '')" :src="item.icon" />
<span class="app-quick-item-label">{{item.label}}</span>
<span v-show="isSelectedItem(item) && counterService && counterService.counterData && counterService.counterData[item.codename]" class="app-quick-item-counter">{{itemTag(item)}}</span>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="childitem in item.children" :command="childitem" :key="childitem.id">
<span :style="{color:childitem.color}">
<i v-if=" childitem.iconcls && !Object.is(childitem.iconcls, '')" :class="childitem.iconcls"></i>
<img v-else-if="childitem.icon && !Object.is(childitem.icon, '')" :src="childitem.icon" />
<span :style="{color:(childitem.label == item.label)?'#0c64eb':''}">{{childitem.label}}</span>
</span>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</span>
</div>
</template>
<script lang="ts">
import { Vue, Component, Prop, Model, Emit } from "vue-property-decorator";
@Component({})
export default class AppQuickGroup extends Vue {
/**
* 传入渲染项
*
* @type {Array<any>}
* @memberof AppQuickGroup
*/
@Prop() public items!:Array<any>;
/**
* 计数器服务名
*
* @type {string}
* @memberof AppQuickGroup
*/
@Prop() public counterService?:any;
/**
* UI选中项
*
* @type {*}
* @memberof AppQuickGroup
*/
public selectedUiItem:any;
/**
* 传入渲染项
*
* @type {Array<any>}
* @memberof AppQuickGroup
*/
get renderArray(){
if(this.items && this.items.length >0){
this.selectedUiItem = this.items[0];
this.handleClick(this.items[0]);
return this.handleDataSet(this.items)
}else{
return [];
}
}
public itemTag(item:any){
if(this.counterService && this.counterService.counterData && item.codename){
return this.counterService.counterData[item.codename];
}else{
return "";
}
}
/**
* 是否选中当前项
*
* @param item 传入当前项
* @memberof AppQuickGroup
*/
public isSelectedItem(item:any){
if(this.selectedUiItem && (this.selectedUiItem.id === item.id)){
return true;
}else{
return false;
}
}
/**
* 处理代码表返回数据(树状结构)
*
* @param result 返回数组
* @memberof AppQuickGroup
*/
public handleDataSet(result:Array<any>){
let list:Array<any> = [];
if(result.length === 0){
return list;
}
result.forEach((codeItem:any) =>{
if(!codeItem.pvalue){
let valueField:string = codeItem.value;
this.setChildCodeItems(valueField,result,codeItem);
list.push(codeItem);
}
})
return list;
}
/**
* 处理非根节点数据
*
* @param pValue 父值
* @param result 返回数组
* @param codeItem 代码项
* @memberof AppQuickGroup
*/
public setChildCodeItems(pValue:string,result:Array<any>,codeItem:any){
result.forEach((item:any) =>{
if(item.pvalue == pValue){
let valueField:string = item.value;
this.setChildCodeItems(valueField,result,item);
if(!codeItem.children){
codeItem.children = [];
}
codeItem.children.push(item);
}
})
}
/**
* 处理点击事件
*
* @param $event 值
* @param isswitch 是否切换UI选中项
* @memberof AppQuickGroup
*/
public handleClick($event:any,isswitch:boolean = true){
this.$emit('valuechange',$event);
if(isswitch){
this.selectedUiItem = $event;
}
this.$forceUpdate();
}
/**
* 处理子项点击事件
*
* @param $event 值
* @param item 父值
* @memberof AppQuickGroup
*/
public handleCommand($event:any,item:any){
item.label = $event.label;
item.codename = $event.codename;
this.handleClick($event,false);
}
}
</script>
<style lang='less'>
@import "./app-quick-group.less";
</style>
\ No newline at end of file
......@@ -117,6 +117,9 @@ export default class MDViewEngine extends ViewEngine {
if (Object.is(eventName, 'load')) {
this.onSearchFormLoad(args);
}
if (Object.is(eventName, 'search')) {
this.onSearchFormLoad(args);
}
}
/**
......@@ -157,6 +160,20 @@ export default class MDViewEngine extends ViewEngine {
this.isLoadDefault = true;
}
/**
* 搜索表单搜索
*
* @param {*} [args={}]
* @memberof MDViewEngine
*/
public onSearchFormSearch(args: any = {}): void {
if (this.getMDCtrl() && this.isLoadDefault) {
const tag = this.getMDCtrl().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: this.view.viewparams });
}
this.isLoadDefault = true;
}
/**
* 处理实体界面行为
*
......@@ -372,6 +389,15 @@ export default class MDViewEngine extends ViewEngine {
if (this.view && !this.view.isExpandSearchForm) {
Object.assign(arg, { query: this.view.query });
}
// 快速分组和快速搜索栏
let otherQueryParam:any = {};
if(this.view && this.view.qucikGroupData){
Object.assign(otherQueryParam,this.view.qucikGroupData);
}
if(this.view && this.view.qucikFormData){
Object.assign(otherQueryParam,this.view.qucikFormData);
}
Object.assign(arg,{viewparams:otherQueryParam});
}
/**
......
......@@ -17,6 +17,7 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
label: '是',
text: '是',
"data":"",
"codename":"Item_1",
value: '1',
disabled: false,
......@@ -26,6 +27,7 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
label: '否',
text: '否',
"data":"",
"codename":"Item_0",
value: '0',
disabled: false,
......
......@@ -103,6 +103,7 @@
v-show="isExpandSearchForm"
loaddraftAction="FilterGetDraft"
loadAction="FilterGet"
name="searchform"
ref='searchform'
@save="searchform_save($event)"
......@@ -143,6 +144,7 @@
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils';
......@@ -152,6 +154,8 @@ import WFGroupService from '@/service/wfgroup/wfgroup-service';
import GridViewEngine from '@engine/view/grid-view-engine';
import CodeListService from "@service/app/codelist-service";
@Component({
components: {
......@@ -1449,6 +1453,7 @@ export default class WFGroupGridViewBase extends Vue {
*/
public isSingleSelect: boolean = false;
/**
* 是否嵌入关系界面
*
......
......@@ -615,6 +615,7 @@ export default class WFGroupMPickupViewBase extends Vue {
}
const removeSelect: boolean = this.viewSelections.some((selection: any) => selection._select);
this.containerModel.view_leftbtn.disabled = !removeSelect;
this.selectedData = JSON.stringify(this.viewSelections);
}
/**
......@@ -635,6 +636,7 @@ export default class WFGroupMPickupViewBase extends Vue {
});
const removeSelect: boolean = this.viewSelections.some((selection: any) => selection._select);
this.containerModel.view_leftbtn.disabled = !removeSelect;
this.selectedData = JSON.stringify(this.viewSelections);
}
/**
......@@ -647,14 +649,18 @@ export default class WFGroupMPickupViewBase extends Vue {
if (!Object.is(model.type, 'PICKUPVIEWPANEL')) {
return;
}
let newSelections:any[] = [];
model.selections.forEach((item: any) => {
const index: number = this.viewSelections.findIndex((selection: any) => Object.is(item.srfkey, selection.srfkey));
if (index === -1) {
let _item: any = { ...JSON.parse(JSON.stringify(item)) };
Object.assign(_item, { _select: false })
this.viewSelections.push(_item);
newSelections.push(_item);
}else{
newSelections.push(this.viewSelections[index]);
}
});
this.viewSelections = newSelections;
});
}
......@@ -666,6 +672,7 @@ export default class WFGroupMPickupViewBase extends Vue {
public onCLickAllLeft():void {
this.viewSelections = [];
this.containerModel.view_leftbtn.disabled = true;
this.selectedData = JSON.stringify(this.viewSelections);
}
/**
......
......@@ -11,6 +11,7 @@
v-show="isExpandSearchForm"
loaddraftAction="FilterGetDraft"
loadAction="FilterGet"
name="searchform"
ref='searchform'
@save="searchform_save($event)"
......
......@@ -103,6 +103,7 @@
v-show="isExpandSearchForm"
loaddraftAction="FilterGetDraft"
loadAction="FilterGet"
name="searchform"
ref='searchform'
@save="searchform_save($event)"
......@@ -143,6 +144,7 @@
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils';
......@@ -152,6 +154,8 @@ import WFMemberService from '@/service/wfmember/wfmember-service';
import GridViewEngine from '@engine/view/grid-view-engine';
import CodeListService from "@service/app/codelist-service";
@Component({
components: {
......@@ -1480,6 +1484,7 @@ export default class WFMemberGridViewBase extends Vue {
*/
public isSingleSelect: boolean = false;
/**
* 是否嵌入关系界面
*
......
......@@ -103,6 +103,7 @@
v-show="isExpandSearchForm"
loaddraftAction="FilterGetDraft"
loadAction="FilterGet"
name="searchform"
ref='searchform'
@save="searchform_save($event)"
......@@ -143,6 +144,7 @@
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils';
......@@ -152,6 +154,8 @@ import WFProcessDefinitionService from '@/service/wfprocess-definition/wfprocess
import GridViewEngine from '@engine/view/grid-view-engine';
import CodeListService from "@service/app/codelist-service";
@Component({
components: {
......@@ -1449,6 +1453,7 @@ export default class WFProcessDefinitionGridViewBase extends Vue {
*/
public isSingleSelect: boolean = false;
/**
* 是否嵌入关系界面
*
......
......@@ -103,6 +103,7 @@
v-show="isExpandSearchForm"
loaddraftAction="FilterGetDraft"
loadAction="FilterGet"
name="searchform"
ref='searchform'
@save="searchform_save($event)"
......@@ -143,6 +144,7 @@
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils';
......@@ -152,6 +154,8 @@ import WFUserService from '@/service/wfuser/wfuser-service';
import GridViewEngine from '@engine/view/grid-view-engine';
import CodeListService from "@service/app/codelist-service";
@Component({
components: {
......@@ -1449,6 +1453,7 @@ export default class WFUserGridViewBase extends Vue {
*/
public isSingleSelect: boolean = false;
/**
* 是否嵌入关系界面
*
......
......@@ -615,6 +615,7 @@ export default class WFUserMPickupViewBase extends Vue {
}
const removeSelect: boolean = this.viewSelections.some((selection: any) => selection._select);
this.containerModel.view_leftbtn.disabled = !removeSelect;
this.selectedData = JSON.stringify(this.viewSelections);
}
/**
......@@ -635,6 +636,7 @@ export default class WFUserMPickupViewBase extends Vue {
});
const removeSelect: boolean = this.viewSelections.some((selection: any) => selection._select);
this.containerModel.view_leftbtn.disabled = !removeSelect;
this.selectedData = JSON.stringify(this.viewSelections);
}
/**
......@@ -647,14 +649,18 @@ export default class WFUserMPickupViewBase extends Vue {
if (!Object.is(model.type, 'PICKUPVIEWPANEL')) {
return;
}
let newSelections:any[] = [];
model.selections.forEach((item: any) => {
const index: number = this.viewSelections.findIndex((selection: any) => Object.is(item.srfkey, selection.srfkey));
if (index === -1) {
let _item: any = { ...JSON.parse(JSON.stringify(item)) };
Object.assign(_item, { _select: false })
this.viewSelections.push(_item);
newSelections.push(_item);
}else{
newSelections.push(this.viewSelections[index]);
}
});
this.viewSelections = newSelections;
});
}
......@@ -666,6 +672,7 @@ export default class WFUserMPickupViewBase extends Vue {
public onCLickAllLeft():void {
this.viewSelections = [];
this.containerModel.view_leftbtn.disabled = true;
this.selectedData = JSON.stringify(this.viewSelections);
}
/**
......
......@@ -11,6 +11,7 @@
v-show="isExpandSearchForm"
loaddraftAction="FilterGetDraft"
loadAction="FilterGet"
name="searchform"
ref='searchform'
@save="searchform_save($event)"
......
......@@ -216,11 +216,16 @@
>.view-card{
>.ivu-card-body{
>.content-container{
.quick-group-container,.quick-search-container,.quick-search-input{
.quick-group-container,.quick-search-input{
float: left;
margin-top: 6px;
margin-bottom: 6px;
}
.quick-search-container{
float: left;
margin-top: -2px;
margin-bottom: 6px;
}
}
}
}
......
......@@ -700,7 +700,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('load', this.data);
this.$emit('search', this.data);
}
/**
......@@ -712,7 +712,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('load', this.data);
this.$emit('search', this.data);
}
/**
......
......@@ -581,7 +581,9 @@ export default class MainBase extends Vue implements ControlInterface {
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
Object.assign(arg,{viewparams:this.viewparams});
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.status || response.status !== 200) {
......
......@@ -31,6 +31,11 @@
.el-table {
.quick-toolbar{
display: inline-block;
button{
background: #ebf3fb;
color: #2575ca;
border: 0;
}
}
.el-tooltip{
.ivu-form-item{
......@@ -72,9 +77,6 @@
.el-table__body-wrapper{
height: calc(100% - 45px) !important;
}
.el-table__empty-block{
height: auto !important;
}
}
.ivu-modal-content{
.footer{
......@@ -85,4 +87,5 @@
}
// this is less
......@@ -700,7 +700,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('load', this.data);
this.$emit('search', this.data);
}
/**
......@@ -712,7 +712,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('load', this.data);
this.$emit('search', this.data);
}
/**
......
......@@ -567,7 +567,9 @@ export default class MainBase extends Vue implements ControlInterface {
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
Object.assign(arg,{viewparams:this.viewparams});
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.status || response.status !== 200) {
......
......@@ -31,6 +31,11 @@
.el-table {
.quick-toolbar{
display: inline-block;
button{
background: #ebf3fb;
color: #2575ca;
border: 0;
}
}
.el-tooltip{
.ivu-form-item{
......@@ -72,9 +77,6 @@
.el-table__body-wrapper{
height: calc(100% - 45px) !important;
}
.el-table__empty-block{
height: auto !important;
}
}
.ivu-modal-content{
.footer{
......@@ -85,4 +87,5 @@
}
// this is less
......@@ -728,7 +728,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('load', this.data);
this.$emit('search', this.data);
}
/**
......@@ -740,7 +740,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('load', this.data);
this.$emit('search', this.data);
}
/**
......
......@@ -611,7 +611,9 @@ export default class MainBase extends Vue implements ControlInterface {
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
Object.assign(arg,{viewparams:this.viewparams});
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.status || response.status !== 200) {
......
......@@ -31,6 +31,11 @@
.el-table {
.quick-toolbar{
display: inline-block;
button{
background: #ebf3fb;
color: #2575ca;
border: 0;
}
}
.el-tooltip{
.ivu-form-item{
......@@ -72,9 +77,6 @@
.el-table__body-wrapper{
height: calc(100% - 45px) !important;
}
.el-table__empty-block{
height: auto !important;
}
}
.ivu-modal-content{
.footer{
......@@ -85,4 +87,5 @@
}
// this is less
......@@ -700,7 +700,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('load', this.data);
this.$emit('search', this.data);
}
/**
......@@ -712,7 +712,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
if (!this.formValidateStatus()) {
return;
}
this.$emit('load', this.data);
this.$emit('search', this.data);
}
/**
......
......@@ -581,7 +581,9 @@ export default class MainBase extends Vue implements ControlInterface {
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
Object.assign(arg,{viewparams:this.viewparams});
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.status || response.status !== 200) {
......
......@@ -31,6 +31,11 @@
.el-table {
.quick-toolbar{
display: inline-block;
button{
background: #ebf3fb;
color: #2575ca;
border: 0;
}
}
.el-tooltip{
.ivu-form-item{
......@@ -72,9 +77,6 @@
.el-table__body-wrapper{
height: calc(100% - 45px) !important;
}
.el-table__empty-block{
height: auto !important;
}
}
.ivu-modal-content{
.footer{
......@@ -85,4 +87,5 @@
}
// this is less
......@@ -37,11 +37,6 @@
git clone -b master $para2 ibzwf/
export NODE_OPTIONS=--max-old-space-size=4096
cd ibzwf/
mvn clean package -Papi
cd ibzwf-provider/ibzwf-provider-api
mvn -Papi docker:build
mvn -Papi docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzwf-provider-api.yaml ibzlab-rt --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
......
......@@ -31,7 +31,6 @@ public class webSecurityConfig extends WebSecurityConfigurerAdapter {
private AuthenticationEntryPoint unauthorizedHandler;
@Autowired
@Qualifier("IBZUAAUserService")
private AuthenticationUserService userDetailsService;
/**
......
......@@ -27,6 +27,7 @@ import java.util.List;
@MapperScan("cn.ibizlab.*.mapper")
@SpringBootApplication(exclude = {
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class,
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class,
})
public class webApplication extends WebMvcConfigurerAdapter{
......
......@@ -32,5 +32,9 @@ zuul:
path: /wfcore/**
serviceId: ibzwf-api
stripPrefix: true
loginv7:
path: /v7/login
serviceId: ibzuaa-api
stripPrefix: false
sensitive-headers:
- Cookie,Set-Cookie,Authorization
......@@ -15,8 +15,10 @@ import java.util.List;
@EnableDiscoveryClient
@Configuration
@EnableTransactionManagement
@SpringBootApplication
@EnableFeignClients(basePackages = {"cn.ibizlab" })
@SpringBootApplication(exclude = {
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class,
})
public class DevBootApplication extends WebMvcConfigurerAdapter{
public static void main(String[] args) {
......
......@@ -30,7 +30,6 @@ public class DevBootSecurityConfig extends WebSecurityConfigurerAdapter {
private AuthenticationEntryPoint unauthorizedHandler;
@Autowired
@Qualifier("IBZUAAUserService")
private AuthenticationUserService userDetailsService;
/**
......
......@@ -3,48 +3,6 @@
],
"predefineddatarange":[{"id":"ALL","name":"全部数据"},{"id":"CURORG","name":"当前单位"},{"id":"PORG","name":"上级单位"},{"id":"SORG","name":"下级单位"},{"id":"CURORGDEPT","name":"当前部门"},{"id":"PORGDEPT","name":"上级部门"},{"id":"SORGDEPT","name":"下级部门"}],
"entities":[
{
"dename":"WFREModel",
"delogicname":"流程模型",
"sysmoudle":{"id":"WORKFLOW","name":"workflow"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" }]
}
, {
"dename":"WFMember",
"delogicname":"成员",
"sysmoudle":{"id":"WORKFLOW","name":"workflow"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" }]
}
, {
"dename":"WFGroup",
"delogicname":"角色/用户组",
"sysmoudle":{"id":"WORKFLOW","name":"workflow"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" }]
}
, {
"dename":"WFUser",
"delogicname":"用户",
"sysmoudle":{"id":"WORKFLOW","name":"workflow"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" }]
}
, {
"dename":"WFProcessDefinition",
"delogicname":"流程定义",
"sysmoudle":{"id":"WORKFLOW","name":"workflow"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" }]
}
, {
"dename":"WFSystem",
"delogicname":"系统",
"sysmoudle":{"id":"WORKFLOW","name":"workflow"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" }]
}
]
}
......@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBZ_SLEEP}s..." && \
sleep ${IBZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzwf-provider-api.jar
EXPOSE 40003
EXPOSE 8081
ADD ibzwf-provider-api.jar /ibzwf-provider-api.jar
......@@ -3,11 +3,9 @@ services:
ibzwf-provider-api:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/ibzwf-provider-api:latest
ports:
- "40003:40003"
- "8081:8081"
networks:
- agent_network
environment:
SPRING_CLOUD_NACOS_DISCOVERY_IP: 172.16.180.237
deploy:
mode: replicated
replicas: 1
......
......@@ -31,7 +31,6 @@ public class apiSecurityConfig extends WebSecurityConfigurerAdapter {
private AuthenticationEntryPoint unauthorizedHandler;
@Autowired
@Qualifier("IBZUAAUserService")
private AuthenticationUserService userDetailsService;
/**
......
......@@ -23,6 +23,7 @@ import java.util.List;
@MapperScan("cn.ibizlab.*.mapper")
@SpringBootApplication(exclude = {
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class,
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class,
})
@EnableFeignClients(basePackages = {"cn.ibizlab" })
public class ibzwfapiApplication extends WebMvcConfigurerAdapter{
......
server:
port: 40003
\ No newline at end of file
port: 8081
\ No newline at end of file
......@@ -32,7 +32,7 @@ public class PermissionSyncJob implements ApplicationRunner {
@Value("${ibiz.enablePermissionValid:false}")
boolean enablePermissionValid; //是否开启权限校验
@Value("${ibiz.systemid:2C40DFCD-0DF5-47BF-91A5-C45F810B0001}")
@Value("${ibiz.systemid:ibzwf}")
private String systemId;
@Override
......
......@@ -15,9 +15,11 @@ import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@RestController
@RequestMapping("/")
@ConditionalOnProperty( name = "ibiz.enablePermissionValid", havingValue = "false")
public class AuthenticationController
{
......@@ -28,7 +30,6 @@ public class AuthenticationController
private AuthTokenUtil jwtTokenUtil;
@Autowired
@Qualifier("IBZUAAUserService")
private AuthenticationUserService userDetailsService;
@PostMapping(value = "${ibiz.auth.path:v7/login}")
......
......@@ -48,6 +48,7 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
private String keyFieldTag="keyfield";
@Resource
@Lazy
private MongoTemplate mongoTemplate;
/**
......@@ -115,8 +116,6 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
if(!validDataSetHasPermission(permissionList,entityName,dataSetName)){
return false;
}
//拼接权限条件
deDataSetFillPermissionSQLRouter(deStorageMode, searchContext, entity , dataSetName , permissionList);
}
return true;
}
......@@ -344,80 +343,6 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
}
}
/**
* 根据实体存储类型,拼接权限条件
* @param deStorageMode
* @param searchContext
* @param entity
* @param dataSetName
* @param permissionList
*/
private void deDataSetFillPermissionSQLRouter(String deStorageMode , Object searchContext, EntityBase entity ,String dataSetName ,JSONObject permissionList){
//检查是否有数据权限[单行删除]
if(deStorageMode.equalsIgnoreCase("sql")){
sqlPermissionBuilder(searchContext, entity , dataSetName, permissionList);
}
else if(deStorageMode.equalsIgnoreCase("nosql")){
noSqlPermissionBuilder(searchContext, entity , dataSetName, permissionList);
}
else if(deStorageMode.equalsIgnoreCase("serviceapi")){
}
else {
throw new RuntimeException(String.format("未能识别[%s]实体对应存储模式[%s]",entity.getClass().getSimpleName(),deStorageMode));
}
}
/**
* 为NoSQL存储模式的表格查询填充权限条件
* @param searchContext
* @param entity
* @param dataSetName
* @param permissionList
*/
private void noSqlPermissionBuilder(Object searchContext, EntityBase entity, String dataSetName, JSONObject permissionList) {
if(searchContext instanceof QueryBuildContext){
//获取权限表达式[全部数据、本单位、本部门等]
String entityName=entity.getClass().getSimpleName();
JSONObject entityObj=permissionList.getJSONObject(entityName);
JSONObject permissionType=entityObj.getJSONObject(DataSetTag);
JSONArray dataRange=permissionType.getJSONArray(dataSetName);
if(dataRange.size()==0)
return ;
//根据权限表达式生成查询条件,并将查询条件设置到SearchContext中
fillNoSqlPermissionCond(dataRange,entity,((QueryBuildContext) searchContext).getSelectCond());
}
}
/**
* 为SQL存储模式的表格查询填充权限条件
* @param searchContext
* @param entity
* @param dataSetName
* @param permissionList
*/
private void sqlPermissionBuilder(Object searchContext, EntityBase entity, String dataSetName, JSONObject permissionList){
//获取权限表达式[全部数据、本单位、本部门等]
String entityName=entity.getClass().getSimpleName();
JSONObject entityObj=permissionList.getJSONObject(entityName);//获取实体
JSONObject permissionType=entityObj.getJSONObject(DataSetTag);
JSONArray dataRange=permissionType.getJSONArray(dataSetName);//获取实体数据集
if(dataRange.size()==0)
return ;
//根据权限条件获取SQL
String permissionSQL=getPermissionSQL(entity,dataRange);
//将SQL拼接到SearchContext中
if(searchContext instanceof QueryWrapperContext){
QueryWrapperContext queryWrapperContext = (QueryWrapperContext) searchContext;
QueryWrapper queryWrapper = queryWrapperContext.getSelectCond();
queryWrapper.apply(permissionSQL);
}
}
/**
* 为NoSQL存储模式的表格查询填充权限条件
......
......@@ -27,7 +27,7 @@ public class AuthorizationTokenFilter extends OncePerRequestFilter {
private final AuthTokenUtil authTokenUtil;
private final String tokenHeader;
public AuthorizationTokenFilter(@Qualifier("IBZUAAUserService") AuthenticationUserService userDetailsService, AuthTokenUtil authTokenUtil, @Value("${ibiz.jwt.header:Authorization}") String tokenHeader) {
public AuthorizationTokenFilter(AuthenticationUserService userDetailsService, AuthTokenUtil authTokenUtil, @Value("${ibiz.jwt.header:Authorization}") String tokenHeader) {
this.userDetailsService = userDetailsService;
this.authTokenUtil = authTokenUtil;
this.tokenHeader = tokenHeader;
......
......@@ -12,11 +12,13 @@ import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils;
import org.springframework.util.StringUtils;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
/**
* 实体[IBZUSER] 服务对象接口实现
*/
@Service("IBZUAAUserService")
@ConditionalOnExpression("${ibiz.enablePermissionValid:false}||'${ibiz.auth.service:SimpleUserService}'.equals('IBZUAAUserService')")
public class IBZUAAUserService implements AuthenticationUserService{
@Autowired
......
......@@ -13,11 +13,13 @@ import cn.ibizlab.util.mapper.IBZUSERMapper;
import cn.ibizlab.util.domain.IBZUSER;
import org.springframework.util.DigestUtils;
import org.springframework.util.StringUtils;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
/**
* 实体[IBZUSER] 服务对象接口实现
*/
@Service("IBZUSERService")
@ConditionalOnExpression("(!${ibiz.enablePermissionValid:false})&&'${ibiz.auth.service:SimpleUserService}'.equals('IBZUSERService')")
public class IBZUSERServiceImpl extends ServiceImpl<IBZUSERMapper, IBZUSER> implements IBZUSERService,AuthenticationUserService{
@Value("${ibiz.auth.pwencrymode:0}")
......
......@@ -11,12 +11,14 @@ import org.springframework.util.StringUtils;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
/**
* 实体[IBZUSER] 服务对象接口实现
*/
@Primary
@Service("SimpleUserService")
@ConditionalOnExpression("(!${ibiz.enablePermissionValid:false})&&'${ibiz.auth.service:SimpleUserService}'.equals('SimpleUserService')")
public class SimpleUserService implements AuthenticationUserService{
@Override
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册