浏览代码

业委会每日上报日历2/8

maoyunfeng 5 年之前
父节点
当前提交
dfa851e1ae

+ 11 - 18
whepi-ui/templates/yeweihui/ribaohuiz.ftl

@@ -16,9 +16,9 @@
                         <td style="background-color: lightgrey" align="center">异常户数</td>
                     </tr>
                     <tr id="huiz">
-                    <td align="center">8</td>
-                    <td align="center">0</td>
-                    <td align="center">0</td>
+                    <#--<td align="center">8</td>-->
+                    <#--<td align="center">0</td>-->
+                    <#--<td align="center">0</td>-->
                     </tr>
                     </tbody>
                 </table>
@@ -41,27 +41,20 @@
                 onChange: function (p, values, displayValues) {
                     var reportDate = values.toString();
                     console.log(reportDate);
-                    var userId = $("#userId").val();
+                    // var userId = $("#userId").val();
                     $.ajax({
-                        url: '/home/home/queryRibaoReportDate',
+                        url: '/yeweihui/ribaohuiz',
                         data: {
-                            "userCreate": userId,
+                            // "userCreate": userId,
                             "reportDate": reportDate,
                         },
                         type: 'GET',
                         success: function (data) {
-                            if (data.data == undefined) {
-                                $('#ribao_famliy').empty();
-                            }
-                            else {
-                                if (data.data.length > 0) {
-                                    $('#ribao_famliy').empty();
-                                    data.data.forEach(function (v) {
-                                        helpValue1(v);
-                                    });
-                                } else {
-
-                                }
+                            // $('#ribao_famliy').empty();
+                            for (var i = 0; i < data.data.length; i++) {
+                                var v = data.data[i];
+                                var t1 = $('<td align="center">' + v.num + '</td>');
+                                $("#huiz").append(t1);
                             }
                         },
                         error: function () {

+ 26 - 2
whepi-web/src/main/java/com/bofeng/dao/RbMapper.java

@@ -41,8 +41,32 @@ 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("")
-    List<MsSuspected> selecthuiz(@Param("userId") Long userId);
+    @Select("select * from " +
+            "(" +
+            "select count(*) as num,d.user_id as userId from sys_uptown_house a " +
+            "inner join sys_uptown_unit b on b.unit_id = a.unit_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 " +
+            "GROUP BY d.user_id " +
+            "union all " +
+            "select DISTINCT count(*) as num,e.user_id as userId 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} " +
+            "GROUP BY e.user_id " +
+            "union all " +
+            "select DISTINCT count(*) as num,e.user_id as userId 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} " +
+            "GROUP BY e.user_id " +
+            ") tt " +
+            "where tt.userId = #{userId}")
+    List<MsSuspected> selecthuiz(@Param("userId") Long userId,@Param("reportDate") String reportDate);
 
     @Select(
             "select suu.ridgepole,suu.unit,suh.doorplate,suho.linkman,suho.phone,msr.safety_num," +

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

@@ -130,4 +130,10 @@ public class MsSuspected {
 
     @TableField(exist = false)
     private String singleRoomStr;
+
+    @TableField(exist = false)
+    private Integer num;
+
+    @TableField(exist = false)
+    private Long userId;
 }

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

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

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

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

+ 3 - 3
whepi-web/src/main/resources/application-dev.yml

@@ -63,9 +63,9 @@ spring:
     #driverClassName: com.mysql.jdbc.Driver
     #url: jdbc:mysql://localhost:3306/bofeng_test?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false
     driverClassName: net.sf.log4jdbc.DriverSpy
-    url: jdbc:log4jdbc:mysql://localhost:3306/whepi_test?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false
-    username: root
-    password:
+    url: jdbc:log4jdbc:mysql://39.99.148.1:3306/whepi_test?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false
+    username: whepi_test
+    password: 123456
 
   redis:
     database: 4