diff --git a/pom.xml b/pom.xml
index a1dba4e..76aa5dc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,11 +24,6 @@
spring-boot-starter-web
- mysql
- mysql-connector-java
- 8.0.15
-
-
org.springframework.boot
spring-boot-starter-test
test
@@ -57,13 +52,6 @@
spring-boot-starter-data-redis
-
-
-
- com.alibaba
- druid-spring-boot-starter
- 1.1.10
-
io.jsonwebtoken
@@ -101,16 +89,6 @@
4.5.7
- com.github.pagehelper
- pagehelper-spring-boot-autoconfigure
- 1.2.9
-
-
- com.github.pagehelper
- pagehelper
- 5.0.0
-
-
org.springframework.boot
spring-boot-starter-data-mongodb
@@ -121,22 +99,12 @@
2.1.5.RELEASE
- org.mybatis.spring.boot
- mybatis-spring-boot-starter
- 1.2.0
-
-
commons-net
commons-net
3.6
- org.mybatis
- mybatis
- 3.4.6
-
-
org.apache.commons
commons-lang3
3.8.1
diff --git a/src/main/java/com/objecteye/VehicleApplication.java b/src/main/java/com/objecteye/VehicleApplication.java
index 58f09f1..806e1e9 100644
--- a/src/main/java/com/objecteye/VehicleApplication.java
+++ b/src/main/java/com/objecteye/VehicleApplication.java
@@ -1,6 +1,5 @@
package com.objecteye;
-import com.objecteye.handle.Ftp2Mongo;
import com.objecteye.websocket.SelectMongoData;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -26,10 +25,6 @@ public class VehicleApplication {
//存储系统开始运行时间
SelectMongoData selectMongoData = run.getBean(SelectMongoData.class);
selectMongoData.setSystemStartTime();
-
- Ftp2Mongo bean = run.getBean(Ftp2Mongo.class);
- bean.downloadFile();
-
}
@Bean
diff --git a/src/main/java/com/objecteye/common/CommonPage.java b/src/main/java/com/objecteye/common/CommonPage.java
deleted file mode 100644
index 074d31d..0000000
--- a/src/main/java/com/objecteye/common/CommonPage.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package com.objecteye.common;
-
-import com.github.pagehelper.PageInfo;
-import org.springframework.data.domain.Page;
-
-import java.util.List;
-
-/**
- * 分页数据封装类
- */
-public class CommonPage {
- private Integer pageNum;
- private Integer pageSize;
- private Integer totalPage;
- private Long total;
- private List list;
-
- /**
- * 将PageHelper分页后的list转为分页信息
- */
- public static CommonPage restPage(List list) {
- CommonPage result = new CommonPage();
- PageInfo pageInfo = new PageInfo(list);
- result.setTotalPage(pageInfo.getPages());
- result.setPageNum(pageInfo.getPageNum());
- result.setPageSize(pageInfo.getPageSize());
- result.setTotal(pageInfo.getTotal());
- result.setList(pageInfo.getList());
- return result;
- }
-
- /**
- * 将SpringData分页后的list转为分页信息
- */
- public static CommonPage restPage(Page pageInfo) {
- CommonPage result = new CommonPage();
- result.setTotalPage(pageInfo.getTotalPages());
- result.setPageNum(pageInfo.getNumber());
- result.setPageSize(pageInfo.getSize());
- result.setTotal(pageInfo.getTotalElements());
- result.setList(pageInfo.getContent());
- return result;
- }
-
- public Integer getPageNum() {
- return pageNum;
- }
-
- public void setPageNum(Integer pageNum) {
- this.pageNum = pageNum;
- }
-
- public Integer getPageSize() {
- return pageSize;
- }
-
- public void setPageSize(Integer pageSize) {
- this.pageSize = pageSize;
- }
-
- public Integer getTotalPage() {
- return totalPage;
- }
-
- public void setTotalPage(Integer totalPage) {
- this.totalPage = totalPage;
- }
-
- public List getList() {
- return list;
- }
-
- public void setList(List list) {
- this.list = list;
- }
-
- public Long getTotal() {
- return total;
- }
-
- public void setTotal(Long total) {
- this.total = total;
- }
-}
diff --git a/src/main/java/com/objecteye/component/ParamInterceptor.java b/src/main/java/com/objecteye/component/ParamInterceptor.java
deleted file mode 100644
index d6ea525..0000000
--- a/src/main/java/com/objecteye/component/ParamInterceptor.java
+++ /dev/null
@@ -1,74 +0,0 @@
-
-package com.objecteye.component;
-
-/*@Component
-public class ParamInterceptor implements HandlerInterceptor {
-
- @Autowired
- private JwtTokenUtil jwtTokenUtil;
- @Autowired
- private UserService userService;
-
-
- @Override
- public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
-
- String token = request.getHeader("token");
- if (!(handler instanceof HandlerMethod)) {
- return true;
- }
- if (token == null || token.equals("")) {
- printJson(response, "");
- return false;
- }
- String userName = jwtTokenUtil.getUserNameFromToken(token);
- SyUser user = userService.getAdminByUsername(userName);
- if (user == null) {
- printJson(response, "");
- return false;
- }
-
- *//*String userId = user.getId();
- User sqlUser = getUserService().getUserById(userId);
- String enterpriseId = getUserEnterpriseService().selectEnterpriseByUser(userId);
- if (enterpriseId == null) {
- getRedisService().set(REDIS_USER_SESSION_KEY + ":" + token, sqlUser, SSO_SESSION_EXPIRE);
- return true;
- }
- Enterprise sqlEnterprise = getEnterpriseService().selectEnterpriseById(enterpriseId);
- getRedisService().set(REDIS_USER_SESSION_KEY + ":" + token, sqlUser, SSO_SESSION_EXPIRE);
- getRedisService().set(REDIS_ENTERPRISE_SESSION_KEY + ":" + token, sqlEnterprise, SSO_SESSION_EXPIRE);*//*
-
- return true;
- }
-
- @Override
- public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
-
- }
-
- @Override
- public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
-
-
- }
- private static void printJson(HttpServletResponse response, String code) {
- printContent(response, "token过期,请重新登陆");
- }
-
-
- private static void printContent(HttpServletResponse response, String content) {
- try {
- response.reset();
- response.setContentType("application/json");
- response.setHeader("Cache-Control", "no-store");
- response.setCharacterEncoding("UTF-8");
- PrintWriter pw = response.getWriter();
- pw.write(content);
- pw.flush();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}*/
-
diff --git a/src/main/java/com/objecteye/config/MyBatisConfig.java b/src/main/java/com/objecteye/config/MyBatisConfig.java
deleted file mode 100644
index 902ff57..0000000
--- a/src/main/java/com/objecteye/config/MyBatisConfig.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.objecteye.config;
-
-import org.mybatis.spring.annotation.MapperScan;
-import org.springframework.context.annotation.Configuration;
-
-@Configuration
-@MapperScan({"com.objecteye.mapper"})
-public class MyBatisConfig {
-
-}
diff --git a/src/main/java/com/objecteye/controller/AreaEquipmentController.java b/src/main/java/com/objecteye/controller/AreaEquipmentController.java
deleted file mode 100644
index 9246a22..0000000
--- a/src/main/java/com/objecteye/controller/AreaEquipmentController.java
+++ /dev/null
@@ -1,155 +0,0 @@
-package com.objecteye.controller;
-
-
-import com.objecteye.common.CommonResult;
-import com.objecteye.entity.SyAreaEquipment;
-import com.objecteye.service.AreaEquipmentService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * controller
- *
- * @author Administrator
- */
-@RestController
-@Api(tags = "AreaEquipmentController", description = "区域设备管理")
-@RequestMapping("/areaEquipment")
-@CrossOrigin
-public class AreaEquipmentController {
-
- @Autowired
- private AreaEquipmentService areaEquipmentService;
-
- /**
- * 返回全部列表
- *
- * @return
- */
- @ApiOperation("区域设备树的展示==区域可操作")
- @RequestMapping(value = "/findAll", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
- public CommonResult findAll() {
- if (areaEquipmentService.findAll() == null) {
- return CommonResult.success("", "无符合条件的数据");
- }
- return CommonResult.success(areaEquipmentService.findAll());
- }
-
- /**
- * 返回全部列表
- *
- * @return
- */
- @ApiOperation("区域设备树的展示==区域设备可操作")
- @RequestMapping(value = "/findAllEquipAndArea", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
- public CommonResult findAllEquipAndArea() {
- if (areaEquipmentService.findAllEquipAndArea() == null) {
- return CommonResult.success("", "无符合条件的数据");
- }
- return CommonResult.success(areaEquipmentService.findAllEquipAndArea());
- }
-
- /**
- * 增加
- *
- * @param areaEquipment
- * @return
- */
- @ApiOperation("添加区域")
- @RequestMapping(value = "/add", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
- public CommonResult add(@RequestBody SyAreaEquipment areaEquipment) {
- Integer parentId = areaEquipment.getParentId();
- if (parentId == 1) {
- int count = areaEquipmentService.add(areaEquipment);
- if (count > 0) {
- return CommonResult.success(count);
- }
- }
- return CommonResult.failed("该区域下只能创建设备");
- }
-
- /**
- * 修改
- *
- * @param areaEquipment
- * @return
- */
- @ApiOperation("修改区域名称")
- @RequestMapping(value = "/update", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
- public CommonResult update(@RequestBody SyAreaEquipment areaEquipment) {
- int count = areaEquipmentService.update(areaEquipment);
- if (count > 0) {
- return CommonResult.success(count);
- }
- return CommonResult.failed("节点id无效");
- }
-
- /**
- * 获取实体
- *
- * @return
- */
- /*@ApiOperation("查找区域或者设备")
- @RequestMapping(value = "/findOne",method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
- public CommonResult findOne(@RequestBody Map map){
- Integer id = map.get("id");
- if(areaEquipmentService.findOne(id)==null){
- return CommonResult.success("","节点无效");
- }
- return CommonResult.success(areaEquipmentService.findOne(id));
- }*/
-
- /**
- * 删除区域
- *
- * @param map
- * @return
- */
- @ApiOperation("删除区域")
- @RequestMapping(value = "/delete", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
- public CommonResult delete(@RequestBody Map map) {
- try {
- int[] ids = map.get("ids");
- areaEquipmentService.delete(ids);
- return CommonResult.success("删除成功", "删除成功");
- } catch (Exception e) {
- e.printStackTrace();
- return CommonResult.failed(e.getMessage());
- }
- }
-
- @ApiOperation("判断该区域下是否有设备")
- @RequestMapping(value = "/isHaveChild", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
- public CommonResult isHaveChild(@RequestBody Map map) {
- int id = map.get("id");
- List ids = areaEquipmentService.findCaptureById(id);
- if (ids == null || ids.size() == 0) {
- return CommonResult.success(ids, "是否确认删除该区域?");
- }
- return CommonResult.success(ids, "该区域下存在设备,且可能存在正在执行的布控任务,请确认是否删除该区域?");
- }
-
-
- @ApiOperation("根据id查找该区域下所有设备")
- @RequestMapping(value = "/findCaptureById", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
- public CommonResult findCaptureById(@RequestBody Map map) {
- try {
- Integer id = map.get("id");
- List> captureMsgById = areaEquipmentService.findCaptureMsgById(id);
- if (captureMsgById == null) {
- return CommonResult.success("", "该区域下无设备");
- }
- return CommonResult.success(captureMsgById);
- } catch (Exception e) {
- e.printStackTrace();
- return CommonResult.failed();
- }
- }
-
-}
diff --git a/src/main/java/com/objecteye/controller/DeployController.java b/src/main/java/com/objecteye/controller/DeployController.java
index 6931347..403bd9e 100644
--- a/src/main/java/com/objecteye/controller/DeployController.java
+++ b/src/main/java/com/objecteye/controller/DeployController.java
@@ -66,8 +66,8 @@ public class DeployController {
*/
@ApiOperation("查看布控任务详细信息")
@RequestMapping(value = "/findOne", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
- public CommonResult findOne(@RequestBody Map param) {
- SyDeploy syDeploy = deployService.findOne(param.get("id"));
+ public CommonResult findOne(@RequestBody Map param) {
+ SyDeploy syDeploy = deployService.findOne((String) param.get("id"));
if (syDeploy == null) {
return CommonResult.success(201, "没有找到对应任务", new ArrayList<>());
}
@@ -101,7 +101,7 @@ public class DeployController {
*/
@ApiOperation("分页查看全部的布控任务内容")
@RequestMapping(value = "/findMonitorTaskDetail", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
- public CommonResult findMonitorTaskDetail(@RequestParam Integer currentpage, @RequestParam Integer pagevolume, @RequestParam Integer deployId) {
+ public CommonResult findMonitorTaskDetail(@RequestParam Integer currentpage, @RequestParam Integer pagevolume, @RequestParam String deployId) {
PageResult page = deployService.findMonitorTaskDetail(deployId, currentpage, pagevolume);
if (page.getRow().size() == 0) {
return CommonResult.success(201, "无符合条件的数据", new PageResult<>());
@@ -153,9 +153,9 @@ public class DeployController {
*/
@ApiOperation("删除布控任务")
@RequestMapping(value = "/delete", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
- public CommonResult delete(@RequestBody Map map) {
+ public CommonResult delete(@RequestBody Map map) {
try {
- int[] ids = map.get("ids");
+ String[] ids = (String[]) map.get("ids");
deployService.delete(ids);
return CommonResult.success("操作成功");
} catch (Exception e) {
diff --git a/src/main/java/com/objecteye/controller/EquipmentController.java b/src/main/java/com/objecteye/controller/EquipmentController.java
deleted file mode 100644
index a7c4c4e..0000000
--- a/src/main/java/com/objecteye/controller/EquipmentController.java
+++ /dev/null
@@ -1,173 +0,0 @@
-package com.objecteye.controller;
-
-import com.objecteye.common.CommonResult;
-import com.objecteye.entity.PageResult;
-import com.objecteye.entity.SyEquipment;
-import com.objecteye.service.EquipmentService;
-import com.objecteye.utils.GlobalUtil;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-/**
- * controller
- *
- * @author Administrator
- */
-@RestController
-@RequestMapping("/equipment")
-@Api(tags = "EquipmentController", description = "设备管理")
-@CrossOrigin
-public class EquipmentController {
-
- @Autowired
- private EquipmentService equipmentService;
- @Autowired
- private RedisTemplate redisTemplate;
-
- /**
- * 返回全部列表
- *
- * @return
- */
- @ApiOperation("分页返回全部设备")
- @RequestMapping(value = "/findPage", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
- public CommonResult findPage(@RequestParam int currentpage, @RequestParam int pagevolume) { //@RequestBody PagePara pagePara
- //PageResult page1 = equipmentService.findPage(pagePara.getPage(), pagePara.getLimit());
- PageResult page1 = equipmentService.findPage(currentpage, pagevolume);
- if (page1 != null) {
- return CommonResult.success(page1);
- }
- return CommonResult.success("", "无可用设备");
- }
-
- /**
- * 增加
- *
- * @param equipment
- * @return
- */
- @ApiOperation("添加设备")
- @RequestMapping(value = "/add", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
- public CommonResult add(@RequestBody SyEquipment equipment) {
- SyEquipment byIp = equipmentService.findByIp(equipment.getEquipmentIp());
- SyEquipment byName = equipmentService.findByName(equipment.getEquipmentName());
- SyEquipment byPort = equipmentService.findByPort(equipment.getEquipmentPort());
- if ((byIp == null) & (byName == null) & (byPort == null)) {
- int count = equipmentService.add(equipment);
- if (count > 0) {
- return CommonResult.success(count);
- }
- return CommonResult.failed();
- }
- return CommonResult.failed("设备名称、ip、端口不能重复");
- }
-
- /**
- * 修改
- *
- * @param equipment
- * @return
- */
- @ApiOperation("更新设备")
- @RequestMapping(value = "/update", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
- public CommonResult update(@RequestBody SyEquipment equipment) {
- int update = equipmentService.update(equipment);
- if (update > 0) {
- return CommonResult.success(update);
- }
- if (update == 0) {
- return CommonResult.failed("设备名称不能重复");
- }
- return CommonResult.failed();
- }
-
- /**
- * 获取实体
- *
- * @return
- */
- @ApiOperation("根据id查找设备")
- @RequestMapping(value = "/findOne", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
- public CommonResult findOne(@RequestBody Map map) {
- Integer id = map.get("id");
- SyEquipment equipment = equipmentService.findOne(id);
- if (equipment != null) {
- return CommonResult.success(equipment);
- }
- return CommonResult.failed("设备id无效");
- }
-
- /**
- * 批量删除
- *
- * @return
- */
- @ApiOperation("删除设备")
- @Transactional
- @RequestMapping(value = "/delete", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
- public CommonResult delete(@RequestBody Map map) {
- try {
- int[] ids = map.get("ids");
- equipmentService.delete(ids);
- return CommonResult.success("删除成功", "操作成功");
- } catch (Exception e) {
- e.printStackTrace();
- return CommonResult.failed(e.getMessage());
- }
- }
-
- /**
- * 设备开关
- *
- * @param map
- * @return
- */
- @ApiOperation("设备开关")
- @RequestMapping(value = "/updateStatusById", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
- public CommonResult updateStatusById(@RequestBody Map map) {
- Integer id = map.get("id");
- int i = equipmentService.updateStatusById(id);
- if (i == -1) {
- return CommonResult.failed("设备id无效");
- }
- if (i != 0) {
- return CommonResult.success("设备状态更新成功");
- }
- return CommonResult.failed();
- }
-
- /**
- * 设备开关
- *
- * @param map id区域id
- * @return 设备是否可以删除
- */
- @ApiOperation("设备是否可以删除")
- @RequestMapping(value = "/checkDelete", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
- public CommonResult checkDelete(@RequestBody Map map) {
- Integer id = map.get("id");
- boolean canDel = true;
- List msgList = new ArrayList<>();
- if (redisTemplate.opsForHash().hasKey(GlobalUtil.IPWITHDEPLOYLIST, id)) {
- canDel = false;
- msgList.add("布控预警任务");
- }
- if (redisTemplate.opsForHash().hasKey(GlobalUtil.FORBIDDEN_TASK, id)) {
- canDel = false;
- msgList.add("禁行任务");
- }
- if (canDel) {
- return CommonResult.success(200, "不存在设备占用情况", "");
- } else {
- return CommonResult.success(201, "存在" + String.join(",", msgList) + "占用设备", "");
- }
- }
-}
diff --git a/src/main/java/com/objecteye/controller/FeatureController.java b/src/main/java/com/objecteye/controller/FeatureController.java
index fd7a04a..776b826 100644
--- a/src/main/java/com/objecteye/controller/FeatureController.java
+++ b/src/main/java/com/objecteye/controller/FeatureController.java
@@ -38,7 +38,7 @@ public class FeatureController {
@RequestMapping(value = "/findAllName", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public CommonResult findAllName() {
List