部门导入

pull/170/MERGE^2
dxfeng 3 years ago
parent fc8aaf7729
commit bc151f7648

@ -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");

Loading…
Cancel
Save