车型与套餐
This commit is contained in:
@ -97,21 +97,7 @@ public class ZcCarModelController extends BaseController
|
|||||||
public AjaxResult addSave(@RequestParam("rentCarRuleIds") List<Long> rentCarRuleIds, ZcCarModel zcCarModel)
|
public AjaxResult addSave(@RequestParam("rentCarRuleIds") List<Long> rentCarRuleIds, ZcCarModel zcCarModel)
|
||||||
{
|
{
|
||||||
zcCarModel.setCreateBy(getLoginName());
|
zcCarModel.setCreateBy(getLoginName());
|
||||||
int flag = zcCarModelService.insertZcCarModel(zcCarModel);
|
return toAjax(zcCarModelService.insertZcCarModel(rentCarRuleIds, 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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -121,6 +107,9 @@ public class ZcCarModelController extends BaseController
|
|||||||
@GetMapping("/edit/{id}")
|
@GetMapping("/edit/{id}")
|
||||||
public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
List<ZcRentCarRule> rentCarRuleList = zcRentCarRuleService.selectZcRentCarRuleListByCarModelId(id);
|
||||||
|
mmap.put("rentCarRuleList", rentCarRuleList);
|
||||||
ZcCarModel zcCarModel = zcCarModelService.selectZcCarModelById(id);
|
ZcCarModel zcCarModel = zcCarModelService.selectZcCarModelById(id);
|
||||||
mmap.put("zcCarModel", zcCarModel);
|
mmap.put("zcCarModel", zcCarModel);
|
||||||
return prefix + "/edit";
|
return prefix + "/edit";
|
||||||
@ -133,10 +122,10 @@ public class ZcCarModelController extends BaseController
|
|||||||
@Log(title = "车型管理", businessType = BusinessType.UPDATE)
|
@Log(title = "车型管理", businessType = BusinessType.UPDATE)
|
||||||
@PostMapping("/edit")
|
@PostMapping("/edit")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult editSave(ZcCarModel zcCarModel)
|
public AjaxResult editSave(@RequestParam("rentCarRuleIds") List<Long> rentCarRuleIds, ZcCarModel zcCarModel)
|
||||||
{
|
{
|
||||||
zcCarModel.setUpdateBy(getLoginName());
|
zcCarModel.setUpdateBy(getLoginName());
|
||||||
return toAjax(zcCarModelService.updateZcCarModel(zcCarModel));
|
return toAjax(zcCarModelService.updateZcCarModel(rentCarRuleIds,zcCarModel));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
package com.ruoyi.operation.domain;
|
package com.ruoyi.operation.domain;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
@ -55,6 +57,9 @@ public class ZcCarModel extends BaseEntity
|
|||||||
/** 扩展字段3 */
|
/** 扩展字段3 */
|
||||||
private String extend3;
|
private String extend3;
|
||||||
|
|
||||||
|
private List<ZcRentCarRule> rentCarRuleList;
|
||||||
|
|
||||||
|
|
||||||
public void setId(Long id)
|
public void setId(Long id)
|
||||||
{
|
{
|
||||||
this.id = id;
|
this.id = id;
|
||||||
@ -164,6 +169,14 @@ public class ZcCarModel extends BaseEntity
|
|||||||
return extend3;
|
return extend3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<ZcRentCarRule> getRentCarRuleList() {
|
||||||
|
return rentCarRuleList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRentCarRuleList(List<ZcRentCarRule> rentCarRuleList) {
|
||||||
|
this.rentCarRuleList = rentCarRuleList;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|||||||
@ -89,6 +89,11 @@ public class ZcRentCarRule extends BaseEntity
|
|||||||
/** 扩展字段5 */
|
/** 扩展字段5 */
|
||||||
private String extend5;
|
private String extend5;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
private Long carRuleId;
|
||||||
|
/** 车型是否关联此套餐标识 默认不存在 */
|
||||||
|
@Transient
|
||||||
|
private boolean flag = false;
|
||||||
@Transient
|
@Transient
|
||||||
private String operatingCompanyName;
|
private String operatingCompanyName;
|
||||||
|
|
||||||
@ -281,10 +286,29 @@ public class ZcRentCarRule extends BaseEntity
|
|||||||
this.operatingCompanyName = operatingCompanyName;
|
this.operatingCompanyName = operatingCompanyName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getCarRuleId() {
|
||||||
|
return carRuleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCarRuleId(Long carRuleId) {
|
||||||
|
this.id = carRuleId;
|
||||||
|
this.carRuleId = carRuleId;
|
||||||
|
}
|
||||||
|
public boolean isFlag()
|
||||||
|
{
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlag(boolean flag)
|
||||||
|
{
|
||||||
|
this.flag = flag;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
.append("id", getId())
|
.append("id", getId())
|
||||||
|
.append("carRuleId", getCarRuleId())
|
||||||
.append("ruleName", getRuleName())
|
.append("ruleName", getRuleName())
|
||||||
.append("ruleCode", getRuleCode())
|
.append("ruleCode", getRuleCode())
|
||||||
.append("rentalType", getRentalType())
|
.append("rentalType", getRentalType())
|
||||||
|
|||||||
@ -54,6 +54,7 @@ public interface ZcCarModelPackageMapper
|
|||||||
*/
|
*/
|
||||||
public int deleteZcCarModelPackageById(Long id);
|
public int deleteZcCarModelPackageById(Long id);
|
||||||
|
|
||||||
|
public int deleteZcCarModelPackageByModeId(Long modeId);
|
||||||
/**
|
/**
|
||||||
* 批量删除车型与租车规则关联
|
* 批量删除车型与租车规则关联
|
||||||
*
|
*
|
||||||
|
|||||||
@ -52,6 +52,7 @@ public interface IZcCarModelPackageService
|
|||||||
*/
|
*/
|
||||||
public int deleteZcCarModelPackageByIds(String ids);
|
public int deleteZcCarModelPackageByIds(String ids);
|
||||||
|
|
||||||
|
public int deleteZcCarModelPackageByModeId(Long modeId);
|
||||||
/**
|
/**
|
||||||
* 删除车型与租车规则关联信息
|
* 删除车型与租车规则关联信息
|
||||||
*
|
*
|
||||||
|
|||||||
@ -33,7 +33,7 @@ public interface IZcCarModelService
|
|||||||
* @param zcCarModel 车型管理
|
* @param zcCarModel 车型管理
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertZcCarModel(ZcCarModel zcCarModel);
|
public int insertZcCarModel(List<Long> rentCarRuleIds, ZcCarModel zcCarModel);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改车型管理
|
* 修改车型管理
|
||||||
@ -43,6 +43,8 @@ public interface IZcCarModelService
|
|||||||
*/
|
*/
|
||||||
public int updateZcCarModel(ZcCarModel zcCarModel);
|
public int updateZcCarModel(ZcCarModel zcCarModel);
|
||||||
|
|
||||||
|
public int updateZcCarModel(List<Long> rentCarRuleIds, ZcCarModel zcCarModel);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除车型管理
|
* 批量删除车型管理
|
||||||
*
|
*
|
||||||
|
|||||||
@ -28,6 +28,8 @@ public interface IZcRentCarRuleService
|
|||||||
*/
|
*/
|
||||||
public List<ZcRentCarRule> selectZcRentCarRuleList(ZcRentCarRule zcRentCarRule);
|
public List<ZcRentCarRule> selectZcRentCarRuleList(ZcRentCarRule zcRentCarRule);
|
||||||
|
|
||||||
|
public List<ZcRentCarRule> selectZcRentCarRuleListByCarModelId(Long carModelId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增租车计费规则
|
* 新增租车计费规则
|
||||||
*
|
*
|
||||||
|
|||||||
@ -88,6 +88,13 @@ public class ZcCarModelPackageServiceImpl implements IZcCarModelPackageService
|
|||||||
return zcCarModelPackageMapper.deleteZcCarModelPackageByIds(Convert.toStrArray(ids));
|
return zcCarModelPackageMapper.deleteZcCarModelPackageByIds(Convert.toStrArray(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteZcCarModelPackageByModeId(Long modeId)
|
||||||
|
{
|
||||||
|
return zcCarModelPackageMapper.deleteZcCarModelPackageByModeId(modeId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除车型与租车规则关联信息
|
* 删除车型与租车规则关联信息
|
||||||
*
|
*
|
||||||
|
|||||||
@ -1,13 +1,18 @@
|
|||||||
package com.ruoyi.operation.service.impl;
|
package com.ruoyi.operation.service.impl;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import com.ruoyi.operation.domain.ZcCarModelPackage;
|
||||||
|
import com.ruoyi.operation.service.IZcCarModelPackageService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.operation.mapper.ZcCarModelMapper;
|
import com.ruoyi.operation.mapper.ZcCarModelMapper;
|
||||||
import com.ruoyi.operation.domain.ZcCarModel;
|
import com.ruoyi.operation.domain.ZcCarModel;
|
||||||
import com.ruoyi.operation.service.IZcCarModelService;
|
import com.ruoyi.operation.service.IZcCarModelService;
|
||||||
import com.ruoyi.common.core.text.Convert;
|
import com.ruoyi.common.core.text.Convert;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车型管理Service业务层处理
|
* 车型管理Service业务层处理
|
||||||
@ -20,7 +25,8 @@ public class ZcCarModelServiceImpl implements IZcCarModelService
|
|||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private ZcCarModelMapper zcCarModelMapper;
|
private ZcCarModelMapper zcCarModelMapper;
|
||||||
|
@Autowired
|
||||||
|
private IZcCarModelPackageService zcCarModelPackageService;
|
||||||
/**
|
/**
|
||||||
* 查询车型管理
|
* 查询车型管理
|
||||||
*
|
*
|
||||||
@ -52,11 +58,27 @@ public class ZcCarModelServiceImpl implements IZcCarModelService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertZcCarModel(ZcCarModel zcCarModel)
|
@Transactional
|
||||||
|
public int insertZcCarModel(List<Long> rentCarRuleIds, ZcCarModel zcCarModel)
|
||||||
{
|
{
|
||||||
zcCarModel.setCreateTime(DateUtils.getNowDate());
|
zcCarModel.setCreateTime(DateUtils.getNowDate());
|
||||||
zcCarModel.setUpdateTime(DateUtils.getNowDate());
|
zcCarModel.setUpdateTime(DateUtils.getNowDate());
|
||||||
return zcCarModelMapper.insertZcCarModel(zcCarModel);
|
int flag = zcCarModelMapper.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 flag;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -72,6 +94,29 @@ public class ZcCarModelServiceImpl implements IZcCarModelService
|
|||||||
return zcCarModelMapper.updateZcCarModel(zcCarModel);
|
return zcCarModelMapper.updateZcCarModel(zcCarModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public int updateZcCarModel(List<Long> rentCarRuleIds,ZcCarModel zcCarModel)
|
||||||
|
{
|
||||||
|
zcCarModel.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
int flag = zcCarModelMapper.updateZcCarModel(zcCarModel);
|
||||||
|
|
||||||
|
zcCarModelPackageService.deleteZcCarModelPackageByModeId(zcCarModel.getId());
|
||||||
|
// 保存关联表 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 flag;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除车型管理
|
* 批量删除车型管理
|
||||||
*
|
*
|
||||||
|
|||||||
@ -1,7 +1,13 @@
|
|||||||
package com.ruoyi.operation.service.impl;
|
package com.ruoyi.operation.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import com.ruoyi.operation.domain.ZcCarModelPackage;
|
||||||
|
import com.ruoyi.operation.domain.ZcRentCarRuleBattery;
|
||||||
|
import com.ruoyi.operation.service.IZcCarModelPackageService;
|
||||||
|
import com.ruoyi.operation.service.IZcRentCarRuleBatteryService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.operation.mapper.ZcRentCarRuleMapper;
|
import com.ruoyi.operation.mapper.ZcRentCarRuleMapper;
|
||||||
@ -20,7 +26,8 @@ public class ZcRentCarRuleServiceImpl implements IZcRentCarRuleService
|
|||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private ZcRentCarRuleMapper zcRentCarRuleMapper;
|
private ZcRentCarRuleMapper zcRentCarRuleMapper;
|
||||||
|
@Autowired
|
||||||
|
private IZcCarModelPackageService zcCarModelPackageService;
|
||||||
/**
|
/**
|
||||||
* 查询租车计费规则
|
* 查询租车计费规则
|
||||||
*
|
*
|
||||||
@ -45,6 +52,29 @@ public class ZcRentCarRuleServiceImpl implements IZcRentCarRuleService
|
|||||||
return zcRentCarRuleMapper.selectZcRentCarRuleList(zcRentCarRule);
|
return zcRentCarRuleMapper.selectZcRentCarRuleList(zcRentCarRule);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ZcRentCarRule> selectZcRentCarRuleListByCarModelId(Long carModelId)
|
||||||
|
{
|
||||||
|
ZcRentCarRule zcRentCarRule = new ZcRentCarRule();
|
||||||
|
zcRentCarRule.setStatus("0");
|
||||||
|
List<ZcRentCarRule> rentCarRuleList = zcRentCarRuleMapper.selectZcRentCarRuleList(zcRentCarRule);
|
||||||
|
ZcCarModelPackage zcCarModelPackage = new ZcCarModelPackage();
|
||||||
|
zcCarModelPackage.setCarModelId(carModelId);
|
||||||
|
List<ZcCarModelPackage> carModeBatteryList = zcCarModelPackageService.selectZcCarModelPackageList(zcCarModelPackage);
|
||||||
|
for (ZcRentCarRule rcr : rentCarRuleList)
|
||||||
|
{
|
||||||
|
for (ZcCarModelPackage modeRcr : carModeBatteryList)
|
||||||
|
{
|
||||||
|
if (rcr.getId().longValue() == modeRcr.getCarRuleId().longValue())
|
||||||
|
{
|
||||||
|
rcr.setFlag(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rentCarRuleList;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增租车计费规则
|
* 新增租车计费规则
|
||||||
*
|
*
|
||||||
|
|||||||
@ -22,12 +22,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="extend1" column="extend1" />
|
<result property="extend1" column="extend1" />
|
||||||
<result property="extend2" column="extend2" />
|
<result property="extend2" column="extend2" />
|
||||||
<result property="extend3" column="extend3" />
|
<result property="extend3" column="extend3" />
|
||||||
|
|
||||||
|
<collection property="rentCarRuleList" javaType="java.util.List" resultMap="RentCarRuleResult" />
|
||||||
|
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap id="RentCarRuleResult" type="ZcRentCarRule">
|
||||||
|
<id property="carRuleId" column="carRuleId" />
|
||||||
|
<result property="ruleName" column="rule_name" />
|
||||||
|
<result property="ruleCode" column="rule_code" />
|
||||||
|
<result property="rentalType" column="rental_type" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectZcCarModelVo">
|
<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
|
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>
|
</sql>
|
||||||
|
<sql id="selectZcCarModelVo2">
|
||||||
|
select u.*,
|
||||||
|
r.id as carRuleId, r.rule_name, r.rule_code, r.rental_type
|
||||||
|
from zc_car_model u
|
||||||
|
left join zc_car_model_package p on u.id = p.car_model_id
|
||||||
|
left join zc_rent_car_rule r on r.id = p.car_rule_id
|
||||||
|
</sql>
|
||||||
<select id="selectZcCarModelList" parameterType="ZcCarModel" resultMap="ZcCarModelResult">
|
<select id="selectZcCarModelList" parameterType="ZcCarModel" resultMap="ZcCarModelResult">
|
||||||
<include refid="selectZcCarModelVo"/>
|
<include refid="selectZcCarModelVo"/>
|
||||||
<where>
|
<where>
|
||||||
@ -38,8 +54,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectZcCarModelById" parameterType="Long" resultMap="ZcCarModelResult">
|
<select id="selectZcCarModelById" parameterType="Long" resultMap="ZcCarModelResult">
|
||||||
<include refid="selectZcCarModelVo"/>
|
<include refid="selectZcCarModelVo2"/>
|
||||||
where id = #{id}
|
where u.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertZcCarModel" parameterType="ZcCarModel" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertZcCarModel" parameterType="ZcCarModel" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
|||||||
@ -90,5 +90,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
<delete id="deleteZcCarModelPackageByModeId">
|
||||||
|
delete from zc_car_model_package where car_model_id = #{modeId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -7,24 +7,26 @@
|
|||||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||||
<form class="form-horizontal m" id="form-carModel-edit" th:object="${zcCarModel}">
|
<form class="form-horizontal m" id="form-carModel-edit" th:object="${zcCarModel}">
|
||||||
<input name="id" th:field="*{id}" type="hidden">
|
<input name="id" th:field="*{id}" type="hidden">
|
||||||
|
<input type="hidden" id="rentCarRuleIds" name="rentCarRuleIds">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label is-required">品牌名称:</label>
|
<label class="col-sm-2 control-label is-required">品牌名称:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-6">
|
||||||
<input name="brandName" th:field="*{brandName}" class="form-control" type="text" required>
|
<input name="brandName" th:field="*{brandName}" class="form-control" type="text" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label is-required">车型名称:</label>
|
<label class="col-sm-2 control-label is-required">车型名称:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-6">
|
||||||
<input name="modelName" th:field="*{modelName}" class="form-control" type="text" required>
|
<input name="modelName" th:field="*{modelName}" class="form-control" type="text" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<h4 class="form-header h4">关联套餐</h4>
|
||||||
<label class="col-sm-3 control-label">备注:</label>
|
<div class="row">
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-12">
|
||||||
<textarea name="remark" class="form-control">[[*{remark}]]</textarea>
|
<div class="col-sm-12 select-table table-striped">
|
||||||
|
<table id="bootstrap-table"></table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@ -32,11 +34,111 @@
|
|||||||
<th:block th:include="include :: footer" />
|
<th:block th:include="include :: footer" />
|
||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
var prefix = ctx + "operation/carModel";
|
var prefix = ctx + "operation/carModel";
|
||||||
$("#form-carModel-edit").validate({
|
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
|
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() {
|
function submitHandler() {
|
||||||
|
var rows = $.table.selectFirstColumns();
|
||||||
|
$("#rentCarRuleIds").val(rows.join())
|
||||||
if ($.validate.form()) {
|
if ($.validate.form()) {
|
||||||
$.operate.save(prefix + "/edit", $('#form-carModel-edit').serialize());
|
$.operate.save(prefix + "/edit", $('#form-carModel-edit').serialize());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user