院系管理员,分析报告 添加缓存

main
zhc077 4 months ago
parent b81bdfcac8
commit d77922fd7b
  1. 5
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/controller/UserHomePageController.java
  2. 3
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/service/UserHomePageService.java
  3. 32
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/service/UserHomePageServiceImpl.java

@ -56,8 +56,7 @@ public class UserHomePageController {
@AutoLog(value = "部门管理员-分析报告")
@ApiOperation(value = "河南机电-部门综合报告", notes = "河南机电-部门综合报告")
@GetMapping(value = "/report4Depart")
public Result report4Depart(String orgCode) {
Map<String, Object> result = homePageService.report4Depart(orgCode);
return Result.ok(result);
public Result report4Depart(String orgCode,boolean recreateFlag) {
return Result.ok(homePageService.report4Depart(orgCode, recreateFlag));
}
}

@ -1,6 +1,5 @@
package org.jeecg.modules.demo.homepage.service;
import java.util.List;
import java.util.Map;
public interface UserHomePageService {
@ -11,5 +10,5 @@ public interface UserHomePageService {
Object report4School(boolean recreateFlag);
Map<String, Object> report4Depart(String orgCode);
Object report4Depart(String orgCode, boolean recreateFlag);
}

@ -613,10 +613,12 @@ public class UserHomePageServiceImpl implements UserHomePageService {
}
@Override
public Map<String, Object> report4Depart(String orgCode) {
public Object report4Depart(String orgCode, boolean recreateFlag) {
Assert.notNull(orgCode, "部门编号不能为空");
final String REPORT4DEPART = "report4Depart";
Map<String, Object> resultMap = new LinkedHashMap<>();
if (recreateFlag) {
SysDepart sysDepart = iSysDepartService.getOne(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getOrgCode, orgCode));
if (ObjectUtil.isNull(sysDepart)) {
throw new JeecgBootException("部门不存在");
@ -804,26 +806,16 @@ public class UserHomePageServiceImpl implements UserHomePageService {
}
}
canSaiList.add(departMap);
resultMap.put("部门参赛情况列表", canSaiList);
/* List<AwardPersion> awardPersionList4Depart = iAwardPersionService.list(new LambdaQueryWrapper<AwardPersion>().eq(AwardPersion::getAnnualCompP, pointIds4Depart));
Map<String, Object> departHuoJiangMap = new LinkedHashMap<>();
departHuoJiangMap.put("部门名称", sysDepart.getDepartName());
departHuoJiangMap.put("获取人数", awardPersionList4Depart.size());
Map<String, List<AwardPersion>> awardNameMap = Optional.ofNullable(awardPersionList4Depart).orElse(new LinkedList<>()).stream()
.collect(Collectors.groupingBy(AwardPersion::getAwardname));
//遍历分组后的结果
Map<String, Object> awardTypeMap2 = new HashMap<>();
// AtomicInteger huoJiangCount = new AtomicInteger();
Optional.ofNullable(awardNameMap).orElse(new LinkedHashMap<>()).forEach((key, value) -> {
departHuoJiangMap.put(key, value.size());
// huoJiangCount.addAndGet(value.size());
});
// awardTypeMap2.put("获奖人数", huoJiangCount.get());
// huoJiangList.add(awardTypeMap2);
resultMap.put("部门获奖情况列表", departHuoJiangMap);*/
redisUtil.set(REPORT4DEPART, resultMap);
return resultMap;
} else {
boolean hasKey = redisUtil.hasKey(REPORT4DEPART);
if (hasKey) {
return redisUtil.get(REPORT4DEPART);
} else {
return this.report4Depart(orgCode, true);
}
}
}
Map<String, Object> convertProjectLevel(List<AnnualCompPoint> annualCompPointList) {

Loading…
Cancel
Save