This commit is contained in:
YuNan 2024-12-05 13:43:36 +08:00
commit a954982686
1 changed files with 5 additions and 0 deletions

View File

@ -96,6 +96,10 @@ public class Cet_4ServiceImpl extends ServiceImpl<Cet_4Mapper, Cet_4> implements
@Override
public Result<JSONObject> getRateByBatch(String college, String batchStr) {
if (redisTemplate.opsForValue().get("getRateByBatch" + college + batchStr) != null) {
return Result.ok((JSONObject) redisTemplate.opsForValue().get("getRateByBatch" + college + batchStr));
}
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
DecimalFormat decimalFormat = new DecimalFormat("#.#");
Date batch;
@ -176,6 +180,7 @@ public class Cet_4ServiceImpl extends ServiceImpl<Cet_4Mapper, Cet_4> implements
resultData.put("data", jsonObject);
resultData.put("gradeData", gradeByBatch);
System.out.println(resultData);
redisTemplate.opsForValue().set("getRateByBatch" + college + batchStr, resultData);
return Result.OK(resultData);
}