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
d75d7647
Commit
d75d7647
authored
Jan 14, 2026
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
huych-入职确认信息编辑提交
parent
2b68dc4a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
241 additions
and
246 deletions
+241
-246
TElectronicArchiveTaskController.java
...v1/batch/controller/TElectronicArchiveTaskController.java
+0
-19
ElectronicArchiveImportService.java
...plus/v1/batch/service/ElectronicArchiveImportService.java
+1
-2
ElectronicArchiveImportServiceImpl.java
...atch/service/impl/ElectronicArchiveImportServiceImpl.java
+240
-225
No files found.
yifu-batch/yifu-batch-biz/src/main/java/com/yifu/cloud/plus/v1/batch/controller/TElectronicArchiveTaskController.java
View file @
d75d7647
...
@@ -136,25 +136,6 @@ public class TElectronicArchiveTaskController {
...
@@ -136,25 +136,6 @@ public class TElectronicArchiveTaskController {
return
R
.
ok
(
task
);
return
R
.
ok
(
task
);
}
}
/**
* 手动触发异步处理(用于重试)
*
* @param taskId 任务ID
* @return R
*/
@Operation
(
summary
=
"手动触发异步处理"
,
description
=
"手动触发异步处理任务(用于重试失败的任务)"
)
@PostMapping
(
"/retryProcess/{taskId}"
)
public
R
<?>
retryProcess
(
@PathVariable
(
"taskId"
)
String
taskId
)
{
TElectronicArchiveTask
task
=
tElectronicArchiveTaskService
.
getById
(
taskId
);
if
(
task
==
null
)
{
return
R
.
failed
(
"任务不存在"
);
}
// 只有生成中或失败的任务才能重试
// 这里可以根据需要增加失败状态
return
importService
.
asyncProcessUpload
(
taskId
);
}
/**
/**
* 单个新增人员附件
* 单个新增人员附件
* 前端先调用 /fileUpload/uploadArchiveFile 接口上传文件获取附件ID列表
* 前端先调用 /fileUpload/uploadArchiveFile 接口上传文件获取附件ID列表
...
...
yifu-batch/yifu-batch-biz/src/main/java/com/yifu/cloud/plus/v1/batch/service/ElectronicArchiveImportService.java
View file @
d75d7647
...
@@ -35,9 +35,8 @@ public interface ElectronicArchiveImportService {
...
@@ -35,9 +35,8 @@ public interface ElectronicArchiveImportService {
* 第三步:异步处理上传
* 第三步:异步处理上传
*
*
* @param taskId 任务ID
* @param taskId 任务ID
* @return 处理结果
*/
*/
R
<?>
asyncProcessUpload
(
String
taskId
);
void
asyncProcessUpload
(
String
taskId
);
/**
/**
* 生成任务编号
* 生成任务编号
...
...
yifu-batch/yifu-batch-biz/src/main/java/com/yifu/cloud/plus/v1/batch/service/impl/ElectronicArchiveImportServiceImpl.java
View file @
d75d7647
...
@@ -33,9 +33,11 @@ import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
...
@@ -33,9 +33,11 @@ import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import
com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants
;
import
com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.log4j.Log4j2
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.Cache
;
import
org.springframework.cache.Cache
;
import
org.springframework.cache.CacheManager
;
import
org.springframework.cache.CacheManager
;
import
org.springframework.cache.support.SimpleValueWrapper
;
import
org.springframework.cache.support.SimpleValueWrapper
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.mock.web.MockMultipartFile
;
import
org.springframework.mock.web.MockMultipartFile
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -70,14 +72,22 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
...
@@ -70,14 +72,22 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
private
final
ArchivesDaprUtil
archivesDaprUtil
;
private
final
ArchivesDaprUtil
archivesDaprUtil
;
private
final
CacheManager
cacheManager
;
private
final
CacheManager
cacheManager
;
private
final
OSSUtil
ossUtil
;
private
final
OSSUtil
ossUtil
;
private
final
SysConfigLimitMapper
configLimitMapper
;
/**
* 自注入代理对象,用于解决@Async注解在类内部调用时失效的问题
*
* @Lazy 延迟加载,避免循环依赖
*/
@Autowired
@Lazy
private
ElectronicArchiveImportService
self
;
//初始化zip导入上限值
//初始化zip导入上限值
private
int
maxLimit
=
1
;
private
int
maxLimit
=
1
;
private
AtomicInteger
atomicInteger
=
new
AtomicInteger
(
0
);
private
AtomicInteger
atomicInteger
=
new
AtomicInteger
(
0
);
private
final
SysConfigLimitMapper
configLimitMapper
;
/**
/**
* 第一步:导入Excel模板文件
* 第一步:导入Excel模板文件
...
@@ -163,15 +173,15 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
...
@@ -163,15 +173,15 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
taskService
.
save
(
task
);
taskService
.
save
(
task
);
// 保存任务表附件
// 保存任务表附件
saveTaskAttachment
(
task
.
getId
(),
fileName
,
inputStream
,
"task_file"
+
"/"
+
task
.
getId
()
+
"_"
+
fileName
);
saveTaskAttachment
(
task
.
getId
(),
fileName
,
inputStream
,
"task_file"
+
"/"
+
task
.
getId
()
+
"_"
+
fileName
);
// 上传文件到阿里云OSS根目录
// 上传文件到阿里云OSS根目录
uploadFileToOSS
(
"task_file"
+
"/"
+
task
.
getId
()
+
"_"
+
fileName
,
fileBytes
);
uploadFileToOSS
(
"task_file"
+
"/"
+
task
.
getId
()
+
"_"
+
fileName
,
fileBytes
);
// 建立任务和档案详情的关联关系
// 建立任务和档案详情的关联关系
createTaskArchiveRelations
(
task
.
getId
(),
successList
);
createTaskArchiveRelations
(
task
.
getId
(),
successList
);
return
R
.
ok
(
task
.
getId
(),
"全部校验通过"
);
return
R
.
ok
(
task
.
getId
(),
"全部校验通过"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"导入Excel文件失败"
,
e
);
log
.
error
(
"导入Excel文件失败"
,
e
);
...
@@ -188,7 +198,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
...
@@ -188,7 +198,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
TEmployeeInfo
empInfo
;
TEmployeeInfo
empInfo
;
TSettleDomainSelectVo
settleResult
;
TSettleDomainSelectVo
settleResult
;
R
<
TEmployeeInfo
>
empResult
;
R
<
TEmployeeInfo
>
empResult
;
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
List
<
String
>
deptNoList
=
new
ArrayList
<>();
List
<
String
>
deptNoList
=
new
ArrayList
<>();
...
@@ -210,7 +220,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
...
@@ -210,7 +220,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
if
(
Common
.
isNotNull
(
user
)
&&
isCheck
)
{
if
(
Common
.
isNotNull
(
user
)
&&
isCheck
)
{
if
(
Common
.
isEmpty
(
deptNoList
)
||
!
deptNoList
.
contains
(
data
.
getDeptNo
()))
{
if
(
Common
.
isEmpty
(
deptNoList
)
||
!
deptNoList
.
contains
(
data
.
getDeptNo
()))
{
ErrorMessage
<
ArchiveImportVO
>
errorMessage
=
new
ErrorMessage
<>(
data
.
getRowIndex
()
ErrorMessage
<
ArchiveImportVO
>
errorMessage
=
new
ErrorMessage
<>(
data
.
getRowIndex
()
,
InsurancesConstants
.
DEPT_NO_NOT_IN_USER_DEPT_LIST
,
data
);
,
InsurancesConstants
.
DEPT_NO_NOT_IN_USER_DEPT_LIST
,
data
);
errorMessageList
.
add
(
errorMessage
);
errorMessageList
.
add
(
errorMessage
);
continue
;
continue
;
}
}
...
@@ -219,7 +229,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
...
@@ -219,7 +229,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
String
uniqueKey
=
data
.
getEmpIdcard
()
+
"_"
+
data
.
getEmpName
();
String
uniqueKey
=
data
.
getEmpIdcard
()
+
"_"
+
data
.
getEmpName
();
if
(
null
!=
map
.
get
(
uniqueKey
))
{
if
(
null
!=
map
.
get
(
uniqueKey
))
{
ErrorMessage
<
ArchiveImportVO
>
errorMessage
=
new
ErrorMessage
<>(
data
.
getRowIndex
()
ErrorMessage
<
ArchiveImportVO
>
errorMessage
=
new
ErrorMessage
<>(
data
.
getRowIndex
()
,
"第"
+
data
.
getRowIndex
()
+
"行:姓名和身份证信息存在重复数据"
,
data
);
,
"第"
+
data
.
getRowIndex
()
+
"行:姓名和身份证信息存在重复数据"
,
data
);
errorMessageList
.
add
(
errorMessage
);
errorMessageList
.
add
(
errorMessage
);
continue
;
continue
;
}
else
{
}
else
{
...
@@ -230,7 +240,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
...
@@ -230,7 +240,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
settleResult
=
archivesDaprUtil
.
selectDeptByNo
(
data
.
getDeptNo
());
settleResult
=
archivesDaprUtil
.
selectDeptByNo
(
data
.
getDeptNo
());
if
(
Common
.
isEmpty
(
settleResult
)
||
Common
.
isEmpty
(
settleResult
.
getCustomerCode
()))
{
if
(
Common
.
isEmpty
(
settleResult
)
||
Common
.
isEmpty
(
settleResult
.
getCustomerCode
()))
{
ErrorMessage
<
ArchiveImportVO
>
errorMessage
=
new
ErrorMessage
<>(
data
.
getRowIndex
()
ErrorMessage
<
ArchiveImportVO
>
errorMessage
=
new
ErrorMessage
<>(
data
.
getRowIndex
()
,
"第"
+
data
.
getRowIndex
()
+
"行:项目编码["
+
data
.
getDeptNo
()
+
"]信息不存在"
,
data
);
,
"第"
+
data
.
getRowIndex
()
+
"行:项目编码["
+
data
.
getDeptNo
()
+
"]信息不存在"
,
data
);
errorMessageList
.
add
(
errorMessage
);
errorMessageList
.
add
(
errorMessage
);
continue
;
continue
;
}
}
...
@@ -242,7 +252,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
...
@@ -242,7 +252,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
empResult
=
archivesDaprUtil
.
getTEmployeeInfoByIdcardAndName
(
vo
);
empResult
=
archivesDaprUtil
.
getTEmployeeInfoByIdcardAndName
(
vo
);
if
(
empResult
==
null
||
empResult
.
getData
()
==
null
)
{
if
(
empResult
==
null
||
empResult
.
getData
()
==
null
)
{
ErrorMessage
<
ArchiveImportVO
>
errorMessage
=
new
ErrorMessage
<>(
data
.
getRowIndex
()
ErrorMessage
<
ArchiveImportVO
>
errorMessage
=
new
ErrorMessage
<>(
data
.
getRowIndex
()
,
"第"
+
data
.
getRowIndex
()
+
"行:人员档案信息不存在"
,
data
);
,
"第"
+
data
.
getRowIndex
()
+
"行:人员档案信息不存在"
,
data
);
errorMessageList
.
add
(
errorMessage
);
errorMessageList
.
add
(
errorMessage
);
continue
;
continue
;
}
}
...
@@ -289,7 +299,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
...
@@ -289,7 +299,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
/**
/**
* 保存任务表附件
* 保存任务表附件
*/
*/
private
void
saveTaskAttachment
(
String
taskId
,
String
fileName
,
InputStream
inputStream
,
String
filePath
)
{
private
void
saveTaskAttachment
(
String
taskId
,
String
fileName
,
InputStream
inputStream
,
String
filePath
)
{
try
{
try
{
TAttaInfo
attaInfo
=
new
TAttaInfo
();
TAttaInfo
attaInfo
=
new
TAttaInfo
();
attaInfo
.
setAttaName
(
fileName
);
attaInfo
.
setAttaName
(
fileName
);
...
@@ -328,22 +338,22 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
...
@@ -328,22 +338,22 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
/**
/**
* 获取项目权限
* 获取项目权限
*
*
* @author huych
* @param userId
* @param userId
* @return {@link List< String>}
* @return {@link List< String>}
* @author huych
*/
*/
public
List
<
String
>
getDeptNoList
(
String
userId
){
public
List
<
String
>
getDeptNoList
(
String
userId
)
{
List
<
String
>
deptList
=
new
ArrayList
<>(
16
);
List
<
String
>
deptList
=
new
ArrayList
<>(
16
);
try
{
try
{
R
<
TSettleDomainListVo
>
settleDomainList
=
archivesDaprUtil
.
getSettleDomainIdsByUserId
(
userId
);
R
<
TSettleDomainListVo
>
settleDomainList
=
archivesDaprUtil
.
getSettleDomainIdsByUserId
(
userId
);
if
(
Common
.
isNotNull
(
settleDomainList
)
&&
settleDomainList
.
getCode
()
==
CommonConstants
.
SUCCESS
)
{
if
(
Common
.
isNotNull
(
settleDomainList
)
&&
settleDomainList
.
getCode
()
==
CommonConstants
.
SUCCESS
)
{
TSettleDomainListVo
data
=
settleDomainList
.
getData
();
TSettleDomainListVo
data
=
settleDomainList
.
getData
();
if
(
Optional
.
ofNullable
(
data
).
isPresent
()){
if
(
Optional
.
ofNullable
(
data
).
isPresent
())
{
deptList
=
data
.
getDeptNos
();
deptList
=
data
.
getDeptNos
();
}
}
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"查询项目信息出错:"
+
e
);
log
.
error
(
"查询项目信息出错:"
+
e
);
}
}
return
deptList
;
return
deptList
;
}
}
...
@@ -420,7 +430,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
...
@@ -420,7 +430,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
// 3. 校验同时上传任务数
// 3. 校验同时上传任务数
maxLimit
=
configLimitMapper
.
getSysConfigLimitByKey
(
"UPDOLOAD_MAX_LIMIT"
);
maxLimit
=
configLimitMapper
.
getSysConfigLimitByKey
(
"UPDOLOAD_MAX_LIMIT"
);
if
(
atomicInteger
.
incrementAndGet
()
>
maxLimit
){
if
(
atomicInteger
.
incrementAndGet
()
>
maxLimit
)
{
atomicInteger
.
decrementAndGet
();
atomicInteger
.
decrementAndGet
();
return
R
.
failed
(
"有其他客服正在上传中,请5分钟后重试"
);
return
R
.
failed
(
"有其他客服正在上传中,请5分钟后重试"
);
}
}
...
@@ -451,8 +461,8 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
...
@@ -451,8 +461,8 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
zipAtta
.
setAttaSrc
(
tempZipFile
.
getAbsolutePath
());
// 临时存储文件路径
zipAtta
.
setAttaSrc
(
tempZipFile
.
getAbsolutePath
());
// 临时存储文件路径
attaInfoService
.
save
(
zipAtta
);
attaInfoService
.
save
(
zipAtta
);
// 调用异步处理
// 调用异步处理
(通过self代理对象调用,使@Async生效)
asyncProcessUpload
(
taskId
);
self
.
asyncProcessUpload
(
taskId
);
return
R
.
ok
(
"ZIP文件提交成功,正在处理中"
);
return
R
.
ok
(
"ZIP文件提交成功,正在处理中"
);
...
@@ -475,7 +485,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
...
@@ -475,7 +485,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
*/
*/
@Override
@Override
@Async
@Async
public
R
<?>
asyncProcessUpload
(
String
taskId
)
{
public
void
asyncProcessUpload
(
String
taskId
)
{
List
<
ArchiveFeedbackVO
>
feedbackList
=
new
ArrayList
<>();
List
<
ArchiveFeedbackVO
>
feedbackList
=
new
ArrayList
<>();
File
tempDir
=
null
;
File
tempDir
=
null
;
...
@@ -485,7 +495,8 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
...
@@ -485,7 +495,8 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
// 查询任务及关联的明细
// 查询任务及关联的明细
TElectronicArchiveTask
task
=
taskService
.
getById
(
taskId
);
TElectronicArchiveTask
task
=
taskService
.
getById
(
taskId
);
if
(
task
==
null
)
{
if
(
task
==
null
)
{
return
R
.
failed
(
"任务不存在"
);
log
.
error
(
"任务不存在,任务ID:{}"
,
taskId
);
return
;
}
}
// 查询ZIP附件(从附件导入中获取)
// 查询ZIP附件(从附件导入中获取)
...
@@ -495,7 +506,8 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
...
@@ -495,7 +506,8 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
if
(
CollUtil
.
isEmpty
(
zipAttas
))
{
if
(
CollUtil
.
isEmpty
(
zipAttas
))
{
updateTaskStatus
(
task
,
ArchiveConstants
.
TASK_STATUS_NOT_UPLOADED
);
updateTaskStatus
(
task
,
ArchiveConstants
.
TASK_STATUS_NOT_UPLOADED
);
return
R
.
failed
(
"ZIP附件不存在"
);
log
.
error
(
"ZIP附件不存在,任务ID:{}"
,
taskId
);
return
;
}
}
TAttaInfo
zipAtta
=
zipAttas
.
get
(
0
);
TAttaInfo
zipAtta
=
zipAttas
.
get
(
0
);
...
@@ -503,13 +515,15 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
...
@@ -503,13 +515,15 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
// 从附件记录中获取ZIP文件路径
// 从附件记录中获取ZIP文件路径
if
(
StrUtil
.
isBlank
(
zipAtta
.
getAttaSrc
()))
{
if
(
StrUtil
.
isBlank
(
zipAtta
.
getAttaSrc
()))
{
updateTaskStatus
(
task
,
ArchiveConstants
.
TASK_STATUS_NOT_UPLOADED
);
updateTaskStatus
(
task
,
ArchiveConstants
.
TASK_STATUS_NOT_UPLOADED
);
return
R
.
failed
(
"ZIP文件路径为空"
);
log
.
error
(
"ZIP文件路径为空,任务ID:{}"
,
taskId
);
return
;
}
}
zipSourceFile
=
new
File
(
zipAtta
.
getAttaSrc
());
zipSourceFile
=
new
File
(
zipAtta
.
getAttaSrc
());
if
(!
zipSourceFile
.
exists
())
{
if
(!
zipSourceFile
.
exists
())
{
updateTaskStatus
(
task
,
ArchiveConstants
.
TASK_STATUS_NOT_UPLOADED
);
updateTaskStatus
(
task
,
ArchiveConstants
.
TASK_STATUS_NOT_UPLOADED
);
return
R
.
failed
(
"ZIP文件不存在"
);
log
.
error
(
"ZIP文件不存在,任务ID:{},文件路径:{}"
,
taskId
,
zipAtta
.
getAttaSrc
());
return
;
}
}
// 获取任务关联的明细
// 获取任务关联的明细
...
@@ -518,7 +532,8 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
...
@@ -518,7 +532,8 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
if
(
CollUtil
.
isEmpty
(
relations
))
{
if
(
CollUtil
.
isEmpty
(
relations
))
{
updateTaskStatus
(
task
,
ArchiveConstants
.
TASK_STATUS_NOT_UPLOADED
);
updateTaskStatus
(
task
,
ArchiveConstants
.
TASK_STATUS_NOT_UPLOADED
);
return
R
.
failed
(
"任务没有关联的明细数据"
);
log
.
error
(
"任务没有关联的明细数据,任务ID:{}"
,
taskId
);
return
;
}
}
List
<
String
>
detailIds
=
relations
.
stream
()
List
<
String
>
detailIds
=
relations
.
stream
()
...
@@ -533,7 +548,8 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
...
@@ -533,7 +548,8 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
tempDir
=
new
File
(
tempDirPath
);
tempDir
=
new
File
(
tempDirPath
);
if
(!
tempDir
.
exists
()
&&
!
tempDir
.
mkdirs
())
{
if
(!
tempDir
.
exists
()
&&
!
tempDir
.
mkdirs
())
{
updateTaskStatus
(
task
,
ArchiveConstants
.
TASK_STATUS_NOT_UPLOADED
);
updateTaskStatus
(
task
,
ArchiveConstants
.
TASK_STATUS_NOT_UPLOADED
);
return
R
.
failed
(
"创建临时目录失败"
);
log
.
error
(
"创建临时目录失败,任务ID:{},目录路径:{}"
,
taskId
,
tempDirPath
);
return
;
}
}
// 解压ZIP文件
// 解压ZIP文件
...
@@ -542,7 +558,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
...
@@ -542,7 +558,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
if
(!
zipSourceFile
.
canRead
())
{
if
(!
zipSourceFile
.
canRead
())
{
log
.
error
(
"ZIP文件不可读,路径:{}"
,
zipSourceFile
.
getAbsolutePath
());
log
.
error
(
"ZIP文件不可读,路径:{}"
,
zipSourceFile
.
getAbsolutePath
());
updateTaskStatus
(
task
,
ArchiveConstants
.
TASK_STATUS_NOT_UPLOADED
);
updateTaskStatus
(
task
,
ArchiveConstants
.
TASK_STATUS_NOT_UPLOADED
);
return
R
.
failed
(
"ZIP文件不可读"
)
;
return
;
}
}
// 使用指定字符集解压(支持中文文件名)
// 使用指定字符集解压(支持中文文件名)
// Windows系统通常使用GBK编码,Linux使用UTF-8
// Windows系统通常使用GBK编码,Linux使用UTF-8
...
@@ -556,7 +572,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
...
@@ -556,7 +572,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
log
.
error
(
"解压ZIP文件失败,任务ID:{},ZIP路径:{},临时目录:{}"
,
log
.
error
(
"解压ZIP文件失败,任务ID:{},ZIP路径:{},临时目录:{}"
,
taskId
,
zipSourceFile
.
getAbsolutePath
(),
tempDirPath
,
e
);
taskId
,
zipSourceFile
.
getAbsolutePath
(),
tempDirPath
,
e
);
updateTaskStatus
(
task
,
ArchiveConstants
.
TASK_STATUS_NOT_UPLOADED
);
updateTaskStatus
(
task
,
ArchiveConstants
.
TASK_STATUS_NOT_UPLOADED
);
return
R
.
failed
(
"解压ZIP文件失败:"
+
e
.
getMessage
()
+
",请检查ZIP文件是否完整且格式正确"
)
;
return
;
}
}
// 获取ZIP包的根目录(第一级目录,身份证+姓名目录)
// 获取ZIP包的根目录(第一级目录,身份证+姓名目录)
...
@@ -658,7 +674,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
...
@@ -658,7 +674,7 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
// 生成反馈表
// 生成反馈表
generateFeedbackExcel
(
task
,
feedbackList
);
generateFeedbackExcel
(
task
,
feedbackList
);
return
R
.
ok
(
"处理完成"
);
log
.
info
(
"异步任务处理完成,任务ID:{}"
,
taskId
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"异步处理任务失败,任务ID:{}"
,
taskId
,
e
);
log
.
error
(
"异步处理任务失败,任务ID:{}"
,
taskId
,
e
);
...
@@ -667,7 +683,6 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
...
@@ -667,7 +683,6 @@ public class ElectronicArchiveImportServiceImpl implements ElectronicArchiveImpo
if
(
task
!=
null
)
{
if
(
task
!=
null
)
{
updateTaskStatus
(
task
,
ArchiveConstants
.
TASK_STATUS_NOT_UPLOADED
);
updateTaskStatus
(
task
,
ArchiveConstants
.
TASK_STATUS_NOT_UPLOADED
);
}
}
return
R
.
failed
(
"处理失败:"
+
e
.
getMessage
());
}
finally
{
}
finally
{
// 清理临时解压目录
// 清理临时解压目录
if
(
tempDir
!=
null
&&
tempDir
.
exists
())
{
if
(
tempDir
!=
null
&&
tempDir
.
exists
())
{
...
...
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