From 4ec572512834c827e71e42671c4915a403d7b769 Mon Sep 17 00:00:00 2001 From: zhangheng <3226558941@qq.com> Date: Tue, 23 Jun 2026 09:47:42 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9F=AD=E4=BF=A1=E3=80=81=E7=94=B5=E8=AF=9D?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PhoneDialRecordController.java | 8 +++++ .../ShortMessageSendRecordController.java | 8 +++++ .../PhoneDialRecordMapper.java | 6 ++++ .../ShortMessageSendRecordMapper.java | 6 ++++ .../impl/BatchSendTaskInfoServiceImpl.java | 4 +-- .../IPhoneDialRecordService.java | 6 ++++ .../impl/PhoneDialRecordServiceImpl.java | 20 +++++++++++ .../IShortMessageSendRecordService.java | 6 ++++ .../ShortMessageSendRecordServiceImpl.java | 20 +++++++++++ .../manage/vo/statistics/PushCount.java | 34 +++++++++++++++++++ .../phonedialrecord/PhoneDialRecordMapper.xml | 8 +++++ .../ShortMessageSendRecordMapper.xml | 7 ++++ 12 files changed, 131 insertions(+), 2 deletions(-) create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/vo/statistics/PushCount.java diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/phonedialrecord/PhoneDialRecordController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/phonedialrecord/PhoneDialRecordController.java index c122fe5c..4df8be9a 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/phonedialrecord/PhoneDialRecordController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/phonedialrecord/PhoneDialRecordController.java @@ -89,4 +89,12 @@ public class PhoneDialRecordController extends BaseController { public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(phoneDialRecordService.deletePhoneDialRecordByIds(ids)); } + + /** + * 电话推送统计 + */ + @GetMapping("/phoneCount") + public AjaxResult phoneCount() { + return phoneDialRecordService.phoneCount(); + } } \ No newline at end of file diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/shortmessagesendrecord/ShortMessageSendRecordController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/shortmessagesendrecord/ShortMessageSendRecordController.java index 50d89513..da87f619 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/shortmessagesendrecord/ShortMessageSendRecordController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/shortmessagesendrecord/ShortMessageSendRecordController.java @@ -89,4 +89,12 @@ public class ShortMessageSendRecordController extends BaseController { public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(shortMessageSendRecordService.deleteShortMessageSendRecordByIds(ids)); } + + /** + * 短信推送统计 + */ + @GetMapping("/messageCount") + public AjaxResult messageCount() { + return shortMessageSendRecordService.messageCount(); + } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/phonedialrecord/PhoneDialRecordMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/phonedialrecord/PhoneDialRecordMapper.java index 3b5ed208..1f58c1b8 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/phonedialrecord/PhoneDialRecordMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/phonedialrecord/PhoneDialRecordMapper.java @@ -6,6 +6,7 @@ import com.xinelu.manage.dto.phonedialrecord.PhoneDialRecordDto; import com.xinelu.manage.dto.statistics.FollowUpRateDto; import com.xinelu.manage.vo.phonedialrecord.BillPhoneDialVo; import com.xinelu.manage.vo.phonedialrecord.PhoneDialRecordVo; +import com.xinelu.manage.vo.statistics.PushCount; import java.util.List; @@ -105,4 +106,9 @@ public interface PhoneDialRecordMapper { * @return BillInfoDto */ List selectPhoneDialStatisticByBillId(Long billId); + + /** + * 电话推送统计 + */ + PushCount phoneCount(); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/shortmessagesendrecord/ShortMessageSendRecordMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/shortmessagesendrecord/ShortMessageSendRecordMapper.java index 654810ae..43a5185a 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/shortmessagesendrecord/ShortMessageSendRecordMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/shortmessagesendrecord/ShortMessageSendRecordMapper.java @@ -5,6 +5,7 @@ import com.xinelu.manage.dto.billinfo.BillInfoDto; import com.xinelu.manage.dto.statistics.FollowUpRateDto; import com.xinelu.manage.vo.shortmessagesendrecord.ShortMessageSendRecordVo; import com.xinelu.manage.vo.statistics.MessageSendVo; +import com.xinelu.manage.vo.statistics.PushCount; import com.xinelu.manage.vo.subscribemessagesendrecord.RecordNum; import org.apache.ibatis.annotations.Param; @@ -98,4 +99,9 @@ public interface ShortMessageSendRecordMapper { * @return 结果 */ int insertShortMessageSendRecords(List shortMessageSendRecords); + + /** + * 短信推送统计 + */ + PushCount messageCount(); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/batchsendtaskinfo/impl/BatchSendTaskInfoServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/batchsendtaskinfo/impl/BatchSendTaskInfoServiceImpl.java index 08c5917d..b4001b72 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/batchsendtaskinfo/impl/BatchSendTaskInfoServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/batchsendtaskinfo/impl/BatchSendTaskInfoServiceImpl.java @@ -212,9 +212,9 @@ public class BatchSendTaskInfoServiceImpl implements IBatchSendTaskInfoService { if (Objects.isNull(isDistinct) || isDistinct == 1) { list = list.stream().filter(Objects::nonNull).distinct().collect(Collectors.toList()); } - List collect = list.stream().filter(Objects::nonNull).filter(item -> StringUtils.isEmpty(item.getPatientName()) || StringUtils.isEmpty(item.getPatientPhone()) || StringUtils.isEmpty(item.getPersonnelType())).collect(Collectors.toList()); + List collect = list.stream().filter(Objects::nonNull).filter(item -> StringUtils.isEmpty(item.getPatientName()) || StringUtils.isEmpty(item.getPatientPhone()) || StringUtils.isEmpty(item.getPersonnelType()) || Objects.isNull(item.getVisitTime())).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(collect)) { - return AjaxResult.error("用户信息不完整,姓名均不允许为空,请完善后重试;"); + return AjaxResult.error("用户信息不完整,姓名、联系方式、人员类型、时间均不允许为空,请完善后重试;"); } SysUser sysUser = sysUserMapper.selectUserById(SecurityUtils.getUserId()); Agency agency = agencyMapper.selectAgencyById(sysUser.getHospitalAgencyId()); diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/phonedialrecord/IPhoneDialRecordService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/phonedialrecord/IPhoneDialRecordService.java index ed8a30b8..35c2bb0d 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/phonedialrecord/IPhoneDialRecordService.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/phonedialrecord/IPhoneDialRecordService.java @@ -1,5 +1,6 @@ package com.xinelu.manage.service.phonedialrecord; +import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.manage.domain.phonedialrecord.PhoneDialRecord; import com.xinelu.manage.vo.phonedialrecord.BillPhoneDialVo; @@ -59,4 +60,9 @@ public interface IPhoneDialRecordService { * @return 结果 */ int deletePhoneDialRecordById(Long id); + + /** + * 电话推送统计 + */ + AjaxResult phoneCount(); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/phonedialrecord/impl/PhoneDialRecordServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/phonedialrecord/impl/PhoneDialRecordServiceImpl.java index b808350e..0e3da6c0 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/phonedialrecord/impl/PhoneDialRecordServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/phonedialrecord/impl/PhoneDialRecordServiceImpl.java @@ -1,14 +1,19 @@ package com.xinelu.manage.service.phonedialrecord.impl; +import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.manage.domain.phonedialrecord.PhoneDialRecord; import com.xinelu.manage.mapper.phonedialrecord.PhoneDialRecordMapper; import com.xinelu.manage.service.phonedialrecord.IPhoneDialRecordService; import com.xinelu.manage.vo.phonedialrecord.BillPhoneDialVo; +import com.xinelu.manage.vo.statistics.PushCount; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.math.BigDecimal; +import java.math.RoundingMode; import java.time.LocalDateTime; import java.util.List; +import java.util.Objects; /** * 电话拨打记录Service业务层处理 @@ -88,4 +93,19 @@ public class PhoneDialRecordServiceImpl implements IPhoneDialRecordService { public int deletePhoneDialRecordById(Long id) { return phoneDialRecordMapper.deletePhoneDialRecordById(id); } + + /** + * 电话推送统计 + */ + @Override + public AjaxResult phoneCount() { + PushCount pushCount = phoneDialRecordMapper.phoneCount(); + if (Objects.nonNull(pushCount.getTotal()) && pushCount.getTotal() != 0) { + pushCount.setSuccessRate(new BigDecimal(pushCount.getSuccess()).divide(new BigDecimal(pushCount.getTotal()), 4, RoundingMode.HALF_UP)); + } + if (Objects.isNull(pushCount.getTotal()) || pushCount.getTotal() == 0){ + pushCount.setSuccessRate(BigDecimal.ZERO); + } + return AjaxResult.success(pushCount); + } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/shortmessagesendrecord/IShortMessageSendRecordService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/shortmessagesendrecord/IShortMessageSendRecordService.java index b5e54689..bcf77a74 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/shortmessagesendrecord/IShortMessageSendRecordService.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/shortmessagesendrecord/IShortMessageSendRecordService.java @@ -1,5 +1,6 @@ package com.xinelu.manage.service.shortmessagesendrecord; +import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.manage.domain.shortmessagesendrecord.ShortMessageSendRecord; import com.xinelu.manage.vo.shortmessagesendrecord.ShortMessageSendRecordVo; @@ -59,4 +60,9 @@ public interface IShortMessageSendRecordService { * @return 结果 */ int deleteShortMessageSendRecordById(Long id); + + /** + * 短信推送统计 + */ + AjaxResult messageCount(); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/shortmessagesendrecord/impl/ShortMessageSendRecordServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/shortmessagesendrecord/impl/ShortMessageSendRecordServiceImpl.java index f5aa4375..a0381019 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/shortmessagesendrecord/impl/ShortMessageSendRecordServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/shortmessagesendrecord/impl/ShortMessageSendRecordServiceImpl.java @@ -1,14 +1,19 @@ package com.xinelu.manage.service.shortmessagesendrecord.impl; +import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.manage.domain.shortmessagesendrecord.ShortMessageSendRecord; import com.xinelu.manage.mapper.shortmessagesendrecord.ShortMessageSendRecordMapper; import com.xinelu.manage.service.shortmessagesendrecord.IShortMessageSendRecordService; import com.xinelu.manage.vo.shortmessagesendrecord.ShortMessageSendRecordVo; +import com.xinelu.manage.vo.statistics.PushCount; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.math.BigDecimal; +import java.math.RoundingMode; import java.time.LocalDateTime; import java.util.List; +import java.util.Objects; /** * 短信发送结果记录Service业务层处理 @@ -88,4 +93,19 @@ public class ShortMessageSendRecordServiceImpl implements IShortMessageSendRecor public int deleteShortMessageSendRecordById(Long id) { return shortMessageSendRecordMapper.deleteShortMessageSendRecordById(id); } + + /** + * 短信推送统计 + */ + @Override + public AjaxResult messageCount() { + PushCount pushCount = shortMessageSendRecordMapper.messageCount(); + if (Objects.nonNull(pushCount.getTotal()) && pushCount.getTotal() != 0) { + pushCount.setSuccessRate(new BigDecimal(pushCount.getSuccess()).divide(new BigDecimal(pushCount.getTotal()), 4, RoundingMode.HALF_UP)); + } + if (Objects.isNull(pushCount.getTotal()) || pushCount.getTotal() == 0){ + pushCount.setSuccessRate(BigDecimal.ZERO); + } + return AjaxResult.success(pushCount); + } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/statistics/PushCount.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/statistics/PushCount.java new file mode 100644 index 00000000..5377b682 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/statistics/PushCount.java @@ -0,0 +1,34 @@ +package com.xinelu.manage.vo.statistics; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 推送统计 + */ +@Data +public class PushCount { + + /** + * 推送总数 + */ + private Long total; + + + /** + * 发送成功数量 + */ + private Long success; + + /** + * 发送失败数量 + */ + private Long failure; + + /** + * 发送成功率 + */ + private BigDecimal successRate; + +} diff --git a/postdischarge-manage/src/main/resources/mapper/manage/phonedialrecord/PhoneDialRecordMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/phonedialrecord/PhoneDialRecordMapper.xml index 3190bfe8..861f0464 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/phonedialrecord/PhoneDialRecordMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/phonedialrecord/PhoneDialRecordMapper.xml @@ -377,4 +377,12 @@ left join patient_info patient on patient.id = record.patient_id where record.bill_id = #{billId} + + \ No newline at end of file diff --git a/postdischarge-manage/src/main/resources/mapper/manage/shortmessagesendrecord/ShortMessageSendRecordMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/shortmessagesendrecord/ShortMessageSendRecordMapper.xml index 3872e96d..e2d09250 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/shortmessagesendrecord/ShortMessageSendRecordMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/shortmessagesendrecord/ShortMessageSendRecordMapper.xml @@ -401,4 +401,11 @@ ) + + \ No newline at end of file