车辆管理+车辆标识
parent
5d5537cb37
commit
86d2643da9
|
@ -8,6 +8,7 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 响应信息主体
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
package com.zhilian.business.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zhilian.common.core.domain.Result;
|
||||
import com.zhilian.common.core.web.controller.BaseController;
|
||||
import com.zhilian.business.domain.Fence;
|
||||
import com.zhilian.business.domain.FenceVo;
|
||||
import com.zhilian.business.domain.vo.FenceVo;
|
||||
import com.zhilian.business.service.FenceService;
|
||||
import com.zhilian.common.core.web.page.TableDataInfo;
|
||||
import com.zhilian.common.security.utils.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName FenceController
|
||||
* @Description 电子围栏控制层
|
||||
|
@ -27,8 +29,10 @@ public class FenceController extends BaseController {
|
|||
* TODO: 围栏管理
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public Result<PageInfo<Fence>> fenceList(@RequestBody FenceVo fenceVo) {
|
||||
return success(fenceService.fenceList(fenceVo));
|
||||
public Result<TableDataInfo<Fence>> fenceList(@RequestBody Fence fence) {
|
||||
startPage();
|
||||
List<Fence> result = fenceService.fenceList(fence);
|
||||
return getDataTable(result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -38,24 +42,27 @@ public class FenceController extends BaseController {
|
|||
*/
|
||||
@PostMapping("/fenceAdd")
|
||||
public Result fenceAdd(@RequestBody Fence fence) {
|
||||
boolean i = fenceService.save(fence);
|
||||
return toAjax(i);
|
||||
fence.setUpdateBy(SecurityUtils.getUsername());
|
||||
fence.setUpdateTime(new Date());
|
||||
return toAjax(fenceService.save(fence));
|
||||
}
|
||||
|
||||
// @PostMapping("insertFence")
|
||||
// public Result insertFence(@RequestBody Fence fence) {
|
||||
// Result result = fenceService.insertFence(fence);
|
||||
// return Result.success();
|
||||
// }
|
||||
|
||||
/**
|
||||
* 修改电子围栏
|
||||
*/
|
||||
// @RequiresPermissions("system:config:fenceAdd")
|
||||
@PostMapping("/fenceUpdate")
|
||||
public Result fenceUpdate(@RequestBody Fence fence) {
|
||||
boolean i = fenceService.updateById(fence);
|
||||
return toAjax(i);
|
||||
fence.setUpdateBy(SecurityUtils.getUsername());
|
||||
fence.setUpdateTime(new Date());
|
||||
return toAjax(fenceService.updateById(fence));
|
||||
}
|
||||
|
||||
@PostMapping("/fenceUpdateMap")
|
||||
public Result fenceUpdateMap(@RequestBody Fence fence) {
|
||||
fence.setUpdateBy(SecurityUtils.getUsername());
|
||||
fence.setUpdateTime(new Date());
|
||||
return toAjax(fenceService.updateById(fence));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -65,8 +72,8 @@ public class FenceController extends BaseController {
|
|||
*/
|
||||
@PostMapping("/fenceDelete/{fenceId}")
|
||||
public Result fenceDelete(@PathVariable String fenceId) {
|
||||
boolean i = fenceService.removeById(fenceId);
|
||||
return toAjax(i);
|
||||
return toAjax(fenceService.removeById(fenceId));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
package com.zhilian.business.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.zhilian.business.domain.Markers;
|
||||
import com.zhilian.business.domain.middle.MarkersFence;
|
||||
import com.zhilian.business.domain.middle.VehicleMarkers;
|
||||
import com.zhilian.business.service.MarkersFenceService;
|
||||
import com.zhilian.business.service.MarkersService;
|
||||
import com.zhilian.common.core.domain.Result;
|
||||
import com.zhilian.common.core.web.controller.BaseController;
|
||||
import com.zhilian.common.core.web.page.TableDataInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/markers")
|
||||
public class MarkersController extends BaseController {
|
||||
@Autowired
|
||||
private MarkersService markersService;
|
||||
@Autowired
|
||||
private MarkersFenceService markersFenceService;
|
||||
|
||||
/**
|
||||
* 车辆标识列表
|
||||
* @param markers
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("list")
|
||||
public Result<TableDataInfo<Markers>> list(@RequestBody Markers markers) {
|
||||
startPage();
|
||||
List<Markers> result = markersService.selectMarkersList(markers);
|
||||
return getDataTable(result);
|
||||
}
|
||||
|
||||
@PostMapping("insert")
|
||||
public Result insert(@RequestBody Markers markers){
|
||||
return toAjax(markersService.save(markers));
|
||||
}
|
||||
|
||||
@PostMapping("update")
|
||||
public Result update(@RequestBody Markers markers) {
|
||||
return toAjax(markersService.updateById(markers));
|
||||
}
|
||||
|
||||
@PostMapping("delete")
|
||||
public Result delete(@RequestParam Long markersId) {
|
||||
markersFenceList(markersId).forEach(markersFence -> {
|
||||
markersFenceService.removeById(markersId);
|
||||
});
|
||||
return toAjax(markersService.removeById(markersId));
|
||||
}
|
||||
|
||||
@PostMapping("insertMarkersFence")
|
||||
public Result insertMarkersFenceMarkers(@RequestBody MarkersFence markersFence){
|
||||
return toAjax(markersFenceService.save(markersFence));
|
||||
}
|
||||
|
||||
public List<MarkersFence> markersFenceList(Long markersId){
|
||||
LambdaQueryWrapper<MarkersFence> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(MarkersFence::getMarkerId, markersId);
|
||||
return markersFenceService.list(queryWrapper);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.zhilian.business.controller;
|
||||
|
||||
import com.zhilian.business.domain.middle.MarkersFence;
|
||||
import com.zhilian.business.service.MarkersFenceService;
|
||||
import com.zhilian.common.core.domain.Result;
|
||||
import com.zhilian.common.core.web.controller.BaseController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/markersFence")
|
||||
public class MarkersFenceController extends BaseController {
|
||||
@Autowired
|
||||
private MarkersFenceService markersFenceService;
|
||||
|
||||
@PostMapping("/list")
|
||||
public Result<List<MarkersFence>> markersFenceList() {
|
||||
return Result.success(markersFenceService.list());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
package com.zhilian.business.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.zhilian.business.domain.Vehicle;
|
||||
import com.zhilian.business.domain.middle.VehicleMarkers;
|
||||
import com.zhilian.business.service.VehicleMarkersService;
|
||||
import com.zhilian.business.service.VehicleService;
|
||||
import com.zhilian.common.core.domain.Result;
|
||||
import com.zhilian.common.core.utils.StringUtils;
|
||||
import com.zhilian.common.core.web.controller.BaseController;
|
||||
import com.zhilian.common.core.web.page.TableDataInfo;
|
||||
import com.zhilian.common.security.utils.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/vehicle")
|
||||
public class VehicleController extends BaseController {
|
||||
@Autowired
|
||||
private VehicleService vehicleService;
|
||||
|
||||
@Autowired
|
||||
private VehicleMarkersService vehicleMarkersService;
|
||||
|
||||
/**
|
||||
* 查询车辆列表
|
||||
* @param vehicle
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<Vehicle>> list(@RequestBody Vehicle vehicle) {
|
||||
startPage();
|
||||
List<Vehicle> list = vehicleService.selectVehicleList(vehicle);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增车辆
|
||||
* @param vehicle
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/vehicleInsert")
|
||||
public Result vehicleInsert(@RequestBody Vehicle vehicle){
|
||||
vehicle.setCreateBy(SecurityUtils.getUsername());
|
||||
vehicle.setCreateTime(new Date());
|
||||
return toAjax(vehicleService.save(vehicle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车辆
|
||||
* @param vehicle
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/vehicleUpdate")
|
||||
public Result vehicleUpdate(@RequestBody Vehicle vehicle){
|
||||
vehicle.setUpdateBy(SecurityUtils.getUsername());
|
||||
vehicle.setUpdateTime(new Date());
|
||||
return toAjax(vehicleService.updateById(vehicle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据车辆ID查询车辆与围栏中间表
|
||||
* @param vehicleId
|
||||
* @return
|
||||
*/
|
||||
public List<VehicleMarkers> getVehicleMarkers(Long vehicleId){
|
||||
LambdaQueryWrapper<VehicleMarkers> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(VehicleMarkers::getVehicleId, vehicleId);
|
||||
return vehicleMarkersService.list(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除车辆
|
||||
* @param vehicleId
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/vehicleDelete")
|
||||
public Result vehicleDelete(@RequestParam Long vehicleId){
|
||||
getVehicleMarkers(vehicleId).forEach(vehicleMarkers -> {
|
||||
vehicleMarkersService.removeById(vehicleId);
|
||||
});
|
||||
return toAjax(vehicleService.removeById(vehicleId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆绑定围栏
|
||||
* @param vehicleMarkers
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/vehicleInsertMarkers")
|
||||
public Result vehicleInsertMarkers(@RequestBody VehicleMarkers vehicleMarkers){
|
||||
return toAjax(vehicleMarkersService.save(vehicleMarkers));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.zhilian.business.controller;
|
||||
|
||||
import com.zhilian.business.domain.Markers;
|
||||
import com.zhilian.business.domain.middle.MarkersFence;
|
||||
import com.zhilian.business.domain.middle.VehicleMarkers;
|
||||
import com.zhilian.business.service.VehicleMarkersService;
|
||||
import com.zhilian.common.core.domain.Result;
|
||||
import com.zhilian.common.core.web.controller.BaseController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/vehicleMarkers")
|
||||
public class VehicleMarkersController extends BaseController {
|
||||
@Autowired
|
||||
private VehicleMarkersService vehicleMarkersService;
|
||||
|
||||
@PostMapping("/list")
|
||||
public Result<List<VehicleMarkers>> vehicleMarkersList() {
|
||||
return Result.success(vehicleMarkersService.list());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.zhilian.business.controller;
|
||||
|
||||
import com.zhilian.business.domain.VehicleType;
|
||||
import com.zhilian.business.service.VehicleTypeService;
|
||||
import com.zhilian.common.core.domain.Result;
|
||||
import com.zhilian.common.core.web.controller.BaseController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("vehicleType")
|
||||
public class VehicleTypeController extends BaseController {
|
||||
@Autowired
|
||||
private VehicleTypeService vehicleTypeService;
|
||||
|
||||
@GetMapping("list")
|
||||
public Result<List<VehicleType>> list(){
|
||||
List<VehicleType> list = vehicleTypeService.listVehicleType();
|
||||
return Result.success(list);
|
||||
}
|
||||
}
|
|
@ -12,6 +12,8 @@ import lombok.EqualsAndHashCode;
|
|||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
|
@ -50,6 +52,6 @@ public class Fence extends BaseEntity {
|
|||
@Excel(name = "电子围栏经纬度信息")
|
||||
@TableField("fence_message")
|
||||
private String fenceMessage;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
List<Markers> markersList;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
package com.zhilian.business.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.zhilian.common.core.annotation.Excel;
|
||||
import com.zhilian.common.core.web.domain.BaseEntity;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("business_markers")
|
||||
public class Markers extends BaseEntity {
|
||||
|
||||
@TableId(value = "markers_id", type = IdType.AUTO)
|
||||
@Excel(name = "标识编号")
|
||||
private Long markersId;
|
||||
|
||||
@TableField("markers_name")
|
||||
@Excel(name = "标识名称")
|
||||
private String markersName;
|
||||
|
||||
@TableField(exist = false)
|
||||
List<Fence> fenceList;
|
||||
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
package com.zhilian.business.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.zhilian.common.core.annotation.Excel;
|
||||
import com.zhilian.common.core.web.domain.BaseEntity;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 车辆信息对象 business_vehicle
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("business_vehicle")
|
||||
public class Vehicle extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 车辆ID
|
||||
*/
|
||||
@Excel(name = "车辆ID",cellType = Excel.ColumnType.NUMERIC)
|
||||
@TableId(value = "vehicle_id",type = IdType.AUTO)
|
||||
private Long vehicleId;
|
||||
/**
|
||||
* 车辆VIN
|
||||
*/
|
||||
@Excel(name = "车辆VIN")
|
||||
@TableField(value = "vehicle_vin")
|
||||
private String vehicleVIN;
|
||||
/**
|
||||
* 车辆类型编号
|
||||
*/
|
||||
@Excel(name = "车辆类型编号")
|
||||
@TableField(value = "vehicle_type_id")
|
||||
private Long vehicleTypeId;
|
||||
/**
|
||||
* 电子围栏编号
|
||||
*/
|
||||
@Excel(name = "电子围栏")
|
||||
@TableField(value = "fence_id")
|
||||
private Long fenceId;
|
||||
/**
|
||||
* 电机厂商
|
||||
*/
|
||||
@Excel(name = "电机厂商")
|
||||
@TableField(value = "vehicle_motor")
|
||||
private String motorBusiness;
|
||||
/**
|
||||
* 电池厂商
|
||||
*/
|
||||
@Excel(name = "电池厂商")
|
||||
@TableField(value = "vehicle_battery")
|
||||
private String batteryBusiness;
|
||||
/**
|
||||
* 电机ID
|
||||
*/
|
||||
@Excel(name = "电机ID")
|
||||
@TableField(value = "motor_id")
|
||||
private String motorID;
|
||||
/**
|
||||
* 电池ID
|
||||
*/
|
||||
@Excel(name = "电池ID")
|
||||
@TableField(value = "battery_id")
|
||||
private String batteryID;
|
||||
|
||||
/**
|
||||
* 车辆状态
|
||||
*/
|
||||
@Excel(name = "车辆状态")
|
||||
@TableField(value = "vehicle_state")
|
||||
private Long vehicleState;
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.zhilian.business.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.zhilian.common.core.annotation.Excel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ToString
|
||||
@TableName(value = "business_vehicle_type")
|
||||
public class VehicleType {
|
||||
|
||||
@TableId(value = "vehicle_type_id", type = IdType.AUTO)
|
||||
@Excel(name = "车型ID")
|
||||
private Long vehicleTypeId;
|
||||
|
||||
@Excel(name = "车型名称")
|
||||
@TableField(value = "vehicle_type_name")
|
||||
private String vehicleTypeName;
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.zhilian.business.domain.middle;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zhilian.business.domain.Fence;
|
||||
import com.zhilian.business.domain.Markers;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
@TableName("business_markers_fence")
|
||||
public class MarkersFence {
|
||||
/**
|
||||
* 车辆标识编号
|
||||
*/
|
||||
@TableId(value = "markers_id",type = IdType.INPUT)
|
||||
private Long markerId;
|
||||
@TableField(value = "fence_id",insertStrategy = FieldStrategy.IGNORED)
|
||||
private Long fenceId;
|
||||
|
||||
public Long getMarkerId() {
|
||||
return markerId;
|
||||
}
|
||||
|
||||
public void setMarkerId(Long markerId) {
|
||||
this.markerId = markerId;
|
||||
}
|
||||
|
||||
public Long getFenceId() {
|
||||
return fenceId;
|
||||
}
|
||||
|
||||
public void setFenceId(Long fenceId) {
|
||||
this.fenceId = fenceId;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.zhilian.business.domain.middle;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
@TableName("business_vehicle_markers")
|
||||
public class VehicleMarkers {
|
||||
/**
|
||||
* 车辆编号
|
||||
*/
|
||||
@TableId(value = "vehicle_id",type = IdType.INPUT)
|
||||
private Long vehicleId;
|
||||
/**
|
||||
* 车辆标识编号
|
||||
*/
|
||||
@TableField(value = "markers_id",insertStrategy = FieldStrategy.IGNORED)
|
||||
private Long markersId;
|
||||
|
||||
public Long getVehicleId() {
|
||||
return vehicleId;
|
||||
}
|
||||
|
||||
public void setVehicleId(Long vehicleId) {
|
||||
this.vehicleId = vehicleId;
|
||||
}
|
||||
|
||||
public Long getMarkersId() {
|
||||
return markersId;
|
||||
}
|
||||
|
||||
public void setMarkersId(Long markersId) {
|
||||
this.markersId = markersId;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
package com.zhilian.business.domain.request;
|
||||
|
||||
import com.zhilian.common.core.web.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class FenceRequest extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 电子围栏名称
|
||||
*/
|
||||
private String fenceName;
|
||||
/**
|
||||
* 电子围栏类型编号
|
||||
*/
|
||||
private Long fenceTypeId;
|
||||
/**
|
||||
* 电子围栏状态
|
||||
*/
|
||||
private Long fenceState;
|
||||
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.zhilian.business.domain;
|
||||
package com.zhilian.business.domain.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
@ -33,11 +33,4 @@ public class FenceVo {
|
|||
private Long fenceState;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
private Integer pageNum=1;
|
||||
private Integer pageSize=5;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.zhilian.business.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MarkersVo {
|
||||
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package com.zhilian.business.domain.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.zhilian.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class VehicleVo {
|
||||
/**
|
||||
* 车辆VIN
|
||||
*/
|
||||
private String vehicleVIN;
|
||||
/**
|
||||
* 车辆类型编号
|
||||
*/
|
||||
private Long vehicleTypeId;
|
||||
/**
|
||||
* 电子围栏编号
|
||||
*/
|
||||
private Long fenceId;
|
||||
/**
|
||||
* 电机厂商
|
||||
*/
|
||||
private String motorBusiness;
|
||||
/**
|
||||
* 电池厂商
|
||||
*/
|
||||
private String batteryBusiness;
|
||||
/**
|
||||
* 电机ID
|
||||
*/
|
||||
private String motorID;
|
||||
/**
|
||||
* 电池ID
|
||||
*/
|
||||
private String batteryID;
|
||||
}
|
|
@ -2,7 +2,7 @@ package com.zhilian.business.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.zhilian.business.domain.Fence;
|
||||
import com.zhilian.business.domain.FenceVo;
|
||||
import com.zhilian.business.domain.vo.FenceVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
package com.zhilian.business.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.zhilian.business.domain.middle.MarkersFence;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Mapper
|
||||
@Component
|
||||
public interface MarkersFenceMapper extends BaseMapper<MarkersFence> {
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.zhilian.business.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.zhilian.business.domain.Markers;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Mapper
|
||||
@Component
|
||||
public interface MarkersMapper extends BaseMapper<Markers> {
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.zhilian.business.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.zhilian.business.domain.Vehicle;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Mapper
|
||||
@Component
|
||||
public interface VehicleMapper extends BaseMapper<Vehicle> {
|
||||
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.zhilian.business.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.zhilian.business.domain.middle.VehicleMarkers;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Mapper
|
||||
@Component
|
||||
public interface VehicleMarkersMapper extends BaseMapper<VehicleMarkers> {
|
||||
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.zhilian.business.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.zhilian.business.domain.VehicleType;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Mapper
|
||||
@Component
|
||||
public interface VehicleTypeMapper extends BaseMapper<VehicleType> {
|
||||
|
||||
}
|
|
@ -1,14 +1,10 @@
|
|||
package com.zhilian.business.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zhilian.business.domain.Fence;
|
||||
import com.zhilian.business.domain.FenceVo;
|
||||
import com.zhilian.common.core.domain.Result;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface FenceService extends IService<Fence> {
|
||||
PageInfo<Fence> fenceList(FenceVo fenceVo);
|
||||
|
||||
|
||||
// Result insertFence(Fence fence);
|
||||
List<Fence> fenceList(Fence fence);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
package com.zhilian.business.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhilian.business.domain.Fence;
|
||||
import com.zhilian.business.domain.Markers;
|
||||
import com.zhilian.business.domain.middle.MarkersFence;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MarkersFenceService extends IService<MarkersFence> {
|
||||
// List<MarkersFence> selectFenceByIdAndMarkersBuyId(List<MarkersFence> list, List<Fence> list1, List<Markers> list2,MarkersFence markersFence);
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.zhilian.business.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhilian.business.domain.Markers;
|
||||
import com.zhilian.business.domain.middle.MarkersFence;
|
||||
import com.zhilian.common.core.domain.Result;
|
||||
import com.zhilian.common.core.web.page.TableDataInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MarkersService extends IService<Markers> {
|
||||
List<Markers> selectMarkersList(Markers markers);
|
||||
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.zhilian.business.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhilian.business.domain.middle.VehicleMarkers;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public interface VehicleMarkersService extends IService<VehicleMarkers> {
|
||||
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.zhilian.business.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhilian.business.domain.Vehicle;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface VehicleService extends IService<Vehicle> {
|
||||
|
||||
List<Vehicle> selectVehicleList(Vehicle vehicle);
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.zhilian.business.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhilian.business.domain.VehicleType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface VehicleTypeService extends IService<VehicleType> {
|
||||
|
||||
List<VehicleType> listVehicleType();
|
||||
|
||||
|
||||
}
|
|
@ -1,13 +1,17 @@
|
|||
package com.zhilian.business.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zhilian.business.domain.Fence;
|
||||
import com.zhilian.business.domain.FenceVo;
|
||||
import com.zhilian.business.domain.Vehicle;
|
||||
import com.zhilian.business.domain.vo.FenceVo;
|
||||
import com.zhilian.business.mapper.FenceMapper;
|
||||
import com.zhilian.business.mapper.MarkersFenceMapper;
|
||||
import com.zhilian.business.mapper.MarkersMapper;
|
||||
import com.zhilian.business.service.FenceService;
|
||||
import com.zhilian.common.core.domain.Result;
|
||||
import com.zhilian.common.core.utils.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -15,24 +19,29 @@ import java.util.List;
|
|||
|
||||
@Service
|
||||
public class FenceServiceImpl extends ServiceImpl<FenceMapper, Fence> implements FenceService {
|
||||
@Autowired
|
||||
private FenceMapper fenceMapper;
|
||||
@Override
|
||||
public PageInfo<Fence> fenceList(FenceVo fenceVo) {
|
||||
|
||||
PageHelper.startPage(fenceVo.getPageNum(),fenceVo.getPageSize());
|
||||
|
||||
List<Fence> list=fenceMapper.fenceList(fenceVo);
|
||||
|
||||
PageInfo info = new PageInfo(list);
|
||||
|
||||
return info;
|
||||
public List<Fence> fenceList(Fence fence) {
|
||||
if (fence.getFenceName() == null && fence.getFenceTypeId() == null && fence.getFenceState() == null) {
|
||||
return this.list();
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public Result insertFence(Fence fence) {
|
||||
// boolean save = this.save(fence);
|
||||
// return Result.success(save);
|
||||
// }
|
||||
LambdaQueryWrapper<Fence> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
// 模糊条件 - 电子围栏名称
|
||||
if (StringUtils.isNotEmpty(fence.getFenceName())) {
|
||||
queryWrapper.like(Fence::getFenceName, fence.getFenceName());
|
||||
}
|
||||
|
||||
// 精确查询 - 查询类型
|
||||
if (fence.getFenceTypeId() != null) {
|
||||
queryWrapper.eq(Fence::getFenceTypeId, fence.getFenceTypeId());
|
||||
}
|
||||
|
||||
// 模糊查询 - 状态
|
||||
if (fence.getFenceState() != null) {
|
||||
queryWrapper.eq(Fence::getFenceState, fence.getFenceState());
|
||||
}
|
||||
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
package com.zhilian.business.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zhilian.business.domain.Fence;
|
||||
import com.zhilian.business.domain.Markers;
|
||||
import com.zhilian.business.domain.middle.MarkersFence;
|
||||
import com.zhilian.business.mapper.MarkersFenceMapper;
|
||||
import com.zhilian.business.service.MarkersFenceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class MarkersFenceServiceImpl extends ServiceImpl<MarkersFenceMapper, MarkersFence> implements MarkersFenceService {
|
||||
@Autowired
|
||||
private MarkersFenceMapper markersFenceMapper;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.zhilian.business.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zhilian.business.domain.Markers;
|
||||
import com.zhilian.business.domain.Vehicle;
|
||||
import com.zhilian.business.mapper.MarkersMapper;
|
||||
import com.zhilian.business.service.MarkersService;
|
||||
import com.zhilian.common.core.utils.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class MarkersServiceImpl extends ServiceImpl<MarkersMapper, Markers> implements MarkersService {
|
||||
|
||||
@Override
|
||||
public List<Markers> selectMarkersList(Markers markers) {
|
||||
LambdaQueryWrapper<Markers> queryWrapper = new LambdaQueryWrapper<>();
|
||||
//模糊查询 查询标识名称
|
||||
queryWrapper.like(StringUtils.isNotEmpty(markers.getMarkersName()), Markers::getMarkersName, markers.getMarkersName());
|
||||
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.zhilian.business.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zhilian.business.domain.middle.VehicleMarkers;
|
||||
import com.zhilian.business.mapper.VehicleMarkersMapper;
|
||||
import com.zhilian.business.service.VehicleMarkersService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class VehicleMarkersServiceImpl extends ServiceImpl<VehicleMarkersMapper, VehicleMarkers> implements VehicleMarkersService {
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package com.zhilian.business.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zhilian.business.domain.Vehicle;
|
||||
import com.zhilian.business.mapper.VehicleMapper;
|
||||
import com.zhilian.business.service.VehicleService;
|
||||
import com.zhilian.common.core.utils.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Service
|
||||
public class VehicleServiceImpl extends ServiceImpl<VehicleMapper, Vehicle> implements VehicleService {
|
||||
|
||||
@Override
|
||||
public List<Vehicle> selectVehicleList(Vehicle vehicle) {
|
||||
LambdaQueryWrapper<Vehicle> queryWrapper = new LambdaQueryWrapper<>();
|
||||
//模糊条件 查询车辆VIN
|
||||
queryWrapper.like(StringUtils.isNotEmpty(vehicle.getVehicleVIN()), Vehicle::getVehicleVIN, vehicle.getVehicleVIN());
|
||||
|
||||
//精确查询 查询车辆类型
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(String.valueOf(vehicle.getVehicleTypeId())), Vehicle::getVehicleTypeId, vehicle.getVehicleTypeId());
|
||||
|
||||
//模糊查询 车辆电机厂商
|
||||
queryWrapper.like(StringUtils.isNotEmpty(vehicle.getMotorID()), Vehicle::getMotorID, vehicle.getMotorID());
|
||||
|
||||
//模糊查询 车辆电池厂商
|
||||
queryWrapper.like(StringUtils.isNotEmpty(vehicle.getBatteryID()), Vehicle::getBatteryID, vehicle.getBatteryID());
|
||||
|
||||
//模糊查询 车辆电机ID
|
||||
queryWrapper.like(StringUtils.isNotEmpty(vehicle.getMotorBusiness()),Vehicle::getMotorBusiness, vehicle.getMotorBusiness());
|
||||
|
||||
//模糊查询 车辆电池ID
|
||||
queryWrapper.like(StringUtils.isNotEmpty(vehicle.getBatteryBusiness()),Vehicle::getBatteryBusiness,vehicle.getBatteryBusiness());
|
||||
|
||||
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.zhilian.business.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zhilian.business.domain.VehicleType;
|
||||
import com.zhilian.business.mapper.VehicleTypeMapper;
|
||||
import com.zhilian.business.service.VehicleTypeService;
|
||||
import com.zhilian.common.redis.service.RedisService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
@Service
|
||||
public class VehicleTypeServiceImpl extends ServiceImpl<VehicleTypeMapper, VehicleType> implements VehicleTypeService {
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
@Override
|
||||
public List<VehicleType> listVehicleType() {
|
||||
if(redisService.hasKey("vehicleType")){
|
||||
List<VehicleType> vehicleType = redisService.getCacheList("vehicleType");
|
||||
return vehicleType;
|
||||
}
|
||||
List<VehicleType> list = this.list();
|
||||
redisService.setCacheList("vehicleType",list);
|
||||
return this.list();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhilian.business.mapper.VehicleMapper">
|
||||
|
||||
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhilian.business.mapper.VehicleMarkersMapper">
|
||||
|
||||
</mapper>
|
|
@ -1,18 +0,0 @@
|
|||
package com.zhilian.resolver;
|
||||
import com.zhilian.common.security.annotation.EnableMyFeignClients;
|
||||
import com.zhilian.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
@EnableCustomSwagger2
|
||||
@EnableScheduling
|
||||
@EnableMyFeignClients
|
||||
@MapperScan({"com.zhilian.resolver.mapper", "com.zhilian.resolver.resolverReport"})
|
||||
@SpringBootApplication
|
||||
public class ZhiLianResolverApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ZhiLianResolverApplication.class, args);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue