Explorar o código

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

# Conflicts:
#	admin-ui/app/whepi/mock/menu.json
yuliang %!s(int64=5) %!d(string=hai) anos
pai
achega
de2205f681

+ 17 - 0
admin-ui/app/whepi/mock/menu.json

@@ -19,6 +19,23 @@
       "children": []
     },
     {
+      "id": "ENT10002",
+      "text": "小区进出信息",
+      "href": "",
+      "iconCls": "icon-blank fa fa-bars",
+      "state": "closed",
+      "children": [
+        {
+          "id": "ENT100021",
+          "text": "进出二维码",
+          "href": "/app/whepi/scan/qrImg.js",
+          "iconCls": "icon-blank fa fa-align-justify",
+          "state": "close",
+          "children": []
+        }
+      ]
+    },
+    {
       "id": "ENT10011",
       "text": "授权测试",
       "href": "/app/whepi/ceshi.js",

+ 132 - 0
admin-ui/app/whepi/scan/qrImg.js

@@ -0,0 +1,132 @@
+define(function (require) {
+        return function (context) {
+
+            var $grid1, $form;
+
+
+            //查询小区
+            function queryGrid2() {
+                var _datas = [];
+                $.yvan.ajax({
+                    async: false,
+                    method: 'post',
+                    url: api('/getAllUptown'),
+                    data: {userId: 0},
+                    success: function (data) {
+                        if (data.data != null && data.data != undefined) {
+                            for (var i = 0; i < data.data.length; i++) {
+                                _datas.push({
+                                    "id": data.data[i].uptownId,
+                                    "text": data.data[i].uptownName
+                                })
+                            }
+                        }
+                    }
+                });
+                return _datas;
+            }
+
+            // 输入搜索文本后点击回车按钮查询列表
+            function enterQueryGrid1(e) {
+                if (e.keyCode === 13) {
+                    var tmp = $(this).val();
+                    $form.formSet({queryProperties: tmp});
+                    queryGrid1();
+                }
+            }
+
+            // 检索条件查询
+            function queryGrid1() {
+                var queryForm = $form.formGet();
+                $grid1.reload({
+                    mtype: 'POST',
+                    url: api('/qrImg/scanQrImg'),
+                    queryParams: queryForm
+                }, true);
+            }
+
+            // 搜索按钮
+            var queryToolbarTitle = '团购信息管理';// 自行替换此参数
+            var queryToolbar = {
+                xtype: 'toolbar', title: queryToolbarTitle, items: [
+                    {
+                        text: '查询', iconCls: 'fa fa-search', onClick: function () {
+                            queryGrid1();
+                        }
+                    }, {
+                        text: '重置', iconCls: 'fa fa-refresh', onClick: function () {
+                            $form.formClear();
+                            queryGrid1();
+                        }
+                    }, {
+                        text: '关闭', iconCls: 'fa fa-times-circle', onClick: function () {
+                            App.closeMe(this);
+                        }
+                    }
+                ]
+            };
+
+            var queryForm = {
+                onRender: function () {
+                    $form = $(this);
+                },
+                xtype: 'form',
+                items: [[
+                    {
+                        xtype: 'textbox',
+                        label: '检索条件',
+                        name: 'queryProperties',
+                        prompt: "小区名称",
+                        labelWidth: 'auto',
+                        events: {keydown: enterQueryGrid1}, width: 350
+                    },
+                ]]
+            };
+
+            return {
+                north: {
+                    height: 88,
+                    /* split: true,
+                     border: false,*///底框是否可变动
+                    items: [
+                        queryToolbar,
+                        queryForm
+                    ]
+                },
+                center: {
+                    height: '60%',
+                    split: true,
+                    items:
+                        {
+                            onRender: function () {
+                                $grid1 = $(this);
+                                queryGrid1()
+                            },
+                            xtype: 'grid',
+                            idField: 'doorId',
+                            autoSizeColumns: true,
+                            columns:
+                                [
+                                    [
+                                        {field: 'doorId', title: '大门ID', hidden: true},
+                                        {field: 'uptownName', title: '小区', maxWidth: 200, align: 'left',},
+                                        {field: 'doorName', title: '小区大门', maxWidth: 200, align: 'left',},
+                                        {
+                                            field: 'outImg', title: '外出二维码', minWidth: 300, maxWidth: 400,
+                                            formatter: function (value) {
+                                                return "<img  src='" + value + "'/>";
+                                            },
+                                        },
+                                        {field: 'inImg', title: '进入二维码', minWidth: 300, maxWidth: 400,
+                                            formatter: function (value) {
+                                                return "<img  src='" + value + "'/>";
+                                            },},
+                                        {field: 'timeUpdate', title: '修改时间', maxWidth: 200, formatter: $.fn.fmatter.ts},
+                                    ]
+                                ]
+                        }
+                }
+            };
+        };
+    }
+);

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

@@ -154,7 +154,7 @@
     });
 
     function goback() {
-        window.location.href = "/yeweihui/home.html?show=tuangou&userId=" + userId;
+        window.location.href = "/yeweihui/tuangouHome.html?show=tuangou&userId=" + userId;
     }
 
     function finish() {

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

@@ -98,7 +98,7 @@
     <#--返回-->
     function buyBack() {
         // window.history.back();
-        window.location.href = "/user/homeIndex.html?userId=" + $('#buyuserId').val() + "&userType=" + 1 + "&show=tuangou";
+        window.location.href = "/user/homeIndex.html?userId=" + $('#buyuserId').val() + "&userType=" + 1 + "&show=tuangou"+"&type="+2;
     }
 
     /*撤销*/

+ 15 - 15
whepi-ui/templates/home/home.ftl

@@ -8,8 +8,8 @@
             <#include "/home/ribao.ftl" /></div>
         <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>
+       <#-- <div id="tab3" class="weui-tab__bd-item">
+    <#include "/home/buy.ftl" /></div>-->
     <#--<div id="tab4" class="weui-tab__bd-item">-->
     <#--<h1>页面四</h1> </div>-->
     </div>
@@ -22,10 +22,10 @@
             <div class="weui-tabbar__icon"><img src="/static/images/wx/customer_service.png" alt=""></div>
             <p class="weui-tabbar__label">家庭求助</p>
         </a>
-        <a id="jt3" href="#tab3" class="weui-tabbar__item" onclick="buyGroup()">
+      <#--  <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>-->
     <#--<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>-->
@@ -84,20 +84,20 @@
         });
 
 
-        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();
-        }
+        <#--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!'"-"'};
+        <#--var show = ${show!'"-"'};-->
 
-        if (show == 'tuangou') {
-            selectTab();
+        <#--if (show == 'tuangou') {-->
+            <#--selectTab();-->
 
-        }
+        <#--}-->
     })(jQuery);
 
 

+ 14 - 9
whepi-ui/templates/home/ribao.js

@@ -308,7 +308,7 @@ function ribao_cell(v) {
   $('#rb_family').append($('<div class="weui-media-box weui-media-box_text" style="height: 12vh">\n' +
     '                                      <h4 class="weui-media-box__title">' + userName + '&nbsp;&nbsp;&nbsp;' + grender + '&nbsp;&nbsp;&nbsp;' + age + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a style="color: #bc4246" onclick=\'deleteSuspected(' + JSON.stringify(v.suspectedId) + ')\'>删除</a>\n' +
     '                                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a style="color: #2a62bc" onclick=\'updateSuspected(' + JSON.stringify(v.suspectedId) + ')\'>修改</a></h4>\n' +
-    '                                      <p class="weui-media-box__desc" style="height: 80%">'  + medical + singleRoom + temperature + cough + muscle + dyspnea + fatigue + diarrhea + others + scoreRezult + '</p>\n' +
+    '                                      <p class="weui-media-box__desc" style="height: 80%">' + medical + singleRoom + temperature + cough + muscle + dyspnea + fatigue + diarrhea + others + scoreRezult + '</p>\n' +
     '                                    </div>\n' +
     '                              '));
 }
@@ -374,6 +374,11 @@ function ribaoCommit() {
   var userName = $("#js_input_user_name").val();
   var grender = $("#js_input_user_sex").attr("data-values") == undefined ? 0 : $("#js_input_user_sex").attr("data-values");
   var age = $("#js_input_user_age").val();
+  //不能同时选择服用和未服用
+  if ($("input[name='checkbox1']:checked").val() == "on" && $("input[name='checkbox2']:checked").val() == "on") {
+    $.alert("心脑血管不能同时选择服用和未服用");
+    return;
+  }
   //家庭状态
   var familyStatus = "";
   if ($("input[name='checkbox1']:checked").val() == "on")
@@ -537,31 +542,31 @@ function updateSuspected(suspectedId) {
         if (suspected.familyStatus != "") {
           var familyStatusList = suspected.familyStatus.split(",");
           if (familyStatusList[0] == 1)
-            $("input[name='checkbox1']").prop("checked","checked");
+            $("input[name='checkbox1']").prop("checked", "checked");
           else
             $("input[name='checkbox1']").removeAttr("checked");
           if (familyStatusList[1] == 1)
-            $("input[name='checkbox2']").prop("checked","checked");
+            $("input[name='checkbox2']").prop("checked", "checked");
           else
             $("input[name='checkbox2']").removeAttr("checked");
           if (familyStatusList[2] == 1)
-            $("input[name='checkbox3']").prop("checked","checked");
+            $("input[name='checkbox3']").prop("checked", "checked");
           else
             $("input[name='checkbox3']").removeAttr("checked");
           if (familyStatusList[3] == 1)
-            $("input[name='checkbox4']").prop("checked","checked");
+            $("input[name='checkbox4']").prop("checked", "checked");
           else
             $("input[name='checkbox4']").removeAttr("checked");
           if (familyStatusList[4] == 1)
-            $("input[name='checkbox5']").prop("checked","checked");
+            $("input[name='checkbox5']").prop("checked", "checked");
           else
             $("input[name='checkbox5']").removeAttr("checked");
           if (familyStatusList[5] == 1)
-            $("input[name='checkbox6']").prop("checked","checked");
+            $("input[name='checkbox6']").prop("checked", "checked");
           else
             $("input[name='checkbox6']").removeAttr("checked");
           if (familyStatusList[6] == 1)
-            $("input[name='checkbox7']").prop("checked","checked");
+            $("input[name='checkbox7']").prop("checked", "checked");
           else
             $("input[name='checkbox7']").removeAttr("checked");
 
@@ -695,7 +700,7 @@ function helpValue1(v) {
     scoreRezult = "评估结果:" + getScoreRezult(v.scoreRezult, v.temperatureScore) + ";";
   $('#ribao_famliy').append($('<div class="weui-media-box weui-media-box_text" style="height: 12vh">\n' +
     '                                      <h4 class="weui-media-box__title">' + userName + '&nbsp;&nbsp;&nbsp;' + grender + '&nbsp;&nbsp;&nbsp;' + age + '</h4>\n' +
-    '                                      <p class="weui-media-box__desc" style="height: 80%">'  + medical + singleRoom + temperature + cough + muscle + dyspnea + fatigue + diarrhea + others + scoreRezult + '</p>\n' +
+    '                                      <p class="weui-media-box__desc" style="height: 80%">' + medical + singleRoom + temperature + cough + muscle + dyspnea + fatigue + diarrhea + others + scoreRezult + '</p>\n' +
     '                                    </div>\n' +
     '                              '));
 }

+ 34 - 2
whepi-ui/templates/home/tuangouHome.ftl

@@ -1,8 +1,24 @@
 <#assign title="我的团购"/>
 <#include "/home/frag.head.ftl" />
 
-<#include "/home/buy.ftl" />
-
+<#--<#include "/home/buy.ftl" />-->
+<div class="weui-tab">
+    <input id="userId" type="text" hidden="hidden" value=${user_id!}/>
+    <div class="weui-tab__bd">
+        <div id="tab3" class="weui-tab__bd-item weui-tab__bd-item--active">
+    <#include "/home/buy.ftl" /></div>
+    </div>
+    <div class="weui-tabbar">
+        <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>-->
+    <#--</a>-->
+    </div>
+</div>
 </body>
 
 <#include "/home/frag.foot.ftl" />
@@ -20,6 +36,22 @@
                 $(data_toggle).addClass(moduleClass + "_weui_tab_bd_item_active");
             });
         });
