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
171f82f3
Commit
171f82f3
authored
Feb 24, 2023
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
电子档案文件夹名称格式修改
parent
ef2eb51c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
TElecEmployeeInfoServiceImpl.java
...u/archives/service/impl/TElecEmployeeInfoServiceImpl.java
+15
-14
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TElecEmployeeInfoServiceImpl.java
View file @
171f82f3
...
@@ -156,7 +156,7 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
...
@@ -156,7 +156,7 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
elecTypeMap
.
put
(
entry
.
getValue
(),
entry
.
getKey
());
elecTypeMap
.
put
(
entry
.
getValue
(),
entry
.
getKey
());
}
}
}
}
if
(
!
elecTypeMap
.
isEmpty
())
{
if
(
elecTypeMap
.
isEmpty
())
{
return
R
.
failed
(
"获取字典失败!"
);
return
R
.
failed
(
"获取字典失败!"
);
}
}
// 判断源文件是否存在
// 判断源文件是否存在
...
@@ -176,14 +176,19 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
...
@@ -176,14 +176,19 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
TEmployeeInfo
tEmployeeInfo
;
TEmployeeInfo
tEmployeeInfo
;
ZipEntry
entry
;
ZipEntry
entry
;
String
idCard
;
String
empInfo
;
while
(
entriesCheck
.
hasMoreElements
())
{
while
(
entriesCheck
.
hasMoreElements
())
{
entry
=
(
ZipEntry
)
entriesCheck
.
nextElement
();
entry
=
(
ZipEntry
)
entriesCheck
.
nextElement
();
//添加进filesName
//添加进filesName
String
empInfo
=
entry
.
getName
();
empInfo
=
entry
.
getName
();
infoList
.
add
(
empInfo
);
infoList
.
add
(
empInfo
);
String
dataType
=
""
;
String
dataType
=
""
;
if
(
empInfo
.
length
()
==
empInfo
.
lastIndexOf
(
"/"
)
+
1
)
{
if
(
empInfo
.
length
()
==
empInfo
.
lastIndexOf
(
"/"
)
+
1
)
{
String
idCard
=
empInfo
.
substring
(
0
,
empInfo
.
indexOf
(
"/"
));
if
(!
empInfo
.
contains
(
"-"
))
{
return
R
.
failed
(
"请使用正确的文件夹命名格式:身份证-员工姓名"
);
}
idCard
=
empInfo
.
substring
(
0
,
empInfo
.
indexOf
(
"-"
));
tEmployeeInfo
=
tEmployeeInfoService
.
getOne
((
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
tEmployeeInfo
=
tEmployeeInfoService
.
getOne
((
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
idCard
)).
eq
(
TEmployeeInfo:
:
getFileStatus
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
idCard
)).
eq
(
TEmployeeInfo:
:
getFileStatus
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
)
...
@@ -197,7 +202,7 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
...
@@ -197,7 +202,7 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
if
(!
Common
.
isNotNull
(
elecTypeMap
.
get
(
dataType
)))
{
if
(!
Common
.
isNotNull
(
elecTypeMap
.
get
(
dataType
)))
{
return
R
.
failed
(
"资料类型错误:"
+
dataType
);
return
R
.
failed
(
"资料类型错误:"
+
dataType
);
}
}
cardType
.
add
(
idCard
+
"
/
"
+
dataType
);
cardType
.
add
(
idCard
+
"
_
"
+
dataType
);
}
}
}
}
}
}
...
@@ -219,7 +224,7 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
...
@@ -219,7 +224,7 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
while
(
entries
.
hasMoreElements
())
{
while
(
entries
.
hasMoreElements
())
{
entry
=
(
ZipEntry
)
entries
.
nextElement
();
entry
=
(
ZipEntry
)
entries
.
nextElement
();
//添加进filesName
//添加进filesName
String
empInfo
=
entry
.
getName
();
empInfo
=
entry
.
getName
();
// 如果是文件夹,就创建个文件夹
// 如果是文件夹,就创建个文件夹
if
(
entry
.
isDirectory
())
{
if
(
entry
.
isDirectory
())
{
String
dirPath
=
destDirPath
+
"/"
+
entry
.
getName
();
String
dirPath
=
destDirPath
+
"/"
+
entry
.
getName
();
...
@@ -245,7 +250,7 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
...
@@ -245,7 +250,7 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
TElecEmployeeInfo
tElecEmployeeInfo
=
new
TElecEmployeeInfo
();
TElecEmployeeInfo
tElecEmployeeInfo
=
new
TElecEmployeeInfo
();
if
(
empInfo
.
length
()
>
empInfo
.
lastIndexOf
(
"/"
)
+
1
)
{
if
(
empInfo
.
length
()
>
empInfo
.
lastIndexOf
(
"/"
)
+
1
)
{
String
idCard
=
empInfo
.
substring
(
0
,
empInfo
.
indexOf
(
"/
"
));
idCard
=
empInfo
.
substring
(
0
,
empInfo
.
indexOf
(
"-
"
));
String
dataType
=
empInfo
.
substring
(
empInfo
.
indexOf
(
"/"
)
+
1
,
empInfo
.
lastIndexOf
(
"/"
));
String
dataType
=
empInfo
.
substring
(
empInfo
.
indexOf
(
"/"
)
+
1
,
empInfo
.
lastIndexOf
(
"/"
));
String
empName
=
""
;
String
empName
=
""
;
employeeInfo
=
tEmployeeInfoService
.
getOne
((
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
employeeInfo
=
tEmployeeInfoService
.
getOne
((
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
...
@@ -388,16 +393,12 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
...
@@ -388,16 +393,12 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
}
}
public
boolean
containsCheckTwo
(
String
e
,
String
idCard
)
{
public
boolean
containsCheckTwo
(
String
e
,
String
idCard
)
{
if
(
e
.
contains
(
idCard
)
&&
e
.
length
()
>
20
)
{
return
e
.
contains
(
idCard
)
&&
e
.
length
()
>
20
;
return
true
;
}
return
false
;
}
}
public
boolean
containsCheckOne
(
String
e
,
String
cardType
)
{
public
boolean
containsCheckOne
(
String
e
,
String
cardType
)
{
if
(
e
.
contains
(
cardType
)
&&
e
.
contains
(
CommonConstants
.
SPOT
))
{
String
empIdcard
=
cardType
.
substring
(
0
,
cardType
.
indexOf
(
"_"
));
return
true
;
String
fileName
=
cardType
.
substring
(
cardType
.
indexOf
(
"_"
)
+
1
,
cardType
.
length
());
}
return
e
.
contains
(
empIdcard
)
&&
e
.
contains
(
fileName
)
&&
e
.
contains
(
CommonConstants
.
SPOT
);
return
false
;
}
}
}
}
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