yuliang 5 年之前
父节点
当前提交
3c5825c1c6

+ 1 - 1
whepi-ui/templates/user/home.ftl

@@ -180,7 +180,7 @@
                         <div class="weui-cells">
                             <div class="weui-cell">
                                 <div class="weui-cell__bd">
-                                    <input class="weui-input" type="text" id="doorplate" placeholder="请输入文本门牌号码: 如 108"/>
+                                    <input class="weui-input" type="text" id="doorplate" placeholder="请输入门牌号码: 如 108"/>
                                 </div>
                             </div>
                         </div>

+ 6 - 15
whepi-ui/templates/yeweihui/home.ftl

@@ -91,22 +91,13 @@
                     type: 'GET',
                     success: function (data) {
                         $('#huiz').empty();
-                        for (var i = 0; i < data.data.length; i++) {
-                            var v = data.data[i];
-                            if(i == 0){
-                                $("#xiaoqu").text(v.uptownName);
-                            }
-                            var t1;
-                                t1 = $('<td align="center">' + v.num + '</td>');
-
+                        console.log("data.data.length:"+data.data.nums);
+                        console.log("data.data.length:"+data.data.uptownName);
+                        $("#xiaoqu").text(data.data.uptownName);
+                        for (var i = 0; i < data.data.nums.length; i++) {
+                            var v = data.data.nums[i];
+                            var t1 = $('<td align="center">' + v + '</td>');
                             $("#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 () {

+ 19 - 56
whepi-web/src/main/java/com/bofeng/dao/RbMapper.java

@@ -10,6 +10,7 @@ import org.springframework.stereotype.Repository;
 
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 @Mapper
 @Repository
@@ -41,62 +42,24 @@ public interface RbMapper extends BaseMapper<sysUptownUnit> {
             "where b.house_id = #{houseId} and DATE_FORMAT(a.time_update,'%Y-%m-%d') = #{dateStr}")
     List<MsSuspected> selectYcXq(@Param("houseId") Long houseId, @Param("dateStr") String dateStr);
 
-    @Select("select * from " +
-            "(" +
-            "select count(*) as num,e.uptown_name as uptownName from sys_uptown_house a " +
-            "inner join sys_uptown_unit b on b.unit_id = a.unit_id " +
-            "inner join sys_uptown e on b.uptown_id = e.uptown_id " +
-            "inner join sys_owner c on c.uptown_id = b.uptown_id " +
-            "inner join sys_user_role d on d.property_id = c.owner_id and d.role_id = 2 " +
-            "where d.user_id = #{userId} " +
-            "GROUP BY e.uptown_name " +
-            "union all " +
-            "select DISTINCT count(*) as num,'' 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} " +
-            "union all " +
-            "select DISTINCT count(*) as num,'' 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} " +
-            "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 ")
-    List<MsSuspected> selecthuiz(@Param("userId") Long userId,@Param("reportDate") String reportDate);
+    @Select(
+            "select count(a.report_id) as yichangCount\n" +
+                    "from ms_report a \n" +
+                    "INNER JOIN sys_uptown_house b ON a.house_id = b.house_id\n" +
+                    "INNER JOIN sys_uptown_unit c ON c.unit_id = b.unit_id and c.uptown_id = #{uptownId}\n" +
+                    "where a.report_date = #{date} and a.ms_status = 2"
+    )
+    Map<String, Integer> selectyicahng(@Param("uptownId") Long uptownId, @Param("date") String date);
+
+    @Select(
+            "select sum(a.safety_num) AS safetyNum, sum(suspected_num) as suspectedNum\n" +
+                    ", count(b.house_id) as houseCount, count(a.report_id) as reportCount\n" +
+                    "from ms_report a \n" +
+                    "INNER JOIN sys_uptown_house b ON a.house_id = b.house_id\n" +
+                    "INNER JOIN sys_uptown_unit c ON c.unit_id = b.unit_id and c.uptown_id = #{uptownId}\n" +
+                    "where a.report_date = #{date}"
+    )
+    Map<String, Integer> selecthuiz(@Param("uptownId") Long uptownId, @Param("date") String date);
 
     @Select(
             "select suu.ridgepole,suu.unit,suh.doorplate,suho.linkman,suho.phone,msr.safety_num as safetyNum," +

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

@@ -56,7 +56,7 @@ public class ExcelRiBao {
     @ExcelProperty(value = "今日居家人数", index = 4)
     private int safetyNum;
 
-    @ExcelProperty(value = "确诊入院人数", index = 5)
+    @ExcelProperty(value = "确诊人数", index = 5)
     private int sureNum;
 
     @ExcelProperty(value = "隔离人数", index = 6)

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

@@ -95,10 +95,4 @@ public class RbService {
 
         return sysUptownHouses;
     }
-
-    public List<MsSuspected> selecthuiz(Long userId,String reportDate) {
-        List<MsSuspected> huiz = rbMapper.selecthuiz(userId,reportDate);
-
-        return huiz;
-    }
 }

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

@@ -8,10 +8,12 @@ import com.bofeng.service.QzTaskReplyService;
 import com.bofeng.service.QzTaskService;
 import com.bofeng.service.RbService;
 import com.fasterxml.jackson.core.JsonProcessingException;
+import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.yvan.Model;
 import com.yvan.ModelOps;
 import com.yvan.mvc.Pd;
+import com.yvan.platform.Conv;
 import com.yvan.platform.JsonWapper;
 import com.yvan.platform.YvanUtil;
 import io.swagger.annotations.ApiOperation;
@@ -181,10 +183,29 @@ public class YeWeiHuiController {
     }
 
     @GetMapping("/yeweihui/ribaohuiz")
-    public Model<List<MsSuspected>> yeweihuiRibaohuiz(Long userCreate,String reportDate) {
+    public Model<Map<String, Object>> yeweihuiRibaohuiz(Long userCreate,String reportDate) {
 //        Long userCreate = 1225321682867105793L;
-        List<MsSuspected> rbList = rbService.selecthuiz(userCreate,reportDate);
-        return Model.newSuccess(rbList);
+
+        List<Uptown> uptowns = rbMapper.selectUptown(userCreate);
+
+        if (uptowns!=null && uptowns.size()>0) {
+            Long upId = uptowns.get(0).getUptownId();
+            Map<String, Integer> map1 = rbMapper.selecthuiz(upId,reportDate);
+            Map<String, Integer> map2 = rbMapper.selectyicahng(upId,reportDate);
+
+            Map<String, Object> reMap = Maps.newHashMap();
+            reMap.put("uptownName", uptowns.get(0).getUptownName());
+            List<Integer> nums = Lists.newArrayList();
+            nums.add(Conv.NI(map1.get("houseCount")));
+            nums.add(Conv.NI(map1.get("reportCount")));
+            nums.add(Conv.NI(map2.get("yichangCount")));
+            nums.add(Conv.NI(map1.get("safetyNum")));
+            nums.add(Conv.NI(map1.get("suspectedNum")));
+            reMap.put("nums", nums);
+            return Model.newSuccess(reMap);
+        }
+        return Model.newFail("没有数据");
+
     }
 
     @ApiOperation("导出家庭上报明细")