+
+      /*  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();
+        }*/
+        buyGroup();
+
     })(jQuery);
 
 </script>

+ 10 - 9
whepi-ui/templates/yeweihui/home.ftl

@@ -12,10 +12,11 @@
             <#include "/yeweihui/ribaohuiz.ftl" />
         </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" />
+            <#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">-->
     <#--<h1>页面三</h1> </div>-->
     <#--<div id="tab4" class="weui-tab__bd-item">-->
@@ -30,10 +31,10 @@
             <div class="weui-tabbar__icon"><img src="/static/images/wx/customer_service.png" alt=""></div>
             <p class="weui-tabbar__label">求助</p>
         </a>
-        <a id="tab3a" href="#tab3" class="weui-tabbar__item">
-            <div class="weui-tabbar__icon"><img src="/static/images/wx/customer_service.png" alt=""></div>
-            <p class="weui-tabbar__label">团购</p>
-        </a>
+<#--        <a id="tab3a" href="#tab3" class="weui-tabbar__item">-->
+<#--            <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">-->
     <#--<div class="weui-tabbar__icon"> <img src="./images/icon_nav_article.png" alt=""> </div>-->
     <#--<p class="weui-tabbar__label">发现</p>-->
@@ -52,7 +53,7 @@
 <script>
     <#include "/yeweihui/ribao.js" />
     <#include "/yeweihui/qiuzhu.js" />
-    <#include "/yeweihui/tuangou.js" />
+<#--    <#include "/yeweihui/tuangou.js" />-->
 
     var taskList = ${taskList!'[]'};
     var statisticsOrderList =${rbList!'[]'};
@@ -84,7 +85,7 @@
 
         ribao_init();
         qiuzhu_init();
-        tuangou_init();
+        // tuangou_init();
 
         $("#ribaohuiz").calendar({
             dateFormat: 'yyyy-mm-dd',

+ 2 - 2
whepi-ui/templates/yeweihui/tgPublish.ftl

@@ -44,7 +44,7 @@
     $("#tg_input_deliver_time").datetimePicker();
 
     function goback() {
-        window.location.href = "/yeweihui/home.html?show=tuangou&userId=" + userId;
+        window.location.href = "/yeweihui/tuangouHome.html?show=tuangou&userId=" + userId;
     }
 
     $("#tg_publish").on('click', function () {
@@ -197,7 +197,7 @@
             success: function (data) {
                 // console.log(data);
                 if (data.success) {
-                    window.location.href = "/yeweihui/home.html?show=tuangou&userId=" + userId;
+                    window.location.href = "/yeweihui/tuangouHome.html?show=tuangou&userId=" + userId;
                 }
                 else  {
                     $.alert(data.data);

+ 22 - 3
whepi-ui/templates/yeweihui/tuangouHome.ftl

@@ -1,7 +1,24 @@
-<#assign title="我的团购"/>
+<#assign title="管理员"/>
 <#include "/home/frag.head.ftl" />
 
-<#include "/yeweihui/tuangou.ftl" />
+<div class="weui-tab">
+    <input id="userId" type="text" hidden="hidden" value=${user_id!}/>
+    <input id="uptownId" type="text" hidden="hidden" value=${uptown_id!}/>
+    <input id="uptownName" type="text" hidden="hidden" value=${uptown_name!}/>
+
+    <div class="weui-tab__bd">
+        <div id="tab__1" class="weui-tab__bd-item weui-tab__bd-item--active">
+            <#include "/yeweihui/tuangou.ftl" />
+        </div>
+    </div>
+    <div class="weui-tabbar">
+        <a href="#tab__1" class="weui-tabbar__item weui-bar__item--on">
+            <div class="weui-tabbar__icon"><img src="/static/images/wx/customer_service.png" alt=""></div>
+            <p class="weui-tabbar__label">团购</p>
+        </a>
+    </div>
+</div>
+
 
 </body>
 
@@ -21,6 +38,8 @@
             });
 
         });
-    })(jQuery);
 
+        tuangou_init();
+
+    })(jQuery);
 </script>

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

@@ -2,12 +2,14 @@ package com.bofeng.dao;
 
 import com.baomidou.mybatisplus.mapper.BaseMapper;
 import com.bofeng.entity.UptownDoor;
+import com.yvan.PageDb;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
+import java.util.Map;
 
 @Mapper
 @Repository
@@ -17,7 +19,6 @@ public interface UptownDoorMapper extends BaseMapper<UptownDoor> {
             "sys_uptown u ON u.uptown_id = ud.uptown_id WHERE ud.door_id = #{doorId} AND ud.STATUS = 1")
     UptownDoor getUptownDoorById(@Param("doorId") Long doorId);
 
-    @Select("SELECT * FROM sys_uptown_door WHERE STATUS = 1")
-    List<UptownDoor> getAllUptownDoor();
+    List<UptownDoor> getAllUptownDoor(PageDb pagination, Map<String, Object> map);
 
 }

+ 7 - 0
whepi-web/src/main/java/com/bofeng/entity/UptownDoor.java

@@ -45,4 +45,11 @@ public class UptownDoor {
     @ApiModelProperty("出门间隔时间")
     @TableField(exist = false)
     private Integer goOutFre;
+
+    @TableField(exist = false)
+    private String inImg;
+
+    @TableField(exist = false)
+    private String outImg;
+
 }

+ 69 - 0
whepi-web/src/main/java/com/bofeng/wx/controller/ScanAdminController.java

@@ -1,18 +1,35 @@
 package com.bofeng.wx.controller;
 
+import com.bofeng.dao.UptownDoorMapper;
 import com.bofeng.entity.SysUptownHouse;
+import com.bofeng.entity.UptownDoor;
 import com.bofeng.excel.ExcelUtils;
 import com.bofeng.service.SweepCodeService;
+import com.google.zxing.BarcodeFormat;
+import com.google.zxing.MultiFormatWriter;
+import com.google.zxing.WriterException;
+import com.google.zxing.client.j2se.MatrixToImageConfig;
+import com.google.zxing.client.j2se.MatrixToImageWriter;
+import com.google.zxing.common.BitMatrix;
 import com.yvan.Model;
+import com.yvan.PageDb;
+import com.yvan.mvc.Pd;
 import com.yvan.springmvc.HttpParameterParser;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import lombok.Cleanup;
 import lombok.SneakyThrows;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.net.URLEncoder;
 import java.util.List;
 
 @Api("进出扫码后台信息")
