|
@@ -12,7 +12,6 @@ import com.qmth.boot.core.exception.StatusException;
|
|
import com.qmth.boot.tools.excel.ExcelReader;
|
|
import com.qmth.boot.tools.excel.ExcelReader;
|
|
import com.qmth.boot.tools.excel.enums.ExcelType;
|
|
import com.qmth.boot.tools.excel.enums.ExcelType;
|
|
import com.qmth.boot.tools.excel.model.DataMap;
|
|
import com.qmth.boot.tools.excel.model.DataMap;
|
|
-import com.qmth.exam.reserve.bean.applytask.CurrentApplyTaskVO;
|
|
|
|
import com.qmth.exam.reserve.bean.category.CategoryCacheBean;
|
|
import com.qmth.exam.reserve.bean.category.CategoryCacheBean;
|
|
import com.qmth.exam.reserve.bean.category.CategoryInfo;
|
|
import com.qmth.exam.reserve.bean.category.CategoryInfo;
|
|
import com.qmth.exam.reserve.bean.login.LoginUser;
|
|
import com.qmth.exam.reserve.bean.login.LoginUser;
|
|
@@ -37,8 +36,10 @@ import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
|
|
|
|
import java.io.InputStream;
|
|
import java.io.InputStream;
|
|
-import java.util.*;
|
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
public class CategoryServiceImpl extends ServiceImpl<CategoryDao, CategoryEntity> implements CategoryService {
|
|
public class CategoryServiceImpl extends ServiceImpl<CategoryDao, CategoryEntity> implements CategoryService {
|
|
@@ -90,6 +91,23 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryDao, CategoryEntity
|
|
|
|
|
|
List<CategoryInfo> list = new ArrayList<>();
|
|
List<CategoryInfo> list = new ArrayList<>();
|
|
|
|
|
|
|
|
+ // 需求变更:学生自主预约不再支持跨教学点,仅显示自己所在教学点和城市
|
|
|
|
+ CategoryCacheBean curCategory = categoryCacheService.getCategoryById(student.getCategoryId());
|
|
|
|
+ if (curCategory == null) {
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
+ CategoryInfo curInfo = new CategoryInfo();
|
|
|
|
+ curInfo.setId(curCategory.getId());
|
|
|
|
+ curInfo.setName(curCategory.getName());
|
|
|
|
+ curInfo.setLevel(curCategory.getLevel());
|
|
|
|
+ curInfo.setParentId(curCategory.getParentId());
|
|
|
|
+ curInfo.setSubNodes(new ArrayList<>());
|
|
|
|
+
|
|
|
|
+ // 获取父级分类
|
|
|
|
+ CategoryInfo parent = this.fillParentCategory(curInfo);
|
|
|
|
+ list.add(parent);
|
|
|
|
+
|
|
|
|
+ /*
|
|
// 获取当前启用的预约任务
|
|
// 获取当前启用的预约任务
|
|
CurrentApplyTaskVO curApplyTask = applyTaskCacheService.currentApplyTask(student.getOrgId());
|
|
CurrentApplyTaskVO curApplyTask = applyTaskCacheService.currentApplyTask(student.getOrgId());
|
|
if (curApplyTask == null) {
|
|
if (curApplyTask == null) {
|
|
@@ -111,9 +129,9 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryDao, CategoryEntity
|
|
curInfo.setParentId(curCategory.getParentId());
|
|
curInfo.setParentId(curCategory.getParentId());
|
|
curInfo.setSubNodes(new ArrayList<>());
|
|
curInfo.setSubNodes(new ArrayList<>());
|
|
|
|
|
|
- // 根节点
|
|
|
|
- CategoryInfo root = this.fillParentCategory(curInfo);
|
|
|
|
- list.add(root);
|
|
|
|
|
|
+ // 获取父级分类
|
|
|
|
+ CategoryInfo parent = this.fillParentCategory(curInfo);
|
|
|
|
+ list.add(parent);
|
|
|
|
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
@@ -140,7 +158,7 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryDao, CategoryEntity
|
|
this.fillSubCategory(curInfo, categoryMaps);
|
|
this.fillSubCategory(curInfo, categoryMaps);
|
|
|
|
|
|
list.add(curInfo);
|
|
list.add(curInfo);
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
@@ -336,7 +354,7 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryDao, CategoryEntity
|
|
msg.append(" 教学点名称不能超过50个字符");
|
|
msg.append(" 教学点名称不能超过50个字符");
|
|
} else {
|
|
} else {
|
|
List<CategoryEntity> categoryEntities = listTeachingByName(name);
|
|
List<CategoryEntity> categoryEntities = listTeachingByName(name);
|
|
- if(categoryEntities != null && !categoryEntities.isEmpty()) {
|
|
|
|
|
|
+ if (categoryEntities != null && !categoryEntities.isEmpty()) {
|
|
msg.append(" 教学点名称不能重复");
|
|
msg.append(" 教学点名称不能重复");
|
|
} else {
|
|
} else {
|
|
category.setName(name);
|
|
category.setName(name);
|
|
@@ -424,7 +442,7 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryDao, CategoryEntity
|
|
baseMapper.insert(category);
|
|
baseMapper.insert(category);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
private Long getIdByName(String cityName, List<CategoryVO> cityList) {
|
|
private Long getIdByName(String cityName, List<CategoryVO> cityList) {
|
|
for (CategoryVO city : cityList) {
|
|
for (CategoryVO city : cityList) {
|