|
@@ -201,6 +201,13 @@ public class SettleRelaConfigLogic {
|
|
List<Object> objects = ExcelUtils.importExcel(file);
|
|
List<Object> objects = ExcelUtils.importExcel(file);
|
|
Map<String, List<String>> importMap = new HashMap<>();
|
|
Map<String, List<String>> importMap = new HashMap<>();
|
|
|
|
|
|
|
|
+ final List<AdminWebsit> websitList = adminWebsitService.lambdaQuery()
|
|
|
|
+ .select(AdminWebsit::getWebsitId)
|
|
|
|
+ .eq(AdminWebsit::getLevel, 1)
|
|
|
|
+ .list();
|
|
|
|
+
|
|
|
|
+ final List<String> websitOneList = websitList.stream().map(AdminWebsit::getWebsitId).collect(Collectors.toList());
|
|
|
|
+
|
|
for (int i = 0; i < objects.size(); i++) {
|
|
for (int i = 0; i < objects.size(); i++) {
|
|
List<Object> row = (List<Object>) objects.get(i);
|
|
List<Object> row = (List<Object>) objects.get(i);
|
|
row = CommonUtils.initList2(row, 2);
|
|
row = CommonUtils.initList2(row, 2);
|
|
@@ -215,6 +222,10 @@ public class SettleRelaConfigLogic {
|
|
String parentId = (String) row.get(0);
|
|
String parentId = (String) row.get(0);
|
|
String subId = (String) row.get(1);
|
|
String subId = (String) row.get(1);
|
|
|
|
|
|
|
|
+ if (websitOneList.contains(subId)) {
|
|
|
|
+ throw new RemoteServiceException(subId + "不能导入一级网点");
|
|
|
|
+ }
|
|
|
|
+
|
|
if (importMap.containsKey(StrUtil.trim(parentId))) {
|
|
if (importMap.containsKey(StrUtil.trim(parentId))) {
|
|
importMap.get(StrUtil.trim(parentId)).add(subId);
|
|
importMap.get(StrUtil.trim(parentId)).add(subId);
|
|
} else {
|
|
} else {
|
|
@@ -250,16 +261,6 @@ public class SettleRelaConfigLogic {
|
|
throw new RemoteServiceException(err + "已有上级关系");
|
|
throw new RemoteServiceException(err + "已有上级关系");
|
|
}
|
|
}
|
|
|
|
|
|
- final Integer count = adminWebsitService.lambdaQuery()
|
|
|
|
- .eq(AdminWebsit::getWebsitId, entry.getValue())
|
|
|
|
- .eq(AdminWebsit::getLevel, 1)
|
|
|
|
- .count();
|
|
|
|
-
|
|
|
|
- if (count > 0) {
|
|
|
|
- final String err = entry.getKey();
|
|
|
|
- throw new RemoteServiceException(err + "不能导入一级网点");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
List<WebsitFollowConfigItem> items = new ArrayList<>();
|
|
List<WebsitFollowConfigItem> items = new ArrayList<>();
|
|
for (String subId : entry.getValue()) {
|
|
for (String subId : entry.getValue()) {
|
|
WebsitFollowConfigItem item = new WebsitFollowConfigItem();
|
|
WebsitFollowConfigItem item = new WebsitFollowConfigItem();
|