Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
05ea5991
Commit
05ea5991
authored
Jun 28, 2022
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
huyc 项目档案代码提交
parent
81e29bde
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
4 deletions
+45
-4
TElecEmployeeInfoServiceImpl.java
...u/archives/service/impl/TElecEmployeeInfoServiceImpl.java
+44
-3
DictController.java
...u.cloud.plus.v1/yifu/admin/controller/DictController.java
+1
-1
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TElecEmployeeInfoServiceImpl.java
View file @
05ea5991
...
...
@@ -97,6 +97,8 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
zipFile
.
transferTo
(
file
);
// 获取解压出来的文件名 不带后缀
unZip
(
file
,
dec
);
//解析完成删除本次解析中生成的文件 删除此目录下的所有文件
deleteFile
(
dec
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -121,16 +123,18 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
private
R
unZip
(
File
srcFile
,
String
destDirPath
)
throws
RuntimeException
{
// 调用字典服务,渲染字典值
R
<
Map
<
String
,
Map
<
String
,
String
>>>
dictR
=
HttpDaprUtil
.
invokeMethodPost
(
daprUpmsProperties
.
getAppUrl
(),
daprUpmsProperties
.
getAppId
()
R
<
Map
<
String
,
Map
<
String
,
Map
<
String
,
String
>
>>>
dictR
=
HttpDaprUtil
.
invokeMethodPost
(
daprUpmsProperties
.
getAppUrl
(),
daprUpmsProperties
.
getAppId
()
,
"/dict/inner/getDictToLable"
,
null
,
Map
.
class
,
SecurityConstants
.
FROM_IN
);
Map
<
String
,
Map
<
String
,
String
>>
dictMap
;
Map
<
String
,
Map
<
String
,
Map
<
String
,
String
>
>>
dictMap
;
// 电子档案类型
Map
<
String
,
Map
<
String
,
String
>>
elecTypeMapData
;
Map
<
String
,
String
>
elecTypeMap
;
if
(
dictR
==
null
)
{
return
R
.
failed
(
"获取字典失败!"
);
}
else
{
dictMap
=
dictR
.
getData
();
elecTypeMap
=
dictMap
.
get
(
"elec_archives_type"
);
elecTypeMapData
=
dictMap
.
get
(
"data"
);
elecTypeMap
=
elecTypeMapData
.
get
(
"elec_archives_type"
);
}
//记录解压出来的所有文件名
List
<
String
>
filesName
=
new
ArrayList
<>();
...
...
@@ -239,4 +243,41 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
MultipartFile
multipartFile
=
new
CommonsMultipartFile
(
item
);
return
multipartFile
;
}
/**
* 删除文件
*
* @param filePath
* @return
*/
public
static
boolean
deleteFile
(
String
filePath
)
{
boolean
flag
=
false
;
File
file
=
new
File
(
filePath
);
if
(!
file
.
exists
())
{
return
flag
;
}
if
(!
file
.
isDirectory
())
{
return
flag
;
}
String
[]
tempList
=
file
.
list
();
File
temp
;
for
(
int
i
=
0
;
i
<
tempList
.
length
;
i
++)
{
if
(
filePath
.
endsWith
(
File
.
separator
))
{
temp
=
new
File
(
filePath
+
tempList
[
i
]);
}
else
{
temp
=
new
File
(
filePath
+
File
.
separator
+
tempList
[
i
]);
}
if
(
temp
.
isFile
())
{
temp
.
delete
();
}
if
(
temp
.
isDirectory
())
{
// 先删除文件夹里面的文件
deleteFile
(
filePath
+
"/"
+
tempList
[
i
]);
// 再删除空文件夹
deleteFile
(
filePath
+
"/"
+
tempList
[
i
]);
flag
=
true
;
}
}
return
flag
;
}
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/controller/DictController.java
View file @
05ea5991
...
...
@@ -311,7 +311,7 @@ public class DictController {
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.Map < java.lang.String, java.util.Map < java.lang.String, java.lang.String>>>
**/
@Inner
@
Ge
tMapping
(
"/inner/getDictToLable"
)
@
Pos
tMapping
(
"/inner/getDictToLable"
)
public
R
<
Map
<
String
,
Map
<
String
,
String
>>>
getDictToLable
()
{
return
sysDictItemService
.
getDictToLable
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment