|
|
@@ -4,12 +4,15 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
import com.alibaba.excel.EasyExcel;
|
|
|
import com.alibaba.excel.support.ExcelTypeEnum;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.xjrsoft.common.enums.DeleteMark;
|
|
|
import com.xjrsoft.common.model.result.RT;
|
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
|
import com.xjrsoft.common.utils.TreeUtil;
|
|
|
+import com.xjrsoft.module.base.entity.BaseClass;
|
|
|
import com.xjrsoft.module.base.service.IBaseClassService;
|
|
|
import com.xjrsoft.module.base.service.IBaseGradeService;
|
|
|
import com.xjrsoft.module.student.dto.*;
|
|
|
@@ -30,7 +33,9 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
import javax.validation.Valid;
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* @title: 学生职务设置
|
|
|
@@ -52,45 +57,43 @@ public class ConsumptionController {
|
|
|
@GetMapping(value = "/tree")
|
|
|
@ApiOperation(value = "学生在读毕业年级班级树")
|
|
|
@SaCheckPermission("studentmanager:detail")
|
|
|
- public RT<List<BaseStudentTreeVo>> tree() {
|
|
|
- List<BaseStudentTreeVo> voList = new ArrayList<>();
|
|
|
+ public RT<List<BaseClassTreeVo>> tree() {
|
|
|
+ List<BaseClassTreeVo> voList = new ArrayList<>();
|
|
|
|
|
|
- voList.add(new BaseStudentTreeVo(){{
|
|
|
- setId(6L);
|
|
|
- setName("在读年级");
|
|
|
- }});
|
|
|
+ List<BaseClassQfCountVo> qfCount = pbVXsxxsfytbService.getClassQfCount();
|
|
|
+ Map<Long, Integer> qfCountMap = new HashMap<>();
|
|
|
+ for (BaseClassQfCountVo qfCountVo : qfCount) {
|
|
|
+ qfCountMap.put(qfCountVo.getId(), qfCountVo.getCount());
|
|
|
+ }
|
|
|
|
|
|
- voList.add(new BaseStudentTreeVo(){{
|
|
|
- setId(8L);
|
|
|
- setName("毕业年级");
|
|
|
+ voList.add(new BaseClassTreeVo(){{
|
|
|
+ setId(6L);
|
|
|
+ setName("年级");
|
|
|
}});
|
|
|
|
|
|
baseGradeService.list().forEach((node) -> {
|
|
|
if(node.getStatus() == 1){
|
|
|
- voList.add(new BaseStudentTreeVo(){{
|
|
|
+ voList.add(new BaseClassTreeVo(){{
|
|
|
setId(node.getId());
|
|
|
setName(node.getName());
|
|
|
setParentId(6L);
|
|
|
}});
|
|
|
}
|
|
|
- if(node.getStatus() == 0){
|
|
|
- voList.add(new BaseStudentTreeVo(){{
|
|
|
- setId(node.getId());
|
|
|
- setName(node.getName());
|
|
|
- setParentId(8L);
|
|
|
- }});
|
|
|
- }
|
|
|
});
|
|
|
|
|
|
- baseClassService.list().forEach((node)->{
|
|
|
- voList.add(new BaseStudentTreeVo(){{
|
|
|
+ baseClassService.list(new QueryWrapper<BaseClass>().lambda().eq(BaseClass::getDeleteMark, DeleteMark.NODELETE.getCode())).forEach((node)->{
|
|
|
+ voList.add(new BaseClassTreeVo(){{
|
|
|
setId(node.getId());
|
|
|
setName(node.getName());
|
|
|
setParentId(node.getGradeId());
|
|
|
+ setStatus(0);
|
|
|
+ if(qfCountMap.get(node.getId()) != null && qfCountMap.get(node.getId()) > 0){
|
|
|
+ setStatus(1);
|
|
|
+ }
|
|
|
}});
|
|
|
});
|
|
|
|
|
|
- List<BaseStudentTreeVo> treeVoList = TreeUtil.build(voList);
|
|
|
+ List<BaseClassTreeVo> treeVoList = TreeUtil.build(voList);
|
|
|
|
|
|
return RT.ok(treeVoList);
|
|
|
}
|