Procházet zdrojové kódy

add:首页数据看板-统计条

Scott před 2 roky
rodič
revize
144138a63d

+ 1 - 0
jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java

@@ -143,6 +143,7 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/newsWebsocket/**", "anon");//CMS模块
         filterChainDefinitionMap.put("/vxeSocket/**", "anon");//JVxeTable无痕刷新示例
         filterChainDefinitionMap.put("/notify/**", "anon"); // nw弹窗页面
+        filterChainDefinitionMap.put("/medical/homepage/**", "anon"); // 首页数据看板临时放通
 //        filterChainDefinitionMap.put("/medical/**", "anon");//JVxeTable无痕刷新示例
 
         //性能监控——安全隐患泄露TOEKN(durid连接池也有)

+ 50 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/common/bo/before/AuditAdvanceWarningAuditDetailResponse.java

@@ -0,0 +1,50 @@
+package org.jeecg.modules.medical.common.bo.before;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author soft01
+ * @time 2023/6/11 16:53
+ * @description '稽核-事前提醒明细统计'
+ * @parentProject medical-java
+ */
+@Data
+@ApiModel(value = "稽核-事前提醒明细统计")
+public class AuditAdvanceWarningAuditDetailResponse {
+    @ApiModelProperty(value = "患者id")
+    private String patientId;
+
+    @ApiModelProperty(value = "患者姓名|参保人")
+    private String patientName;
+
+    @ApiModelProperty(value = "医生id")
+    private String doctorId;
+
+    @ApiModelProperty(value = "医生名称")
+    private String doctorName;
+
+    @ApiModelProperty(value = "科室编码")
+    private String medicalDeptCode;
+
+    @ApiModelProperty(value = "科室名称")
+    private String medicalDeptName;
+
+    @ApiModelProperty(value = "门诊号/住院号")
+    private String outpatientNumber;
+
+    @ApiModelProperty(value = "提醒时间")
+    private Date createTime;
+
+    @ApiModelProperty(value = "提醒规则编码")
+    private String medicalInsRuleInfoCode;
+
+    @ApiModelProperty(value = "提醒规则名称")
+    private String medicalInsRuleInfoName;
+
+    @ApiModelProperty(value = "规则管理级别")
+    private String reminderLevel;
+}

+ 83 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/common/bo/mid/AuditMidDetailListResponse.java

@@ -0,0 +1,83 @@
+package org.jeecg.modules.medical.common.bo.mid;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @author soft01
+ * @time 2023/6/11 18:36
+ * @description '事中-审查统计响应值'
+ * @parentProject medical-java
+ */
+@Data
+@ApiModel(description = "事中-审查统计响应值")
+public class AuditMidDetailListResponse implements Serializable {
+//    @ApiModelProperty(value = "项目编码")
+//    private String projectCode;
+//
+//    @ApiModelProperty(value = "项目名称")
+//    private String projectName;
+
+    @ApiModelProperty(value = "事中工单id")
+    private Integer id;
+
+    @ApiModelProperty(value = "患者编码|参保人编码")
+    private String patientId;
+
+//    @ApiModelProperty(value = "违反规则名称")
+//    private String violationRuleName;
+//
+//    @ApiModelProperty(value = "违反规则代码")
+//    private String violationRuleCode;
+
+//    @ApiModelProperty(value = "规则管理级别")
+//    private String reminderLevel;
+
+    @ApiModelProperty(value = "患者姓名")
+    private String patientName;
+
+    @ApiModelProperty(value = "就诊类型")
+    private String treatmentType;
+
+//    @ApiModelProperty(value = "是否医保")
+//    private String medicalInsuranceMark;
+
+    @ApiModelProperty(value = "科室名称")
+    private String medicalDeptName;
+
+    @ApiModelProperty(value = "医生名称")
+    private String doctorName;
+
+    @ApiModelProperty(value = "提醒时间")
+    private Date createTime;
+//
+//    @ApiModelProperty(value = "单价")
+//    private BigDecimal price;
+//
+//    @ApiModelProperty(value = "数量")
+//    private BigDecimal medicalNumber;
+
+    @ApiModelProperty(value = "金额")
+    private BigDecimal amount;
+
+    @ApiModelProperty(value = "异常-多收")
+    private BigDecimal errorRelativelyManyAmt;
+
+    @ApiModelProperty(value = "异常-少收")
+    private BigDecimal errorRelativelyFewAmt;
+
+
+    @ApiModelProperty(value = "违反规则编码")
+    private String feedbackCode;
+
+    @ApiModelProperty(value = "医生处理意见")
+    private String feedbackResult;
+
+    @ApiModelProperty(value = "违规名称-弹窗部分橘黄色副标题")
+    private String description;
+}

