健康咨询大屏接口
This commit is contained in:
+2
@@ -58,5 +58,7 @@ public interface RequestPrefix {
|
||||
|
||||
String sessionReservationDate = BASE + "/sessionReservationDate";
|
||||
|
||||
String screen = BASE + "/screen";
|
||||
|
||||
|
||||
}
|
||||
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
package com.renkang.consultation.api.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.renkang.consultation.api.RequestPrefix;
|
||||
import com.renkang.consultation.api.service.ConHelperApiService;
|
||||
import com.renkang.consultation.dto.ConDoctorDTO;
|
||||
import com.renkang.consultation.entity.ConDoctor;
|
||||
import com.renkang.consultation.entity.ConSession;
|
||||
import com.renkang.consultation.service.IConDoctorService;
|
||||
import com.renkang.consultation.service.IConSessionService;
|
||||
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 org.apache.commons.collections4.CollectionUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.modules.manager.SysCacheImpl;
|
||||
import org.jeecg.modules.system.entity.SysDepart;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(RequestPrefix.screen)
|
||||
public class ConScreenApiController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IConDoctorService conDoctorService;
|
||||
@Autowired
|
||||
private IConSessionService conSessionService;
|
||||
@Autowired
|
||||
private SysCacheImpl sysCache;
|
||||
|
||||
@Operation(summary = "查询统计数", description = "查询统计数")
|
||||
@GetMapping("/queryStaticCount")
|
||||
public Result<?> queryStaticCount() {
|
||||
Map<String,Long> map = new HashMap<>();
|
||||
|
||||
//入驻医生数
|
||||
LambdaQueryWrapper<ConDoctor> dockerWrapper = new LambdaQueryWrapper<>();
|
||||
dockerWrapper.eq(ConDoctor::getDoctorStatus, "1");//只查有效的
|
||||
Long docCount = conDoctorService.count(dockerWrapper);
|
||||
map.put("docCount",docCount);
|
||||
//累计咨询
|
||||
Long consultCount = conSessionService.count();
|
||||
map.put("consultCount",consultCount);
|
||||
//累计咨询人数
|
||||
LambdaQueryWrapper<ConSession> sessionWrapper = new LambdaQueryWrapper<>();
|
||||
sessionWrapper.in(ConSession::getSessionType, "1", "2");
|
||||
sessionWrapper.groupBy(ConSession::getFromAccount);
|
||||
sessionWrapper.select(ConSession::getFromAccount);
|
||||
List<ConSession> fromAccountList = conSessionService.list(sessionWrapper);
|
||||
map.put("consultPersonCount", (long) fromAccountList.size());
|
||||
return Result.OK(map);
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询入驻专家", description = "分页查询入驻专家")
|
||||
@GetMapping("/queryPageList")
|
||||
public Result<IPage<ConDoctorVO>> queryPageList(ConDoctorDTO dto) {
|
||||
Page<ConDoctor> page = new Page<>(dto.getPageNo(), dto.getPageSize());
|
||||
dto.setDoctorTitle("2");//主任医师
|
||||
dto.setDoctorStatus("1");//有效
|
||||
IPage<ConDoctorVO> pageList = conDoctorService.queryPageList(page, dto);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@Operation(summary = "医院专家数量统计", description = "医院专家数量统计")
|
||||
@GetMapping("/queryDocCountStat")
|
||||
public Result<?> queryDocCountStat() {
|
||||
List<Map<String, Object>> mapList = conDoctorService.getDocCountStatList();
|
||||
return Result.OK(mapList);
|
||||
}
|
||||
@Operation(summary = "单位咨询数量统计", description = "单位咨询数量统计")
|
||||
@GetMapping("/queryDeptCountStat")
|
||||
public Result<?> queryDeptCountStat() {
|
||||
List<Map<String, Object>> mapList = conDoctorService.getDeptCountStatList();
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.OK(mapList);
|
||||
}
|
||||
@Operation(summary = "科室咨询数量统计", description = "科室咨询数量统计")
|
||||
@GetMapping("/queryDepartmentCountStat")
|
||||
public Result<?> queryDepartmentCountStat() {
|
||||
List<Map<String, Object>> mapList = conDoctorService.getDepartmentCountStatList();
|
||||
return Result.OK(mapList);
|
||||
}
|
||||
@Operation(summary = "医院咨询数量统计", description = "医院咨询数量统计")
|
||||
@GetMapping("/queryHospitalCountStat")
|
||||
public Result<?> queryHospitalCountStat() {
|
||||
List<Map<String, Object>> mapList = conDoctorService.getHospitalCountStatList();
|
||||
return Result.OK(mapList);
|
||||
}
|
||||
}
|
||||
+82
@@ -214,4 +214,86 @@ public interface ConDoctorMapper extends BaseMapper<ConDoctor> , MPJBaseMapper<C
|
||||
|
||||
String selectDoctorNoExist(@Param("doctorNo") String doctorNo,@Param("doctorId") String doctorId);
|
||||
|
||||
@Select("SELECT\n" +
|
||||
" * \n" +
|
||||
"FROM\n" +
|
||||
" (\n" +
|
||||
" SELECT\n" +
|
||||
" conr.resource_name hospitalName,\n" +
|
||||
" count(doct.resource_id) docCount \n" +
|
||||
" FROM\n" +
|
||||
" con_resource conr\n" +
|
||||
" LEFT JOIN con_doctor doct ON conr.id = doct.resource_id \n" +
|
||||
" GROUP BY\n" +
|
||||
" conr.id) a\n" +
|
||||
"ORDER BY\n" +
|
||||
" docCount DESC")
|
||||
List<Map<String, Object>> getDocCountStatList();
|
||||
|
||||
@Select("SELECT\n" +
|
||||
" * \n" +
|
||||
"FROM\n" +
|
||||
" (\n" +
|
||||
" SELECT\n" +
|
||||
" LEFT(org_code, 6) orgCode,\n" +
|
||||
" count(c.id) consultCount \n" +
|
||||
" FROM\n" +
|
||||
" con_session c \n" +
|
||||
" WHERE\n" +
|
||||
" c.del_flag = 0 \n" +
|
||||
" AND c.STATUS = '1' \n" +
|
||||
" AND (c.tf_reply = 1 OR c.user_tf_reply = 1) \n" +
|
||||
" AND c.session_type IN ('1', '2') \n" +
|
||||
" AND length(c.org_code) >= 6 \n" +
|
||||
" GROUP BY\n" +
|
||||
" LEFT(org_code, 6)) a \n" +
|
||||
"ORDER BY\n" +
|
||||
" consultCount DESC")
|
||||
List<Map<String, Object>> getDeptCountStatList();
|
||||
|
||||
@Select("SELECT\n" +
|
||||
" * \n" +
|
||||
"FROM\n" +
|
||||
" (\n" +
|
||||
" SELECT\n" +
|
||||
" cre.department_name departmentName,\n" +
|
||||
" count(cre.id) consultCount \n" +
|
||||
" FROM\n" +
|
||||
" con_session c\n" +
|
||||
" LEFT JOIN con_doctor d ON c.to_account = d.id\n" +
|
||||
" LEFT JOIN con_department cre ON d.department_id = cre.id \n" +
|
||||
" WHERE\n" +
|
||||
" c.del_flag = 0 \n" +
|
||||
" AND c.STATUS = '1' \n" +
|
||||
" AND (c.tf_reply = 1 OR c.user_tf_reply = 1) \n" +
|
||||
" AND c.session_type = '1' \n" +
|
||||
" AND cre.id IS NOT NULL \n" +
|
||||
" GROUP BY\n" +
|
||||
" cre.id) a \n" +
|
||||
"ORDER BY\n" +
|
||||
" consultCount DESC")
|
||||
List<Map<String, Object>> getDepartmentCountStatList();
|
||||
|
||||
@Select("SELECT\n" +
|
||||
" * \n" +
|
||||
"FROM\n" +
|
||||
" (\n" +
|
||||
" SELECT\n" +
|
||||
" cre.resource_name hospitalName,\n" +
|
||||
" count(cre.id) consultCount \n" +
|
||||
" FROM\n" +
|
||||
" con_session c\n" +
|
||||
" LEFT JOIN con_doctor d ON c.to_account = d.id\n" +
|
||||
" LEFT JOIN con_resource cre ON d.resource_id = cre.id \n" +
|
||||
" WHERE\n" +
|
||||
" c.del_flag = 0 \n" +
|
||||
" AND c.STATUS = '1' \n" +
|
||||
" AND (c.tf_reply = 1 OR c.user_tf_reply = 1) \n" +
|
||||
" AND c.session_type = '1' \n" +
|
||||
" AND cre.id IS NOT NULL \n" +
|
||||
" GROUP BY\n" +
|
||||
" cre.id) a \n" +
|
||||
"ORDER BY\n" +
|
||||
" consultCount DESC")
|
||||
List<Map<String, Object>> getHospitalCountStatList();
|
||||
}
|
||||
|
||||
+9
@@ -16,6 +16,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: con_doctor
|
||||
@@ -154,4 +155,12 @@ public interface IConDoctorService extends IService<ConDoctor> {
|
||||
void updateDoctorByLog(ConDoctorChangeLog changeLog);
|
||||
|
||||
void recommendDoctor(String id, Integer type);
|
||||
|
||||
List<Map<String, Object>> getDocCountStatList();
|
||||
|
||||
List<Map<String, Object>> getDeptCountStatList();
|
||||
|
||||
List<Map<String, Object>> getDepartmentCountStatList();
|
||||
|
||||
List<Map<String, Object>> getHospitalCountStatList();
|
||||
}
|
||||
|
||||
+20
@@ -1089,4 +1089,24 @@ public class ConDoctorServiceImpl extends ServiceImpl<ConDoctorMapper, ConDoctor
|
||||
doctor.setTfRecommend(String.valueOf(type));
|
||||
this.updateDoctor(doctor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getDocCountStatList() {
|
||||
return conDoctorMapper.getDocCountStatList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getDeptCountStatList() {
|
||||
return conDoctorMapper.getDeptCountStatList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getDepartmentCountStatList() {
|
||||
return conDoctorMapper.getDepartmentCountStatList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getHospitalCountStatList() {
|
||||
return conDoctorMapper.getHospitalCountStatList();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user