songjiaqing 5 سال پیش
والد
کامیت
c63cc6dae7

+ 7 - 110
whepi-ui/templates/shop/home.ftl

@@ -5,13 +5,12 @@
     <input id="userId" type="text" hidden="hidden" value=${user_id!}/>
     <div class="weui-tab__bd">
         <div id="tab1" class="weui-tab__bd-item weui-tab__bd-item--active">
-            <#include "/shop/qiuzhu.ftl" /></div>
+            <#include "/shop/qiuzhu.ftl" />
+        </div>
         <div id="tab2" class="weui-tab__bd-item">
-            <#include "/shop/shangpin.ftl" /></div>
-    <#--<div id="tab3" class="weui-tab__bd-item">-->
-    <#--<h1>页面三</h1> </div>-->
-    <#--<div id="tab4" class="weui-tab__bd-item">-->
-    <#--<h1>页面四</h1> </div>-->
+            <#include "/shop/shangpin.ftl" />
+        </div>
+
     </div>
     <div class="weui-tabbar">
         <a href="#tab1" class="weui-tabbar__item weui-bar__item--on">
@@ -20,16 +19,8 @@
         </a>
         <a href="#tab2" class="weui-tabbar__item">
             <div class="weui-tabbar__icon"><img src="/static/images/wx/customer_service.png" alt=""></div>
-            <p class="weui-tabbar__label" onclick="familyClick()">我的商品</p>
+            <p class="weui-tabbar__label" onclick="shangpin_init()">我的商品</p>
         </a>
-    <#--<a href="#tab3" class="weui-tabbar__item">-->
-    <#--<div class="weui-tabbar__icon"> <img src="./images/icon_nav_article.png" alt=""> </div>-->
-    <#--<p class="weui-tabbar__label">发现</p>-->
-    <#--</a>-->
-    <#--<a href="#tab4" class="weui-tabbar__item">-->
-    <#--<div class="weui-tabbar__icon"> <img src="./images/icon_nav_cell.png" alt=""> </div>-->
-    <#--<p class="weui-tabbar__label">我</p>-->
-    <#--</a>-->
     </div>
 </div>
 
@@ -54,102 +45,8 @@
             });
         });
 
-
-        ribao_init();
-        qiuzhu_init();
-        family_init();
-        ribao_add();
-        ribao_cancel();
-        ribao_commit();
-        submit_back();
-        familyClick();
-
-        $(function () {
-            $("#ground").bind("click", function () {
-                if ($("#Gj").val() == "off") {
-                    $("#Gj").val("on");
-                    console.log("关闭查看所有");
-                    qzMy_help(1);
-                } else {
-                    $("#Gj").val("off");
-                    console.log("查看已解决的");
-                    qzMy_help(2);
-                }
-            });
-        });
+        shangpin_init();
     })(jQuery);
 
 
-    //小区求助信息的展示
-    function familyClick() {
-        $('#notitle').empty();//清除节点
-        $.ajax({
-            url: '/home/home/queryQzTask',
-            // data: {},
-            data: {taskStatus: 1,userId: $('#userId').val()},
-            type: 'GET',
-            success: function (data) {
-                console.log(data);
-                if (data.data.length > 0) {
-                    hasData = true;
-                    data.data.forEach(function (v) {
-                        familyValue(v);
-                    });
-                } else {
-
-                }
-            },
-            error: function () {
-            }
-        });
-    }
-
-    function familyValue(v) {
-        $('#notitle').append($('<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="form" ' +
-                '                               onclick=\'xiaoQuItemClick(' + JSON.stringify(v) + ')\'>\n' +
-                '                        <div class="weui-cell__bd" taskId="1212>\n' +
-                '                            <div class="weui-media-box weui-media-box_text" id="title">\n' +
-                '                                <p class="weui-media-box__desc" >' + v.taskTitle + '</p>\n' +
-                '                            </div>\n' +
-                '                        </div>\n' +
-                '                        <div class="weui-cell__ft"></div>\n' +
-                '                    </a>\n<br />'));
-
-    }
-
-    function xiaoQuItemClick(v) {
-        /*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';
-        }
-    }
-
-
 </script>

+ 6 - 299
whepi-ui/templates/shop/qiuzhu.ftl

@@ -1,69 +1,27 @@
 <div class="page__bd">
     <div class="weui-tab">
         <div class="weui-navbar">
-            <a class="weui-navbar__item weui-bar__item_on" target="#qz_nav1" module="qiu_zhu" onclick="familyClick()">
+            <a class="weui-navbar__item weui-bar__item_on" target="#qz_nav1" module="qiu_zhu">
                 未响应
             </a>
-            <a class="weui-navbar__item" target="#qz_nav2" module="qiu_zhu" id="qzMy_help" onclick="qzMy_help('')">
+            <a class="weui-navbar__item" target="#qz_nav2" module="qiu_zhu">
                 已响应
             </a>
         </div>
         <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:;">
-                        <div class="weui-cell__bd">
-                            <div class="weui-media-box weui-media-box_text" id="title">
-                                <p class="weui-media-box__desc">由各种物质组成的巨型球状天体,叫做星球。星球有一定的形状,有自己的运行轨道。</p>
-                            </div>
-                        </div>
-                        <div class="weui-cell__ft"></div>
-                    </a>
-                    <a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="list" 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>
-                            </div>
-                        </div>
-                        <div class="weui-cell__ft"></div>
-                    </a>
-                    <a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="name" href="javascript:;">
-                        <div class="weui-cell__bd">
-                            <div class="weui-media-box weui-media-box_text" id="title2">
-                                <p class="weui-media-box__desc">由各种物质组成的巨型球状天体,叫做星球。星球有一定的形状,有自己的运行轨道。</p>
-                            </div>
-                        </div>
-                        <div class="weui-cell__ft"></div>
-                    </a>
-                    <a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="age" href="javascript:;">
-                        <div class="weui-cell__bd">
-                            <div class="weui-media-box weui-media-box_text" id="title3">
-                                <p class="weui-media-box__desc">由各种物质组成的巨型球状天体,叫做星球。星球有一定的形状,有自己的运行轨道。</p>
-                            </div>
-                        </div>
-                        <div class="weui-cell__ft"></div>
-                    </a>-->
-                </div>
-                <div id="titlteZs" style="display: none">
-                    <div class="page__bd">
-                        <div class="weui-panel weui-panel_access" id="qzHS">
-                        </div>
-                        <div class="button-sp-area">
-                            <div class="weui-btn-area">
-                                <a class="weui-btn weui-btn_primary" onclick="qzBackXiaoQu();">返回</a>
-                            </div>
-                        </div>
-                    </div>
+                    aaaaaaaaaaaaaaaaa
                 </div>
-            </div>
-
 
+            </div>
 
         <#--我的求助2-->
             <div id="qz_nav2" class="weui-tab__bd-item">
                 <div id="notPlay">
+                    bbbbbbbbbbbbbbbbbbb
                     <div class="weui-btn-area">
-                        <a id="btnQZ" class="weui-btn weui-btn_primary" onclick="qzDetail();">发起求助</a>
+                        <a id="btnQZ" class="weui-btn weui-btn_primary">发起求助</a>
                     </div>
                     <div class="weui-cell weui-cell_active weui-cell_switch">
                         <div class="weui-cell">
@@ -82,260 +40,9 @@
                         </div>
                     </div>
                 </div>
-                <div id="play" style="display: none" class="weui-panel__bd"><#--发起求助的展示界面-->
-                    <div class="weui-cells__group weui-cells__group_form">
-                        <div class="weui-cells weui-cells_form">
-                            <div class="weui-cell weui-cell_active" id="js_cell">
-                                <div class="weui-cell__hd"><label class="weui-label">标题</label></div>
-                                <div class="weui-cell__bd weui-flex">
-                                    <input id="Qzinput" class="weui-input" type="text"
-                                           placeholder="输入求助标题" maxlength="20" bindinput='formName' name="name"
-                                    >
-                                <#--<button id="js_input_clear" onclick="inputClick()"
-                                        class="weui-btn_reset weui-btn_icon weui-btn_input-clear">
-                                    <i class="weui-icon-clear"></i>
-                                </button>-->
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                    <div class="weui-form__control-area">
-                        <div class="weui-cells__group weui-cells__group_form">
-                            <div class="weui-cells weui-cells_checkbox">
-                                <label class="weui-cell weui-cell_active weui-check__label" for="qzf1">
-                                    <div class="weui-cell__hd">
-                                        <input type="checkbox" class="weui-check" name="checkbox1" id="qzf1"
-                                               value="居委会">
-                                        <i class="weui-icon-checked"></i>
-                                    </div>
-                                    <div class="weui-cell__bd">
-                                        <p>居委会</p>
-                                    </div>
-                                </label>
-                                <label class="weui-cell weui-cell_active weui-check__label" for="qzf2">
-                                    <div class="weui-cell__hd">
-                                        <input type="checkbox" name="checkbox2" class="weui-check" id="qzf2"
-                                               value="业委会">
-                                        <i class="weui-icon-checked"></i>
-                                    </div>
-                                    <div class="weui-cell__bd">
-                                        <p>业委会</p>
-                                    </div>
-                                </label>
-                                <label class="weui-cell weui-cell_active weui-check__label" for="qzf3">
-                                    <div class="weui-cell__hd">
-                                        <input type="checkbox" name="checkbox3" class="weui-check" id="qzf3" value="物业">
-                                        <i class="weui-icon-checked"></i>
-                                    </div>
-                                    <div class="weui-cell__bd">
-                                        <p>物业</p>
-                                    </div>
-                                </label>
-                                <label class="weui-cell weui-cell_active weui-check__label" for="qzf4">
-                                    <div class="weui-cell__hd">
-                                        <input type="checkbox" name="checkbox4" class="weui-check" id="qzf4"
-                                               value="志愿者">
-                                        <i class="weui-icon-checked"></i>
-                                    </div>
-                                    <div class="weui-cell__bd">
-                                        <p>志愿者</p>
-                                    </div>
-                                </label>
-                            <#--<a href="javascript:void(0);" class="weui-cell weui-cell_active weui-cell_link">
-                                <div class="weui-cell__bd">添加更多</div>
-                            </a>-->
-                            </div>
-                        </div>
-                        <div class="weui-cells weui-cells_form">
-                            <div class="weui-cell ">
-                                <div class="weui-cell__bd">
-                                    <textarea class="weui-textarea" placeholder="请输入求助内容" rows="3"
-                                              id="remarks"></textarea>
-                                    <div class="weui-textarea-counter"><span>0</span>/200</div>
-                                </div>
-                            </div>
-                            <div class="weui-cell">
-                                <a class="weui-btn weui-btn_primary" href="javascript:" id="back"
-                                   onclick="qzCommit()">发起求助</a>
-                            </div>
-                            <div class="weui-cell ">
-                                <br>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-
-                <div id="familyDisplay" style="display: none">
-                    <div class="page__bd">
-                        <div class="weui-panel weui-panel_access" id="qzHS2">
-                        </div>
-                        <div class="button-sp-area">
-                            <div class="weui-btn-area">
-                                <a class="weui-btn weui-btn_primary" onclick="qzBackHome();">返回</a>
-                            </div>
-                        </div>
-                    </div>
-                </div>
             </div>
         </div>
     </div>
 </div>
 
-<script>
-
-    function qzCommit() {
-        /*     $("#qzf1").val()
-             $("#qzf2").val()
-             $("#qzf3").val()
-             $("#qzf4").val()*/
-        var taskTitle = $("#Qzinput").val();
-        if (!taskTitle) {
-            alert("请输入求助标题!")
-            return false;
-        }
-        var taskTarget = $("#qzf2").val();
-        if (!taskTarget) {
-            alert("请输入求助目标!")
-            return false;
-        }
-        var remark = $("#remarks").val();
-        if (!remark) {
-            alert("请输入求助内容!")
-            return false;
-        }
-
-        var data = {}
-        var tep = JSON.stringify(data);
-        console.log(tep)
-        $.ajax({
-            url: '/home/home/addFimaly',
-            data: {
-                taskTitle: $("#Qzinput").val(),
-                taskTarget: $("#qzf2").val(),
-                remark: $("#remarks").val()
-            },
-            type: 'GET',
-            success: function (data) {
-                /*if ($('#notPlay')[0].style.display == 'none') {
-                    $('#play').toggle();
-                    $('#notPlay')[0].style.display = '';
-                } else {
-                    $('#play')[0].style.display = '';
-                    $('#notPlay')[0].style.display = 'none';
-                }*/
-            },
-            error: function () {
-
-            }
-        });
-    }
-
-    //我的求助的页面展示
-    function qzMy_help(status) {
-        $('#valueQz').empty();//清除节点
-        $.ajax({
-            url: '/home/home/queryQzTask',
-            data: {userId: $('#userId').val(),taskStatus: status},
-            type: 'GET',
-            success: function (data) {
-                console.log(data);
-                if (data.data.length > 0) {
-                    hasData = true;
-                    data.data.forEach(function (v) {
-                        helpValue(v);
-                    });
-                } else {
-
-                }
-            },
-            error: function () {
-            }
-        });
-    }
-
-    function helpValue(v) {
-        $('#valueQz').append($(' <a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="form"\n' +
-                '                               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' +
-                '                                    </div>\n' +
-                '                                </div>\n' +
-                '                                <div class="weui-cell__ft"></div>\n' +
-                '                            </a><br />'));
-    }
-
-    function myItemClick(v) {
-        if ($('#familyDisplay')[0].style.display == 'none') {
-            $('#familyDisplay')[0].style.display = '';
-            $("#notPlay").toggle();
-            $('#qzHS2').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;
-                        $('#qzHS2').append($('<div>' + data.data[0].taskTitle + '</div>'))
-                        data.data.forEach(function (v) {
-                            shValuenat2(v);
-                        });
-                    } else {
-
-                    }
-                },
-                error: function () {
-                }
-            });
-        }
-    }
-
-    function shValuenat2(v) {
-        $('#qzHS2').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 />'));
-    }
-
-    function qzBackXiaoQu() {
-        if ($('#titlteZs')[0].style.display == 'none') {
-            $('#notitle').toggle();
-            $('#titlteZs')[0].style.display = '';
-        } else {
-            $('#notitle')[0].style.display = '';
-            $('#titlteZs')[0].style.display = 'none';
-        }
-
-    }
-
-    function qzBackHome() {
-        if ($('#notPlay')[0].style.display == 'none') {
-            $('#familyDisplay').toggle();
-            $('#notPlay')[0].style.display = '';
-        } else {
-            $('#familyDisplay')[0].style.display = '';
-            $('#notPlay')[0].style.display = 'none';
-        }
-
-    }
-
-    function qzDetail() {
-        $("#notPlay").toggle();
-        /*点击隐藏*/
-        /*展示*/
-        $('#play')[0].style.display = '';
-    }
-</script>
 

+ 0 - 54
whepi-ui/templates/shop/qiuzhu.js

@@ -2,57 +2,3 @@ function qiuzhu_init() {
 
 }
 
-function shValue(v) {
-  $('#qzHS').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 />'));
-}
-
-function timestampToTime(timestamp) {
-  var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
-  var Y = date.getFullYear() + '/';
-  var M = ((date.getMonth() + 1) < 10) ? ('0' + (date.getMonth() + 1) + '/') : ((date.getMonth() + 1) + '/');
-  var D = (date.getDate() < 10) ? ('0' + date.getDate() + ' ') : (date.getDate() + ' ');
-  var h = (date.getHours() < 10) ? ('0' + date.getHours() + ':') : (date.getHours() + ':');
-  var m = (date.getMinutes() < 10) ? ('0' + date.getMinutes() + ':') : (date.getMinutes() + ':');
-  var s = (date.getSeconds() < 10) ? ('0' + date.getSeconds()) : (date.getSeconds());
-  return Y + M + D + h + m + s;
-}
-
-function family_init() {
-  /*$('#family').on('click',function () {
-    $('#familyDisplay')[0].style.display == '';
-    alert($('#familyDisplay')[0].style.display == 'none')
-    if($('#familyDisplay')[0].style.display == 'none'){
-      $('#notPlay').toggle();
-
-    }else{
-      $('#familyDisplay')[0].style.display == '';
-      $('#notPlay')[0].style.display == 'none';
-    }
-
-
-  })*/
-}
-
-function submit_back() {
-  $('#back').on('click', function () {
-    if ($('#notPlay')[0].style.display = 'none') {
-      $('#notPlay')[0].style.display = '';
-      $('#play').toggle();
-
-    }
-
-  })
-}

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 11 - 507
whepi-ui/templates/shop/shangpin.ftl


+ 10 - 64
whepi-ui/templates/shop/shangpin.js

@@ -1,69 +1,15 @@
-function ribao_init() {
-  $('#btnRB').on('click', function () {
-    window.location.href = "/yeweihui/home.html";
-  });
-
-}
-
-
-function ribao_add() {
-  $('#btnAdd').on('click', function () {
-    if ($('#ribao')[0].style.display == 'none') {
-      $('#notOpenRibao').toggle();
-      $('#ribao')[0].style.display = '';
-    } else {
-      $('#notOpenRibao')[0].style.display = '';
-      $('#ribao')[0].style.display = 'none';
-    }
-  });
-}
-
-function ribao_cancel() {
-  $('#cancel').on('click', function () {
-    if ($('#ribao')[0].style.display == 'none') {
-      $('#notOpenRibao').toggle();
-      $('#ribao')[0].style.display = '';
-    } else {
-      $('#notOpenRibao')[0].style.display = '';
-      $('#ribao')[0].style.display = 'none';
-    }
-  });
+function shangpin_init() {
+  // $('#btnRB').on('click', function () {
+  //   window.location.href = "/yeweihui/home.html";
+  // });
+  alert($('#ssdd').html())
+  $('#ssdd').empty();//清除节点
+  $('#ssdd').append('<div class="weui-loadmore weui-loadmore_line">\n' +
+    '    <span class="weui-loadmore__tips">暂无数据</span>\n' +
+    '</div><br/>');
+  alert($('#ssdd').html())
 }
 
-function ribao_commit() {
-  $('#commit').on('click', function () {
-
-    if ($('#ribao')[0].style.display == 'none') {
-      $('#notOpenRibao').toggle();
-      $('#ribao')[0].style.display = '';
-    } else {
-      $('#notOpenRibao')[0].style.display = '';
-      $('#ribao')[0].style.display = 'none';
-    }
-  });
-}
-
-
-function ribaoCommit() {
-  var user_name = $("#js_input_user_name").val();
-  var remarks = $("#rb_remarks").val();
-  var medical = $('input:radio:checked').val();
-  console.log(user_name)
-  console.log(remarks)
-  console.log(medical)
-
-  $.ajax({
-    url: '/home/addRibao.json',
-    type: "post",
-    data: {
-      "userName": user_name,
-      "conditionStatus": "",
-      "medical": medical,
-      "remarks": remarks,
-    },
-  });
-  qz_searchNum1
-}
 
 
 

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

@@ -7,7 +7,6 @@ import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.springframework.stereotype.Repository;
 
-import java.math.BigDecimal;
 import java.util.List;
 
 /**
@@ -21,7 +20,7 @@ public interface MsReportMapper extends BaseMapper<MsReport> {
     List<MsReport> selectByReportDate(@Param("reportDate") String reportDate, @Param("userCreate") Long userCreate);
 
     @Select("select property_id from sys_user_role where user_id=#{userId} and role_id=1")
-    long selectHouseIdByUserId(@Param("userId") Long userId);
+    Long selectHouseIdByUserId(@Param("userId") Long userId);
 
     //确诊
     @Select("select count(*) from ms_suspected where report_id=#{reportId} and  medical=#{medical}")

+ 21 - 7
whepi-web/src/main/java/com/bofeng/entity/MsSuspected.java

@@ -32,18 +32,27 @@ public class MsSuspected {
     @TableField("grender")
     private Integer grender;
 
+    @TableField(exist = false)
+    private String grenderStr = "";
+
     @TableField("age")
     private Integer age;
 
     @TableField("family_status")
     private Integer familyStatus;
 
+    @TableField(exist = false)
+    private String familyStatusStr = "";
+
     @TableField("status_desp")
     private String statusDesp;
 
     @TableField("medical")
     private Integer medical;
 
+    @TableField(exist = false)
+    private String medicalStr = "";
+
     @TableField("temperature")
     private BigDecimal temperature;
 
@@ -51,19 +60,19 @@ public class MsSuspected {
     private Integer cough;
 
     @TableField(exist = false)
-    private String coughStr;
+    private String coughStr = "";
 
     @TableField("muscle")
     private Integer muscle;
 
     @TableField(exist = false)
-    private String muscleStr;
+    private String muscleStr = "";
 
     @TableField("dyspnea")
     private Integer dyspnea;
 
     @TableField(exist = false)
-    private String dyspneaStr;
+    private String dyspneaStr = "";
 
     @TableField("fatigue")
     private Integer fatigue;
@@ -75,17 +84,24 @@ public class MsSuspected {
     private Integer diarrhea;
 
     @TableField(exist = false)
-    private String diarrheaStr;
+    private String diarrheaStr = "";
 
     @TableField(exist = false)
-    private String zhengzhuang;
+    private String zhengzhuang = "";
 
     @TableField("single_room")
     private Integer singleRoom;
 
+    @TableField(exist = false)
+    private String singleRoomStr = "";
+
     @TableField("suspected_status")
     private Integer suspectedStatus;
 
+
+    @TableField(exist = false)
+    private String suspectedStatusStr = "";
+
     @TableField("others")
     private String others;
 
@@ -128,8 +144,6 @@ public class MsSuspected {
     @TableField(exist = false)
     private Integer singleNum;
 
-    @TableField(exist = false)
-    private String singleRoomStr;
 
     @TableField(exist = false)
     private Integer num;

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

@@ -0,0 +1,320 @@
+package com.bofeng.service;
+
+
+import com.baomidou.mybatisplus.toolkit.IdWorker;
+import com.bofeng.dao.MsReportMapper;
+import com.bofeng.dao.MsSuspectedMapper;
+import com.bofeng.entity.MsReport;
+import com.bofeng.entity.MsSuspected;
+import org.apache.commons.collections.CollectionUtils;
+import org.joda.time.DateTime;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Author: xielianghe
+ * @Date: 2020/2/4 15:44
+ */
+@Service
+@Transactional()
+public class RiBaoService {
+
+    @Autowired
+    private MsSuspectedMapper msSuspectedMapper;
+    @Autowired
+    private MsReportMapper msReportMapper;
+    @Autowired
+    private RiBaoService msReportService;
+
+    public List<MsSuspected> getByReportId(Long reportId) {
+        return msSuspectedMapper.selectByReportId(reportId);
+    }
+
+    public MsReport selectById(Long reportId) {
+        return msReportMapper.selectById(reportId);
+    }
+
+    //获取前一天数据
+//    public List<MsSuspected> getByReportReportDate(String reportDate, Long userCreate) {
+//
+//        List<MsReport> listReport = msReportMapper.selectByReportDate(reportDate, userCreate);
+//        List<MsSuspected> listSuspected = null;
+//        if (listReport != null && listReport.size() > 0) {
+//            listSuspected = msSuspectedMapper.selectByReportId(Long.parseLong(listReport.get(0).getReportId().toString()));
+//        }
+//        return listSuspected;
+//    }
+
+    //获取今天数据
+    public MsReport getReportByDateNow(Long userCreate) {
+        //根据昨天的获取今天的
+        msReportService.getNowByYesterday(userCreate);
+        Date t = new Date();
+        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
+        String reportDate = df.format(t);
+        List<MsReport> listReport = msReportMapper.selectByReportDate(reportDate, userCreate);
+        MsReport msReport = new MsReport();
+        if (listReport != null && listReport.size() > 0) {
+            msReport = msReportMapper.selectById(Long.parseLong(listReport.get(0).getReportId().toString()));
+        }
+        return msReport;
+    }
+
+    //上报
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public Integer addReport(Long userCreate) {
+        Date t = new Date();
+        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
+        String reportDate = df.format(t);
+        List<MsReport> listReport = msReportMapper.selectByReportDate(reportDate, userCreate);
+        if (listReport == null || listReport.size() == 0)
+            return 0;
+
+        //判断体温是否填写
+        List<MsSuspected> listSuspected = msSuspectedMapper.selectByReportId(Long.parseLong(listReport.get(0).getReportId().toString()));
+        for (MsSuspected msSuspected : listSuspected) {
+            if (msSuspected.getTemperature().compareTo(new BigDecimal(0)) == 0)
+                return 2;
+        }
+        MsReport msReport = msReportMapper.selectById(Long.parseLong(listReport.get(0).getReportId().toString()));
+        if (msReport != null) {
+            msReport.setReportStatus(1);
+            msReport.setUserUpdate(userCreate);
+            msReport.setTimeUpdate(DateTime.now());
+            msReportMapper.updateById(msReport);
+        }
+        return 1;
+    }
+
+    //    @Pd(name = "userName") String userName,// 家人姓名
+//    @Pd(name = "grender") Integer grender,// 性别:0未设置,1男,2女
+//    @Pd(name = "age") Integer age,// 年龄
+//    @Pd(name = "familyStatus") Integer familyStatus,// 基本状态:0正常,1心血管疾病(服用ARB),2心血管疾病(未服用ARB),3呼吸系统病史,4肿瘤病史,5糖尿病史,6服用过激素药物,7妊娠期,8其他
+//    @Pd(name = "statusDesp") String statusDesp,// 状态描述
+//    @Pd(name = "medical") Integer medical,// 是否确诊:0否,1是
+//    @Pd(name = "temperature") BigDecimal temperature,// 体温
+//    @Pd(name = "cough") Integer cough,// 咳嗽:0无咳嗽,1偶有短暂咳嗽,2咳嗽轻度影响生活,3咳嗽严重影响生活
+//    @Pd(name = "muscle") Integer muscle,// 肌肉酸痛:0无,1按压有,2偶尔,3持续有
+//    @Pd(name = "dyspnea") Integer dyspnea,// 呼吸困难:0无,1急走或上坡气短,2气短而走路变慢,3走路数分钟后气短,4气短无法离开房间
+//    @Pd(name = "fatigue") Integer fatigue,// 乏力:0无,1可体力劳动但觉得累,2轻体力劳动后长时间不能恢复,3不能正常生活
+//    @Pd(name = "diarrhea") Integer diarrhea,// 腹泻:0无,1轻度腹泻少于于3次,2中度腹泻4-6次,3重度腹泻超过6次
+//    @Pd(name = "singleRoom") Integer singleRoom,// 单间隔离:0否,1是
+//    //            @Pd(name = "suspectedStatus") String suspectedStatus,// 是否疑似:0否,1是
+//    @Pd(name = "others") String others,// 其他
+    //获取前一天数据
+    public List<MsSuspected> queryRibaoDetailList(Long reportId) {
+        List<MsSuspected> listSuspected = msSuspectedMapper.selectByReportId(reportId);
+        if (CollectionUtils.isEmpty(listSuspected)) {
+            listSuspected = new ArrayList<MsSuspected>();
+        } else {
+            for (MsSuspected obj : listSuspected) {
+                if (obj.getGrender().intValue() == 1) {
+                    obj.setGrenderStr("男");
+                } else if (obj.getGrender().intValue() == 2) {
+                    obj.setGrenderStr("女");
+                }
+
+                if (obj.getFamilyStatus().intValue() == 0) {
+                    obj.setFamilyStatusStr("正常");
+                } else if (obj.getFamilyStatus().intValue() == 1) {
+                    obj.setFamilyStatusStr("心血管疾病(服用ARB)");
+                } else if (obj.getFamilyStatus().intValue() == 2) {
+                    obj.setFamilyStatusStr("心血管疾病(未服用ARB)");
+                } else if (obj.getFamilyStatus().intValue() == 3) {
+                    obj.setFamilyStatusStr("呼吸系统病史");
+                } else if (obj.getFamilyStatus().intValue() == 4) {
+                    obj.setFamilyStatusStr("肿瘤病史");
+                } else if (obj.getFamilyStatus().intValue() == 5) {
+                    obj.setFamilyStatusStr("糖尿病史");
+                } else if (obj.getFamilyStatus().intValue() == 6) {
+                    obj.setFamilyStatusStr("服用过激素药物");
+                } else if (obj.getFamilyStatus().intValue() == 7) {
+                    obj.setFamilyStatusStr("妊娠期");
+                } else if (obj.getFamilyStatus().intValue() == 8) {
+                    obj.setFamilyStatusStr("其他");
+                }
+
+                if (obj.getMedical().intValue() == 0) {
+                    obj.setMedicalStr("否");
+                } else if (obj.getMedical().intValue() == 1) {
+                    obj.setMedicalStr("是");
+                }
+
+                if (obj.getCough().intValue() == 0) {
+                    obj.setCoughStr("无咳嗽");
+                } else if (obj.getCough().intValue() == 1) {
+                    obj.setCoughStr("偶有短暂咳嗽");
+                } else if (obj.getCough().intValue() == 2) {
+                    obj.setCoughStr("咳嗽轻度影响生活");
+                } else if (obj.getCough().intValue() == 3) {
+                    obj.setCoughStr("咳嗽严重影响生活");
+                }
+
+                if (obj.getMuscle().intValue() == 0) {
+                    obj.setMuscleStr("无");
+                } else if (obj.getMuscle().intValue() == 1) {
+                    obj.setMuscleStr("按压有");
+                } else if (obj.getMuscle().intValue() == 2) {
+                    obj.setMuscleStr("偶尔");
+                } else if (obj.getMuscle().intValue() == 3) {
+                    obj.setMuscleStr("持续有");
+                }
+
+                if (obj.getDyspnea().intValue() == 0) {
+                    obj.setDyspneaStr("无");
+                } else if (obj.getDyspnea().intValue() == 1) {
+                    obj.setDyspneaStr("急走或上坡气短");
+                } else if (obj.getDyspnea().intValue() == 2) {
+                    obj.setDyspneaStr("气短而走路变慢");
+                } else if (obj.getDyspnea().intValue() == 3) {
+                    obj.setDyspneaStr("走路数分钟后气短");
+                } else if (obj.getDyspnea().intValue() == 4) {
+                    obj.setDyspneaStr("气短无法离开房间");
+                }
+
+                if (obj.getFatigue().intValue() == 0) {
+                    obj.setFatigueStr("无");
+                } else if (obj.getFatigue().intValue() == 1) {
+                    obj.setFatigueStr("可体力劳动但觉得累");
+                } else if (obj.getFatigue().intValue() == 2) {
+                    obj.setFatigueStr("轻体力劳动后长时间不能恢复");
+                } else if (obj.getFatigue().intValue() == 3) {
+                    obj.setFatigueStr("不能正常生活");
+                }
+
+                if (obj.getDiarrhea().intValue() == 0) {
+                    obj.setDiarrheaStr("无");
+                } else if (obj.getDiarrhea().intValue() == 1) {
+                    obj.setDiarrheaStr("轻度腹泻少于于3次");
+                } else if (obj.getDiarrhea().intValue() == 2) {
+                    obj.setDiarrheaStr("中度腹泻4-6次");
+                } else if (obj.getDiarrhea().intValue() == 3) {
+                    obj.setDiarrheaStr("重度腹泻超过6次");
+                }
+
+                if (obj.getSingleRoom().intValue() == 0) {
+                    obj.setSingleRoomStr("否");
+                } else if (obj.getSingleRoom().intValue() == 1) {
+                    obj.setSingleRoomStr("是");
+                }
+
+                if (obj.getSuspectedStatus().intValue() == 0) {
+                    obj.setSuspectedStatusStr("否");
+                } else if (obj.getSuspectedStatus().intValue() == 1) {
+                    obj.setSuspectedStatusStr("是");
+                }
+            }
+        }
+        return listSuspected;
+    }
+
+    //通过昨天数据更新今天数据
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public Long getNowByYesterday(Long userCreate) {
+        // 判断今天是否有数据
+        Date today = new Date();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        String todayStr = sdf.format(today);
+        List<MsReport> listReportDb = msReportMapper.selectByReportDate(todayStr, userCreate);
+        if (CollectionUtils.isNotEmpty(listReportDb)) {
+            Long reportId = listReportDb.get(0).getReportId();
+            return reportId;
+        }
+
+        // 判断昨天是否有数据
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(today);
+        calendar.add(Calendar.DATE, -1);
+        String yestodayStr = sdf.format(calendar.getTime());
+        listReportDb = msReportMapper.selectByReportDate(yestodayStr, userCreate);
+        //有数据
+        Long reportId = 0L;
+        DateTime dateTime = new DateTime();
+        if (CollectionUtils.isNotEmpty(listReportDb)) {
+            Long reportIdDb = listReportDb.get(0).getReportId();
+            //添加到今天日报
+            MsReport msReportDb = msReportMapper.selectById(reportIdDb);
+            if (msReportDb != null) {
+                MsReport msReport = new MsReport();
+                BeanUtils.copyProperties(msReportDb, msReport);
+                reportId = IdWorker.getId();
+                msReport.setReportId(reportId);
+                msReport.setReportDate(dateTime.toDate());
+                msReport.setReportStatus(0);//未上报
+                msReport.setUserCreate(userCreate);
+                msReport.setTimeCreate(dateTime);
+                msReport.setUserUpdate(userCreate);
+                msReport.setTimeUpdate(dateTime);
+                msReportMapper.insert(msReport);
+
+                //添加今日家庭
+                List<MsSuspected> suspectedListDb = msSuspectedMapper.selectByReportId(reportIdDb);
+                if (CollectionUtils.isNotEmpty(suspectedListDb)) {
+                    for (MsSuspected msSuspectedDb : suspectedListDb) {
+                        MsSuspected msSuspected = new MsSuspected();
+                        BeanUtils.copyProperties(msSuspectedDb, msSuspected);
+                        msSuspected.setSuspectedId(IdWorker.getId());
+                        msSuspected.setReportId(reportId);
+                        msSuspected.setSuspectedStatus(0);
+                        msSuspected.setUserCreate(userCreate);
+                        msSuspected.setTimeCreate(dateTime);
+                        msSuspected.setUserUpdate(userCreate);
+                        msSuspected.setTimeUpdate(dateTime);
+                        msSuspectedMapper.insert(msSuspected);
+                    }
+                }
+            } else {
+                Long houseId = msReportMapper.selectHouseIdByUserId(userCreate);
+                reportId = IdWorker.getId();
+                MsReport msReport = new MsReport();
+                msReport.setReportId(reportId);
+                msReport.setHouseId(houseId);
+                msReport.setSafetyNum(0);
+                msReport.setSureNum(0);
+                msReport.setSuspectedNum(0);
+                msReport.setNormalNum(0);
+                msReport.setSingleNum(0);
+                msReport.setRemarks("");
+                msReport.setReportDate(dateTime.toDate());
+                msReport.setMsStatus(0);
+                msReport.setUserCreate(userCreate);
+                msReport.setTimeCreate(dateTime);
+                msReport.setUserUpdate(userCreate);
+                msReport.setTimeUpdate(dateTime);
+                msReportMapper.insert(msReport);
+            }
+        } else {
+            Long houseId = msReportMapper.selectHouseIdByUserId(userCreate);
+            reportId = IdWorker.getId();
+            MsReport msReport = new MsReport();
+            msReport.setReportId(reportId);
+            msReport.setHouseId(houseId);
+            msReport.setSafetyNum(0);
+            msReport.setSureNum(0);
+            msReport.setSuspectedNum(0);
+            msReport.setNormalNum(0);
+            msReport.setSingleNum(0);
+            msReport.setRemarks("");
+            msReport.setReportDate(dateTime.toDate());
+            msReport.setMsStatus(0);
+            msReport.setUserCreate(userCreate);
+            msReport.setTimeCreate(dateTime);
+            msReport.setUserUpdate(userCreate);
+            msReport.setTimeUpdate(dateTime);
+            msReportMapper.insert(msReport);
+        }
+
+        return reportId;
+    }
+
+}

+ 159 - 0
whepi-web/src/main/java/com/bofeng/wx/controller/RiBaoController.java

@@ -0,0 +1,159 @@
+package com.bofeng.wx.controller;
+
+
+import com.bofeng.entity.MsReport;
+import com.bofeng.entity.MsSuspected;
+import com.bofeng.service.MsSuspectedService;
+import com.bofeng.service.RiBaoService;
+import com.yvan.Model;
+import com.yvan.ModelOps;
+import com.yvan.mvc.Pd;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Author: songjiaqing
+ * @Date: 2020/2/4 15:38
+ */
+@RestController
+public class RiBaoController {
+
+    @Autowired
+    private MsSuspectedService msSuspectedService;
+    @Autowired
+    private RiBaoService riBaoService;
+
+
+    private String suspected_id;
+    private String report_id;
+    private String user_name;
+    private String grender;
+    private String age;
+    private String family_status;
+    private String status_desp;
+    private String medical;
+    private String temperature;
+    private String cough;
+    private String muscle;
+    private String dyspnea;
+    private String fatigue;
+    private String diarrhea;
+    private String single_room;
+    private String suspected_status;
+    private String others;
+    private String user_create;
+    private String time_create;
+    private String user_update;
+    private String time_update;
+
+
+    //查询家人
+    @GetMapping("/riBao/getRibao")
+    public MsReport queryRibao(@Pd(name = "userCreate") Long userCreate) {
+        Long reportId = riBaoService.getNowByYesterday(userCreate);
+        MsReport msReport = riBaoService.selectById(reportId);
+
+        return msReport;
+    }
+
+    // 进入日报首页
+    @GetMapping("/riBao/queryRibaoDetailList")
+    public Model<List<MsSuspected>> queryRibaoDetailList(@Pd(name = "userCreate") Long userCreate) {
+        Long reportId = riBaoService.getNowByYesterday(userCreate);
+        List<MsSuspected> listSuspected = riBaoService.queryRibaoDetailList(reportId);
+        return Model.newSuccess(listSuspected);
+    }
+
+    // 添加日报
+    @GetMapping("/riBao/addOrEditRibao")
+    public ModelOps addOrEditRibao(
+            @Pd(name = "suspectedId") Long suspectedId,
+            @Pd(name = "userName") String userName,// 家人姓名
+            @Pd(name = "grender") Integer grender,// 性别:0未设置,1男,2女
+            @Pd(name = "age") Integer age,// 年龄
+            @Pd(name = "familyStatus") Integer familyStatus,// 基本状态:0正常,1心血管疾病(服用ARB),2心血管疾病(未服用ARB),3呼吸系统病史,4肿瘤病史,5糖尿病史,6服用过激素药物,7妊娠期,8其他
+            @Pd(name = "statusDesp") String statusDesp,// 状态描述
+            @Pd(name = "medical") Integer medical,// 是否确诊:0否,1是
+            @Pd(name = "temperature") BigDecimal temperature,// 体温
+            @Pd(name = "cough") Integer cough,// 咳嗽:0无咳嗽,1偶有短暂咳嗽,2咳嗽轻度影响生活,3咳嗽严重影响生活
+            @Pd(name = "muscle") Integer muscle,// 肌肉酸痛:0无,1按压有,2偶尔,3持续有
+            @Pd(name = "dyspnea") Integer dyspnea,// 呼吸困难:0无,1急走或上坡气短,2气短而走路变慢,3走路数分钟后气短,4气短无法离开房间
+            @Pd(name = "fatigue") Integer fatigue,// 乏力:0无,1可体力劳动但觉得累,2轻体力劳动后长时间不能恢复,3不能正常生活
+            @Pd(name = "diarrhea") Integer diarrhea,// 腹泻:0无,1轻度腹泻少于于3次,2中度腹泻4-6次,3重度腹泻超过6次
+            @Pd(name = "singleRoom") Integer singleRoom,// 单间隔离:0否,1是
+//            @Pd(name = "suspectedStatus") String suspectedStatus,// 是否疑似:0否,1是
+            @Pd(name = "others") String others,// 其他
+            @Pd(name = "userCreate") Long userCreate) {
+        msSuspectedService.addSuspected(suspectedId, userName, grender, age, familyStatus, statusDesp, medical, temperature, cough, muscle, dyspnea, fatigue, diarrhea, singleRoom, others, userCreate);
+        return ModelOps.newSuccess();
+    }
+
+
+    //查询家人
+    @GetMapping("/riBao/selectSuspected")
+    public MsSuspected selectSuspected(HttpServletRequest request) {
+        //初始化今日日报
+        Long suspectedId = Long.parseLong(request.getParameter("suspectedId"));
+        return msSuspectedService.selectSuspected(suspectedId);
+    }
+
+    //删除家人病例
+    @PostMapping("/riBao/deleteSuspected")
+    public Integer deleteSuspected(HttpServletRequest request) {
+        Long suspectedId = Long.parseLong(request.getParameter("suspectedId"));
+        msSuspectedService.deleteSuspected(suspectedId);
+        return 1;
+    }
+
+//    //根据登录人获取家人
+//    @GetMapping("/riBao/queryRibao")
+//    public Model<List<MsSuspected>> queryRibao(@Pd(name = "userCreate") Long userCreate) {
+//        Date t = new Date();
+//        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
+//        String reportDate = df.format(t);
+//        return Model.newSuccess(msReportService.getByReportReportDate(reportDate, userCreate));
+//    }
+
+    //根据日报获取家人
+    @GetMapping("/riBao/queryRibaoRefresh")
+    public Model<List<MsSuspected>> queryRibaoRefresh(@Pd(name = "reportId") Long reportId) {
+        return Model.newSuccess(riBaoService.getByReportId(reportId));
+    }
+
+    //全家报平安
+    @PostMapping("/riBao/addReport")
+    public ModelOps addReport(HttpServletRequest request) {
+        Long userCreate = Long.parseLong(request.getParameter("userCreate"));
+        int re = riBaoService.addReport(userCreate);
+        if (re == 1) {
+            return ModelOps.newSuccess();
+        } else if (re == 2) { //没有上报体温
+            return ModelOps.newFail("请填报今日体温!");
+        }
+        return ModelOps.newFail("上报错误");
+    }
+
+    //根据日期获取家人
+    @GetMapping("/riBao/queryRibaoReportDate")
+    public Model<List<MsSuspected>> queryRibaoReportDate(
+            @Pd(name = "reportDate") String reportDate,
+            @Pd(name = "userCreate") Long userCreate) {
+//        return Model.newSuccess(riBaoService.getByReportReportDate(reportDate, userCreate));
+        return Model.newSuccess(new ArrayList<>());
+    }
+
+    //通过昨天数据更新今天数据
+    @PostMapping("/riBao/getNowByYesterday")
+    public Integer getNowByYesterday(HttpServletRequest request) {
+        Long userCreate = Long.parseLong(request.getParameter("userCreate"));
+        riBaoService.getNowByYesterday(userCreate);
+        return 1;
+    }
+}

+ 1 - 0
whepi-web/src/main/resources/mapper/MsReport.xml

@@ -3,5 +3,6 @@
 <mapper namespace="com.bofeng.dao.MsReportMapper">
     <select id="selectByReportDate" resultType="com.bofeng.entity.MsReport">
         select * from ms_report where report_date = #{reportDate} and  user_create = #{userCreate}
+        order by report_date desc
     </select>
 </mapper>