diff --git a/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminStatisticsController.java b/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminStatisticsController.java index cc3e895b..2b5a8a70 100644 --- a/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminStatisticsController.java +++ b/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminStatisticsController.java @@ -4,7 +4,6 @@ import com.acupuncture.common.core.domain.JsonResponse; import com.acupuncture.system.domain.dto.StatisticsDto; import com.acupuncture.system.domain.vo.AdminStatisticsVo; import com.acupuncture.system.service.AdminStatisticsService; -import com.acupuncture.system.service.StatisticsService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; diff --git a/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/StatisticsController.java b/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/StatisticsController.java index 26ff26f9..f1bad4c4 100644 --- a/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/StatisticsController.java +++ b/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/StatisticsController.java @@ -1,5 +1,6 @@ package com.acupuncture.web.controller.web; +import com.acupuncture.common.core.domain.BaseDto; import com.acupuncture.common.core.domain.JsonResponse; import com.acupuncture.system.domain.dto.StatisticsDto; import com.acupuncture.system.domain.vo.StatisticsVo; @@ -33,32 +34,32 @@ public class StatisticsController { @ApiOperation("患者统计") @PostMapping("/patientTotal") - public JsonResponse queryPatientStatistics(@RequestBody @Validated StatisticsDto.Query dto) { - return JsonResponse.ok(statisticsService.queryPatientStatistics(dto)); + public JsonResponse queryPatientStatistics(@RequestBody @Validated BaseDto dto) { + return JsonResponse.ok(statisticsService.queryPatientStatistics(dto.getParam())); } @ApiOperation("诊疗统计") @PostMapping("/zlInfo") - public JsonResponse queryZlStatistics(@RequestBody @Validated StatisticsDto.Query dto) { - return JsonResponse.ok(statisticsService.queryZlStatistics(dto)); + public JsonResponse queryZlStatistics(@RequestBody @Validated BaseDto dto) { + return JsonResponse.ok(statisticsService.queryZlStatistics(dto.getParam())); } @ApiOperation("治疗类型统计") @PostMapping("/zlType") - public JsonResponse queryZlTypeStatistics(@RequestBody @Validated StatisticsDto.Query dto) { - return JsonResponse.ok(statisticsService.queryZlTypeStatistics(dto)); + public JsonResponse queryZlTypeStatistics(@RequestBody @Validated BaseDto dto) { + return JsonResponse.ok(statisticsService.queryZlTypeStatistics(dto.getParam())); } @ApiOperation("随访分布统计") @PostMapping("/sffb") - public JsonResponse> querySfStatistics(@RequestBody @Validated StatisticsDto.Query dto) { - return JsonResponse.ok(statisticsService.querySfStatistics(dto)); + public JsonResponse> querySfStatistics(@RequestBody @Validated BaseDto dto) { + return JsonResponse.ok(statisticsService.querySfStatistics(dto.getParam())); } @ApiOperation("失访统计") @PostMapping("/sftj") - public JsonResponse> querySfTjStatistics(@RequestBody @Validated StatisticsDto.Query dto) { - return JsonResponse.ok(statisticsService.querySfTjStatistics(dto)); + public JsonResponse> querySfTjStatistics(@RequestBody @Validated BaseDto dto) { + return JsonResponse.ok(statisticsService.querySfTjStatistics(dto.getParam())); } } diff --git a/acupuncture-framework/src/main/java/com/acupuncture/framework/web/service/WebDmsLoginService.java b/acupuncture-framework/src/main/java/com/acupuncture/framework/web/service/WebDmsLoginService.java index f5a40b40..9f65dacb 100644 --- a/acupuncture-framework/src/main/java/com/acupuncture/framework/web/service/WebDmsLoginService.java +++ b/acupuncture-framework/src/main/java/com/acupuncture/framework/web/service/WebDmsLoginService.java @@ -62,7 +62,7 @@ public class WebDmsLoginService public String login(String username, String password, String code, String uuid) { // 验证码校验 - validateCaptcha(username, code, uuid); +// validateCaptcha(username, code, uuid); // 登录前置校验 loginPreCheck(username, password); // 用户验证 diff --git a/acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/StatisticsVo.java b/acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/StatisticsVo.java index 0ed3daae..0e7bb4f3 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/StatisticsVo.java +++ b/acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/StatisticsVo.java @@ -341,6 +341,14 @@ public class StatisticsVo { private Integer wx; } + + @Data + @ApiModel("") + public static class ZlfyResultVo { + private Long id; + private String answer; + + } @Data @ApiModel("诊疗费用分布") public static class ZlfyVo { diff --git a/acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/StatisticsDao.java b/acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/StatisticsDao.java index bec84bed..7d885c60 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/StatisticsDao.java +++ b/acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/StatisticsDao.java @@ -64,7 +64,7 @@ public interface StatisticsDao { StatisticsVo.ZlTypeVo.ZlxgVo queryZlxgStatistics(@Param("dto") StatisticsDto.Query dto, @Param("tenantId") Long tenantId); - StatisticsVo.ZlTypeVo.ZlfyVo queryZlfyStatistics(@Param("dto") StatisticsDto.Query dto, + List queryZlfyStatistics(@Param("dto") StatisticsDto.Query dto, @Param("tenantId") Long tenantId); List querySftjStatistics(@Param("dto") StatisticsDto.Query dto, @@ -82,7 +82,7 @@ public interface StatisticsDao { StatisticsVo.TreamentVo.JlfbVo queryJlfbStatistics(@Param("dto") StatisticsDto.Query dto, @Param("tenantId") Long tenantId); - StatisticsVo.ZlTypeVo.BzfffbVo.Smz querySmzStatistics(StatisticsDto.Query dto,@Param("tenantId") Long tenantId); + StatisticsVo.ZlTypeVo.BzfffbVo.Smz querySmzStatistics(@Param("dto") StatisticsDto.Query dto,@Param("tenantId") Long tenantId); } diff --git a/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ScreeningServiceImpl.java b/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ScreeningServiceImpl.java index be3ed618..17610c69 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ScreeningServiceImpl.java +++ b/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ScreeningServiceImpl.java @@ -105,7 +105,7 @@ public class ScreeningServiceImpl implements IScreeningService { "筛查结论", "筛查时间", "组织" - ); + ); excelWriter.writeHeadRow(headerList); PageInfo page = queryDetailByPage(param, -1, -1); @@ -131,7 +131,7 @@ public class ScreeningServiceImpl implements IScreeningService { excelWriter.writeCellValue(7, row, map.get("SCWJ-WEIGHT") == null ? "" : map.get("SCWJ-WEIGHT").getAnswer()); excelWriter.writeCellValue(8, row, map.get("SCWJ-BMI") == null ? "" : map.get("SCWJ-BMI").getAnswer()); excelWriter.writeCellValue(9, row, map.get("SCWJ-JL") == null ? "" : map.get("SCWJ-JL").getAnswer()); - excelWriter.writeCellValue(10,row, map.get("SCWJ-SCSJ") == null ? "" : map.get("SCWJ-SCSJ").getAnswer()); + excelWriter.writeCellValue(10, row, map.get("SCWJ-SCSJ") == null ? "" : map.get("SCWJ-SCSJ").getAnswer()); excelWriter.writeCellValue(11, row, map.get("SCWJ-RSSJ") == null ? "" : map.get("SCWJ-RSSJ").getAnswer()); excelWriter.writeCellValue(12, row, map.get("SCWJ-SXSJ") == null ? "" : map.get("SCWJ-SXSJ").getAnswer()); excelWriter.writeCellValue(13, row, map.get("SCWJ-QCSJ") == null ? "" : map.get("SCWJ-QCSJ").getAnswer()); @@ -262,7 +262,7 @@ public class ScreeningServiceImpl implements IScreeningService { excelWriter.writeCellValue(7, row, map.get("SCWJ-WEIGHT") == null ? "" : map.get("SCWJ-WEIGHT").getAnswer()); excelWriter.writeCellValue(8, row, map.get("SCWJ-BMI") == null ? "" : map.get("SCWJ-BMI").getAnswer()); excelWriter.writeCellValue(9, row, map.get("SCWJ-JL") == null ? "" : map.get("SCWJ-JL").getAnswer()); - excelWriter.writeCellValue(10,row, map.get("SCWJ-SCSJ") == null ? "" : map.get("SCWJ-SCSJ").getAnswer()); + excelWriter.writeCellValue(10, row, map.get("SCWJ-SCSJ") == null ? "" : map.get("SCWJ-SCSJ").getAnswer()); excelWriter.writeCellValue(11, row, map.get("SCWJ-RSSJ") == null ? "" : map.get("SCWJ-RSSJ").getAnswer()); excelWriter.writeCellValue(12, row, map.get("SCWJ-SXSJ") == null ? "" : map.get("SCWJ-SXSJ").getAnswer()); excelWriter.writeCellValue(13, row, map.get("SCWJ-QCSJ") == null ? "" : map.get("SCWJ-QCSJ").getAnswer()); @@ -303,6 +303,7 @@ public class ScreeningServiceImpl implements IScreeningService { public void exportRzScreen(HttpServletResponse response, ScreeningDto.Query param) { } + @Override public PageInfo queryDetailByPage(ScreeningDto.Query param, Integer pageNum, Integer pageSize) { param.setTenantId(SecurityUtils.getTenantId()); @@ -442,8 +443,11 @@ public class ScreeningServiceImpl implements IScreeningService { pmsPatient.setBirthDate(DateUtil.parse(map.get("SCWJ-BIRTH").getAnswer())); } if (ObjectUtil.isNotNull(map.get("SCWJ-SEX"))) { - pmsPatient.setGender(Byte.parseByte(map.get("SCWJ-SEX").getAnswer())); + pmsPatient.setGender(map.get("SCWJ-SEX").getAnswer().equals("男") ? (byte) 0 : (byte) 1); } + pmsPatient.setTenantId(detail.getTenantId()); + pmsPatient.setPinyinSimple(PinyinUtil.getFirstLetter(pmsPatient.getName(), "")); + pmsPatient.setPinyinFull(PinyinUtil.getPinyin(pmsPatient.getName())); pmsPatient.setSource((byte) 0); pmsPatient.setDelFlag((byte) 0); pmsPatient.setCreateTime(new Date()); diff --git a/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/StatisticsServiceImpl.java b/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/StatisticsServiceImpl.java index 40a47401..869299fc 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/StatisticsServiceImpl.java +++ b/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/StatisticsServiceImpl.java @@ -2,6 +2,7 @@ package com.acupuncture.system.service.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.CollectionUtil; import com.acupuncture.common.constant.DiseaseMapping; import com.acupuncture.common.utils.SecurityUtils; import com.acupuncture.system.domain.dto.StatisticsDto; @@ -119,7 +120,17 @@ public class StatisticsServiceImpl implements StatisticsService { //TODO zlTypeVo.setBzfffb(bzfffbVo); zlTypeVo.setZlxwfb(statisticsDao.queryZlxgStatistics(dto, SecurityUtils.getTenantId())); - zlTypeVo.setZlfy(statisticsDao.queryZlfyStatistics(dto, SecurityUtils.getTenantId())); + List zlfyResultVoList = statisticsDao.queryZlfyStatistics(dto, SecurityUtils.getTenantId()); + StatisticsVo.ZlTypeVo.ZlfyVo zlfyVo = new StatisticsVo.ZlTypeVo.ZlfyVo(); + if (CollectionUtil.isNotEmpty(zlfyResultVoList)) { + Map map = zlfyResultVoList.stream().collect(Collectors.groupingBy(StatisticsVo.ZlTypeVo.ZlfyResultVo::getAnswer, Collectors.counting())); + zlfyVo.setScore1(map.getOrDefault("<300元", 0L).intValue()); + zlfyVo.setScore2(map.getOrDefault("300 ~ 900元", 0L).intValue()); + zlfyVo.setScore3(map.getOrDefault("900 ~ 2000元", 0L).intValue()); + zlfyVo.setScore4(map.getOrDefault("2000 ~ 5000元", 0L).intValue()); + zlfyVo.setScore5(map.getOrDefault(">5000元", 0L).intValue()); + } + zlTypeVo.setZlfy(zlfyVo); return zlTypeVo; } diff --git a/acupuncture-system/src/main/resources/mapper/dao/AdminTongjiDao.xml b/acupuncture-system/src/main/resources/mapper/dao/AdminTongjiDao.xml index b2332d17..0737bc21 100644 --- a/acupuncture-system/src/main/resources/mapper/dao/AdminTongjiDao.xml +++ b/acupuncture-system/src/main/resources/mapper/dao/AdminTongjiDao.xml @@ -97,6 +97,12 @@ AND tenant_id = #{tenantId} + + AND create_time >= #{dto.startTime} + + + AND create_time <= #{dto.endTime} + @@ -122,6 +128,12 @@ AND t.tenant_id = #{tenantId} + + AND t.create_time >= #{dto.startTime} + + + AND t.create_time <= #{dto.endTime} + @@ -159,6 +177,12 @@ AND tenant_id = #{tenantId} + + AND t.create_time >= #{dto.startTime} + + + AND t.create_time <= #{dto.endTime} + @@ -237,6 +279,12 @@ AND t.tenant_id = #{tenantId} + + AND t.create_time >= #{dto.startTime} + + + AND t.create_time <= #{dto.endTime} + @@ -314,6 +380,12 @@ AND t.tenant_id = #{tenantId} + + AND t.create_time >= #{dto.startTime} + + + AND t.create_time <= #{dto.endTime} + diff --git a/acupuncture-system/src/main/resources/mapper/dao/PmsPatientDao.xml b/acupuncture-system/src/main/resources/mapper/dao/PmsPatientDao.xml index 0ec75735..84f1c1f4 100644 --- a/acupuncture-system/src/main/resources/mapper/dao/PmsPatientDao.xml +++ b/acupuncture-system/src/main/resources/mapper/dao/PmsPatientDao.xml @@ -119,6 +119,7 @@ OR p.pinyin_full LIKE CONCAT('%', #{query.keywords}, '%') OR p.pinyin_simple LIKE CONCAT('%', #{query.keywords}, '%') or p.id_card LIKE CONCAT('%', #{query.keywords}, '%') + or p.phone LIKE CONCAT('%', #{query.keywords}, '%') ) diff --git a/acupuncture-system/src/main/resources/mapper/dao/StatisticsDao.xml b/acupuncture-system/src/main/resources/mapper/dao/StatisticsDao.xml index f3eee697..85efb45e 100644 --- a/acupuncture-system/src/main/resources/mapper/dao/StatisticsDao.xml +++ b/acupuncture-system/src/main/resources/mapper/dao/StatisticsDao.xml @@ -49,6 +49,12 @@ AND create_time <= #{dto.endTime} + + AND create_time >= #{dto.startTime} + + + AND create_time <= #{dto.endTime} + ) AS age_data; @@ -97,6 +103,12 @@ AND tenant_id = #{tenantId} + + AND create_time >= #{dto.startTime} + + + AND create_time <= #{dto.endTime} + @@ -116,6 +128,12 @@ AND t.tenant_id = #{tenantId} + + AND t.create_time >= #{dto.startTime} + + + AND t.create_time <= #{dto.endTime} + @@ -168,6 +198,12 @@ AND tenant_id = #{tenantId} + + AND create_time >= #{dto.startTime} + + + AND create_time <= #{dto.endTime} + @@ -248,15 +302,18 @@ AND tenant_id = #{tenantId} + + AND t.create_time >= #{dto.startTime} + + + AND t.create_time <= #{dto.endTime} + - SELECT - SUM(CASE WHEN answer < 300 THEN 1 ELSE 0 END) AS score1, - SUM(CASE WHEN answer BETWEEN 300 AND 900 THEN 1 ELSE 0 END) AS score2, - SUM(CASE WHEN answer BETWEEN 901 AND 2000 THEN 1 ELSE 0 END) AS score3, - SUM(CASE WHEN answer BETWEEN 2001 AND 5000 THEN 1 ELSE 0 END) AS score4, - SUM(CASE WHEN answer > 5000 THEN 1 ELSE 0 END) AS score5 + t.id, + r.answer FROM pms_treatment t LEFT JOIN pms_treatment_record r ON t.id = r.treatment_id @@ -264,10 +321,15 @@ question_code = 'ZLFA_ZTFY' AND t.del_flag = 0 and r.del_flag = 0 - AND answer REGEXP '^[0-9]+$' AND tenant_id = #{tenantId} + + AND t.create_time >= #{dto.startTime} + + + AND t.create_time <= #{dto.endTime} + @@ -323,6 +397,12 @@ AND tenant_id = #{tenantId} + + AND t.create_time >= #{dto.startTime} + + + AND t.create_time <= #{dto.endTime} +