Browse Source

医院统计简单界面

gaodm 5 years atrás
parent
commit
1d78149927

+ 5 - 0
zzcx-service/pom.xml

@@ -51,6 +51,11 @@
             <artifactId>spring-boot-starter-undertow</artifactId>
             <artifactId>spring-boot-starter-undertow</artifactId>
         </dependency>
         </dependency>
 
 
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-freemarker</artifactId>
+        </dependency>
+
         <!-- 开启feign-->
         <!-- 开启feign-->
         <dependency>
         <dependency>
             <groupId>org.springframework.cloud</groupId>
             <groupId>org.springframework.cloud</groupId>

+ 1 - 1
zzcx-service/src/main/java/com/diagbot/ZzcxServiceApplication.java

@@ -20,7 +20,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
  * @time: 2018/8/7 9:26
  * @time: 2018/8/7 9:26
  */
  */
 @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class,
 @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class,
-        JmxAutoConfiguration.class, ThymeleafAutoConfiguration.class })
+        JmxAutoConfiguration.class })
 @EnableEurekaClient
 @EnableEurekaClient
 @EnableFeignClients({ "com.diagbot.client" })
 @EnableFeignClients({ "com.diagbot.client" })
 @EnableHystrixDashboard
 @EnableHystrixDashboard

+ 67 - 0
zzcx-service/src/main/java/com/diagbot/web/ViewController.java

@@ -0,0 +1,67 @@
+package com.diagbot.web;
+
+import com.diagbot.dto.OptDTO;
+import com.diagbot.dto.OptHospDTO;
+import com.diagbot.facade.OptInfoFacade;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.OptVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import java.util.Date;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/7 13:17
+ */
+@Controller
+public class ViewController {
+    @Autowired
+    private OptInfoFacade optInfoFacade;
+
+    @RequestMapping("/view/indexlantone")
+    public String indexlantone(Map<String, Object> map, String hospitalCode) {
+        Date now = DateUtil.now();
+        OptVO optVO = new OptVO();
+        if (StringUtil.isNotBlank(hospitalCode)) {
+            optVO.setHospitalCode(hospitalCode);
+        }
+        optVO.setStartDate(DateUtil.addDay(now, -60));
+        optVO.setEndDate(now);
+        OptDTO optDTO = optInfoFacade.getOptSum(optVO);
+        map.put("pvSum", optDTO.getPvSum());
+        map.put("pvdto", optDTO.getPvdto());
+        map.put("uvSum", optDTO.getUvSum());
+        map.put("uvdto", optDTO.getUvdto());
+        map.put("zzSum", optDTO.getZzSum());
+        map.put("zzdto", optDTO.getZzdto());
+
+        return "index_lantong";
+    }
+
+    @RequestMapping("/view/indexall")
+    public String indexall(Map<String, Object> map, String hospitalCode) {
+        Date now = DateUtil.now();
+        OptVO optVO = new OptVO();
+        if (StringUtil.isNotBlank(hospitalCode)) {
+            optVO.setHospitalCode(hospitalCode);
+        }
+        optVO.setStartDate(DateUtil.addDay(now, -60));
+        optVO.setEndDate(now);
+        OptHospDTO optHospDTO = optInfoFacade.getOptSumHosp(optVO);
+        map.put("pvSum", optHospDTO.getPvSum());
+        map.put("pvHospDto", optHospDTO.getPvHospDto());
+        map.put("pvHospSumDto", optHospDTO.getPvHospSumDto());
+        map.put("uvSum", optHospDTO.getUvSum());
+        map.put("uvHospDto", optHospDTO.getUvHospDto());
+        map.put("uvHospSumDto", optHospDTO.getUvHospSumDto());
+        map.put("zzSum", optHospDTO.getZzSum());
+        map.put("zzHospDto", optHospDTO.getZzHospDto());
+        map.put("zzHospSumDto", optHospDTO.getZzHospSumDto());
+        return "index_all";
+    }
+}

