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
48ea6d30
Commit
48ea6d30
authored
Aug 08, 2022
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
薪资审核页面接口修改
parent
29b53fd9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
ExcelUtil.java
...m/yifu.cloud.plus.v1/yifu/common/core/util/ExcelUtil.java
+23
-3
No files found.
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/util/ExcelUtil.java
View file @
48ea6d30
...
...
@@ -18,6 +18,7 @@ import java.time.LocalDate;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
import
java.util.regex.Pattern
;
/**
* @Author fxj
...
...
@@ -266,7 +267,7 @@ public class ExcelUtil <T> implements Serializable {
//如果是需要从字典表取值数据的话在这里处理即可
if
(
Common
.
isNotNull
(
attr
.
readConverterExp
()))
{
tempStr
=
reverseByExp
(
c
,
attr
.
readConverterExp
());
tempStr
=
reverseByExp
(
c
,
attr
.
readConverterExp
());
if
(
Common
.
isEmpty
(
tempStr
)){
errorMessageHashMap
=
initErrorMessage
(
errorMessageHashMap
,
new
ErrorMessage
(
rowNum
,
"未找到:"
+
c
+
"的字典数据"
),
errorTemp
);
continue
;
...
...
@@ -689,13 +690,21 @@ public class ExcelUtil <T> implements Serializable {
return
errorInfo
(
attr
,
"_小于最小值"
,
i
);
}
}
else
{
if
(
Float
.
valueOf
(
c
).
intValue
()
<
attr
.
min
())
{
return
errorInfo
(
attr
,
"_
小于最小值
"
,
i
);
if
(
String
.
valueOf
(
Float
.
valueOf
(
c
).
intValue
()).
length
()
<
attr
.
min
())
{
return
errorInfo
(
attr
,
"_
长度小于"
+
Float
.
valueOf
(
attr
.
min
()).
intValue
()
+
"位
"
,
i
);
}
}
}
else
{
return
errorInfo
(
attr
,
"_必须为数字且最多两位小数"
,
i
);
}
}
else
if
(
attr
.
min
()
==
0
)
{
if
(
Common
.
isNumber
(
c
))
{
if
(
attr
.
isFloat
()){
if
(
Float
.
valueOf
(
c
).
compareTo
(
attr
.
min
())
<
CommonConstants
.
ZERO_INT
)
{
return
errorInfo
(
attr
,
"_小于最小值"
,
i
);
}
}
}
}
}
return
null
;
...
...
@@ -821,6 +830,17 @@ public class ExcelUtil <T> implements Serializable {
}
//校验字段是否符合要求 返回错误信息
error
=
validateUtil
(
c
,
attr
,
i
+
2
);
if
(
null
==
error
&&
attr
.
isDate
()
&&
Common
.
isNotNull
(
c
))
{
c
.
replace
(
"/"
,
"-"
).
replace
(
CommonConstants
.
YEAR
,
"-"
)
.
replace
(
CommonConstants
.
MONTH
,
"-"
).
replace
(
CommonConstants
.
DAY
,
""
);
Pattern
pattern
=
Pattern
.
compile
(
"[0-9]*"
);
if
(
pattern
.
matcher
(
c
).
matches
())
{
StringBuilder
sb
=
new
StringBuilder
(
c
);
sb
.
insert
(
4
,
"-"
);
sb
.
insert
(
7
,
"-"
);
c
=
sb
.
toString
();
}
}
if
(
null
!=
error
)
{
errorList
.
add
(
new
ErrorMessage
(
i
+
2
,
error
));
errorMessageHashMap
=
initErrorMessage
(
errorMessageHashMap
,
new
ErrorMessage
(
i
+
2
,
error
),
errorTemp
);
...
...
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