Browse Source

与手机端的接口完成

wukai 2 years ago
parent
commit
43ecd72df2

+ 102 - 13
dayun-admin/src/main/java/com/jjt/biz/controller/ApiController.java

@@ -1,22 +1,34 @@
 package com.jjt.biz.controller;
 
-import com.jjt.biz.domain.DeviceInfo;
-import com.jjt.biz.domain.KeyInfo;
-import com.jjt.biz.domain.VenueInfo;
-import com.jjt.biz.domain.WifiInfo;
+import com.jjt.biz.domain.*;
 import com.jjt.biz.service.*;
+import com.jjt.biz.vo.BluetoothInfoVO;
+import com.jjt.biz.vo.VenueAreaVO;
+import com.jjt.biz.vo.VenueInfoVO;
+import com.jjt.biz.vo.WifiInfoVO;
 import com.jjt.common.annotation.Log;
+import com.jjt.common.config.RuoYiConfig;
 import com.jjt.common.core.controller.BaseController;
 import com.jjt.common.core.domain.AjaxResult;
 import com.jjt.common.core.page.TableDataInfo;
 import com.jjt.common.enums.BusinessType;
+import com.jjt.common.utils.StringUtils;
+import com.jjt.common.utils.file.FileUploadUtils;
+import com.jjt.common.utils.file.FileUtils;
 import com.jjt.common.utils.poi.ExcelUtil;
+import com.jjt.common.utils.sign.Base64;
+import com.jjt.framework.config.ServerConfig;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -36,32 +48,92 @@ public class ApiController extends BaseController {
     private IBluetoothInfoService bluetoothInfoService;
     @Resource
     private IVenueInfoService venueInfoService;
+    @Resource
+    private IVenueAreaService areaService;
+    @Resource
+    private ServerConfig serverConfig;
 
     /**
      * 设备注册接口
      */
-    @Log(title = "设备", businessType = BusinessType.INSERT)
     @PostMapping("/device")
-    public AjaxResult device(DeviceInfo deviceInfo) {
+    public AjaxResult device(@RequestBody DeviceInfo deviceInfo) {
+        deviceInfo.setRegisterTime(new Date());
         return toAjax(deviceInfoService.insertDeviceInfo(deviceInfo));
     }
 
     /**
      * WIFI上传
      */
-    @Log(title = "WIFI", businessType = BusinessType.INSERT)
     @PostMapping("/wifi")
-    public AjaxResult wifi(List<WifiInfo> infoList) {
-        return null;
+    public AjaxResult wifi(@RequestBody List<WifiInfoVO> infoList) {
+        infoList.forEach(vo -> {
+            WifiInfo info = new WifiInfo();
+            info.setDeviceId(vo.getDeviceId());
+            String[] vaId = vo.getVenueId().split("-");
+            Long vId = Long.parseLong(vaId[0]);
+            info.setVenueId(vId);
+            if (vaId.length > 1) {
+                Long aId = Long.parseLong(vaId[1]);
+                info.setAreaId(aId);
+            }
+            if (StringUtils.isNotEmpty(vo.getAuthPage())) {
+                String page = new String(Base64.decode(vo.getAuthPage()), StandardCharsets.UTF_8);
+                info.setAuthPage(page);
+            }
+            info.setBssid(vo.getBssid());
+            info.setSsid(vo.getSsid());
+            info.setTime(vo.getTime());
+            wifiInfoService.insertWifiInfo(info);
+        });
+        return AjaxResult.success();
     }
 
     /**
      * 蓝牙上传
      */
-    @Log(title = "蓝牙", businessType = BusinessType.INSERT)
     @PostMapping("/bluetooth")
-    public AjaxResult bluetooth(List<WifiInfo> infoList) {
-        return null;
+    public AjaxResult bluetooth(@RequestBody List<BluetoothInfoVO> infoList) {
+        infoList.forEach(vo -> {
+            BluetoothInfo info = new BluetoothInfo();
+            info.setDeviceId(vo.getDeviceId());
+            String[] vaId = vo.getVenueId().split("-");
+            Long vId = Long.parseLong(vaId[0]);
+            info.setVenueId(vId);
+            if (vaId.length > 1) {
+                Long aId = Long.parseLong(vaId[1]);
+                info.setAreaId(aId);
+            }
+            info.setMac(vo.getMac());
+            info.setName(vo.getName());
+            info.setFileName(vo.getFileName());
+            info.setFilePath(vo.getFilePath());
+            info.setTime(vo.getTime());
+            bluetoothInfoService.insertBluetoothInfo(info);
+        });
+        return AjaxResult.success();
+    }
+
+    /**
+     * 通用上传请求(单个)
+     */
+    @PostMapping("/upload")
+    public AjaxResult upload(MultipartFile file) {
+        try {
+            // 上传文件路径
+            String filePath = RuoYiConfig.getUploadPath();
+            // 上传并返回新文件名称
+            String fileName = FileUploadUtils.upload(filePath, file);
+            String url = serverConfig.getUrl() + fileName;
+            AjaxResult ajax = AjaxResult.success();
+            ajax.put("url", url);
+//            ajax.put("fileName", fileName);
+//            ajax.put("newFileName", FileUtils.getName(fileName));
+            ajax.put("fileName", file.getOriginalFilename());
+            return ajax;
+        } catch (Exception e) {
+            return AjaxResult.error(e.getMessage());
+        }
     }
 
     /**
@@ -70,6 +142,23 @@ public class ApiController extends BaseController {
     @GetMapping("/venue")
     public TableDataInfo venue() {
         List<VenueInfo> list = venueInfoService.selectVenueInfoList(null);
-        return getDataTable(list);
+        List<VenueInfoVO> result = new ArrayList<>();
+        VenueArea area = new VenueArea();
+        for (VenueInfo info : list) {
+            VenueInfoVO vo = new VenueInfoVO();
+            BeanUtils.copyProperties(info, vo);
+            area.setVenueId(info.getVenueId());
+            List<VenueArea> areaList = areaService.selectVenueAreaList(area);
+            List<VenueAreaVO> areaVOList = new ArrayList<>();
+            areaList.forEach(bean -> {
+                VenueAreaVO avo = new VenueAreaVO();
+                BeanUtils.copyProperties(bean, avo);
+                areaVOList.add(avo);
+            });
+
+            vo.setArea(areaVOList);
+            result.add(vo);
+        }
+        return getDataTable(result);
     }
 }

+ 35 - 21
dayun-admin/src/main/java/com/jjt/biz/domain/BluetoothInfo.java

@@ -22,19 +22,23 @@ public class BluetoothInfo extends BaseEntity
 
     /** 设备ID */
     @Excel(name = "设备ID")
-    private Long deviceId;
+    private String deviceId;
 
     /** 场馆ID */
     @Excel(name = "场馆ID")
     private Long venueId;
 
+    /** 区域ID */
+    @Excel(name = "区域ID")
+    private Long areaId;
+
     /** MAC地址 */
     @Excel(name = "MAC地址")
-    private String MAC;
+    private String mac;
 
     /** 蓝牙名称 */
     @Excel(name = "蓝牙名称")
-    private String NAME;
+    private String name;
 
     /** 文件名 */
     @Excel(name = "文件名")
@@ -55,7 +59,7 @@ public class BluetoothInfo extends BaseEntity
     /** 数据采集时间 */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "数据采集时间", width = 30, dateFormat = "yyyy-MM-dd")
-    private Date TIME;
+    private Date time;
 
     public void setbInfoId(Long bInfoId) 
     {
@@ -66,12 +70,12 @@ public class BluetoothInfo extends BaseEntity
     {
         return bInfoId;
     }
-    public void setDeviceId(Long deviceId) 
+    public void setDeviceId(String deviceId) 
     {
         this.deviceId = deviceId;
     }
 
-    public Long getDeviceId() 
+    public String getDeviceId() 
     {
         return deviceId;
     }
@@ -84,23 +88,32 @@ public class BluetoothInfo extends BaseEntity
     {
         return venueId;
     }
-    public void setMAC(String MAC) 
+    public void setAreaId(Long areaId) 
+    {
+        this.areaId = areaId;
+    }
+
+    public Long getAreaId() 
+    {
+        return areaId;
+    }
+    public void setMac(String mac) 
     {
-        this.MAC = MAC;
+        this.mac = mac;
     }
 
-    public String getMAC() 
+    public String getMac() 
     {
-        return MAC;
+        return mac;
     }
-    public void setNAME(String NAME) 
+    public void setName(String name) 
     {
-        this.NAME = NAME;
+        this.name = name;
     }
 
-    public String getNAME() 
+    public String getName() 
     {
-        return NAME;
+        return name;
     }
     public void setFileName(String fileName) 
     {
@@ -138,14 +151,14 @@ public class BluetoothInfo extends BaseEntity
     {
         return keyType;
     }
-    public void setTIME(Date TIME) 
+    public void setTime(Date time) 
     {
-        this.TIME = TIME;
+        this.time = time;
     }
 
-    public Date getTIME() 
+    public Date getTime() 
     {
-        return TIME;
+        return time;
     }
 
     @Override
@@ -154,13 +167,14 @@ public class BluetoothInfo extends BaseEntity
             .append("bInfoId", getbInfoId())
             .append("deviceId", getDeviceId())
             .append("venueId", getVenueId())
-            .append("MAC", getMAC())
-            .append("NAME", getNAME())
+            .append("areaId", getAreaId())
+            .append("mac", getMac())
+            .append("name", getName())
             .append("fileName", getFileName())
             .append("filePath", getFilePath())
             .append("isIllegal", getIsIllegal())
             .append("keyType", getKeyType())
-            .append("TIME", getTIME())
+            .append("time", getTime())
             .toString();
     }
 }

+ 35 - 21
dayun-admin/src/main/java/com/jjt/biz/domain/WifiInfo.java

@@ -22,19 +22,23 @@ public class WifiInfo extends BaseEntity
 
     /** 设备ID */
     @Excel(name = "设备ID")
-    private Long deviceId;
+    private String deviceId;
 
     /** 场馆ID */
     @Excel(name = "场馆ID")
     private Long venueId;
 
+    /** 区域ID */
+    @Excel(name = "区域ID")
+    private Long areaId;
+
     /** MAC地址 */
     @Excel(name = "MAC地址")
-    private String BSSID;
+    private String bssid;
 
     /** WIFI名称 */
     @Excel(name = "WIFI名称")
-    private String SSID;
+    private String ssid;
 
     /** 认证页面 */
     @Excel(name = "认证页面")
@@ -51,7 +55,7 @@ public class WifiInfo extends BaseEntity
     /** 数据采集时间 */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "数据采集时间", width = 30, dateFormat = "yyyy-MM-dd")
-    private Date TIME;
+    private Date time;
 
     public void setWifiInfoId(Long wifiInfoId) 
     {
@@ -62,12 +66,12 @@ public class WifiInfo extends BaseEntity
     {
         return wifiInfoId;
     }
-    public void setDeviceId(Long deviceId) 
+    public void setDeviceId(String deviceId) 
     {
         this.deviceId = deviceId;
     }
 
-    public Long getDeviceId() 
+    public String getDeviceId() 
     {
         return deviceId;
     }
@@ -80,23 +84,32 @@ public class WifiInfo extends BaseEntity
     {
         return venueId;
     }
-    public void setBSSID(String BSSID) 
+    public void setAreaId(Long areaId) 
+    {
+        this.areaId = areaId;
+    }
+
+    public Long getAreaId() 
+    {
+        return areaId;
+    }
+    public void setBssid(String bssid) 
     {
-        this.BSSID = BSSID;
+        this.bssid = bssid;
     }
 
-    public String getBSSID() 
+    public String getBssid() 
     {
-        return BSSID;
+        return bssid;
     }
-    public void setSSID(String SSID) 
+    public void setSsid(String ssid) 
     {
-        this.SSID = SSID;
+        this.ssid = ssid;
     }
 
-    public String getSSID() 
+    public String getSsid() 
     {
-        return SSID;
+        return ssid;
     }
     public void setAuthPage(String authPage) 
     {
@@ -125,14 +138,14 @@ public class WifiInfo extends BaseEntity
     {
         return keyType;
     }
-    public void setTIME(Date TIME) 
+    public void setTime(Date time) 
     {
-        this.TIME = TIME;
+        this.time = time;
     }
 
-    public Date getTIME() 
+    public Date getTime() 
     {
-        return TIME;
+        return time;
     }
 
     @Override
@@ -141,12 +154,13 @@ public class WifiInfo extends BaseEntity
             .append("wifiInfoId", getWifiInfoId())
             .append("deviceId", getDeviceId())
             .append("venueId", getVenueId())
-            .append("BSSID", getBSSID())
-            .append("SSID", getSSID())
+            .append("areaId", getAreaId())
+            .append("bssid", getBssid())
+            .append("ssid", getSsid())
             .append("authPage", getAuthPage())
             .append("isIllegal", getIsIllegal())
             .append("keyType", getKeyType())
-            .append("TIME", getTIME())
+            .append("time", getTime())
             .toString();
     }
 }

+ 134 - 0
dayun-admin/src/main/java/com/jjt/biz/vo/BluetoothInfoVO.java

@@ -0,0 +1,134 @@
+package com.jjt.biz.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jjt.common.annotation.Excel;
+import com.jjt.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.Date;
+
+/**
+ * 蓝牙信息对象 bluetooth_info
+ *
+ * @author ruoyi
+ * @date 2023-07-06
+ */
+public class BluetoothInfoVO {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 信息ID
+     */
+    private Long bInfoId;
+
+    /**
+     * 设备ID
+     */
+    private String deviceId;
+
+    /**
+     * 场馆ID
+     */
+    private String venueId;
+
+    /**
+     * MAC地址
+     */
+    private String mac;
+
+    /**
+     * 蓝牙名称
+     */
+    private String name;
+
+    /**
+     * 文件名
+     */
+    private String fileName;
+
+    /**
+     * 文件地址
+     */
+    private String filePath;
+
+    private Date time;
+
+    public void setbInfoId(Long bInfoId) {
+        this.bInfoId = bInfoId;
+    }
+
+    public Long getbInfoId() {
+        return bInfoId;
+    }
+
+    public void setDeviceId(String deviceId) {
+        this.deviceId = deviceId;
+    }
+
+    public String getDeviceId() {
+        return deviceId;
+    }
+
+    public void setVenueId(String venueId) {
+        this.venueId = venueId;
+    }
+
+    public String getVenueId() {
+        return venueId;
+    }
+
+
+    public void setMac(String mac) {
+        this.mac = mac;
+    }
+
+    public String getMac() {
+        return mac;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setFilePath(String filePath) {
+        this.filePath = filePath;
+    }
+
+    public String getFilePath() {
+        return filePath;
+    }
+
+    public void setTime(Date time) {
+        this.time = time;
+    }
+
+    public Date getTime() {
+        return time;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("bInfoId", getbInfoId())
+                .append("deviceId", getDeviceId())
+                .append("venueId", getVenueId())
+                .append("mac", getMac())
+                .append("name", getName())
+                .append("fileName", getFileName())
+                .append("time", getTime())
+                .toString();
+    }
+}

+ 64 - 0
dayun-admin/src/main/java/com/jjt/biz/vo/VenueAreaVO.java

@@ -0,0 +1,64 @@
+package com.jjt.biz.vo;
+
+import com.jjt.common.annotation.Excel;
+import com.jjt.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 场馆区域对象 venue_area
+ *
+ * @author ruoyi
+ * @date 2023-07-06
+ */
+public class VenueAreaVO {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 区域ID
+     */
+    private Long areaId;
+
+    /**
+     * 场馆ID
+     */
+    private Long venueId;
+
+    /**
+     * 区域名称
+     */
+    private String areaName;
+
+    public void setAreaId(Long areaId) {
+        this.areaId = areaId;
+    }
+
+    public Long getAreaId() {
+        return areaId;
+    }
+
+    public void setVenueId(Long venueId) {
+        this.venueId = venueId;
+    }
+
+    public Long getVenueId() {
+        return venueId;
+    }
+
+    public void setAreaName(String areaName) {
+        this.areaName = areaName;
+    }
+
+    public String getAreaName() {
+        return areaName;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("areaId", getAreaId())
+                .append("venueId", getVenueId())
+                .append("areaName", getAreaName())
+                .toString();
+    }
+}

+ 66 - 0
dayun-admin/src/main/java/com/jjt/biz/vo/VenueInfoVO.java

@@ -0,0 +1,66 @@
+package com.jjt.biz.vo;
+
+import com.jjt.common.annotation.Excel;
+import com.jjt.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.List;
+
+/**
+ * 场馆基本信息对象 venue_info
+ *
+ * @author ruoyi
+ * @date 2023-07-06
+ */
+public class VenueInfoVO {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 场馆ID
+     */
+    private Long venueId;
+
+    /**
+     * 场馆名称
+     */
+    private String venueName;
+
+    /**
+     * 场馆区域信息
+     */
+    private List<VenueAreaVO> area;
+
+    public void setVenueId(Long venueId) {
+        this.venueId = venueId;
+    }
+
+    public Long getVenueId() {
+        return venueId;
+    }
+
+    public void setVenueName(String venueName) {
+        this.venueName = venueName;
+    }
+
+    public String getVenueName() {
+        return venueName;
+    }
+
+
+    public List<VenueAreaVO> getArea() {
+        return area;
+    }
+
+    public void setArea(List<VenueAreaVO> area) {
+        this.area = area;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("venueId", getVenueId())
+                .append("venueName", getVenueName())
+                .toString();
+    }
+}

+ 120 - 0
dayun-admin/src/main/java/com/jjt/biz/vo/WifiInfoVO.java

@@ -0,0 +1,120 @@
+package com.jjt.biz.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jjt.common.annotation.Excel;
+import com.jjt.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.Date;
+
+/**
+ * WIFI信息对象 wifi_info
+ *
+ * @author ruoyi
+ * @date 2023-07-06
+ */
+public class WifiInfoVO {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 信息ID
+     */
+    private Long wifiInfoId;
+
+    /**
+     * 设备ID
+     */
+    private String deviceId;
+
+    /**
+     * 场馆ID
+     */
+    private String venueId;
+
+    /**
+     * MAC地址
+     */
+    private String bssid;
+
+    /**
+     * WIFI名称
+     */
+    private String ssid;
+
+    /**
+     * 认证页面
+     */
+    private String authPage;
+
+    private Date time;
+
+    public void setWifiInfoId(Long wifiInfoId) {
+        this.wifiInfoId = wifiInfoId;
+    }
+
+    public Long getWifiInfoId() {
+        return wifiInfoId;
+    }
+
+    public void setDeviceId(String deviceId) {
+        this.deviceId = deviceId;
+    }
+
+    public String getDeviceId() {
+        return deviceId;
+    }
+
+    public void setVenueId(String venueId) {
+        this.venueId = venueId;
+    }
+
+    public String getVenueId() {
+        return venueId;
+    }
+
+    public void setBssid(String bssid) {
+        this.bssid = bssid;
+    }
+
+    public String getBssid() {
+        return bssid;
+    }
+
+    public void setSsid(String ssid) {
+        this.ssid = ssid;
+    }
+
+    public String getSsid() {
+        return ssid;
+    }
+
+    public void setAuthPage(String authPage) {
+        this.authPage = authPage;
+    }
+
+    public String getAuthPage() {
+        return authPage;
+    }
+
+    public void setTime(Date time) {
+        this.time = time;
+    }
+
+    public Date getTime() {
+        return time;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("wifiInfoId", getWifiInfoId())
+                .append("deviceId", getDeviceId())
+                .append("venueId", getVenueId())
+                .append("BSSID", getBssid())
+                .append("SSID", getSsid())
+                .append("authPage", getAuthPage())
+                .append("time", getTime())
+                .toString();
+    }
+}

+ 22 - 17
dayun-admin/src/main/resources/mapper/biz/BluetoothInfoMapper.xml

@@ -8,31 +8,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="bInfoId"    column="B_INFO_ID"    />
         <result property="deviceId"    column="DEVICE_ID"    />
         <result property="venueId"    column="VENUE_ID"    />
-        <result property="MAC"    column="MAC"    />
-        <result property="NAME"    column="NAME"    />
+        <result property="areaId"    column="AREA_ID"    />
+        <result property="mac"    column="MAC"    />
+        <result property="name"    column="NAME"    />
         <result property="fileName"    column="FILE_NAME"    />
         <result property="filePath"    column="FILE_PATH"    />
         <result property="isIllegal"    column="IS_ILLEGAL"    />
         <result property="keyType"    column="KEY_TYPE"    />
-        <result property="TIME"    column="TIME"    />
+        <result property="time"    column="TIME"    />
     </resultMap>
 
     <sql id="selectBluetoothInfoVo">
-        select B_INFO_ID, DEVICE_ID, VENUE_ID, MAC, NAME, FILE_NAME, FILE_PATH, IS_ILLEGAL, KEY_TYPE, TIME from bluetooth_info
+        select B_INFO_ID, DEVICE_ID, VENUE_ID, AREA_ID, MAC, NAME, FILE_NAME, FILE_PATH, IS_ILLEGAL, KEY_TYPE, TIME from bluetooth_info
     </sql>
 
     <select id="selectBluetoothInfoList" parameterType="BluetoothInfo" resultMap="BluetoothInfoResult">
         <include refid="selectBluetoothInfoVo"/>
         <where>  
-            <if test="deviceId != null "> and DEVICE_ID = #{deviceId}</if>
+            <if test="deviceId != null  and deviceId != ''"> and DEVICE_ID = #{deviceId}</if>
             <if test="venueId != null "> and VENUE_ID = #{venueId}</if>
-            <if test="MAC != null  and MAC != ''"> and MAC like concat('%', #{MAC}, '%')</if>
-            <if test="NAME != null  and NAME != ''"> and NAME like concat('%', #{NAME}, '%')</if>
+            <if test="areaId != null "> and AREA_ID = #{areaId}</if>
+            <if test="mac != null  and mac != ''"> and MAC like concat('%', #{mac}, '%')</if>
+            <if test="name != null  and name != ''"> and NAME like concat('%', #{name}, '%')</if>
             <if test="fileName != null  and fileName != ''"> and FILE_NAME like concat('%', #{fileName}, '%')</if>
             <if test="filePath != null  and filePath != ''"> and FILE_PATH = #{filePath}</if>
             <if test="isIllegal != null  and isIllegal != ''"> and IS_ILLEGAL = #{isIllegal}</if>
             <if test="keyType != null  and keyType != ''"> and KEY_TYPE like concat('%', #{keyType}, '%')</if>
-            <if test="TIME != null "> and TIME = #{TIME}</if>
+            <if test="time != null "> and TIME = #{time}</if>
         </where>
     </select>
     
@@ -46,24 +48,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="deviceId != null">DEVICE_ID,</if>
             <if test="venueId != null">VENUE_ID,</if>
-            <if test="MAC != null and MAC != ''">MAC,</if>
-            <if test="NAME != null">NAME,</if>
+            <if test="areaId != null">AREA_ID,</if>
+            <if test="mac != null and mac != ''">MAC,</if>
+            <if test="name != null">NAME,</if>
             <if test="fileName != null">FILE_NAME,</if>
             <if test="filePath != null">FILE_PATH,</if>
             <if test="isIllegal != null">IS_ILLEGAL,</if>
             <if test="keyType != null">KEY_TYPE,</if>
-            <if test="TIME != null">TIME,</if>
+            <if test="time != null">TIME,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="deviceId != null">#{deviceId},</if>
             <if test="venueId != null">#{venueId},</if>
-            <if test="MAC != null and MAC != ''">#{MAC},</if>
-            <if test="NAME != null">#{NAME},</if>
+            <if test="areaId != null">#{areaId},</if>
+            <if test="mac != null and mac != ''">#{mac},</if>
+            <if test="name != null">#{name},</if>
             <if test="fileName != null">#{fileName},</if>
             <if test="filePath != null">#{filePath},</if>
             <if test="isIllegal != null">#{isIllegal},</if>
             <if test="keyType != null">#{keyType},</if>
-            <if test="TIME != null">#{TIME},</if>
+            <if test="time != null">#{time},</if>
          </trim>
     </insert>
 
@@ -72,13 +76,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="SET" suffixOverrides=",">
             <if test="deviceId != null">DEVICE_ID = #{deviceId},</if>
             <if test="venueId != null">VENUE_ID = #{venueId},</if>
-            <if test="MAC != null and MAC != ''">MAC = #{MAC},</if>
-            <if test="NAME != null">NAME = #{NAME},</if>
+            <if test="areaId != null">AREA_ID = #{areaId},</if>
+            <if test="mac != null and mac != ''">MAC = #{mac},</if>
+            <if test="name != null">NAME = #{name},</if>
             <if test="fileName != null">FILE_NAME = #{fileName},</if>
             <if test="filePath != null">FILE_PATH = #{filePath},</if>
             <if test="isIllegal != null">IS_ILLEGAL = #{isIllegal},</if>
             <if test="keyType != null">KEY_TYPE = #{keyType},</if>
-            <if test="TIME != null">TIME = #{TIME},</if>
+            <if test="time != null">TIME = #{time},</if>
         </trim>
         where B_INFO_ID = #{bInfoId}
     </update>

+ 22 - 17
dayun-admin/src/main/resources/mapper/biz/WifiInfoMapper.xml

@@ -8,29 +8,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="wifiInfoId"    column="WIFI_INFO_ID"    />
         <result property="deviceId"    column="DEVICE_ID"    />
         <result property="venueId"    column="VENUE_ID"    />
-        <result property="BSSID"    column="BSSID"    />
-        <result property="SSID"    column="SSID"    />
+        <result property="areaId"    column="AREA_ID"    />
+        <result property="bssid"    column="BSSID"    />
+        <result property="ssid"    column="SSID"    />
         <result property="authPage"    column="AUTH_PAGE"    />
         <result property="isIllegal"    column="IS_ILLEGAL"    />
         <result property="keyType"    column="KEY_TYPE"    />
-        <result property="TIME"    column="TIME"    />
+        <result property="time"    column="TIME"    />
     </resultMap>
 
     <sql id="selectWifiInfoVo">
-        select WIFI_INFO_ID, DEVICE_ID, VENUE_ID, BSSID, SSID, AUTH_PAGE, IS_ILLEGAL, KEY_TYPE, TIME from wifi_info
+        select WIFI_INFO_ID, DEVICE_ID, VENUE_ID, AREA_ID, BSSID, SSID, AUTH_PAGE, IS_ILLEGAL, KEY_TYPE, TIME from wifi_info
     </sql>
 
     <select id="selectWifiInfoList" parameterType="WifiInfo" resultMap="WifiInfoResult">
         <include refid="selectWifiInfoVo"/>
         <where>  
-            <if test="deviceId != null "> and DEVICE_ID = #{deviceId}</if>
+            <if test="deviceId != null  and deviceId != ''"> and DEVICE_ID = #{deviceId}</if>
             <if test="venueId != null "> and VENUE_ID = #{venueId}</if>
-            <if test="BSSID != null  and BSSID != ''"> and BSSID like concat('%', #{BSSID}, '%')</if>
-            <if test="SSID != null  and SSID != ''"> and SSID like concat('%', #{SSID}, '%')</if>
+            <if test="areaId != null "> and AREA_ID = #{areaId}</if>
+            <if test="bssid != null  and bssid != ''"> and BSSID like concat('%', #{bssid}, '%')</if>
+            <if test="ssid != null  and ssid != ''"> and SSID like concat('%', #{ssid}, '%')</if>
             <if test="authPage != null  and authPage != ''"> and AUTH_PAGE like concat('%', #{authPage}, '%')</if>
             <if test="isIllegal != null  and isIllegal != ''"> and IS_ILLEGAL = #{isIllegal}</if>
             <if test="keyType != null  and keyType != ''"> and KEY_TYPE = #{keyType}</if>
-            <if test="TIME != null "> and TIME = #{TIME}</if>
+            <if test="time != null "> and TIME = #{time}</if>
         </where>
     </select>
     
@@ -44,22 +46,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="deviceId != null">DEVICE_ID,</if>
             <if test="venueId != null">VENUE_ID,</if>
-            <if test="BSSID != null">BSSID,</if>
-            <if test="SSID != null">SSID,</if>
+            <if test="areaId != null">AREA_ID,</if>
+            <if test="bssid != null">BSSID,</if>
+            <if test="ssid != null">SSID,</if>
             <if test="authPage != null">AUTH_PAGE,</if>
             <if test="isIllegal != null">IS_ILLEGAL,</if>
             <if test="keyType != null">KEY_TYPE,</if>
-            <if test="TIME != null">TIME,</if>
+            <if test="time != null">TIME,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="deviceId != null">#{deviceId},</if>
             <if test="venueId != null">#{venueId},</if>
-            <if test="BSSID != null">#{BSSID},</if>
-            <if test="SSID != null">#{SSID},</if>
+            <if test="areaId != null">#{areaId},</if>
+            <if test="bssid != null">#{bssid},</if>
+            <if test="ssid != null">#{ssid},</if>
             <if test="authPage != null">#{authPage},</if>
             <if test="isIllegal != null">#{isIllegal},</if>
             <if test="keyType != null">#{keyType},</if>
-            <if test="TIME != null">#{TIME},</if>
+            <if test="time != null">#{time},</if>
          </trim>
     </insert>
 
@@ -68,12 +72,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="SET" suffixOverrides=",">
             <if test="deviceId != null">DEVICE_ID = #{deviceId},</if>
             <if test="venueId != null">VENUE_ID = #{venueId},</if>
-            <if test="BSSID != null">BSSID = #{BSSID},</if>
-            <if test="SSID != null">SSID = #{SSID},</if>
+            <if test="areaId != null">AREA_ID = #{areaId},</if>
+            <if test="bssid != null">BSSID = #{bssid},</if>
+            <if test="ssid != null">SSID = #{ssid},</if>
             <if test="authPage != null">AUTH_PAGE = #{authPage},</if>
             <if test="isIllegal != null">IS_ILLEGAL = #{isIllegal},</if>
             <if test="keyType != null">KEY_TYPE = #{keyType},</if>
-            <if test="TIME != null">TIME = #{TIME},</if>
+            <if test="time != null">TIME = #{time},</if>
         </trim>
         where WIFI_INFO_ID = #{wifiInfoId}
     </update>

+ 223 - 0
dayun-admin/src/test/java/Test.java

@@ -0,0 +1,223 @@
+import com.jjt.common.utils.sign.Base64;
+
+import java.nio.charset.StandardCharsets;
+
+public class Test {
+    public static void main(String[] args) {
+        String yy = Base64.encode(xx.getBytes(StandardCharsets.UTF_8));
+        System.err.println(yy);
+
+        String zz = new String(Base64.decode(yy), StandardCharsets.UTF_8);
+        System.err.println(zz);
+    }
+
+    static String xx = "<!DOCTYPE html>\n" +
+            "<html>\n" +
+            "  <head>\n" +
+            "    <meta charset=\"utf-8\">\n" +
+            "    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\n" +
+            "    <meta name=\"renderer\" content=\"webkit\">\n" +
+            "    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no\">\n" +
+            "    <link rel=\"icon\" href=\"<%= BASE_URL %>favicon.ico\">\n" +
+            "    <title><%= webpackConfig.name %></title>\n" +
+            "    <!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->\n" +
+            "\t  <style>\n" +
+            "    html,\n" +
+            "    body,\n" +
+            "    #app {\n" +
+            "      height: 100%;\n" +
+            "      margin: 0px;\n" +
+            "      padding: 0px;\n" +
+            "    }\n" +
+            "    .chromeframe {\n" +
+            "      margin: 0.2em 0;\n" +
+            "      background: #ccc;\n" +
+            "      color: #000;\n" +
+            "      padding: 0.2em 0;\n" +
+            "    }\n" +
+            "\n" +
+            "    #loader-wrapper {\n" +
+            "      position: fixed;\n" +
+            "      top: 0;\n" +
+            "      left: 0;\n" +
+            "      width: 100%;\n" +
+            "      height: 100%;\n" +
+            "      z-index: 999999;\n" +
+            "    }\n" +
+            "\n" +
+            "    #loader {\n" +
+            "      display: block;\n" +
+            "      position: relative;\n" +
+            "      left: 50%;\n" +
+            "      top: 50%;\n" +
+            "      width: 150px;\n" +
+            "      height: 150px;\n" +
+            "      margin: -75px 0 0 -75px;\n" +
+            "      border-radius: 50%;\n" +
+            "      border: 3px solid transparent;\n" +
+            "      border-top-color: #FFF;\n" +
+            "      -webkit-animation: spin 2s linear infinite;\n" +
+            "      -ms-animation: spin 2s linear infinite;\n" +
+            "      -moz-animation: spin 2s linear infinite;\n" +
+            "      -o-animation: spin 2s linear infinite;\n" +
+            "      animation: spin 2s linear infinite;\n" +
+            "      z-index: 1001;\n" +
+            "    }\n" +
+            "\n" +
+            "    #loader:before {\n" +
+            "      content: \"\";\n" +
+            "      position: absolute;\n" +
+            "      top: 5px;\n" +
+            "      left: 5px;\n" +
+            "      right: 5px;\n" +
+            "      bottom: 5px;\n" +
+            "      border-radius: 50%;\n" +
+            "      border: 3px solid transparent;\n" +
+            "      border-top-color: #FFF;\n" +
+            "      -webkit-animation: spin 3s linear infinite;\n" +
+            "      -moz-animation: spin 3s linear infinite;\n" +
+            "      -o-animation: spin 3s linear infinite;\n" +
+            "      -ms-animation: spin 3s linear infinite;\n" +
+            "      animation: spin 3s linear infinite;\n" +
+            "    }\n" +
+            "\n" +
+            "    #loader:after {\n" +
+            "      content: \"\";\n" +
+            "      position: absolute;\n" +
+            "      top: 15px;\n" +
+            "      left: 15px;\n" +
+            "      right: 15px;\n" +
+            "      bottom: 15px;\n" +
+            "      border-radius: 50%;\n" +
+            "      border: 3px solid transparent;\n" +
+            "      border-top-color: #FFF;\n" +
+            "      -moz-animation: spin 1.5s linear infinite;\n" +
+            "      -o-animation: spin 1.5s linear infinite;\n" +
+            "      -ms-animation: spin 1.5s linear infinite;\n" +
+            "      -webkit-animation: spin 1.5s linear infinite;\n" +
+            "      animation: spin 1.5s linear infinite;\n" +
+            "    }\n" +
+            "\n" +
+            "\n" +
+            "    @-webkit-keyframes spin {\n" +
+            "      0% {\n" +
+            "        -webkit-transform: rotate(0deg);\n" +
+            "        -ms-transform: rotate(0deg);\n" +
+            "        transform: rotate(0deg);\n" +
+            "      }\n" +
+            "      100% {\n" +
+            "        -webkit-transform: rotate(360deg);\n" +
+            "        -ms-transform: rotate(360deg);\n" +
+            "        transform: rotate(360deg);\n" +
+            "      }\n" +
+            "    }\n" +
+            "\n" +
+            "    @keyframes spin {\n" +
+            "      0% {\n" +
+            "        -webkit-transform: rotate(0deg);\n" +
+            "        -ms-transform: rotate(0deg);\n" +
+            "        transform: rotate(0deg);\n" +
+            "      }\n" +
+            "      100% {\n" +
+            "        -webkit-transform: rotate(360deg);\n" +
+            "        -ms-transform: rotate(360deg);\n" +
+            "        transform: rotate(360deg);\n" +
+            "      }\n" +
+            "    }\n" +
+            "\n" +
+            "\n" +
+            "    #loader-wrapper .loader-section {\n" +
+            "      position: fixed;\n" +
+            "      top: 0;\n" +
+            "      width: 51%;\n" +
+            "      height: 100%;\n" +
+            "      background: #7171C6;\n" +
+            "      z-index: 1000;\n" +
+            "      -webkit-transform: translateX(0);\n" +
+            "      -ms-transform: translateX(0);\n" +
+            "      transform: translateX(0);\n" +
+            "    }\n" +
+            "\n" +
+            "    #loader-wrapper .loader-section.section-left {\n" +
+            "      left: 0;\n" +
+            "    }\n" +
+            "\n" +
+            "    #loader-wrapper .loader-section.section-right {\n" +
+            "      right: 0;\n" +
+            "    }\n" +
+            "\n" +
+            "\n" +
+            "    .loaded #loader-wrapper .loader-section.section-left {\n" +
+            "      -webkit-transform: translateX(-100%);\n" +
+            "      -ms-transform: translateX(-100%);\n" +
+            "      transform: translateX(-100%);\n" +
+            "      -webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);\n" +
+            "      transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);\n" +
+            "    }\n" +
+            "\n" +
+            "    .loaded #loader-wrapper .loader-section.section-right {\n" +
+            "      -webkit-transform: translateX(100%);\n" +
+            "      -ms-transform: translateX(100%);\n" +
+            "      transform: translateX(100%);\n" +
+            "      -webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);\n" +
+            "      transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);\n" +
+            "    }\n" +
+            "\n" +
+            "    .loaded #loader {\n" +
+            "      opacity: 0;\n" +
+            "      -webkit-transition: all 0.3s ease-out;\n" +
+            "      transition: all 0.3s ease-out;\n" +
+            "    }\n" +
+            "\n" +
+            "    .loaded #loader-wrapper {\n" +
+            "      visibility: hidden;\n" +
+            "      -webkit-transform: translateY(-100%);\n" +
+            "      -ms-transform: translateY(-100%);\n" +
+            "      transform: translateY(-100%);\n" +
+            "      -webkit-transition: all 0.3s 1s ease-out;\n" +
+            "      transition: all 0.3s 1s ease-out;\n" +
+            "    }\n" +
+            "\n" +
+            "    .no-js #loader-wrapper {\n" +
+            "      display: none;\n" +
+            "    }\n" +
+            "\n" +
+            "    .no-js h1 {\n" +
+            "      color: #222222;\n" +
+            "    }\n" +
+            "\n" +
+            "    #loader-wrapper .load_title {\n" +
+            "      font-family: 'Open Sans';\n" +
+            "      color: #FFF;\n" +
+            "      font-size: 19px;\n" +
+            "      width: 100%;\n" +
+            "      text-align: center;\n" +
+            "      z-index: 9999999999999;\n" +
+            "      position: absolute;\n" +
+            "      top: 60%;\n" +
+            "      opacity: 1;\n" +
+            "      line-height: 30px;\n" +
+            "    }\n" +
+            "\n" +
+            "    #loader-wrapper .load_title span {\n" +
+            "      font-weight: normal;\n" +
+            "      font-style: italic;\n" +
+            "      font-size: 13px;\n" +
+            "      color: #FFF;\n" +
+            "      opacity: 0.5;\n" +
+            "    }\n" +
+            "  </style>\n" +
+            "  </head>\n" +
+            "  <body>\n" +
+            "    <div id=\"app\">\n" +
+            "\t    <div id=\"loader-wrapper\">\n" +
+            "\t\t    <div id=\"loader\"></div>\n" +
+            "\t\t    <div class=\"loader-section section-left\"></div>\n" +
+            "\t\t    <div class=\"loader-section section-right\"></div>\n" +
+            "\t\t    <div class=\"load_title\">正在加载系统资源,请耐心等待</div>\n" +
+            "        </div>\n" +
+            "\t</div>\n" +
+            "  </body>\n" +
+            "</html>\n";
+
+}

+ 2 - 2
dayun-common/src/main/java/com/jjt/common/utils/file/FileUploadUtils.java

@@ -107,8 +107,8 @@ public class FileUploadUtils
         {
             throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
         }
-
-        assertAllowed(file, allowedExtension);
+        //暂时不校验文件类型
+        //assertAllowed(file, allowedExtension);
 
         String fileName = extractFilename(file);