|
@@ -2,7 +2,7 @@ package com.qmth.sop.business.templete.execute;
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import com.qmth.boot.api.exception.ApiException;
|
|
import com.qmth.boot.api.exception.ApiException;
|
|
-import com.qmth.sop.business.bean.dto.SysUserImportDto;
|
|
|
|
|
|
+import com.qmth.sop.business.bean.dto.UserArchivesImportDto;
|
|
import com.qmth.sop.business.entity.TBTask;
|
|
import com.qmth.sop.business.entity.TBTask;
|
|
import com.qmth.sop.business.service.TBTaskService;
|
|
import com.qmth.sop.business.service.TBTaskService;
|
|
import com.qmth.sop.business.templete.importData.AsyncImportTaskTemplete;
|
|
import com.qmth.sop.business.templete.importData.AsyncImportTaskTemplete;
|
|
@@ -31,9 +31,9 @@ import java.util.StringJoiner;
|
|
* @Date: 2021-08-12
|
|
* @Date: 2021-08-12
|
|
*/
|
|
*/
|
|
@Service
|
|
@Service
|
|
-public class AsyncSysUserDataImportService extends AsyncImportTaskTemplete {
|
|
|
|
- private final static Logger log = LoggerFactory.getLogger(AsyncSysUserDataImportService.class);
|
|
|
|
- public static final String OBJ_TITLE = "用户基本信息";
|
|
|
|
|
|
+public class AsyncUserArchivesImportService extends AsyncImportTaskTemplete {
|
|
|
|
+ private final static Logger log = LoggerFactory.getLogger(AsyncUserArchivesImportService.class);
|
|
|
|
+ public static final String OBJ_TITLE = "人员档案信息";
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
TaskLogicService taskLogicService;
|
|
TaskLogicService taskLogicService;
|
|
@@ -50,11 +50,11 @@ public class AsyncSysUserDataImportService extends AsyncImportTaskTemplete {
|
|
try {
|
|
try {
|
|
tbTask.setSummary(stringJoinerSummary.toString());
|
|
tbTask.setSummary(stringJoinerSummary.toString());
|
|
// 执行导入基础用户数据
|
|
// 执行导入基础用户数据
|
|
- Map<String, Object> result = taskLogicService.executeImportSysUserLogic(map);
|
|
|
|
- LinkedMultiValueMap<String, SysUserImportDto> sysUserImportDtoLinkedMultiValueMap = (LinkedMultiValueMap<String, SysUserImportDto>) result.get(SystemConstant.EXCEL_DATA);
|
|
|
|
|
|
+ Map<String, Object> result = taskLogicService.executeImportUserArchivesLogic(map);
|
|
|
|
+ LinkedMultiValueMap<String, UserArchivesImportDto> userArchivesImportDtoLinkedMultiValueMap = (LinkedMultiValueMap<String, UserArchivesImportDto>) result.get(SystemConstant.EXCEL_DATA);
|
|
String errorList = (String) result.get(SystemConstant.EXCEL_DATA_ERROR);
|
|
String errorList = (String) result.get(SystemConstant.EXCEL_DATA_ERROR);
|
|
- int successSize = Objects.nonNull(sysUserImportDtoLinkedMultiValueMap.get(BasicExcelListener.SUCCESS)) ? sysUserImportDtoLinkedMultiValueMap.get(BasicExcelListener.SUCCESS).size() : 0;
|
|
|
|
- int errorSize = Objects.nonNull(sysUserImportDtoLinkedMultiValueMap.get(BasicExcelListener.ERROR)) ? sysUserImportDtoLinkedMultiValueMap.get(BasicExcelListener.ERROR).size() : 0;
|
|
|
|
|
|
+ int successSize = Objects.nonNull(userArchivesImportDtoLinkedMultiValueMap.get(BasicExcelListener.SUCCESS)) ? userArchivesImportDtoLinkedMultiValueMap.get(BasicExcelListener.SUCCESS).size() : 0;
|
|
|
|
+ int errorSize = Objects.nonNull(userArchivesImportDtoLinkedMultiValueMap.get(BasicExcelListener.ERROR)) ? userArchivesImportDtoLinkedMultiValueMap.get(BasicExcelListener.ERROR).size() : 0;
|
|
stringJoinerSummary.add(MessageFormat.format("{0}{1}{2}{3}{4}{5}{6}{7}", DateUtil.format(new Date(), SystemConstant.DEFAULT_DATE_PATTERN), FINISH_TITLE, (successSize + errorSize), FINISH_TOTAL_SIZE, successSize, FINISH_SUCCESS_SIZE, errorSize, FINISH_ERROR_SIZE));
|
|
stringJoinerSummary.add(MessageFormat.format("{0}{1}{2}{3}{4}{5}{6}{7}", DateUtil.format(new Date(), SystemConstant.DEFAULT_DATE_PATTERN), FINISH_TITLE, (successSize + errorSize), FINISH_TOTAL_SIZE, successSize, FINISH_SUCCESS_SIZE, errorSize, FINISH_ERROR_SIZE));
|
|
if (Objects.nonNull(errorList) && !Objects.equals(errorList, "")) {
|
|
if (Objects.nonNull(errorList) && !Objects.equals(errorList, "")) {
|
|
tbTask.setResult(TaskResultEnum.ERROR);
|
|
tbTask.setResult(TaskResultEnum.ERROR);
|