|
|
@@ -16,6 +16,7 @@ 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.base.vo.BaseClassGradeVo;
|
|
|
import com.xjrsoft.module.student.dto.*;
|
|
|
import com.xjrsoft.module.student.service.IPbVXssfdetailService;
|
|
|
import com.xjrsoft.module.student.service.IPbVXsxxsfytbService;
|
|
|
@@ -28,10 +29,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* @title: 学生消费管理
|
|
|
@@ -68,27 +66,53 @@ public class ConsumptionController {
|
|
|
setName("年级");
|
|
|
}});
|
|
|
|
|
|
- baseGradeService.list().forEach((node) -> {
|
|
|
- if (node.getStatus() == 1) {
|
|
|
+ List<BaseClassGradeVo> classGradeVoList = baseClassService.getListByGrade();
|
|
|
+
|
|
|
+ if (!classGradeVoList.isEmpty()) {
|
|
|
+ for (BaseClassGradeVo classGradeVo : classGradeVoList) {
|
|
|
+
|
|
|
voList.add(new BaseClassTreeVo() {{
|
|
|
- setId(node.getId());
|
|
|
- setName(node.getName());
|
|
|
- setParentId(6L);
|
|
|
+ setId(classGradeVo.getId());
|
|
|
+ setName(classGradeVo.getName());
|
|
|
+ setParentId(classGradeVo.getGradeId());
|
|
|
+ setStatus(0);
|
|
|
+ if (qfCountMap.get(classGradeVo.getId()) != null && qfCountMap.get(classGradeVo.getId()) > 0) {
|
|
|
+ setStatus(1);
|
|
|
+ }
|
|
|
}});
|
|
|
+
|
|
|
+ if (voList.stream().noneMatch(item -> Objects.equals(item.getId(), classGradeVo.getGradeId()))) {
|
|
|
+ voList.add(new BaseClassTreeVo() {{
|
|
|
+ setId(classGradeVo.getId());
|
|
|
+ setName(classGradeVo.getName());
|
|
|
+ setParentId(6L);
|
|
|
+ }});
|
|
|
+ }
|
|
|
}
|
|
|
- });
|
|
|
-
|
|
|
- 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);
|
|
|
+ } else {
|
|
|
+
|
|
|
+ baseGradeService.list().forEach((node) -> {
|
|
|
+ if (node.getStatus() == 1) {
|
|
|
+ voList.add(new BaseClassTreeVo() {{
|
|
|
+ setId(node.getId());
|
|
|
+ setName(node.getName());
|
|
|
+ setParentId(6L);
|
|
|
+ }});
|
|
|
}
|
|
|
- }});
|
|
|
- });
|
|
|
+ });
|
|
|
+
|
|
|
+ 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<BaseClassTreeVo> treeVoList = TreeUtil.build(voList);
|
|
|
|