diff --git a/car-base-server/src/main/java/com/god/base/server/controller/CarController.java b/car-base-server/src/main/java/com/god/base/server/controller/CarController.java index ab0d80f..6689047 100644 --- a/car-base-server/src/main/java/com/god/base/server/controller/CarController.java +++ b/car-base-server/src/main/java/com/god/base/server/controller/CarController.java @@ -55,7 +55,7 @@ public class CarController extends BaseController { /** * 车辆信息查看 */ - @GetMapping("carList/{userId}") + @GetMapping("/carList/{userId}") public Result carList(@PathVariable String userId){ log.info("功能介绍车辆信息列表查看,请求方式:{},请求路径:{},请求参数:{}", @@ -71,7 +71,7 @@ public class CarController extends BaseController { request.getRequestURL(), JSONObject.toJSONString(carList)); - return Result.success(carList); + return carList; } @@ -136,7 +136,7 @@ public class CarController extends BaseController { @PostMapping("/export") public void export(HttpServletResponse response , Car car , CarRequest carRequest) { - List list = carMapper.getList((int) car.getUserId()); + List list = carMapper.getList(String.valueOf(car.getUserId())); ExcelUtil util = new ExcelUtil<>(Car.class); //对list数据源将其里面的数据导入到excel表单 util.exportExcel(response,list,"车辆信息管理"); diff --git a/car-base-server/src/main/java/com/god/base/server/controller/TopLineController.java b/car-base-server/src/main/java/com/god/base/server/controller/TopLineController.java index 6e21599..5a5af2a 100644 --- a/car-base-server/src/main/java/com/god/base/server/controller/TopLineController.java +++ b/car-base-server/src/main/java/com/god/base/server/controller/TopLineController.java @@ -1,18 +1,18 @@ package com.god.base.server.controller; import com.god.base.domain.request.GetTopicReq; +import com.god.base.server.service.TopLineService; import com.god.base.server.service.impl.TopLineServiceImpl; import com.god.common.core.domain.Result; import com.god.common.log.annotation.Log; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; -import java.util.List; - /** - * 车辆上线控制层 + * @description: 车辆上线控制层 * @Author fst * @date 2023/11/28 23:38 */ @@ -27,17 +27,10 @@ public class TopLineController { * 获取主题 * @return */ - @PostMapping("getTopic") + @PostMapping("/getTopic") @Log(title = "获取主题") public Result getTopic(@RequestBody GetTopicReq getTopicReq){ String topic = topLineService.getTopic(getTopicReq); return Result.success(topic); } - - @GetMapping("getCarVinList") - @Log(title = "获取车辆vin列表") - public Result> getCarVinList(){ - List carVinList = topLineService.getCarVinList(); - return Result.success(); - } } diff --git a/car-base-server/src/main/java/com/god/base/server/mapper/CarMapper.java b/car-base-server/src/main/java/com/god/base/server/mapper/CarMapper.java index 959542e..e011b4b 100644 --- a/car-base-server/src/main/java/com/god/base/server/mapper/CarMapper.java +++ b/car-base-server/src/main/java/com/god/base/server/mapper/CarMapper.java @@ -19,21 +19,8 @@ import java.util.List; @Mapper public interface CarMapper extends BaseMapper { - @Select("SELECT\n" + - "t_car.car_vin_id ,\n" + - "t_car_type.car_type_name , \n" + - "t_fence.fence_name , \n" + - "t_car.battery_manufacturer ,\n" + - "t_car.motor_manufacturer ,\n" + - "t_car.motor_number , \n" + - "t_car.battery_number ,\n" + - "t_car.status \n" + - "\n" + - "FROM\n" + - "\tt_car\n" + - "\tJOIN t_fence ON t_car.fence_id = t_fence.fence_id\n" + - "\tJOIN t_car_type ON t_car.car_type_id = t_car_type.id where t_car.user_id = #{userId1}") - List getList(@Param("userId1") int userId); + + List getList(@Param("userId") String userId); // @Select("select * from t_car where 1=1 " + // " and car_vin_id = #{carVinId}" + diff --git a/car-base-server/src/main/java/com/god/base/server/service/impl/CarServiceImpl.java b/car-base-server/src/main/java/com/god/base/server/service/impl/CarServiceImpl.java index e0e9f13..8bf0f60 100644 --- a/car-base-server/src/main/java/com/god/base/server/service/impl/CarServiceImpl.java +++ b/car-base-server/src/main/java/com/god/base/server/service/impl/CarServiceImpl.java @@ -44,8 +44,7 @@ public class CarServiceImpl extends ServiceImpl implements CarSe // if (null == userId1){ // throw new SecurityException("请先登录"); // } - int userId1 = 1; - List carList = carMapper.getList(userId1); + List carList = carMapper.getList(userId); return Result.success(carList); } diff --git a/car-base-server/src/main/java/com/god/base/server/service/impl/TopLineServiceImpl.java b/car-base-server/src/main/java/com/god/base/server/service/impl/TopLineServiceImpl.java index 38dc8da..c967c8e 100644 --- a/car-base-server/src/main/java/com/god/base/server/service/impl/TopLineServiceImpl.java +++ b/car-base-server/src/main/java/com/god/base/server/service/impl/TopLineServiceImpl.java @@ -7,7 +7,6 @@ import com.god.base.domain.Car; import com.god.base.domain.HisPath; import com.god.base.domain.TopicCar; import com.god.base.domain.request.GetTopicReq; -import com.god.base.server.mapper.CarMapper; import com.god.base.server.mapper.TopicCarMapper; import com.god.base.server.service.TopLineService; import com.god.common.core.exception.ServiceException; diff --git a/car-base-server/src/main/java/com/god/base/server/utils/CarFenceMonitor.java b/car-base-server/src/main/java/com/god/base/server/utils/CarFenceMonitor.java index 79d3eee..caa55c0 100644 --- a/car-base-server/src/main/java/com/god/base/server/utils/CarFenceMonitor.java +++ b/car-base-server/src/main/java/com/god/base/server/utils/CarFenceMonitor.java @@ -29,11 +29,12 @@ import java.util.Set; @Log4j2 public class CarFenceMonitor { - @Autowired private CarService carService; + @Autowired private FenceService fenceService; + @Autowired private RedisService redisService; @@ -43,7 +44,7 @@ public class CarFenceMonitor { log.info("开始获取车辆围栏信息"); //获取车辆信息 - Result> listResult = carService.carList(String.valueOf(SecurityUtils.getUserId())); + Result> listResult = carService.carList(null); List dataCar = listResult.getData(); if (dataCar.size() <= 0) { diff --git a/car-base-server/src/main/resources/mapper/CarMapper.xml b/car-base-server/src/main/resources/mapper/CarMapper.xml index 968da53..76e715d 100644 --- a/car-base-server/src/main/resources/mapper/CarMapper.xml +++ b/car-base-server/src/main/resources/mapper/CarMapper.xml @@ -68,4 +68,25 @@ +