feat: 老部门新部门对应关系导入

This commit is contained in:
2023-12-04 15:02:28 +08:00
parent 6b8415e1c4
commit d14e911b0c
4 changed files with 101 additions and 74 deletions
@@ -28,33 +28,19 @@ public class OldSystemDepartRelation implements Serializable {
@ApiModelProperty(value = "主键ID")
private String id;
/**
* 组织部门
*/
@Excel(name = "组织部门", width = 15)
@ApiModelProperty(value = "组织部门")
private String oldOrgName;
/**
* 上级组织
*/
@Excel(name = "上级组织", width = 15)
@ApiModelProperty(value = "上级组织")
@Excel(name = "上级组织", width = 15)
@ApiModelProperty(value = "上级组织")
private String oldOrgSuperior;
/**
* 组织级别
* 组织部门
*/
@Excel(name = "组织级别", width = 15)
@ApiModelProperty(value = "组织级别")
private String orgLevel;
/**
* 现组织部门
*/
@Excel(name = "现组织部门", width = 15)
@ApiModelProperty(value = "现组织部门")
private String curOrgName;
@Excel(name = "组织部门", width = 15)
@ApiModelProperty(value = "组织部门")
private String oldOrgName;
/**
* 现上级组织
@@ -63,6 +49,13 @@ public class OldSystemDepartRelation implements Serializable {
@ApiModelProperty(value = "现上级组织")
private String curOrgSuperior;
/**
* 现组织部门
*/
@Excel(name = "现组织部门", width = 15)
@ApiModelProperty(value = "现组织部门")
private String curOrgName;
/**
* 现组织部门Id
*/
@@ -89,7 +82,6 @@ public class OldSystemDepartRelation implements Serializable {
public boolean isEmptyRow() {
return oldOrgName == null &&
oldOrgSuperior == null &&
orgLevel == null &&
curOrgName == null &&
curOrgSuperior == null &&
curOrgId == null &&
@@ -75,6 +75,10 @@ public class OldSystemDepartRelationServiceImpl extends ServiceImpl<OldSystemDep
}
}
log.info("导入数据条数:{}", list.size());
// 过滤掉新部门为空的数据
list = list.stream().filter(dr -> dr.getCurOrgName() != null && !dr.getCurOrgName().isEmpty()).collect(Collectors.toList());
log.info("过滤掉新部门为空的数据后数据条数:{}", list.size());
// 获取所有有关联的新部门
LambdaQueryWrapper<SysDepart> sysDeptWrapper = new LambdaQueryWrapper<>();
sysDeptWrapper.eq(SysDepart::getDelFlag, CommonConstant.DEL_FLAG_0.toString());