车型支持电池改为查询数据库

This commit is contained in:
majian314
2025-09-26 17:24:08 +08:00
parent 399a365224
commit 0d6c2eb1d7
13 changed files with 1282 additions and 17 deletions

View File

@ -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.ZcBatteryCategory;
import com.ruoyi.operation.service.IZcBatteryCategoryService;
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-09-26
*/
@Controller
@RequestMapping("/operation/batteryCategory")
public class ZcBatteryCategoryController extends BaseController
{
private String prefix = "operation/batteryCategory";
@Autowired
private IZcBatteryCategoryService zcBatteryCategoryService;
@RequiresPermissions("operation:batteryCategory:view")
@GetMapping()
public String batteryCategory()
{
return prefix + "/batteryCategory";
}
/**
* 查询电池类别列表
*/
@RequiresPermissions("operation:batteryCategory:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(ZcBatteryCategory zcBatteryCategory)
{
startPage();
List<ZcBatteryCategory> list = zcBatteryCategoryService.selectZcBatteryCategoryList(zcBatteryCategory);
return getDataTable(list);
}
/**
* 导出电池类别列表
*/
@RequiresPermissions("operation:batteryCategory:export")
@Log(title = "电池类别", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(ZcBatteryCategory zcBatteryCategory)
{
List<ZcBatteryCategory> list = zcBatteryCategoryService.selectZcBatteryCategoryList(zcBatteryCategory);
ExcelUtil<ZcBatteryCategory> util = new ExcelUtil<ZcBatteryCategory>(ZcBatteryCategory.class);
return util.exportExcel(list, "电池类别数据");
}
/**
* 新增电池类别
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存电池类别
*/
@RequiresPermissions("operation:batteryCategory:add")
@Log(title = "电池类别", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(ZcBatteryCategory zcBatteryCategory)
{
return toAjax(zcBatteryCategoryService.insertZcBatteryCategory(zcBatteryCategory));
}
/**
* 修改电池类别
*/
@RequiresPermissions("operation:batteryCategory:edit")
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap)
{
ZcBatteryCategory zcBatteryCategory = zcBatteryCategoryService.selectZcBatteryCategoryById(id);
mmap.put("zcBatteryCategory", zcBatteryCategory);
return prefix + "/edit";
}
/**
* 修改保存电池类别
*/
@RequiresPermissions("operation:batteryCategory:edit")
@Log(title = "电池类别", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(ZcBatteryCategory zcBatteryCategory)
{
return toAjax(zcBatteryCategoryService.updateZcBatteryCategory(zcBatteryCategory));
}
/**
* 删除电池类别
*/
@RequiresPermissions("operation:batteryCategory:remove")
@Log(title = "电池类别", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(zcBatteryCategoryService.deleteZcBatteryCategoryByIds(ids));
}
}

View File

@ -6,9 +6,7 @@ import java.util.List;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.operation.domain.*;
import com.ruoyi.operation.service.IZcCarBrandService;
import com.ruoyi.operation.service.IZcCarModelPackageService;
import com.ruoyi.operation.service.IZcRentCarRuleService;
import com.ruoyi.operation.service.*;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -16,7 +14,6 @@ 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;
@ -42,6 +39,9 @@ public class ZcCarModelController extends BaseController
private IZcCarModelPackageService zcCarModelPackageService;
@Autowired
private IZcCarBrandService zcCarBrandService;
@Autowired
private IZcBatteryCategoryService batteryCategoryService;
@RequiresPermissions("operation:carModel:view")
@GetMapping()
public String carModel(ModelMap mmap)
@ -90,7 +90,8 @@ public class ZcCarModelController extends BaseController
zcRentCarRule.setStatus("0");
List<ZcRentCarRule> rentCarRuleList = zcRentCarRuleService.selectZcRentCarRuleList(zcRentCarRule);
mmap.put("rentCarRuleList", rentCarRuleList);
List<ZcBatteryCategory> batteryCategoryList = batteryCategoryService.selectZcBatteryCategoryList(new ZcBatteryCategory());
mmap.put("batteryCategoryList", batteryCategoryList);
return prefix + "/add";
}
@ -126,6 +127,8 @@ public class ZcCarModelController extends BaseController
mmap.put("rentCarRuleList", rentCarRuleList);
ZcCarModel zcCarModel = zcCarModelService.selectZcCarModelById(id);
mmap.put("zcCarModel", zcCarModel);
List<ZcBatteryCategory> batteryCategoryList = batteryCategoryService.selectZcBatteryCategoryList(new ZcBatteryCategory());
mmap.put("batteryCategoryList", batteryCategoryList);
return prefix + "/edit";
}

View File

@ -0,0 +1,289 @@
package com.ruoyi.operation.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 电池类别对象 zc_battery_category
*
* @author ruoyi
* @date 2025-09-26
*/
public class ZcBatteryCategory extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 电池类别名称 */
@Excel(name = "电池类别名称")
private String categoryName;
/** 产品名称 */
@Excel(name = "产品名称")
private String product;
/** 图标路径 */
@Excel(name = "图标路径")
private String icon;
/** 是否删除(0:否,1:是) */
@Excel(name = "是否删除(0:否,1:是)")
private Integer isDelete;
/** 电压 */
@Excel(name = "电压")
private String voltage;
/** 安时(Ah) */
@Excel(name = "安时(Ah)")
private String ah;
/** 最大电压 */
@Excel(name = "最大电压")
private String maxVoltage;
/** 最大充电电流 */
@Excel(name = "最大充电电流")
private String maxCharge;
/** 批次 */
@Excel(name = "批次")
private Long batch;
/** 说明 */
@Excel(name = "说明")
private String explain;
/** 电芯ID */
@Excel(name = "电芯ID")
private Long cellId;
/** 充电器ID */
@Excel(name = "充电器ID")
private Long chargeId;
/** 操作员ID */
@Excel(name = "操作员ID")
private Long operatorId;
/** 保护板ID */
@Excel(name = "保护板ID")
private Long protectId;
/** 供应商ID */
@Excel(name = "供应商ID")
private Long supplierId;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createdAt;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date updatedAt;
private String remarks;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setCategoryName(String categoryName)
{
this.categoryName = categoryName;
}
public String getCategoryName()
{
return categoryName;
}
public void setProduct(String product)
{
this.product = product;
}
public String getProduct()
{
return product;
}
public void setIcon(String icon)
{
this.icon = icon;
}
public String getIcon()
{
return icon;
}
public void setIsDelete(Integer isDelete)
{
this.isDelete = isDelete;
}
public Integer getIsDelete()
{
return isDelete;
}
public void setVoltage(String voltage)
{
this.voltage = voltage;
}
public String getVoltage()
{
return voltage;
}
public void setAh(String ah)
{
this.ah = ah;
}
public String getAh()
{
return ah;
}
public void setMaxVoltage(String maxVoltage)
{
this.maxVoltage = maxVoltage;
}
public String getMaxVoltage()
{
return maxVoltage;
}
public void setMaxCharge(String maxCharge)
{
this.maxCharge = maxCharge;
}
public String getMaxCharge()
{
return maxCharge;
}
public void setBatch(Long batch)
{
this.batch = batch;
}
public Long getBatch()
{
return batch;
}
public void setExplain(String explain)
{
this.explain = explain;
}
public String getExplain()
{
return explain;
}
public void setCellId(Long cellId)
{
this.cellId = cellId;
}
public Long getCellId()
{
return cellId;
}
public void setChargeId(Long chargeId)
{
this.chargeId = chargeId;
}
public Long getChargeId()
{
return chargeId;
}
public void setOperatorId(Long operatorId)
{
this.operatorId = operatorId;
}
public Long getOperatorId()
{
return operatorId;
}
public void setProtectId(Long protectId)
{
this.protectId = protectId;
}
public Long getProtectId()
{
return protectId;
}
public void setSupplierId(Long supplierId)
{
this.supplierId = supplierId;
}
public Long getSupplierId()
{
return supplierId;
}
public void setCreatedAt(Date createdAt)
{
this.createdAt = createdAt;
}
public Date getCreatedAt()
{
return createdAt;
}
public void setUpdatedAt(Date updatedAt)
{
this.updatedAt = updatedAt;
}
public Date getUpdatedAt()
{
return updatedAt;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("categoryName", getCategoryName())
.append("product", getProduct())
.append("icon", getIcon())
.append("isDelete", getIsDelete())
.append("voltage", getVoltage())
.append("ah", getAh())
.append("maxVoltage", getMaxVoltage())
.append("maxCharge", getMaxCharge())
.append("batch", getBatch())
.append("explain", getExplain())
.append("cellId", getCellId())
.append("chargeId", getChargeId())
.append("operatorId", getOperatorId())
.append("protectId", getProtectId())
.append("supplierId", getSupplierId())
.append("createdAt", getCreatedAt())
.append("updatedAt", getUpdatedAt())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.operation.mapper;
import java.util.List;
import com.ruoyi.operation.domain.ZcBatteryCategory;
/**
* 电池类别Mapper接口
*
* @author ruoyi
* @date 2025-09-26
*/
public interface ZcBatteryCategoryMapper
{
/**
* 查询电池类别
*
* @param id 电池类别主键
* @return 电池类别
*/
public ZcBatteryCategory selectZcBatteryCategoryById(Long id);
/**
* 查询电池类别列表
*
* @param zcBatteryCategory 电池类别
* @return 电池类别集合
*/
public List<ZcBatteryCategory> selectZcBatteryCategoryList(ZcBatteryCategory zcBatteryCategory);
/**
* 新增电池类别
*
* @param zcBatteryCategory 电池类别
* @return 结果
*/
public int insertZcBatteryCategory(ZcBatteryCategory zcBatteryCategory);
/**
* 修改电池类别
*
* @param zcBatteryCategory 电池类别
* @return 结果
*/
public int updateZcBatteryCategory(ZcBatteryCategory zcBatteryCategory);
/**
* 删除电池类别
*
* @param id 电池类别主键
* @return 结果
*/
public int deleteZcBatteryCategoryById(Long id);
/**
* 批量删除电池类别
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteZcBatteryCategoryByIds(String[] ids);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.operation.service;
import java.util.List;
import com.ruoyi.operation.domain.ZcBatteryCategory;
/**
* 电池类别Service接口
*
* @author ruoyi
* @date 2025-09-26
*/
public interface IZcBatteryCategoryService
{
/**
* 查询电池类别
*
* @param id 电池类别主键
* @return 电池类别
*/
public ZcBatteryCategory selectZcBatteryCategoryById(Long id);
/**
* 查询电池类别列表
*
* @param zcBatteryCategory 电池类别
* @return 电池类别集合
*/
public List<ZcBatteryCategory> selectZcBatteryCategoryList(ZcBatteryCategory zcBatteryCategory);
/**
* 新增电池类别
*
* @param zcBatteryCategory 电池类别
* @return 结果
*/
public int insertZcBatteryCategory(ZcBatteryCategory zcBatteryCategory);
/**
* 修改电池类别
*
* @param zcBatteryCategory 电池类别
* @return 结果
*/
public int updateZcBatteryCategory(ZcBatteryCategory zcBatteryCategory);
/**
* 批量删除电池类别
*
* @param ids 需要删除的电池类别主键集合
* @return 结果
*/
public int deleteZcBatteryCategoryByIds(String ids);
/**
* 删除电池类别信息
*
* @param id 电池类别主键
* @return 结果
*/
public int deleteZcBatteryCategoryById(Long id);
}

View File

@ -0,0 +1,94 @@
package com.ruoyi.operation.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.operation.mapper.ZcBatteryCategoryMapper;
import com.ruoyi.operation.domain.ZcBatteryCategory;
import com.ruoyi.operation.service.IZcBatteryCategoryService;
import com.ruoyi.common.core.text.Convert;
/**
* 电池类别Service业务层处理
*
* @author ruoyi
* @date 2025-09-26
*/
@Service
public class ZcBatteryCategoryServiceImpl implements IZcBatteryCategoryService
{
@Autowired
private ZcBatteryCategoryMapper zcBatteryCategoryMapper;
/**
* 查询电池类别
*
* @param id 电池类别主键
* @return 电池类别
*/
@Override
public ZcBatteryCategory selectZcBatteryCategoryById(Long id)
{
return zcBatteryCategoryMapper.selectZcBatteryCategoryById(id);
}
/**
* 查询电池类别列表
*
* @param zcBatteryCategory 电池类别
* @return 电池类别
*/
@Override
public List<ZcBatteryCategory> selectZcBatteryCategoryList(ZcBatteryCategory zcBatteryCategory)
{
return zcBatteryCategoryMapper.selectZcBatteryCategoryList(zcBatteryCategory);
}
/**
* 新增电池类别
*
* @param zcBatteryCategory 电池类别
* @return 结果
*/
@Override
public int insertZcBatteryCategory(ZcBatteryCategory zcBatteryCategory)
{
return zcBatteryCategoryMapper.insertZcBatteryCategory(zcBatteryCategory);
}
/**
* 修改电池类别
*
* @param zcBatteryCategory 电池类别
* @return 结果
*/
@Override
public int updateZcBatteryCategory(ZcBatteryCategory zcBatteryCategory)
{
return zcBatteryCategoryMapper.updateZcBatteryCategory(zcBatteryCategory);
}
/**
* 批量删除电池类别
*
* @param ids 需要删除的电池类别主键
* @return 结果
*/
@Override
public int deleteZcBatteryCategoryByIds(String ids)
{
return zcBatteryCategoryMapper.deleteZcBatteryCategoryByIds(Convert.toStrArray(ids));
}
/**
* 删除电池类别信息
*
* @param id 电池类别主键
* @return 结果
*/
@Override
public int deleteZcBatteryCategoryById(Long id)
{
return zcBatteryCategoryMapper.deleteZcBatteryCategoryById(id);
}
}

View File

@ -0,0 +1,128 @@
<?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.ZcBatteryCategoryMapper">
<resultMap type="ZcBatteryCategory" id="ZcBatteryCategoryResult">
<result property="id" column="id" />
<result property="categoryName" column="category_name" />
<result property="product" column="product" />
<result property="icon" column="icon" />
<result property="isDelete" column="is_delete" />
<result property="voltage" column="voltage" />
<result property="ah" column="ah" />
<result property="maxVoltage" column="max_voltage" />
<result property="maxCharge" column="max_charge" />
<result property="batch" column="batch" />
<result property="cellId" column="cell_id" />
<result property="chargeId" column="charge_id" />
<result property="operatorId" column="operator_id" />
<result property="protectId" column="protect_id" />
<result property="supplierId" column="supplier_id" />
<result property="createdAt" column="created_at" />
<result property="updatedAt" column="updated_at" />
<result property="remarks" column="remarks" />
</resultMap>
<sql id="selectZcBatteryCategoryVo">
select id, category_name, product, icon, is_delete, voltage, ah, max_voltage, max_charge, batch, cell_id, charge_id, operator_id, protect_id, supplier_id ,
CONCAT(category_name,'/',product) as remarks
from zc_battery_category
</sql>
<select id="selectZcBatteryCategoryList" parameterType="ZcBatteryCategory" resultMap="ZcBatteryCategoryResult">
<include refid="selectZcBatteryCategoryVo"/>
<where>
<if test="categoryName != null and categoryName != ''"> and category_name like concat('%', #{categoryName}, '%')</if>
<if test="product != null and product != ''"> and product = #{product}</if>
<if test="icon != null and icon != ''"> and icon = #{icon}</if>
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
<if test="voltage != null and voltage != ''"> and voltage = #{voltage}</if>
<if test="ah != null and ah != ''"> and ah = #{ah}</if>
<if test="maxVoltage != null and maxVoltage != ''"> and max_voltage = #{maxVoltage}</if>
<if test="maxCharge != null and maxCharge != ''"> and max_charge = #{maxCharge}</if>
<if test="batch != null "> and batch = #{batch}</if>
</where>
</select>
<select id="selectZcBatteryCategoryById" parameterType="Long" resultMap="ZcBatteryCategoryResult">
<include refid="selectZcBatteryCategoryVo"/>
where id = #{id}
</select>
<insert id="insertZcBatteryCategory" parameterType="ZcBatteryCategory" useGeneratedKeys="true" keyProperty="id">
insert into zc_battery_category
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="categoryName != null and categoryName != ''">category_name,</if>
<if test="product != null and product != ''">product,</if>
<if test="icon != null">icon,</if>
<if test="isDelete != null">is_delete,</if>
<if test="voltage != null and voltage != ''">voltage,</if>
<if test="ah != null and ah != ''">ah,</if>
<if test="maxVoltage != null and maxVoltage != ''">max_voltage,</if>
<if test="maxCharge != null and maxCharge != ''">max_charge,</if>
<if test="batch != null">batch,</if>
<if test="cellId != null">cell_id,</if>
<if test="chargeId != null">charge_id,</if>
<if test="operatorId != null">operator_id,</if>
<if test="protectId != null">protect_id,</if>
<if test="supplierId != null">supplier_id,</if>
<if test="createdAt != null">created_at,</if>
<if test="updatedAt != null">updated_at,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="categoryName != null and categoryName != ''">#{categoryName},</if>
<if test="product != null and product != ''">#{product},</if>
<if test="icon != null">#{icon},</if>
<if test="isDelete != null">#{isDelete},</if>
<if test="voltage != null and voltage != ''">#{voltage},</if>
<if test="ah != null and ah != ''">#{ah},</if>
<if test="maxVoltage != null and maxVoltage != ''">#{maxVoltage},</if>
<if test="maxCharge != null and maxCharge != ''">#{maxCharge},</if>
<if test="batch != null">#{batch},</if>
<if test="cellId != null">#{cellId},</if>
<if test="chargeId != null">#{chargeId},</if>
<if test="operatorId != null">#{operatorId},</if>
<if test="protectId != null">#{protectId},</if>
<if test="supplierId != null">#{supplierId},</if>
<if test="createdAt != null">#{createdAt},</if>
<if test="updatedAt != null">#{updatedAt},</if>
</trim>
</insert>
<update id="updateZcBatteryCategory" parameterType="ZcBatteryCategory">
update zc_battery_category
<trim prefix="SET" suffixOverrides=",">
<if test="categoryName != null and categoryName != ''">category_name = #{categoryName},</if>
<if test="product != null and product != ''">product = #{product},</if>
<if test="icon != null">icon = #{icon},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="voltage != null and voltage != ''">voltage = #{voltage},</if>
<if test="ah != null and ah != ''">ah = #{ah},</if>
<if test="maxVoltage != null and maxVoltage != ''">max_voltage = #{maxVoltage},</if>
<if test="maxCharge != null and maxCharge != ''">max_charge = #{maxCharge},</if>
<if test="batch != null">batch = #{batch},</if>
<if test="cellId != null">cell_id = #{cellId},</if>
<if test="chargeId != null">charge_id = #{chargeId},</if>
<if test="operatorId != null">operator_id = #{operatorId},</if>
<if test="protectId != null">protect_id = #{protectId},</if>
<if test="supplierId != null">supplier_id = #{supplierId},</if>
<if test="createdAt != null">created_at = #{createdAt},</if>
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZcBatteryCategoryById" parameterType="Long">
delete from zc_battery_category where id = #{id}
</delete>
<delete id="deleteZcBatteryCategoryByIds" parameterType="String">
delete from zc_battery_category where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,147 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增电池类别')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-batteryCategory-add">
<div class="form-group">
<label class="col-sm-3 control-label is-required">电池类别名称:</label>
<div class="col-sm-8">
<input name="categoryName" 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="product" 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">
<input name="icon" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否删除(0:否,1:是)</label>
<div class="col-sm-8">
<input name="isDelete" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">电压:</label>
<div class="col-sm-8">
<input name="voltage" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">安时(Ah)</label>
<div class="col-sm-8">
<input name="ah" 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="maxVoltage" 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="maxCharge" 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">
<input name="batch" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">说明:</label>
<div class="col-sm-8">
<textarea name="explain" class="form-control"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">电芯ID</label>
<div class="col-sm-8">
<input name="cellId" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">充电器ID</label>
<div class="col-sm-8">
<input name="chargeId" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">操作员ID</label>
<div class="col-sm-8">
<input name="operatorId" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">保护板ID</label>
<div class="col-sm-8">
<input name="protectId" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">供应商ID</label>
<div class="col-sm-8">
<input name="supplierId" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="createdAt" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">更新时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="updatedAt" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "operation/batteryCategory"
$("#form-batteryCategory-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-batteryCategory-add').serialize());
}
}
$("input[name='createdAt']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='updatedAt']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

View File

@ -0,0 +1,210 @@
<!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="categoryName"/>
</li>
<li>
<label>产品名称:</label>
<input type="text" name="product"/>
</li>
<li>
<label>图标路径:</label>
<input type="text" name="icon"/>
</li>
<li>
<label>是否删除(0:否,1:是)</label>
<input type="text" name="isDelete"/>
</li>
<li>
<label>电压:</label>
<input type="text" name="voltage"/>
</li>
<li>
<label>安时(Ah)</label>
<input type="text" name="ah"/>
</li>
<li>
<label>最大电压:</label>
<input type="text" name="maxVoltage"/>
</li>
<li>
<label>最大充电电流:</label>
<input type="text" name="maxCharge"/>
</li>
<li>
<label>批次:</label>
<input type="text" name="batch"/>
</li>
<li>
<label>电芯ID</label>
<input type="text" name="cellId"/>
</li>
<li>
<label>充电器ID</label>
<input type="text" name="chargeId"/>
</li>
<li>
<label>操作员ID</label>
<input type="text" name="operatorId"/>
</li>
<li>
<label>保护板ID</label>
<input type="text" name="protectId"/>
</li>
<li>
<label>供应商ID</label>
<input type="text" name="supplierId"/>
</li>
<li>
<label>创建时间:</label>
<input type="text" class="time-input" placeholder="请选择创建时间" name="createdAt"/>
</li>
<li>
<label>更新时间:</label>
<input type="text" class="time-input" placeholder="请选择更新时间" name="updatedAt"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="operation:batteryCategory:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="operation:batteryCategory:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="operation:batteryCategory:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="operation:batteryCategory:export">
<i class="fa fa-download"></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:batteryCategory:edit')}]];
var removeFlag = [[${@permission.hasPermi('operation:batteryCategory:remove')}]];
var prefix = ctx + "operation/batteryCategory";
$(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: 'categoryName',
title: '电池类别名称'
},
{
field: 'product',
title: '产品名称'
},
{
field: 'icon',
title: '图标路径'
},
{
field: 'isDelete',
title: '是否删除(0:否,1:是)'
},
{
field: 'voltage',
title: '电压'
},
{
field: 'ah',
title: '安时(Ah)'
},
{
field: 'maxVoltage',
title: '最大电压'
},
{
field: 'maxCharge',
title: '最大充电电流'
},
{
field: 'batch',
title: '批次'
},
{
field: 'explain',
title: '说明'
},
{
field: 'cellId',
title: '电芯ID'
},
{
field: 'chargeId',
title: '充电器ID'
},
{
field: 'operatorId',
title: '操作员ID'
},
{
field: 'protectId',
title: '保护板ID'
},
{
field: 'supplierId',
title: '供应商ID'
},
{
field: 'createdAt',
title: '创建时间'
},
{
field: 'updatedAt',
title: '更新时间'
},
{
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);
});
</script>
</body>
</html>

View File

@ -0,0 +1,148 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改电池类别')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-batteryCategory-edit" th:object="${zcBatteryCategory}">
<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="categoryName" th:field="*{categoryName}" 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="product" th:field="*{product}" 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">
<input name="icon" th:field="*{icon}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否删除(0:否,1:是)</label>
<div class="col-sm-8">
<input name="isDelete" th:field="*{isDelete}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">电压:</label>
<div class="col-sm-8">
<input name="voltage" th:field="*{voltage}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">安时(Ah)</label>
<div class="col-sm-8">
<input name="ah" th:field="*{ah}" 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="maxVoltage" th:field="*{maxVoltage}" 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="maxCharge" th:field="*{maxCharge}" 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">
<input name="batch" th:field="*{batch}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">说明:</label>
<div class="col-sm-8">
<textarea name="explain" class="form-control">[[*{explain}]]</textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">电芯ID</label>
<div class="col-sm-8">
<input name="cellId" th:field="*{cellId}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">充电器ID</label>
<div class="col-sm-8">
<input name="chargeId" th:field="*{chargeId}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">操作员ID</label>
<div class="col-sm-8">
<input name="operatorId" th:field="*{operatorId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">保护板ID</label>
<div class="col-sm-8">
<input name="protectId" th:field="*{protectId}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">供应商ID</label>
<div class="col-sm-8">
<input name="supplierId" th:field="*{supplierId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="createdAt" th:value="${#dates.format(zcBatteryCategory.createdAt, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">更新时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="updatedAt" th:value="${#dates.format(zcBatteryCategory.updatedAt, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "operation/batteryCategory";
$("#form-batteryCategory-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-batteryCategory-edit').serialize());
}
}
$("input[name='createdAt']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='updatedAt']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

View File

@ -32,8 +32,8 @@
<div class="form-group">
<label class="col-sm-2 control-label is-required">支持电池类型:</label>
<div class="col-sm-9">
<select name="batteryType" class="form-control m-b select2-multiple" multiple th:with="type=${@dict.getType('key_car_battery_type')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
<select name="batteryType" id="batteryType" class="form-control m-b select2-multiple" multiple required>
<option th:each="batteryCategory : ${batteryCategoryList}" th:value="${batteryCategory.remarks}" th:text="${batteryCategory.remarks}"></option>
</select>
</div>
</div>
@ -54,7 +54,7 @@
<div class="col-sm-9">
<input type="hidden" name="image">
<div class="file-loading">
<input class="form-control file-upload" id="image" name="file" type="file" required>
<input class="form-control file-upload" id="image" name="file" type="file" >
</div>
</div>
</div>

View File

@ -35,8 +35,8 @@
<div class="form-group">
<label class="col-sm-2 control-label is-required">支持电池类型:</label>
<div class="col-sm-9">
<select name="batteryType" class="form-control m-b select2-multiple" multiple th:with="type=${@dict.getType('key_car_battery_type')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{batteryType}"></option>
<select name="batteryType" id="batteryType" class="form-control m-b select2-multiple" multiple required>
<option th:each="batteryCategory : ${batteryCategoryList}" th:value="${batteryCategory.remarks}" th:text="${batteryCategory.remarks}"></option>
</select>
</div>
</div>

View File

@ -142,10 +142,7 @@
},
{
field: 'batteryType',
title: '支持电池类型',
formatter: function(value, row, index) {
return $.table.selectDictLabel(batteryTypeDatas, value);
}
title: '支持电池类型'
},
{
field: 'weight',