+ 12 - 0
zzcx-service/src/main/resources/bootstrap.yml

@@ -11,6 +11,18 @@ spring:
   profiles:
   profiles:
     active: local
     active: local
 
 
+  freemarker:
+    allow-request-override: false
+    cache: true
+    check-template-location: true
+    charset: utf-8
+    content-type: text/html
+    expose-request-attributes: false
+    expose-session-attributes: false
+    expose-spring-macro-helpers: false
+    suffix: .ftl
+    template-loader-path: classpath:/templates/
+
 eureka:
 eureka:
   client:
   client:
     serviceUrl:
     serviceUrl:

+ 173 - 0
zzcx-service/src/main/resources/templates/index_all.ftl

@@ -0,0 +1,173 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>数据统计各个医院</title>
+    <style type="text/css">
+        table
+        {
+            border-collapse: collapse;
+            margin: 0 auto;
+            text-align: center;
+        }
+        table td, table th
+        {
+            border: 1px solid #cad9ea;
+            color: #666;
+            height: 30px;
+        }
+        table thead th
+        {
+            background-color: #CCE8EB;
+            width: 100px;
+        }
+        table tr:nth-child(odd)
+        {
+            background: #fff;
+        }
+        table tr:nth-child(even)
+        {
+            background: #F5FAFA;
+        }
+    </style>
+</head>
+<body>
+<table valign="top" class="table">
+    <tr>
+        <th>
+            PV(点击数量) 总合计: ${pvSum}
+        </th>
+        <th>
+            UV(用户数量) 总合计: ${uvSum}
+        </th>
+        <th>
+            完成自诊量 总合计: ${zzSum}
+        </th>
+    </tr>
+    <tr>
+        <th valign="top">
+            <table valign="top" class="table">
+                <tr>
+                    <th>每日情况</th>
+                    <th>医院统计</th>
+                </tr>
+                <tr>
+                    <th valign="top">
+                        <table valign="top" class="table">
+                            <tr>
+                                <td>医院名称</td>
+                                <td>日期</td>
+                                <td>数量</td>
+                            </tr>
+                 <#list pvHospDto ! as pvHospDto>
+                     <tr>
+                         <td>${pvHospDto.hospitalCode!}</td>
+                         <td>${pvHospDto.days!}</td>
+                         <td>${pvHospDto.pvCnt!}</td>
+                     </tr>
+                 </#list>
+                        </table>
+                    </th>
+                    <th valign="top">
+                        <table valign="top" class="table">
+                            <tr>
+                                <td>医院名称</td>
+                                <td>合计</td>
+                            </tr>
+                 <#list pvHospSumDto ! as pvHospSumDto>
+                     <tr>
+                         <td>${pvHospSumDto.hospitalCode!}</td>
+                         <td>${pvHospSumDto.pvSum!}</td>
+                     </tr>
+                 </#list>
+                        </table>
+                    </th>
+                </tr>
+            </table>
+
+        </th>
+        <th valign="top">
+            <table valign="top" class="table">
+                <tr>
+                    <th>每日情况</th>
+                    <th>医院统计</th>
+                </tr>
+                <tr>
+                    <th valign="top">
+                        <table valign="top" class="table">
+                            <tr>
+                                <td>医院名称</td>
+                                <td>日期</td>
+                                <td>数量</td>
+                            </tr>
+                <#list uvHospDto ! as uvHospDto>
+                    <tr>
+                        <td>${uvHospDto.hospitalCode!}</td>
+                        <td>${uvHospDto.days!}</td>
+                        <td>${uvHospDto.uvCnt!}</td>
+                    </tr>
+                </#list>
+                        </table>
+                    </th>
+                    <th valign="top">
+                        <table valign="top" class="table">
+                            <tr>
+                                <td>医院名称</td>
+                                <td>合计</td>
+                            </tr>
+                 <#list uvHospSumDto ! as uvHospSumDto>
+                     <tr>
+                         <td>${uvHospSumDto.hospitalCode!}</td>
+                         <td>${uvHospSumDto.uvSum!}</td>
+                     </tr>
+                 </#list>
+                        </table>
+                    </th>
+                </tr>
+            </table>
+        </th>
+        <th valign="top">
+            <table valign="top" class="table">
+                <tr>
+                    <th>每日情况</th>
+                    <th>医院统计</th>
+                </tr>
+                <tr>
+                    <th valign="top">
+                        <table valign="top" class="table">
+                            <tr>
+                                <td>医院名称</td>
+                                <td>日期</td>
+                                <td>数量</td>
+                            </tr>
+                 <#list zzHospDto ! as zzHospDto>
+                     <tr>
+                         <td>${zzHospDto.hospitalCode!}</td>
+                         <td>${zzHospDto.days!}</td>
+                         <td>${zzHospDto.zzCnt!}</td>
+                     </tr>
+                 </#list>
+                        </table>
+                    </th>
+                    <th valign="top">
+                        <table valign="top" class="table">
+                            <tr>
+                                <td>医院名称</td>
+                                <td>合计</td>
+                            </tr>
+                 <#list zzHospSumDto ! as zzHospSumDto>
+                     <tr>
+                         <td>${zzHospSumDto.hospitalCode!}</td>
+                         <td>${zzHospSumDto.zzSum!}</td>
+                     </tr>
+                 </#list>
+                        </table>
+                    </th>
+                </tr>
+            </table>
+        </th>
+    </tr>
+</table>
+
+</body>
+</html>

