修改工作量查询方法参数
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
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:
parent
9f9fc10128
commit
ea865b9f3d
@ -156,35 +156,36 @@ public class EcganalysisparasController {
|
|||||||
@Operation(summary = "导出医生工作量统计Excel")
|
@Operation(summary = "导出医生工作量统计Excel")
|
||||||
@PreAuthorize("@ss.hasPermission('tblist:ecganalysisparas:export')")
|
@PreAuthorize("@ss.hasPermission('tblist:ecganalysisparas:export')")
|
||||||
@ApiAccessLog(operateType = EXPORT)
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
public void exportWorkloadExcel(@RequestParam("startTime") String startTime,
|
public void exportWorkloadExcel(
|
||||||
@RequestParam("endTime") String endTime,
|
@RequestParam("startTime") String startTime,
|
||||||
HttpServletResponse response) throws IOException {
|
@RequestParam("endTime") String endTime,
|
||||||
// 设置响应头
|
@RequestParam(value = "doctorName", required = false) String doctorName,
|
||||||
// response.setContentType("application/vnd.ms-excel");
|
HttpServletResponse response) throws IOException {
|
||||||
// response.setCharacterEncoding("utf-8");
|
|
||||||
// String fileName = URLEncoder.encode("医生工作量统计", "UTF-8").replaceAll("\\+", "%20");
|
|
||||||
// response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xls");
|
|
||||||
|
|
||||||
QueryWrapper<EcganalysisparasDO> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<EcganalysisparasDO> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.select("doctorId, doctorName, doctorDiagTime, COUNT(*) as count")
|
queryWrapper.select("doctorName, DATE(doctorDiagTime) as diagDate, COUNT(*) as count")
|
||||||
.ge("doctorDiagTime", startTime)
|
.ge("doctorDiagTime", startTime)
|
||||||
.le("doctorDiagTime", endTime)
|
.le("doctorDiagTime", endTime);
|
||||||
.groupBy("doctorId, doctorName, doctorDiagTime")
|
|
||||||
.orderByDesc("doctorDiagTime");
|
if (doctorName != null && !doctorName.isEmpty()) {
|
||||||
|
queryWrapper.eq("doctorName", doctorName);
|
||||||
|
}
|
||||||
|
|
||||||
|
queryWrapper.groupBy("doctorName, DATE(doctorDiagTime)")
|
||||||
|
.orderByAsc("doctorName")
|
||||||
|
.orderByDesc("diagDate");
|
||||||
|
|
||||||
List<Map<String, Object>> resultList = ecganalysisparasMapper.selectMaps(queryWrapper);
|
List<Map<String, Object>> resultList = ecganalysisparasMapper.selectMaps(queryWrapper);
|
||||||
List<EcgWorkloadVO> workloadList = new ArrayList<>();
|
List<EcgWorkloadVO> workloadList = new ArrayList<>();
|
||||||
|
|
||||||
for (Map<String, Object> result : resultList) {
|
for (Map<String, Object> result : resultList) {
|
||||||
EcgWorkloadVO workload = new EcgWorkloadVO();
|
EcgWorkloadVO workload = new EcgWorkloadVO();
|
||||||
//workload.setDoctorId((Integer) result.get("doctorId"));
|
|
||||||
workload.setDoctorName(result.get("doctorName").toString());
|
workload.setDoctorName(result.get("doctorName").toString());
|
||||||
workload.setDoctorDiagTime(result.get("doctorDiagTime").toString().replace('T',' '));
|
workload.setDoctorDiagTime(result.get("diagDate").toString());
|
||||||
workload.setCount((Long) result.get("count"));
|
workload.setCount((Long) result.get("count"));
|
||||||
workloadList.add(workload);
|
workloadList.add(workload);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导出Excel
|
// 导出Excel
|
||||||
ExcelUtils.write(response, "医生工作量统计.xls", "数据", EcgWorkloadVO.class, BeanUtils.toBean(workloadList, EcgWorkloadVO.class));
|
ExcelUtils.write(response, "医生工作量统计.xls", "数据", EcgWorkloadVO.class, workloadList);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user