|
|
@ -3,6 +3,7 @@ package com.epmet.service.impl; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
|
import com.epmet.commons.tools.security.user.LoginUserUtil; |
|
|
|
import com.epmet.constants.ImportTaskConstants; |
|
|
|
import com.epmet.dao.ImportTaskDao; |
|
|
|
import com.epmet.entity.ImportTaskEntity; |
|
|
@ -24,6 +25,9 @@ public class ImportTaskServiceImpl implements ImportTaskService { |
|
|
|
@Autowired |
|
|
|
private ImportTaskDao importRecordDao; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private LoginUserUtil loginUserUtil; |
|
|
|
|
|
|
|
// /**
|
|
|
|
// * 该用户,该业务类型,是否有正在处理的导入任务
|
|
|
|
// * @param operatorId 操作者ID
|
|
|
@ -56,7 +60,7 @@ public class ImportTaskServiceImpl implements ImportTaskService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public String createProcessTask(String operatorId, String bizType) { |
|
|
|
public String createProcessTask(String operatorId, String bizType, String originFileName) { |
|
|
|
if (existsProcessingTask(operatorId, bizType)) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), |
|
|
|
"已存在执行中的导入任务,请等待执行完成。", |
|
|
@ -67,7 +71,9 @@ public class ImportTaskServiceImpl implements ImportTaskService { |
|
|
|
importRecord.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_PROCESSING); |
|
|
|
importRecord.setOperatorId(operatorId); |
|
|
|
importRecord.setBizType(bizType); |
|
|
|
importRecord.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
|
|
|
importRecord.setStartTime(new Date()); |
|
|
|
importRecord.setOriginFileName(originFileName); |
|
|
|
|
|
|
|
importRecordDao.insert(importRecord); |
|
|
|
return importRecord.getId(); |
|
|
|