车辆信息管理电子围栏下拉框,车辆状态

master
shaowenhao 2023-11-30 18:36:49 +08:00
parent 5b87af6999
commit 9dc95d7889
5 changed files with 68 additions and 10 deletions

View File

@ -2,11 +2,12 @@ package com.god.base.server.controller;
import com.alibaba.fastjson.JSONObject;
import com.god.base.domain.Car;
import com.god.base.domain.CarType;
import com.god.base.domain.Fence;
import com.god.base.domain.VehicleMessage;
import com.god.base.domain.request.CarRequest;
import com.god.base.server.mapper.CarMapper;
import com.god.base.server.service.CarService;
import com.god.base.server.util.AopConfig;
import com.god.common.core.domain.Result;
import com.god.common.core.utils.poi.ExcelUtil;
import com.god.common.core.web.controller.BaseController;
@ -36,9 +37,6 @@ public class CarController extends BaseController {
@Autowired
private CarService carService;
@Autowired
private AopConfig aopConfig;
@Autowired
private CarMapper carMapper;
@ -80,7 +78,7 @@ public class CarController extends BaseController {
/**
*
*/
@Log(title = "车辆信息管理" , businessType = BusinessType.INSERT) // 添加
@Log(title = "添加车辆管理信息" , businessType = BusinessType.INSERT) // 添加
@PostMapping("/addCar")
public Result addCarP(@RequestBody @Validated CarRequest carRequest){
@ -92,7 +90,7 @@ public class CarController extends BaseController {
/**
*
*/
@Log(title = "车辆信息管理" , businessType = BusinessType.UPDATE) //修改
@Log(title = "修改车辆信息" , businessType = BusinessType.UPDATE) //修改
@PostMapping("/updCar")
public Result updCar(@PathVariable @Validated Car car){
log.info("功能介绍修改车辆,请求方式:{},请求路径:{},请求参数:{}",
@ -113,7 +111,7 @@ public class CarController extends BaseController {
/**
*
*/
@Log(title = "车辆信息管理" , businessType = BusinessType.DELETE) // 删除
@Log(title = "逻辑删除车辆信息管理" , businessType = BusinessType.DELETE) // 删除
@GetMapping("/delCar/{vinId}")
public Result delCar(@PathVariable String vinId){
log.info("功能介绍逻辑删除车辆信息,请求方式:{},请求路径:{},请求参数:{}",
@ -135,7 +133,7 @@ public class CarController extends BaseController {
*
*/
@RequiresPermissions("car:car:export")
@Log(title = "车辆信息管理" , businessType = BusinessType.EXPORT) // 导出 跳转业务操作类型表中
@Log(title = "导出车辆信息管理列表" , businessType = BusinessType.EXPORT) // 导出 跳转业务操作类型表中
@PostMapping("/export")
public void export(HttpServletResponse response , Car car , CarRequest carRequest)
{
@ -162,5 +160,21 @@ public class CarController extends BaseController {
return carService.countData();
}
/**
* id
*/
@GetMapping("/fenceId")
public Result<List<Fence>> fenceId(){
List<Fence> fenceId = carService.fenceId();
return Result.success(fenceId);
}
/**
* id
*/
@GetMapping("/carType")
public Result<List<CarType>> carTypeId(){
List<CarType> carTypeId = carService.carTypeId();
return Result.success(carTypeId);
}
}

View File

@ -3,6 +3,8 @@ package com.god.base.server.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.god.base.domain.Car;
import com.god.base.domain.CarType;
import com.god.base.domain.Fence;
import com.god.base.domain.request.CarRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -67,4 +69,7 @@ public interface CarMapper extends BaseMapper<Car> {
Integer getUnOnlineCount();
List<Fence> fenceId();
List<CarType> carTypeId();
}

View File

@ -2,6 +2,8 @@ package com.god.base.server.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.god.base.domain.Car;
import com.god.base.domain.CarType;
import com.god.base.domain.Fence;
import com.god.base.domain.VehicleMessage;
import com.god.common.core.domain.Result;
import org.apache.ibatis.annotations.Param;
@ -27,6 +29,22 @@ public interface CarService extends IService<Car> {
*/
Result<String> countData();
/**
* id
* @param
* @return
*/
List<Fence> fenceId();
/**
* id
* @param
* @return
* @return
*/
List<CarType> carTypeId();
}

View File

@ -2,6 +2,8 @@ package com.god.base.server.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.god.base.domain.Car;
import com.god.base.domain.CarType;
import com.god.base.domain.Fence;
import com.god.base.domain.VehicleMessage;
import com.god.base.common.constant.RedisConstant;
import com.god.base.server.mapper.CarMapper;
@ -138,12 +140,13 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements CarSe
@Override
public boolean removeById(Serializable id) {
boolean remove = super.removeById(id);
if (!remove) {
if (remove ==false) {
log.warn("删除管理车辆数据:[/-{}-/]失败!", id);
throw new RuntimeException("删除管理车辆数据失败");
}
} else {
return true;
}
}
/**
* 线
@ -168,5 +171,15 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements CarSe
return Result.success(day + ":" + month + ":" + onlineCount + ":" + unOnlineCount );
}
@Override
public List<Fence> fenceId() {
return carMapper.fenceId();
}
@Override
public List<CarType> carTypeId() {
return carMapper.carTypeId();
}
}

View File

@ -60,4 +60,12 @@
<include refid="selectVehicleInfoVo"/>
where car_vin_id = #{vinId}
</select>
<!-- 根据电子围栏 获取电子围栏信息-->
<select id="fenceId" resultType="com.god.base.domain.Fence">
SELECT fence_id from t_fence
</select>
<!-- 根据车辆类型 获取车辆类型下拉框-->
<select id="carTypeId" resultType="com.god.base.domain.CarType">
select id from t_car_type
</select>
</mapper>