LAPTOP-KB9HII50\70708 hai 6 meses
pai
achega
68d5734e4b

+ 52 - 1
business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java

@ -7600,6 +7600,8 @@ public class StatisticsEsService {
    public static String[] calculatePreviousPeriod(String start, String end) {
        if (start.length() > 10) {
            start = start.substring(0, 10);
        }
        if (end.length() > 10) {
            end = end.substring(0, 10);
        }
        // 将时间字符串转换为LocalDate对象
@ -7623,6 +7625,8 @@ public class StatisticsEsService {
    public static String[] calculatePreviousYearPeriod(String start, String end) {
        if (start.length() > 10) {
            start = start.substring(0, 10);
        }
        if (end.length() > 10) {
            end = end.substring(0, 10);
        }
        // 将时间字符串转换为LocalDate对象
@ -8582,7 +8586,7 @@ public class StatisticsEsService {
     * @param flag
     * @return
     */
    public JSONObject getFollowUpHeaderTotal(String startDate,String endDate,Integer flag,String deptCode) {
    public JSONObject getFollowUpHeaderTotal(String startDate,String endDate,Integer flag,String deptCode,String isRate) {
        JSONObject jsonObject = new JSONObject();
        if(StringUtils.isBlank(startDate)){
            if (flag == 1) {
@ -8694,6 +8698,53 @@ public class StatisticsEsService {
        String rate = getTwoRange(Integer.parseInt(followupCompleteTotal),Integer.parseInt(followUpTotal),0);
        jsonObject.put("followupCompleteRate",rate);
        jsonObject.put("followupTotal",followUpTotal);
        if("1".equals(isRate)){
            // 计算上一个周期  开始时间period[0] 、结束时间period[1]
            String[] period = calculatePreviousPeriod(startDate, endDate);
            //计算去年同期时间段 开始时间periodYear[0] 、结束时间periodYear[1]
            String[] periodYear = calculatePreviousYearPeriod(startDate, endDate);
            //下转次数:
            String turnSqlH = "select count(1) as total  from wlyy_rehabilitation_patient_info where create_time>='"+period[0]+"' and create_time <='"+period[1]+"' ";
            String turnSqlT = "select count(1) as total  from wlyy_rehabilitation_patient_info where create_time>='"+periodYear[1]+"' and create_time <='"+periodYear[1]+"' ";
            //下转人数:
            String turnPersonSqlH = "select count(DISTINCT patient) as total  from wlyy_rehabilitation_patient_info where create_time>='"+period[0]+"' and create_time <='"+period[0]+"' ";
            String turnPersonSqlT = "select count(DISTINCT patient) as total  from wlyy_rehabilitation_patient_info where create_time>='"+periodYear[1]+"' and create_time <='"+periodYear[1]+"' ";
            //随访次数
            String followupSqlH = "SELECT COUNT(f.id) planNum from wlyy_followup f where f.followup_date >='"+period[0]+"' and f.followup_date <='"+period[0]+"' ";
            String followupSqlT = "SELECT COUNT(f.id) planNum from wlyy_followup f where f.followup_date >='"+periodYear[1]+"' and f.followup_date <='"+periodYear[1]+"' ";
            if(StringUtils.isNotBlank(deptCode)){
                turnSqlH += " and dept = '"+deptCode+"' ";
                turnSqlT += " and dept = '"+deptCode+"' ";
                turnPersonSqlH += " and dept = '"+deptCode+"' ";
                turnPersonSqlT += " and dept = '"+deptCode+"' ";
                followupSqlH += "SELECT COUNT(f.id) planNum from wlyy_followup f,base_doctor_hospital h " +
                        " where f.doctor_code=h.doctor_code and h.del=1 and h.dept_code='"+deptCode+"' " +
                        " and f.followup_date >='"+period[0]+"' and f.followup_date <='"+period[1]+"' ";
                followupSqlT += "SELECT COUNT(f.id) planNum from wlyy_followup f,base_doctor_hospital h " +
                        " where f.doctor_code=h.doctor_code and h.del=1 and h.dept_code='"+deptCode+"' " +
                        " and f.followup_date >='"+periodYear[0]+"' and f.followup_date <='"+periodYear[1]+"' ";
            }
            Integer turnTotalH = jdbcTemplate.queryForObject(turnSqlH,Integer.class);
            Integer turnTotalT = jdbcTemplate.queryForObject(turnSqlT,Integer.class);
            Integer turnPersonTotalH = jdbcTemplate.queryForObject(turnPersonSqlH,Integer.class);
            Integer turnPersonTotalT = jdbcTemplate.queryForObject(turnPersonSqlT,Integer.class);
            Integer followUpTotalH = jdbcTemplate.queryForObject(followupSqlH,Integer.class);
            Integer followUpTotalT = jdbcTemplate.queryForObject(followupSqlT,Integer.class);
            jsonObject.put("turnTotal_hb", getRange((Integer.parseInt(turnTotal)- turnTotalH), turnTotalH, 0));//环比
            jsonObject.put("turnTotal_tb", getRange((Integer.parseInt(turnTotal) - turnTotalT), turnTotalT, 0));//同比
            jsonObject.put("turnPersonTotal_hb", getRange((Integer.parseInt(turnPersonTotal)- turnPersonTotalH), turnPersonTotalH, 0));//环比
            jsonObject.put("turnPersonTotal_tb", getRange((Integer.parseInt(turnPersonTotal) - turnPersonTotalT), turnPersonTotalT, 0));//同比
            jsonObject.put("followUpTotal_hb", getRange((Integer.parseInt(followUpTotal)- followUpTotalH), followUpTotalH, 0));//环比
            jsonObject.put("followUpTotal_tb", getRange((Integer.parseInt(followUpTotal) - followUpTotalT), followUpTotalT, 0));//同比
        }
        return jsonObject;
    }

+ 1 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/specialist/BaseDiseaseHospitalController.java

@ -41,7 +41,7 @@ public class BaseDiseaseHospitalController extends EnvelopRestEndpoint {
    @Autowired
    private ExportUtl exportUtl;
    @GetMapping(value = "exportSurveyRecord")
    @GetMapping(value = "open/exportExcel/exportSurveyRecord")
    @ApiOperation(value = " 导出筛查患者管理")
    public ListEnvelop exportSurveyRecord(
            @ApiParam(value = "姓名") @RequestParam(value = "name", required = false) String name,

+ 4 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/statistics/EsStatisticsEndpoint.java

@ -2102,10 +2102,12 @@ class EsStatisticsEndpoint extends EnvelopRestEndpoint {
                                           @RequestParam(value = "endTime", required = false) String endTime,
                                          @ApiParam(name = "flag", value = "1本月2近半年3近一年0自定义")
                                              @RequestParam(value = "flag", required = false) Integer flag,
                                             @ApiParam(name = "isRate", value = "是否返回同环比 1是0否 默认否")
                                                 @RequestParam(value = "isRate", required = false) String isRate,
                                             @ApiParam(name = "dept", value = "科室编码")
                                                 @RequestParam(value = "dept", required = false) String dept) {
        try {
            return ObjEnvelop.getSuccess("查询成功",statisticsEsService.getFollowUpHeaderTotal(startTime,endTime,flag,dept));
            return ObjEnvelop.getSuccess("查询成功",statisticsEsService.getFollowUpHeaderTotal(startTime,endTime,flag,dept,isRate));
        } catch (Exception e) {
            e.printStackTrace();
            return ObjEnvelop.getError("查询失败");
@ -2150,7 +2152,7 @@ class EsStatisticsEndpoint extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = "exportFollowupDetail")
    @GetMapping(value = "open/exportExcel/exportFollowupDetail")
    @ApiOperation(value = " 导出诊后随访明细")
    public void exportFollowupList(
            @ApiParam(name = "startTime", value = "开始时间 YYYY-MM-DD") @RequestParam(value = "startTime", required = false) String startTime,

+ 1 - 1
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/followup/controller/DoctorFollowUpController.java

@ -78,7 +78,7 @@ public class DoctorFollowUpController extends BaseController {
        }
    }
    @GetMapping(value = "exportFollowupList")
    @GetMapping(value = "open/exportExcel/exportFollowupList")
    @ApiOperation(value = " 导出筛随访记录列表")
    public void exportFollowupList(
            @ApiParam(value = "业务类型,全部及存在数据的专病名称") @RequestParam(value = "businessType", required = false) String businessType,