@@ -22,6 +39,8 @@ public class ScanAdminController {
 
     @Autowired
     private SweepCodeService sweepCodeService;
+    @Autowired
+    private UptownDoorMapper uptownDoorMapper;
 
     @ApiOperation("出入查询")
     @GetMapping("/whepi/sweepCode/selectCode")
@@ -39,5 +58,55 @@ public class ScanAdminController {
         ExcelUtils.writeSheet(SysUptownHouse.class, sysUptownHouses).export(resp,"扫码导出");
     }
 
+    @ApiOperation("小区进出二维码")
+    @PostMapping("/whepi/qrImg/scanQrImg")
+    public Model<List<UptownDoor>> scanQrImg(HttpParameterParser parser, PageDb pagination) {
+        List<UptownDoor> list = uptownDoorMapper.getAllUptownDoor(pagination, parser.getMap());
+        for (UptownDoor door : list) {
+            door.setInImg("/whepi/scan/scan_qr.png?doorId=" + door.getDoorId() + "&inType=1");
+            door.setOutImg("/whepi/scan/scan_qr.png?doorId=" + door.getDoorId() + "&inType=2");
+        }
+        return Model.newSuccess(pagination, list);
+    }
+
+    // 获取code
+    private static final String oauth2 = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=";
+    private static final String moreUrl = "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
+    @Value("${yvan.wechat.appID}")
+    private String appId;
+    @Value("${yvan.wechat.domain}")
+    private String domain;
+
+    /**
+     * 生成进出门二维码
+     * @param doorId 小区大门ID
+     * @param inType 1进入;2外出
+     * @param response
+     * @throws IOException
+     * @throws WriterException
+     */
+    @GetMapping(value = "/whepi/scan/scan_qr.png", produces = MediaType.IMAGE_PNG_VALUE)
+    public void scanQrImg(@Pd(name = "doorId") Long doorId, @Pd(name = "inType") Integer inType,
+                          HttpServletResponse response) throws IOException, WriterException {
+        @Cleanup ServletOutputStream outputStream = response.getOutputStream();
+        String msg = URLEncoder.encode( domain + "user/scan.html?doorId=" + doorId + "&inType=" + inType,"utf-8");
+        BitMatrix matrix = new MultiFormatWriter().encode(oauth2 + appId + "&redirect_uri=" +
+                msg + moreUrl, BarcodeFormat.QR_CODE, 256, 256);
+        MatrixToImageWriter.writeToStream(matrix, MediaType.IMAGE_PNG.getSubtype(), outputStream, new MatrixToImageConfig());
+    }
+
+    /**
+     * 生成校园巡逻二维码
+     * @throws IOException
+     * @throws WriterException
+     */
+    @GetMapping(value = "/whepi/scan/scanEstate_qr.png", produces = MediaType.IMAGE_PNG_VALUE)
+    public void scanEstateQrImg(HttpServletResponse response) throws IOException, WriterException {
+        @Cleanup ServletOutputStream outputStream = response.getOutputStream();
+        String msg = URLEncoder.encode( domain + "user/scanEstate.html","utf-8");
+        BitMatrix matrix = new MultiFormatWriter().encode(oauth2 + appId + "&redirect_uri=" +
+                msg + moreUrl, BarcodeFormat.QR_CODE, 256, 256);
+        MatrixToImageWriter.writeToStream(matrix, MediaType.IMAGE_PNG.getSubtype(), outputStream, new MatrixToImageConfig());
+    }
 
 }

+ 7 - 4
whepi-web/src/main/java/com/bofeng/wx/controller/ScanController.java

