diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/controller/ZcCarModelController.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/controller/ZcCarModelController.java new file mode 100644 index 0000000..9caa835 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/controller/ZcCarModelController.java @@ -0,0 +1,164 @@ +package com.ruoyi.operation.controller; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import com.ruoyi.operation.domain.*; +import com.ruoyi.operation.service.IZcCarModelPackageService; +import com.ruoyi.operation.service.IZcRentCarRuleService; +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.*; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.operation.service.IZcCarModelService; +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-10 + */ +@Controller +@RequestMapping("/operation/carModel") +public class ZcCarModelController extends BaseController +{ + private String prefix = "operation/carModel"; + + @Autowired + private IZcCarModelService zcCarModelService; + @Autowired + private IZcRentCarRuleService zcRentCarRuleService; + @Autowired + private IZcCarModelPackageService zcCarModelPackageService; + + @RequiresPermissions("operation:carModel:view") + @GetMapping() + public String carModel() + { + return prefix + "/carModel"; + } + + /** + * 查询车型管理列表 + */ + @RequiresPermissions("operation:carModel:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(ZcCarModel zcCarModel) + { + startPage(); + List list = zcCarModelService.selectZcCarModelList(zcCarModel); + return getDataTable(list); + } + + /** + * 导出车型管理列表 + */ + @RequiresPermissions("operation:carModel:export") + @Log(title = "车型管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(ZcCarModel zcCarModel) + { + List list = zcCarModelService.selectZcCarModelList(zcCarModel); + ExcelUtil util = new ExcelUtil(ZcCarModel.class); + return util.exportExcel(list, "车型管理数据"); + } + + /** + * 新增车型管理 + */ + @GetMapping("/add") + public String add(ModelMap mmap) + { + ZcRentCarRule zcRentCarRule = new ZcRentCarRule(); + zcRentCarRule.setStatus("0"); + List rentCarRuleList = zcRentCarRuleService.selectZcRentCarRuleList(zcRentCarRule); + mmap.put("rentCarRuleList", rentCarRuleList); + + return prefix + "/add"; + } + + /** + * 新增保存车型管理 + */ + @RequiresPermissions("operation:carModel:add") + @Log(title = "车型管理", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(@RequestParam("rentCarRuleIds") List rentCarRuleIds, ZcCarModel zcCarModel) + { + zcCarModel.setCreateBy(getLoginName()); + int flag = zcCarModelService.insertZcCarModel(zcCarModel); + + // 保存关联表 ZcRentCarRuleBattery 数据 + List carModelPackageList = new ArrayList<>(); + for (Long rentCarRuleId : rentCarRuleIds) { + ZcCarModelPackage zcCarModelPackage = new ZcCarModelPackage(); + zcCarModelPackage.setCarModelId(zcCarModel.getId()); + zcCarModelPackage.setCarRuleId(rentCarRuleId); + zcCarModelPackage.setCreateTime(new Date()); + carModelPackageList.add(zcCarModelPackage); + } + if (!carModelPackageList.isEmpty()) { + zcCarModelPackageService.batchInsert(carModelPackageList); + } + return toAjax(flag); + } + + /** + * 修改车型管理 + */ + @RequiresPermissions("operation:carModel:edit") + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Long id, ModelMap mmap) + { + ZcCarModel zcCarModel = zcCarModelService.selectZcCarModelById(id); + mmap.put("zcCarModel", zcCarModel); + return prefix + "/edit"; + } + + /** + * 修改保存车型管理 + */ + @RequiresPermissions("operation:carModel:edit") + @Log(title = "车型管理", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(ZcCarModel zcCarModel) + { + zcCarModel.setUpdateBy(getLoginName()); + return toAjax(zcCarModelService.updateZcCarModel(zcCarModel)); + } + + /** + * 删除车型管理 + */ + @RequiresPermissions("operation:carModel:remove") + @Log(title = "车型管理", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(zcCarModelService.deleteZcCarModelByIds(ids)); + } + + + @Log(title = "车型管理", businessType = BusinessType.UPDATE) + @RequiresPermissions("operation:carModel:edit") + @PostMapping("/changeStatus") + @ResponseBody + public AjaxResult changeStatus(ZcCarModel zcCarModel) + { + return toAjax(zcCarModelService.changeStatus(zcCarModel)); + } + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/controller/ZcCarModelPackageController.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/controller/ZcCarModelPackageController.java new file mode 100644 index 0000000..f310268 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/controller/ZcCarModelPackageController.java @@ -0,0 +1,127 @@ +package com.ruoyi.operation.controller; + +import java.util.List; +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.ZcCarModelPackage; +import com.ruoyi.operation.service.IZcCarModelPackageService; +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-10 + */ +@Controller +@RequestMapping("/operation/carModelPackage") +public class ZcCarModelPackageController extends BaseController +{ + private String prefix = "operation/carModelPackage"; + + @Autowired + private IZcCarModelPackageService zcCarModelPackageService; + + @RequiresPermissions("operation:carModelPackage:view") + @GetMapping() + public String carModelPackage() + { + return prefix + "/carModelPackage"; + } + + /** + * 查询车型与租车规则关联列表 + */ + @RequiresPermissions("operation:carModelPackage:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(ZcCarModelPackage zcCarModelPackage) + { + startPage(); + List list = zcCarModelPackageService.selectZcCarModelPackageList(zcCarModelPackage); + return getDataTable(list); + } + + /** + * 导出车型与租车规则关联列表 + */ + @RequiresPermissions("operation:carModelPackage:export") + @Log(title = "车型与租车规则关联", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(ZcCarModelPackage zcCarModelPackage) + { + List list = zcCarModelPackageService.selectZcCarModelPackageList(zcCarModelPackage); + ExcelUtil util = new ExcelUtil(ZcCarModelPackage.class); + return util.exportExcel(list, "车型与租车规则关联数据"); + } + + /** + * 新增车型与租车规则关联 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存车型与租车规则关联 + */ + @RequiresPermissions("operation:carModelPackage:add") + @Log(title = "车型与租车规则关联", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(ZcCarModelPackage zcCarModelPackage) + { + return toAjax(zcCarModelPackageService.insertZcCarModelPackage(zcCarModelPackage)); + } + + /** + * 修改车型与租车规则关联 + */ + @RequiresPermissions("operation:carModelPackage:edit") + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Long id, ModelMap mmap) + { + ZcCarModelPackage zcCarModelPackage = zcCarModelPackageService.selectZcCarModelPackageById(id); + mmap.put("zcCarModelPackage", zcCarModelPackage); + return prefix + "/edit"; + } + + /** + * 修改保存车型与租车规则关联 + */ + @RequiresPermissions("operation:carModelPackage:edit") + @Log(title = "车型与租车规则关联", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(ZcCarModelPackage zcCarModelPackage) + { + return toAjax(zcCarModelPackageService.updateZcCarModelPackage(zcCarModelPackage)); + } + + /** + * 删除车型与租车规则关联 + */ + @RequiresPermissions("operation:carModelPackage:remove") + @Log(title = "车型与租车规则关联", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(zcCarModelPackageService.deleteZcCarModelPackageByIds(ids)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/controller/ZcRentCarRuleController.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/controller/ZcRentCarRuleController.java index 93a5876..5e6e016 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/operation/controller/ZcRentCarRuleController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/controller/ZcRentCarRuleController.java @@ -189,6 +189,13 @@ public class ZcRentCarRuleController extends BaseController return toAjax(zcRentCarRuleService.changeStatus(zcRentCarRule)); } + @GetMapping("/listAllValid") + @ResponseBody + public List listAllValid() { + ZcRentCarRule zcRentCarRule = new ZcRentCarRule(); + zcRentCarRule.setStatus("0"); + return zcRentCarRuleService.selectZcRentCarRuleList(zcRentCarRule); + } public static String generateTimestampBasedCode() { Random random = new Random(); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/domain/ZcCarModel.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/domain/ZcCarModel.java new file mode 100644 index 0000000..3479411 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/domain/ZcCarModel.java @@ -0,0 +1,189 @@ +package com.ruoyi.operation.domain; + +import java.math.BigDecimal; +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_model + * + * @author ruoyi + * @date 2025-07-10 + */ +public class ZcCarModel extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 车型ID */ + private Long id; + + /** 车型名称 */ + @Excel(name = "车型名称") + private String modelName; + + /** 品牌ID */ + private Long brandId; + + /** 品牌名称 */ + @Excel(name = "品牌名称") + private String brandName; + + /** 电池类型 */ + private String batteryType; + + /** 最高时速(km/h) */ + private Long maxSpeed; + + /** 整车重量(kg) */ + private BigDecimal weight; + + /** 状态(0正常 1停用) */ + @Excel(name = "状态", readConverterExp = "0=正常,1=停用") + private String status; + + /** 删除标志(0存在 2删除) */ + private String delFlag; + + /** 扩展字段1 */ + private String extend1; + + /** 扩展字段2 */ + private String extend2; + + /** 扩展字段3 */ + private String extend3; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setModelName(String modelName) + { + this.modelName = modelName; + } + + public String getModelName() + { + return modelName; + } + 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 setBatteryType(String batteryType) + { + this.batteryType = batteryType; + } + + public String getBatteryType() + { + return batteryType; + } + public void setMaxSpeed(Long maxSpeed) + { + this.maxSpeed = maxSpeed; + } + + public Long getMaxSpeed() + { + return maxSpeed; + } + public void setWeight(BigDecimal weight) + { + this.weight = weight; + } + + public BigDecimal getWeight() + { + return weight; + } + 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; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("modelName", getModelName()) + .append("brandId", getBrandId()) + .append("brandName", getBrandName()) + .append("batteryType", getBatteryType()) + .append("maxSpeed", getMaxSpeed()) + .append("weight", getWeight()) + .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()) + .toString(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/domain/ZcCarModelPackage.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/domain/ZcCarModelPackage.java new file mode 100644 index 0000000..3a82351 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/domain/ZcCarModelPackage.java @@ -0,0 +1,97 @@ +package com.ruoyi.operation.domain; + +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_model_package + * + * @author ruoyi + * @date 2025-07-10 + */ +public class ZcCarModelPackage extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 规则ID */ + private Long id; + + /** */ + @Excel(name = "") + private Long carModelId; + + /** */ + @Excel(name = "") + private Long carRuleId; + + /** */ + @Excel(name = "") + private Long sortOrder; + + /** 删除标志(0代表存在 2代表删除) */ + private String delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCarModelId(Long carModelId) + { + this.carModelId = carModelId; + } + + public Long getCarModelId() + { + return carModelId; + } + public void setCarRuleId(Long carRuleId) + { + this.carRuleId = carRuleId; + } + + public Long getCarRuleId() + { + return carRuleId; + } + public void setSortOrder(Long sortOrder) + { + this.sortOrder = sortOrder; + } + + public Long getSortOrder() + { + return sortOrder; + } + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("carModelId", getCarModelId()) + .append("carRuleId", getCarRuleId()) + .append("sortOrder", getSortOrder()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/mapper/ZcCarModelMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/mapper/ZcCarModelMapper.java new file mode 100644 index 0000000..6361915 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/mapper/ZcCarModelMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.operation.mapper; + +import java.util.List; +import com.ruoyi.operation.domain.ZcCarModel; + +/** + * 车型管理Mapper接口 + * + * @author ruoyi + * @date 2025-07-10 + */ +public interface ZcCarModelMapper +{ + /** + * 查询车型管理 + * + * @param id 车型管理主键 + * @return 车型管理 + */ + public ZcCarModel selectZcCarModelById(Long id); + + /** + * 查询车型管理列表 + * + * @param zcCarModel 车型管理 + * @return 车型管理集合 + */ + public List selectZcCarModelList(ZcCarModel zcCarModel); + + /** + * 新增车型管理 + * + * @param zcCarModel 车型管理 + * @return 结果 + */ + public int insertZcCarModel(ZcCarModel zcCarModel); + + /** + * 修改车型管理 + * + * @param zcCarModel 车型管理 + * @return 结果 + */ + public int updateZcCarModel(ZcCarModel zcCarModel); + + /** + * 删除车型管理 + * + * @param id 车型管理主键 + * @return 结果 + */ + public int deleteZcCarModelById(Long id); + + /** + * 批量删除车型管理 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteZcCarModelByIds(String[] ids); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/mapper/ZcCarModelPackageMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/mapper/ZcCarModelPackageMapper.java new file mode 100644 index 0000000..6df5fcc --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/mapper/ZcCarModelPackageMapper.java @@ -0,0 +1,64 @@ +package com.ruoyi.operation.mapper; + +import java.util.List; +import com.ruoyi.operation.domain.ZcCarModelPackage; +import org.apache.ibatis.annotations.Param; + +/** + * 车型与租车规则关联Mapper接口 + * + * @author ruoyi + * @date 2025-07-10 + */ +public interface ZcCarModelPackageMapper +{ + /** + * 查询车型与租车规则关联 + * + * @param id 车型与租车规则关联主键 + * @return 车型与租车规则关联 + */ + public ZcCarModelPackage selectZcCarModelPackageById(Long id); + + /** + * 查询车型与租车规则关联列表 + * + * @param zcCarModelPackage 车型与租车规则关联 + * @return 车型与租车规则关联集合 + */ + public List selectZcCarModelPackageList(ZcCarModelPackage zcCarModelPackage); + + int batchInsert(@Param("list") List zcCarModelPackageList); + + /** + * 新增车型与租车规则关联 + * + * @param zcCarModelPackage 车型与租车规则关联 + * @return 结果 + */ + public int insertZcCarModelPackage(ZcCarModelPackage zcCarModelPackage); + + /** + * 修改车型与租车规则关联 + * + * @param zcCarModelPackage 车型与租车规则关联 + * @return 结果 + */ + public int updateZcCarModelPackage(ZcCarModelPackage zcCarModelPackage); + + /** + * 删除车型与租车规则关联 + * + * @param id 车型与租车规则关联主键 + * @return 结果 + */ + public int deleteZcCarModelPackageById(Long id); + + /** + * 批量删除车型与租车规则关联 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteZcCarModelPackageByIds(String[] ids); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/service/IZcCarModelPackageService.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/service/IZcCarModelPackageService.java new file mode 100644 index 0000000..510970b --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/service/IZcCarModelPackageService.java @@ -0,0 +1,62 @@ +package com.ruoyi.operation.service; + +import java.util.List; +import com.ruoyi.operation.domain.ZcCarModelPackage; + +/** + * 车型与租车规则关联Service接口 + * + * @author ruoyi + * @date 2025-07-10 + */ +public interface IZcCarModelPackageService +{ + /** + * 查询车型与租车规则关联 + * + * @param id 车型与租车规则关联主键 + * @return 车型与租车规则关联 + */ + public ZcCarModelPackage selectZcCarModelPackageById(Long id); + + /** + * 查询车型与租车规则关联列表 + * + * @param zcCarModelPackage 车型与租车规则关联 + * @return 车型与租车规则关联集合 + */ + public List selectZcCarModelPackageList(ZcCarModelPackage zcCarModelPackage); + + /** + * 新增车型与租车规则关联 + * + * @param zcCarModelPackage 车型与租车规则关联 + * @return 结果 + */ + public int insertZcCarModelPackage(ZcCarModelPackage zcCarModelPackage); + + public int batchInsert(List zcCarModelPackageList); + /** + * 修改车型与租车规则关联 + * + * @param zcCarModelPackage 车型与租车规则关联 + * @return 结果 + */ + public int updateZcCarModelPackage(ZcCarModelPackage zcCarModelPackage); + + /** + * 批量删除车型与租车规则关联 + * + * @param ids 需要删除的车型与租车规则关联主键集合 + * @return 结果 + */ + public int deleteZcCarModelPackageByIds(String ids); + + /** + * 删除车型与租车规则关联信息 + * + * @param id 车型与租车规则关联主键 + * @return 结果 + */ + public int deleteZcCarModelPackageById(Long id); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/service/IZcCarModelService.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/service/IZcCarModelService.java new file mode 100644 index 0000000..9461fa5 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/service/IZcCarModelService.java @@ -0,0 +1,65 @@ +package com.ruoyi.operation.service; + +import java.util.List; +import com.ruoyi.operation.domain.ZcCarModel; + +/** + * 车型管理Service接口 + * + * @author ruoyi + * @date 2025-07-10 + */ +public interface IZcCarModelService +{ + /** + * 查询车型管理 + * + * @param id 车型管理主键 + * @return 车型管理 + */ + public ZcCarModel selectZcCarModelById(Long id); + + /** + * 查询车型管理列表 + * + * @param zcCarModel 车型管理 + * @return 车型管理集合 + */ + public List selectZcCarModelList(ZcCarModel zcCarModel); + + /** + * 新增车型管理 + * + * @param zcCarModel 车型管理 + * @return 结果 + */ + public int insertZcCarModel(ZcCarModel zcCarModel); + + /** + * 修改车型管理 + * + * @param zcCarModel 车型管理 + * @return 结果 + */ + public int updateZcCarModel(ZcCarModel zcCarModel); + + /** + * 批量删除车型管理 + * + * @param ids 需要删除的车型管理主键集合 + * @return 结果 + */ + public int deleteZcCarModelByIds(String ids); + + /** + * 删除车型管理信息 + * + * @param id 车型管理主键 + * @return 结果 + */ + public int deleteZcCarModelById(Long id); + + + public int changeStatus(ZcCarModel zcCarModel); + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/service/impl/ZcCarModelPackageServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/service/impl/ZcCarModelPackageServiceImpl.java new file mode 100644 index 0000000..7a825e3 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/service/impl/ZcCarModelPackageServiceImpl.java @@ -0,0 +1,102 @@ +package com.ruoyi.operation.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.operation.mapper.ZcCarModelPackageMapper; +import com.ruoyi.operation.domain.ZcCarModelPackage; +import com.ruoyi.operation.service.IZcCarModelPackageService; +import com.ruoyi.common.core.text.Convert; + +/** + * 车型与租车规则关联Service业务层处理 + * + * @author ruoyi + * @date 2025-07-10 + */ +@Service +public class ZcCarModelPackageServiceImpl implements IZcCarModelPackageService +{ + @Autowired + private ZcCarModelPackageMapper zcCarModelPackageMapper; + + /** + * 查询车型与租车规则关联 + * + * @param id 车型与租车规则关联主键 + * @return 车型与租车规则关联 + */ + @Override + public ZcCarModelPackage selectZcCarModelPackageById(Long id) + { + return zcCarModelPackageMapper.selectZcCarModelPackageById(id); + } + + /** + * 查询车型与租车规则关联列表 + * + * @param zcCarModelPackage 车型与租车规则关联 + * @return 车型与租车规则关联 + */ + @Override + public List selectZcCarModelPackageList(ZcCarModelPackage zcCarModelPackage) + { + return zcCarModelPackageMapper.selectZcCarModelPackageList(zcCarModelPackage); + } + + /** + * 新增车型与租车规则关联 + * + * @param zcCarModelPackage 车型与租车规则关联 + * @return 结果 + */ + @Override + public int insertZcCarModelPackage(ZcCarModelPackage zcCarModelPackage) + { + zcCarModelPackage.setCreateTime(DateUtils.getNowDate()); + return zcCarModelPackageMapper.insertZcCarModelPackage(zcCarModelPackage); + } + + @Override + public int batchInsert(List zcCarModelPackageList) { + return zcCarModelPackageMapper.batchInsert(zcCarModelPackageList); + } + + /** + * 修改车型与租车规则关联 + * + * @param zcCarModelPackage 车型与租车规则关联 + * @return 结果 + */ + @Override + public int updateZcCarModelPackage(ZcCarModelPackage zcCarModelPackage) + { + zcCarModelPackage.setUpdateTime(DateUtils.getNowDate()); + return zcCarModelPackageMapper.updateZcCarModelPackage(zcCarModelPackage); + } + + /** + * 批量删除车型与租车规则关联 + * + * @param ids 需要删除的车型与租车规则关联主键 + * @return 结果 + */ + @Override + public int deleteZcCarModelPackageByIds(String ids) + { + return zcCarModelPackageMapper.deleteZcCarModelPackageByIds(Convert.toStrArray(ids)); + } + + /** + * 删除车型与租车规则关联信息 + * + * @param id 车型与租车规则关联主键 + * @return 结果 + */ + @Override + public int deleteZcCarModelPackageById(Long id) + { + return zcCarModelPackageMapper.deleteZcCarModelPackageById(id); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/service/impl/ZcCarModelServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/service/impl/ZcCarModelServiceImpl.java new file mode 100644 index 0000000..851c092 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/service/impl/ZcCarModelServiceImpl.java @@ -0,0 +1,105 @@ +package com.ruoyi.operation.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.operation.mapper.ZcCarModelMapper; +import com.ruoyi.operation.domain.ZcCarModel; +import com.ruoyi.operation.service.IZcCarModelService; +import com.ruoyi.common.core.text.Convert; + +/** + * 车型管理Service业务层处理 + * + * @author ruoyi + * @date 2025-07-10 + */ +@Service +public class ZcCarModelServiceImpl implements IZcCarModelService +{ + @Autowired + private ZcCarModelMapper zcCarModelMapper; + + /** + * 查询车型管理 + * + * @param id 车型管理主键 + * @return 车型管理 + */ + @Override + public ZcCarModel selectZcCarModelById(Long id) + { + return zcCarModelMapper.selectZcCarModelById(id); + } + + /** + * 查询车型管理列表 + * + * @param zcCarModel 车型管理 + * @return 车型管理 + */ + @Override + public List selectZcCarModelList(ZcCarModel zcCarModel) + { + return zcCarModelMapper.selectZcCarModelList(zcCarModel); + } + + /** + * 新增车型管理 + * + * @param zcCarModel 车型管理 + * @return 结果 + */ + @Override + public int insertZcCarModel(ZcCarModel zcCarModel) + { + zcCarModel.setCreateTime(DateUtils.getNowDate()); + zcCarModel.setUpdateTime(DateUtils.getNowDate()); + return zcCarModelMapper.insertZcCarModel(zcCarModel); + } + + /** + * 修改车型管理 + * + * @param zcCarModel 车型管理 + * @return 结果 + */ + @Override + public int updateZcCarModel(ZcCarModel zcCarModel) + { + zcCarModel.setUpdateTime(DateUtils.getNowDate()); + return zcCarModelMapper.updateZcCarModel(zcCarModel); + } + + /** + * 批量删除车型管理 + * + * @param ids 需要删除的车型管理主键 + * @return 结果 + */ + @Override + public int deleteZcCarModelByIds(String ids) + { + return zcCarModelMapper.deleteZcCarModelByIds(Convert.toStrArray(ids)); + } + + /** + * 删除车型管理信息 + * + * @param id 车型管理主键 + * @return 结果 + */ + @Override + public int deleteZcCarModelById(Long id) + { + return zcCarModelMapper.deleteZcCarModelById(id); + } + + @Override + public int changeStatus(ZcCarModel zcCarModel) { + zcCarModel.setUpdateTime(DateUtils.getNowDate()); + return zcCarModelMapper.updateZcCarModel(zcCarModel); + } + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/service/impl/ZcRentCarRuleServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/service/impl/ZcRentCarRuleServiceImpl.java index e2d7b94..279cc88 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/operation/service/impl/ZcRentCarRuleServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/service/impl/ZcRentCarRuleServiceImpl.java @@ -101,4 +101,5 @@ public class ZcRentCarRuleServiceImpl implements IZcRentCarRuleService zcRentCarRule.setUpdateTime(DateUtils.getNowDate()); return zcRentCarRuleMapper.updateZcRentCarRule(zcRentCarRule); } + } diff --git a/ruoyi-admin/src/main/resources/mapper/operation/ZcCarModelMapper.xml b/ruoyi-admin/src/main/resources/mapper/operation/ZcCarModelMapper.xml new file mode 100644 index 0000000..214a985 --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/operation/ZcCarModelMapper.xml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select id, model_name, brand_id, brand_name, battery_type, max_speed, weight, status, del_flag, create_by, create_time, update_by, update_time, remark, extend1, extend2, extend3 from zc_car_model + + + + + + + + insert into zc_car_model + + model_name, + brand_id, + brand_name, + battery_type, + max_speed, + weight, + status, + del_flag, + create_by, + create_time, + update_by, + update_time, + remark, + extend1, + extend2, + extend3, + + + #{modelName}, + #{brandId}, + #{brandName}, + #{batteryType}, + #{maxSpeed}, + #{weight}, + #{status}, + #{delFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + #{extend1}, + #{extend2}, + #{extend3}, + + + + + update zc_car_model + + model_name = #{modelName}, + brand_id = #{brandId}, + brand_name = #{brandName}, + battery_type = #{batteryType}, + max_speed = #{maxSpeed}, + weight = #{weight}, + status = #{status}, + del_flag = #{delFlag}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + extend1 = #{extend1}, + extend2 = #{extend2}, + extend3 = #{extend3}, + + where id = #{id} + + + + delete from zc_car_model where id = #{id} + + + + delete from zc_car_model where id in + + #{id} + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/mapper/operation/ZcCarModelPackageMapper.xml b/ruoyi-admin/src/main/resources/mapper/operation/ZcCarModelPackageMapper.xml new file mode 100644 index 0000000..4ff71dc --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/operation/ZcCarModelPackageMapper.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + select id, car_model_id, car_rule_id, sort_order, del_flag, create_by, create_time, update_by, update_time, remark from zc_car_model_package + + + + + + + + insert into zc_car_model_package + + car_model_id, + car_rule_id, + sort_order, + del_flag, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{carModelId}, + #{carRuleId}, + #{sortOrder}, + #{delFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + INSERT INTO zc_car_model_package (car_model_id, car_rule_id,create_time) + VALUES + + (#{item.carModelId}, #{item.carRuleId}, #{item.createTime}) + + + + update zc_car_model_package + + car_model_id = #{carModelId}, + car_rule_id = #{carRuleId}, + sort_order = #{sortOrder}, + del_flag = #{delFlag}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from zc_car_model_package where id = #{id} + + + + delete from zc_car_model_package where id in + + #{id} + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js index e05490b..24e0f57 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js @@ -1166,6 +1166,21 @@ var table = { return url; }, // 修改信息 + editCustomize: function(id,width,height) { + table.set(); + if($.common.isEmpty(id) && table.options.type == table_type.bootstrapTreeTable) { + var row = $("#" + table.options.id).bootstrapTreeTable('getSelections')[0]; + if ($.common.isEmpty(row)) { + $.modal.alertWarning("请至少选择一条记录"); + return; + } + var url = table.options.updateUrl.replace("{id}", row[table.options.uniqueId]); + $.modal.open("修改" + table.options.modalName, url,width,height); + } else { + $.modal.open("修改" + table.options.modalName, $.operate.editUrl(id),width,height); + } + }, + // 修改信息 edit: function(id) { table.set(); if($.common.isEmpty(id) && table.options.type == table_type.bootstrapTreeTable) { diff --git a/ruoyi-admin/src/main/resources/templates/operation/carModel/add.html b/ruoyi-admin/src/main/resources/templates/operation/carModel/add.html new file mode 100644 index 0000000..2a0f488 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/operation/carModel/add.html @@ -0,0 +1,147 @@ + + + + + + +
+
+ + +
+ +
+ +
+
+
+ +
+ +
+
+ +

关联套餐

+
+
+
+
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/operation/carModel/carModel.html b/ruoyi-admin/src/main/resources/templates/operation/carModel/carModel.html new file mode 100644 index 0000000..2265901 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/operation/carModel/carModel.html @@ -0,0 +1,145 @@ + + + + + + +
+
+
+
+
+
    + +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/operation/carModel/edit.html b/ruoyi-admin/src/main/resources/templates/operation/carModel/edit.html new file mode 100644 index 0000000..6ce9a52 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/operation/carModel/edit.html @@ -0,0 +1,46 @@ + + + + + + +
+
+ + +
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/operation/rentBatteyRule/rentBatteyRule.html b/ruoyi-admin/src/main/resources/templates/operation/rentBatteyRule/rentBatteyRule.html index dbe280a..c0e9b0b 100644 --- a/ruoyi-admin/src/main/resources/templates/operation/rentBatteyRule/rentBatteyRule.html +++ b/ruoyi-admin/src/main/resources/templates/operation/rentBatteyRule/rentBatteyRule.html @@ -14,118 +14,7 @@ -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • +
  •  搜索  重置 @@ -136,18 +25,18 @@
    @@ -206,7 +95,7 @@ }, { field: 'minMileage', - title: '最小里程 默认0' + title: '最小里程' }, { field: 'depositPrice', @@ -233,39 +122,17 @@ }, { field: 'compulsoryInsurance', - title: '是否强制投保 默认0 false' + title: '是否强制投保' }, { field: 'insuranceDuration', - title: '保险有效时长 默认12个月' + title: '保险有效时长' }, { field: 'changeNum', title: '换电次数' }, - { - field: 'changeType', - title: '1、有限次数 2无限次数', - formatter: function(value, row, index) { - return $.table.selectDictLabel(changeTypeDatas, value); - } - }, - { - field: 'isDelete', - title: '' - }, - { - field: 'cityId', - title: '' - }, - { - field: 'operatorId', - title: '' - }, - { - field: 'provinceId', - title: '' - }, + { field: 'categoryId', title: '电池类型' @@ -281,13 +148,10 @@ field: 'mealSort', title: '套餐排序规则' }, - { - field: 'isJoinInvite', - title: '' - }, + { field: 'mealChannel', - title: '套餐渠道租车默认 id号待定' + title: '套餐渠道租车默认' }, { field: 'buyLimitType', @@ -296,16 +160,17 @@ return $.table.selectDictLabel(buyLimitTypeDatas, value); } }, - { - title: '操作', - align: 'center', - formatter: function(value, row, index) { - var actions = []; - actions.push('编辑 '); - actions.push('删除'); - return actions.join(''); - } - }] + // { + // title: '操作', + // align: 'center', + // formatter: function(value, row, index) { + // var actions = []; + // actions.push('编辑 '); + // actions.push('删除'); + // return actions.join(''); + // } + // } + ] }; $.table.init(options); }); diff --git a/ruoyi-admin/src/main/resources/templates/operation/rentCarRule/rentCarRule.html b/ruoyi-admin/src/main/resources/templates/operation/rentCarRule/rentCarRule.html index d1e007b..683b470 100644 --- a/ruoyi-admin/src/main/resources/templates/operation/rentCarRule/rentCarRule.html +++ b/ruoyi-admin/src/main/resources/templates/operation/rentCarRule/rentCarRule.html @@ -164,6 +164,10 @@ return $.table.selectDictLabel(autoDeductDatas, value); } }, + { + field: 'remark', + title: '关联电池套餐' + }, { field: 'status', title: '状态', diff --git a/ruoyi-admin/src/main/resources/templates/operation/store/store.html b/ruoyi-admin/src/main/resources/templates/operation/store/store.html index 49830fd..361e644 100644 --- a/ruoyi-admin/src/main/resources/templates/operation/store/store.html +++ b/ruoyi-admin/src/main/resources/templates/operation/store/store.html @@ -197,9 +197,9 @@ actions.push('编辑 '); actions.push('删除'); if (row.status == 1) { - actions.push('启用 '); + actions.push('启用 '); } else { - actions.push('停用 '); + actions.push('停用 '); } return actions.join(''); } @@ -209,14 +209,14 @@ }); /* 停用 */ - function disable(id,phone) { + function disable(id) { $.modal.confirm("确认是否停用此门店?停用后门店不可在小程序中查看,门店车辆建议尽快重新分配", function() { $.operate.post(prefix + "/changeStatus", { "id": id, "status": 1 }); }) } /* 启用 */ - function enable(id,phone) { + function enable(id) { $.modal.confirm("确认是否启用此门店?启用门店后停用前的数据将恢复正常。", function() { $.operate.post(prefix + "/changeStatus", { "id": id, "status": 0 }); })