+ 95 - 0
zzcx-service/src/main/resources/templates/index_lantong.ftl

@@ -0,0 +1,95 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>数据统计朗通</title>
+    <style type="text/css">
+        table
+        {
+            border-collapse: collapse;
+            margin: 0 auto;
+            text-align: center;
+        }
+        table td, table th
+        {
+            border: 1px solid #cad9ea;
+            color: #666;
+            height: 30px;
+        }
+        table thead th
+        {
+            background-color: #CCE8EB;
+            width: 100px;
+        }
+        table tr:nth-child(odd)
+        {
+            background: #fff;
+        }
+        table tr:nth-child(even)
+        {
+            background: #F5FAFA;
+        }
+    </style>
+</head>
+<body>
+<table valign="top" class="table">
+    <tr>
+        <th>
+            PV(点击数量) 合计: ${pvSum}
+        </th>
+        <th>
+            UV(用户数量) 合计: ${uvSum}
+        </th>
+        <th>
+            完成自诊量 合计: ${zzSum}
+        </th>
+    </tr>
+    <tr>
+        <th valign="top">
+            <table valign="top" class="table">
+                <tr>
+                    <td>日期</td>
+                    <td>数量</td>
+                </tr>
+                 <#list pvdto ! as pvdto>
+                     <tr>
+                         <td>${pvdto.days!}</td>
+                         <td>${pvdto.pvCnt!}</td>
+                     </tr>
+                 </#list>
+            </table>
+        </th>
+        <th valign="top">
+            <table valign="top" class="table">
+                <tr>
+                    <td>日期</td>
+                    <td>数量</td>
+                </tr>
+                <#list uvdto ! as uvdto>
+                    <tr>
+                        <td>${uvdto.days!}</td>
+                        <td>${uvdto.uvCnt!}</td>
+                    </tr>
+                </#list>
+            </table>
+        </th>
+        <th valign="top">
+            <table valign="top" class="table">
+                <tr>
+                    <td>日期</td>
+                    <td>数量</td>
+                </tr>
+                 <#list zzdto ! as zzdto>
+                     <tr>
+                         <td>${zzdto.days!}</td>
+                         <td>${zzdto.zzCnt!}</td>
+                     </tr>
+                 </#list>
+            </table>
+        </th>
+    </tr>
+
+</table>
+
+</body>
+</html>