Selaa lähdekoodia

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	whepi-web/src/main/java/com/bofeng/wx/controller/UserOpenController.java
yuliang 5 vuotta sitten
vanhempi
commit
814aca72e5

+ 5 - 30
whepi-ui/templates/home/help.ftl

@@ -1,38 +1,13 @@
-<div class="page__bd">
+<div class="page__bd" xmlns="http://www.w3.org/1999/html">
 
-    <div class="weui-cells__group weui-cells__group_form">
-        <div class="weui-cells weui-cells_radio">
-            <label class="weui-cell weui-cell_active weui-check__label" for="x11">
-                <div class="weui-cell__bd">
-                    <p>已解决</p>
-                </div>
-                <div class="weui-cell__ft">
-                    <input type="radio" class="weui-check" name="radio1" id="x11">
-                    <span class="weui-icon-checked"></span>
-                </div>
-            </label>
-            <label class="weui-cell weui-cell_active weui-check__label" for="x12">
-
-                <div class="weui-cell__bd">
-                    <p>未解决</p>
-                </div>
-                <div class="weui-cell__ft">
-                    <input type="radio" name="radio1" class="weui-check" id="x12" checked="checked">
-                    <span class="weui-icon-checked"></span>
-                </div>
-            </label>
-        </div>
+    <div class="weui-panel weui-panel_access" id="qzHS">
     </div>
 
-    <div>
-        <div>生活必须品求助</div>
+    <div class="button-sp-area">
+    <div class="weui-btn-area">
+        <a id="zqBack_help" class="weui-btn weui-btn_primary" href="javascript:">返回</a>
     </div>
-    <div class="weui-panel weui-panel_access">
-        <div class="weui-panel__bd" id="qzHS">
-        </div>
     </div>
-
-
 </div>
 
 <script>

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

@@ -63,11 +63,13 @@
         ribao_cancel();
         ribao_commit();
         submit_back();
