瀏覽代碼

上报userOpen

maoyunfeng 5 年之前
父節點
當前提交
0025cd6c29

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

@@ -45,7 +45,6 @@ var taskList = ${taskList!'[]'};
 var statisticsOrderList =${rbList!'[]'};
 
 (function ($) {
-
     $(function(){
         $('.weui-navbar__item').on('click', function () {
             $(this).addClass('weui-bar__item_on').siblings('.weui-bar__item_on').removeClass('weui-bar__item_on');

+ 9 - 3
whepi-web/src/main/java/com/bofeng/dao/RbMapper.java

@@ -19,8 +19,14 @@ public interface RbMapper extends BaseMapper<sysUptownUnit> {
 
     @Select("select a.doorplate as doorplate,c.report_id as reportId,c.ms_status as msStatus,a.time_update as time from sys_uptown_house a " +
             "inner join sys_uptown_unit b on a.unit_id = b.unit_id " +
-            "left join ms_report c on c.house_id = a.house_id " +
-            "where b.ridgepole = #{ridgepole} and b.unit = #{unit} and c.time_update = #{date}")
-    List<SysUptownHouse> selectDY(@Param("ridgepole") String ridgepole,@Param("unit") String unit,@Param("date") Date date);
+            "left join ms_report c on c.house_id = a.house_id and c.time_update = #{date} " +
+            "where b.ridgepole = #{ridgepole} and b.unit = #{unit}")
+    List<SysUptownHouse> selectMp(@Param("ridgepole") String ridgepole,@Param("unit") String unit,@Param("date") Date date);
     // and c.time_update = #{date}
+
+    @Select("select c.ridgepole as ridgepole,c.unit as unit from sys_user_role a " +
+            "inner join sys_owner b on b.owner_id = a.property_id and a.role_id = 2 " +
+            "inner join sys_uptown_unit c on c.uptown_id = b.uptown_id " +
+            "where a.user_id = #{userId}")
+    List<sysUptownUnit> selectDY(@Param("ridgepole") Long userId);
 }

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

@@ -19,15 +19,15 @@ public class RbService {
     @Autowired
     private RbMapper rbMapper;
 
-    public List<sysUptownUnit> selectAll () {
-        List<sysUptownUnit> sysUptownHouses = rbMapper.selectList(new EntityWrapper<>());
+    public List<sysUptownUnit> selectAll (Long userId) {
+        List<sysUptownUnit> sysUptownHouses = rbMapper.selectDY(userId);
         return sysUptownHouses;
     }
 
     public List<SysUptownHouse> selectXq (String ridgepole,String unit) {
 //        List<SysUptownHouse> sysUptownHouses = rbMapper.selectList(new EntityWrapper<SysUptownHouse>().eq("ridgepole",ridgepole).eq("unit",unit));
         Date date = new Date();
-        List<SysUptownHouse> sysUptownHouses = rbMapper.selectDY(ridgepole,unit,date);
+        List<SysUptownHouse> sysUptownHouses = rbMapper.selectMp(ridgepole,unit,date);
         return sysUptownHouses;
     }
 }

+ 5 - 0
whepi-web/src/main/java/com/bofeng/wx/controller/UserOpenController.java

@@ -4,6 +4,7 @@ import com.bofeng.dao.*;
 import com.bofeng.entity.*;
 import com.bofeng.service.HomeService;
 import com.bofeng.service.QzTaskService;
+import com.bofeng.service.RbService;
 import com.bofeng.service.UserOpenService;
 import com.yvan.Model;
 import com.yvan.platform.YvanUtil;
@@ -41,6 +42,8 @@ public class UserOpenController {
     private UptownUnitMapper uptownUnitMapper;
     @Autowired
     private QzTaskService qzTaskService;
+    @Autowired
+    private RbService rbService;
 
     @GetMapping("/user/home.html")
     public ModelAndView home(ModelMap model, @RequestParam(value = "userId", required = false,defaultValue = "0") Long userId) {
@@ -65,6 +68,8 @@ public class UserOpenController {
             } else if(list.get(0).getRoleId() == 2) {
                 List<QzTask> taskList = qzTaskService.selectAll();
                 model.put("taskList", YvanUtil.toJsonPretty(taskList));
+                List<sysUptownUnit> rbList = rbService.selectAll(userId);
+                model.put("rbList", YvanUtil.toJsonPretty(rbList));
                 return new ModelAndView("/yeweihui/home.ftl", model);
             }
         }

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

@@ -18,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.servlet.ModelAndView;
 
@@ -36,16 +37,16 @@ public class YeWeiHuiController {
     private QzTaskReplyService qzTaskReplyService;
 
     @GetMapping("/yeweihui/home.html")
-    public ModelAndView yeweihui(ModelMap model) {
+    public ModelAndView yeweihui(ModelMap model,@RequestParam(value = "userId", required = false,defaultValue = "0") Long userId) {
 
         Map<String, Object> queryParam = Maps.newLinkedHashMap();
         queryParam.put("userId", "12345677");
         queryParam.put("statistics", "M");
 
         List<QzTask> taskList = qzTaskService.selectAll();
-        List<sysUptownUnit> rbList = rbService.selectAll();
+//        List<sysUptownUnit> rbList = rbService.selectAll();
         model.put("taskList", YvanUtil.toJsonPretty(taskList));
-        model.put("rbList", YvanUtil.toJsonPretty(rbList));
+//        model.put("rbList", YvanUtil.toJsonPretty(rbList));
 
         return new ModelAndView("/yeweihui/home.ftl", model);
     }
@@ -115,9 +116,9 @@ public class YeWeiHuiController {
     @GetMapping("/yeweihui/ribao.html")
     public ModelAndView yeweihuiRibao(ModelMap model) {
 
-        List<QzTask> taskList = qzTaskService.selectAll();
-
-        model.put("taskList", YvanUtil.toJsonPretty(taskList));
+//        List<QzTask> taskList = qzTaskService.selectAll();
+//
+//        model.put("taskList", YvanUtil.toJsonPretty(taskList));
 
         return new ModelAndView("/yeweihui/ribao.ftl", model);
     }