songjiaqing 5 years ago
parent
commit
4bbf2fefd4

+ 1 - 1
whepi-web/src/main/java/com/bofeng/dao/UptownUnitMapper.java

@@ -21,7 +21,7 @@ public interface UptownUnitMapper extends BaseMapper<UptownUnit> {
 
     List<UptownUnit> queryDanYuanList(@Param("uptownId") Long uptownId, @Param("ridgepole") Long ridgepole);
 
-    List<UptownUnit> queryMenPaiList(@Param("uptownId") Long uptownId, @Param("ridgepole") Long ridgepol, @Param("unitId") Long unitId);
+    List<UptownUnit> queryMenPaiList(@Param("uptownId") Long uptownId, @Param("ridgepole") Long ridgepole, @Param("unitId") Long unitId, @Param("reportDate") String reportDate);
 
     List<UptownUnit> queryXiaoQuList(@Param("uptownId") Long uptownId);
 

+ 8 - 0
whepi-web/src/main/java/com/bofeng/entity/UptownUnit.java

@@ -71,4 +71,12 @@ public class UptownUnit {
     @TableField(exist = false)
     private Integer yiChangSubNum;
 
+
+    @TableField(exist = false)
+    private Integer msStatus;
+    @TableField(exist = false)
+    private String msStatusStr = "";
+    @TableField(exist = false)
+    private Integer safetyNum;
+
 }

+ 35 - 0
whepi-web/src/main/java/com/bofeng/service/RiBaoService.java

@@ -575,4 +575,39 @@ public class RiBaoService {
         List<UptownUnit> dongList = uptownUnitMapper.queryDongList(uptownId);
         return dongList;
     }
+
+
+    public List<UptownUnit> queryDanYuanList(Long uptownId, Long ridgepole) {
+        List<UptownUnit> dongList = uptownUnitMapper.queryDanYuanList(uptownId, ridgepole);
+        return dongList;
+    }
+
+    public List<UptownUnit> queryMenPaiList(Long uptownId, Long ridgepole, Long unitId) {
+        Date today = new Date();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        String todayStr = sdf.format(today);
+
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(today);
+        calendar.add(Calendar.DATE, -2);
+        String yestodayStr = sdf.format(calendar.getTime());
+
+        List<UptownUnit> dongList = uptownUnitMapper.queryMenPaiList(uptownId, ridgepole, unitId, yestodayStr);
+        if (CollectionUtils.isNotEmpty(dongList)) {
+            for (UptownUnit obj : dongList) {
+                if (obj.getMsStatus() != null && obj.getMsStatus().intValue() == 1) {
+//                    健康状态:1正常,2异常
+                    obj.setMsStatusStr("正常");
+                } else if (obj.getMsStatus() != null && obj.getMsStatus().intValue() == 2) {
+//                    健康状态:1正常,2异常
+                    obj.setMsStatusStr("异常");
+                } else {
+                    obj.setMsStatus(-1);
+                    obj.setMsStatusStr("未报");
+                    obj.setSafetyNum(0);
+                }
+            }
+        }
+        return dongList;
+    }
 }

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

@@ -57,14 +57,14 @@ public class RiBaoYwhController {
     @Autowired
     private RiBaoService riBaoService;
 
-    // 查询业委会日报小区及统计数据
+    // 查询业委会日报首页小区及统计数据
     @GetMapping("/ywh/getRibaoYwh")
     public Model<UptownUnit> getRibaoYwh(@Pd(name = "userId") Long userId) {
         return Model.newSuccess(riBaoService.getRibaoYwh(userId));
     }
 
 
-    // 查询业委会日报小区对应栋列表
+    // 查询业委会日报首页小区对应栋列表
     @GetMapping("/ywh/queryRibaoYwhDongList")
     public Model<List<UptownUnit>> queryRibaoYwhDongList(@Pd(name = "uptownId") Long uptownId) {
         List<UptownUnit> listSuspected = riBaoService.queryRibaoYwhDongList(uptownId);
@@ -72,6 +72,23 @@ public class RiBaoYwhController {
     }
 
 
+    // 查询业委会日报某一栋小区单元数据 根据queryRibaoYwhDongList获取栋数据作为参数传递给此接口
+    @GetMapping("/ywh/queryDanYuanList")
+    public Model<List<UptownUnit>> queryDanYuanList(@Pd(name = "uptownId") Long uptownId, @Pd(name = "ridgepole") Long ridgepole) {
+        List<UptownUnit> listSuspected = riBaoService.queryDanYuanList(uptownId, ridgepole);
+        return Model.newSuccess(listSuspected);
+    }
+
+
+    // 查询业委会日报某一栋门牌数据 根据queryDanYuanList获取单元数据作为参数传递给此接口
+    // uptownId:小区id; ridgepole:栋;unitId:单元id
+    @GetMapping("/ywh/queryMenPaiList")
+    public Model<List<UptownUnit>> queryMenPaiList(@Pd(name = "uptownId") Long uptownId, @Pd(name = "ridgepole") Long ridgepole, @Pd(name = "unitId") Long unitId) {
+        List<UptownUnit> listSuspected = riBaoService.queryMenPaiList(uptownId, ridgepole, unitId);
+        return Model.newSuccess(listSuspected);
+    }
+
+
     @GetMapping("/ywh/home.html")
     public ModelAndView yeweihui(ModelMap model, @RequestParam(value = "userId") Long userId, @RequestParam(value = "show", required = false, defaultValue = "-") String show) {
 

+ 7 - 4
whepi-web/src/main/resources/mapper/UptownUnitMapper.xml

@@ -26,10 +26,13 @@
     </select>
 
     <select id="queryMenPaiList" resultType="com.bofeng.entity.UptownUnit">
-        SELECT a.house_id, a.doorplate, a.unit_id,b.unit, b.ridgepole,b.uptown_id FROM `sys_uptown_house` a
-        inner JOIN `sys_uptown_unit` b  on a.unit_id=b.unit_id and b.ridgepole=#{ridgepole} and b.unit_id=#{unitId}
-        where b.uptown_id=#{uptownId}
-        order by house_id
+        SELECT a.*,c.report_date, c.ms_status,c.safety_num from (
+          SELECT a.house_id, a.doorplate, a.unit_id,b.unit, b.ridgepole,b.uptown_id FROM `sys_uptown_house` a
+          inner JOIN `sys_uptown_unit` b  on a.unit_id=b.unit_id and b.ridgepole=#{ridgepole} and b.unit_id=#{unitId}
+          where b.uptown_id=#{uptownId}
+          order by house_id
+        ) a
+        left JOIN `ms_report` c  on a.house_id=c.house_id  and c.report_date = #{reportDate}
     </select>
 
     <select id="queryXiaoQuList" resultType="com.bofeng.entity.UptownUnit">