Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzou
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzou
提交
7cc1cbb5
提交
7cc1cbb5
编写于
5月 05, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibizdev提交
上级
a68c1fa4
变更
20
展开全部
显示空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
495 行增加
和
151 行删除
+495
-151
wfdyna-exp-grid-view-engine.ts
app_web/src/engine/view/wfdyna-exp-grid-view-engine.ts
+37
-0
ibzdepartments.ts
app_web/src/mock/entity/ibzdepartments/ibzdepartments.ts
+47
-0
ibzemployees.ts
app_web/src/mock/entity/ibzemployees/ibzemployees.ts
+47
-0
ibzorganizations.ts
app_web/src/mock/entity/ibzorganizations/ibzorganizations.ts
+47
-0
config.xml
config.xml
+0
-5
webSecurityConfig.java
...rc/main/java/cn/ibizlab/web/config/webSecurityConfig.java
+13
-0
application-dev.yml
ibzou-boot/src/main/resources/application-dev.yml
+1
-1
IBZOrganization.java
.../main/java/cn/ibizlab/core/ou/domain/IBZOrganization.java
+1
-1
h2_table.xml
ibzou-core/src/main/resources/liquibase/h2_table.xml
+2
-2
Dockerfile
ibzou-provider/ibzou-provider-api/src/main/docker/Dockerfile
+1
-1
ibzou-provider-api.yaml
...bzou-provider-api/src/main/docker/ibzou-provider-api.yaml
+1
-3
IBZDepartmentResource.java
.../main/java/cn/ibizlab/api/rest/IBZDepartmentResource.java
+8
-8
IBZEmployeeResource.java
...rc/main/java/cn/ibizlab/api/rest/IBZEmployeeResource.java
+8
-8
IBZOrganizationResource.java
...ain/java/cn/ibizlab/api/rest/IBZOrganizationResource.java
+12
-12
application-api-dev.yml
...u-provider-api/src/main/resources/application-api-dev.yml
+1
-1
application-api-prod.yml
...-provider-api/src/main/resources/application-api-prod.yml
+1
-1
FileItem.java
...u-util/src/main/java/cn/ibizlab/util/domain/FileItem.java
+2
-0
FileController.java
...il/src/main/java/cn/ibizlab/util/rest/FileController.java
+3
-4
AuthPermissionEvaluator.java
...ava/cn/ibizlab/util/security/AuthPermissionEvaluator.java
+253
-90
SimpleFileService.java
.../main/java/cn/ibizlab/util/service/SimpleFileService.java
+10
-14
未找到文件。
app_web/src/engine/view/wfdyna-exp-grid-view-engine.ts
0 → 100644
浏览文件 @
7cc1cbb5
import
GridViewEngine
from
'./grid-view-engine'
;
/**
* 视图引擎基础
*
* @export
* @class WFDynaExpGridViewEngine
* @extends {GridViewEngine}
*/
export
default
class
WFDynaExpGridViewEngine
extends
GridViewEngine
{
/**
* Creates an instance of WFDynaExpGridViewEngine.
* @memberof WFDynaExpGridViewEngine
*/
constructor
()
{
super
();
}
/**
* 引擎加载
*
* @param {*} [opts={}]
* @memberof WFDynaExpGridViewEngine
*/
public
load
(
opts
:
any
=
{},
isnotify
:
boolean
=
false
):
void
{
this
.
view
.
getWFStepModel
().
then
((
res
:
any
)
=>
{
if
(
!
this
.
view
.
isformDruipart
){
super
.
load
(
opts
);
}
else
{
if
(
isnotify
){
super
.
load
(
opts
);
}
}
})
}
}
\ No newline at end of file
app_web/src/mock/entity/ibzdepartments/ibzdepartments.ts
浏览文件 @
7cc1cbb5
...
...
@@ -6,10 +6,55 @@ const mock = MockAdapter.getInstance();
const
mockDatas
:
Array
<
any
>
=
[
];
//getwflink
mock
.
onGet
(
new
RegExp
(
/^
\/
wfcore
\/
ibzou-app-web
\/
ibzdepartments
\/[
a-zA-Z0-9
\-\;]
+
\/
usertasks
\/[
a-zA-Z0-9
\-\;]
+
\/
ways$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:ibzdepartment 方法: getwflink"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,[
{
"sequenceFlowId"
:
"dfdsfdsfdsfdsfds"
,
"sequenceFlowName"
:
"同意"
,
"taskId"
:
"aaaaddddccccddddd"
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processInstanceId"
:
"ddlfldldfldsfds"
,
"refViewKey"
:
""
},
{
"sequenceFlowId"
:
"ddssdfdfdfdfsfdf"
,
"sequenceFlowName"
:
"不同意"
,
"taskId"
:
"aaaaddddccccddddd"
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processInstanceId"
:
"ddfdsldlfdlldsf"
,
"refViewKey"
:
"workorder_ltform_editview"
}
]];
});
// getwfstep
mock
.
onGet
(
new
RegExp
(
/^
\/
wfcore
\/
ibzou-app-web
\/
ibzdepartments
\/
process-definitions-nodes$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:ibzdepartment 方法: getwfstep"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,
[
{
"userTaskId"
:
"sddfddfd-dfdf-fdfd-fdf-dfdfd"
,
"userTaskName"
:
"待审"
,
"cnt"
:
0
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processDefinitionName"
:
"工单审批流程v1"
},
{
"userTaskId"
:
"sddfddfd-dfdf-fdfd-fdf-87927"
,
"userTaskName"
:
"待分配"
,
"cnt"
:
3
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processDefinitionName"
:
"工单审批流程v1"
}
]];
});
// createBatch
mock
.
onPost
(
new
RegExp
(
/^
\/
ibzdepartments
\/
batch$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:ibzdepartment 方法: createBatch"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
...
...
@@ -21,6 +66,7 @@ mock.onPost(new RegExp(/^\/ibzdepartments\/batch$/)).reply((config: any) => {
mock
.
onPut
(
new
RegExp
(
/^
\/
ibzdepartments
\/
batch$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:ibzdepartment 方法: updateBatch"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
...
...
@@ -32,6 +78,7 @@ mock.onPut(new RegExp(/^\/ibzdepartments\/batch$/)).reply((config: any) => {
mock
.
onDelete
(
new
RegExp
(
/^
\/
ibzdepartments
\/
batch$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:ibzdepartment 方法: removeBatch"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
...
...
app_web/src/mock/entity/ibzemployees/ibzemployees.ts
浏览文件 @
7cc1cbb5
...
...
@@ -6,10 +6,55 @@ const mock = MockAdapter.getInstance();
const
mockDatas
:
Array
<
any
>
=
[
];
//getwflink
mock
.
onGet
(
new
RegExp
(
/^
\/
wfcore
\/
ibzou-app-web
\/
ibzemployees
\/[
a-zA-Z0-9
\-\;]
+
\/
usertasks
\/[
a-zA-Z0-9
\-\;]
+
\/
ways$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:ibzemployee 方法: getwflink"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,[
{
"sequenceFlowId"
:
"dfdsfdsfdsfdsfds"
,
"sequenceFlowName"
:
"同意"
,
"taskId"
:
"aaaaddddccccddddd"
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processInstanceId"
:
"ddlfldldfldsfds"
,
"refViewKey"
:
""
},
{
"sequenceFlowId"
:
"ddssdfdfdfdfsfdf"
,
"sequenceFlowName"
:
"不同意"
,
"taskId"
:
"aaaaddddccccddddd"
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processInstanceId"
:
"ddfdsldlfdlldsf"
,
"refViewKey"
:
"workorder_ltform_editview"
}
]];
});
// getwfstep
mock
.
onGet
(
new
RegExp
(
/^
\/
wfcore
\/
ibzou-app-web
\/
ibzemployees
\/
process-definitions-nodes$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:ibzemployee 方法: getwfstep"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,
[
{
"userTaskId"
:
"sddfddfd-dfdf-fdfd-fdf-dfdfd"
,
"userTaskName"
:
"待审"
,
"cnt"
:
0
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processDefinitionName"
:
"工单审批流程v1"
},
{
"userTaskId"
:
"sddfddfd-dfdf-fdfd-fdf-87927"
,
"userTaskName"
:
"待分配"
,
"cnt"
:
3
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processDefinitionName"
:
"工单审批流程v1"
}
]];
});
// createBatch
mock
.
onPost
(
new
RegExp
(
/^
\/
ibzemployees
\/
batch$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:ibzemployee 方法: createBatch"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
...
...
@@ -21,6 +66,7 @@ mock.onPost(new RegExp(/^\/ibzemployees\/batch$/)).reply((config: any) => {
mock
.
onPut
(
new
RegExp
(
/^
\/
ibzemployees
\/
batch$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:ibzemployee 方法: updateBatch"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
...
...
@@ -32,6 +78,7 @@ mock.onPut(new RegExp(/^\/ibzemployees\/batch$/)).reply((config: any) => {
mock
.
onDelete
(
new
RegExp
(
/^
\/
ibzemployees
\/
batch$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:ibzemployee 方法: removeBatch"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
...
...
app_web/src/mock/entity/ibzorganizations/ibzorganizations.ts
浏览文件 @
7cc1cbb5
...
...
@@ -6,10 +6,55 @@ const mock = MockAdapter.getInstance();
const
mockDatas
:
Array
<
any
>
=
[
];
//getwflink
mock
.
onGet
(
new
RegExp
(
/^
\/
wfcore
\/
ibzou-app-web
\/
ibzorganizations
\/[
a-zA-Z0-9
\-\;]
+
\/
usertasks
\/[
a-zA-Z0-9
\-\;]
+
\/
ways$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:ibzorganization 方法: getwflink"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,[
{
"sequenceFlowId"
:
"dfdsfdsfdsfdsfds"
,
"sequenceFlowName"
:
"同意"
,
"taskId"
:
"aaaaddddccccddddd"
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processInstanceId"
:
"ddlfldldfldsfds"
,
"refViewKey"
:
""
},
{
"sequenceFlowId"
:
"ddssdfdfdfdfsfdf"
,
"sequenceFlowName"
:
"不同意"
,
"taskId"
:
"aaaaddddccccddddd"
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processInstanceId"
:
"ddfdsldlfdlldsf"
,
"refViewKey"
:
"workorder_ltform_editview"
}
]];
});
// getwfstep
mock
.
onGet
(
new
RegExp
(
/^
\/
wfcore
\/
ibzou-app-web
\/
ibzorganizations
\/
process-definitions-nodes$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:ibzorganization 方法: getwfstep"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,
[
{
"userTaskId"
:
"sddfddfd-dfdf-fdfd-fdf-dfdfd"
,
"userTaskName"
:
"待审"
,
"cnt"
:
0
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processDefinitionName"
:
"工单审批流程v1"
},
{
"userTaskId"
:
"sddfddfd-dfdf-fdfd-fdf-87927"
,
"userTaskName"
:
"待分配"
,
"cnt"
:
3
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processDefinitionName"
:
"工单审批流程v1"
}
]];
});
// createBatch
mock
.
onPost
(
new
RegExp
(
/^
\/
ibzorganizations
\/
batch$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:ibzorganization 方法: createBatch"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
...
...
@@ -21,6 +66,7 @@ mock.onPost(new RegExp(/^\/ibzorganizations\/batch$/)).reply((config: any) => {
mock
.
onPut
(
new
RegExp
(
/^
\/
ibzorganizations
\/
batch$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:ibzorganization 方法: updateBatch"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
...
...
@@ -32,6 +78,7 @@ mock.onPut(new RegExp(/^\/ibzorganizations\/batch$/)).reply((config: any) => {
mock
.
onDelete
(
new
RegExp
(
/^
\/
ibzorganizations
\/
batch$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:ibzorganization 方法: removeBatch"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
...
...
config.xml
浏览文件 @
7cc1cbb5
...
...
@@ -38,11 +38,6 @@
git clone -b master $para2 ibzou/
export NODE_OPTIONS=--max-old-space-size=4096
cd ibzou/
mvn clean package -Papi
cd ibzou-provider/ibzou-provider-api
mvn -Papi docker:build
mvn -Papi docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzou-provider-api.yaml dev --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
...
...
ibzou-app/ibzou-app-web/src/main/java/cn/ibizlab/web/config/webSecurityConfig.java
浏览文件 @
7cc1cbb5
...
...
@@ -41,6 +41,15 @@ public class webSecurityConfig extends WebSecurityConfigurerAdapter {
@Value
(
"${ibiz.auth.path:v7/login}"
)
private
String
loginPath
;
@Value
(
"${ibiz.file.uploadpath:ibizutil/upload}"
)
private
String
uploadpath
;
@Value
(
"${ibiz.file.downloadpath:ibizutil/download}"
)
private
String
downloadpath
;
@Value
(
"${ibiz.file.previewpath:ibizutil/preview}"
)
private
String
previewpath
;
@Autowired
public
void
configureGlobal
(
AuthenticationManagerBuilder
auth
)
throws
Exception
{
auth
...
...
@@ -97,6 +106,10 @@ public class webSecurityConfig extends WebSecurityConfigurerAdapter {
).
permitAll
()
//放行登录请求
.
antMatchers
(
HttpMethod
.
POST
,
"/"
+
loginPath
).
permitAll
()
// 文件操作
.
antMatchers
(
"/"
+
downloadpath
+
"/**"
).
permitAll
()
.
antMatchers
(
"/"
+
uploadpath
).
permitAll
()
.
antMatchers
(
"/"
+
previewpath
+
"/**"
).
permitAll
()
// 所有请求都需要认证
.
anyRequest
().
authenticated
()
// 防止iframe 造成跨域
...
...
ibzou-boot/src/main/resources/application-dev.yml
浏览文件 @
7cc1cbb5
server
:
port
:
40001
port
:
8080
ibzou-core/src/main/java/cn/ibizlab/core/ou/domain/IBZOrganization.java
浏览文件 @
7cc1cbb5
...
...
@@ -35,7 +35,7 @@ public class IBZOrganization extends EntityMP implements Serializable {
/**
* 单位标识
*/
@DEField
(
isKeyField
=
true
)
@DEField
(
defaultValue
=
"orgcode"
,
defaultValueType
=
DEFieldDefaultValueType
.
PARAM
,
isKeyField
=
true
)
@TableId
(
value
=
"orgid"
,
type
=
IdType
.
UUID
)
@JSONField
(
name
=
"orgid"
)
@JsonProperty
(
"orgid"
)
...
...
ibzou-core/src/main/resources/liquibase/h2_table.xml
浏览文件 @
7cc1cbb5
...
...
@@ -2,7 +2,7 @@
<databaseChangeLog
xmlns=
"http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext=
"http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"
>
<!--输出实体[IBZORG]数据结构 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-ibzorg-4
09
-1"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-ibzorg-4
10
-1"
>
<createTable
tableName=
"IBZORG"
>
<column
name=
"ORGID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_IBZORG_ORGID"
/>
...
...
@@ -137,7 +137,7 @@
</changeSet>
<!--输出实体[IBZORG]外键关系 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-ibzorg-4
09
-4"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-ibzorg-4
10
-4"
>
<addForeignKeyConstraint
baseColumnNames=
"PORGID"
baseTableName=
"IBZORG"
constraintName=
"DER1N_IBZORG_IBZORG_PORGID"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"ORGID"
referencedTableName=
"IBZORG"
validate=
"true"
/>
</changeSet>
<!--输出实体[IBZEMP]外键关系 -->
...
...
ibzou-provider/ibzou-provider-api/src/main/docker/Dockerfile
浏览文件 @
7cc1cbb5
...
...
@@ -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 /ibzou-provider-api.jar
EXPOSE
4000
1
EXPOSE
808
1
ADD
ibzou-provider-api.jar /ibzou-provider-api.jar
ibzou-provider/ibzou-provider-api/src/main/docker/ibzou-provider-api.yaml
浏览文件 @
7cc1cbb5
...
...
@@ -3,11 +3,9 @@ services:
ibzou-provider-api
:
image
:
registry.cn-shanghai.aliyuncs.com/ibizsys/ibzou-provider-api:latest
ports
:
-
"
40001:4000
1"
-
"
8081:808
1"
networks
:
-
agent_network
environment
:
SPRING_CLOUD_NACOS_DISCOVERY_IP
:
172.16.180.237
deploy
:
mode
:
replicated
replicas
:
1
...
...
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/rest/IBZDepartmentResource.java
浏览文件 @
7cc1cbb5
...
...
@@ -55,7 +55,7 @@ public class IBZDepartmentResource {
@PreAuthorize
(
"hasPermission('','Create',
this.getEntity()
)"
)
@PreAuthorize
(
"hasPermission('','Create',
{this.getEntity(),'Sql'}
)"
)
@ApiOperation
(
value
=
"Create"
,
tags
=
{
"IBZDepartment"
},
notes
=
"Create"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzdepartments"
)
@Transactional
...
...
@@ -66,7 +66,7 @@ public class IBZDepartmentResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission('','Create',
this.getEntity()
)"
)
@PreAuthorize
(
"hasPermission('','Create',
{this.getEntity(),'Sql'}
)"
)
@ApiOperation
(
value
=
"createBatch"
,
tags
=
{
"createBatch"
},
notes
=
"createBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzdepartments/createbatch"
)
public
ResponseEntity
<
Boolean
>
createBatch
(
@RequestBody
List
<
IBZDepartmentDTO
>
ibzdepartmentdtos
)
{
...
...
@@ -77,7 +77,7 @@ public class IBZDepartmentResource {
@PreAuthorize
(
"hasPermission(#ibzdepartment_id,'Get',
this.getEntity()
)"
)
@PreAuthorize
(
"hasPermission(#ibzdepartment_id,'Get',
{this.getEntity(),'Sql'}
)"
)
@ApiOperation
(
value
=
"Get"
,
tags
=
{
"IBZDepartment"
},
notes
=
"Get"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzdepartments/{ibzdepartment_id}"
)
public
ResponseEntity
<
IBZDepartmentDTO
>
get
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
)
{
...
...
@@ -123,7 +123,7 @@ public class IBZDepartmentResource {
@PreAuthorize
(
"hasPermission('Remove',{#ibzdepartment_id,
this.getEntity()
})"
)
@PreAuthorize
(
"hasPermission('Remove',{#ibzdepartment_id,
{this.getEntity(),'Sql'}
})"
)
@ApiOperation
(
value
=
"Remove"
,
tags
=
{
"IBZDepartment"
},
notes
=
"Remove"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/ibzdepartments/{ibzdepartment_id}"
)
@Transactional
...
...
@@ -141,7 +141,7 @@ public class IBZDepartmentResource {
@PreAuthorize
(
"hasPermission(#ibzdepartment_id,'Update',
this.getEntity()
)"
)
@PreAuthorize
(
"hasPermission(#ibzdepartment_id,'Update',
{this.getEntity(),'Sql'}
)"
)
@ApiOperation
(
value
=
"Update"
,
tags
=
{
"IBZDepartment"
},
notes
=
"Update"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/ibzdepartments/{ibzdepartment_id}"
)
@Transactional
...
...
@@ -153,7 +153,7 @@ public class IBZDepartmentResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission(#ibzdepartment_id,'Update',
this.getEntity()
)"
)
@PreAuthorize
(
"hasPermission(#ibzdepartment_id,'Update',
{this.getEntity(),'Sql'}
)"
)
@ApiOperation
(
value
=
"UpdateBatch"
,
tags
=
{
"UpdateBatch"
},
notes
=
"UpdateBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzdepartments/updatebatch"
)
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
IBZDepartmentDTO
>
ibzdepartmentdtos
)
{
...
...
@@ -161,7 +161,7 @@ public class IBZDepartmentResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission('Get',{#context,'Default',this.getEntity()})"
)
@PreAuthorize
(
"hasPermission('Get',{#context,'Default',this.getEntity()
,'Sql'
})"
)
@ApiOperation
(
value
=
"fetchDEFAULT"
,
tags
=
{
"IBZDepartment"
}
,
notes
=
"fetchDEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzdepartments/fetchdefault"
)
public
ResponseEntity
<
List
<
IBZDepartmentDTO
>>
fetchDefault
(
IBZDepartmentSearchContext
context
)
{
...
...
@@ -174,7 +174,7 @@ public class IBZDepartmentResource {
.
body
(
list
);
}
@PreAuthorize
(
"hasPermission('Get',{#context,'Default',this.getEntity()})"
)
@PreAuthorize
(
"hasPermission('Get',{#context,'Default',this.getEntity()
,'Sql'
})"
)
@ApiOperation
(
value
=
"searchDEFAULT"
,
tags
=
{
"IBZDepartment"
}
,
notes
=
"searchDEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzdepartments/searchdefault"
)
public
ResponseEntity
<
Page
<
IBZDepartmentDTO
>>
searchDefault
(
IBZDepartmentSearchContext
context
)
{
...
...
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/rest/IBZEmployeeResource.java
浏览文件 @
7cc1cbb5
...
...
@@ -55,7 +55,7 @@ public class IBZEmployeeResource {
@PreAuthorize
(
"hasPermission('Remove',{#ibzemployee_id,
this.getEntity()
})"
)
@PreAuthorize
(
"hasPermission('Remove',{#ibzemployee_id,
{this.getEntity(),'Sql'}
})"
)
@ApiOperation
(
value
=
"Remove"
,
tags
=
{
"IBZEmployee"
},
notes
=
"Remove"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/ibzemployees/{ibzemployee_id}"
)
@Transactional
...
...
@@ -86,7 +86,7 @@ public class IBZEmployeeResource {
@PreAuthorize
(
"hasPermission('','Create',
this.getEntity()
)"
)
@PreAuthorize
(
"hasPermission('','Create',
{this.getEntity(),'Sql'}
)"
)
@ApiOperation
(
value
=
"Create"
,
tags
=
{
"IBZEmployee"
},
notes
=
"Create"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzemployees"
)
@Transactional
...
...
@@ -97,7 +97,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission('','Create',
this.getEntity()
)"
)
@PreAuthorize
(
"hasPermission('','Create',
{this.getEntity(),'Sql'}
)"
)
@ApiOperation
(
value
=
"createBatch"
,
tags
=
{
"createBatch"
},
notes
=
"createBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzemployees/createbatch"
)
public
ResponseEntity
<
Boolean
>
createBatch
(
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
...
...
@@ -117,7 +117,7 @@ public class IBZEmployeeResource {
@PreAuthorize
(
"hasPermission(#ibzemployee_id,'Update',
this.getEntity()
)"
)
@PreAuthorize
(
"hasPermission(#ibzemployee_id,'Update',
{this.getEntity(),'Sql'}
)"
)
@ApiOperation
(
value
=
"Update"
,
tags
=
{
"IBZEmployee"
},
notes
=
"Update"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/ibzemployees/{ibzemployee_id}"
)
@Transactional
...
...
@@ -129,7 +129,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission(#ibzemployee_id,'Update',
this.getEntity()
)"
)
@PreAuthorize
(
"hasPermission(#ibzemployee_id,'Update',
{this.getEntity(),'Sql'}
)"
)
@ApiOperation
(
value
=
"UpdateBatch"
,
tags
=
{
"UpdateBatch"
},
notes
=
"UpdateBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzemployees/updatebatch"
)
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
...
...
@@ -156,7 +156,7 @@ public class IBZEmployeeResource {
@PreAuthorize
(
"hasPermission(#ibzemployee_id,'Get',
this.getEntity()
)"
)
@PreAuthorize
(
"hasPermission(#ibzemployee_id,'Get',
{this.getEntity(),'Sql'}
)"
)
@ApiOperation
(
value
=
"Get"
,
tags
=
{
"IBZEmployee"
},
notes
=
"Get"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzemployees/{ibzemployee_id}"
)
public
ResponseEntity
<
IBZEmployeeDTO
>
get
(
@PathVariable
(
"ibzemployee_id"
)
String
ibzemployee_id
)
{
...
...
@@ -174,7 +174,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeMapping
.
toDto
(
ibzemployeeService
.
getDraft
(
new
IBZEmployee
())));
}
@PreAuthorize
(
"hasPermission('Get',{#context,'Default',this.getEntity()})"
)
@PreAuthorize
(
"hasPermission('Get',{#context,'Default',this.getEntity()
,'Sql'
})"
)
@ApiOperation
(
value
=
"fetchDEFAULT"
,
tags
=
{
"IBZEmployee"
}
,
notes
=
"fetchDEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzemployees/fetchdefault"
)
public
ResponseEntity
<
List
<
IBZEmployeeDTO
>>
fetchDefault
(
IBZEmployeeSearchContext
context
)
{
...
...
@@ -187,7 +187,7 @@ public class IBZEmployeeResource {
.
body
(
list
);
}
@PreAuthorize
(
"hasPermission('Get',{#context,'Default',this.getEntity()})"
)
@PreAuthorize
(
"hasPermission('Get',{#context,'Default',this.getEntity()
,'Sql'
})"
)
@ApiOperation
(
value
=
"searchDEFAULT"
,
tags
=
{
"IBZEmployee"
}
,
notes
=
"searchDEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzemployees/searchdefault"
)
public
ResponseEntity
<
Page
<
IBZEmployeeDTO
>>
searchDefault
(
IBZEmployeeSearchContext
context
)
{
...
...
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/rest/IBZOrganizationResource.java
浏览文件 @
7cc1cbb5
...
...
@@ -64,7 +64,7 @@ public class IBZOrganizationResource {
@PreAuthorize
(
"hasPermission(#ibzorganization_id,'Update',
this.getEntity()
)"
)
@PreAuthorize
(
"hasPermission(#ibzorganization_id,'Update',
{this.getEntity(),'Sql'}
)"
)
@ApiOperation
(
value
=
"Update"
,
tags
=
{
"IBZOrganization"
},
notes
=
"Update"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/ibzorganizations/{ibzorganization_id}"
)
@Transactional
...
...
@@ -76,7 +76,7 @@ public class IBZOrganizationResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission(#ibzorganization_id,'Update',
this.getEntity()
)"
)
@PreAuthorize
(
"hasPermission(#ibzorganization_id,'Update',
{this.getEntity(),'Sql'}
)"
)
@ApiOperation
(
value
=
"UpdateBatch"
,
tags
=
{
"UpdateBatch"
},
notes
=
"UpdateBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/updatebatch"
)
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
IBZOrganizationDTO
>
ibzorganizationdtos
)
{
...
...
@@ -87,7 +87,7 @@ public class IBZOrganizationResource {
@PreAuthorize
(
"hasPermission('','Create',
this.getEntity()
)"
)
@PreAuthorize
(
"hasPermission('','Create',
{this.getEntity(),'Sql'}
)"
)
@ApiOperation
(
value
=
"Create"
,
tags
=
{
"IBZOrganization"
},
notes
=
"Create"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations"
)
@Transactional
...
...
@@ -98,7 +98,7 @@ public class IBZOrganizationResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission('','Create',
this.getEntity()
)"
)
@PreAuthorize
(
"hasPermission('','Create',
{this.getEntity(),'Sql'}
)"
)
@ApiOperation
(
value
=
"createBatch"
,
tags
=
{
"createBatch"
},
notes
=
"createBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/createbatch"
)
public
ResponseEntity
<
Boolean
>
createBatch
(
@RequestBody
List
<
IBZOrganizationDTO
>
ibzorganizationdtos
)
{
...
...
@@ -125,7 +125,7 @@ public class IBZOrganizationResource {
@PreAuthorize
(
"hasPermission('Remove',{#ibzorganization_id,
this.getEntity()
})"
)
@PreAuthorize
(
"hasPermission('Remove',{#ibzorganization_id,
{this.getEntity(),'Sql'}
})"
)
@ApiOperation
(
value
=
"Remove"
,
tags
=
{
"IBZOrganization"
},
notes
=
"Remove"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/ibzorganizations/{ibzorganization_id}"
)
@Transactional
...
...
@@ -143,7 +143,7 @@ public class IBZOrganizationResource {
@PreAuthorize
(
"hasPermission(#ibzorganization_id,'Get',
this.getEntity()
)"
)
@PreAuthorize
(
"hasPermission(#ibzorganization_id,'Get',
{this.getEntity(),'Sql'}
)"
)
@ApiOperation
(
value
=
"Get"
,
tags
=
{
"IBZOrganization"
},
notes
=
"Get"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}"
)
public
ResponseEntity
<
IBZOrganizationDTO
>
get
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
)
{
...
...
@@ -161,7 +161,7 @@ public class IBZOrganizationResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzorganizationMapping
.
toDto
(
ibzorganizationService
.
getDraft
(
new
IBZOrganization
())));
}
@PreAuthorize
(
"hasPermission('Get',{#context,'SelectSOrg',this.getEntity()})"
)
@PreAuthorize
(
"hasPermission('Get',{#context,'SelectSOrg',this.getEntity()
,'Sql'
})"
)
@ApiOperation
(
value
=
"fetch查询下级单位"
,
tags
=
{
"IBZOrganization"
}
,
notes
=
"fetch查询下级单位"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/fetchselectsorg"
)
public
ResponseEntity
<
List
<
IBZOrganizationDTO
>>
fetchSelectSOrg
(
IBZOrganizationSearchContext
context
)
{
...
...
@@ -174,7 +174,7 @@ public class IBZOrganizationResource {
.
body
(
list
);
}
@PreAuthorize
(
"hasPermission('Get',{#context,'SelectSOrg',this.getEntity()})"
)
@PreAuthorize
(
"hasPermission('Get',{#context,'SelectSOrg',this.getEntity()
,'Sql'
})"
)
@ApiOperation
(
value
=
"search查询下级单位"
,
tags
=
{
"IBZOrganization"
}
,
notes
=
"search查询下级单位"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/searchselectsorg"
)
public
ResponseEntity
<
Page
<
IBZOrganizationDTO
>>
searchSelectSOrg
(
IBZOrganizationSearchContext
context
)
{
...
...
@@ -183,7 +183,7 @@ public class IBZOrganizationResource {
.
body
(
new
PageImpl
(
ibzorganizationMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
@PreAuthorize
(
"hasPermission('Get',{#context,'SelectPOrg',this.getEntity()})"
)
@PreAuthorize
(
"hasPermission('Get',{#context,'SelectPOrg',this.getEntity()
,'Sql'
})"
)
@ApiOperation
(
value
=
"fetch查询上级单位"
,
tags
=
{
"IBZOrganization"
}
,
notes
=
"fetch查询上级单位"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/fetchselectporg"
)
public
ResponseEntity
<
List
<
IBZOrganizationDTO
>>
fetchSelectPOrg
(
IBZOrganizationSearchContext
context
)
{
...
...
@@ -196,7 +196,7 @@ public class IBZOrganizationResource {
.
body
(
list
);
}
@PreAuthorize
(
"hasPermission('Get',{#context,'SelectPOrg',this.getEntity()})"
)
@PreAuthorize
(
"hasPermission('Get',{#context,'SelectPOrg',this.getEntity()
,'Sql'
})"
)
@ApiOperation
(
value
=
"search查询上级单位"
,
tags
=
{
"IBZOrganization"
}
,
notes
=
"search查询上级单位"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/searchselectporg"
)
public
ResponseEntity
<
Page
<
IBZOrganizationDTO
>>
searchSelectPOrg
(
IBZOrganizationSearchContext
context
)
{
...
...
@@ -205,7 +205,7 @@ public class IBZOrganizationResource {
.
body
(
new
PageImpl
(
ibzorganizationMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
@PreAuthorize
(
"hasPermission('Get',{#context,'Default',this.getEntity()})"
)
@PreAuthorize
(
"hasPermission('Get',{#context,'Default',this.getEntity()
,'Sql'
})"
)
@ApiOperation
(
value
=
"fetchDEFAULT"
,
tags
=
{
"IBZOrganization"
}
,
notes
=
"fetchDEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/fetchdefault"
)
public
ResponseEntity
<
List
<
IBZOrganizationDTO
>>
fetchDefault
(
IBZOrganizationSearchContext
context
)
{
...
...
@@ -218,7 +218,7 @@ public class IBZOrganizationResource {
.
body
(
list
);
}
@PreAuthorize
(
"hasPermission('Get',{#context,'Default',this.getEntity()})"
)
@PreAuthorize
(
"hasPermission('Get',{#context,'Default',this.getEntity()
,'Sql'
})"
)
@ApiOperation
(
value
=
"searchDEFAULT"
,
tags
=
{
"IBZOrganization"
}
,
notes
=
"searchDEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/searchdefault"
)
public
ResponseEntity
<
Page
<
IBZOrganizationDTO
>>
searchDefault
(
IBZOrganizationSearchContext
context
)
{
...
...
ibzou-provider/ibzou-provider-api/src/main/resources/application-api-dev.yml
浏览文件 @
7cc1cbb5
server
:
port
:
40001
\ No newline at end of file
port
:
8081
\ No newline at end of file
ibzou-provider/ibzou-provider-api/src/main/resources/application-api-prod.yml
浏览文件 @
7cc1cbb5
server
:
port
:
4000
1
port
:
808
1
ibzou-util/src/main/java/cn/ibizlab/util/domain/FileItem.java
浏览文件 @
7cc1cbb5
...
...
@@ -14,6 +14,8 @@ public class FileItem
{
private
String
id
;
private
String
name
;
private
String
fileid
;
private
String
filename
;
private
long
size
;
private
String
ext
;
}
ibzou-util/src/main/java/cn/ibizlab/util/rest/FileController.java
浏览文件 @
7cc1cbb5
...
...
@@ -14,21 +14,20 @@ import java.io.*;
@Slf4j
@RestController
@RequestMapping
(
"/"
)
public
class
FileController
{
@Autowired
private
FileService
fileService
;
@PostMapping
(
value
=
"${ibiz.
uploadpath.
path:ibizutil/upload}"
)
@PostMapping
(
value
=
"${ibiz.
file.upload
path:ibizutil/upload}"
)
public
ResponseEntity
<
FileItem
>
upload
(
@RequestParam
(
"file"
)
MultipartFile
multipartFile
){
return
ResponseEntity
.
ok
().
body
(
fileService
.
saveFile
(
multipartFile
));
}
private
final
String
defaultdownloadpath
=
"ibizutil/download/{id}"
;
protected
String
getDefaultdownloadpath
(){
return
defaultdownloadpath
;
}
@GetMapping
(
value
=
"${ibiz.file.downloadpath:"
+
defaultdownloadpath
+
"}"
)
@ResponseStatus
(
HttpStatus
.
OK
)
...
...
ibzou-util/src/main/java/cn/ibizlab/util/security/AuthPermissionEvaluator.java
浏览文件 @
7cc1cbb5
此差异已折叠。
点击以展开。
ibzou-util/src/main/java/cn/ibizlab/util/service/SimpleFileService.java
浏览文件 @
7cc1cbb5
...
...
@@ -3,6 +3,7 @@ package cn.ibizlab.util.service;
import
cn.ibizlab.util.domain.FileItem
;
import
cn.ibizlab.util.errors.InternalServerErrorException
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.stereotype.Service
;
...
...
@@ -11,7 +12,6 @@ import org.springframework.web.multipart.MultipartFile;
import
java.io.File
;
import
java.io.IOException
;
import
java.nio.file.Files
;
import
java.util.UUID
;
@Primary
@Slf4j
...
...
@@ -21,26 +21,22 @@ public class SimpleFileService implements FileService {
@Value
(
"${ibiz.filePath:/app/file/}"
)
private
String
fileRoot
;
@Override
public
FileItem
saveFile
(
MultipartFile
multipartFile
)
{
FileItem
item
=
null
;
// 获取文件名
String
fileName
=
multipartFile
.
getOriginalFilename
();
// 获取文件后缀
String
extname
=
"."
+
getExtensionName
(
fileName
);
// 用uuid作为文件名,防止生成的临时文件重复
String
fileid
=
UUID
.
randomUUID
().
toString
();
String
fileFullPath
=
this
.
fileRoot
+
"ibztuit"
+
File
.
separator
+
fileid
+
File
.
separator
+
fileName
;
try
{
String
fileid
=
DigestUtils
.
md5Hex
(
multipartFile
.
getInputStream
());
String
fileFullPath
=
this
.
fileRoot
+
"ibizutil"
+
File
.
separator
+
fileid
+
File
.
separator
+
fileName
;
File
file
=
new
File
(
fileFullPath
);
File
parent
=
new
File
(
file
.
getParent
());
if
(!
parent
.
exists
())
parent
.
mkdirs
();
try
{
FileCopyUtils
.
copy
(
multipartFile
.
getInputStream
()
,
Files
.
newOutputStream
(
file
.
toPath
()));
item
=
new
FileItem
(
fileid
,
fileName
,
(
int
)
multipartFile
.
getSize
()
,
extname
);
FileCopyUtils
.
copy
(
multipartFile
.
getInputStream
(),
Files
.
newOutputStream
(
file
.
toPath
()));
item
=
new
FileItem
(
fileid
,
fileName
,
fileid
,
fileName
,(
int
)
multipartFile
.
getSize
(),
extname
);
}
catch
(
IOException
e
)
{
throw
new
InternalServerErrorException
(
"文件上传失败"
);
}
...
...
@@ -49,7 +45,7 @@ public class SimpleFileService implements FileService {
@Override
public
File
getFile
(
String
fileid
)
{
String
dirpath
=
this
.
fileRoot
+
"ib
ztuit
"
+
File
.
separator
+
fileid
;
String
dirpath
=
this
.
fileRoot
+
"ib
izutil
"
+
File
.
separator
+
fileid
;
File
parent
=
new
File
(
dirpath
);
if
(
parent
.
exists
()
&&
parent
.
isDirectory
()
&&
parent
.
listFiles
().
length
>
0
)
{
return
parent
.
listFiles
()[
0
];
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录