增加首页统计数据方法
Some checks are pending
Java CI with Maven / build (11) (push) Waiting to run
Java CI with Maven / build (17) (push) Waiting to run
Java CI with Maven / build (8) (push) Waiting to run
yudao-ui-admin CI / build (14.x) (push) Waiting to run
yudao-ui-admin CI / build (16.x) (push) Waiting to run

This commit is contained in:
lxd 2024-08-21 18:02:07 +08:00
parent c2c53271d4
commit 510581e4f5
10 changed files with 89 additions and 2 deletions

View File

@ -394,4 +394,14 @@ public class ApplyformController {
return success(true);
}
@GetMapping("/getreglisrcount")
public CommonResult<ApplyformCountVO> GetReglistCount()
{
//获取当前登陆用户
AdminUserDO user = userService.getUser(getLoginUserId());
ApplyformCountVO applyformCountVO= applyformService.GetRegisCount(user.getOrgId());
return success(applyformCountVO);
}
}

View File

@ -9,6 +9,8 @@ import cn.iocoder.yudao.module.applyregistration.dal.dataobject.applyform.Applyf
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.applyregistration.controller.admin.applyform.vo.*;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/**
* 申请登记记录 Mapper
@ -45,5 +47,14 @@ public interface ApplyformMapper extends BaseMapperX<ApplyformDO> {
.eqIfPresent(ApplyformDO::getDeviceDepartmentCode,reqVO.getDeviceDepartmentCode())
.orderByDesc(ApplyformDO::getId));
}
//统计登记单相关信息
@Select(" SELECT " +
" COUNT(*) AS totalcount, " +
" COUNT(CASE WHEN examStatus = '未分检' THEN 1 END) AS wfj, " +
" COUNT(CASE WHEN examStatus = '未检查' THEN 1 END) AS wjc, " +
" COUNT(CASE WHEN examStatus = '已检查' THEN 1 END) AS yjc, " +
" COUNT(CASE WHEN examStatus = '已放弃' THEN 1 END) AS yfq " +
" FROM tb_reglist WHERE orgId =#{orgId}")
ApplyformCountVO GetRegisCount(@Param("orgId") String orgId);
}

View File

@ -69,4 +69,7 @@ public interface ApplyformService extends IService<ApplyformDO> {
PageResult<ApplyformDO> getApplyformPage(ApplyformPageReqVO pageReqVO);
boolean insertbatch(List<ApplyformDO> doList);
// 统计登记单相关信息
ApplyformCountVO GetRegisCount(String orgId);
}

View File

@ -141,4 +141,9 @@ public class ApplyformServiceImpl extends ServiceImpl<ApplyformMapper, Applyform
return bol;
}
@Override
public ApplyformCountVO GetRegisCount(String orgId) {
return applyformMapper.GetRegisCount(orgId);
}
}

View File

@ -239,6 +239,26 @@ public class PatientexamlistController {
patientexamlistService.updatePatientexamlist(updateReqVO);
return success(true);
}
@GetMapping("/WholeDiagFlagCount")
@Operation(summary = "首页饼状图统计")
public CommonResult<PatientexamlistCountVO> GetWholeDiagFlagCount()
{
//获取当前登陆用户
AdminUserDO user = userService.getUser(getLoginUserId());
PatientexamlistCountVO patientexamlistCountVO= patientexamlistService.GetWholeDiagFlagCount(user.getOrgId());
return success(patientexamlistCountVO);
}
@GetMapping("/GetDateYYZDYXCount")
@Operation(summary = "首页折线图统计")
public CommonResult<List<PatientexamlistCountVO>> GetDateYYZDYXCount()
{
//获取当前登陆用户
AdminUserDO user = userService.getUser(getLoginUserId());
List<PatientexamlistCountVO> patientexamlistCountVO= patientexamlistService.GetDateWholeDiagFlagCount(user.getOrgId());
return success(patientexamlistCountVO);
}
}

View File

@ -77,4 +77,25 @@ public interface PatientexamlistMapper extends BaseMapperX<PatientexamlistDO> {
// 查询需要刷新的数据
@Select("select * from tb_patientexamlist where reportstatus='已分检' and examDate is null and orgId=#{orgId}")
List<PatientexamlistDO> GetSortingDataList(@Param("orgId") String orgId);
// 查询已检查数据的阴性阳性重大阳性统计
@Select(" SELECT COUNT(*) AS totalcount, SUM(CASE WHEN diagFlag = '0' THEN 1 ELSE 0 END) AS yx, SUM(CASE WHEN diagFlag = '1' THEN 1 ELSE 0 END) AS y, SUM(CASE WHEN diagFlag = '2' THEN 1 ELSE 0 END) AS zdyx " +
" ,SUM( CASE WHEN gender = '男' THEN 1 ELSE 0 END ) AS F,SUM( CASE WHEN gender = '女' THEN 1 ELSE 0 END ) AS M FROM tb_patientexamlist WHERE examDate IS NOT NULL and orgId=#{orgId}")
PatientexamlistCountVO GetWholeDiagFlagCount(@Param("orgId") String orgId);
// 统计一周内的数据已检查数据的阴性阳性重大阳性
@Select("SELECT "
+ "DATE_FORMAT(examDate, '%Y-%m-%d') AS date, "
+ "COUNT(*) AS totalcount, "
+ "SUM(CASE WHEN diagFlag = '0' THEN 1 ELSE 0 END) AS yx, "
+ "SUM(CASE WHEN diagFlag = '1' THEN 1 ELSE 0 END) AS y, "
+ "SUM(CASE WHEN diagFlag = '2' THEN 1 ELSE 0 END) AS zdyx "
+ "FROM tb_patientexamlist "
+ "WHERE examDate IS NOT NULL "
+ "AND examDate >= CURDATE() - INTERVAL 7 DAY "
+ "AND orgId = #{orgId} "
+ "GROUP BY date "
+ " ORDER BY date")
List<PatientexamlistCountVO> GetDateYYZDCount(@Param("orgId") String orgId);
}

View File

@ -92,4 +92,9 @@ public interface PatientexamlistService extends IService<PatientexamlistDO> {
boolean dicomDataRefresh(String orgId);
boolean insertbatch(List<PatientexamlistDO> doList);
// 获取已检查的阴性阳性重大阳性统计
PatientexamlistCountVO GetWholeDiagFlagCount(String orgId);
// 获取一周已检查的阴性阳性重大阳性统计
List<PatientexamlistCountVO> GetDateWholeDiagFlagCount(String orgId);
}

View File

@ -237,4 +237,16 @@ public class PatientexamlistServiceImpl extends ServiceImpl<PatientexamlistMappe
return bol;
}
@Override
public PatientexamlistCountVO GetWholeDiagFlagCount(String orgId) {
return patientexamlistMapper.GetWholeDiagFlagCount(orgId);
}
@Override
public List<PatientexamlistCountVO> GetDateWholeDiagFlagCount(String orgId) {
return patientexamlistMapper.GetDateYYZDCount(orgId);
}
}

View File

@ -202,5 +202,5 @@ justauth:
cache:
type: REDIS
prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE::
timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟
timeout: 5m # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟

View File

@ -249,4 +249,4 @@ justauth:
cache:
type: REDIS
prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE::
timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟
timeout: 5m # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