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
eec72767
Commit
eec72767
authored
Jul 01, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
校验长度等优化
parent
8145c9e8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
138 additions
and
18 deletions
+138
-18
EmployeeVO.java
...a/com/yifu/cloud/plus/v1/yifu/archives/vo/EmployeeVO.java
+7
-0
EmployeeConstants.java
...ud/plus/v1/yifu/archives/Constants/EmployeeConstants.java
+13
-0
TEmployeeInfoServiceImpl.java
.../yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
+114
-18
ErrorCodes.java
....cloud.plus.v1/yifu/common/core/exception/ErrorCodes.java
+2
-0
messages_zh_CN.properties
...on-core/src/main/resources/i18n/messages_zh_CN.properties
+2
-0
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmployeeVO.java
View file @
eec72767
...
...
@@ -18,6 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.write.style.ColumnWidth
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
...
...
@@ -203,4 +204,10 @@ public class EmployeeVO implements Serializable {
@ExcelProperty
(
value
=
"备注"
)
private
String
remark
;
/**
* 通信地址
*/
@Schema
(
description
=
"通信地址"
)
private
String
contactAddress
;
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/Constants/EmployeeConstants.java
0 → 100644
View file @
eec72767
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
Constants
;
public
class
EmployeeConstants
{
public
static
final
String
IS_OR_NOT
=
"请填是/否"
;
public
static
final
String
SCHOOL_LENGTH
=
"学校长度超过50"
;
public
static
final
String
MAJOR_LENGTH
=
"专业长度超过50"
;
public
static
final
String
CONTACT_ADDRESS_LENGTH
=
"通信地址长度超过200"
;
public
static
final
String
REMARL_LENGTH
=
"备注长度超过200"
;
public
static
final
String
POST_LENGTH
=
"就职岗位长度超过20"
;
public
static
final
String
DEPT_NO_LENGTH
=
"项目编码长度超过20"
;
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
View file @
eec72767
...
...
@@ -24,6 +24,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import
com.pig4cloud.plugin.excel.vo.ErrorMessage
;
import
com.yifu.cloud.plus.v1.check.entity.TCheckIdCard
;
import
com.yifu.cloud.plus.v1.check.entity.TCheckMobile
;
import
com.yifu.cloud.plus.v1.yifu.archives.Constants.EmployeeConstants
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpEducation
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject
;
...
...
@@ -606,6 +607,9 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if
(
Common
.
isEmpty
(
employeeInfo
.
getDeptNo
()))
{
errorMsg
.
add
(
"项目编码必填!"
);
errorMsgMap
.
put
(
lineNum
,
new
ErrorMessage
(
"项目编码必填!"
));
}
else
if
(
employeeInfo
.
getDeptNo
().
length
()
>
20
)
{
errorMsg
.
add
(
"项目编码超长!"
);
errorMsgMap
.
put
(
lineNum
,
new
ErrorMessage
(
"项目编码超长!"
));
}
if
(
Common
.
isEmpty
(
employeeInfo
.
getEmpName
()))
{
errorMsg
.
add
(
"员工姓名必填!"
);
...
...
@@ -861,9 +865,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
saveEmp
.
setEmpNatrue
(
empNatrueMap
.
get
(
excel
.
getEmpNatrue
()));
}
}
saveEmp
.
setValidityStart
(
excel
.
getValidityStart
());
saveEmp
.
setValidityEnd
(
excel
.
getValidityEnd
());
saveEmp
.
setEmpEmail
(
excel
.
getEmpEmail
());
// 户籍所在地
if
(
Common
.
isNotNull
(
excel
.
getIdProvince
()))
{
if
(
areaMap
.
get
(
excel
.
getIdProvince
())
==
null
)
{
...
...
@@ -914,15 +915,54 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if
(
Common
.
isEmpty
(
excel
.
getHignEducation
()))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_HIGH_EDUCATION_ERROR
,
excel
.
getEmpIdcard
()));
}
}
else
{
}
else
if
(
CommonConstants
.
IS_FALSE
.
equals
(
excel
.
getIsCollege
()))
{
saveEmp
.
setIsCollege
(
CommonConstants
.
ZERO_INT
);
}
else
{
errorMsg
.
add
(
EmployeeConstants
.
IS_OR_NOT
);
}
}
saveEmp
.
setValidityStart
(
excel
.
getValidityStart
());
saveEmp
.
setValidityEnd
(
excel
.
getValidityEnd
());
// 邮箱
if
(
Common
.
isNotNull
(
excel
.
getEmpEmail
()))
{
if
(
excel
.
getEmpEmail
().
contains
(
"@"
))
{
if
(
excel
.
getEmpEmail
().
length
()
<
50
)
{
saveEmp
.
setEmpEmail
(
excel
.
getEmpEmail
());
}
else
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_EMAIL_LENGTH
,
excel
.
getEmpIdcard
()));
}
}
else
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_EMAIL_CHECK
,
excel
.
getEmpIdcard
()));
}
}
if
(
Common
.
isNotNull
(
excel
.
getSchool
()))
{
saveEmp
.
setSchool
(
excel
.
getSchool
());
if
(
excel
.
getSchool
().
length
()
>
50
)
{
errorMsg
.
add
(
EmployeeConstants
.
SCHOOL_LENGTH
);
}
else
{
saveEmp
.
setSchool
(
excel
.
getSchool
());
}
}
if
(
Common
.
isNotNull
(
excel
.
getMajor
()))
{
saveEmp
.
setMajor
(
excel
.
getMajor
());
if
(
excel
.
getMajor
().
length
()
>
50
)
{
errorMsg
.
add
(
EmployeeConstants
.
MAJOR_LENGTH
);
}
else
{
saveEmp
.
setMajor
(
excel
.
getMajor
());
}
}
if
(
Common
.
isNotNull
(
excel
.
getContactAddress
()))
{
if
(
excel
.
getContactAddress
().
length
()
>
200
)
{
errorMsg
.
add
(
EmployeeConstants
.
CONTACT_ADDRESS_LENGTH
);
}
else
{
saveEmp
.
setContactAddress
(
excel
.
getContactAddress
());
}
}
if
(
Common
.
isNotNull
(
excel
.
getRemark
()))
{
if
(
excel
.
getRemark
().
length
()
>
200
)
{
errorMsg
.
add
(
EmployeeConstants
.
REMARL_LENGTH
);
}
else
{
saveEmp
.
setRemark
(
excel
.
getRemark
());
}
}
if
(
Common
.
isNotNull
(
excel
.
getAdmissionDate
()))
{
saveEmp
.
setAdmissionDate
(
excel
.
getAdmissionDate
());
...
...
@@ -930,11 +970,19 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if
(
Common
.
isNotNull
(
excel
.
getGradutionDate
()))
{
saveEmp
.
setGradutionDate
(
excel
.
getGradutionDate
());
}
if
(
Common
.
isNotNull
(
excel
.
getRemark
()))
{
saveEmp
.
setRemark
(
excel
.
getRemark
());
}
if
(
Common
.
isNotNull
(
excel
.
getPost
()))
{
saveEmp
.
setPost
(
excel
.
getPost
());
if
(
excel
.
getPost
().
length
()
>
20
)
{
errorMsg
.
add
(
EmployeeConstants
.
POST_LENGTH
);
}
else
{
saveEmp
.
setPost
(
excel
.
getPost
());
}
}
if
(
Common
.
isNotNull
(
excel
.
getDeptNo
()))
{
if
(
excel
.
getDeptNo
().
length
()
>
20
)
{
errorMsg
.
add
(
EmployeeConstants
.
DEPT_NO_LENGTH
);
}
else
{
saveEmp
.
setDeptNo
(
excel
.
getDeptNo
());
}
}
this
.
setBaseData
(
saveEmp
,
CommonConstants
.
dingleDigitStrArray
[
4
],
user
);
saveList
.
add
(
saveEmp
);
...
...
@@ -1253,9 +1301,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
saveEmp
.
setEmpNatrue
(
empNatrueMap
.
get
(
excel
.
getEmpNatrue
()));
}
}
saveEmp
.
setValidityStart
(
excel
.
getValidityStart
());
saveEmp
.
setValidityEnd
(
excel
.
getValidityEnd
());
saveEmp
.
setEmpEmail
(
excel
.
getEmpEmail
());
// 户籍所在地
if
(
Common
.
isNotNull
(
excel
.
getIdProvince
()))
{
if
(
areaMap
.
get
(
excel
.
getIdProvince
())
==
null
)
{
...
...
@@ -1306,15 +1351,55 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if
(
Common
.
isEmpty
(
excel
.
getHignEducation
()))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_HIGH_EDUCATION_ERROR
,
excel
.
getEmpIdcard
()));
}
}
else
{
}
else
if
(
CommonConstants
.
IS_FALSE
.
equals
(
excel
.
getIsCollege
()))
{
saveEmp
.
setIsCollege
(
CommonConstants
.
ZERO_INT
);
}
else
{
errorMsg
.
add
(
EmployeeConstants
.
IS_OR_NOT
);
}
}
saveEmp
.
setValidityStart
(
excel
.
getValidityStart
());
saveEmp
.
setValidityEnd
(
excel
.
getValidityEnd
());
// 邮箱
if
(
Common
.
isNotNull
(
excel
.
getEmpEmail
()))
{
if
(
excel
.
getEmpEmail
().
contains
(
"@"
))
{
if
(
excel
.
getEmpEmail
().
length
()
<
50
)
{
saveEmp
.
setEmpEmail
(
excel
.
getEmpEmail
());
}
else
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_EMAIL_LENGTH
,
excel
.
getEmpIdcard
()));
}
}
else
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_EMAIL_CHECK
,
excel
.
getEmpIdcard
()));
}
}
if
(
Common
.
isNotNull
(
excel
.
getSchool
()))
{
saveEmp
.
setSchool
(
excel
.
getSchool
());
if
(
excel
.
getSchool
().
length
()
>
50
)
{
errorMsg
.
add
(
EmployeeConstants
.
SCHOOL_LENGTH
);
}
else
{
saveEmp
.
setSchool
(
excel
.
getSchool
());
}
}
if
(
Common
.
isNotNull
(
excel
.
getMajor
()))
{
saveEmp
.
setMajor
(
excel
.
getMajor
());
if
(
excel
.
getMajor
().
length
()
>
50
)
{
errorMsg
.
add
(
EmployeeConstants
.
MAJOR_LENGTH
);
}
else
{
saveEmp
.
setMajor
(
excel
.
getMajor
());
}
}
if
(
Common
.
isNotNull
(
excel
.
getContactAddress
()))
{
if
(
excel
.
getContactAddress
().
length
()
>
200
)
{
errorMsg
.
add
(
EmployeeConstants
.
CONTACT_ADDRESS_LENGTH
);
}
else
{
saveEmp
.
setContactAddress
(
excel
.
getContactAddress
());
}
}
if
(
Common
.
isNotNull
(
excel
.
getRemark
()))
{
if
(
excel
.
getRemark
().
length
()
>
200
)
{
errorMsg
.
add
(
EmployeeConstants
.
REMARL_LENGTH
);
}
else
{
saveEmp
.
setRemark
(
excel
.
getRemark
());
}
}
if
(
Common
.
isNotNull
(
excel
.
getAdmissionDate
()))
{
saveEmp
.
setAdmissionDate
(
excel
.
getAdmissionDate
());
...
...
@@ -1322,8 +1407,19 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if
(
Common
.
isNotNull
(
excel
.
getGradutionDate
()))
{
saveEmp
.
setGradutionDate
(
excel
.
getGradutionDate
());
}
if
(
Common
.
isNotNull
(
excel
.
getRemark
()))
{
saveEmp
.
setRemark
(
excel
.
getRemark
());
if
(
Common
.
isNotNull
(
excel
.
getPost
()))
{
if
(
excel
.
getPost
().
length
()
>
20
)
{
errorMsg
.
add
(
EmployeeConstants
.
POST_LENGTH
);
}
else
{
saveEmp
.
setPost
(
excel
.
getPost
());
}
}
if
(
Common
.
isNotNull
(
excel
.
getDeptNo
()))
{
if
(
excel
.
getDeptNo
().
length
()
>
20
)
{
errorMsg
.
add
(
EmployeeConstants
.
DEPT_NO_LENGTH
);
}
else
{
saveEmp
.
setDeptNo
(
excel
.
getDeptNo
());
}
}
// 更新时,不需要更新其余信息
newOld
=
new
EmployeeNewOldVO
();
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/exception/ErrorCodes.java
View file @
eec72767
...
...
@@ -257,6 +257,8 @@ public interface ErrorCodes {
String
ARCHIVES_IMPORT_EMP_LEAVEREASON_MUST
=
"archives.import.emp.leaveReason.must"
;
String
ARCHIVES_IMPORT_EMP_LEAVEREMARK_LENGTH
=
"archives.import.emp.leaveRemark.length"
;
String
ARCHIVES_IMPORT_EMP_HAVE_PROJECT
=
"archives.import.emp.have.project"
;
String
ARCHIVES_IMPORT_EMP_EMAIL_CHECK
=
"archives.import.emp.email.check"
;
String
ARCHIVES_IMPORT_EMP_EMAIL_LENGTH
=
"archives.import.emp.email.length"
;
/**
* 项目档案状态为已审核,禁止删除
...
...
yifu-common/yifu-common-core/src/main/resources/i18n/messages_zh_CN.properties
View file @
eec72767
...
...
@@ -84,6 +84,8 @@ archives.import.emp.empName.must=\u5458\u5DE5\u59D3\u540D\u5FC5\u586B
archives.import.emp.leaveReason.must
=
\u
51CF
\u6863\u
539F
\u
56E0
\u
5FC5
\u
586B
archives.import.emp.leaveRemark.length
=
\u
51CF
\u6863\u5907\u
6CE8
\u
8D85
\u
8FC7200
archives.import.emp.have.project
=
\u7981\u
6B62
\u
201C
\u
51CF
\u6863\u
201D
\u
8BE5
\u
4EBA
\u5458\u
5B58
\u5728\u
201C
\u
6B63
\u
5E38
\u
201D
\u
5B58
\u
7EED
\u7684\u
201C
\u9879\u
76EE
\u6863\u6848\u
201D
archives.import.emp.email.check
=
\u
8BF7
\u
8F93
\u5165\u
6B63
\u
786E
\u7684\u
90AE
\u
7BB1
\u
683C
\u
5F0F
archives.import.emp.email.length
=
\u
90AE
\u
7BB1
\u
4E0D
\u
53EF
\u
8D85
\u
8FC750
\u
5B57
import.file.type.error
=
\u
5BFC
\u5165\u7684\u6587\u
4EF6
\u
683C
\u
5F0F
\u
4E0D
\u
6B63
\u
786E
...
...
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