Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzou
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzou
提交
8c0fedf9
提交
8c0fedf9
编写于
5月 22, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lab_qyk 发布系统代码
上级
2a3f1b78
变更
7
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
101 行增加
和
9 行删除
+101
-9
state.ts
app_web/src/store/modules/view-action/state.ts
+1
-0
main-form-base.vue
...eb/src/widgets/ibzdepartment/main-form/main-form-base.vue
+32
-2
main-form-service.ts
.../src/widgets/ibzdepartment/main-form/main-form-service.ts
+12
-0
IBZDepartmentResource.java
.../main/java/cn/ibizlab/api/rest/IBZDepartmentResource.java
+2
-2
IBZEmployeeResource.java
...rc/main/java/cn/ibizlab/api/rest/IBZEmployeeResource.java
+4
-4
IBZOrganizationResource.java
...ain/java/cn/ibizlab/api/rest/IBZOrganizationResource.java
+1
-1
AuthPermissionEvaluator.java
...ava/cn/ibizlab/util/security/AuthPermissionEvaluator.java
+49
-0
未找到文件。
app_web/src/store/modules/view-action/state.ts
浏览文件 @
8c0fedf9
...
...
@@ -55,6 +55,7 @@ export const viewstate: any = {
viewaction
:
''
,
viewdatachange
:
false
,
refviews
:
[
'9e25d15d43ff644fa008c9cf7d063ac3'
,
'b59db4df07430a34645566a64d59244c'
,
],
},
...
...
app_web/src/widgets/ibzdepartment/main-form/main-form-base.vue
浏览文件 @
8c0fedf9
...
...
@@ -42,7 +42,26 @@
</i-col>
<i-col
v-show=
"detailsModel.orgname.visible"
:style=
"
{}" :lg="{ span: 24, offset: 0 }">
<app-form-item
name=
'orgname'
:itemRules=
"this.rules.orgname"
class=
''
:caption=
"$t('entities.ibzdepartment.main_form.details.orgname')"
uiStyle=
"DEFAULT"
:labelWidth=
"130"
:isShowCaption=
"true"
:error=
"detailsModel.orgname.error"
:isEmptyCaption=
"false"
labelPos=
"LEFT"
>
<app-org-select
:data=
"data"
:context=
"JSON.parse(JSON.stringify(context))"
:fillMap=
"
{'id':'orgid','label':'orgname'}" filter="pdeptid" :multiple="false" style="" @formitemvaluechange="onFormItemValueChange">
</app-org-select>
<app-picker
:formState=
"formState"
:data=
"data"
:context=
"context"
:viewparams=
"viewparams"
:itemParam=
'
{ }'
:disabled="detailsModel.orgname.disabled"
name='orgname'
deMajorField='orgname'
deKeyField='ibzorganization'
:service="service"
:acParams="{ serviceName: 'IBZOrganizationService', interfaceName: 'FetchDefault'}"
valueitem='orgid'
:value="data.orgname"
editortype=""
:pickupView="{ viewname: 'ibzorganization-pickup-view', title: $t('entities.ibzorganization.views.pickupview.title'), deResParameters: [], parameters: [{ pathName: 'ibzorganizations', parameterName: 'ibzorganization' }, { pathName: 'pickupview', parameterName: 'pickupview' } ], placement:'' }"
style=""
@formitemvaluechange="onFormItemValueChange">
</app-picker>
</app-form-item>
</i-col>
...
...
@@ -66,7 +85,18 @@
</i-col>
<i-col
v-show=
"detailsModel.leadername.visible"
:style=
"
{}" :lg="{ span: 24, offset: 0 }">
<app-form-item
name=
'leadername'
:itemRules=
"this.rules.leadername"
class=
''
:caption=
"$t('entities.ibzdepartment.main_form.details.leadername')"
uiStyle=
"DEFAULT"
:labelWidth=
"130"
:isShowCaption=
"true"
:error=
"detailsModel.leadername.error"
:isEmptyCaption=
"false"
labelPos=
"LEFT"
>
<input-box
v-model=
"data.leadername"
@
enter=
"onEnter($event)"
unit=
""
:disabled=
"detailsModel.leadername.disabled"
type=
'text'
style=
""
></input-box>
<ibiz-group-select
name=
"leadername"
:value=
'data.leadername'
valueitem=
""
:multiple=
"true"
filter=
"orgid"
:disabled=
"detailsModel.leadername.disabled"
:data=
"data"
:context=
"context"
@
formitemvaluechange=
"onFormItemValueChange"
>
</ibiz-group-select>
</app-form-item>
</i-col>
...
...
app_web/src/widgets/ibzdepartment/main-form/main-form-service.ts
浏览文件 @
8c0fedf9
...
...
@@ -2,6 +2,7 @@ import { Http,Util,Errorlog } from '@/utils';
import
ControlService
from
'@/widgets/control-service'
;
import
IBZDepartmentService
from
'@/service/ibzdepartment/ibzdepartment-service'
;
import
MainModel
from
'./main-form-model'
;
import
IBZOrganizationService
from
'@/service/ibzorganization/ibzorganization-service'
;
/**
...
...
@@ -41,6 +42,14 @@ export default class MainService extends ControlService {
this
.
model
=
new
MainModel
();
}
/**
* 单位机构服务对象
*
* @type {IBZOrganizationService}
* @memberof MainService
*/
public
ibzorganizationService
:
IBZOrganizationService
=
new
IBZOrganizationService
();
/**
* 处理数据
*
...
...
@@ -83,6 +92,9 @@ export default class MainService extends ControlService {
if
(
Object
.
is
(
serviceName
,
'IBZDepartmentService'
)
&&
Object
.
is
(
interfaceName
,
'FetchDefault'
))
{
return
this
.
doItems
(
this
.
appEntityService
.
FetchDefault
(
JSON
.
parse
(
JSON
.
stringify
(
context
)),
data
,
isloading
),
'deptid'
,
'ibzdepartment'
);
}
if
(
Object
.
is
(
serviceName
,
'IBZOrganizationService'
)
&&
Object
.
is
(
interfaceName
,
'FetchDefault'
))
{
return
this
.
doItems
(
this
.
ibzorganizationService
.
FetchDefault
(
JSON
.
parse
(
JSON
.
stringify
(
context
)),
data
,
isloading
),
'orgid'
,
'ibzorganization'
);
}
return
Promise
.
reject
([])
}
...
...
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/rest/IBZDepartmentResource.java
浏览文件 @
8c0fedf9
...
...
@@ -82,7 +82,7 @@ public class IBZDepartmentResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"has
AnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDepartment-Save-all'
)"
)
@PreAuthorize
(
"has
Permission('','Save',{'Sql',this.ibzdepartmentMapping,#ibzdepartmentdto}
)"
)
@ApiOperation
(
value
=
"Save"
,
tags
=
{
"IBZDepartment"
},
notes
=
"Save"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzdepartments/save"
)
public
ResponseEntity
<
Boolean
>
save
(
@RequestBody
IBZDepartmentDTO
ibzdepartmentdto
)
{
...
...
@@ -222,7 +222,7 @@ public class IBZDepartmentResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"has
AnyAuthority('ROLE_SUPERADMIN','ibzou-IBZDepartment-Save-all'
)"
)
@PreAuthorize
(
"has
Permission('','Save',{'Sql',this.ibzdepartmentMapping,#ibzdepartmentdto}
)"
)
@ApiOperation
(
value
=
"SaveByIBZOrganization"
,
tags
=
{
"IBZDepartment"
},
notes
=
"SaveByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/save"
)
public
ResponseEntity
<
Boolean
>
saveByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
IBZDepartmentDTO
ibzdepartmentdto
)
{
...
...
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/rest/IBZEmployeeResource.java
浏览文件 @
8c0fedf9
...
...
@@ -127,7 +127,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"has
AnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-Save-all'
)"
)
@PreAuthorize
(
"has
Permission('','Save',{'Sql',this.ibzemployeeMapping,#ibzemployeedto}
)"
)
@ApiOperation
(
value
=
"Save"
,
tags
=
{
"IBZEmployee"
},
notes
=
"Save"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzemployees/save"
)
public
ResponseEntity
<
Boolean
>
save
(
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
...
...
@@ -263,7 +263,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"has
AnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-Save-all'
)"
)
@PreAuthorize
(
"has
Permission('','Save',{'Sql',this.ibzemployeeMapping,#ibzemployeedto}
)"
)
@ApiOperation
(
value
=
"SaveByIBZDepartment"
,
tags
=
{
"IBZEmployee"
},
notes
=
"SaveByIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/save"
)
public
ResponseEntity
<
Boolean
>
saveByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
...
...
@@ -409,7 +409,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"has
AnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-Save-all'
)"
)
@PreAuthorize
(
"has
Permission('','Save',{'Sql',this.ibzemployeeMapping,#ibzemployeedto}
)"
)
@ApiOperation
(
value
=
"SaveByIBZOrganization"
,
tags
=
{
"IBZEmployee"
},
notes
=
"SaveByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/save"
)
public
ResponseEntity
<
Boolean
>
saveByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
...
...
@@ -555,7 +555,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"has
AnyAuthority('ROLE_SUPERADMIN','ibzou-IBZEmployee-Save-all'
)"
)
@PreAuthorize
(
"has
Permission('','Save',{'Sql',this.ibzemployeeMapping,#ibzemployeedto}
)"
)
@ApiOperation
(
value
=
"SaveByIBZOrganizationIBZDepartment"
,
tags
=
{
"IBZEmployee"
},
notes
=
"SaveByIBZOrganizationIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/save"
)
public
ResponseEntity
<
Boolean
>
saveByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
...
...
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/rest/IBZOrganizationResource.java
浏览文件 @
8c0fedf9
...
...
@@ -100,7 +100,7 @@ public class IBZOrganizationResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"has
AnyAuthority('ROLE_SUPERADMIN','ibzou-IBZOrganization-Save-all'
)"
)
@PreAuthorize
(
"has
Permission('','Save',{'Sql',this.ibzorganizationMapping,#ibzorganizationdto}
)"
)
@ApiOperation
(
value
=
"Save"
,
tags
=
{
"IBZOrganization"
},
notes
=
"Save"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/save"
)
public
ResponseEntity
<
Boolean
>
save
(
@RequestBody
IBZOrganizationDTO
ibzorganizationdto
)
{
...
...
ibzou-util/src/main/java/cn/ibizlab/util/security/AuthPermissionEvaluator.java
浏览文件 @
8c0fedf9
...
...
@@ -104,6 +104,9 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
if
(
action
.
equalsIgnoreCase
(
"create"
)){
return
createBatchActionPermissionValid
(
entityList
,
dataRangeList
);
}
else
if
(
action
.
equalsIgnoreCase
(
"save"
)){
return
saveBatchActionPermissionValid
(
deStorageMode
,
entityList
,
dataRangeList
);
}
else
{
if
(!
action
.
equalsIgnoreCase
(
"remove"
)){
ids
=
getIds
(
entity
,
entityList
);
...
...
@@ -114,6 +117,43 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
}
}
/**
* 批save校验
* @param deStorageMode
* @param entityList
* @param dataRangeList
* @return
*/
private
boolean
saveBatchActionPermissionValid
(
String
deStorageMode
,
List
<
EntityBase
>
entityList
,
JSONArray
dataRangeList
)
{
if
(
entityList
==
null
||
entityList
.
size
()==
0
)
return
false
;
EntityBase
tempEntity
=
entityList
.
get
(
0
);
Map
<
String
,
String
>
permissionField
=
getPermissionField
(
tempEntity
);
String
keyFieldName
=
permissionField
.
get
(
keyFieldTag
);
List
createList
=
new
ArrayList
();
List
<
String
>
updateList
=
new
ArrayList
();
for
(
EntityBase
entity
:
entityList
){
Object
id
=
entity
.
get
(
keyFieldName
);
if
(
ObjectUtils
.
isEmpty
(
id
))
createList
.
add
(
entity
);
else
updateList
.
add
(
String
.
valueOf
(
id
));
}
if
(
updateList
.
size
()>
0
){
boolean
isUpdate
=
otherBatchActionPermissionValidRouter
(
deStorageMode
,
tempEntity
,
updateList
,
dataRangeList
);
if
(!
isUpdate
)
return
false
;
}
if
(
createList
.
size
()>
0
){
boolean
isCreate
=
createBatchActionPermissionValid
(
entityList
,
dataRangeList
);
if
(!
isCreate
)
return
false
;
}
return
true
;
}
/**
* 实体行为权限检查 :用于检查当前用户是否拥有实体的新建、编辑、删除权限
*
...
...
@@ -157,6 +197,15 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
if
(
dataRangeList
.
size
()==
0
)
return
false
;
if
(
action
.
equalsIgnoreCase
(
"save"
)){
Map
<
String
,
String
>
permissionField
=
getPermissionField
(
entity
);
String
keyFieldName
=
permissionField
.
get
(
keyFieldTag
);
Object
srfKey
=
entity
.
get
(
keyFieldName
);
if
(
ObjectUtils
.
isEmpty
(
srfKey
))
action
=
"create"
;
else
action
=
"update"
;
}
if
(
action
.
equalsIgnoreCase
(
"create"
)){
return
createActionPermissionValid
(
entity
,
dataRangeList
);
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录