车型
This commit is contained in:
@ -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<ZcCarModel> 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<ZcCarModel> list = zcCarModelService.selectZcCarModelList(zcCarModel);
|
||||
ExcelUtil<ZcCarModel> util = new ExcelUtil<ZcCarModel>(ZcCarModel.class);
|
||||
return util.exportExcel(list, "车型管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增车型管理
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add(ModelMap mmap)
|
||||
{
|
||||
ZcRentCarRule zcRentCarRule = new ZcRentCarRule();
|
||||
zcRentCarRule.setStatus("0");
|
||||
List<ZcRentCarRule> 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<Long> rentCarRuleIds, ZcCarModel zcCarModel)
|
||||
{
|
||||
zcCarModel.setCreateBy(getLoginName());
|
||||
int flag = zcCarModelService.insertZcCarModel(zcCarModel);
|
||||
|
||||
// 保存关联表 ZcRentCarRuleBattery 数据
|
||||
List<ZcCarModelPackage> 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));
|
||||
}
|
||||
|
||||
}
|
||||
@ -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<ZcCarModelPackage> 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<ZcCarModelPackage> list = zcCarModelPackageService.selectZcCarModelPackageList(zcCarModelPackage);
|
||||
ExcelUtil<ZcCarModelPackage> util = new ExcelUtil<ZcCarModelPackage>(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));
|
||||
}
|
||||
}
|
||||
@ -189,6 +189,13 @@ public class ZcRentCarRuleController extends BaseController
|
||||
return toAjax(zcRentCarRuleService.changeStatus(zcRentCarRule));
|
||||
}
|
||||
|
||||
@GetMapping("/listAllValid")
|
||||
@ResponseBody
|
||||
public List<ZcRentCarRule> listAllValid() {
|
||||
ZcRentCarRule zcRentCarRule = new ZcRentCarRule();
|
||||
zcRentCarRule.setStatus("0");
|
||||
return zcRentCarRuleService.selectZcRentCarRuleList(zcRentCarRule);
|
||||
}
|
||||
|
||||
public static String generateTimestampBasedCode() {
|
||||
Random random = new Random();
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
@ -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<ZcCarModel> 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);
|
||||
}
|
||||
@ -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<ZcCarModelPackage> selectZcCarModelPackageList(ZcCarModelPackage zcCarModelPackage);
|
||||
|
||||
int batchInsert(@Param("list") List<ZcCarModelPackage> 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);
|
||||
}
|
||||
@ -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<ZcCarModelPackage> selectZcCarModelPackageList(ZcCarModelPackage zcCarModelPackage);
|
||||
|
||||
/**
|
||||
* 新增车型与租车规则关联
|
||||
*
|
||||
* @param zcCarModelPackage 车型与租车规则关联
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertZcCarModelPackage(ZcCarModelPackage zcCarModelPackage);
|
||||
|
||||
public int batchInsert(List<ZcCarModelPackage> 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);
|
||||
}
|
||||
@ -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<ZcCarModel> 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);
|
||||
|
||||
}
|
||||
@ -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<ZcCarModelPackage> 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<ZcCarModelPackage> 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);
|
||||
}
|
||||
}
|
||||
@ -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<ZcCarModel> 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);
|
||||
}
|
||||
|
||||
}
|
||||
@ -101,4 +101,5 @@ public class ZcRentCarRuleServiceImpl implements IZcRentCarRuleService
|
||||
zcRentCarRule.setUpdateTime(DateUtils.getNowDate());
|
||||
return zcRentCarRuleMapper.updateZcRentCarRule(zcRentCarRule);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,119 @@
|
||||
<?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.ruoyi.operation.mapper.ZcCarModelMapper">
|
||||
|
||||
<resultMap type="ZcCarModel" id="ZcCarModelResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="modelName" column="model_name" />
|
||||
<result property="brandId" column="brand_id" />
|
||||
<result property="brandName" column="brand_name" />
|
||||
<result property="batteryType" column="battery_type" />
|
||||
<result property="maxSpeed" column="max_speed" />
|
||||
<result property="weight" column="weight" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="extend1" column="extend1" />
|
||||
<result property="extend2" column="extend2" />
|
||||
<result property="extend3" column="extend3" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectZcCarModelVo">
|
||||
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
|
||||
</sql>
|
||||
|
||||
<select id="selectZcCarModelList" parameterType="ZcCarModel" resultMap="ZcCarModelResult">
|
||||
<include refid="selectZcCarModelVo"/>
|
||||
<where>
|
||||
<if test="modelName != null and modelName != ''"> and model_name like concat('%', #{modelName}, '%')</if>
|
||||
<if test="brandName != null and brandName != ''"> and brand_name like concat('%', #{brandName}, '%')</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectZcCarModelById" parameterType="Long" resultMap="ZcCarModelResult">
|
||||
<include refid="selectZcCarModelVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertZcCarModel" parameterType="ZcCarModel" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into zc_car_model
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="modelName != null and modelName != ''">model_name,</if>
|
||||
<if test="brandId != null">brand_id,</if>
|
||||
<if test="brandName != null and brandName != ''">brand_name,</if>
|
||||
<if test="batteryType != null">battery_type,</if>
|
||||
<if test="maxSpeed != null">max_speed,</if>
|
||||
<if test="weight != null">weight,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="extend1 != null">extend1,</if>
|
||||
<if test="extend2 != null">extend2,</if>
|
||||
<if test="extend3 != null">extend3,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="modelName != null and modelName != ''">#{modelName},</if>
|
||||
<if test="brandId != null">#{brandId},</if>
|
||||
<if test="brandName != null and brandName != ''">#{brandName},</if>
|
||||
<if test="batteryType != null">#{batteryType},</if>
|
||||
<if test="maxSpeed != null">#{maxSpeed},</if>
|
||||
<if test="weight != null">#{weight},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="extend1 != null">#{extend1},</if>
|
||||
<if test="extend2 != null">#{extend2},</if>
|
||||
<if test="extend3 != null">#{extend3},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateZcCarModel" parameterType="ZcCarModel">
|
||||
update zc_car_model
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="modelName != null and modelName != ''">model_name = #{modelName},</if>
|
||||
<if test="brandId != null">brand_id = #{brandId},</if>
|
||||
<if test="brandName != null and brandName != ''">brand_name = #{brandName},</if>
|
||||
<if test="batteryType != null">battery_type = #{batteryType},</if>
|
||||
<if test="maxSpeed != null">max_speed = #{maxSpeed},</if>
|
||||
<if test="weight != null">weight = #{weight},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="extend1 != null">extend1 = #{extend1},</if>
|
||||
<if test="extend2 != null">extend2 = #{extend2},</if>
|
||||
<if test="extend3 != null">extend3 = #{extend3},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteZcCarModelById" parameterType="Long">
|
||||
delete from zc_car_model where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteZcCarModelByIds" parameterType="String">
|
||||
delete from zc_car_model where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,94 @@
|
||||
<?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.ruoyi.operation.mapper.ZcCarModelPackageMapper">
|
||||
|
||||
<resultMap type="ZcCarModelPackage" id="ZcCarModelPackageResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="carModelId" column="car_model_id" />
|
||||
<result property="carRuleId" column="car_rule_id" />
|
||||
<result property="sortOrder" column="sort_order" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectZcCarModelPackageVo">
|
||||
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
|
||||
</sql>
|
||||
|
||||
<select id="selectZcCarModelPackageList" parameterType="ZcCarModelPackage" resultMap="ZcCarModelPackageResult">
|
||||
<include refid="selectZcCarModelPackageVo"/>
|
||||
<where>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectZcCarModelPackageById" parameterType="Long" resultMap="ZcCarModelPackageResult">
|
||||
<include refid="selectZcCarModelPackageVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertZcCarModelPackage" parameterType="ZcCarModelPackage" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into zc_car_model_package
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="carModelId != null">car_model_id,</if>
|
||||
<if test="carRuleId != null">car_rule_id,</if>
|
||||
<if test="sortOrder != null">sort_order,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="carModelId != null">#{carModelId},</if>
|
||||
<if test="carRuleId != null">#{carRuleId},</if>
|
||||
<if test="sortOrder != null">#{sortOrder},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="batchInsert">
|
||||
INSERT INTO zc_car_model_package (car_model_id, car_rule_id,create_time)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.carModelId}, #{item.carRuleId}, #{item.createTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
<update id="updateZcCarModelPackage" parameterType="ZcCarModelPackage">
|
||||
update zc_car_model_package
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="carModelId != null">car_model_id = #{carModelId},</if>
|
||||
<if test="carRuleId != null">car_rule_id = #{carRuleId},</if>
|
||||
<if test="sortOrder != null">sort_order = #{sortOrder},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteZcCarModelPackageById" parameterType="Long">
|
||||
delete from zc_car_model_package where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteZcCarModelPackageByIds" parameterType="String">
|
||||
delete from zc_car_model_package where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@ -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) {
|
||||
|
||||
@ -0,0 +1,147 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增车型管理')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-carModel-add">
|
||||
|
||||
<input type="hidden" id="rentCarRuleIds" name="rentCarRuleIds">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label is-required">品牌名称:</label>
|
||||
<div class="col-sm-6">
|
||||
<input name="brandName" class="form-control" type="text" maxlength="20" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label is-required">车型名称:</label>
|
||||
<div class="col-sm-6">
|
||||
<input name="modelName" class="form-control" type="text" maxlength="20" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h4 class="form-header h4">关联套餐</h4>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "operation/carModel"
|
||||
var rentCarRuleList = [[${rentCarRuleList}]]
|
||||
var rentalTypeDatas = [[${@dict.getType('key_rent_type')}]];
|
||||
var overdueTypeDatas = [[${@dict.getType('key_rent_overdue_type')}]];
|
||||
var depositFreeDatas = [[${@dict.getType('key_rent_deposit_free')}]];
|
||||
var autoDeductDatas = [[${@dict.getType('key_rent_auto_deduct')}]];
|
||||
$("#form-carModel-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
data: rentCarRuleList,
|
||||
sidePagination: "client",
|
||||
showSearch: false,
|
||||
showRefresh: false,
|
||||
showToggle: false,
|
||||
showColumns: false,
|
||||
clickToSelect: true,
|
||||
maintainSelected: true,
|
||||
columns: [{
|
||||
checkbox: true,
|
||||
formatter:function (value, row, index) {
|
||||
if($.common.isEmpty(value)) {
|
||||
return { checked: row.flag };
|
||||
} else {
|
||||
return { checked: value }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'id',
|
||||
title: '规则ID',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'ruleName',
|
||||
title: '套餐名称'
|
||||
},
|
||||
{
|
||||
field: 'ruleCode',
|
||||
title: '套餐编码',
|
||||
formatter: function(value, row, index) {
|
||||
return '<a href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\', 900, 700)">' + value + '</a>';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'rentalType',
|
||||
title: '租赁类型',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(rentalTypeDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'rentalDays',
|
||||
title: '租赁天数'
|
||||
},
|
||||
{
|
||||
field: 'rentalPrice',
|
||||
title: '租车价格(元)'
|
||||
},
|
||||
{
|
||||
field: 'depositPrice',
|
||||
title: '押金价格(元)'
|
||||
},
|
||||
{
|
||||
field: 'overdueFee',
|
||||
title: '逾期金额(元)'
|
||||
},
|
||||
{
|
||||
field: 'overdueType',
|
||||
title: '逾期计费类型',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(overdueTypeDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'depositFree',
|
||||
title: '是否支持免押',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(depositFreeDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'autoDeduct',
|
||||
title: '是否支持代扣',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(autoDeductDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
title: '关联电池套餐'
|
||||
},
|
||||
{
|
||||
field: 'updateTime',
|
||||
title: '操作时间',
|
||||
sortable: true
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
function submitHandler() {
|
||||
var rows = $.table.selectFirstColumns();
|
||||
$("#rentCarRuleIds").val(rows.join())
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-carModel-add').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,145 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('车型管理列表')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<label>品牌名称:</label>
|
||||
<input type="text" name="brandName"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>车型名称:</label>
|
||||
<input type="text" name="modelName"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>状态:</label>
|
||||
<select name="status" th:with="type=${@dict.getType('key_company_status')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.addCustomize(null,1300,700)" shiro:hasPermission="operation:carModel:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.editCustomize(null,1300,700)" shiro:hasPermission="operation:carModel:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="operation:carModel:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('operation:carModel:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('operation:carModel:remove')}]];
|
||||
var statusDatas = [[${@dict.getType('key_company_status')}]];
|
||||
var prefix = ctx + "operation/carModel";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "车型管理",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'id',
|
||||
title: '车型ID',
|
||||
visible: false
|
||||
},
|
||||
|
||||
{
|
||||
field: 'brandName',
|
||||
title: '品牌名称',
|
||||
width: '200'
|
||||
},
|
||||
{
|
||||
field: 'modelName',
|
||||
title: '车型名称',
|
||||
width: '400'
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: '状态',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(statusDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'createBy',
|
||||
title: '创建者'
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间'
|
||||
},
|
||||
{
|
||||
field: 'updateBy',
|
||||
title: '更新者'
|
||||
},
|
||||
{
|
||||
field: 'updateTime',
|
||||
title: '更新时间'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="$.operate.editCustomize(\'' + row.id + '\',1300,700)"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + ' btnOption" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
if (row.status == 1) {
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="enable(\'' + row.id + '\')"><i class="fa fa-edit"></i>启用</a> ');
|
||||
} else {
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="disable(\'' + row.id + '\')"><i class="fa fa-edit"></i>停用</a> ');
|
||||
}
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
|
||||
/* 停用 */
|
||||
function disable(id) {
|
||||
$.modal.confirm("停用品牌车型提示<span style='color: red'>停用品牌车型后,不可再添加此型号车辆。己添加的型号不受影响,</span>", function() {
|
||||
$.operate.post(prefix + "/changeStatus", { "id": id, "status": 1 });
|
||||
})
|
||||
}
|
||||
|
||||
/* 启用 */
|
||||
function enable(id) {
|
||||
$.modal.confirm("确认启用该车型", function() {
|
||||
$.operate.post(prefix + "/changeStatus", { "id": id, "status": 0 });
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,46 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('修改车型管理')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-carModel-edit" th:object="${zcCarModel}">
|
||||
<input name="id" th:field="*{id}" type="hidden">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">品牌名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="brandName" th:field="*{brandName}" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">车型名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="modelName" th:field="*{modelName}" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="remark" class="form-control">[[*{remark}]]</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "operation/carModel";
|
||||
$("#form-carModel-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-carModel-edit').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -14,118 +14,7 @@
|
||||
<label>商品标题:</label>
|
||||
<input type="text" name="title"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>商品描述:</label>
|
||||
<input type="text" name="detail"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>图标:</label>
|
||||
<input type="text" name="icon"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>电压:</label>
|
||||
<input type="text" name="voltage"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>电容:</label>
|
||||
<input type="text" name="ah"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>最大里程:</label>
|
||||
<input type="text" name="maxMileage"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>最小里程 默认0:</label>
|
||||
<input type="text" name="minMileage"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>押金:</label>
|
||||
<input type="text" name="depositPrice"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>租金:</label>
|
||||
<input type="text" name="rentPrice"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>计时方式:</label>
|
||||
<select name="durationType" th:with="type=${@dict.getType('key_battey_duration_type')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label>租赁时长:</label>
|
||||
<input type="text" name="duration"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>盗抢险:</label>
|
||||
<input type="text" name="insurancePrice"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>是否强制投保 默认0 false:</label>
|
||||
<input type="text" name="compulsoryInsurance"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>保险有效时长 默认12个月:</label>
|
||||
<input type="text" name="insuranceDuration"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>换电次数:</label>
|
||||
<input type="text" name="changeNum"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>1、有限次数 2无限次数:</label>
|
||||
<select name="changeType" th:with="type=${@dict.getType('key_battey_change_type')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label>:</label>
|
||||
<input type="text" name="isDelete"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>:</label>
|
||||
<input type="text" name="cityId"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>:</label>
|
||||
<input type="text" name="operatorId"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>:</label>
|
||||
<input type="text" name="provinceId"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>电池类型:</label>
|
||||
<input type="text" name="categoryId"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>套餐类型 换电/租电:</label>
|
||||
<select name="mealType" th:with="type=${@dict.getType('key_battey_meal_type')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label>套餐排序规则:</label>
|
||||
<input type="text" name="mealSort"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>:</label>
|
||||
<input type="text" name="isJoinInvite"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>套餐渠道租车默认 id号待定:</label>
|
||||
<input type="text" name="mealChannel"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>购买限制类型:</label>
|
||||
<select name="buyLimitType" th:with="type=${@dict.getType('key_battey_buy_limit_type')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
@ -136,18 +25,18 @@
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="operation:rentBatteyRule:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="operation:rentBatteyRule:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="operation:rentBatteyRule:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="operation:rentBatteyRule:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
<!-- <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="operation:rentBatteyRule:add">-->
|
||||
<!-- <i class="fa fa-plus"></i> 添加-->
|
||||
<!-- </a>-->
|
||||
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="operation:rentBatteyRule:edit">-->
|
||||
<!-- <i class="fa fa-edit"></i> 修改-->
|
||||
<!-- </a>-->
|
||||
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="operation:rentBatteyRule:remove">-->
|
||||
<!-- <i class="fa fa-remove"></i> 删除-->
|
||||
<!-- </a>-->
|
||||
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="operation:rentBatteyRule:export">-->
|
||||
<!-- <i class="fa fa-download"></i> 导出-->
|
||||
<!-- </a>-->
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
@ -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('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
// {
|
||||
// title: '操作',
|
||||
// align: 'center',
|
||||
// formatter: function(value, row, index) {
|
||||
// var actions = [];
|
||||
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
// actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
// return actions.join('');
|
||||
// }
|
||||
// }
|
||||
]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
|
||||
@ -164,6 +164,10 @@
|
||||
return $.table.selectDictLabel(autoDeductDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
title: '关联电池套餐'
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: '状态',
|
||||
|
||||
@ -197,9 +197,9 @@
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + ' btnOption" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
if (row.status == 1) {
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="enable(\'' + row.id + '\',\'' + row.phone + '\')"><i class="fa fa-edit"></i>启用</a> ');
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="enable(\'' + row.id + '\')"><i class="fa fa-edit"></i>启用</a> ');
|
||||
} else {
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="disable(\'' + row.id + '\',\'' + row.phone + '\')"><i class="fa fa-edit"></i>停用</a> ');
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="disable(\'' + row.id + '\')"><i class="fa fa-edit"></i>停用</a> ');
|
||||
}
|
||||
return actions.join('');
|
||||
}
|
||||
@ -209,14 +209,14 @@
|
||||
});
|
||||
|
||||
/* 停用 */
|
||||
function disable(id,phone) {
|
||||
function disable(id) {
|
||||
$.modal.confirm("确认是否停用此门店?<span style='color: red'>停用后门店不可在小程序中查看,门店车辆建议尽快重新分配</span>", function() {
|
||||
$.operate.post(prefix + "/changeStatus", { "id": id, "status": 1 });
|
||||
})
|
||||
}
|
||||
|
||||
/* 启用 */
|
||||
function enable(id,phone) {
|
||||
function enable(id) {
|
||||
$.modal.confirm("确认是否启用此门店?<span style='color: red'>启用门店后停用前的数据将恢复正常。</span>", function() {
|
||||
$.operate.post(prefix + "/changeStatus", { "id": id, "status": 0 });
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user