Browse Source

添加总人数

maoyunfeng 5 years ago
parent
commit
9be5a309f8

+ 9 - 1
whepi-ui/templates/yeweihui/home.ftl

@@ -96,9 +96,17 @@
                             if(i == 0){
                             if(i == 0){
                                 $("#xiaoqu").text(v.uptownName);
                                 $("#xiaoqu").text(v.uptownName);
                             }
                             }
+                            var t1;
+                                t1 = $('<td align="center">' + v.num + '</td>');
 
 
-                            var t1 = $('<td align="center">' + v.num + '</td>');
                             $("#huiz").append(t1);
                             $("#huiz").append(t1);
+
+                        }
+                        if(data.data.length == 3){
+                            var t2 = $('<td align="center">' + 0 + '</td>');
+                            var t3 = $('<td align="center">' + 0 + '</td>');
+                            $("#huiz").append(t2);
+                            $("#huiz").append(t3);
                         }
                         }
                     },
                     },
                     error: function () {
                     error: function () {

+ 2 - 0
whepi-ui/templates/yeweihui/ribaohuiz.ftl

@@ -12,6 +12,8 @@
                 <td style="background-color: lightgrey" align="center">注册户数</td>
                 <td style="background-color: lightgrey" align="center">注册户数</td>
                 <td style="background-color: lightgrey" align="center">上报户数</td>
                 <td style="background-color: lightgrey" align="center">上报户数</td>
                 <td style="background-color: lightgrey" align="center">异常户数</td>
                 <td style="background-color: lightgrey" align="center">异常户数</td>
+                <td style="background-color: lightgrey" align="center">总人数</td>
+                <td style="background-color: lightgrey" align="center">异常人数</td>
             </tr>
             </tr>
             <tr id="huiz">
             <tr id="huiz">
                 <#--<td align="center">8</td>-->
                 <#--<td align="center">8</td>-->

+ 31 - 0
whepi-web/src/main/java/com/bofeng/dao/RbMapper.java

@@ -64,6 +64,37 @@ public interface RbMapper extends BaseMapper<sysUptownUnit> {
             "inner join sys_owner d on d.uptown_id = c.uptown_id " +
             "inner join sys_owner d on d.uptown_id = c.uptown_id " +
             "inner join sys_user_role e on e.property_id = d.owner_id and e.role_id = 2 " +
             "inner join sys_user_role e on e.property_id = d.owner_id and e.role_id = 2 " +
             "where a.report_status = 1 and a.ms_status = 2 and a.report_date = #{reportDate} and e.user_id = #{userId} " +
             "where a.report_status = 1 and a.ms_status = 2 and a.report_date = #{reportDate} and e.user_id = #{userId} " +
+            "union all " +
+            "SELECT DISTINCT " +
+            "sum(a.safety_num) AS yc," +
+            "'' as uptownName " +
+            "FROM " +
+            "ms_report a " +
+            "INNER JOIN sys_uptown_house b ON a.house_id = b.house_id " +
+            "INNER JOIN sys_uptown_unit c ON c.unit_id = b.unit_id " +
+            "INNER JOIN sys_owner d ON d.uptown_id = c.uptown_id " +
+            "INNER JOIN sys_user_role e ON e.property_id = d.owner_id " +
+            "AND e.role_id = 2 " +
+            "WHERE a.report_status = 1 " +
+            "AND a.report_date = #{reportDate} " +
+            "and e.user_id = #{userId} " +
+            "GROUP BY a.house_id " +
+            "union all " +
+            "SELECT DISTINCT " +
+            "sum(a.suspected_num+a.sure_num+a.single_num) AS ycnum," +
+            "'' as uptownName " +
+            "FROM " +
+            "ms_report a " +
+            "INNER JOIN sys_uptown_house b ON a.house_id = b.house_id " +
+            "INNER JOIN sys_uptown_unit c ON c.unit_id = b.unit_id " +
+            "INNER JOIN sys_owner d ON d.uptown_id = c.uptown_id " +
+            "INNER JOIN sys_user_role e ON e.property_id = d.owner_id " +
+            "AND e.role_id = 2 " +
+            "WHERE a.report_status = 1 " +
+            "and a.ms_status = 2 " +
+            "AND a.report_date = #{reportDate} " +
+            "and e.user_id = #{userId} " +
+            "GROUP BY a.house_id" +
             ") tt ")
             ") tt ")
     List<MsSuspected> selecthuiz(@Param("userId") Long userId,@Param("reportDate") String reportDate);
     List<MsSuspected> selecthuiz(@Param("userId") Long userId,@Param("reportDate") String reportDate);
 
 

+ 1 - 0
whepi-web/src/main/java/com/bofeng/entity/MsSuspected.java

@@ -134,6 +134,7 @@ public class MsSuspected {
     @TableField(exist = false)
     @TableField(exist = false)
     private Integer num;
     private Integer num;
 
 
+
     @TableField(exist = false)
     @TableField(exist = false)
     private Long userId;
     private Long userId;
 
 

+ 1 - 0
whepi-web/src/main/java/com/bofeng/service/RbService.java

@@ -98,6 +98,7 @@ public class RbService {
 
 
     public List<MsSuspected> selecthuiz(Long userId,String reportDate) {
     public List<MsSuspected> selecthuiz(Long userId,String reportDate) {
         List<MsSuspected> huiz = rbMapper.selecthuiz(userId,reportDate);
         List<MsSuspected> huiz = rbMapper.selecthuiz(userId,reportDate);
+
         return huiz;
         return huiz;
     }
     }
 }
 }

+ 2 - 2
whepi-web/src/main/java/com/bofeng/wx/controller/YeWeiHuiController.java

@@ -188,8 +188,8 @@ public class YeWeiHuiController {
     }
     }
 
 
     @GetMapping("/yeweihui/ribaohuiz")
     @GetMapping("/yeweihui/ribaohuiz")
-    public Model<List<MsSuspected>> yeweihuiRibaohuiz(Long userCreate,String reportDate) {
-//        Long userCreate = 1225321682867105793L;
+    public Model<List<MsSuspected>> yeweihuiRibaohuiz(/*Long userCreate,*/String reportDate) {
+        Long userCreate = 1225321682867105793L;
         List<MsSuspected> rbList = rbService.selecthuiz(userCreate,reportDate);
         List<MsSuspected> rbList = rbService.selecthuiz(userCreate,reportDate);
         return Model.newSuccess(rbList);
         return Model.newSuccess(rbList);
     }
     }