新疆需求整改

This commit is contained in:
feng
2025-12-25 11:16:29 +08:00
parent 7b473e5e36
commit 34c3c59c0c
4 changed files with 21 additions and 16 deletions
@@ -15,9 +15,11 @@ import com.renkang.consultation.vo.ConDoctorVO;
import com.renkang.consultation.vo.ConHelperCustomUserVO;
import com.renkang.emergency.entity.EmergencyCenterResource;
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.modules.manager.SysCacheImpl;
import org.jeecg.modules.system.entity.SysDepart;
import org.springframework.beans.factory.annotation.Autowired;
@@ -26,22 +28,17 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
@RestController
@RequestMapping(RequestPrefix.screen)
@RequiredArgsConstructor
public class ConScreenApiController {
@Autowired
private IConDoctorService conDoctorService;
@Autowired
private IConSessionService conSessionService;
@Autowired
private SysCacheImpl sysCache;
private final IConDoctorService conDoctorService;
private final IConSessionService conSessionService;
private final SysCacheImpl sysCache;
private final ISysBaseAPI sysBaseAPI;
@Operation(summary = "查询统计数", description = "查询统计数")
@GetMapping("/queryStaticCount")
@@ -108,16 +105,18 @@ public class ConScreenApiController {
@GetMapping("/queryDeptCountStat")
public Result<?> queryDeptCountStat() {
List<Map<String, Object>> mapList = conDoctorService.getDeptCountStatList();
//翻译部门名称之前循环查缓存20251225修改, 线上出现存在的部门未翻译成功的问题
Set<String> orgCodes = mapList.stream().map(map -> map.get("orgCode").toString()).collect(Collectors.toSet());
Map<String,String> orgCodeForName = sysBaseAPI.queryDepartNameByOrgCodes(orgCodes);
if(!CollectionUtils.isEmpty(mapList)){
for (Map<String, Object> map : mapList) {
SysDepart depart = sysCache.getDepartByOrgCode(map.get("orgCode").toString());
if(depart != null){
map.put("departName", depart.getDepartName());
}
String orgName = orgCodeForName.get(map.get("orgCode").toString());
map.put("departName", null != orgName ? orgName : "未知");
}
}
return Result.OK(mapList);
}
@Operation(summary = "科室咨询数量统计", description = "科室咨询数量统计")
@GetMapping("/queryDepartmentCountStat")
public Result<?> queryDepartmentCountStat() {