添加学院/专业对比年级多选功能
This commit is contained in:
parent
c965397ebf
commit
9047390717
|
@ -152,7 +152,8 @@ public class Cet_4ServiceImpl extends ServiceImpl<Cet_4Mapper, Cet_4> implements
|
|||
public Result<JSONObject> getRateByCollege(JSONObject webData) {
|
||||
JSONArray colleges = webData.getJSONArray("college");
|
||||
|
||||
String entryDate = webData.getString("entrydate");
|
||||
JSONArray entryDateArray = webData.getJSONArray("entrydate");
|
||||
|
||||
//获取所有batch
|
||||
JSONObject batch = centerService.getBatch();
|
||||
JSONArray batchsArray = batch.getJSONArray("batches");
|
||||
|
@ -161,6 +162,11 @@ public class Cet_4ServiceImpl extends ServiceImpl<Cet_4Mapper, Cet_4> implements
|
|||
for (int i = 0; i < batchsArray.size(); i++) {
|
||||
batchs[i] = batchsArray.getJSONObject(i).getString("value");
|
||||
}
|
||||
JSONObject result = new JSONObject();
|
||||
JSONObject oneEntryDate = new JSONObject();
|
||||
|
||||
for (Object entryDate : entryDateArray) {
|
||||
|
||||
//根据entrydate转换为入学年份之后的八次list
|
||||
List<String> batchList = new ArrayList<>();
|
||||
for (int i = 0; i < batchs.length; i++) {
|
||||
|
@ -169,9 +175,9 @@ public class Cet_4ServiceImpl extends ServiceImpl<Cet_4Mapper, Cet_4> implements
|
|||
}
|
||||
String value = batchs[i];
|
||||
//获取入学年份之后的批次
|
||||
if (Integer.parseInt(value.substring(0, 4)) > Integer.parseInt(entryDate)) {
|
||||
if (Integer.parseInt(value.substring(0, 4)) > Integer.parseInt((String) entryDate)) {
|
||||
batchList.add(value);
|
||||
} else if (Integer.parseInt(value.substring(0, 4)) == Integer.parseInt(entryDate)) {
|
||||
} else if (Integer.parseInt(value.substring(0, 4)) == Integer.parseInt((String) entryDate)) {
|
||||
if (Integer.parseInt(value.substring(5, 7)) > 9) {
|
||||
batchList.add(value);
|
||||
}
|
||||
|
@ -184,7 +190,6 @@ public class Cet_4ServiceImpl extends ServiceImpl<Cet_4Mapper, Cet_4> implements
|
|||
LambdaQueryWrapper<Cet4_major> Cet4_majorQW = new LambdaQueryWrapper<>();
|
||||
///学院/专业的全部在籍学生
|
||||
long allStudent = 0;
|
||||
JSONObject result = new JSONObject();
|
||||
JSONArray ans = new JSONArray();
|
||||
//如果是全校,获取每个学院的数据
|
||||
if (colleges.size() > 1 || colleges.get(0).equals("全校")) {
|
||||
|
@ -300,8 +305,9 @@ public class Cet_4ServiceImpl extends ServiceImpl<Cet_4Mapper, Cet_4> implements
|
|||
}
|
||||
}
|
||||
}
|
||||
result.put("data", ans);
|
||||
|
||||
oneEntryDate.put((String) entryDate, ans);
|
||||
}
|
||||
result.put("data", oneEntryDate);
|
||||
return Result.ok(result);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue