ソースを参照

Merge branch 'master' of http://git.yvanui.com/hust/wuhan_epi

hudingbo 5 年 前
コミット
f3d6511fde
37 ファイル変更1177 行追加363 行削除
  1. 2 2
      whepi-doc/group.sql
  2. 1 1
      whepi-doc/mrsb.sql
  3. 1 1
      whepi-ui/templates/groupBuying/groupBuyingCx.ftl
  4. 1 1
      whepi-ui/templates/groupBuying/groupBuyingJt.ftl
  5. 1 1
      whepi-ui/templates/groupBuying/groupBuyingQx.ftl
  6. 15 14
      whepi-ui/templates/groupBuying/groupBuyingXx.ftl
  7. 40 25
      whepi-ui/templates/home/buy.ftl
  8. 33 12
      whepi-ui/templates/home/buyClient.ftl
  9. 12 5
      whepi-ui/templates/home/buytc.ftl
  10. 23 7
      whepi-ui/templates/home/home.ftl
  11. 4 4
      whepi-ui/templates/yeweihui/home.ftl
  12. 30 10
      whepi-ui/templates/yeweihui/tgPublish.ftl
  13. 11 3
      whepi-ui/templates/yeweihui/tuangouMemberList.ftl
  14. 3 3
      whepi-web/src/main/java/com/bofeng/dao/BuyMapper.java
  15. 12 8
      whepi-web/src/main/java/com/bofeng/dao/JmTuangouDao.java
  16. 14 0
      whepi-web/src/main/java/com/bofeng/dao/UptownUnitMapper.java
  17. 8 0
      whepi-web/src/main/java/com/bofeng/dao/UserRoleMapper.java
  18. 92 87
      whepi-web/src/main/java/com/bofeng/entity/ExcelRiBao.java
  19. 95 87
      whepi-web/src/main/java/com/bofeng/entity/ExcelRiBaoLY.java
  20. 29 2
      whepi-web/src/main/java/com/bofeng/entity/ExcelRiBaoPrivate.java
  21. 1 1
      whepi-web/src/main/java/com/bofeng/entity/JmTuangou.java
  22. 44 7
      whepi-web/src/main/java/com/bofeng/entity/JmTuangouMember.java
  23. 38 1
      whepi-web/src/main/java/com/bofeng/entity/UptownUnit.java
  24. 51 4
      whepi-web/src/main/java/com/bofeng/service/BuyService.java
  25. 13 0
      whepi-web/src/main/java/com/bofeng/service/JmTuangouService.java
  26. 2 0
      whepi-web/src/main/java/com/bofeng/service/MsReportService.java
  27. 24 5
      whepi-web/src/main/java/com/bofeng/service/MsSuspectedService.java
  28. 133 16
      whepi-web/src/main/java/com/bofeng/service/RiBaoService.java
  29. 6 3
      whepi-web/src/main/java/com/bofeng/wx/controller/BuyController.java
  30. 0 3
      whepi-web/src/main/java/com/bofeng/wx/controller/RiBaoController.java
  31. 337 0
      whepi-web/src/main/java/com/bofeng/wx/controller/RiBaoYwhController.java
  32. 2 1
      whepi-web/src/main/java/com/bofeng/wx/controller/UserOpenController.java
  33. 3 27
      whepi-web/src/main/java/com/bofeng/wx/controller/YeWeiHuiController.java
  34. 11 10
      whepi-web/src/main/resources/mapper/BuyMapper.xml
  35. 10 0
      whepi-web/src/main/resources/mapper/JmTuangouMapper.xml
  36. 17 12
      whepi-web/src/main/resources/mapper/JmTuangouMemberMapper.xml
  37. 58 0
      whepi-web/src/main/resources/mapper/UptownUnitMapper.xml

+ 2 - 2
whepi-doc/group.sql

@@ -7,7 +7,7 @@ create table jm_buy (
     jm_id           bigint(20)      NOT NULL DEFAULT 0          COMMENT '团购参团id',
     user_id         bigint(20)      NOT NULL DEFAULT 0          COMMENT '居民id',
     buy_count       int(11)         NOT NULL DEFAULT 0          COMMENT '购买数量',
-    buy_money       varchar(6)      NOT NULL DEFAULT 0.00       COMMENT '购买金额',
+    buy_money       varchar(20)     NOT NULL DEFAULT 0          COMMENT '购买金额',
     phone           varchar(20)     NOT NULL DEFAULT ''         COMMENT '联系电话',
     buy_status      int(11)         NOT NULL DEFAULT 1          COMMENT '状态 1 在团 2 撤单',
     my_remark       varchar(200)    NOT NULL DEFAULT ''         COMMENT '备注',
@@ -30,7 +30,7 @@ create table jm_tuangou (
     tg_supplier     varchar(20)     NOT NULL DEFAULT ''         COMMENT '团购供应商',
     tg_goods        varchar(50)     NOT NULL DEFAULT ''         COMMENT '团购物资(套餐)',
     tg_price        varchar(20)     NOT NULL DEFAULT ''         COMMENT '价格',
-    tg_min_num      int(11)         NOT NULL DEFAULT 0          COMMENT '最小起订量',
+    tg_min_num      int(11)         NOT NULL DEFAULT 0          COMMENT '最低起送',
     tg_end_time     datetime(0)     NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '团购截止时间',
     tg_deliver_time datetime(0)     NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '预计送货时间',
     tg_phone_number varchar(20)     NOT NULL DEFAULT ''         COMMENT '联系人电话',

+ 1 - 1
whepi-doc/mrsb.sql

@@ -44,7 +44,7 @@ CREATE TABLE ms_suspected  (
   diarrhea          int(11)    NOT NULL DEFAULT 0                           COMMENT '腹泻:0无,1轻度腹泻少于于3次,2中度腹泻4-6次,3重度腹泻超过6次',
   score_histroy     int(11)    NOT NULL DEFAULT 0                           COMMENT '历史数据,没有历史数据,就是1分以下为安全,2分到3分为注意观察,3分以上联系医生,5分尽快就诊。有历史数据,一天增加三分及以上就是建议马上就医',
   score             int(11)    NOT NULL DEFAULT 0                           COMMENT '今日数据',
-  score_rezult      int(11)    NOT NULL DEFAULT 0                           COMMENT '评分结果,未评分(0),安全(1),注意观察(2),联系医生(3),尽快就诊(4)',
+  score_rezult      int(11)    NOT NULL DEFAULT 0                           COMMENT '评分结果,未评分(0),正常(1),注意观察(2),联系医生(3),尽快就诊(4)',
   single_room       int(11)    NOT NULL DEFAULT 0                           COMMENT '单间隔离:0否,1是',
   suspected_status  int(11)    NOT NULL DEFAULT 0                           COMMENT '是否疑似:0否,1是',
   others            varchar(600)  NOT NULL DEFAULT ''                       COMMENT '其他',

+ 1 - 1
whepi-ui/templates/groupBuying/groupBuyingCx.ftl

@@ -23,7 +23,7 @@
              
             <p style="text-indent: -0em;margin-left: 2em;">单&nbsp;&nbsp;&nbsp;&nbsp;价:&nbsp;&nbsp;${ tgItem.tgPrice }</p>
             &nbsp;
-            <p style="text-indent: -0em;margin-left: 2em;">最新起定量(份):&nbsp;&nbsp;${ tgItem.tgMinNum }</p>
+            <p style="text-indent: -0em;margin-left: 2em;">最低起送(份):&nbsp;&nbsp;${ tgItem.tgMinNum }</p>
             &nbsp;
             <p id="cx_p_endTime" style="text-indent: -0em;margin-left: 2em;">截止时间:&nbsp;&nbsp;</p>
             &nbsp;

+ 1 - 1
whepi-ui/templates/groupBuying/groupBuyingJt.ftl

@@ -19,7 +19,7 @@
             &nbsp;
             <p style="text-indent: -0em;margin-left: 2em;">单&nbsp;&nbsp;&nbsp;&nbsp;价:&nbsp;&nbsp;10</p>
             &nbsp;
-            <p style="text-indent: -0em;margin-left: 2em;">最新起定量(份):&nbsp;&nbsp;20</p>
+            <p style="text-indent: -0em;margin-left: 2em;">最低起送(份):&nbsp;&nbsp;20</p>
             &nbsp;
             <p style="text-indent: -0em;margin-left: 2em;">截止时间:&nbsp;&nbsp;2020-02-11</p>
             &nbsp;

+ 1 - 1
whepi-ui/templates/groupBuying/groupBuyingQx.ftl

@@ -19,7 +19,7 @@
             &nbsp;
             <p style="text-indent: -0em;margin-left: 2em;">单&nbsp;&nbsp;&nbsp;&nbsp;价:&nbsp;&nbsp;10</p>
             &nbsp;
-            <p style="text-indent: -0em;margin-left: 2em;">最新起定量(份):&nbsp;&nbsp;20</p>
+            <p style="text-indent: -0em;margin-left: 2em;">最低起送(份):&nbsp;&nbsp;20</p>
             &nbsp;
             <p style="text-indent: -0em;margin-left: 2em;">截止时间:&nbsp;&nbsp;2020-02-11</p>
             &nbsp;

+ 15 - 14
whepi-ui/templates/groupBuying/groupBuyingXx.ftl

@@ -18,20 +18,21 @@
             </div>
         </div>
         <div>
-
-        <p style="text-indent: -0em;margin-left: 2em;">供应商:&nbsp;&nbsp;${ tgItem.tgSupplier }</p>
-        &nbsp;
-        <p style="text-indent: -0em;margin-left: 2em;">套&nbsp;&nbsp;&nbsp;&nbsp;餐:&nbsp;&nbsp;${ tgItem.tgGoods }</p>
-        &nbsp;
-        <p style="text-indent: -0em;margin-left: 2em;">单&nbsp;&nbsp;&nbsp;&nbsp;价:&nbsp;&nbsp;${ tgItem.tgPrice }</p>
-        &nbsp;
-        <p style="text-indent: -0em;margin-left: 2em;">最新起定量(份):&nbsp;&nbsp;${ tgItem.tgMinNum }</p>
-        &nbsp;
-        <p id="p_endTime" style="text-indent: -0em;margin-left: 2em;">截止时间:&nbsp;&nbsp;</p>
-        &nbsp;
-        <p id="p_deliverTime" style="text-indent: -0em;margin-left: 2em;">预计送货时间:&nbsp;&nbsp;</p>
-        &nbsp;
-        <p style="text-indent: -0em;margin-left: 2em;">服务电话:&nbsp;&nbsp;${ tgItem.tgPhoneNumber }</p>
+            <p style="text-indent: -0em;margin-left: 2em;">供应商:&nbsp;&nbsp;${ tgItem.tgSupplier }</p>
+            &nbsp;
+            <p style="text-indent: -0em;margin-left: 2em;">套&nbsp;&nbsp;&nbsp;&nbsp;餐:&nbsp;&nbsp;${ tgItem.tgGoods }</p>
+            &nbsp;
+            <p style="text-indent: -0em;margin-left: 2em;">单&nbsp;&nbsp;&nbsp;&nbsp;价:&nbsp;&nbsp;${ tgItem.tgPrice }</p>
+            &nbsp;
+            <p style="text-indent: -0em;margin-left: 2em;">最低起送(份):&nbsp;&nbsp;${ tgItem.tgMinNum }</p>
+            &nbsp;
+            <p id="p_endTime" style="text-indent: -0em;margin-left: 2em;">截止时间:&nbsp;&nbsp;</p>
+            &nbsp;
+            <p id="p_deliverTime" style="text-indent: -0em;margin-left: 2em;">预计送货时间:&nbsp;&nbsp;</p>
+            &nbsp;
+            <p style="text-indent: -0em;margin-left: 2em;">服务电话:&nbsp;&nbsp;${ tgItem.tgPhoneNumber }</p>
+            &nbsp;
+            <p style="text-indent: -0em;margin-left: 2em;">增补修订:&nbsp;&nbsp;${ tgItem.remark }</p>
         </div>
         <div class="weui-loadmore weui-loadmore_line" style="width: 100%">
             <span class="weui-loadmore__tips">参团情况</span>

+ 40 - 25
whepi-ui/templates/home/buy.ftl

@@ -11,32 +11,24 @@
         <div class="weui-tab__panel"><#--团购信息的列表-->
             <div id="buy_nav1" style="text-align: center ">
                 团购信息
-            </div>
 
+                <div class="container">
+                    <div class="weui-form-preview"
+                         id="buyListGroup">
+
+                        <div style="display: flex; flex-direction: row; color: grey; font-size: medium;">
+                            <div style="width: 30%; text-align: center;color: #0a001f">标题</div>
+                            <div style="width: 20%; text-align: center;color: #0a001f">已团</div>
+                            <div style="width: 35%; text-align: center;color: #0a001f">截止时间</div>
+                            <div style="width: 15%; text-align: center;color: #0a001f">状态</div>
+                        </div>
 
-            <div id="buy_nav2" style="display: none"><#--我的团购信息-->
-                <div class="weui-form-preview">
-                    <div style="display: flex; flex-direction: row; color: grey; font-size: medium;">
-                        <div style="width: 33%; text-align: center;color: #0a001f">我的订单</div>
-                        <div style="width: 33%; text-align: center;color: #0a001f">提交时间</div>
-                        <div style="width: 33%; text-align: center;color: #0a001f">订单状态</div>
                     </div>
+
                 </div>
-                <div id="MyBuyAll">
-                </div>
-            </div>
-        </div>
-        <div class="weui-form-preview"
-             id="buyListGroup">
-            <div style="display: flex; flex-direction: row; color: grey; font-size: medium;">
-                <div style="width: 30%; text-align: center;color: #0a001f">标题</div>
-                <div style="width: 20%; text-align: center;color: #0a001f">已团</div>
-                <div style="width: 35%; text-align: center;color: #0a001f">截止时间</div>
-                <div style="width: 15%; text-align: center;color: #0a001f">状态</div>
-            </div>
-        </div>
-        <div id="buyAll" class="weui-panel__bd">
-        <#--   <a href="javascript:void(0);" style="color: grey;font-size: large">
+                <div class="container">
+                    <div id="buyAll" class="weui-panel__bd">
+                    <#--   <a href="javascript:void(0);" style="color: grey;font-size: large">
                 <div style="display: flex; flex-direction: row; text-align: center; font-size: x-small; line-height: 5vh;"
                      onclick=" myBuyClick()">
                     <div style="width: 40%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 12px">
@@ -53,7 +45,30 @@
                     </div>
                 </div>
             </a>-->
+                    </div>
+                    <div style="height: 20vh"></div>
+                </div>
+
+            </div>
+
+
+            <div id="buy_nav2" style="display: none"><#--我的团购信息-->
+                <div class="weui-form-preview">
+                    <div style="display: flex; flex-direction: row; color: grey; font-size: medium;">
+                        <div style="width: 33%; text-align: center;color: #0a001f">我的订单</div>
+                        <div style="width: 33%; text-align: center;color: #0a001f">提交时间</div>
+                        <div style="width: 33%; text-align: center;color: #0a001f">订单状态</div>
+                    </div>
+                </div>
+                <div class="container">
+                    <div id="MyBuyAll">
+
+                    </div>
+                    <div style="height: 20vh"></div>
+                </div>
+            </div>
         </div>
+
     </div>
 
     <script>
@@ -138,13 +153,13 @@
             if (v.buyStatus != 1) {
                 return $.alert("该订单已经取消");
             }
-            window.location.href = "/home/buytc.html?userId=" + $('#userId').val() + "&jmId=" + v.jmId + "&type=" + 2 + "&tgStatus=" + v.tgStatus;
+            window.location.href = "/home/buytc.html?userId=" + $('#userId').val() + "&jmId=" + v.jmId + "&type=" + 2 + "&tgStatus=" + v.tgStatus + "&buyId=" + v.buyId;
         }
 
 
         /*居民求助信息*/
         function myBuyClick(v) {
-            window.location.href = "/home/buytc.html?userId=" + $('#userId').val() + "&jmId=" + v.jmId + "&type=" + 1 + "&tgStatus=" + v.tgStatus;
+            window.location.href = "/home/buytc.html?userId=" + $('#userId').val() + "&jmId=" + v.jmId + "&type=" + 1 + "&tgStatus=" + v.tgStatus + "&buyId=" + 1;
         }
 
 
@@ -179,6 +194,6 @@
             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  M + D + h + m + s;
+            return M + D + h + m + s;
         }
     </script>

+ 33 - 12
whepi-ui/templates/home/buyClient.ftl

@@ -17,7 +17,7 @@
             <div style="display: inline;">
                 <input type="text" id="buyCount"
                        style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh; width: 50%;font-size: 16px;margin-top: 1vh;"
-                       maxlength="3" onkeyup="this.value=this.value.replace(/[^0-9-]+/,'');" min="1"
+                       maxlength="2" onkeyup="this.value=this.value.replace(/[^0-9-]+/,'');" min="1"
                        onchange="changeBuy()">
             </div>
         </div>
@@ -37,17 +37,21 @@
         </div>
     </div>
     <div style=" flex-direction: row; justify-content: space-between;">
-        <div style="display: inline;align-items: flex-start"">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</div>
-        <textarea id="Myremarks" class="weui-textarea" placeholder="输入内容(200字内)" rows="3"
-                  style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; margin-top: 1vh;" ></textarea>
+        <div style="display: inline;align-items: flex-start"
+        ">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:
     </div>
+    <textarea id="Myremarks" class="weui-textarea" placeholder="输入内容(200字内)" rows="3"
+              style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; margin-top: 1vh;"></textarea>
+</div>
     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh; margin-bottom: 5vh;">
     <#if type==1>
-        <a id="buyBack" onclick="buyBack()" href="javascript:;" class="weui-btn weui-btn_default"
-           style="width: 30%;">返回</a>
+        <a onclick="buyBack()" href="javascript:;" class="weui-btn weui-btn_default"
+           style="margin-top: 0;width: 30%;">返回</a>
     <#else>
-      <a id="MybuyRepeal" onclick="MybuyBack()" href="javascript:;" class="weui-btn weui-btn_default"
-         style="width: 30%;">撤销</a>
+    <a id="MybuyRepeal" onclick="MybuyBack()" href="javascript:;" class="weui-btn weui-btn_default"
+       style="margin-top: 0;width: 30%;">撤销</a>
+    <a onclick="buyBack()" href="javascript:;" class="weui-btn weui-btn_default"
+       style="margin-top: 0;width: 30%;">返回</a>
     </#if>
         <a id="buyCommit" onclick="buyCommit()" href="javascript:;" class="weui-btn weui-btn_primary"
            style="margin-top: 0;width: 30%;">提交</a>
@@ -64,13 +68,14 @@
             url: '/query/getAll/status',
             data: {
                 jmId: $('#jmBuy').val(),
+                userId: $('#buyuserId').val(),
             },
             type: 'GET',
             success: function (data) {
                 console.log(data);
-                $("#Buycount").html(data.data.count)
-                $("#myStatus").html(getStatus(data.data.tgStatus))
-                /* $("#myMenory").html(data.data.tgPrice)*/
+                $("#Buycount").html(data.data.count);
+                $("#myStatus").html(getStatus(data.data.tgStatus));
+                $("#myPhone").val(data.data.phone);
             },
             error: function () {
             }
@@ -82,7 +87,7 @@
     <#--返回-->
     function buyBack() {
         // window.history.back();
-        window.location.href = "/user/homeIndex.html?userId=" + $('#buyuserId').val() + "&userType=" + 1 + '#tab3';
+        window.location.href = "/user/homeIndex.html?userId=" + $('#buyuserId').val() + "&userType=" + 1 + "&show=tuangou";
     }
 
     /*撤销*/
@@ -123,10 +128,18 @@
             $.alert("请填写联系电话");
             return;
         }
+
+        if (!(/^1[34578]\d{9}$/.test($('#myPhone').val()))) {
+            $.alert("手机号码有误,请重填");
+            return false;
+
+        }
         /* if ($('#Myremarks').val() == undefined || $('#Myremarks').val() == '') {
              $.alert("请填写备注");
              return;
          }*/
+        changeBuy();
+
         $.ajax({
             url: '/home/home/buyGroup',
             data: {
@@ -138,6 +151,7 @@
                 jmId: $('#jmBuy').val(),
             },
             type: 'GET',
+            async: false,
             success: function (data) {
                 console.log(data.data);
                 buyBack();
@@ -149,12 +163,19 @@
 
     //输入购买的数量
     function changeBuy() {
+        if ($('#buyCount').val() > 20 || $('#buyCount').val() < 1) {
+            $('#buyCount').val('')
+            $.alert('请输入1到20以内的整数')
+            return ;
+        }
         $.ajax({
             url: '/query/getAll/status',
             data: {
                 jmId: $('#jmBuy').val(),
+                userId: $('#buyuserId').val(),
             },
             type: 'GET',
+            async: false,
             success: function (data) {
                 console.log(data);
                 $("#myMenory").html($('#buyCount').val() * data.data.tgPrice)

+ 12 - 5
whepi-ui/templates/home/buytc.ftl

@@ -5,6 +5,9 @@
     <input id="buyuserId" type="text" hidden="hidden" value=${userId}>
     <input id="jmBuy" type="text" hidden="hidden" value=${jmId}>
     <input id="tgStatusBuy" type="text" hidden="hidden" value=${tgStatus}>
+<#if type==2>
+    <input id="buyIdMy2" type="text" hidden="hidden" value=${buyId}>
+</#if>
 <#-- <div style="text-align: center ">
      团购信息
  </div>-->
@@ -29,7 +32,7 @@
         </div>
     </div>
 </div>
-<#include "/home/frag.foot.ftl"/>
+    <#include "/home/frag.foot.ftl"/>
 
 <script>
     (function ($) {
@@ -57,14 +60,14 @@
                         '\n' +
                         '            <div style="text-indent: -0em;margin-left: 2em;">单&nbsp;&nbsp;&nbsp;&nbsp;价:&nbsp;&nbsp;' + v.tgPrice + '</div>\n' +
                         '\n' +
-                        '            <div style="text-indent: -0em;margin-left: 2em;">最新起定量(份):&nbsp;&nbsp;' + v.tgMinNum + '</div>\n' +
+                        '            <div style="text-indent: -0em;margin-left: 2em;">最低起送:&nbsp;&nbsp;' + v.tgMinNum + '</div>\n' +
                         '\n' +
-                        '            <div style="text-indent: -0em;margin-left: 2em;">截止时间:&nbsp;&nbsp;' + timestampToTime(v.tgEndTime) + '</div>\n' +
+                        '            <div style="text-indent: -0em;margin-left: 2em;">截止时间:&nbsp;&nbsp;' + v.tgEndTime + '</div>\n' +
                         '\n' +
-                        '            <div style="text-indent: -0em;margin-left: 2em;">预计送货时间:&nbsp;&nbsp;' + timestampToTime(v.tgDeliverTime) + '</div>\n' +
+                        '            <div style="text-indent: -0em;margin-left: 2em;">预计送货时间:&nbsp;&nbsp;' + v.tgDeliverTime + '</div>\n' +
                         '\n' +
                         '            <div style="text-indent: -0em;margin-left: 2em;">服务电话:&nbsp;&nbsp;' + v.tgPhoneNumber + '</div>\n' +
-                        '            <div style="text-indent: -0em;margin-left: 2em;">备&nbsp;&nbsp;&nbsp;&nbsp;注:&nbsp;&nbsp;' + v.remark + '</div>\n'+
+                        '            <div style="text-indent: -0em;margin-left: 2em;">备&nbsp;&nbsp;&nbsp;&nbsp;注:&nbsp;&nbsp;' + v.remark + '</div>\n' +
                         '     </div>\n' +
                         '    </div>')
             },
@@ -78,6 +81,7 @@
          data: {
              userId: $('#buyuserId').val(),
              jmId: $('#jmBuy').val(),
+             buyId: $('#buyIdMy2').val(),
          },
          type: 'GET',
          success: function (data) {
@@ -99,6 +103,9 @@
             $('#buyCount').attr("disabled", "disabled");
             $('#myPhone').attr("disabled", "disabled");
             $('#Myremarks').attr("disabled", "disabled");
+            $('#buyCommit')[0].style.display = 'none';
+            $('#MybuyRepeal')[0].style.display = 'none';
+
         }
 
     })(jQuery);

+ 23 - 7
whepi-ui/templates/home/home.ftl

@@ -9,23 +9,23 @@
         <div id="tab2" class="weui-tab__bd-item">
             <#include "/home/qiuzhu.ftl" /></div>
         <div id="tab3" class="weui-tab__bd-item">
-           <#include "/home/buy.ftl" /></div>
+    <#include "/home/buy.ftl" /></div>
     <#--<div id="tab4" class="weui-tab__bd-item">-->
     <#--<h1>页面四</h1> </div>-->
     </div>
     <div class="weui-tabbar">
-        <a href="#tab1" class="weui-tabbar__item weui-bar__item--on">
+        <a id="jt1" href="#tab1" class="weui-tabbar__item weui-bar__item--on">
             <div class="weui-tabbar__icon"><img src="/static/images/wx/order.png" alt=""></div>
             <p class="weui-tabbar__label">健康日报</p>
         </a>
-        <a href="#tab2" class="weui-tabbar__item" onclick="familyClick()">
+        <a id="jt2" href="#tab2" class="weui-tabbar__item" onclick="familyClick()">
             <div class="weui-tabbar__icon"><img src="/static/images/wx/customer_service.png" alt=""></div>
             <p class="weui-tabbar__label">家庭求助</p>
         </a>
-        <#--<a href="#tab3" class="weui-tabbar__item" onclick="buyGroup()">-->
-            <#--<div class="weui-tabbar__icon"><img src="/static/images/wx/upload.png" alt=""></div>-->
-            <#--<p class="weui-tabbar__label">商品团购</p>-->
-        <#--</a>-->
+        <a id="jt3" href="#tab3" class="weui-tabbar__item" onclick="buyGroup()">
+            <div class="weui-tabbar__icon"><img src="/static/images/wx/upload.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>-->
@@ -82,6 +82,22 @@
                 }
             });
         });
+
+
+        function selectTab() {
+            $("#tab1").removeClass('weui-tab__bd-item--active');
+            $("#jt1").removeClass('weui-bar__item--on');
+            $("#tab3").addClass('weui-tab__bd-item--active');
+            $("#jt3").addClass('weui-bar__item--on');
+            buyGroup();
+        }
+
+        var show = ${show!'"-"'};
+
+        if (show == 'tuangou') {
+            selectTab();
+
+        }
     })(jQuery);
 
 

+ 4 - 4
whepi-ui/templates/yeweihui/home.ftl

@@ -1,4 +1,4 @@
-<#assign title="管理员"/>
+<#assign title="业委会"/>
 <#include "/home/frag.head.ftl" />
 
 <div class="weui-tab">
@@ -13,9 +13,9 @@
         </div>
         <div id="tab2" class="weui-tab__bd-item">
             <#include "/yeweihui/qiuzhu.ftl" /></div>
-        <div id="tab3" class="weui-tab__bd-item">
-            <#include "/yeweihui/tuangou.ftl" />
-        </div>
+        <#--<div id="tab3" class="weui-tab__bd-item">-->
+            <#--<#include "/yeweihui/tuangou.ftl" />-->
+        <#--</div>-->
     <#--<div id="tab3" class="weui-tab__bd-item">-->
     <#--<h1>页面三</h1> </div>-->
     <#--<div id="tab4" class="weui-tab__bd-item">-->

+ 30 - 10
whepi-ui/templates/yeweihui/tgPublish.ftl

@@ -1,4 +1,4 @@
-<#assign title="求助详情"/>
+<#assign title="团购详情"/>
 <#include "/home/frag.head.ftl" />
 
 <div class="weui-tab">
@@ -16,7 +16,7 @@
         <input id="tg_input_goods" class="weui-input" autofocus="" type="text" placeholder="请输入" maxlength="50" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
         <p class="weui-media-box__desc" style="margin-top: 1vh;">单价(元):</p>
         <input id="tg_input_price" class="weui-input" autofocus="" type="number" placeholder="请输入" maxlength="50" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
-        <p class="weui-media-box__desc" style="margin-top: 1vh;">最小起订量(份):</p>
+        <p class="weui-media-box__desc" style="margin-top: 1vh;">最低起送(份):</p>
         <input id="tg_input_mixnum" class="weui-input" autofocus="" type="number" placeholder="请输入" maxlength="50" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
         <p class="weui-media-box__desc" style="margin-top: 1vh;">截止时间:</p>
         <input id="tg_input_end_time" type="text" placeholder="请选择时间" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;"/>
@@ -49,49 +49,69 @@
 
         let title = $("#tg_input_title").val();
         if (title.length <= 0) {
-            alert("请输入组团标题");
+            $.alert("请输入组团标题");
             return;
         }
 
         let supplier = $("#tg_input_supplier").val();
         if (supplier.length <= 0) {
-            alert("请输入供应商名称");
+            $.alert("请输入供应商名称");
             return;
         }
 
         let goods = $("#tg_input_goods").val();
         if (goods.length <= 0) {
-            alert("请输入套餐内容");
+            $.alert("请输入套餐内容");
             return;
         }
 
         let price = $("#tg_input_price").val();
         if (price.length <= 0) {
-            alert("请输入套餐单价");
+            $.alert("请输入套餐单价");
             return;
         }
 
         let mixnum = $("#tg_input_mixnum").val();
         if (mixnum.length <= 0) {
-            alert("请输入最小起订量");
+            $.alert("请输入最低起送");
             return;
         }
 
         let end_time = $("#tg_input_end_time").val();
         if (end_time.length <= 0) {
-            alert("请选择截止时间");
+            $.alert("请选择截止时间");
             return;
         }
 
         let deliver_time = $("#tg_input_deliver_time").val();
         if (deliver_time.length <= 0) {
-            alert("请选择送货时间");
+            $.alert("请选择送货时间");
             return;
         }
 
         let phone_number = $("#tg_input_phone_number").val();
         if (phone_number.length <= 0) {
-            alert("请输入服务电话");
+            $.alert("请输入服务电话");
+            return;
+        }
+
+        let curTimestamp =(new Date()).valueOf();
+        let endTimestamp = end_time.replace(/-/g,'/');
+        endTimestamp = Date.parse(endTimestamp);
+        let deliverTimestamp = deliver_time.replace(/-/g,'/');
+        deliverTimestamp = Date.parse(deliverTimestamp);
+        if (endTimestamp < curTimestamp) {
+            $.alert("团购截止时间不能早于当前时间");
+            return;
+        }
+
+        if (deliverTimestamp < curTimestamp) {
+            $.alert("送货时间不能早于当前时间");
+            return;
+        }
+
+        if (endTimestamp > deliverTimestamp) {
+            $.alert("团购截止时间不能大于送货时间");
             return;
         }
 

+ 11 - 3
whepi-ui/templates/yeweihui/tuangouMemberList.ftl

@@ -9,8 +9,12 @@
 
     <div class="weui-btn-area">
         <div style="display: flex; flex-direction: row; justify-content: space-around;">
-            <div id="tg_member_xiaoqu">敬业小区</div>
-            <div id="tg_member_num">当前已团: </div>
+            <div id="tg_member_xiaoqu"></div>
+        </div>
+        <div style="display: flex; flex-direction: row; justify-content: space-around;">
+            <div id="tg_member_count">家庭用户: </div>
+            <div id="tg_member_num">已参团份数: </div>
+            <div id="tg_member_totoalPrice">合计金额: </div>
         </div>
 
         <div class="msgInfoTabHeaderDiv">
@@ -65,10 +69,11 @@
 
     $('#member_list').empty();
     let totalNum = 0;
+    let totalPrice = 0;
     for (let i = 0; i < members.length; i++) {
         let member = members[i];
         totalNum += member.buyCount;
-
+        totalPrice += member.buyCount * parseFloat(member.tgPrice);
         $('#member_list').append($('<div class="msgInfoTabHeaderDiv">\n' +
             '                <div class="msgInfoTabColumn1">' + member.ridgepole + '-' + member.unit + '-' + member.houseNumber + '</div>\n' +
             '                <div class="msgInfoTabColumn2" style="text-align: center;">' + member.buyCount + '</div>\n' +
@@ -78,6 +83,9 @@
 
     $('#tg_member_xiaoqu').html(members[0].uptownName);
     $('#tg_member_num').append(totalNum);
+    $('#tg_member_count').append(members.length);
+    $('#tg_member_totoalPrice').append(totalPrice);
+
     $("#tg_member_export").attr('href', '/yeweihui/tuangou/member/list/export?jmId=' + tgItem.jmId);
     $('#tg_member_export_url_detail').val(window.location.hostname + '/yeweihui/tuangou/member/list/export?jmId=' + tgItem.jmId);
 </script>

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

@@ -19,9 +19,9 @@ public interface BuyMapper extends BaseMapper<Buy> {
 
   List<Buy> MyGroup(@Param("userId") Long userId);
 
-  Buy queryGroup(@Param("userId") Long userId, @Param("jmId") Long jmId);
-
   JmTuangou selectGroup(@Param("userId") Long userId, @Param("jmId") Long jmId);
 
-  Buy status(@Param("jmId") Long jmId);
+  Buy status(@Param("jmId") Long jmId,@Param("userId") Long userId);
+
+  Buy selectCountNum(@Param("jmId") Long jmId);
 }

+ 12 - 8
whepi-web/src/main/java/com/bofeng/dao/JmTuangouDao.java

@@ -12,19 +12,23 @@ import java.util.List;
 @Repository
 public interface JmTuangouDao extends BaseMapper<JmTuangou> {
 
-    List<JmTuangou> queryTuangouListByUptownId (@Param("uptownId") Long uptownId);
+  List<JmTuangou> queryTuangouListByUptownId(@Param("uptownId") Long uptownId);
 
-    List<JmTuangou> queryTuangouListByUptownIdAndTitle (@Param("uptownId") Long uptownId, @Param("title") String title);
+  List<JmTuangou> queryTuangouListByUptownIdAndTitle(@Param("uptownId") Long uptownId, @Param("title") String title);
 
-    List<JmTuangou> queryTuangouListByUserId (@Param("userId") Long userId);
+  List<JmTuangou> queryTuangouListByUserId(@Param("userId") Long userId);
 
-    List<JmTuangou> queryTuangouListByUserIdAndTitle (@Param("userId") Long userId, @Param("title") String title);
+  List<JmTuangou> queryTuangouListByUserIdAndTitle(@Param("userId") Long userId, @Param("title") String title);
 
-    JmTuangou selectJmTuangouByJmId(@Param("JmId") Long JmId);
+  JmTuangou selectJmTuangouByJmId(@Param("JmId") Long JmId);
 
-    Integer updateRemarkByJmId(@Param("JmId") Long JmId, @Param("remark") String remark);
+  Integer updateRemarkByJmId(@Param("JmId") Long JmId, @Param("remark") String remark);
 
-    Integer updateStatusByJmId(@Param("JmId") Long JmId, @Param("status") Long status);
+  Integer updateStatusByJmId(@Param("JmId") Long JmId, @Param("status") Long status);
 
-    Integer updateStatusRemarkByJmId(@Param("JmId") Long JmId, @Param("status") Long status, @Param("remark") String remark);
+  Integer updateStatusRemarkByJmId(@Param("JmId") Long JmId, @Param("status") Long status, @Param("remark") String remark);
+
+  List<JmTuangou> selectAll();
+
+  int updateAll(@Param("tg") List<JmTuangou> tg);
 }

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

@@ -15,4 +15,18 @@ public interface UptownUnitMapper extends BaseMapper<UptownUnit> {
 
     @Select("select * from sys_uptown_unit where status = 1 and uptown_id = #{uptownId}")
     List<UptownUnit> getUptownUnitData(@Param("uptownId") Long uptownId);
+
+
+    List<UptownUnit> queryDongList(@Param("uptownId") Long uptownId);
+
+    List<UptownUnit> queryDanYuanList(@Param("uptownId") Long uptownId, @Param("ridgepole") Long ridgepole);
+
+    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);
+
+    List<UptownUnit> queryYiBaoList(@Param("uptownId") Long uptownId, @Param("reportDate") String reportDate);
+
+    List<UptownUnit> queryYiChangList(@Param("uptownId") Long uptownId, @Param("reportDate") String reportDate);
+
 }

+ 8 - 0
whepi-web/src/main/java/com/bofeng/dao/UserRoleMapper.java

@@ -15,4 +15,12 @@ public interface UserRoleMapper extends BaseMapper<UserRole> {
 
     @Select("select * from sys_user_role where user_id = #{userId}")
     List<UserRole> getUserRoleByUserId(@Param("userId") Long userId);
+
+
+    @Select("select * from sys_user_role where user_id=#{userId} and role_id=2")
+    UserRole getUserRoleYwhByUserId(@Param("userId") Long userId);
+
+    @Select("select * from sys_user_role where user_id=#{userId} and role_id=2")
+    List<UserRole> getUserRoleYwhsByUserId(@Param("userId") Long userId);
+
 }

+ 92 - 87
whepi-web/src/main/java/com/bofeng/entity/ExcelRiBao.java

@@ -14,6 +14,7 @@ public class ExcelRiBao {
     private String ridgepole;
     private String unit;
     private String doorplate;
+    private BigDecimal temperature;
     private int grender;
     private int familyStatus;
     private int medical;
@@ -89,7 +90,11 @@ public class ExcelRiBao {
 //    private String age;
 
     @ExcelProperty(value = "体温", index = 10)
-    private BigDecimal temperature;
+    private String temperatureStr;
+    public String getTemperatureStr() {
+        temperatureStr = temperature.floatValue()>10?temperature+"":"未填报";
+        return temperatureStr;
+    }
 
     @ExcelProperty(value = "确诊", index = 11)
     private String medicalStr;
@@ -113,90 +118,90 @@ public class ExcelRiBao {
         return singleRoomStr;
     }
 
-//    @ExcelProperty(value = "身体基本情况", index = 14)
-//    private String baseDesc;
-//    public String getBaseDesc() {
-//        if (familyStatus == 0) {
-//            baseDesc = "无病史";
-//        } else if (familyStatus == 1) {
-//            baseDesc = "心血管疾病(服用ARB)";
-//        } else if (familyStatus == 2) {
-//            baseDesc = "心血管疾病(未服用ARB)";
-//        } else if (familyStatus == 3) {
-//            baseDesc = "呼吸系统病史";
-//        } else if (familyStatus == 4) {
-//            baseDesc = "肿瘤病史";
-//        } else if (familyStatus == 5) {
-//            baseDesc = "糖尿病史";
-//        } else if (familyStatus == 6) {
-//            baseDesc = "服用过激素药物";
-//        } else if (familyStatus == 7) {
-//            baseDesc = "妊娠期";
-//        } else {
-//            baseDesc = "其他";
-//        }
-//        return baseDesc;
-//    }
-//
-//    @ExcelProperty(value = "病情描述", index = 15)
-//    private String bingqingDesc = "";
-//    public String getBingqingDesc() {
-//
-//        if (medical == 1) {
-//            bingqingDesc += "已确诊、";
-//        }
-//
-//        if (singleRoom == 1) {
-//            bingqingDesc += "单间隔离、";
-//        }
-//
-//        bingqingDesc = bingqingDesc + "体温:" + temperature + "、";
-//
-//        if (cough == 1) {
-//            bingqingDesc += "偶尔短暂咳嗽、";
-//        } else if (cough == 2) {
-//            bingqingDesc += "咳嗽轻度影响生活、";
-//        } else if (cough == 3) {
-//            bingqingDesc += "咳嗽严重影响生活、";
-//        }
-//        if (muscle == 1) {
-//            bingqingDesc += "肌肉按压有酸痛、";
-//        } else if (muscle == 2) {
-//            bingqingDesc += "偶尔肌肉按压酸痛、";
-//        } else if (muscle == 3) {
-//            bingqingDesc += "肌肉按压持续酸痛、";
-//        }
-//        if (dyspnea == 1) {
-//            bingqingDesc += "呼吸急走或上坡气短、";
-//        } else if (dyspnea == 2) {
-//            bingqingDesc += "呼吸气短而走路变慢、";
-//        } else if (dyspnea == 3) {
-//            bingqingDesc += "呼吸走路数分钟后气短、";
-//        } else if (dyspnea == 4) {
-//            bingqingDesc += "呼吸气短无法离开房间、";
-//        }
-//        if (fatigue == 1) {
-//            bingqingDesc += "可体力劳动但觉得累、";
-//        } else if (fatigue == 2) {
-//            bingqingDesc += "轻体力劳动后长时间不能恢复、";
-//        } else if (fatigue == 3) {
-//            bingqingDesc += "不能正常生活、";
-//        }
-//        if (diarrhea == 1) {
-//            bingqingDesc += "轻度腹泻少于于3次、";
-//        } else if (diarrhea == 2) {
-//            bingqingDesc += "中度腹泻4-6次、";
-//        } else if (diarrhea == 3) {
-//            bingqingDesc += "重度腹泻超过6次、";
-//        }
-//
-//        if (!Strings.isNullOrEmpty(statusDesp)) {
-//            bingqingDesc += statusDesp;
-//            bingqingDesc += "、";
-//        }
-//        if (!Strings.isNullOrEmpty(others)) {
-//            bingqingDesc += others;
-//        }
-//        return bingqingDesc;
-//    }
+    @ExcelProperty(value = "身体基本情况", index = 13)
+    private String baseDesc;
+    public String getBaseDesc() {
+        if (familyStatus == 0) {
+            baseDesc = "无病史";
+        } else if (familyStatus == 1) {
+            baseDesc = "心血管疾病(服用ARB)";
+        } else if (familyStatus == 2) {
+            baseDesc = "心血管疾病(未服用ARB)";
+        } else if (familyStatus == 3) {
+            baseDesc = "呼吸系统病史";
+        } else if (familyStatus == 4) {
+            baseDesc = "肿瘤病史";
+        } else if (familyStatus == 5) {
+            baseDesc = "糖尿病史";
+        } else if (familyStatus == 6) {
+            baseDesc = "服用过激素药物";
+        } else if (familyStatus == 7) {
+            baseDesc = "妊娠期";
+        } else {
+            baseDesc = "其他";
+        }
+        return baseDesc;
+    }
+
+    @ExcelProperty(value = "病情描述", index = 14)
+    private String bingqingDesc = "";
+    public String getBingqingDesc() {
+
+        if (medical == 1) {
+            bingqingDesc += "已确诊、";
+        }
+
+        if (singleRoom == 1) {
+            bingqingDesc += "单间隔离、";
+        }
+
+        bingqingDesc = bingqingDesc + "体温:" + temperatureStr + "、";
+
+        if (cough == 1) {
+            bingqingDesc += "偶尔短暂咳嗽、";
+        } else if (cough == 2) {
+            bingqingDesc += "咳嗽轻度影响生活、";
+        } else if (cough == 3) {
+            bingqingDesc += "咳嗽严重影响生活、";
+        }
+        if (muscle == 1) {
+            bingqingDesc += "肌肉按压有酸痛、";
+        } else if (muscle == 2) {
+            bingqingDesc += "偶尔肌肉按压酸痛、";
+        } else if (muscle == 3) {
+            bingqingDesc += "肌肉按压持续酸痛、";
+        }
+        if (dyspnea == 1) {
+            bingqingDesc += "呼吸急走或上坡气短、";
+        } else if (dyspnea == 2) {
+            bingqingDesc += "呼吸气短而走路变慢、";
+        } else if (dyspnea == 3) {
+            bingqingDesc += "呼吸走路数分钟后气短、";
+        } else if (dyspnea == 4) {
+            bingqingDesc += "呼吸气短无法离开房间、";
+        }
+        if (fatigue == 1) {
+            bingqingDesc += "可体力劳动但觉得累、";
+        } else if (fatigue == 2) {
+            bingqingDesc += "轻体力劳动后长时间不能恢复、";
+        } else if (fatigue == 3) {
+            bingqingDesc += "不能正常生活、";
+        }
+        if (diarrhea == 1) {
+            bingqingDesc += "轻度腹泻少于于3次、";
+        } else if (diarrhea == 2) {
+            bingqingDesc += "中度腹泻4-6次、";
+        } else if (diarrhea == 3) {
+            bingqingDesc += "重度腹泻超过6次、";
+        }
+
+        if (!Strings.isNullOrEmpty(statusDesp)) {
+            bingqingDesc += statusDesp;
+            bingqingDesc += "、";
+        }
+        if (!Strings.isNullOrEmpty(others)) {
+            bingqingDesc += others;
+        }
+        return bingqingDesc;
+    }
 }

+ 95 - 87
whepi-web/src/main/java/com/bofeng/entity/ExcelRiBaoLY.java

@@ -1,6 +1,7 @@
 package com.bofeng.entity;
 
 import com.alibaba.excel.annotation.ExcelProperty;
+import com.google.common.base.Strings;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -13,6 +14,7 @@ public class ExcelRiBaoLY {
     private String ridgepole;
     private String unit;
     private String doorplate;
+    private BigDecimal temperature;
     private int grender;
     private int familyStatus;
     private int medical;
@@ -87,8 +89,14 @@ public class ExcelRiBaoLY {
 //    @ExcelProperty(value = "年龄", index = 11)
 //    private String age;
 
+
     @ExcelProperty(value = "体温", index = 10)
-    private BigDecimal temperature;
+    private String temperatureStr;
+    public String getTemperatureStr() {
+        temperatureStr = temperature.floatValue()>10?temperature+"":"未填报";
+        return temperatureStr;
+    }
+
 
     @ExcelProperty(value = "确诊", index = 11)
     private String medicalStr;
@@ -112,90 +120,90 @@ public class ExcelRiBaoLY {
         return singleRoomStr;
     }
 
-//    @ExcelProperty(value = "身体基本情况", index = 14)
-//    private String baseDesc;
-//    public String getBaseDesc() {
-//        if (familyStatus == 0) {
-//            baseDesc = "无病史";
-//        } else if (familyStatus == 1) {
-//            baseDesc = "心血管疾病(服用ARB)";
-//        } else if (familyStatus == 2) {
-//            baseDesc = "心血管疾病(未服用ARB)";
-//        } else if (familyStatus == 3) {
-//            baseDesc = "呼吸系统病史";
-//        } else if (familyStatus == 4) {
-//            baseDesc = "肿瘤病史";
-//        } else if (familyStatus == 5) {
-//            baseDesc = "糖尿病史";
-//        } else if (familyStatus == 6) {
-//            baseDesc = "服用过激素药物";
-//        } else if (familyStatus == 7) {
-//            baseDesc = "妊娠期";
-//        } else {
-//            baseDesc = "其他";
-//        }
-//        return baseDesc;
-//    }
-//
-//    @ExcelProperty(value = "病情描述", index = 15)
-//    private String bingqingDesc = "";
-//    public String getBingqingDesc() {
-//
-//        if (medical == 1) {
-//            bingqingDesc += "已确诊、";
-//        }
-//
-//        if (singleRoom == 1) {
-//            bingqingDesc += "单间隔离、";
-//        }
-//
-//        bingqingDesc = bingqingDesc + "体温:" + temperature + "、";
-//
-//        if (cough == 1) {
-//            bingqingDesc += "偶尔短暂咳嗽、";
-//        } else if (cough == 2) {
-//            bingqingDesc += "咳嗽轻度影响生活、";
-//        } else if (cough == 3) {
-//            bingqingDesc += "咳嗽严重影响生活、";
-//        }
-//        if (muscle == 1) {
-//            bingqingDesc += "肌肉按压有酸痛、";
-//        } else if (muscle == 2) {
-//            bingqingDesc += "偶尔肌肉按压酸痛、";
-//        } else if (muscle == 3) {
-//            bingqingDesc += "肌肉按压持续酸痛、";
-//        }
-//        if (dyspnea == 1) {
-//            bingqingDesc += "呼吸急走或上坡气短、";
-//        } else if (dyspnea == 2) {
-//            bingqingDesc += "呼吸气短而走路变慢、";
-//        } else if (dyspnea == 3) {
-//            bingqingDesc += "呼吸走路数分钟后气短、";
-//        } else if (dyspnea == 4) {
-//            bingqingDesc += "呼吸气短无法离开房间、";
-//        }
-//        if (fatigue == 1) {
-//            bingqingDesc += "可体力劳动但觉得累、";
-//        } else if (fatigue == 2) {
-//            bingqingDesc += "轻体力劳动后长时间不能恢复、";
-//        } else if (fatigue == 3) {
-//            bingqingDesc += "不能正常生活、";
-//        }
-//        if (diarrhea == 1) {
-//            bingqingDesc += "轻度腹泻少于于3次、";
-//        } else if (diarrhea == 2) {
-//            bingqingDesc += "中度腹泻4-6次、";
-//        } else if (diarrhea == 3) {
-//            bingqingDesc += "重度腹泻超过6次、";
-//        }
-//
-//        if (!Strings.isNullOrEmpty(statusDesp)) {
-//            bingqingDesc += statusDesp;
-//            bingqingDesc += "、";
-//        }
-//        if (!Strings.isNullOrEmpty(others)) {
-//            bingqingDesc += others;
-//        }
-//        return bingqingDesc;
-//    }
+    @ExcelProperty(value = "身体基本情况", index = 13)
+    private String baseDesc;
+    public String getBaseDesc() {
+        if (familyStatus == 0) {
+            baseDesc = "无病史";
+        } else if (familyStatus == 1) {
+            baseDesc = "心血管疾病(服用ARB)";
+        } else if (familyStatus == 2) {
+            baseDesc = "心血管疾病(未服用ARB)";
+        } else if (familyStatus == 3) {
+            baseDesc = "呼吸系统病史";
+        } else if (familyStatus == 4) {
+            baseDesc = "肿瘤病史";
+        } else if (familyStatus == 5) {
+            baseDesc = "糖尿病史";
+        } else if (familyStatus == 6) {
+            baseDesc = "服用过激素药物";
+        } else if (familyStatus == 7) {
+            baseDesc = "妊娠期";
+        } else {
+            baseDesc = "其他";
+        }
+        return baseDesc;
+    }
+
+    @ExcelProperty(value = "病情描述", index = 14)
+    private String bingqingDesc = "";
+    public String getBingqingDesc() {
+
+        if (medical == 1) {
+            bingqingDesc += "已确诊、";
+        }
+
+        if (singleRoom == 1) {
+            bingqingDesc += "单间隔离、";
+        }
+
+        bingqingDesc = bingqingDesc + "体温:" + temperatureStr + "、";
+
+        if (cough == 1) {
+            bingqingDesc += "偶尔短暂咳嗽、";
+        } else if (cough == 2) {
+            bingqingDesc += "咳嗽轻度影响生活、";
+        } else if (cough == 3) {
+            bingqingDesc += "咳嗽严重影响生活、";
+        }
+        if (muscle == 1) {
+            bingqingDesc += "肌肉按压有酸痛、";
+        } else if (muscle == 2) {
+            bingqingDesc += "偶尔肌肉按压酸痛、";
+        } else if (muscle == 3) {
+            bingqingDesc += "肌肉按压持续酸痛、";
+        }
+        if (dyspnea == 1) {
+            bingqingDesc += "呼吸急走或上坡气短、";
+        } else if (dyspnea == 2) {
+            bingqingDesc += "呼吸气短而走路变慢、";
+        } else if (dyspnea == 3) {
+            bingqingDesc += "呼吸走路数分钟后气短、";
+        } else if (dyspnea == 4) {
+            bingqingDesc += "呼吸气短无法离开房间、";
+        }
+        if (fatigue == 1) {
+            bingqingDesc += "可体力劳动但觉得累、";
+        } else if (fatigue == 2) {
+            bingqingDesc += "轻体力劳动后长时间不能恢复、";
+        } else if (fatigue == 3) {
+            bingqingDesc += "不能正常生活、";
+        }
+        if (diarrhea == 1) {
+            bingqingDesc += "轻度腹泻少于于3次、";
+        } else if (diarrhea == 2) {
+            bingqingDesc += "中度腹泻4-6次、";
+        } else if (diarrhea == 3) {
+            bingqingDesc += "重度腹泻超过6次、";
+        }
+
+        if (!Strings.isNullOrEmpty(statusDesp)) {
+            bingqingDesc += statusDesp;
+            bingqingDesc += "、";
+        }
+        if (!Strings.isNullOrEmpty(others)) {
+            bingqingDesc += others;
+        }
+        return bingqingDesc;
+    }
 }

+ 29 - 2
whepi-web/src/main/java/com/bofeng/entity/ExcelRiBaoPrivate.java

@@ -14,6 +14,7 @@ public class ExcelRiBaoPrivate {
     private String ridgepole;
     private String unit;
     private String doorplate;
+    private BigDecimal temperature;
     private int grender;
     private int familyStatus;
     private int medical;
@@ -23,6 +24,7 @@ public class ExcelRiBaoPrivate {
     private int fatigue;
     private int diarrhea;
     private int singleRoom;
+    private int scoreRezult;
     private String statusDesp = "";
     private String others = "";
 
@@ -98,7 +100,11 @@ public class ExcelRiBaoPrivate {
     private String age;
 
     @ExcelProperty(value = "体温", index = 13)
-    private BigDecimal temperature;
+    private String temperatureStr;
+    public String getTemperatureStr() {
+        temperatureStr = temperature.floatValue()>10?temperature+"":"未填报";
+        return temperatureStr;
+    }
 
     @ExcelProperty(value = "确诊", index = 14)
     private String medicalStr;
@@ -159,7 +165,7 @@ public class ExcelRiBaoPrivate {
             bingqingDesc += "单间隔离、";
         }
 
-        bingqingDesc = bingqingDesc + "体温:" + temperature + "、";
+        bingqingDesc = bingqingDesc + "体温:" + temperatureStr + "、";
 
         if (cough == 1) {
             bingqingDesc += "偶尔短暂咳嗽、";
@@ -208,4 +214,25 @@ public class ExcelRiBaoPrivate {
         }
         return bingqingDesc;
     }
+
+
+    @ExcelProperty(value = "健康评估", index = 18)
+    private String scoreRezultStr;
+    public String getScoreRezultStr() {
+        if (scoreRezult == 0) {
+            scoreRezultStr = "未评估";
+        } else if (scoreRezult == 1) {
+            scoreRezultStr = "正常";
+        } else if (scoreRezult == 2) {
+            scoreRezultStr = "注意观察";
+        } else if (scoreRezult == 3) {
+            scoreRezultStr = "联系医生";
+        } else if (scoreRezult == 4) {
+            scoreRezultStr = "尽快就诊";
+        } else {
+            scoreRezultStr = "";
+        }
+        return scoreRezultStr;
+    }
+
 }

+ 1 - 1
whepi-web/src/main/java/com/bofeng/entity/JmTuangou.java

@@ -49,7 +49,7 @@ public class JmTuangou implements Serializable {
     private String tgPrice;
 
     /**
-     * 最小起订量
+     * 最低起送
      */
     private Integer tgMinNum;
 

+ 44 - 7
whepi-web/src/main/java/com/bofeng/entity/JmTuangouMember.java

@@ -7,32 +7,69 @@ import lombok.Data;
 public class JmTuangouMember {
 
     /**
+     * 团购标题
+     */
+    @ExcelProperty(value = "团购标题", index = 0)
+    private String tgTitle;
+
+    /**
+     * 团购供应商
+     */
+    @ExcelProperty(value = "团购供应商", index = 1)
+    private String tgSupplier;
+
+    /**
+     * 团购物资(套餐)
+     */
+    @ExcelProperty(value = "团购物资(套餐)", index = 2)
+    private String tgGoods;
+
+    /**
+     * 价格
+     */
+    @ExcelProperty(value = "价格", index = 3)
+    private String tgPrice;
+
+    /**
+     * 最低起送
+     */
+    @ExcelProperty(value = "最低起送", index = 4)
+    private Integer tgMinNum;
+    /**
+     * 小区名称
+     */
+    @ExcelProperty(value = "小区名称", index = 5)
+    private String uptownName;
+    /**
      * 栋
      */
-    @ExcelProperty(value = "楼栋", index = 0)
+    @ExcelProperty(value = "楼栋", index = 6)
     private String ridgepole;
     /**
      * 单元
      */
-    @ExcelProperty(value = "单元", index = 1)
+    @ExcelProperty(value = "单元", index = 7)
     private String unit;
     /**
      * 门牌号
      */
-    @ExcelProperty(value = "门牌号", index = 2)
+    @ExcelProperty(value = "门牌号", index = 8)
     private String houseNumber;
     /**
      * 参团数量
      */
-    @ExcelProperty(value = "参团数量", index = 3)
+    @ExcelProperty(value = "参团数量", index = 9)
     private Integer buyCount;
     /**
      * 联系方式
      */
-    @ExcelProperty(value = "联系方式", index = 4)
+    @ExcelProperty(value = "联系方式", index = 10)
     private String phone;
+    /**
+     * 备注
+     */
+    @ExcelProperty(value = "备注", index = 11)
+    private String myRemark;
 
     private Integer uptownId;
-
-    private String uptownName;
 }

+ 38 - 1
whepi-web/src/main/java/com/bofeng/entity/UptownUnit.java

@@ -3,10 +3,13 @@ package com.bofeng.entity;
 import com.baomidou.mybatisplus.annotations.TableField;
 import com.baomidou.mybatisplus.annotations.TableId;
 import com.baomidou.mybatisplus.annotations.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Getter;
 import lombok.Setter;
 import org.joda.time.DateTime;
 
+import java.util.Date;
+
 /**
  * 门牌信息表
  */
@@ -19,7 +22,7 @@ public class UptownUnit {
     private Long unitId;
 
     @TableField("uptown_id")
-    private Long uptown_id;
+    private Long uptownId;
 
     @TableField("ridgepole")
     private String ridgepole;
@@ -44,4 +47,38 @@ public class UptownUnit {
 
     @TableField(exist = false)
     private DateTime timeUpdate;
+
+    @TableField(exist = false)
+    private String uptownName;
+    @TableField(exist = false)
+    private Long houseId;
+    @TableField(exist = false)
+    private String doorplate;
+    @TableField(exist = false)
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date reportDate;
+    @TableField(exist = false)
+    private Integer doorplateNum;
+
+    @TableField(exist = false)
+    private Integer yiBaoNum;
+    @TableField(exist = false)
+    private Integer weiBaoNum;
+    @TableField(exist = false)
+    private Integer yiChangNum;
+    @TableField(exist = false)
+    private Integer yiChangAddNum;
+    @TableField(exist = false)
+    private Integer yiChangSubNum;
+
+
+    @TableField(exist = false)
+    private Long reportId;
+    @TableField(exist = false)
+    private Integer msStatus;
+    @TableField(exist = false)
+    private String msStatusStr = "";
+    @TableField(exist = false)
+    private Integer safetyNum;
+
 }

+ 51 - 4
whepi-web/src/main/java/com/bofeng/service/BuyService.java

@@ -2,6 +2,7 @@ package com.bofeng.service;
 
 import com.baomidou.mybatisplus.toolkit.IdWorker;
 import com.bofeng.dao.BuyMapper;
+import com.bofeng.dao.JmTuangouDao;
 import com.bofeng.entity.Buy;
 import com.bofeng.entity.JmTuangou;
 import org.joda.time.DateTime;
@@ -10,6 +11,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.ArrayList;
 import java.util.List;
 
 @Service
@@ -19,6 +21,9 @@ public class BuyService {
   @Autowired
   private BuyMapper buyMapper;
 
+  @Autowired
+  private JmTuangouDao jmTuangouDao;
+
   @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
   public int buyGroup(Buy buy) {
     Buy buy1 = buyMapper.selectBuyOne(buy.getUserId(), buy.getJmId());
@@ -33,16 +38,20 @@ public class BuyService {
     return buyMapper.insert(buy);
   }
 
+  @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
   public List<JmTuangou> group(Long userId) {
+    updateStatus();
     return buyMapper.group(userId);
   }
 
+  @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
   public List<Buy> MyGroup(Long userId) {
+    updateStatus();
     return buyMapper.MyGroup(userId);
   }
 
-  public Buy queryGroup(Long userId, Long jmId) {
-    return buyMapper.queryGroup(userId, jmId);
+  public Buy queryGroup(Long buyId) {
+    return buyMapper.selectById(buyId);
   }
 
 
@@ -54,7 +63,7 @@ public class BuyService {
   public int buyBack(Buy buy) {
     //在该套餐截止日期之前 并且是在团状态的才能撤单
     JmTuangou jmTuangou = buyMapper.selectGroup(buy.getUserId(), buy.getJmId());
-    if (jmTuangou.getTgEndTime().getTime() >= new DateTime().getMillis() && jmTuangou.getTgStatus() == 1) {
+    if (jmTuangou.getTgEndTime().getTime() > new DateTime().getMillis() && jmTuangou.getTgStatus() == 1) {
       Buy buy1 = buyMapper.selectBuyOne(buy.getUserId(), buy.getJmId());
       buy.setBuyId(buy1.getBuyId());
       buy.setBuyStatus(2);//撤单
@@ -65,6 +74,44 @@ public class BuyService {
   }
 
   public Buy status(Buy buy) {
-    return buyMapper.status(buy.getJmId());
+    return buyMapper.status(buy.getJmId(), buy.getUserId());
   }
+
+  //截止日期状态的更改
+  @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+  public int updateStatus() {
+    List<JmTuangou> jmTuangous = jmTuangouDao.selectAll();
+    if (jmTuangous != null && jmTuangous.size() > 0) {
+      //已经到截止时间
+      for (JmTuangou list : jmTuangous)
+        if (list.getTgEndTime().getTime() < new DateTime().getMillis()) {
+
+          // 团购数量  最小起订量
+          Buy buy = buyMapper.selectCountNum(list.getJmId());
+          if (buy != null) { //最小起订量
+            if (list.getTgMinNum().intValue() > buy.getCount().intValue()) {
+              jmTuangouDao.updateStatusByJmId(list.getJmId(), 4L);//取消
+            } else {
+              jmTuangouDao.updateStatusByJmId(list.getJmId(), 2L);//发货
+            }
+          } else {
+            jmTuangouDao.updateStatusByJmId(list.getJmId(), 4L);//取消
+          }
+      /*    if (buys != null && buys.size() > 0) {
+            for (Buy v : buys) {
+              if (v.getCount().intValue() < list.getTgMinNum().intValue()) {
+                jmTuangouDao.updateStatusByJmId(list.getJmId(), 4L);//取消
+              } else {
+                jmTuangouDao.updateStatusByJmId(list.getJmId(), 2L);//发货
+              }
+            }
+          } else {
+            jmTuangouDao.updateStatusByJmId(list.getJmId(), 4L);//取消
+          }*/
+
+        }
+    }
+    return 1;
+  }
+
 }

+ 13 - 0
whepi-web/src/main/java/com/bofeng/service/JmTuangouService.java

@@ -20,6 +20,9 @@ import java.util.List;
 public class JmTuangouService {
 
     @Autowired
+    private BuyService buyService;
+
+    @Autowired
     private JmTuangouDao jmTuangouDao;
 
     @Autowired
@@ -57,8 +60,11 @@ public class JmTuangouService {
         return jmTuangouDao.insert(jmTuangou);
     }
 
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     public List<JmTuangou> queryTuangouListByTitle(Long userId, String title) {
 
+        buyService.updateStatus();
+
         Long propertyId = yeweihuiUserRoleMapper.queryPropertyIdByUserId(userId);
         Long uptownId = yeweihuiSysOwnerMapper.queryUptownIdByUserId(propertyId);
 
@@ -68,15 +74,22 @@ public class JmTuangouService {
         return jmTuangouDao.queryTuangouListByUptownIdAndTitle(uptownId, title);
     }
 
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     public List<JmTuangou> queryTuangouMyListByTitle(Long userId, String title) {
 
+        buyService.updateStatus();
+
         if (title.equals("")) {
             return jmTuangouDao.queryTuangouListByUserId(userId);
         }
         return jmTuangouDao.queryTuangouListByUserIdAndTitle(userId, title);
     }
 
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     public JmTuangou queryByJmId(Long jmId) {
+
+        buyService.updateStatus();
+
         return jmTuangouDao.selectJmTuangouByJmId(jmId);
     }
 

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

@@ -32,6 +32,8 @@ public class MsReportService {
     private MsReportMapper msReportMapper;
     @Autowired
     private MsReportService msReportService;
+    @Autowired
+    private MsSuspectedService msSuspectedService;
 
     public List<MsSuspected> getByReportId(Long reportId) {
         return msSuspectedMapper.selectByReportId(reportId);

+ 24 - 5
whepi-web/src/main/java/com/bofeng/service/MsSuspectedService.java

@@ -83,7 +83,7 @@ public class MsSuspectedService {
         if (singleRoom == 1)
             suspectedStatus = 1;
         //体温
-        if (Conv.NFloat(temperature) < Conv.NFloat(36) || Conv.NFloat(temperature) > Conv.NFloat(37.3))
+        if (Conv.NFloat(temperature) < Conv.NFloat(35) || Conv.NFloat(temperature) > Conv.NFloat(37.3))
             suspectedStatus = 1;
         //咳嗽
         if (cough > 0)
@@ -102,9 +102,20 @@ public class MsSuspectedService {
             suspectedStatus = 1;
         if (suspectedId == 0L) {
             //判断家人是否同名
-            List<MsSuspected> list = msSuspectedMapper.selectUserNameNum(reportId, userName,reportDate);
+            List<MsSuspected> list = msSuspectedMapper.selectUserNameNum(reportId, userName, reportDate);
             if (list != null && list.size() > 0)
                 return 2L;
+            //判断是否评估
+            if (scoreRezult == 0) {
+                MsSuspected msSuspected1 = getScore(0L, userName, temperature, cough, muscle, dyspnea, fatigue, diarrhea, userCreate);
+                if (msSuspected1 != null) {
+                    scoreRezult = msSuspected1.getScoreRezult();
+                    score = msSuspected1.getScore();
+                    temperatureScore = msSuspected1.getTemperatureScore();
+                    scoreHistroy = msSuspected1.getScoreHistroy();
+                }
+            }
+
             MsSuspected msSuspected = new MsSuspected();
             msSuspected.setSuspectedId(IdWorker.getId());
             msSuspected.setReportId(reportId);
@@ -134,7 +145,7 @@ public class MsSuspectedService {
             msSuspectedMapper.insert(msSuspected);
         } else {
             //判断家人是否同名
-            List<MsSuspected> list = msSuspectedMapper.selectUserNameNum(reportId, userName,reportDate);
+            List<MsSuspected> list = msSuspectedMapper.selectUserNameNum(reportId, userName, reportDate);
             if (list != null && list.size() > 0) {
                 if (list.size() > 1)
                     return 2L;
@@ -143,6 +154,14 @@ public class MsSuspectedService {
                         return 2L;
                 }
             }
+            MsSuspected msSuspected2 = getScore(suspectedId, userName, temperature, cough, muscle, dyspnea, fatigue, diarrhea, userCreate);
+            if (msSuspected2 != null) {
+                scoreRezult = msSuspected2.getScoreRezult();
+                score = msSuspected2.getScore();
+                temperatureScore = msSuspected2.getTemperatureScore();
+                scoreHistroy = msSuspected2.getScoreHistroy();
+            }
+
             MsSuspected msSuspected1 = msSuspectedMapper.selectById(suspectedId);
             if (msSuspected1 != null) {
                 msSuspected1.setUserName(userName);
@@ -293,9 +312,9 @@ public class MsSuspectedService {
             if (score - scoreHistory >= 3)
                 return 4;
             else {
-                if (score <= 1)
+                if (score < 1)
                     scoreRezult = 1;
-                if (score >= 2 && score <= 3)
+                if (score >= 1 && score <= 3)
                     scoreRezult = 2;
                 if (score == 4)
                     scoreRezult = 3;

+ 133 - 16
whepi-web/src/main/java/com/bofeng/service/RiBaoService.java

@@ -2,14 +2,8 @@ package com.bofeng.service;
 
 
 import com.baomidou.mybatisplus.toolkit.IdWorker;
-import com.bofeng.dao.MsReportMapper;
-import com.bofeng.dao.MsSuspectedMapper;
-import com.bofeng.dao.UptownHouseMapper;
-import com.bofeng.dao.UptownUnitMapper;
-import com.bofeng.entity.MsReport;
-import com.bofeng.entity.MsSuspected;
-import com.bofeng.entity.UptownHouse;
-import com.bofeng.entity.UptownUnit;
+import com.bofeng.dao.*;
+import com.bofeng.entity.*;
 import org.apache.commons.collections.CollectionUtils;
 import org.joda.time.DateTime;
 import org.springframework.beans.BeanUtils;
@@ -44,6 +38,14 @@ public class RiBaoService {
     @Autowired
     private UptownUnitMapper uptownUnitMapper;
 
+
+    @Autowired
+    private UserRoleMapper userRoleMapper;
+    @Autowired
+    private OwnerMapper ownerMapper;
+    @Autowired
+    private UptownMapper uptownMapper;
+
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     public MsReport editRibao(Long reportId) {
         DateTime dateTime = new DateTime();
@@ -112,16 +114,13 @@ public class RiBaoService {
 
         //确诊
         trueNum = msReportMapper.selectSuspectedNum(reportId);
-
+        //疑似
+        isNoSuspected = msReportMapper.selectisNoSuspectedNum(reportId);
         //居家隔离
         singleNum = msReportMapper.selectSingleRoomNum(reportId);
-
         //正常
         isSuspected = msReportMapper.selectisSuspectedNum(reportId);
 
-        //疑似
-        isNoSuspected = msReportMapper.selectisNoSuspectedNum(reportId);
-
         //今日居家
         List<MsSuspected> list = msSuspectedMapper.selectByReportId(reportId);
         if (list != null && list.size() > 0)
@@ -129,14 +128,16 @@ public class RiBaoService {
         MsReport msReport = msReportMapper.selectById(reportId);
         if (msReport != null) {
             msReport.setSureNum(trueNum);
-            msReport.setSingleNum(singleNum);
             msReport.setSuspectedNum(isNoSuspected);
             msReport.setNormalNum(isSuspected);
+            msReport.setSingleNum(singleNum);
             msReport.setSafetyNum(isFamliy);
-            if (isNoSuspected > 0)
+            if (trueNum > 0 || isNoSuspected > 0 || singleNum > 0) {
                 msReport.setMsStatus(2);// 健康状态:1正常,2异常
-            else
+            } else {
                 msReport.setMsStatus(1);
+            }
+
             msReportMapper.updateById(msReport);
         }
     }
@@ -492,5 +493,121 @@ public class RiBaoService {
 
         return reportId;
     }
+//-----------------------------------------------------------------
+
 
+    public UptownUnit getRibaoYwh(Long userId) {
+        DateTime dateTime = new DateTime();
+        UptownUnit uptownUnitVo = new UptownUnit();
+        uptownUnitVo.setUptownId(0L);
+        uptownUnitVo.setUptownName("");
+        uptownUnitVo.setReportDate(dateTime.toDate());
+        uptownUnitVo.setDoorplateNum(0);
+        uptownUnitVo.setYiBaoNum(0);
+        uptownUnitVo.setWeiBaoNum(0);
+        uptownUnitVo.setYiChangNum(0);
+        uptownUnitVo.setYiChangAddNum(0);
+        uptownUnitVo.setYiChangSubNum(0);
+
+        List<UserRole> userRoles = userRoleMapper.getUserRoleYwhsByUserId(userId);
+        Long ownerId = userRoles.get(0).getPropertyId();
+        Owner owner = ownerMapper.selectById(ownerId);
+        Uptown uptown = uptownMapper.selectById(owner.getUptownId());
+        Long uptownId = uptown.getUptownId();
+
+        List<UptownUnit> dongList = uptownUnitMapper.queryDongList(uptownId);
+        if (CollectionUtils.isNotEmpty(dongList)) {
+
+            List<UptownUnit> xiaoQuList = uptownUnitMapper.queryXiaoQuList(uptownId);
+            if (null == xiaoQuList) {
+                xiaoQuList = new ArrayList<UptownUnit>();
+            }
+            int doorplateNum = xiaoQuList.size();
+
+            Date today = new Date();
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            String todayStr = sdf.format(today);
+            List<UptownUnit> yiBaoList = uptownUnitMapper.queryYiBaoList(uptownId, todayStr);
+            if (null == yiBaoList) {
+                yiBaoList = new ArrayList<UptownUnit>();
+            }
+            int yiBaoNum = yiBaoList.size();
+
+            List<UptownUnit> yiChangList = uptownUnitMapper.queryYiChangList(uptownId, todayStr);
+            if (null == yiChangList) {
+                yiChangList = new ArrayList<UptownUnit>();
+            }
+            int yiChangNum = yiChangList.size();
+//            System.out.println("yiChangNum================>>" + yiChangNum);
+
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTime(today);
+            calendar.add(Calendar.DATE, -1);
+            String yestodayStr = sdf.format(calendar.getTime());
+            List<UptownUnit> yiChangYestodayList = uptownUnitMapper.queryYiChangList(uptownId, yestodayStr);
+            if (null == yiChangList) {
+                yiChangYestodayList = new ArrayList<UptownUnit>();
+            }
+            int yiChangYestodayNum = yiChangYestodayList.size();
+//            System.out.println("yiChangYestodayNum================>>" + yiChangYestodayNum);
+
+            UptownUnit uptownUnitDb = dongList.get(0);
+            uptownUnitVo.setUptownId(uptownUnitDb.getUptownId());// 小区id
+            uptownUnitVo.setUptownName(uptownUnitDb.getUptownName());// 小区名称
+            uptownUnitVo.setReportDate(dateTime.toDate());// 日报日期
+            uptownUnitVo.setDoorplateNum(doorplateNum);// 户数
+
+            uptownUnitVo.setYiBaoNum(yiBaoNum);// 已报数
+            uptownUnitVo.setWeiBaoNum(doorplateNum - yiBaoNum);// 未报数
+            uptownUnitVo.setYiChangNum(yiChangNum);// 异常数
+            if (yiChangNum - yiChangYestodayNum > 0) {
+                uptownUnitVo.setYiChangAddNum(yiChangNum - yiChangYestodayNum);// 异常新增数
+            }
+            if (yiBaoNum > 0 && yiChangYestodayNum - yiChangNum > 0) {
+                uptownUnitVo.setYiChangSubNum(yiChangYestodayNum - yiChangNum);// 异常减少数
+            }
+        }
+
+        return uptownUnitVo;
+    }
+
+    public List<UptownUnit> queryRibaoYwhDongList(Long uptownId) {
+        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;
+    }
 }

+ 6 - 3
whepi-web/src/main/java/com/bofeng/wx/controller/BuyController.java

@@ -28,11 +28,14 @@ public class BuyController {
 
   @GetMapping("/home/buytc.html")
   public ModelAndView buytc(@Pd(name = "userId") Long userId, @Pd(name = "jmId") Long jmId,
-                            @Pd(name = "type") Integer type, @Pd(name = "tgStatus") Integer tgStatus, ModelMap model) {
+                            @Pd(name = "type") Integer type, @Pd(name = "tgStatus") Integer tgStatus,
+                            @Pd(name = "buyId") Long buyId, ModelMap model) {
     model.put("userId", userId);
     model.put("jmId", jmId);
     model.put("type", type);
     model.put("tgStatus", tgStatus);
+    model.put("buyId", buyId);
+    buyService.updateStatus();
     return new ModelAndView("/home/buytc.ftl", model);
   }
 
@@ -48,8 +51,8 @@ public class BuyController {
 
 
   @GetMapping("/home/queryGroup/buyGroup")
-  public Model<Buy> queryGroup(@Pd(name = "userId") Long userId, @Pd(name = "jmId") Long jmId) {
-    return Model.newSuccess(buyService.queryGroup(userId, jmId));
+  public Model<Buy> queryGroup(@Pd(name = "buyId") Long buyId) {
+    return Model.newSuccess(buyService.queryGroup(buyId));
   }
 
   @GetMapping("/home/querysj/buytj")

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

@@ -3,7 +3,6 @@ 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;
@@ -25,8 +24,6 @@ import java.util.List;
 public class RiBaoController {
 
     @Autowired
-    private MsSuspectedService msSuspectedService;
-    @Autowired
     private RiBaoService riBaoService;
 
 

+ 337 - 0
whepi-web/src/main/java/com/bofeng/wx/controller/RiBaoYwhController.java

@@ -0,0 +1,337 @@
+package com.bofeng.wx.controller;
+
+import com.bofeng.dao.RbMapper;
+import com.bofeng.dao.UptownMapper;
+import com.bofeng.entity.*;
+import com.bofeng.excel.ExcelUtils;
+import com.bofeng.service.*;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.yvan.Model;
+import com.yvan.ModelOps;
+import com.yvan.PageDb;
+import com.yvan.mvc.Pd;
+import com.yvan.platform.Conv;
+import com.yvan.platform.JsonWapper;
+import com.yvan.platform.YvanUtil;
+import com.yvan.springmvc.HttpParameterParser;
+import io.swagger.annotations.ApiOperation;
+import lombok.SneakyThrows;
+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;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.Map;
+
+@RestController
+public class RiBaoYwhController {
+
+    @Autowired
+    private QzTaskService qzTaskService;
+    @Autowired
+    private RbService rbService;
+
+    @Autowired
+    private QzTaskReplyService qzTaskReplyService;
+
+    @Autowired
+    private HomeService homeService;
+
+    @Autowired
+    private JmTuangouService jmTuangouService;
+
+    @Autowired
+    private UptownMapper uptownMapper;
+
+    @Autowired
+    private RbMapper rbMapper;
+
+
+    @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);
+        return Model.newSuccess(listSuspected);
+    }
+
+
+    // 查询业委会日报某一栋小区单元数据 根据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) {
+
+//        List<QzTask> taskList = qzTaskService.selectAll(1225321682867105793L);
+//        List<sysUptownUnit> rbList = rbService.selectAll(1225321682867105793L);
+        List<QzTask> taskList = qzTaskService.selectAll(userId);
+        List<sysUptownUnit> rbList = rbService.selectAll(userId);
+        model.put("taskList", YvanUtil.toJsonPretty(taskList));
+        model.put("rbList", YvanUtil.toJsonPretty(rbList));
+        model.put("user_id", "\"" + userId + "\"");
+        model.put("show", "\"" + show + "\"");
+
+        return new ModelAndView("/yeweihui/home.ftl", model);
+    }
+
+    @GetMapping("/ywh/qiuzhuDetail.html")
+    public ModelAndView qiuzhudetail(@Pd(name = "taskId") Long taskId, @Pd(name = "userId") Long userId, ModelMap model) throws JsonProcessingException {
+
+        QzTask task = qzTaskService.queryByTaskId(taskId);
+//        A业委会,B居委会,C物业,D志愿者
+        StringBuffer target = new StringBuffer();
+        if (task.getTaskTarget().equals("A")) {
+            target.append("业委会");
+        } else if (task.getTaskTarget().equals("B")) {
+            if (target.length() > 0) {
+                target.append("、居委会");
+            } else {
+                target.append("居委会");
+            }
+        } else if (task.getTaskTarget().equals("C")) {
+            if (target.length() > 0) {
+                target.append("、物业");
+            } else {
+                target.append("物业");
+            }
+        } else if (task.getTaskTarget().equals("D")) {
+            if (target.length() > 0) {
+                target.append("、志愿者");
+            } else {
+                target.append("志愿者");
+            }
+        }
+
+        task.setTaskTarget(target.toString());
+
+        model.put("taskJson", new JsonWapper(task));
+        model.put("task", task);
+        model.put("userId", "\"" + userId + "\"");
+
+        return new ModelAndView("/yeweihui/qiuzhuDetail.ftl", model);
+    }
+
+    @PostMapping("/ywh/qiuzhu/queryTasksByStatus.json")
+    public Model queryTasksByStatus(@Pd(name = "status") Integer status) {
+
+        List<QzTask> taskList = qzTaskService.queryQzTaskByStatus(status);
+
+        return Model.newSuccess(taskList);
+    }
+
+    @PostMapping("/ywh/qiuzhu/reply/add.json")
+    public ModelOps replyQiuzhuInsert(QzTaskReply qzTaskReply) {
+
+        Integer success = qzTaskReplyService.insertQzTaskReply(qzTaskReply);
+
+        if (success > 0) {
+            return ModelOps.newSuccess();
+        } else {
+            return ModelOps.newFail("操作失败");
+        }
+    }
+
+    @PostMapping("/ywh/qiuzhu/reply/querybytaskid.json")
+    public Model replyQiuzhuQueryByTaskId(@Pd(name = "taskId") Long taskId) {
+
+        List<QzTaskReply> reply = qzTaskReplyService.queryQzTaskReplyByTaskId(taskId);
+
+        return Model.newSuccess(reply);
+    }
+
+    @PostMapping("/ywh/qiuzhu/list.json")
+    public Model queryByHouseNumber(String houseNumber, @Pd(name = "status") Integer status) {
+
+        if (houseNumber.length() <= 0) {
+            return Model.newSuccess(qzTaskService.queryQzTaskByStatus(status));
+        }
+
+        List<QzTask> list = qzTaskService.queryByHouseNumber(houseNumber, status);
+
+        return Model.newSuccess(list);
+    }
+
+    @GetMapping("/ywh/ribao.html")
+    public ModelAndView yeweihuiRibao(ModelMap model) {
+
+//        List<QzTask> taskList = qzTaskService.selectAll();
+//
+//        model.put("taskList", YvanUtil.toJsonPretty(taskList));
+
+        return new ModelAndView("/yeweihui/ribao.ftl", model);
+    }
+
+    @GetMapping("/ywh/ribaoDy")
+    public Model<List<SysUptownHouse>> yeweihuiRibaoDy(Long str) {
+//        String[] split = str.split("&");
+        List<SysUptownHouse> rbList = rbService.selectXq(str);
+
+        return Model.newSuccess(rbList);
+    }
+
+    @GetMapping("/ywh/ribaoXq.html")
+    public ModelAndView yeweihuiRibaoYcXq(ModelMap model) {
+        Map<String, Object> queryParam = Maps.newLinkedHashMap();
+        queryParam.put("userId", "12345677");
+        queryParam.put("statistics", "M");
+        return new ModelAndView("/yeweihui/ribaoXq.ftl", model);
+    }
+
+    @GetMapping("/ywh/ribaoDyYcXq")
+    public Model<List<MsSuspected>> yeweihuiRibaoYcXq(Long houseId) {
+        List<MsSuspected> rbList = rbService.selectYcXq(houseId);
+        return Model.newSuccess(rbList);
+    }
+
+    @GetMapping("/ywh/ribaohuiz.html")
+    public ModelAndView yeweihuiRibaohuiz(ModelMap model) {
+        return new ModelAndView("/yeweihui/ribaohuiz.ftl", model);
+    }
+
+    @GetMapping("/ywh/yeweihui/ribaohuiz")
+    public Model<Map<String, Object>> yeweihuiRibaohuiz(Long userCreate, String reportDate) {
+//        Long userCreate = 1225321682867105793L;
+
+        List<Uptown> uptowns = rbMapper.selectUptown(userCreate);
+
+        if (uptowns != null && uptowns.size() > 0) {
+            Long upId = uptowns.get(0).getUptownId();
+            Map<String, Integer> map1 = rbMapper.selecthuiz(upId, reportDate);
+            Map<String, Integer> map2 = rbMapper.selectyicahng(upId, reportDate);
+            Map<String, Integer> map3 = rbMapper.selecthuiz1(upId);
+
+            Map<String, Object> reMap = Maps.newHashMap();
+            reMap.put("uptownName", uptowns.get(0).getUptownName());
+            List<Integer> nums = Lists.newArrayList();
+            nums.add(Conv.NI(map3.get("houseCount")));
+            nums.add(Conv.NI(map1.get("reportCount")));
+            nums.add(Conv.NI(map2.get("yichangCount")));
+            nums.add(Conv.NI(map1.get("safetyNum")));
+            nums.add(Conv.NI(map1.get("suspectedNum")));
+            reMap.put("nums", nums);
+            return Model.newSuccess(reMap);
+        }
+        return Model.newFail("没有数据");
+
+    }
+
+    @ApiOperation("导出正常家庭上报明细")
+    @GetMapping("/ywh/yeweihui/exportRiBao")
+    @SneakyThrows
+    public void exportRiBao(@Pd(name = "uptownId") Long uptownId,
+                            @Pd(name = "date") String date,
+                            HttpServletResponse resp) {
+
+        Uptown uptown = uptownMapper.selectById(uptownId);
+        if (uptown != null && uptown.getUptownId() > 0) {
+            Long upId = uptown.getUptownId();
+            String fileName = uptown.getUptownName();
+            fileName += "上报信息-";
+            fileName += date;
+            List<ExcelRiBao> list = rbMapper.selectExcelRiBao(upId, date);
+            ExcelUtils.writeSheet(ExcelRiBao.class, list).export(resp, fileName);
+        }
+    }
+
+    @ApiOperation("导出凌云家庭上报明细")
+    @GetMapping("/ywh/lun/exportRiBao")
+    @SneakyThrows
+    public void lunExportRiBao(@Pd(name = "date") String date,
+                               HttpServletResponse resp) {
+
+        Uptown uptown = uptownMapper.selectById("1238790987234");
+        Long upId = uptown.getUptownId();
+        String fileName = uptown.getUptownName();
+        fileName += "上报信息-";
+        fileName += date;
+        List<ExcelRiBaoLY> list = rbMapper.selectExcelRiBaoLY(upId, date);
+        ExcelUtils.writeSheet(ExcelRiBaoLY.class, list).export(resp, fileName);
+
+    }
+
+    @ApiOperation("导出小区家庭上报明细")
+    @GetMapping("/ywh/yeweihui/EXR")
+    @SneakyThrows
+    public void exportRiBaoByXiaoQu(@Pd(name = "uptownId") Long uptownId,
+                                    @Pd(name = "date") String date,
+                                    HttpServletResponse resp) {
+        Uptown uptown = uptownMapper.selectById(uptownId);
+        if (uptown != null && uptown.getUptownId() > 0) {
+            Long upId = uptown.getUptownId();
+            String fileName = uptown.getUptownName();
+            fileName += "上报信息-";
+            fileName += date;
+            List<ExcelRiBaoPrivate> list = rbMapper.selectExcelRiBaoPrivate(upId, date);
+            ExcelUtils.writeSheet(ExcelRiBaoPrivate.class, list).export(resp, fileName);
+        }
+    }
+
+    @GetMapping("/ywh/tgPublish.html")
+    public ModelAndView tgPublish(@Pd(name = "userId") Long userId, ModelMap model) throws JsonProcessingException {
+        model.put("userId", "\"" + userId + "\"");
+
+        return new ModelAndView("/yeweihui/tgPublish.ftl", model);
+    }
+
+    @PostMapping("/ywh/tgPublish.json")
+    public Model tuangouPublish(JmTuangou jmTuangou) {
+
+        Integer success = jmTuangouService.tuangouPublish(jmTuangou);
+        if (success == 1) {
+            return Model.newSuccess("操作成功");
+        } else {
+            return Model.newFail("操作失败");
+        }
+    }
+
+    @PostMapping("/ywh/tuangou/list/query.json")
+    public Model queryTuangouListByTitle(@Pd(name = "userId") Long userId, @Pd(name = "title", required = false) String title) {
+
+        List<JmTuangou> list = jmTuangouService.queryTuangouListByTitle(userId, title);
+
+        return Model.newSuccess(list);
+    }
+
+    @PostMapping("/ywh/tuangou/mylist/query.json")
+    public Model queryTuangouMyListByTitle(@Pd(name = "userId") Long userId, @Pd(name = "title", required = false) String title) {
+
+        List<JmTuangou> myList = jmTuangouService.queryTuangouMyListByTitle(userId, title);
+
+        return Model.newSuccess(myList);
+    }
+
+    @PostMapping("/ywh/getAllUptown")
+    public Model<List<Uptown>> getAllUptown(HttpParameterParser parser, PageDb pageDb) {
+        return Model.newSuccess(pageDb, uptownMapper.getUptowns(pageDb, parser.getMap()));
+    }
+}

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

@@ -108,7 +108,7 @@ public class UserOpenController {
 
     @GetMapping("/user/homeIndex.html")
     public ModelAndView homeIndex(ModelMap model, @RequestParam(value = "userId", required = false, defaultValue = "0") Long userId,
-                                  @RequestParam(value = "userType", required = false, defaultValue = "0") Integer userType) throws JsonProcessingException {
+                                  @RequestParam(value = "userType", required = false, defaultValue = "0") Integer userType, @RequestParam(value = "show", required = false, defaultValue = "-") String show) throws JsonProcessingException {
         if (userId != 0 && userType != 0) {
             model.put("user_id", "\"" + userId + "\"");
             List<Uptown> uptowns = rbMapper.selectUptown(userId);
@@ -121,6 +121,7 @@ public class UserOpenController {
             if (userType == 1) {
                 MsReport msReport = msReportService.getReportByDateNow(userId);
                 model.put("msReport", new JsonWapper(msReport));
+                model.put("show", "\"" + show + "\"");
                 return new ModelAndView("/home/home.ftl", model);
             } else if (userType == 2) {
                 List<QzTask> taskList = qzTaskService.selectAll(userId);

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

@@ -18,7 +18,6 @@ import com.yvan.platform.YvanUtil;
 import com.yvan.springmvc.HttpParameterParser;
 import io.swagger.annotations.ApiOperation;
 import lombok.SneakyThrows;
-import org.joda.time.DateTime;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -226,7 +225,9 @@ public class YeWeiHuiController {
     public void exportRiBao(@Pd(name = "uptownId") Long uptownId,
                             @Pd(name = "date") String date,
                             HttpServletResponse resp) {
-
+        if (uptownId == 1238790987234L) {
+            return;
+        }
         Uptown uptown = uptownMapper.selectById(uptownId);
         if (uptown!=null && uptown.getUptownId()>0) {
             Long upId = uptown.getUptownId();
@@ -282,9 +283,6 @@ public class YeWeiHuiController {
     public ModelAndView groupBuyingCx(@Pd(name = "jmId") Long jmId, @Pd(name = "userId") Long userId, @Pd(name = "operation") String operation, ModelMap model) throws JsonProcessingException {
 
         JmTuangou item = jmTuangouService.queryByJmId(jmId);
-        if (item.getTgEndTime().getTime() < new DateTime().getMillis() && item.getTgStatus() == 1) {
-            item.setTgStatus(4);
-        }
 
         model.put("tgItemJson", new JsonWapper(item));
         model.put("tgItem", item);
@@ -301,10 +299,6 @@ public class YeWeiHuiController {
 
         JmTuangou item = jmTuangouService.queryByJmId(jmId);
 
-        if (item.getTgEndTime().getTime() < new DateTime().getMillis() && item.getTgStatus() == 1) {
-            item.setTgStatus(4);
-        }
-
         if (item.getUserId().equals(userId)) {
             model.put("isMine", "mine");
         }
@@ -324,10 +318,6 @@ public class YeWeiHuiController {
 
         JmTuangou item = jmTuangouService.queryByJmId(jmId);
 
-        if (item.getTgEndTime().getTime() < new DateTime().getMillis() && item.getTgStatus() == 1) {
-            item.setTgStatus(4);
-        }
-
         List<JmTuangouMember> members = jmTuangouMemberService.querMemberListByJmId(jmId);
 
         model.put("tgItemJson", new JsonWapper(item));
@@ -383,13 +373,6 @@ public class YeWeiHuiController {
 
         List<JmTuangou> list = jmTuangouService.queryTuangouListByTitle(userId, title);
 
-        for (int i = 0; i < list.size(); i++) {
-            JmTuangou item = list.get(i);
-            if (item.getTgEndTime().getTime() < new DateTime().getMillis() && item.getTgStatus() == 1) {
-                item.setTgStatus(4);
-            }
-        }
-
         return Model.newSuccess(list);
     }
 
@@ -398,13 +381,6 @@ public class YeWeiHuiController {
 
         List<JmTuangou> myList = jmTuangouService.queryTuangouMyListByTitle(userId, title);
 
-        for (int i = 0; i < myList.size(); i++) {
-            JmTuangou item = myList.get(i);
-            if (item.getTgEndTime().getTime() < new DateTime().getMillis() && item.getTgStatus() == 1) {
-                item.setTgStatus(4);
-            }
-        }
-
         return Model.newSuccess(myList);
     }
 

+ 11 - 10
whepi-web/src/main/resources/mapper/BuyMapper.xml

@@ -19,27 +19,28 @@
     </select>
 
     <select id="MyGroup" resultType="com.bofeng.entity.Buy">
-        select DISTINCT a.tg_title,b.time_create,a.tg_status,a.jm_id,b.buy_status
+        select DISTINCT a.tg_title,b.time_create,a.tg_status,a.jm_id,b.buy_status,b.buy_id
         from  jm_tuangou a
         INNER JOIN jm_buy b on a.jm_id=b.jm_id
         where b.user_id=#{userId} and buy_status=1
+        order by b.time_create desc
     </select>
 
 
-    <select id="queryGroup" resultType="com.bofeng.entity.Buy">
-        select * from jm_buy where user_id=#{userId} and jm_id=#{jmId} limit 1
-    </select>
-
     <select id="selectGroup" resultType="com.bofeng.entity.JmTuangou">
         select * from jm_tuangou where jm_id=#{jmId} limit 1
     </select>
 
     <select id="status" resultType="com.bofeng.entity.Buy">
-       SELECT a.tg_status,a.tg_price,
-       IFNULL(( SELECT SUM(b.buy_count)
-      FROM jm_buy b WHERE a.jm_id = b.jm_id and buy_status=1), 0 ) AS count
-      FROM jm_tuangou a
-      WHERE a.jm_id = #{jmId} limit 1
+       SELECT a.tg_status, a.tg_price, IFNULL(( SELECT SUM(b.buy_count) FROM jm_buy b WHERE a.jm_id = b.jm_id AND buy_status = 1 ), 0 ) AS count,
+       ( SELECT phone FROM sys_user_role aa INNER JOIN sys_uptown_home bb ON aa.property_id = bb.house_id WHERE aa.role_id = 1 AND aa.user_id = #{userId}
+       LIMIT 1 ) AS phone FROM jm_tuangou a WHERE a.jm_id = #{jmId}
+       AND a.user_id = #{userId}
+       LIMIT 1
+    </select>
+
+    <select id="selectCountNum" resultType="com.bofeng.entity.Buy">
+        select sum(buy_count) as count,jm_id from jm_buy where jm_id=#{jmId} and buy_status=1 GROUP BY jm_id
     </select>
 
 </mapper>

+ 10 - 0
whepi-web/src/main/resources/mapper/JmTuangouMapper.xml

@@ -43,4 +43,14 @@
     <update id="updateStatusRemarkByJmId">
         update jm_tuangou set tg_status=#{status},remark=#{remark} where jm_id=#{JmId}
     </update>
+
+    <select id="selectAll" resultType="com.bofeng.entity.JmTuangou">
+        select * from jm_tuangou where tg_status=1
+    </select>
+
+    <update id="updateAll">
+        <foreach collection="tg" item="item" index="index" separator=";">
+            update jm_tuangou set tg_status=#{item.tgStatus} where jm_id=#{item.jmId}
+        </foreach>
+    </update>
 </mapper>

+ 17 - 12
whepi-web/src/main/resources/mapper/JmTuangouMemberMapper.xml

@@ -3,18 +3,23 @@
 <mapper namespace="com.bofeng.dao.JmTuangouMemberDao">
 
     <select id="querMemberListByJmId" resultType="com.bofeng.entity.JmTuangouMember">
-        select a.user_id,a.buy_count,a.phone, y.houseNumber, y.ridgepole, y.unit, y.uptown_id, y.uptown_name from jm_buy a
-        LEFT JOIN
-          (
-              select a.user_id, b.house_id, b.doorplate as houseNumber, c.uptown_id, c.ridgepole, c.unit, u.uptown_name
-              FROM sys_user_role a
-                       INNER JOIN sys_uptown_house b on a.property_id=b.house_id
-                       INNER JOIN sys_uptown_unit c on c.unit_id=b.unit_id
-                       INNER JOIN sys_uptown u on u.uptown_id = c.uptown_id
-              where a.user_id in (select user_id from jm_buy where jm_id=#{JmId})
-          ) y
-          on a.user_id=y.user_id
-        where a.jm_id=#{JmId}
+        select a.user_id,a.buy_count,a.phone, a.my_remark, y.houseNumber, y.ridgepole, y.unit, y.uptown_id, y.uptown_name, z.tg_title, z.tg_supplier, z.tg_goods, z.tg_price, z.tg_min_num from jm_buy a
+           LEFT JOIN
+       (
+           select a.user_id, b.house_id, b.doorplate as houseNumber, c.uptown_id, c.ridgepole, c.unit, u.uptown_name
+           FROM sys_user_role a
+                    INNER JOIN sys_uptown_house b on a.property_id=b.house_id
+                    INNER JOIN sys_uptown_unit c on c.unit_id=b.unit_id
+                    INNER JOIN sys_uptown u on u.uptown_id = c.uptown_id
+           where a.user_id in (select user_id from jm_buy where jm_id=#{JmId})
+       ) y
+       on a.user_id=y.user_id
+           LEFT JOIN
+       (
+           SELECT * FROM jm_tuangou
+       ) z
+       on a.jm_id=z.jm_id
+        where a.jm_id=#{JmId} and a.buy_status=1
     </select>
 
 </mapper>

+ 58 - 0
whepi-web/src/main/resources/mapper/UptownUnitMapper.xml

@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.bofeng.dao.UptownUnitMapper">
+    <select id="queryDongList" resultType="com.bofeng.entity.UptownUnit">
+        SELECT DISTINCT a.ridgepole, a.uptown_id, b.uptown_name FROM `sys_uptown_unit` a
+        LEFT JOIN sys_uptown b on a.uptown_id=b.uptown_id
+        <where>
+            <if test="uptownId!=null and uptownId!=''">
+                and a.uptown_id=#{uptownId}
+            </if>
+        </where>
+        order by ridgepole
+    </select>
+
+    <select id="queryDanYuanList" resultType="com.bofeng.entity.UptownUnit">
+        SELECT unit_id, uptown_id, ridgepole, unit FROM `sys_uptown_unit`
+        <where>
+            <if test="uptownId!=null and uptownId!=''">
+                and uptown_id=#{uptownId}
+            </if>
+            <if test="ridgepole!=null and ridgepole!=''">
+                and ridgepole=#{ridgepole}
+            </if>
+        </where>
+        order by unit_id
+    </select>
+
+    <select id="queryMenPaiList" resultType="com.bofeng.entity.UptownUnit">
+        SELECT a.*,c.report_date, c.ms_status,c.safety_num,c.report_id 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">
+        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
+        where b.uptown_id=#{uptownId}
+    </select>
+
+    <select id="queryYiBaoList" resultType="com.bofeng.entity.UptownUnit">
+        SELECT a.house_id, a.doorplate, a.unit_id,b.unit, b.ridgepole,b.uptown_id,c.report_date, c.ms_status FROM `sys_uptown_house` a
+        inner JOIN `sys_uptown_unit` b  on a.unit_id=b.unit_id
+        inner JOIN `ms_report` c  on a.house_id=c.house_id  and c.report_date = #{reportDate}
+        where b.uptown_id=#{uptownId}
+    </select>
+
+    <select id="queryYiChangList" resultType="com.bofeng.entity.UptownUnit">
+        SELECT a.house_id, a.doorplate, a.unit_id,b.unit, b.ridgepole,b.uptown_id,c.report_date, c.ms_status FROM `sys_uptown_house` a
+        inner JOIN `sys_uptown_unit` b  on a.unit_id=b.unit_id
+        inner JOIN `ms_report` c  on a.house_id=c.house_id  and c.report_date = #{reportDate} and c.ms_status=2
+        where b.uptown_id=#{uptownId}
+    </select>
+
+</mapper>