车型与套餐
This commit is contained in:
@ -77,6 +77,14 @@ public class CompanyController extends BaseController
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有运营商
|
||||
*/
|
||||
@GetMapping("/companyAll")
|
||||
@ResponseBody
|
||||
public List<Company> companyAll() {
|
||||
return companyService.selectCompanyList(new Company());
|
||||
}
|
||||
/**
|
||||
* 导出运营商列表
|
||||
*/
|
||||
|
||||
@ -11,11 +11,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.operation.domain.CompanyStore;
|
||||
@ -68,6 +64,16 @@ public class CompanyStoreController extends BaseController
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取某运营商下的门店
|
||||
*/
|
||||
@PostMapping("/storesByCompanyId")
|
||||
@ResponseBody
|
||||
public List<CompanyStore> getStores(@RequestParam Long companyId) {
|
||||
CompanyStore companyStore = new CompanyStore();
|
||||
companyStore.setOperatingCompanyId(companyId);
|
||||
return companyStoreService.selectCompanyStoreList(companyStore);
|
||||
}
|
||||
/**
|
||||
* 导出门店列表
|
||||
*/
|
||||
|
||||
@ -0,0 +1,151 @@
|
||||
package com.ruoyi.operation.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.operation.domain.Company;
|
||||
import com.ruoyi.operation.service.ICompanyService;
|
||||
import com.ruoyi.operation.util.OperationConstants;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.operation.domain.ZcCar;
|
||||
import com.ruoyi.operation.service.IZcCarService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 车型管理Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-13
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/operation/car")
|
||||
public class ZcCarController extends BaseController
|
||||
{
|
||||
private String prefix = "operation/car";
|
||||
|
||||
@Autowired
|
||||
private IZcCarService zcCarService;
|
||||
@Autowired
|
||||
private ICompanyService companyService;
|
||||
|
||||
@RequiresPermissions("operation:car:view")
|
||||
@GetMapping()
|
||||
public String car()
|
||||
{
|
||||
return prefix + "/car";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询车型管理列表
|
||||
*/
|
||||
@RequiresPermissions("operation:car:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(ZcCar zcCar)
|
||||
{
|
||||
startPage();
|
||||
List<ZcCar> list = zcCarService.selectZcCarList(zcCar);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出车型管理列表
|
||||
*/
|
||||
@RequiresPermissions("operation:car:export")
|
||||
@Log(title = "车型管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(ZcCar zcCar)
|
||||
{
|
||||
List<ZcCar> list = zcCarService.selectZcCarList(zcCar);
|
||||
ExcelUtil<ZcCar> util = new ExcelUtil<ZcCar>(ZcCar.class);
|
||||
return util.exportExcel(list, "车型管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增车型管理
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add(ModelMap mmap)
|
||||
{
|
||||
List<Company> companyList = companyService.getCompanyList(new Company(),getSysUser()); // 获取运营商列表
|
||||
mmap.put("companyList", companyList); // 将运营商列表传递到前端
|
||||
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存车型管理
|
||||
*/
|
||||
@RequiresPermissions("operation:car:add")
|
||||
@Log(title = "车型管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(ZcCar zcCar)
|
||||
{
|
||||
// 校验 VIN 是否唯一
|
||||
if (StringUtils.isNotEmpty(zcCar.getVin())
|
||||
&& OperationConstants.USER_VIN_NOT_UNIQUE.equals(zcCarService.checkVinUnique(zcCar))) {
|
||||
return error("新增失败,车机号已存在");
|
||||
}
|
||||
return toAjax(zcCarService.insertZcCar(zcCar));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车型管理
|
||||
*/
|
||||
@RequiresPermissions("operation:car:edit")
|
||||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
||||
{
|
||||
List<Company> companyList = companyService.getCompanyList(new Company(),getSysUser()); // 获取运营商列表
|
||||
mmap.put("companyList", companyList); // 将运营商列表传递到前端
|
||||
|
||||
ZcCar zcCar = zcCarService.selectZcCarById(id);
|
||||
mmap.put("zcCar", zcCar);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存车型管理
|
||||
*/
|
||||
@RequiresPermissions("operation:car:edit")
|
||||
@Log(title = "车型管理", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(ZcCar zcCar)
|
||||
{
|
||||
// 校验 VIN 是否唯一
|
||||
if (StringUtils.isNotEmpty(zcCar.getVin())
|
||||
&& OperationConstants.USER_VIN_NOT_UNIQUE.equals(zcCarService.checkVinUnique(zcCar))) {
|
||||
return error("修改失败,车机号已存在");
|
||||
}
|
||||
return toAjax(zcCarService.updateZcCar(zcCar));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除车型管理
|
||||
*/
|
||||
@RequiresPermissions("operation:car:remove")
|
||||
@Log(title = "车型管理", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(zcCarService.deleteZcCarByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -150,4 +150,17 @@ public class ZcCarModelController extends BaseController
|
||||
return toAjax(zcCarModelService.changeStatus(zcCarModel));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/brands")
|
||||
@ResponseBody
|
||||
public List<String> getBrands() {
|
||||
return zcCarModelService.selectAllBrands();
|
||||
}
|
||||
|
||||
@PostMapping("/getModels")
|
||||
@ResponseBody
|
||||
public List<String> getModels(String brandName) {
|
||||
return zcCarModelService.selectModelsByBrand(brandName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -72,7 +72,6 @@ public class CompanyStore extends BaseEntity
|
||||
private String detailedAddress;
|
||||
|
||||
/** 门店logo */
|
||||
@Excel(name = "门店logo")
|
||||
private String image;
|
||||
|
||||
/** 纬度 */
|
||||
|
||||
460
ruoyi-admin/src/main/java/com/ruoyi/operation/domain/ZcCar.java
Normal file
460
ruoyi-admin/src/main/java/com/ruoyi/operation/domain/ZcCar.java
Normal file
@ -0,0 +1,460 @@
|
||||
package com.ruoyi.operation.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 车型管理对象 zc_car
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-13
|
||||
*/
|
||||
public class ZcCar extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 车架号(VIN) */
|
||||
@Excel(name = "车架号(VIN)")
|
||||
private String vin;
|
||||
|
||||
/** 车牌号码 */
|
||||
@Excel(name = "车牌号码")
|
||||
private String licensePlate;
|
||||
|
||||
/** 车辆品牌ID */
|
||||
@Excel(name = "车辆品牌ID")
|
||||
private Long brandId;
|
||||
|
||||
/** 车辆品牌名称 */
|
||||
@Excel(name = "车辆品牌名称")
|
||||
private String brandName;
|
||||
|
||||
/** 车辆型号ID */
|
||||
@Excel(name = "车辆型号ID")
|
||||
private Long modelId;
|
||||
|
||||
/** 车辆型号名称 */
|
||||
@Excel(name = "车辆型号名称")
|
||||
private String modelName;
|
||||
|
||||
/** 支持电池类型 */
|
||||
@Excel(name = "支持电池类型")
|
||||
private String batteryType;
|
||||
|
||||
/** 整车重量(kg) */
|
||||
@Excel(name = "整车重量(kg)")
|
||||
private String weight;
|
||||
|
||||
/** 最高时速(km/h) */
|
||||
@Excel(name = "最高时速(km/h)")
|
||||
private String maxSpeed;
|
||||
|
||||
/** LOT识别号 */
|
||||
@Excel(name = "LOT识别号")
|
||||
private String lotNumber;
|
||||
|
||||
/** 采购日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "采购日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date purchaseDate;
|
||||
|
||||
/** 采购价格(元) */
|
||||
@Excel(name = "采购价格(元)")
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
/** 车辆归属 */
|
||||
@Excel(name = "车辆归属")
|
||||
private String belongType;
|
||||
|
||||
/** 车辆图片 */
|
||||
@Excel(name = "车辆图片")
|
||||
private String images;
|
||||
|
||||
/** BRS车辆状态 */
|
||||
@Excel(name = "BRS车辆状态")
|
||||
private String brsStatus;
|
||||
|
||||
/** IoT设备状态 */
|
||||
@Excel(name = "IoT设备状态")
|
||||
private String iotStatus;
|
||||
|
||||
/** IoT识别码 */
|
||||
@Excel(name = "IoT识别码")
|
||||
private String iotCode;
|
||||
|
||||
/** 所属运营商ID */
|
||||
@Excel(name = "所属运营商ID")
|
||||
private Long operatorId;
|
||||
|
||||
/** 所属运营商名称 */
|
||||
@Excel(name = "所属运营商名称")
|
||||
private String operatorName;
|
||||
|
||||
/** 所属门店ID */
|
||||
@Excel(name = "所属门店ID")
|
||||
private Long storeId;
|
||||
|
||||
/** 所属门店名称 */
|
||||
@Excel(name = "所属门店名称")
|
||||
private String storeName;
|
||||
|
||||
/** 应用套餐ID */
|
||||
@Excel(name = "应用套餐ID")
|
||||
private Long packageId;
|
||||
|
||||
/** 应用套餐名称 */
|
||||
@Excel(name = "应用套餐名称")
|
||||
private String packageName;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
private String status;
|
||||
|
||||
/** 删除标志 */
|
||||
private String delFlag;
|
||||
|
||||
/** 扩展字段1 */
|
||||
private String extend1;
|
||||
|
||||
/** 扩展字段2 */
|
||||
private String extend2;
|
||||
|
||||
/** 扩展字段3 */
|
||||
private String extend3;
|
||||
|
||||
/** 扩展字段4 */
|
||||
private String extend4;
|
||||
|
||||
/** 扩展字段5 */
|
||||
private String extend5;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setVin(String vin)
|
||||
{
|
||||
this.vin = vin;
|
||||
}
|
||||
|
||||
public String getVin()
|
||||
{
|
||||
return vin;
|
||||
}
|
||||
public void setLicensePlate(String licensePlate)
|
||||
{
|
||||
this.licensePlate = licensePlate;
|
||||
}
|
||||
|
||||
public String getLicensePlate()
|
||||
{
|
||||
return licensePlate;
|
||||
}
|
||||
public void setBrandId(Long brandId)
|
||||
{
|
||||
this.brandId = brandId;
|
||||
}
|
||||
|
||||
public Long getBrandId()
|
||||
{
|
||||
return brandId;
|
||||
}
|
||||
public void setBrandName(String brandName)
|
||||
{
|
||||
this.brandName = brandName;
|
||||
}
|
||||
|
||||
public String getBrandName()
|
||||
{
|
||||
return brandName;
|
||||
}
|
||||
public void setModelId(Long modelId)
|
||||
{
|
||||
this.modelId = modelId;
|
||||
}
|
||||
|
||||
public Long getModelId()
|
||||
{
|
||||
return modelId;
|
||||
}
|
||||
public void setModelName(String modelName)
|
||||
{
|
||||
this.modelName = modelName;
|
||||
}
|
||||
|
||||
public String getModelName()
|
||||
{
|
||||
return modelName;
|
||||
}
|
||||
public void setBatteryType(String batteryType)
|
||||
{
|
||||
this.batteryType = batteryType;
|
||||
}
|
||||
|
||||
public String getBatteryType()
|
||||
{
|
||||
return batteryType;
|
||||
}
|
||||
public void setWeight(String weight)
|
||||
{
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public String getWeight()
|
||||
{
|
||||
return weight;
|
||||
}
|
||||
public void setMaxSpeed(String maxSpeed)
|
||||
{
|
||||
this.maxSpeed = maxSpeed;
|
||||
}
|
||||
|
||||
public String getMaxSpeed()
|
||||
{
|
||||
return maxSpeed;
|
||||
}
|
||||
public void setLotNumber(String lotNumber)
|
||||
{
|
||||
this.lotNumber = lotNumber;
|
||||
}
|
||||
|
||||
public String getLotNumber()
|
||||
{
|
||||
return lotNumber;
|
||||
}
|
||||
public void setPurchaseDate(Date purchaseDate)
|
||||
{
|
||||
this.purchaseDate = purchaseDate;
|
||||
}
|
||||
|
||||
public Date getPurchaseDate()
|
||||
{
|
||||
return purchaseDate;
|
||||
}
|
||||
public void setPurchasePrice(BigDecimal purchasePrice)
|
||||
{
|
||||
this.purchasePrice = purchasePrice;
|
||||
}
|
||||
|
||||
public BigDecimal getPurchasePrice()
|
||||
{
|
||||
return purchasePrice;
|
||||
}
|
||||
public void setBelongType(String belongType)
|
||||
{
|
||||
this.belongType = belongType;
|
||||
}
|
||||
|
||||
public String getBelongType()
|
||||
{
|
||||
return belongType;
|
||||
}
|
||||
public void setImages(String images)
|
||||
{
|
||||
this.images = images;
|
||||
}
|
||||
|
||||
public String getImages()
|
||||
{
|
||||
return images;
|
||||
}
|
||||
public void setBrsStatus(String brsStatus)
|
||||
{
|
||||
this.brsStatus = brsStatus;
|
||||
}
|
||||
|
||||
public String getBrsStatus()
|
||||
{
|
||||
return brsStatus;
|
||||
}
|
||||
public void setIotStatus(String iotStatus)
|
||||
{
|
||||
this.iotStatus = iotStatus;
|
||||
}
|
||||
|
||||
public String getIotStatus()
|
||||
{
|
||||
return iotStatus;
|
||||
}
|
||||
public void setIotCode(String iotCode)
|
||||
{
|
||||
this.iotCode = iotCode;
|
||||
}
|
||||
|
||||
public String getIotCode()
|
||||
{
|
||||
return iotCode;
|
||||
}
|
||||
public void setOperatorId(Long operatorId)
|
||||
{
|
||||
this.operatorId = operatorId;
|
||||
}
|
||||
|
||||
public Long getOperatorId()
|
||||
{
|
||||
return operatorId;
|
||||
}
|
||||
public void setOperatorName(String operatorName)
|
||||
{
|
||||
this.operatorName = operatorName;
|
||||
}
|
||||
|
||||
public String getOperatorName()
|
||||
{
|
||||
return operatorName;
|
||||
}
|
||||
public void setStoreId(Long storeId)
|
||||
{
|
||||
this.storeId = storeId;
|
||||
}
|
||||
|
||||
public Long getStoreId()
|
||||
{
|
||||
return storeId;
|
||||
}
|
||||
public void setStoreName(String storeName)
|
||||
{
|
||||
this.storeName = storeName;
|
||||
}
|
||||
|
||||
public String getStoreName()
|
||||
{
|
||||
return storeName;
|
||||
}
|
||||
public void setPackageId(Long packageId)
|
||||
{
|
||||
this.packageId = packageId;
|
||||
}
|
||||
|
||||
public Long getPackageId()
|
||||
{
|
||||
return packageId;
|
||||
}
|
||||
public void setPackageName(String packageName)
|
||||
{
|
||||
this.packageName = packageName;
|
||||
}
|
||||
|
||||
public String getPackageName()
|
||||
{
|
||||
return packageName;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
public void setExtend1(String extend1)
|
||||
{
|
||||
this.extend1 = extend1;
|
||||
}
|
||||
|
||||
public String getExtend1()
|
||||
{
|
||||
return extend1;
|
||||
}
|
||||
public void setExtend2(String extend2)
|
||||
{
|
||||
this.extend2 = extend2;
|
||||
}
|
||||
|
||||
public String getExtend2()
|
||||
{
|
||||
return extend2;
|
||||
}
|
||||
public void setExtend3(String extend3)
|
||||
{
|
||||
this.extend3 = extend3;
|
||||
}
|
||||
|
||||
public String getExtend3()
|
||||
{
|
||||
return extend3;
|
||||
}
|
||||
public void setExtend4(String extend4)
|
||||
{
|
||||
this.extend4 = extend4;
|
||||
}
|
||||
|
||||
public String getExtend4()
|
||||
{
|
||||
return extend4;
|
||||
}
|
||||
public void setExtend5(String extend5)
|
||||
{
|
||||
this.extend5 = extend5;
|
||||
}
|
||||
|
||||
public String getExtend5()
|
||||
{
|
||||
return extend5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("vin", getVin())
|
||||
.append("licensePlate", getLicensePlate())
|
||||
.append("brandId", getBrandId())
|
||||
.append("brandName", getBrandName())
|
||||
.append("modelId", getModelId())
|
||||
.append("modelName", getModelName())
|
||||
.append("batteryType", getBatteryType())
|
||||
.append("weight", getWeight())
|
||||
.append("maxSpeed", getMaxSpeed())
|
||||
.append("lotNumber", getLotNumber())
|
||||
.append("purchaseDate", getPurchaseDate())
|
||||
.append("purchasePrice", getPurchasePrice())
|
||||
.append("belongType", getBelongType())
|
||||
.append("images", getImages())
|
||||
.append("brsStatus", getBrsStatus())
|
||||
.append("iotStatus", getIotStatus())
|
||||
.append("iotCode", getIotCode())
|
||||
.append("operatorId", getOperatorId())
|
||||
.append("operatorName", getOperatorName())
|
||||
.append("storeId", getStoreId())
|
||||
.append("storeName", getStoreName())
|
||||
.append("packageId", getPackageId())
|
||||
.append("packageName", getPackageName())
|
||||
.append("status", getStatus())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("extend1", getExtend1())
|
||||
.append("extend2", getExtend2())
|
||||
.append("extend3", getExtend3())
|
||||
.append("extend4", getExtend4())
|
||||
.append("extend5", getExtend5())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -41,6 +41,8 @@ public class ZcCarModel extends BaseEntity
|
||||
/** 整车重量(kg) */
|
||||
private BigDecimal weight;
|
||||
|
||||
private String image;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
@ -177,6 +179,14 @@ public class ZcCarModel extends BaseEntity
|
||||
this.rentCarRuleList = rentCarRuleList;
|
||||
}
|
||||
|
||||
public String getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public void setImage(String image) {
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
@ -187,6 +197,7 @@ public class ZcCarModel extends BaseEntity
|
||||
.append("batteryType", getBatteryType())
|
||||
.append("maxSpeed", getMaxSpeed())
|
||||
.append("weight", getWeight())
|
||||
.append("image", getImage())
|
||||
.append("status", getStatus())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
|
||||
@ -0,0 +1,63 @@
|
||||
package com.ruoyi.operation.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.operation.domain.ZcCar;
|
||||
|
||||
/**
|
||||
* 车型管理Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-13
|
||||
*/
|
||||
public interface ZcCarMapper
|
||||
{
|
||||
/**
|
||||
* 查询车型管理
|
||||
*
|
||||
* @param id 车型管理主键
|
||||
* @return 车型管理
|
||||
*/
|
||||
public ZcCar selectZcCarById(Long id);
|
||||
|
||||
/**
|
||||
* 查询车型管理列表
|
||||
*
|
||||
* @param zcCar 车型管理
|
||||
* @return 车型管理集合
|
||||
*/
|
||||
public List<ZcCar> selectZcCarList(ZcCar zcCar);
|
||||
|
||||
/**
|
||||
* 新增车型管理
|
||||
*
|
||||
* @param zcCar 车型管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertZcCar(ZcCar zcCar);
|
||||
|
||||
/**
|
||||
* 修改车型管理
|
||||
*
|
||||
* @param zcCar 车型管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateZcCar(ZcCar zcCar);
|
||||
|
||||
/**
|
||||
* 删除车型管理
|
||||
*
|
||||
* @param id 车型管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZcCarById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除车型管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZcCarByIds(String[] ids);
|
||||
|
||||
public ZcCar checkVinUnique(String vin);
|
||||
}
|
||||
@ -58,4 +58,9 @@ public interface ZcCarModelMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZcCarModelByIds(String[] ids);
|
||||
|
||||
public List<String> selectAllBrands();
|
||||
|
||||
public List<String> selectModelsByBrand(String brandName);
|
||||
|
||||
}
|
||||
|
||||
@ -64,4 +64,14 @@ public interface IZcCarModelService
|
||||
|
||||
public int changeStatus(ZcCarModel zcCarModel);
|
||||
|
||||
/**
|
||||
* 查询所有品牌
|
||||
*/
|
||||
List<String> selectAllBrands();
|
||||
|
||||
/**
|
||||
* 根据品牌查询车型列表
|
||||
*/
|
||||
List<String> selectModelsByBrand(String brandName);
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,69 @@
|
||||
package com.ruoyi.operation.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.operation.domain.ZcCar;
|
||||
|
||||
/**
|
||||
* 车型管理Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-13
|
||||
*/
|
||||
public interface IZcCarService
|
||||
{
|
||||
/**
|
||||
* 查询车型管理
|
||||
*
|
||||
* @param id 车型管理主键
|
||||
* @return 车型管理
|
||||
*/
|
||||
public ZcCar selectZcCarById(Long id);
|
||||
|
||||
/**
|
||||
* 查询车型管理列表
|
||||
*
|
||||
* @param zcCar 车型管理
|
||||
* @return 车型管理集合
|
||||
*/
|
||||
public List<ZcCar> selectZcCarList(ZcCar zcCar);
|
||||
|
||||
/**
|
||||
* 新增车型管理
|
||||
*
|
||||
* @param zcCar 车型管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertZcCar(ZcCar zcCar);
|
||||
|
||||
/**
|
||||
* 修改车型管理
|
||||
*
|
||||
* @param zcCar 车型管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateZcCar(ZcCar zcCar);
|
||||
|
||||
/**
|
||||
* 批量删除车型管理
|
||||
*
|
||||
* @param ids 需要删除的车型管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZcCarByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除车型管理信息
|
||||
*
|
||||
* @param id 车型管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZcCarById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 校验车机号 (VIN) 是否唯一
|
||||
*
|
||||
* @return 是否唯一 (0:唯一, 1:不唯一)
|
||||
*/
|
||||
String checkVinUnique(ZcCar zcCar);
|
||||
}
|
||||
@ -147,4 +147,15 @@ public class ZcCarModelServiceImpl implements IZcCarModelService
|
||||
return zcCarModelMapper.updateZcCarModel(zcCarModel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> selectAllBrands() {
|
||||
return zcCarModelMapper.selectAllBrands();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<String> selectModelsByBrand(String brandName) {
|
||||
return zcCarModelMapper.selectModelsByBrand(brandName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,109 @@
|
||||
package com.ruoyi.operation.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.operation.util.OperationConstants;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.operation.mapper.ZcCarMapper;
|
||||
import com.ruoyi.operation.domain.ZcCar;
|
||||
import com.ruoyi.operation.service.IZcCarService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* 车型管理Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-13
|
||||
*/
|
||||
@Service
|
||||
public class ZcCarServiceImpl implements IZcCarService
|
||||
{
|
||||
@Autowired
|
||||
private ZcCarMapper zcCarMapper;
|
||||
|
||||
/**
|
||||
* 查询车型管理
|
||||
*
|
||||
* @param id 车型管理主键
|
||||
* @return 车型管理
|
||||
*/
|
||||
@Override
|
||||
public ZcCar selectZcCarById(Long id)
|
||||
{
|
||||
return zcCarMapper.selectZcCarById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询车型管理列表
|
||||
*
|
||||
* @param zcCar 车型管理
|
||||
* @return 车型管理
|
||||
*/
|
||||
@Override
|
||||
public List<ZcCar> selectZcCarList(ZcCar zcCar)
|
||||
{
|
||||
return zcCarMapper.selectZcCarList(zcCar);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增车型管理
|
||||
*
|
||||
* @param zcCar 车型管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertZcCar(ZcCar zcCar)
|
||||
{
|
||||
zcCar.setCreateTime(DateUtils.getNowDate());
|
||||
return zcCarMapper.insertZcCar(zcCar);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车型管理
|
||||
*
|
||||
* @param zcCar 车型管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateZcCar(ZcCar zcCar)
|
||||
{
|
||||
zcCar.setUpdateTime(DateUtils.getNowDate());
|
||||
return zcCarMapper.updateZcCar(zcCar);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除车型管理
|
||||
*
|
||||
* @param ids 需要删除的车型管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteZcCarByIds(String ids)
|
||||
{
|
||||
return zcCarMapper.deleteZcCarByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除车型管理信息
|
||||
*
|
||||
* @param id 车型管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteZcCarById(Long id)
|
||||
{
|
||||
return zcCarMapper.deleteZcCarById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkVinUnique(ZcCar zcCar) {
|
||||
Long carId = StringUtils.isNull(zcCar.getId()) ? -1L : zcCar.getId();
|
||||
ZcCar info = zcCarMapper.checkVinUnique(zcCar.getVin());
|
||||
if (StringUtils.isNotNull(info) && info.getId().longValue() != carId.longValue()){
|
||||
return OperationConstants.USER_VIN_NOT_UNIQUE;
|
||||
}
|
||||
return OperationConstants.USER_VIN_UNIQUE;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
package com.ruoyi.operation.util;
|
||||
|
||||
public class OperationConstants {
|
||||
|
||||
/**
|
||||
* 车机号 (VIN) 唯一
|
||||
*/
|
||||
public static final String USER_VIN_UNIQUE = "0";
|
||||
public static final String USER_VIN_NOT_UNIQUE = "1";
|
||||
}
|
||||
Reference in New Issue
Block a user