Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	whepi-web/src/main/java/com/bofeng/wx/controller/UserOpenController.java
guojing 5 years ago
parent
commit
abe7e03025

+ 2 - 2
whepi-doc/mrsb.sql

@@ -30,9 +30,9 @@ CREATE TABLE ms_suspected  (
   suspected_id      bigint(20) NOT NULL DEFAULT 0                           COMMENT '疑似ID',
   report_id         bigint(20) NOT NULL DEFAULT 0                           COMMENT '上报ID',
   user_name         varchar(50)  NOT NULL DEFAULT ''                        COMMENT '家人姓名',
-  grender            int(11)    NOT NULL DEFAULT 0                          COMMENT '性别:0未设置,1男,2女',
+  grender           int(11)    NOT NULL DEFAULT 0                           COMMENT '性别:0未设置,1男,2女',
   age               int(11)    NOT NULL DEFAULT 0                           COMMENT '年龄',
-  family_status     int(11)    NOT NULL DEFAULT 0                           COMMENT '基本状态:1,0,1,0,0,0,1 (0表示未选中,1表示选中)',
+  family_status     varchar(50) NOT NULL DEFAULT 0                          COMMENT '基本状态:1,0,1,0,0,0,1 (0表示未选中,1表示选中)',
   status_desp       varchar(100)  NOT NULL DEFAULT ''                       COMMENT '状态描述',
   medical           int(11)    NOT NULL DEFAULT 0                           COMMENT '是否确诊:0否,1是',
   temperature       decimal(14,2) NOT NULL DEFAULT 0                        COMMENT '体温',

+ 24 - 0
whepi-ui/templates/tuangou/home.ftl

@@ -0,0 +1,24 @@
+<#assign title="商品团购"/>
+<#include "/home/frag.head.ftl" />
+
+<div class="weui-tab">
+    <div class="weui-tab__bd">
+
+
+    </div>
+</div>
+</div>
+</body>
+<#include "/home/frag.foot.ftl" />
+<script>
+
+    $(document).ready(function () {
+    }
+
+</script>
+
+
+
+
+
+

+ 3 - 1
whepi-ui/templates/user/changeRole.ftl

@@ -72,6 +72,8 @@
             $.alert("请选择用户角色!")
             return false;
         }
-        window.location.href = "/user/homeIndex.html?userId=" + $("#userId").val() + "&userType=" + userType;
+        <#if (type?? )&&(type = 1) >window.location.href = "/user/homeIndex.html?userId=" + $("#userId").val() + "&userType=" + userType;</#if>
+        <#if (type?? )&&(type = 2) >window.location.href = "/user/homeIndex.html?userId=" + $("#userId").val() + "&userType=" + userType;</#if>
+
     }
 </script>

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

@@ -0,0 +1,14 @@
+package com.bofeng.dao;
+
+import com.bofeng.entity.SysUptownHouse;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+@Repository
+public interface SweepCodeMapper {
+    List<SysUptownHouse> selectCode(Map<String, Object> queryParam);
+}

+ 22 - 0
whepi-web/src/main/java/com/bofeng/entity/SysUptownHouse.java

@@ -1,5 +1,6 @@
 package com.bofeng.entity;
 
+import com.alibaba.excel.annotation.ExcelProperty;
 import com.baomidou.mybatisplus.annotations.TableField;
 import com.baomidou.mybatisplus.annotations.TableId;
 import com.baomidou.mybatisplus.annotations.TableName;
