|
|
|
@ -16,6 +16,7 @@ import org.jeecg.common.system.query.QueryGenerator;
|
|
|
|
|
import org.jeecg.common.system.util.JwtUtil; |
|
|
|
|
import org.jeecg.common.system.vo.LoginUser; |
|
|
|
|
import org.jeecg.common.util.ImportExcelUtil; |
|
|
|
|
import org.jeecg.common.util.YouBianCodeUtil; |
|
|
|
|
import org.jeecg.common.util.oConvertUtils; |
|
|
|
|
import org.jeecg.modules.system.entity.SysDepart; |
|
|
|
|
import org.jeecg.modules.system.entity.SysUser; |
|
|
|
@ -332,7 +333,7 @@ public class SysDepartController {
|
|
|
|
|
params.setNeedSave(true); |
|
|
|
|
try { |
|
|
|
|
// orgCode编码长度
|
|
|
|
|
int codeLength = 3; |
|
|
|
|
int codeLength = YouBianCodeUtil.zhanweiLength; |
|
|
|
|
listSysDeparts = ExcelImportUtil.importExcel(file.getInputStream(), SysDepart.class, params); |
|
|
|
|
//按长度排序
|
|
|
|
|
Collections.sort(listSysDeparts, new Comparator<SysDepart>() { |
|
|
|
@ -362,6 +363,9 @@ public class SysDepartController {
|
|
|
|
|
}else{ |
|
|
|
|
sysDepart.setParentId(""); |
|
|
|
|
} |
|
|
|
|
//update-begin---author:liusq Date:20210223 for:批量导入部门以后,不能追加下一级部门 #2245------------
|
|
|
|
|
sysDepart.setOrgType(sysDepart.getOrgCode().length()/codeLength+""); |
|
|
|
|
//update-end---author:liusq Date:20210223 for:批量导入部门以后,不能追加下一级部门 #2245------------
|
|
|
|
|
sysDepart.setDelFlag(CommonConstant.DEL_FLAG_0.toString()); |
|
|
|
|
ImportExcelUtil.importDateSaveOne(sysDepart, ISysDepartService.class, errorMessageList, num, CommonConstant.SQL_INDEX_UNIQ_DEPART_ORG_CODE); |
|
|
|
|
num++; |
|
|
|
|