+        familyClick();
     })(jQuery);
 
 
     //小区求助信息的展示
     function familyClick() {
+        $('#notitle').empty();//清除节点
         $.ajax({
             url: '/home/home/queryQzTask',
             data: {},
@@ -102,7 +104,37 @@
     }
 
 function xiaoQuItemClick(v) {
-      debugger
+      /*alert(v.taskId)*/
+    if ($('#titlteZs')[0].style.display == 'none') {
+        $('#notitle').toggle();
+        $('#titlteZs')[0].style.display = '';
+        $('#qzHS').empty();//清除节点
+        //详情页面的展示
+        $.ajax({
+            url: '/home/home/taskQuery',
+            data: {taskId:v.taskId},
+            type: 'GET',
+            success: function (data) {
+                console.log(data);
+                if (data.data.length > 0) {
+                    hasData = true;
+                    $('#qzHS').append($('<div>'+data.data[0].taskTitle+'</div>'))
+                    data.data.forEach(function (v) {
+                        shValue(v);
+                    });
+                } else {
+
+                }
+            },
+            error: function () {
+            }
+        });
+        /*$('#qzHS').*/
+
+    } else {
+        $('#notitle')[0].style.display = '';
+        $('#titlteZs')[0].style.display = 'none';
+    }
 }
 
 

+ 42 - 5
whepi-ui/templates/home/qiuzhu.ftl

@@ -11,7 +11,7 @@
         <div class="weui-tab__panel">
             <div id="qz_nav1" class="weui-tab__bd-item qiu_zhu_weui_tab_bd_item_active">
                 <div id="notitle">
-                    <#--<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="form" href="javascript:;">
+                <#--<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="form" href="javascript:;">
                         <div class="weui-cell__bd">
                             <div class="weui-media-box weui-media-box_text" id="title">
                                 <p class="weui-media-box__desc">由各种物质组成的巨型球状天体,叫做星球。星球有一定的形状,有自己的运行轨道。</p>
@@ -70,7 +70,7 @@
                     </div>
                     <div id="family">
                         <div class="weui-panel__bd" id="valueQz">
-                            <#--<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="form"
+                        <#--<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="form"
                                href="javascript:;">
                                 <div class="weui-cell__bd">
                                     <div class="weui-media-box weui-media-box_text" id="title">
@@ -246,6 +246,7 @@
 
     //我的求助的页面展示
     function qzMy_help() {
+        $('#valueQz').empty();//清除节点
         $.ajax({
             url: '/home/home/queryQzTask',
             data: {},
@@ -257,7 +258,7 @@
                     data.data.forEach(function (v) {
                         helpValue(v);
                     });
-                }else{
+                } else {
 
                 }
             },
@@ -271,7 +272,7 @@
                 '                               onclick=\'myItemClick(' + JSON.stringify(v) + ')\'>\n' +
                 '                                <div class="weui-cell__bd">\n' +
                 '                                    <div class="weui-media-box weui-media-box_text" id="title">\n' +
-                '                                        <p class="weui-media-box__desc">'+v.taskTitle+'</p>\n' +
+                '                                        <p class="weui-media-box__desc">' + v.taskTitle + '</p>\n' +
                 '                                    </div>\n' +
                 '                                </div>\n' +
                 '                                <div class="weui-cell__ft"></div>\n' +
@@ -279,7 +280,43 @@
     }
 
     function myItemClick(v) {
-        debugger
+        $("#notPlay").toggle();
+        $('#qz_nav2').empty();
+        $.ajax({
+            url: '/home/home/taskQuery',
+            data: {taskId:v.taskId},
+            type: 'GET',
+            success: function (data) {
+                console.log(data);
+                if (data.data.length > 0) {
+                    hasData = true;
+                    $('#qz_nav2').append($('<div>'+data.data[0].taskTitle+'</div>'))
+                    data.data.forEach(function (v) {
+                        shValuenat2(v);
+                    });
+                } else {
+
+                }
+            },
+            error: function () {
+            }
+        });
+    }
+    function shValuenat2(v) {
+        $('#qz_nav2').append($('<a href="javascript:void(0);" class="weui-media-box weui-media-box_appmsg">\n' +
+                '                <div class="weui-media-box__bd">\n' +
+                '                    <div style="display: flex; flex-direction: row; justify-content: space-between;">\n' +
+                '                        <p class="weui-media-box__desc">业主1号</p>\n' +
+                '                        <p class="weui-media-box__desc">' + timestampToTime(v.timeUpdate) + '</p>\n' +
+                '                    </div>\n' +
+                '                    <div class="weui-cell ">\n' +
+                '                        <div class="weui-cell__bd">\n' +
+                '                            <textarea class="weui-textarea" rows="1" readonly >' + v.replyContent + '</textarea>\n' +
+                '                            <div class="weui-textarea-counter"></div>\n' +
+                '                        </div>\n' +
+                '                    </div>\n' +
+                '                </div>\n' +
+                '            </a>\n<br />'));
     }
 
 </script>

+ 1 - 23
whepi-ui/templates/home/qiuzhu.js

@@ -8,32 +8,10 @@ function qiuzhu_init() {
 }
 
 function help() {
-  $('#qz_nav1').on('click', function () {
+  $('#zqBack_help').on('click', function () {
     if ($('#titlteZs')[0].style.display == 'none') {
       $('#notitle').toggle();
       $('#titlteZs')[0].style.display = '';
-
-      //详情页面的展示
-      $.ajax({
-        url: '/home/home/taskQuery',
-        data: {},
-        type: 'GET',
-        success: function (data) {
-          console.log(data);
-          if (data.data.length > 0) {
-            hasData = true;
-            data.data.forEach(function (v) {
-              shValue(v);
-            });
-          } else {
-
-          }
-        },
-        error: function () {
-        }
-      });
-      /*$('#qzHS').*/
-
     } else {
       $('#notitle')[0].style.display = '';
       $('#titlteZs')[0].style.display = 'none';

+ 7 - 3
whepi-ui/templates/user/home.ftl

@@ -265,7 +265,7 @@
             return false;
         }
         var unitId = $("#unitId").val();
-        var doorplate = $("#doorplate").val();
+        var doorplate = $("#doorplate").val().trim();
         if(userType == 1) {
             if (!unitId) {
                 alert("栋/单元!")
@@ -306,7 +306,9 @@
                                 "unitId": unitId,
                                 "uptownId": uptownId,
                                 "doorplate": doorplate,
-                            },
+                            },success: function (date) {
+                                window.location.href = "/user/home.html?userId=" + userId;
+                            }
                         });
                     }
                 }
@@ -325,7 +327,9 @@
                     "unitId": unitId,
                     "uptownId": uptownId,
                     "doorplate": doorplate,
-                },
+                },success: function (date) {
+                    window.location.href = "/user/home.html?userId=" + userId;
+                }
             });
         }
     }

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

@@ -3,6 +3,7 @@ package com.bofeng.dao;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
 import com.bofeng.entity.QzTaskReply;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
@@ -11,6 +12,6 @@ import java.util.List;
 @Repository
 public interface QzTaskReplyDao extends BaseMapper<QzTaskReply> {
 
-  List<QzTaskReply> taskQuery();
+  List<QzTaskReply> taskQuery(@Param("taskId")Long taskId);
 
 }

+ 2 - 0
whepi-web/src/main/java/com/bofeng/entity/QzTaskReply.java

@@ -48,5 +48,7 @@ public class QzTaskReply implements Serializable {
      */
     private Date timeUpdate;
 
+    private String taskTitle;
+
     private static final long serialVersionUID = 1L;
 }

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

