Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
荆蔚杰
/
java.archive
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
eeb29e78
authored
2021-11-24 17:29:03 +0800
by
荆蔚杰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
文件上传和排序接口整合
1 parent
e0d189e5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
6 deletions
src/main/java/com/pashanhoo/file/entity/vo/AddDgFileRequest.java
src/main/java/com/pashanhoo/file/entity/vo/DgCatalogWithFileVO.java
src/main/java/com/pashanhoo/file/service/DgFileService.java
src/main/java/com/pashanhoo/file/service/impl/DgFileServiceImpl.java
src/main/resources/mapper/DgFileMapper.xml
src/main/java/com/pashanhoo/file/entity/vo/AddDgFileRequest.java
View file @
eeb29e7
...
...
@@ -34,6 +34,12 @@ public class AddDgFileRequest implements Serializable {
private
String
bsmCatalog
;
/**
* 档案标识码
*/
@ApiModelProperty
(
name
=
"bsmArchive"
,
value
=
"档案标识码"
)
private
String
bsmArchive
;
/**
* 文件类型
*/
@ApiModelProperty
(
name
=
"kzm"
,
value
=
"文件类型"
)
...
...
src/main/java/com/pashanhoo/file/entity/vo/DgCatalogWithFileVO.java
View file @
eeb29e7
...
...
@@ -16,6 +16,12 @@ public class DgCatalogWithFileVO implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
/**
* 档案标识码
*/
@ApiModelProperty
(
name
=
"bsmArchive"
,
value
=
"档案标识码"
)
private
String
bsmArchive
;
/**
* 目录标识码
*/
@ApiModelProperty
(
name
=
"bsmCatalog"
,
value
=
"目录标识码"
)
...
...
src/main/java/com/pashanhoo/file/service/DgFileService.java
View file @
eeb29e7
...
...
@@ -65,5 +65,5 @@ public interface DgFileService extends IService<DgFileDO> {
* @param fileRequest
* @return
*/
boolean
upload
(
MultipartFile
file
,
AddDgFileRequest
fileRequest
)
throws
IOException
;
List
<
DgCatalogWithFileVO
>
upload
(
MultipartFile
file
,
AddDgFileRequest
fileRequest
)
throws
IOException
;
}
...
...
src/main/java/com/pashanhoo/file/service/impl/DgFileServiceImpl.java
View file @
eeb29e7
...
...
@@ -124,15 +124,15 @@ public class DgFileServiceImpl extends ServiceImpl<DgFileMapper, DgFileDO> imple
/**
* 上传材料附件.材料附件信息入库
*
* @param
f
ile
* @param
uploadF
ile
* @param fileRequest
* @return
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
upload
(
MultipartFile
f
ile
,
AddDgFileRequest
fileRequest
)
throws
IOException
{
public
List
<
DgCatalogWithFileVO
>
upload
(
MultipartFile
uploadF
ile
,
AddDgFileRequest
fileRequest
)
throws
IOException
{
//文件上传
FileAttribute
fileAttribute
=
minioUtil
.
upload
(
f
ile
);
FileAttribute
fileAttribute
=
minioUtil
.
upload
(
uploadF
ile
);
Integer
firstXh
=
fileRequest
.
getXh
();
String
firstBsmCatalog
=
fileRequest
.
getBsmCatalog
();
...
...
@@ -153,7 +153,13 @@ public class DgFileServiceImpl extends ServiceImpl<DgFileMapper, DgFileDO> imple
fileWrapper
.
lambda
().
eq
(
DgFileDO:
:
getBsmCatalog
,
firstBsmCatalog
).
gt
(
DgFileDO:
:
getXh
,
firstXh
+
1
);
List
<
DgFileDO
>
list
=
this
.
list
(
fileWrapper
);
list
.
forEach
(
item
->
item
.
setXh
(
item
.
getXh
()
+
1
));
return
this
.
updateBatchById
(
list
);
this
.
updateBatchById
(
list
);
List
<
DgCatalogWithFileVO
>
fileList
=
dgfileMapper
.
getFileList
(
fileRequest
.
getBsmArchive
());
fileList
.
forEach
(
item
->
item
.
getFileLists
().
forEach
(
file
->
file
.
setSaveUrl
(
file
.
getFjurl
())));
fileList
.
forEach
(
catalogWithFiles
->
catalogWithFiles
.
getFileLists
().
forEach
(
file
->
file
.
setFjurl
(
minioUtil
.
getPreviewUrl
(
file
.
getFjurl
()))));
return
fileList
;
}
...
...
src/main/resources/mapper/DgFileMapper.xml
View file @
eeb29e7
...
...
@@ -26,6 +26,7 @@
</sql>
<resultMap
id=
"result"
type=
"com.pashanhoo.file.entity.vo.DgCatalogWithFileVO"
>
<result
column=
"BSM_ARCHIVES"
property=
"bsmArchive"
/>
<result
column=
"bsm_catalog"
property=
"bsmCatalog"
/>
<result
column=
"wjmc"
property=
"wjmc"
/>
<result
column=
"catalogXh"
property=
"catalogXh"
/>
...
...
@@ -42,9 +43,10 @@
</resultMap>
<select
id=
"getFileList"
resultMap=
"result"
>
select DF.*, DAC.XH as catalogXh, DAC.WJMC,DAC.BSM_CATALOG
select DF.*, DAC.XH as catalogXh, DAC.WJMC,DAC.BSM_CATALOG
,DA.BSM_ARCHIVES
from DG_FILE DF
join DG_ARCHIVES_CATALOG DAC on DAC.BSM_CATALOG = DF.BSM_CATALOG
join DG_ARCHIVES DA on DAC.BSM_ARCHIVES = DA.BSM_ARCHIVES
<where>
<if
test=
"bsmArchive != null and bsmArchive != ''"
>
BSM_ARCHIVES = #{bsmArchive,jdbcType=VARCHAR}
...
...
Please
register
or
sign in
to post a comment