@@ -20,9 +21,11 @@ public class SysUptownHouse implements Serializable {
     private Long unitId;
 
     @TableField(exist = false)
+    @ExcelProperty(value = {"楼栋"}, index = 1)
     private String ridgepole;
 
     @TableField(exist = false)
+    @ExcelProperty(value = {"单元"}, index = 2)
     private String unit;
 
     @TableField(exist = false)
@@ -35,6 +38,7 @@ public class SysUptownHouse implements Serializable {
     private String time;
 
     @TableField("doorplate")
+    @ExcelProperty(value = {"房间号"}, index = 3)
     private String doorplate;
 
     @TableField("status")
@@ -49,10 +53,28 @@ public class SysUptownHouse implements Serializable {
     @TableField("time_update")
     private DateTime timeUpdate;
 
+    @TableField(exist = false)
+    @ExcelProperty(value = {"小区名称"}, index = 0)
+    private String uptownName;
 
+    @TableField(exist = false)
+    @ExcelProperty(value = {"小区大门"}, index = 5)
+    private String doorName;
 
+    @TableField(exist = false)
+    @ExcelProperty(value = {"进入时间"}, index = 6)
+    private String intoDate;
 
+    @TableField(exist = false)
+    @ExcelProperty(value = {"外出时间"}, index = 7)
+    private String outDate;
 
+    @TableField(exist = false)
+    @ExcelProperty(value = {"用户名"}, index = 4)
+    private String nickName;
+
+    @TableField(exist = false)
+    private String jcStatus;
 
 
 

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

@@ -140,7 +140,7 @@ public class JmTuangouService {
             return jmTuangouDao.updateRemarkByJmId(jmId, remark);
         }
         if (remark.equals("")) {
-
+            return jmTuangouDao.updateStatusByJmId(jmId, status);
         }
         return jmTuangouDao.updateStatusRemarkByJmId(jmId, status, remark);
     }

+ 26 - 0
whepi-web/src/main/java/com/bofeng/service/SweepCodeService.java

@@ -0,0 +1,26 @@
+package com.bofeng.service;
+
+
+import com.bofeng.dao.SweepCodeMapper;
+import com.bofeng.entity.SysUptownHouse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+@Service
+@Transactional(readOnly = true)
+public class SweepCodeService {
+
+    @Autowired
+    private SweepCodeMapper sweepCodeMapper;
+
+
+    public List<SysUptownHouse> selectCode(Map<String, Object> queryParam) {
+        List<SysUptownHouse> sysUptownHouses = sweepCodeMapper.selectCode(queryParam);
+
+        return sysUptownHouses;
+    }
+}

+ 26 - 4
whepi-web/src/main/java/com/bofeng/wx/WxController.java

@@ -112,7 +112,16 @@ public class WxController {
     public ModelOps createMenu() throws WxErrorException {
         val menu = new WxMenu();
 
-        //推介客户
+//        //推介客户
+//        val btn1 = new WxMenuButton();
+//        btn1.setName("健康日报");
+//        btn1.setType(WxConsts.MenuButtonType.VIEW);
+//        btn1.setUrl(
+//                wxService.oauth2buildAuthorizationUrl(weChatProperties.getDomain() +
+//                                "/user/home.html",
+//                        WxConsts.OAuth2Scope.SNSAPI_USERINFO, null)
+//        );
+
         val btn1 = new WxMenuButton();
         btn1.setName("健康日报");
         btn1.setType(WxConsts.MenuButtonType.VIEW);
@@ -121,6 +130,18 @@ public class WxController {
                                 "/user/home.html",
                         WxConsts.OAuth2Scope.SNSAPI_USERINFO, null)
         );
+        val btn2 = new WxMenuButton();
+        btn2.setName("商品团购");
+        btn2.setType(WxConsts.MenuButtonType.VIEW);
+        btn2.setUrl(
+                wxService.oauth2buildAuthorizationUrl(weChatProperties.getDomain() +
+                                "/tuangou/home.html",
+                        WxConsts.OAuth2Scope.SNSAPI_USERINFO, null)
+        );
+
+        val btn3 = new WxMenuButton();
+        btn3.setName("我的");
+
         val btnDesc = new WxMenuButton();
         btnDesc.setName("平台简介");
         btnDesc.setType(WxConsts.MenuButtonType.VIEW);
@@ -138,7 +159,8 @@ public class WxController {
                                 "/home/homeHelp.html",
                         WxConsts.OAuth2Scope.SNSAPI_USERINFO, null)
         );
-
+        btn3.getSubButtons().add(btnDesc);
+        btn3.getSubButtons().add(btnHelp);
 
 //        val btn2 = new WxMenuButton();
 //        btn2.setName("业委会");
@@ -201,8 +223,8 @@ public class WxController {
 //        btn3.getSubButtons().add(btn33);
 
         menu.getButtons().add(btn1);
-        menu.getButtons().add(btnDesc);
-        menu.getButtons().add(btnHelp);
+        menu.getButtons().add(btn2);
+        menu.getButtons().add(btn3);
 //        menu.getButtons().add(btn2);
 //        menu.getButtons().add(btn3);
         wxService.getMenuService().menuCreate(menu);

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

@@ -1,9 +1,43 @@
 package com.bofeng.wx.controller;
 
+import com.bofeng.entity.SysUptownHouse;
+import com.bofeng.excel.ExcelUtils;
+import com.bofeng.service.SweepCodeService;
+import com.yvan.Model;
+import com.yvan.springmvc.HttpParameterParser;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.SneakyThrows;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
 @Api("进出扫码后台信息")
 @RestController
 public class ScanAdminController {
+
+
+    @Autowired
+    private SweepCodeService sweepCodeService;
+
+    @ApiOperation("出入查询")
+    @GetMapping("/whepi/sweepCode/selectCode")
+    public Model<List<SysUptownHouse>> selectCode(HttpParameterParser parser) {
+//        HttpServletResponse response,HttpServletRequest request
+        List<SysUptownHouse> sysUptownHouses = sweepCodeService.selectCode(parser.getMap());
+        return Model.newSuccess(sysUptownHouses);
+    }
+
+    @ApiOperation("导出")
+    @GetMapping("/whepi/sweepCode/export")
+    @SneakyThrows
+    public void export(HttpParameterParser parser,HttpServletResponse resp) {
+        List<SysUptownHouse> sysUptownHouses = sweepCodeService.selectCode(parser.getMap());
+        ExcelUtils.writeSheet(SysUptownHouse.class, sysUptownHouses).export(resp,"扫码导出");
+    }
+
+
 }

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

@@ -57,8 +57,7 @@ public class ScanController {
     @GetMapping("/user/scan.html")
     public ModelAndView scan(HttpServletRequest request, ModelMap model, @RequestParam(value = "doorId", required = false, defaultValue = "0") Long doorId,
                              @RequestParam(value = "inType", required = false, defaultValue = "0") Integer inType) {
-//        String code = request.getParameter("code");
-        UserOpen userOpen = homeService.getUserOpen();
+        UserOpen userOpen = homeService.getUserOpenByCode(request.getParameter("code"));
         List<UserRole> list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
 //        List<UserRole> list = userRoleMapper.getUserRoleByUserId(1L);
 //        UserOpen userOpen = userOpenMapper.selectByUserId(1L);
@@ -71,7 +70,7 @@ public class ScanController {
             List<UptownHome> uptownHomes =  uptownHomeMapper.getUptownHomeByUserId(userOpen.getUserId());
             UptownUnit unit = uptownUnitMapper.getUptownUnitByUser(userOpen.getUserId());
             model.put("door", uptownDoor.getUptownName() + uptownDoor.getDoorName());
-            model.put("doorplate", unit.getRidgepole() + "栋" + unit.getUnit() + "单元" +unit.getDoorplate());
+            model.put("doorplate", unit.getRidgepole() + "栋" + unit.getUnit() + "单元" +unit.getDoorplate() + "号");
             model.put("name", uptownHomes.get(0).getLinkman());
             SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
             model.put("now", format.format(new Date()));
@@ -112,8 +111,7 @@ public class ScanController {
     @ApiOperation("巡检人员检查扫码信息")
     @GetMapping("/user/scanEstate.html")
     public ModelAndView scanEstate(HttpServletRequest request, ModelMap model) {
-        String code = request.getParameter("code");
-        UserOpen userOpen = homeService.getUserOpen();
+        UserOpen userOpen = homeService.getUserOpenByCode(request.getParameter("code"));
         List<UserRole> list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
 //        List<UserRole> list = userRoleMapper.getUserRoleByUserId(1L);
 //        UserOpen userOpen = userOpenMapper.selectByUserId(1L);
@@ -124,7 +122,7 @@ public class ScanController {
         } else {
             List<UptownHome> uptownHomes =  uptownHomeMapper.getUptownHomeByUserId(userOpen.getUserId());
             UptownUnit unit = uptownUnitMapper.getUptownUnitByUser(userOpen.getUserId());
-            model.put("doorplate", unit.getRidgepole() + "栋" + unit.getUnit() + "单元" +unit.getDoorplate());
+            model.put("doorplate", unit.getRidgepole() + "栋" + unit.getUnit() + "单元" +unit.getDoorplate() + "号");
             model.put("name", uptownHomes.get(0).getLinkman());
             SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
             model.put("now", format.format(new Date()));

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

@@ -64,9 +64,9 @@ public class UserOpenController {
                              @RequestParam(value = "userType", required = false, defaultValue = "0") Integer userType) throws JsonProcessingException {
         List<UserRole> list = new ArrayList<>();
         if (userId == 0) {
-           // UserOpen userOpen = homeService.getUserOpen();
-           // list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
-           list = userRoleMapper.getUserRoleByUserId(1225321682867105793L);
+//            UserOpen userOpen = homeService.getUserOpen();
+//            list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
+            list = userRoleMapper.getUserRoleByUserId(1225321682867105793L);
             UserOpen userOpen = userOpenMapper.selectByUserId(1225321682867105793L);
             userId = userOpen.getUserId();
             model.put("user", userOpen);

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

@@ -385,6 +385,19 @@ public class YeWeiHuiController {
         }
     }
 
+    @PostMapping("/whepi/yeweihui/tgStatus")
+    public Model whepiYeweihuiTgStatus(@Pd(name = "jmId") Long jmId, @Pd(name = "status", required = false, defaultValue = "0") Long status, @Pd(name = "remark", required = false) String remark) {
+
+        Integer success = jmTuangouService.updateRemarkByJmId(jmId, status, remark);
+
+        if (success == 1) {
+            return Model.newSuccess("操作成功");
+        }
+        else {
+            return Model.newFail("操作失败");
+        }
+    }
+
     @PostMapping("/yeweihui/tuangou/list/query.json")
     public Model queryTuangouListByTitle(@Pd(name = "userId") Long userId, @Pd(name = "title", required = false) String title) {
 

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

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

+ 42 - 0
whepi-web/src/main/resources/mapper/SweepCodeMapper.xml

@@ -0,0 +1,42 @@
+<?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.SweepCodeMapper">
+    <select id="selectCode" resultType="com.bofeng.entity.SysUptownHouse">
+       select
+        a.uptown_name,
+        d.ridgepole,
+        d.unit,
+        e.doorplate,
+        b.door_name,
+        c.into_date,
+        h.out_date,
+        g.nick_name
+        from sys_uptown a
+        inner join sys_uptown_door b on a.uptown_id = b.uptown_id
+        inner join out_scan c on c.into_door_id = b.door_id
+        inner join out_scan h on h.out_door_id = b.door_id
+        inner join sys_uptown_unit d on d.uptown_id = a.uptown_id
+        inner join sys_uptown_house e on e.unit_id = d.unit_id
+        inner join sys_user_role j on j.property_id = e.house_id and j.role_id = 1
+        inner join sys_user_open g on g.user_id = j.user_id
+        <where>
+         <if test="uptownName != null and uptownName != ''">
+          a.uptown_name like concat('%',#{uptownName},'%')
+         </if>
+         <if test="intoDate != null and intoDate !=''">
+          and c.into_date >= #{intoDate}
+         </if>
+         <if test="intoDate != null and intoDate !=''">
+          and c.into_date &lt; #{intoDate}
+         </if>
+         <if test="outDate != null and outDate !=''">
+          and h.out_date &lt; #{outDate}
+         </if>
+         <if test="outDate != null and outDate !=''">
+          and h.out_date >= #{outDate}
+         </if>
+        </where>
+    </select>
+
+
+</mapper>