|
|
|
@ -30,6 +30,7 @@ import com.engine.organization.mapper.jclimport.JclImportHistoryMapper;
|
|
|
|
|
import com.engine.organization.mapper.job.JobMapper;
|
|
|
|
|
import com.engine.organization.service.ImportCommonService;
|
|
|
|
|
import com.engine.organization.thread.OrganizationRunable;
|
|
|
|
|
import com.engine.organization.util.HasRightUtil;
|
|
|
|
|
import com.engine.organization.util.OrganizationAssert;
|
|
|
|
|
import com.engine.organization.util.db.MapperProxyFactory;
|
|
|
|
|
import com.engine.organization.util.excel.ExcelUtil;
|
|
|
|
@ -73,6 +74,8 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
private static final Long DEPARTMENT_TYPE = 2L;
|
|
|
|
|
private static final Long JOB_TYPE = 3L;
|
|
|
|
|
|
|
|
|
|
private static final String RIGHT_NAME = "DataImport:All";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ExtendInfoMapper getExtendInfoMapper() {
|
|
|
|
|
return MapperProxyFactory.getProxy(ExtendInfoMapper.class);
|
|
|
|
@ -212,6 +215,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
returnMap.put("pId", jobImport(operateType, excelFile));
|
|
|
|
|
break;
|
|
|
|
|
case "resource":
|
|
|
|
|
Long importHistoryId = saveImportLog("resource", operateType);
|
|
|
|
|
List<Object> lsErrorInfo = new ArrayList<>();
|
|
|
|
|
HrmImportAdaptExcelE9 importAdapt = new HrmImportAdaptExcelE9();
|
|
|
|
|
FileUploadToPath fu = new FileUploadToPath(request);
|
|
|
|
@ -223,9 +227,8 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
Map<String, HrmResourceVo> hrMap = importAdapt.getHrmImportMap();
|
|
|
|
|
|
|
|
|
|
HrmImportProcessE9 importProcess = new HrmImportProcessE9();
|
|
|
|
|
Map<String, Object> map = importProcess.init(request);
|
|
|
|
|
int pId = Util.getIntValue(Util.null2String(map.get("pId")));
|
|
|
|
|
returnMap.put("pId", pId);
|
|
|
|
|
importProcess.init(request, importHistoryId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
importProcess.processMap(hrMap);
|
|
|
|
|
} else {
|
|
|
|
@ -234,8 +237,10 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
error = new HashMap<>();
|
|
|
|
|
error.put("message", Util.null2String(errorInfo.get(i)));
|
|
|
|
|
lsErrorInfo.add(error);
|
|
|
|
|
MapperProxyFactory.getProxy(JclImportHistoryDetailMapper.class).insertHistoryDetail(JclImportHistoryDetailPO.builder().pid(importHistoryId).operateDetail(Util.null2String(errorInfo.get(i))).status("0").build());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
returnMap.put("pId", importHistoryId);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
@ -264,6 +269,14 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
return resultMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getHasRight() {
|
|
|
|
|
Map<String, Object> returnMap = new HashMap<>();
|
|
|
|
|
boolean hasRight = HasRightUtil.hasRight(user, RIGHT_NAME, true);
|
|
|
|
|
returnMap.put("hasRight", hasRight);
|
|
|
|
|
return returnMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 分部导入表单
|
|
|
|
@ -1083,8 +1096,6 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 读取表格文本内容
|
|
|
|
|
*/
|
|
|
|
|