|
@@ -2,6 +2,7 @@ package com.qmth.teachcloud.common.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
|
+import com.qmth.teachcloud.common.base.BaseEntity;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
import com.qmth.teachcloud.common.entity.BasicSchool;
|
|
import com.qmth.teachcloud.common.entity.BasicSchool;
|
|
import com.qmth.teachcloud.common.entity.SysOrg;
|
|
import com.qmth.teachcloud.common.entity.SysOrg;
|
|
@@ -57,6 +58,7 @@ public class OrgCenterDataDisposeServiceImpl implements OrgCenterDataDisposeServ
|
|
List<SysOrg> updateSysOrgList = new ArrayList<>();
|
|
List<SysOrg> updateSysOrgList = new ArrayList<>();
|
|
|
|
|
|
for (Map map : result) {
|
|
for (Map map : result) {
|
|
|
|
+ Long orgCenterAppSchoolId = SystemConstant.convertIdToLong(String.valueOf(map.get("id"))); // 机构中心的id
|
|
String code = String.valueOf(map.get("code"));
|
|
String code = String.valueOf(map.get("code"));
|
|
String name = String.valueOf(map.get("name"));
|
|
String name = String.valueOf(map.get("name"));
|
|
String logo = String.valueOf(map.get("logo"));
|
|
String logo = String.valueOf(map.get("logo"));
|
|
@@ -76,8 +78,16 @@ public class OrgCenterDataDisposeServiceImpl implements OrgCenterDataDisposeServ
|
|
BasicSchool oldSchool = oldSchoolList.get(0);
|
|
BasicSchool oldSchool = oldSchoolList.get(0);
|
|
schoolId = oldSchool.getId();
|
|
schoolId = oldSchool.getId();
|
|
} else {
|
|
} else {
|
|
- // 系统中没有该学校 -》 新增 (系统中如果id被占用会报错)
|
|
|
|
- schoolId = SystemConstant.getDbUuid();
|
|
|
|
|
|
+ // 系统中没有该学校 -》 新增 (优先使用机构中心id如果该id在系统中已经被占用则会使用分布式id)
|
|
|
|
+ if (basicSchoolList.stream().map(BaseEntity::getId).collect(Collectors.toSet()).contains(orgCenterAppSchoolId)){
|
|
|
|
+ schoolId = SystemConstant.getDbUuid();
|
|
|
|
+ }else {
|
|
|
|
+ schoolId = orgCenterAppSchoolId;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 断言schoolId非空
|
|
|
|
+ if (!SystemConstant.longNotNull(schoolId)){
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception();
|
|
}
|
|
}
|
|
|
|
|
|
// 基础学校数据处理
|
|
// 基础学校数据处理
|