From bc151f7648069b760e1eaf7d41ead3aac1d84bd4 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Wed, 27 Jul 2022 11:41:30 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E9=97=A8=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ImportCommonServiceImpl.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/com/engine/organization/service/impl/ImportCommonServiceImpl.java b/src/com/engine/organization/service/impl/ImportCommonServiceImpl.java index 73a99421..e0ab12c6 100644 --- a/src/com/engine/organization/service/impl/ImportCommonServiceImpl.java +++ b/src/com/engine/organization/service/impl/ImportCommonServiceImpl.java @@ -541,7 +541,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ saveImportDetailLog(historyDetailPO); continue nextRow; } - for (int index = split.length - 2; index >= 0; index--) { + for (int index = 0; index < split.length - 1; index++) { parentCompanyId = MapperProxyFactory.getProxy(CompMapper.class).getIdByNameAndPid(split[index], parentCompanyId == null ? 0 : parentCompanyId); if (null == parentCompanyId) { historyDetailPO.setOperateDetail(split[index] + "分部未找到对应数据"); @@ -576,6 +576,10 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ map.put("creator", user.getUID()); map.put("delete_type", 0); map.put("create_time", new Date()); + // 禁用表示为空,默认启用 + if (StringUtils.isBlank(Util.null2String(map.get("forbidden_tag")))) { + map.put("forbidden_tag", 0); + } MapperProxyFactory.getProxy(ExtMapper.class).insertExt(ExtendInfoParams.builder().tableName("JCL_ORG_COMP").params(map).build()); historyDetailPO.setOperateDetail("添加成功"); historyDetailPO.setStatus("1"); @@ -679,7 +683,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ saveImportDetailLog(historyDetailPO); continue nextRow; } - if (StringUtils.isNotBlank(cellValue) && StringUtils.isBlank(Util.null2String(reallyValue))) { + if (StringUtils.isNotBlank(cellValue) && StringUtils.isBlank(Util.null2String(reallyValue)) && !"parent_comp".equals(infoPO.getFieldName())) { // TODO 记录日志 historyDetailPO.setOperateDetail(infoPO.getFieldNameDesc() + "数据转换失败,未找到对应数据"); historyDetailPO.setStatus("0"); @@ -697,9 +701,9 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ saveImportDetailLog(historyDetailPO); continue nextRow; } - for (int index = split.length - 1; index >= 0; index--) { - parentCompanyId = MapperProxyFactory.getProxy(CompMapper.class).getIdByNameAndPid(split[index], parentDepartmentId == null ? 0 : parentDepartmentId); - if (null == parentDepartmentId) { + for (int index = 0; index < split.length; index++) { + parentCompanyId = MapperProxyFactory.getProxy(CompMapper.class).getIdByNameAndPid(split[index], parentCompanyId == null ? 0 : parentCompanyId); + if (null == parentCompanyId) { historyDetailPO.setOperateDetail(cellValue + "分部未找到对应数据"); historyDetailPO.setStatus("0"); saveImportDetailLog(historyDetailPO); @@ -726,7 +730,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ saveImportDetailLog(historyDetailPO); continue nextRow; } - for (int index = split.length - 2; index >= 0; index--) { + for (int index = 0; index < split.length - 1; index++) { parentDepartmentId = MapperProxyFactory.getProxy(DepartmentMapper.class).getIdByNameAndPid(split[index], parentCompanyId, parentDepartmentId == null ? 0 : parentDepartmentId); if (null == parentDepartmentId) { historyDetailPO.setOperateDetail(split[index] + "部门未找到对应数据"); @@ -763,6 +767,10 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ map.put("creator", user.getUID()); map.put("delete_type", 0); map.put("create_time", new Date()); + // 禁用表示为空,默认启用 + if (StringUtils.isBlank(Util.null2String(map.get("forbidden_tag")))) { + map.put("forbidden_tag", 0); + } MapperProxyFactory.getProxy(ExtMapper.class).insertExt(ExtendInfoParams.builder().tableName("JCL_ORG_DEPT").params(map).build()); historyDetailPO.setOperateDetail("添加成功"); historyDetailPO.setStatus("1");