@@ -28,6 +28,7 @@ import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.net.URLEncoder;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
@@ -199,8 +200,9 @@ public class ScanController {
     public void scanQrImg(@Pd(name = "doorId") Long doorId, @Pd(name = "inType") Integer inType,
                             HttpServletResponse response) throws IOException, WriterException {
         @Cleanup ServletOutputStream outputStream = response.getOutputStream();
-        BitMatrix matrix = new MultiFormatWriter().encode(oauth2 + appId + "&redirect_uri=" + domain +
-                "/user/scan.html?doorId=" + doorId + "&inType=" + inType + moreUrl, BarcodeFormat.QR_CODE, 256, 256);
+        String msg = URLEncoder.encode( domain + "user/scan.html?doorId=" + doorId + "&inType=" + inType,"utf-8");
+        BitMatrix matrix = new MultiFormatWriter().encode(oauth2 + appId + "&redirect_uri=" +
+                msg + moreUrl, BarcodeFormat.QR_CODE, 256, 256);
         MatrixToImageWriter.writeToStream(matrix, MediaType.IMAGE_PNG.getSubtype(), outputStream, new MatrixToImageConfig());
     }
 
@@ -212,8 +214,9 @@ public class ScanController {
     @GetMapping(value = "/scan/scanEstate_qr.png", produces = MediaType.IMAGE_PNG_VALUE)
     public void scanEstateQrImg(HttpServletResponse response) throws IOException, WriterException {
         @Cleanup ServletOutputStream outputStream = response.getOutputStream();
-        BitMatrix matrix = new MultiFormatWriter().encode(oauth2 + appId + "&redirect_uri=" + domain +
-                "/user/scanEstate.html" + moreUrl, BarcodeFormat.QR_CODE, 256, 256);
+        String msg = URLEncoder.encode( domain + "user/scanEstate.html","utf-8");
+        BitMatrix matrix = new MultiFormatWriter().encode(oauth2 + appId + "&redirect_uri=" +
+                msg + moreUrl, BarcodeFormat.QR_CODE, 256, 256);
         MatrixToImageWriter.writeToStream(matrix, MediaType.IMAGE_PNG.getSubtype(), outputStream, new MatrixToImageConfig());
     }
 }

+ 9 - 0
whepi-web/src/main/java/com/bofeng/wx/controller/YeWeiHuiController.java

@@ -69,6 +69,15 @@ public class YeWeiHuiController {
     return new ModelAndView("/yeweihui/home.ftl", model);
   }
 
+  @GetMapping("/yeweihui/tuangouHome.html")
+  public ModelAndView yeweihuiTuangouHome(ModelMap model, @RequestParam(value = "userId") Long userId, @RequestParam(value = "show", required = false, defaultValue = "-") String show) {
+
+    model.put("user_id", "\"" + userId + "\"");
+    model.put("show", "\"" + show + "\"");
+
+    return new ModelAndView("/yeweihui/tuangouHome.ftl", model);
+  }
+
   @GetMapping("/yeweihui/qiuzhuDetail.html")
   public ModelAndView qiuzhudetail(@Pd(name = "taskId") Long taskId, @Pd(name = "userId") Long userId, ModelMap model) throws JsonProcessingException {
 

+ 1 - 1
whepi-web/src/main/resources/application.yml

@@ -43,7 +43,7 @@ endpoints:
 #  whitelabel.enabled: false
 
 spring:
-  profiles.active: guojing
+  profiles.active: lll
 
   application:
     name: bofeng-web

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

@@ -15,7 +15,7 @@
        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 b.unit_id=c.unit_id
-       where a.user_id=#{userId} and a.role_id=1) ORDER BY jt.tg_end_time DESC
+       where a.user_id=#{userId} and a.role_id=1 limit 1 ) ORDER BY jt.tg_end_time DESC
     </select>
 
     <select id="MyGroup" resultType="com.bofeng.entity.Buy">

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

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.bofeng.dao.MsReportMapper">
     <select id="selectByReportDate" resultType="com.bofeng.entity.MsReport">
-        select * from ms_report where report_date = #{reportDate} and  user_create = #{userCreate} and report_status=1
+        select * from ms_report where report_date = #{reportDate} and  user_create = #{userCreate}
         order by report_date desc
     </select>
 </mapper>

+ 17 - 0
whepi-web/src/main/resources/mapper/UptownDoorMapper.xml

@@ -0,0 +1,17 @@
+<?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.UptownDoorMapper">
+
+    <select id="getAllUptownDoor" resultType="com.bofeng.entity.UptownDoor">
+        SELECT ud.*,u.uptown_name as uptownName FROM sys_uptown_door ud left join sys_uptown u on u.uptown_id =
+        ud.uptown_id
+        <where>
+            and ud.status = 1
+            <if test="queryProperties!=null and queryProperties!=''">
+                and u.uptown_name like concat('%',#{queryProperties},'%')
+            </if>
+        </where>
+        order by ud.time_update desc
+    </select>
+
+</mapper>