|
@@ -2,21 +2,20 @@ package com.jjt.biz.controller;
|
|
|
|
|
|
|
|
import com.jjt.biz.domain.*;
|
|
import com.jjt.biz.domain.*;
|
|
|
import com.jjt.biz.service.*;
|
|
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.biz.vo.*;
|
|
|
import com.jjt.common.annotation.Log;
|
|
import com.jjt.common.annotation.Log;
|
|
|
import com.jjt.common.config.RuoYiConfig;
|
|
import com.jjt.common.config.RuoYiConfig;
|
|
|
import com.jjt.common.core.controller.BaseController;
|
|
import com.jjt.common.core.controller.BaseController;
|
|
|
import com.jjt.common.core.domain.AjaxResult;
|
|
import com.jjt.common.core.domain.AjaxResult;
|
|
|
import com.jjt.common.core.page.TableDataInfo;
|
|
import com.jjt.common.core.page.TableDataInfo;
|
|
|
|
|
+import com.jjt.common.core.redis.RedisCache;
|
|
|
import com.jjt.common.enums.BusinessType;
|
|
import com.jjt.common.enums.BusinessType;
|
|
|
import com.jjt.common.utils.StringUtils;
|
|
import com.jjt.common.utils.StringUtils;
|
|
|
import com.jjt.common.utils.file.FileUploadUtils;
|
|
import com.jjt.common.utils.file.FileUploadUtils;
|
|
|
import com.jjt.common.utils.file.FileUtils;
|
|
import com.jjt.common.utils.file.FileUtils;
|
|
|
import com.jjt.common.utils.poi.ExcelUtil;
|
|
import com.jjt.common.utils.poi.ExcelUtil;
|
|
|
import com.jjt.common.utils.sign.Base64;
|
|
import com.jjt.common.utils.sign.Base64;
|
|
|
|
|
+import com.jjt.common.utils.spring.SpringUtils;
|
|
|
import com.jjt.framework.config.ServerConfig;
|
|
import com.jjt.framework.config.ServerConfig;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -28,6 +27,7 @@ import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
import java.nio.charset.StandardCharsets;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
@@ -52,6 +52,8 @@ public class ApiController extends BaseController {
|
|
|
private IVenueAreaService areaService;
|
|
private IVenueAreaService areaService;
|
|
|
@Resource
|
|
@Resource
|
|
|
private ServerConfig serverConfig;
|
|
private ServerConfig serverConfig;
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private IKeyInfoService keyInfoService;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 设备注册接口
|
|
* 设备注册接口
|
|
@@ -67,39 +69,72 @@ public class ApiController extends BaseController {
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/wifi")
|
|
@PostMapping("/wifi")
|
|
|
public AjaxResult wifi(@RequestBody List<WifiInfoVO> infoList) {
|
|
public AjaxResult wifi(@RequestBody List<WifiInfoVO> infoList) {
|
|
|
|
|
+ keyInfoList = keyInfoService.selectKeyInfoList(new KeyInfo());
|
|
|
infoList.forEach(vo -> {
|
|
infoList.forEach(vo -> {
|
|
|
WifiInfo info = new WifiInfo();
|
|
WifiInfo info = new WifiInfo();
|
|
|
info.setDeviceId(vo.getDeviceId());
|
|
info.setDeviceId(vo.getDeviceId());
|
|
|
String[] vaId = vo.getVenueId().split("-");
|
|
String[] vaId = vo.getVenueId().split("-");
|
|
|
Long vId = Long.parseLong(vaId[0]);
|
|
Long vId = Long.parseLong(vaId[0]);
|
|
|
info.setVenueId(vId);
|
|
info.setVenueId(vId);
|
|
|
|
|
+ info.setIsIllegal("N");
|
|
|
if (vaId.length > 1) {
|
|
if (vaId.length > 1) {
|
|
|
Long aId = Long.parseLong(vaId[1]);
|
|
Long aId = Long.parseLong(vaId[1]);
|
|
|
info.setAreaId(aId);
|
|
info.setAreaId(aId);
|
|
|
}
|
|
}
|
|
|
if (StringUtils.isNotEmpty(vo.getAuthPage())) {
|
|
if (StringUtils.isNotEmpty(vo.getAuthPage())) {
|
|
|
String page = new String(Base64.decode(vo.getAuthPage()), StandardCharsets.UTF_8);
|
|
String page = new String(Base64.decode(vo.getAuthPage()), StandardCharsets.UTF_8);
|
|
|
|
|
+ IllegalVO illegal = isIllegal(page);
|
|
|
|
|
+ if (illegal.isIllegal()) {
|
|
|
|
|
+ info.setIsIllegal("Y");
|
|
|
|
|
+ info.setKeyType(illegal.getKeyType());
|
|
|
|
|
+ }
|
|
|
|
|
+ isIllegal(vo.getSsid());
|
|
|
info.setAuthPage(page);
|
|
info.setAuthPage(page);
|
|
|
}
|
|
}
|
|
|
info.setBssid(vo.getBssid());
|
|
info.setBssid(vo.getBssid());
|
|
|
info.setSsid(vo.getSsid());
|
|
info.setSsid(vo.getSsid());
|
|
|
info.setTime(vo.getTime());
|
|
info.setTime(vo.getTime());
|
|
|
|
|
+ IllegalVO illegal = isIllegal(vo.getSsid());
|
|
|
|
|
+ if (illegal.isIllegal()) {
|
|
|
|
|
+ info.setIsIllegal("Y");
|
|
|
|
|
+ info.setKeyType(illegal.getKeyType());
|
|
|
|
|
+ }
|
|
|
wifiInfoService.insertWifiInfo(info);
|
|
wifiInfoService.insertWifiInfo(info);
|
|
|
});
|
|
});
|
|
|
return AjaxResult.success();
|
|
return AjaxResult.success();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private List<KeyInfo> keyInfoList;
|
|
|
|
|
+
|
|
|
|
|
+ private IllegalVO isIllegal(String content) {
|
|
|
|
|
+ IllegalVO result = new IllegalVO();
|
|
|
|
|
+ result.setIllegal(false);
|
|
|
|
|
+ for (KeyInfo keyInfo : keyInfoList) {
|
|
|
|
|
+ String[] keys = keyInfo.getKeyWords().split(",");
|
|
|
|
|
+ for (String key : keys) {
|
|
|
|
|
+ if (content.contains(key)) {
|
|
|
|
|
+ result.setIllegal(true);
|
|
|
|
|
+ result.setKeyType(keyInfo.getKeyType());
|
|
|
|
|
+ return result;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return result;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 蓝牙上传
|
|
* 蓝牙上传
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/bluetooth")
|
|
@PostMapping("/bluetooth")
|
|
|
public AjaxResult bluetooth(@RequestBody List<BluetoothInfoVO> infoList) {
|
|
public AjaxResult bluetooth(@RequestBody List<BluetoothInfoVO> infoList) {
|
|
|
|
|
+ keyInfoList = keyInfoService.selectKeyInfoList(new KeyInfo());
|
|
|
infoList.forEach(vo -> {
|
|
infoList.forEach(vo -> {
|
|
|
BluetoothInfo info = new BluetoothInfo();
|
|
BluetoothInfo info = new BluetoothInfo();
|
|
|
info.setDeviceId(vo.getDeviceId());
|
|
info.setDeviceId(vo.getDeviceId());
|
|
|
String[] vaId = vo.getVenueId().split("-");
|
|
String[] vaId = vo.getVenueId().split("-");
|
|
|
Long vId = Long.parseLong(vaId[0]);
|
|
Long vId = Long.parseLong(vaId[0]);
|
|
|
info.setVenueId(vId);
|
|
info.setVenueId(vId);
|
|
|
|
|
+ info.setIsIllegal("N");
|
|
|
if (vaId.length > 1) {
|
|
if (vaId.length > 1) {
|
|
|
Long aId = Long.parseLong(vaId[1]);
|
|
Long aId = Long.parseLong(vaId[1]);
|
|
|
info.setAreaId(aId);
|
|
info.setAreaId(aId);
|
|
@@ -109,6 +144,17 @@ public class ApiController extends BaseController {
|
|
|
info.setFileName(vo.getFileName());
|
|
info.setFileName(vo.getFileName());
|
|
|
info.setFilePath(vo.getFilePath());
|
|
info.setFilePath(vo.getFilePath());
|
|
|
info.setTime(vo.getTime());
|
|
info.setTime(vo.getTime());
|
|
|
|
|
+
|
|
|
|
|
+ IllegalVO illegal = isIllegal(vo.getName());
|
|
|
|
|
+ if (illegal.isIllegal()) {
|
|
|
|
|
+ info.setIsIllegal("Y");
|
|
|
|
|
+ info.setKeyType(illegal.getKeyType());
|
|
|
|
|
+ }
|
|
|
|
|
+ illegal = isIllegal(vo.getFileName());
|
|
|
|
|
+ if (illegal.isIllegal()) {
|
|
|
|
|
+ info.setIsIllegal("Y");
|
|
|
|
|
+ info.setKeyType(illegal.getKeyType());
|
|
|
|
|
+ }
|
|
|
bluetoothInfoService.insertBluetoothInfo(info);
|
|
bluetoothInfoService.insertBluetoothInfo(info);
|
|
|
});
|
|
});
|
|
|
return AjaxResult.success();
|
|
return AjaxResult.success();
|
|
@@ -161,4 +207,37 @@ public class ApiController extends BaseController {
|
|
|
}
|
|
}
|
|
|
return getDataTable(result);
|
|
return getDataTable(result);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取场馆信息
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/venueA")
|
|
|
|
|
+ public TableDataInfo venueA() {
|
|
|
|
|
+ List<VenueInfo> list = venueInfoService.selectVenueInfoList(null);
|
|
|
|
|
+ List<VenueInfoAVO> result = new ArrayList<>();
|
|
|
|
|
+ VenueArea area = new VenueArea();
|
|
|
|
|
+ for (VenueInfo info : list) {
|
|
|
|
|
+ area.setVenueId(info.getVenueId());
|
|
|
|
|
+ List<VenueArea> areaList = areaService.selectVenueAreaList(area);
|
|
|
|
|
+ if (areaList.size() > 0) {
|
|
|
|
|
+ areaList.forEach(bean -> {
|
|
|
|
|
+ VenueInfoAVO vo = new VenueInfoAVO();
|
|
|
|
|
+ String id = info.getVenueId() + "-" + bean.getAreaId();
|
|
|
|
|
+ String name = info.getVenueName() + "-" + bean.getAreaName();
|
|
|
|
|
+ vo.setVenueId(id);
|
|
|
|
|
+ vo.setVenueName(name);
|
|
|
|
|
+ result.add(vo);
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ VenueInfoAVO vo = new VenueInfoAVO();
|
|
|
|
|
+ String id = info.getVenueId() + "";
|
|
|
|
|
+ String name = info.getVenueName();
|
|
|
|
|
+ vo.setVenueId(id);
|
|
|
|
|
+ vo.setVenueName(name);
|
|
|
|
|
+ result.add(vo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ return getDataTable(result);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|