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
2c54d235
Commit
2c54d235
authored
Jun 24, 2022
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
huyc 项目档案代码提交
parent
e185899f
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
113 additions
and
9 deletions
+113
-9
TElecEmployeeInfo.java
...cloud/plus/v1/yifu/archives/entity/TElecEmployeeInfo.java
+1
-2
TElecEmployeeInfoController.java
...yifu/archives/controller/TElecEmployeeInfoController.java
+13
-0
TEmployeeProjectController.java
.../yifu/archives/controller/TEmployeeProjectController.java
+1
-1
TElecEmployeeInfoService.java
...us/v1/yifu/archives/service/TElecEmployeeInfoService.java
+11
-0
TElecEmployeeInfoServiceImpl.java
...u/archives/service/impl/TElecEmployeeInfoServiceImpl.java
+69
-0
TEmployeeProjectServiceImpl.java
...fu/archives/service/impl/TEmployeeProjectServiceImpl.java
+6
-4
TElecEmployeeInfoMapper.xml
...biz/src/main/resources/mapper/TElecEmployeeInfoMapper.xml
+2
-2
CommonConstants.java
...ud.plus.v1/yifu/common/core/constant/CommonConstants.java
+4
-0
ErrorCodes.java
....cloud.plus.v1/yifu/common/core/exception/ErrorCodes.java
+4
-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/entity/TElecEmployeeInfo.java
View file @
2c54d235
...
...
@@ -51,8 +51,7 @@ public class TElecEmployeeInfo extends BaseEntity {
* 员工姓名
*/
@Schema
(
description
=
"员工姓名"
)
@NotNull
(
message
=
"员工姓名不能为空"
)
@Size
(
max
=
20
,
message
=
"员工姓名不可超过20位"
)
@TableField
(
exist
=
false
)
private
String
empName
;
/**
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TElecEmployeeInfoController.java
View file @
2c54d235
...
...
@@ -31,6 +31,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.validation.Valid
;
...
...
@@ -132,4 +133,16 @@ public class TElecEmployeeInfoController {
}
return
R
.
failed
(
"未找到身份证号对应的档案信息"
);
}
/**
* 批量导入电子档案
* @param file
* @return R
*/
@PostMapping
(
"/importZip"
)
@Operation
(
summary
=
"批量导入电子档案"
,
description
=
"批量导入电子档案"
)
@SysLog
(
"批量导入电子档案"
)
public
R
<
Boolean
>
importZip
(
@RequestParam
(
"file"
)
MultipartFile
file
)
{
return
this
.
tElecEmployeeInfoService
.
importZip
(
file
);
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmployeeProjectController.java
View file @
2c54d235
...
...
@@ -214,7 +214,7 @@ public class TEmployeeProjectController {
*/
@Operation
(
summary
=
"通过id批量删除项目档案"
,
description
=
"通过id批量删除项目档案"
)
@SysLog
(
"通过id批量删除项目档案"
)
@PostMapping
(
"/
{ids}
"
)
@PostMapping
(
"/
deletebyIds
"
)
@PreAuthorize
(
"@pms.hasPermission('archives_temployeeproject_batchdel')"
)
public
R
<
List
<
ErrorMessage
>>
removeByIds
(
@RequestParam
String
ids
)
{
return
tEmployeeProjectService
.
batchRemoveByIds
(
ids
);
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TElecEmployeeInfoService.java
View file @
2c54d235
...
...
@@ -21,6 +21,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TElecEmployeeInfo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
org.springframework.web.multipart.MultipartFile
;
/**
* 电子档案信息表
...
...
@@ -31,4 +33,13 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TElecEmployeeInfo;
public
interface
TElecEmployeeInfoService
extends
IService
<
TElecEmployeeInfo
>
{
IPage
<
TElecEmployeeInfo
>
getTElecEmployeeInfoPage
(
Page
page
,
TElecEmployeeInfo
vo
);
/**
* @description: 解析zip文件包中的多个附件,并生成结算记录
* @param file zip文件包
* @return: R
* @author: huyc
* @date: 2022/6/24
*/
R
<
Boolean
>
importZip
(
MultipartFile
file
);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TElecEmployeeInfoServiceImpl.java
View file @
2c54d235
...
...
@@ -16,13 +16,30 @@
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
service
.
impl
;
import
cn.hutool.core.io.FileTypeUtil
;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.util.CharsetUtil
;
import
cn.hutool.core.util.ZipUtil
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TElecEmployeeInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TElecEmployeeInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TElecEmployeeInfoService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
org.apache.commons.compress.archivers.zip.ZipArchiveEntry
;
import
org.apache.commons.compress.archivers.zip.ZipFile
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.BufferedReader
;
import
java.io.File
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
import
java.util.ArrayList
;
import
java.util.Enumeration
;
import
java.util.List
;
import
java.util.UUID
;
/**
* 电子档案信息表
...
...
@@ -42,4 +59,56 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
public
IPage
<
TElecEmployeeInfo
>
getTElecEmployeeInfoPage
(
Page
page
,
TElecEmployeeInfo
tElecEmployeeInfo
)
{
return
baseMapper
.
getTElecEmployeeInfoPage
(
page
,
tElecEmployeeInfo
);
}
/**
* @description: 解析zip文件包中的多个附件,并生成结算记录
* @param file zip文件包
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
* @author: wangweiguo
* @date: 2021/8/19
*/
@Override
public
R
<
Boolean
>
importZip
(
MultipartFile
file
)
{
File
unzip
=
null
;
File
etractFile
=
null
;
try
{
String
fileType
=
FileTypeUtil
.
getType
(
file
.
getInputStream
());
// if (!StringUtils.equalsIgnoreCase(fileType, CommonConstants.ZIP_TYPE)) {
// return R.failed(ErrorCodes.IMPORT_FILE_TYPE_ERROR);
// }
List
list
=
new
ArrayList
();
etractFile
=
new
File
(
UUID
.
randomUUID
().
toString
());
unzip
=
ZipUtil
.
unzip
(
file
.
getInputStream
(),
etractFile
,
CharsetUtil
.
CHARSET_GBK
);
ZipFile
zipFile
=
new
ZipFile
(
unzip
);
for
(
Enumeration
<?
extends
ZipArchiveEntry
>
e
=
zipFile
.
getEntries
();
e
.
hasMoreElements
();)
{
ZipArchiveEntry
entry
=
e
.
nextElement
();
if
(!
entry
.
isDirectory
()){
BufferedReader
br
=
new
BufferedReader
(
new
InputStreamReader
(
zipFile
.
getInputStream
(
entry
)));
String
line
=
""
;
while
((
line
=
br
.
readLine
())
!=
null
){
if
(
line
.
length
()
>
0
){
list
.
add
(
line
);
}
}
br
.
close
();
}
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
if
(
etractFile
!=
null
)
{
FileUtil
.
del
(
etractFile
);
}
}
return
R
.
ok
();
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeProjectServiceImpl.java
View file @
2c54d235
...
...
@@ -392,8 +392,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
insTEmployeeInfo
.
setFileStatus
(
CommonConstants
.
dingleDigitIntArray
[
0
]);
insTEmployeeInfo
.
setDeleteFlag
(
CommonConstants
.
STATUS_NORMAL
);
insTEmployeeInfo
.
setStatus
(
CommonConstants
.
dingleDigitIntArray
[
0
]);
//TODO HUYC 员工编码生成规则
insTEmployeeInfo
.
setEmpCode
(
"查询人员档案的编码"
);
insTEmployeeInfo
.
setEmpCode
(
this
.
getCode
());
YifuUser
user
=
SecurityUtils
.
getUser
();
insTEmployeeInfo
.
setCreateBy
(
user
.
getId
());
insTEmployeeInfo
.
setCreateName
(
user
.
getNickname
());
...
...
@@ -421,7 +420,10 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
insTEmployeePro
.
setEmpNo
(
str
);
//员工编码生成规则
insTEmployeePro
.
setEmpCode
(
"查询人员档案的编码"
);
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
insTEmployeePro
.
setEmpCode
(
tEmployeeInfo
.
getEmpCode
());
YifuUser
user
=
SecurityUtils
.
getUser
();
insTEmployeePro
.
setCreateBy
(
user
.
getId
());
insTEmployeePro
.
setCreateName
(
user
.
getNickname
());
...
...
@@ -471,7 +473,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if
(!
Common
.
isEmpty
(
ids
))
{
idsList
=
Common
.
initStrToList
(
ids
,
CommonConstants
.
COMMA_STRING
);
}
else
{
return
R
.
failed
(
"传参不能为空"
);
return
R
.
failed
(
ErrorCodes
.
PARAM_NOT_EMPTY
);
}
List
<
TEmployeeProject
>
list
=
new
ArrayList
<>();
if
(
Common
.
isNotEmpty
(
idsList
))
{
...
...
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TElecEmployeeInfoMapper.xml
View file @
2c54d235
...
...
@@ -44,7 +44,7 @@
<sql
id=
"Base_Column_List"
>
a.ID,
a
.EMP_NAME,
b
.EMP_NAME,
a.EMP_IDCARD,
b.EMP_NO,
b.UNIT_NAME,
...
...
@@ -67,7 +67,7 @@
AND a.ID = #{tElecEmployeeInfo.id}
</if>
<if
test=
"tElecEmployeeInfo.empName != null and tElecEmployeeInfo.empName.trim() != ''"
>
AND
a
.EMP_NAME = #{tElecEmployeeInfo.empName}
AND
b
.EMP_NAME = #{tElecEmployeeInfo.empName}
</if>
<if
test=
"tElecEmployeeInfo.empIdcard != null and tElecEmployeeInfo.empIdcard.trim() != ''"
>
AND a.EMP_IDCARD = #{tElecEmployeeInfo.empIdcard}
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/constant/CommonConstants.java
View file @
2c54d235
...
...
@@ -202,6 +202,8 @@ public interface CommonConstants {
int
FOUR_INT
=
4
;
String
TEN_STRING
=
"10"
;
public
static
final
String
SPOT
=
"."
;
/**
* 员工初始序列
* @Author pwang
...
...
@@ -247,6 +249,8 @@ public interface CommonConstants {
String
IS_TRUE
=
"是"
;
int
SIX_INT
=
6
;
int
EIGHT_INT
=
8
;
public
static
final
String
ZIP_TYPE
=
"zip"
;
int
BATCH_COUNT
=
100
;
String
IMPORT_DATA_ANALYSIS_ERROR
=
"数据导入解析异常,请检查表数据格式"
;
String
CREATE_TIME
=
"create_time"
;
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/exception/ErrorCodes.java
View file @
2c54d235
...
...
@@ -271,4 +271,8 @@ public interface ErrorCodes {
* 待划转员工已在目标项目下不可划转
*/
String
CHECKS_CHANGE_EMP_PROJECT
=
"checks.change.emp.project"
;
/**
* 导入的文件格式不正确
*/
String
IMPORT_FILE_TYPE_ERROR
=
"import.file.type.error"
;
}
yifu-common/yifu-common-core/src/main/resources/i18n/messages_zh_CN.properties
View file @
2c54d235
...
...
@@ -82,6 +82,8 @@ archives.import.emp.not.exists=\u6839\u636E\u8EAB\u4EFD\u8BC1\u672A\u627E\u5230\
archives.import.emp.idCard.must
=
\u
8EAB
\u
4EFD
\u
8BC1
\u
5FC5
\u
586B
archives.import.emp.leaveReason.must
=
\u
51CF
\u6863\u
539F
\u
56E0
\u
5FC5
\u
586B
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