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
68e80d39
Commit
68e80d39
authored
Jun 28, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
4560adb8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
29 deletions
+17
-29
EmpEducationExcelVO.java
...u/cloud/plus/v1/yifu/archives/vo/EmpEducationExcelVO.java
+1
-1
EmpEducationUpdateExcelVo.java
...d/plus/v1/yifu/archives/vo/EmpEducationUpdateExcelVo.java
+5
-5
ExcelUtil.java
...m/yifu.cloud.plus.v1/yifu/common/core/util/ExcelUtil.java
+11
-23
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmpEducationExcelVO.java
View file @
68e80d39
...
...
@@ -64,7 +64,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable {
/**
* 学历名称
*/
@ExcelAttribute
(
name
=
"学历"
,
errorInfo
=
"学历不可为空"
,
isDataId
=
true
,
dataType
=
"
system_degree_dict
"
)
@ExcelAttribute
(
name
=
"学历"
,
errorInfo
=
"学历不可为空"
,
isDataId
=
true
,
dataType
=
"
education
"
)
@NotNull
(
message
=
"学历不可为空"
)
@ExcelProperty
(
value
=
"学历"
)
private
String
educationName
;
...
...
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmpEducationUpdateExcelVo.java
View file @
68e80d39
...
...
@@ -28,7 +28,7 @@ public class EmpEducationUpdateExcelVo extends RowIndex{
/**
* 学校名称
*/
@ExcelAttribute
(
name
=
"学校"
,
isNotEmpty
=
true
,
errorInfo
=
"学校不可为空"
)
@ExcelAttribute
(
name
=
"学校"
,
isNotEmpty
=
true
,
errorInfo
=
"学校不可为空"
,
maxLength
=
50
)
@NotNull
(
message
=
"学校不可为空"
)
@ExcelProperty
(
value
=
"学校"
)
private
String
school
;
...
...
@@ -36,7 +36,7 @@ public class EmpEducationUpdateExcelVo extends RowIndex{
/**
* 院系名称
*/
@ExcelAttribute
(
name
=
"院系名称"
)
@ExcelAttribute
(
name
=
"院系名称"
,
maxLength
=
50
)
@ExcelProperty
(
value
=
"院系名称"
)
private
String
collageSystem
;
...
...
@@ -44,7 +44,7 @@ public class EmpEducationUpdateExcelVo extends RowIndex{
/**
* 专业
*/
@ExcelAttribute
(
name
=
"专业"
,
isNotEmpty
=
true
,
errorInfo
=
"专业不可为空"
)
@ExcelAttribute
(
name
=
"专业"
,
isNotEmpty
=
true
,
errorInfo
=
"专业不可为空"
,
maxLength
=
50
)
@NotNull
(
message
=
"专业不可为空"
)
@ExcelProperty
(
value
=
"专业"
)
private
String
major
;
...
...
@@ -100,13 +100,13 @@ public class EmpEducationUpdateExcelVo extends RowIndex{
/**
* 证书名称
*/
@ExcelAttribute
(
name
=
"证书名称"
)
@ExcelAttribute
(
name
=
"证书名称"
,
maxLength
=
50
)
@ExcelProperty
(
value
=
"证书名称"
)
private
String
certificationName
;
/**
* 备注
*/
@ExcelAttribute
(
name
=
"
remark"
)
@ExcelAttribute
(
name
=
"
备注"
,
maxLength
=
200
)
@ExcelProperty
(
value
=
"备注"
)
private
String
remark
;
}
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/util/ExcelUtil.java
View file @
68e80d39
...
...
@@ -231,7 +231,12 @@ public class ExcelUtil <T> implements Serializable {
//如果是需要从字典表取值数据的话在这里处理即可
if
(
Common
.
isNotNull
(
attr
.
readConverterExp
()))
{
c
=
reverseByExp
(
c
,
attr
.
readConverterExp
());
tempStr
=
reverseByExp
(
c
,
attr
.
readConverterExp
());
if
(
Common
.
isEmpty
(
tempStr
)){
errorMessageHashMap
=
initErrorMessage
(
errorMessageHashMap
,
new
ErrorMessage
(
rowNum
,
"未找到:"
+
c
+
"的字典数据"
),
errorTemp
);
}
else
{
c
=
tempStr
;
}
}
else
if
(
attr
.
isDataId
())
{
if
(
Common
.
isNotNull
(
attr
.
dataType
()))
{
//非区域字段处理 TODO
...
...
@@ -351,33 +356,16 @@ public class ExcelUtil <T> implements Serializable {
public
static
String
reverseByExp
(
String
propertyValue
,
String
converterExp
)
throws
Exception
{
try
{
String
[]
convertSource
=
converterExp
.
split
(
","
);
if
(
propertyValue
.
contains
(
","
)){
String
[]
valueSource
=
propertyValue
.
split
(
","
);
propertyValue
=
""
;
for
(
String
value:
valueSource
){
for
(
String
item
:
convertSource
)
{
String
[]
itemArray
=
item
.
split
(
"="
);
if
(
itemArray
[
1
].
equals
(
value
))
{
propertyValue
+=
itemArray
[
0
]
+
","
;
break
;
}
}
}
if
(
propertyValue
.
endsWith
(
","
)){
propertyValue
=
propertyValue
.
substring
(
CommonConstants
.
dingleDigitIntArray
[
0
],
propertyValue
.
length
()-
1
);
}
}
else
{
for
(
String
item
:
convertSource
)
{
String
[]
itemArray
=
item
.
split
(
"="
);
if
(
itemArray
[
1
].
equals
(
propertyValue
))
{
return
itemArray
[
0
];
}
for
(
String
item
:
convertSource
)
{
String
[]
itemArray
=
item
.
split
(
"="
);
if
(
itemArray
[
1
].
equals
(
propertyValue
))
{
return
itemArray
[
0
];
}
}
}
catch
(
Exception
e
)
{
throw
e
;
}
return
propertyValue
;
return
null
;
}
/**
...
...
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