+ 61 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/controller/HomePageController.java

@@ -0,0 +1,61 @@
+package org.jeecg.modules.medical.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.modules.medical.response.DashboardStatisticsBarResponse;
+import org.jeecg.modules.medical.service.IHomePageService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author Scott
+ * @time 2023/10/17 20:14 星期二
+ * @description '首页数据'
+ * @parentProject medical-java
+ */
+
+@Api(tags = "事前模块api")
+@RestController
+@RequestMapping("/medical/homepage")
+@Slf4j
+public class HomePageController {
+
+    @Autowired
+    private IHomePageService homePageService;
+
+    @ApiOperation(value="数据看板-统计条", notes="数据看板-统计条")
+    @GetMapping(value = "/statistics/bar")
+    public Result<DashboardStatisticsBarResponse> loadStatisticsBar(@Param("startTime") String startTime, @Param("endTime") String endTime) {
+        DashboardStatisticsBarResponse response = homePageService.loadStatisticsBar(startTime, endTime);
+        return Result.OK(response);
+    }
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 30 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/response/DashboardStatisticsBarResponse.java

@@ -0,0 +1,30 @@
+package org.jeecg.modules.medical.response;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @author Scott
+ * @time 2023/10/17 20:17 星期二
+ * @description '数据看板,统计条数据'
+ * @parentProject medical-java
+ */
+@Data
+public class DashboardStatisticsBarResponse implements Serializable {
+
+    @ApiModelProperty(value = "当日刷卡数")
+    private Integer swipesTotal;
+    @ApiModelProperty(value = "当日提醒数")
+    private Integer beforeReminderTotal;
+    @ApiModelProperty(value = "处方数")
+    private Integer formulaTotal;
+    @ApiModelProperty(value = "事中审查数")
+    private Integer middleReviewTotal;
+    @ApiModelProperty(value = "违规金额")
+    private BigDecimal violationAmountTotal;
+    @ApiModelProperty(value = "事后监管数")
+    private Integer afterSupervisoryTotal;
+}

+ 13 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/IHomePageService.java

@@ -0,0 +1,13 @@
+package org.jeecg.modules.medical.service;
+
+import org.jeecg.modules.medical.response.DashboardStatisticsBarResponse;
+
+/**
+ * @author LENOVO
+ * @time 2023/10/17 20:27 星期二
+ * @description '这里写类描述'
+ * @parentProject medical-java
+ */
+public interface IHomePageService {
+    DashboardStatisticsBarResponse loadStatisticsBar(String startTime, String endTime);
+}

+ 48 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/impl/HomePageServiceImpl.java

@@ -0,0 +1,48 @@
+package org.jeecg.modules.medical.service.impl;
+
+import cn.hutool.core.date.DateTime;
+import org.jeecg.modules.medical.response.DashboardStatisticsBarResponse;
+import org.jeecg.modules.medical.service.IHomePageService;
+import org.jeecg.modules.utils.DateTimeUtil;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @author Scott
+ * @time 2023/10/17 20:29 星期二
+ * @description '获取数据看板'
+ * @parentProject medical-java
+ */
+@Service
+public class HomePageServiceImpl implements IHomePageService {
+
+    @Override
+    public DashboardStatisticsBarResponse loadStatisticsBar(String startTime, String endTime) {
+        DashboardStatisticsBarResponse result = new DashboardStatisticsBarResponse();
+        result.setSwipesTotal(30);
+        result.setBeforeReminderTotal(26);
+        result.setFormulaTotal(28);
+        result.setMiddleReviewTotal(10);
+        result.setViolationAmountTotal(new BigDecimal("280.05"));
+        result.setAfterSupervisoryTotal(9);
+
+        Date startTimeDate = DateTimeUtil.parse(startTime, DateTimeUtil.FULL_STYLE);
+        Date endTimeDate = DateTimeUtil.parse(endTime, DateTimeUtil.FULL_STYLE);
+
+        long diffDay = DateTimeUtil.subDay(startTimeDate, endTimeDate);
+        if (diffDay > 0) {
+            BigDecimal factor = new BigDecimal(diffDay).multiply(new BigDecimal("1.1"));
+            result.setSwipesTotal(new BigDecimal(result.getSwipesTotal()).multiply(factor).intValue());
+            result.setBeforeReminderTotal(new BigDecimal(result.getBeforeReminderTotal()).multiply(factor).intValue());
+            result.setFormulaTotal(new BigDecimal(result.getFormulaTotal()).multiply(factor).intValue());
+            result.setMiddleReviewTotal(new BigDecimal(result.getMiddleReviewTotal()).multiply(factor).intValue());
+            result.setViolationAmountTotal(new BigDecimal(String.valueOf(result.getViolationAmountTotal())).multiply(factor).setScale(2, BigDecimal.ROUND_HALF_UP));
+            result.setAfterSupervisoryTotal(new BigDecimal(result.getAfterSupervisoryTotal()).multiply(factor).intValue());
+        }
+
+
+        return result;
+    }
+}

+ 321 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/utils/DateTimeUtil.java

@@ -0,0 +1,321 @@
+package org.jeecg.modules.utils;
+
+
+import java.time.*;
+import java.time.format.DateTimeFormatter;
+import java.time.temporal.ChronoUnit;
+import java.time.temporal.TemporalAdjusters;
+import java.util.Date;
+
+/**
+ * @author Scott
+ * @apiNote 常用的日期时间转换工具类
+ * @Time 2022年10月8日15:30:17
+ */
+public class DateTimeUtil {
+
+    public static final String FULL_STYLE = "yyyy-MM-dd HH:mm:ss";
+    public static final String LOCAL_DATE = "yyyy-MM-dd";
+
+    public static void main(String[] args) {
+        long l = DateTimeUtil.subDay(new Date(), DateTimeUtil.addDay(new Date(), -2L));
+        System.out.println(l);
+    }
+
+    public static Date addSecond(Date sourceDateTime, Long addSecond) {
+        ZoneId zone = ZoneId.systemDefault();
+        Instant sourceInstant = sourceDateTime.toInstant();
+        LocalDateTime localDateTime = sourceInstant.atZone(zone).toLocalDateTime();
+        LocalDateTime localDateTime1 = localDateTime.plusSeconds(addSecond);
+        //将追加后的日期,转换为date
+        Date from = Date.from(localDateTime1.atZone(zone).toInstant());
+        return from;
+    }
+
+    /**
+     * 给指定日期添加天数
+     * @param sourceDateTime
+     * @param addDay -数时,为减去天数
+     * @return
+     */
+    public static Date addDay(Date sourceDateTime, Long addDay) {
+        ZoneId zone = ZoneId.systemDefault();
+        Instant sourceInstant = sourceDateTime.toInstant();
+        LocalDateTime localDateTime = sourceInstant.atZone(zone).toLocalDateTime();
+        LocalDateTime localDateTime1 = localDateTime.plusDays(addDay);
+        //将追加后的日期,转换为date
+        Date from = Date.from(localDateTime1.atZone(zone).toInstant());
+        return from;
+    }
+
+    /**
+     * 给指定日期添加分钟
+     * @param sourceDateTime
+     * @param addMinute -分钟,为减去分钟数
+     * @return
+     */
+    public static Date addMinute(Date sourceDateTime, Long addMinute) {
+        ZoneId zone = ZoneId.systemDefault();
+        Instant sourceInstant = sourceDateTime.toInstant();
+        LocalDateTime localDateTime = sourceInstant.atZone(zone).toLocalDateTime();
+        LocalDateTime localDateTime1 = localDateTime.plusMinutes(addMinute);
+        //将追加后的日期,转换为date
+        Date from = Date.from(localDateTime1.atZone(zone).toInstant());
+        return from;
+    }
+
+    /**
+     * 日期比较
+     * @param d1 日期1
+     * @param d2 日期2
+     * @return 返回1=日期 1  大于 日期 2; 返回0= 日期1= 日期2,; 返回-1 日期1 小于日期2
+     */
+    public static int diffDateTime(Date d1, Date d2) {
+        if (d1.getTime() > d2.getTime()) {
+            return 1;
+        } else if (d1.getTime() == d2.getTime()) {
+            return 0;
+        } else if (d1.getTime() < d2.getTime()) {
+            return -1;
+        }
+        return 0;
+    }
+
+        /**
+     * 日期比较 当diffDate 日期比开始时间还小,返回-1
+     * 日期比结束时间打,返回1
+     * 在区间范围内,返回0
+     * @param startTime    开始日期
+     * @param endTime    结束日期
+     * @param diffDate  比较日期
+     * @return 返回1=日期 1  大于 日期 2; 返回0= 日期1= 日期2,; 返回-1 日期1 小于日期2
+     */
+    public static int diffDateTime(Date startTime, Date endTime, Date diffDate) {
+        if (startTime.getTime() <= diffDate.getTime() && endTime.getTime() >= diffDate.getTime()) {
+            return 0;
+        }
+        if (startTime.getTime() > diffDate.getTime()) {
+            return -1;
+        } else if (endTime.getTime() < diffDate.getTime()) {
+            return 1;
+        }
+        return 2;
+    }
+
+    /**
+     * 判断日期是否在 范围内
+     * @param d1        比较日期
+     * @param d2        参照日期
+     * @param dayRange  天数范围
+     * @return  当d2减去d1的相差天数 在 dayRange范围内,返回true,否则返回false
+     */
+    public static boolean checkRangeDay(Date d1, Date d2, Long dayRange) {
+        LocalDateTime d1DateTime = getLocalDateTime(d1);
+        LocalDateTime d2DateTime = getLocalDateTime(d2);
+        long until = d1DateTime.until(d2DateTime, ChronoUnit.DAYS); //得到两个日期差
+        if (until <= dayRange) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 判断日期是否在 范围内
+     * @param d1        比较日期
+     * @param d2        参照日期
+     * @param second  秒
+     * @return  当d2减去d1的相差天数 在 dayRange范围内,返回true,否则返回false
+     */
+    public static boolean checkRangeSecond(Date d1, Date d2, Long second) {
+        LocalDateTime d1DateTime = getLocalDateTime(d1);
+        LocalDateTime d2DateTime = getLocalDateTime(d2);
+        long until = d1DateTime.until(d2DateTime, ChronoUnit.SECONDS); //得到两个秒差
+        if (until <= second) {
+            return true;
+        }
+        return false;
+    }
+
+    private static LocalDateTime getLocalDateTime(Date d1) {
+        ZoneId zone = ZoneId.systemDefault();
+        Instant sourceInstant = d1.toInstant();
+        LocalDateTime d1DateTime = sourceInstant.atZone(zone).toLocalDateTime();
+        return d1DateTime;
+    }
+
+
+
+    /**
+     * 获取指定日期的 00:00:00秒
+     * @param d1
+     * @return
+     */
+    public static Date getStartTime(Date d1) {
+        ZoneId zone = ZoneId.systemDefault();
+        Instant sourceInstant = d1.toInstant();
+        LocalDateTime localDateTime = sourceInstant.atZone(zone).toLocalDateTime();
+        LocalDateTime temp = localDateTime.withHour(0).withMinute(0).withSecond(0);
+        //将追加后的日期,转换为date
+        Date from = Date.from(temp.atZone(zone).toInstant());
+        return from;
+    }
+
+    /**
+     * 获取指定日期的 00:00:00秒
+     * @param d1
+     * @return
+     */
+    public static LocalDateTime getStartLocalDateTime(Date d1) {
+        ZoneId zone = ZoneId.systemDefault();
+        Instant sourceInstant = d1.toInstant();
+        LocalDateTime localDateTime = sourceInstant.atZone(zone).toLocalDateTime();
+        LocalDateTime temp = localDateTime.withHour(0).withMinute(0).withSecond(0);
+        return temp;
+    }
+
+    /**
+     * 获取指定日期的 00:00:00
+     * @param d1
+     * @return 返回字符串类型
+     */
+    public static String getStartTimeStr(Date d1) {
+        LocalDateTime startLocalDateTime = getStartLocalDateTime(d1);
+        return formatLocalDateTime(startLocalDateTime);
+    }
+
+    public static String formatLocalDateTime(LocalDateTime dateTime) {
+        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(FULL_STYLE);
+        return dateTime.format(dateTimeFormatter);
+    }
+
+    /**
+     * 获取指定日期的 23:59:59
+     * @param d1
+     * @return
+     */
+    public static Date getEndTime(Date d1) {
+        ZoneId zone = ZoneId.systemDefault();
+        Instant sourceInstant = d1.toInstant();
+        LocalDateTime localDateTime = sourceInstant.atZone(zone).toLocalDateTime();
+        LocalDateTime temp = localDateTime.withHour(23).withMinute(59).withSecond(59);
+        //将追加后的日期,转换为date
+        Date from = Date.from(temp.atZone(zone).toInstant());
+        return from;
+    }
+
+    /**
+     * 获取指定日期的 23:59:59
+     * @param d1
+     * @return
+     */
+    public static LocalDateTime getEndLocalDateTime(Date d1) {
+        ZoneId zone = ZoneId.systemDefault();
+        Instant sourceInstant = d1.toInstant();
+        LocalDateTime localDateTime = sourceInstant.atZone(zone).toLocalDateTime();
+        LocalDateTime temp = localDateTime.withHour(23).withMinute(59).withSecond(59);
+        return temp;
+    }
+
+    public static String getEndTimeStr(Date d1) {
+        LocalDateTime endLocalDateTime = getEndLocalDateTime(d1);
+        return formatLocalDateTime(endLocalDateTime);
+    }
+
+
+    /**
+     * 给指定日期添加天数
+     * @param sourceDateTime
+     * @param addHour -小时,为减去小时数
+     * @return
+     */
+    public static Date addHour(Date sourceDateTime, Long addHour) {
+        ZoneId zone = ZoneId.systemDefault();
+        Instant sourceInstant = sourceDateTime.toInstant();
+        LocalDateTime localDateTime = sourceInstant.atZone(zone).toLocalDateTime();
+        LocalDateTime localDateTime1 = localDateTime.plusHours(addHour);
+        //将追加后的日期,转换为date
+        Date from = Date.from(localDateTime1.atZone(zone).toInstant());
+        return from;
+    }
+
+    /** 获取本年度的第一天 */
+    public static Date getThisYearFirst() {
+        ZoneId zone = ZoneId.systemDefault();
+        LocalDateTime firstDayOfYear = LocalDateTime.of(LocalDate.from(LocalDateTime.now().with(TemporalAdjusters.firstDayOfYear())), LocalTime.MIN);
+        return Date.from(firstDayOfYear.atZone(zone).toInstant());
+    }
+
+    /**
+     * 获取本年度的最后一天
+     * @return
+     */
+    public static Date getThisYearLast() {
+        ZoneId zone = ZoneId.systemDefault();
+        LocalDateTime with = LocalDateTime.now().with(TemporalAdjusters.lastDayOfYear());
+        LocalDateTime localDateTime = LocalDateTime.of(LocalDate.from(with), LocalTime.MAX);
+        return Date.from(localDateTime.atZone(zone).toInstant());
+    }
+
+    /**
+     * 获取当前月份的月第一天
+     * @return
+     */
+    public static Date getThisMonthFirst() {
+        ZoneId zone = ZoneId.systemDefault();
+        LocalDate localDate = LocalDate.from(LocalDateTime.now().with(TemporalAdjusters.firstDayOfMonth()));
+        LocalDateTime monthFirst = LocalDateTime.of(localDate, LocalTime.MIN);
+        return Date.from(monthFirst.atZone(zone).toInstant());
+    }
+
+    /**
+     * 获取当前月份的最后一天
+     * @return
+     */
+    public static Date getThisMonthLast() {
+        ZoneId zone = ZoneId.systemDefault();
+        LocalDate localDate = LocalDate.from(LocalDateTime.now().with(TemporalAdjusters.lastDayOfMonth()));
+        LocalDateTime of = LocalDateTime.of(localDate, LocalTime.MAX);
+        return Date.from(of.atZone(zone).toInstant());
+    }
+
+    public static Date parse(String startTime, String fullStyle) {
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern(fullStyle);
+        LocalDate localDateTime = LocalDate.parse(startTime, formatter);
+        Instant instant = localDateTime.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant();
+        return Date.from(instant);
+    }
+
+        /**
+     * 判断日期是否在 范围内
+     * @param d1        比较日期
+     * @param d2        参照日期
+     * @param dayRange  天数范围
+     * @return  当d2减去d1的相差天数 在 dayRange范围内,返回true,否则返回false
+     */
+    public static boolean checkRange(Date d1, Date d2, Long dayRange) {
+        LocalDateTime d1DateTime = getLocalDateTime(d1);
+        LocalDateTime d2DateTime = getLocalDateTime(d2);
+        long until = d1DateTime.until(d2DateTime, ChronoUnit.DAYS); //得到两个日期差
+        if (until <= dayRange) {
+            return true;
+        }
+        return false;
+    }
+
+    public static String formatterStr(Date date, String fullStyle) {
+        LocalDateTime localDateTime = LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault());
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern(fullStyle);
+        return localDateTime.format(formatter);
+    }
+
+
+    public static long subDay(Date startTimeDate, Date endTimeDate) {
+        // 获取两个日期之间的日期差
+        LocalDateTime d1DateTime = getLocalDateTime(startTimeDate);
+        LocalDateTime d2DateTime = getLocalDateTime(endTimeDate);
+        long until = d1DateTime.until(d2DateTime, ChronoUnit.DAYS);
+        return until;
+    }
+
+
+}