@@ -6,7 +6,6 @@ import com.bofeng.dao.MsReportMapper;
 import com.bofeng.dao.MsSuspectedMapper;
 import com.bofeng.entity.MsReport;
 import com.bofeng.entity.MsSuspected;
-import com.sun.org.apache.bcel.internal.generic.NEW;
 import org.joda.time.DateTime;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;

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

@@ -21,8 +21,8 @@ public class QzTaskReplyService {
     @Autowired
     private QzTaskDao qzTaskDao;
 
-    public List<QzTaskReply> taskQuery() {
-        return qzTaskReplyDao.taskQuery();
+    public List<QzTaskReply> taskQuery(Long taskId) {
+        return qzTaskReplyDao.taskQuery(taskId);
 
     }
 

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

@@ -62,7 +62,7 @@ public class HomeController {
 
   //小区求助的查看
   @GetMapping("/home/home/taskQuery")
-  public Model<List<QzTaskReply>> taskQuery(){
-    return Model.newSuccess(qzTaskReplyService.taskQuery());
+  public Model<List<QzTaskReply>> taskQuery(@Pd(name = "taskId")Long taskId){
+    return Model.newSuccess(qzTaskReplyService.taskQuery(taskId));
   }
 }

+ 25 - 18
whepi-web/src/main/java/com/bofeng/wx/controller/UserOpenController.java

@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.servlet.ModelAndView;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
 import java.util.List;
 
 @RestController
@@ -42,12 +43,18 @@ public class UserOpenController {
     private QzTaskService qzTaskService;
 
     @GetMapping("/user/home.html")
-    public ModelAndView home(ModelMap model) {
-        UserOpen userOpen = homeService.getUserOpen();
-        List<UserRole> list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
-        model.put("user", userOpen);
-        model.put("user_id", "\""+userOpen.getUserId()+"\"");
-//        List<UserRole> list = userRoleMapper.getUserRoleByUserId(1224239062748065800L);
+    public ModelAndView home(ModelMap model, @RequestParam(value = "userId", required = false,defaultValue = "0") Long userId) {
+        List<UserRole> list = new ArrayList<>();
+        if (userId == 0) {
+            UserOpen userOpen = homeService.getUserOpen();
+            list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
+            model.put("user", userOpen);
+            model.put("user_id", "\""+userOpen.getUserId()+"\"");
+        } else {
+            model.put("user", userOpenMapper.selectByUserId(userId));
+            list = userRoleMapper.getUserRoleByUserId(userId);
+            model.put("user_id", "\""+userId+"\"");
+        }
         if (list.size() == 0) {
             return new ModelAndView("/user/home.ftl", model);
         } else if (list.size()>0) {
@@ -89,7 +96,7 @@ public class UserOpenController {
     }
 
     @PostMapping("/home/saveUser.json")
-    public ModelAndView saveUser(ModelMap model, HttpServletRequest request) {
+    public void saveUser(ModelMap model, HttpServletRequest request) {
         Long userId = Long.parseLong(request.getParameter("userId"));
         Integer userType = Integer.parseInt(request.getParameter("userType"));
         String linkman = request.getParameter("linkman");
@@ -103,17 +110,17 @@ public class UserOpenController {
             doorplate = request.getParameter("doorplate");
         }
         userOpenService.saveUserInfo(userId,userType,linkman,phone,area,uptownId,unitId,doorplate);
-        UserOpen userOpen = userOpenMapper.selectByUserId(userId);
-        model.put("user", userOpen);
-        if (userType == 1) {
-            return new ModelAndView("/home/home.ftl", model);
-        } else if (userType == 2) {
-            List<QzTask> taskList = qzTaskService.selectAll();
-            model.put("taskList", YvanUtil.toJsonPretty(taskList));
-            return new ModelAndView("/yeweihui/home.ftl", model);
-        } else {
-            return null;
-        }
+//        UserOpen userOpen = userOpenMapper.selectByUserId(userId);
+//        model.put("user", userOpen);
+//        if (userType == 1) {
+//            return new ModelAndView("redirect:/home/home.html");
+//        } else if (userType == 2) {
+//            List<QzTask> taskList = qzTaskService.selectAll();
+//            model.put("taskList", YvanUtil.toJsonPretty(taskList));
+//            return new ModelAndView("redirect:/yeweihui/home.html");
+//        } else {
+//            return null;
+//        }
 
     }
 }

+ 3 - 1
whepi-web/src/main/resources/mapper/QzTaskReplyDao.xml

@@ -4,6 +4,8 @@
 
 
     <select id="taskQuery" resultType="com.bofeng.entity.QzTaskReply">
-      select * from qz_task_reply
+     select * from qz_task a
+     INNER JOIN qz_task_reply b on a.task_id=b.task_id
+     where a.task_id=#{taskId}
     </select>
 </mapper>