订单列表

This commit is contained in:
19173159168
2025-07-24 00:14:37 +08:00
parent 7700722989
commit 769a0609d5
18 changed files with 2929 additions and 0 deletions

View File

@ -0,0 +1,143 @@
package com.ruoyi.orders.controller;
import java.util.List;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.operation.domain.Company;
import com.ruoyi.operation.service.ICompanyService;
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.orders.domain.ZcOrderMain;
import com.ruoyi.orders.service.IZcOrderMainService;
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-19
*/
@Controller
@RequestMapping("/orders/order")
public class ZcOrderMainController extends BaseController
{
private String prefix = "orders/order";
@Autowired
private IZcOrderMainService zcOrderMainService;
@Autowired
private ICompanyService companyService;
@RequiresPermissions("orders:order:view")
@GetMapping()
public String order(ModelMap mmap)
{
List<Company> companyList = companyService.getCompanyList(new Company(),getSysUser()); // 获取运营商列表
mmap.put("companyList", companyList); // 将运营商列表传递到前端
return prefix + "/order";
}
/**
* 查询租车订单列表
*/
@RequiresPermissions("orders:order:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(ZcOrderMain zcOrderMain)
{
startPage();
// 运营者账号,只能查询所属商户数据
if(UserConstants.USER_TYPE_02 .equals(getSysUser().getUserType())){
zcOrderMain.setOperatorId(getSysUser().getGroupId());
}
List<ZcOrderMain> list = zcOrderMainService.selectZcOrderMainList(zcOrderMain);
return getDataTable(list);
}
/**
* 导出租车订单列表
*/
@RequiresPermissions("orders:order:export")
@Log(title = "租车订单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(ZcOrderMain zcOrderMain)
{
// 运营者账号,只能查询所属商户数据
if(UserConstants.USER_TYPE_02 .equals(getSysUser().getUserType())){
zcOrderMain.setOperatorId(getSysUser().getGroupId());
}
List<ZcOrderMain> list = zcOrderMainService.selectZcOrderMainList(zcOrderMain);
ExcelUtil<ZcOrderMain> util = new ExcelUtil<ZcOrderMain>(ZcOrderMain.class);
return util.exportExcel(list, "租车订单数据");
}
/**
* 新增租车订单
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存租车订单
*/
@RequiresPermissions("orders:order:add")
@Log(title = "租车订单", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(ZcOrderMain zcOrderMain)
{
return toAjax(zcOrderMainService.insertZcOrderMain(zcOrderMain));
}
/**
* 修改租车订单
*/
@RequiresPermissions("orders:order:edit")
@GetMapping("/edit/{orderId}")
public String edit(@PathVariable("orderId") Long orderId, ModelMap mmap)
{
ZcOrderMain zcOrderMain = zcOrderMainService.selectZcOrderMainByOrderId(orderId);
mmap.put("zcOrderMain", zcOrderMain);
return prefix + "/edit";
}
/**
* 修改保存租车订单
*/
@RequiresPermissions("orders:order:edit")
@Log(title = "租车订单", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(ZcOrderMain zcOrderMain)
{
return toAjax(zcOrderMainService.updateZcOrderMain(zcOrderMain));
}
/**
* 删除租车订单
*/
@RequiresPermissions("orders:order:remove")
@Log(title = "租车订单", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(zcOrderMainService.deleteZcOrderMainByOrderIds(ids));
}
}

View File

@ -0,0 +1,127 @@
package com.ruoyi.orders.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.orders.domain.ZcOrderSub;
import com.ruoyi.orders.service.IZcOrderSubService;
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-19
*/
@Controller
@RequestMapping("/orders/orderSub")
public class ZcOrderSubController extends BaseController
{
private String prefix = "orders/orderSub";
@Autowired
private IZcOrderSubService zcOrderSubService;
@RequiresPermissions("orders:orderSub:view")
@GetMapping()
public String orderSub()
{
return prefix + "/orderSub";
}
/**
* 查询租车子订单列表
*/
@RequiresPermissions("orders:orderSub:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(ZcOrderSub zcOrderSub)
{
startPage();
List<ZcOrderSub> list = zcOrderSubService.selectZcOrderSubList(zcOrderSub);
return getDataTable(list);
}
/**
* 导出租车子订单列表
*/
@RequiresPermissions("orders:orderSub:export")
@Log(title = "租车子订单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(ZcOrderSub zcOrderSub)
{
List<ZcOrderSub> list = zcOrderSubService.selectZcOrderSubList(zcOrderSub);
ExcelUtil<ZcOrderSub> util = new ExcelUtil<ZcOrderSub>(ZcOrderSub.class);
return util.exportExcel(list, "租车子订单数据");
}
/**
* 新增租车子订单
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存租车子订单
*/
@RequiresPermissions("orders:orderSub:add")
@Log(title = "租车子订单", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(ZcOrderSub zcOrderSub)
{
return toAjax(zcOrderSubService.insertZcOrderSub(zcOrderSub));
}
/**
* 修改租车子订单
*/
@RequiresPermissions("orders:orderSub:edit")
@GetMapping("/edit/{suborderId}")
public String edit(@PathVariable("suborderId") Long suborderId, ModelMap mmap)
{
ZcOrderSub zcOrderSub = zcOrderSubService.selectZcOrderSubBySuborderId(suborderId);
mmap.put("zcOrderSub", zcOrderSub);
return prefix + "/edit";
}
/**
* 修改保存租车子订单
*/
@RequiresPermissions("orders:orderSub:edit")
@Log(title = "租车子订单", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(ZcOrderSub zcOrderSub)
{
return toAjax(zcOrderSubService.updateZcOrderSub(zcOrderSub));
}
/**
* 删除租车子订单
*/
@RequiresPermissions("orders:orderSub:remove")
@Log(title = "租车子订单", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(zcOrderSubService.deleteZcOrderSubBySuborderIds(ids));
}
}

View File

@ -0,0 +1,380 @@
package com.ruoyi.orders.domain;
import java.math.BigDecimal;
import java.util.List;
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_order_main
*
* @author ruoyi
* @date 2025-07-19
*/
public class ZcOrderMain extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 订单ID主键 */
private Long orderId;
/** 订单编号 */
@Excel(name = "订单编号")
private String orderNo;
/** 订单状态:下单未提车、租赁中、已结束-自动、已结束-手动 */
@Excel(name = "订单状态:下单未提车、租赁中、已结束-自动、已结束-手动")
private String orderStatus;
/** 所属运营商ID */
@Excel(name = "所属运营商ID")
private Long operatorId;
/** 所属门店ID */
@Excel(name = "所属门店ID")
private Long storeId;
/** 车辆ID */
@Excel(name = "车辆ID")
private Long vehicleId;
/** 客户id */
@Excel(name = "客户id")
private Long customerId;
/** 客户姓名 */
@Excel(name = "客户姓名")
private String customerName;
/** 客户联系电话 */
@Excel(name = "客户联系电话")
private String customerPhone;
/** 租赁类型(时租/日租/按天数/以租代售) */
@Excel(name = "租赁类型(时租/日租/按天数/以租代售)")
private String rentalType;
/** 租赁天数(当类型为"按天数"时使用) */
@Excel(name = "租赁天数")
private Long rentalDays;
/** 租车价格(元) */
@Excel(name = "租车价格(元)")
private BigDecimal rentalPrice;
/** 押金价格(元) */
@Excel(name = "押金价格(元)")
private BigDecimal depositPrice;
/** 逾期金额(元) */
@Excel(name = "逾期金额(元)")
private BigDecimal overdueFee;
/** 是否开通免押 */
@Excel(name = "是否开通免押")
private Integer isDepositFree;
/** 是否开通代扣 */
@Excel(name = "是否开通代扣")
private Integer isAutoDeduct;
/** 首次下单时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "首次下单时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date firstOrderTime;
/** 开始计费时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开始计费时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date startRentTime;
/** 逾期天数 */
@Excel(name = "逾期天数")
private Long overdueDays;
/** 续租次数 */
@Excel(name = "续租次数")
private Long renewalTimes;
/** 充电次数 */
@Excel(name = "充电次数")
private Long chargeTimes;
/** 租车套餐id */
@Excel(name = "租车套餐id")
private Long rentCarRuleId;
/** 租电套餐id */
@Excel(name = "租电套餐id")
private Long rentBatteyRuleId;
/** 删除标志0代表存在 2代表删除 */
private String delFlag;
/** 租车子订单信息 */
private List<ZcOrderSub> zcOrderSubList;
public void setOrderId(Long orderId)
{
this.orderId = orderId;
}
public Long getOrderId()
{
return orderId;
}
public void setOrderNo(String orderNo)
{
this.orderNo = orderNo;
}
public String getOrderNo()
{
return orderNo;
}
public void setOrderStatus(String orderStatus)
{
this.orderStatus = orderStatus;
}
public String getOrderStatus()
{
return orderStatus;
}
public void setOperatorId(Long operatorId)
{
this.operatorId = operatorId;
}
public Long getOperatorId()
{
return operatorId;
}
public void setStoreId(Long storeId)
{
this.storeId = storeId;
}
public Long getStoreId()
{
return storeId;
}
public void setVehicleId(Long vehicleId)
{
this.vehicleId = vehicleId;
}
public Long getVehicleId()
{
return vehicleId;
}
public void setCustomerId(Long customerId)
{
this.customerId = customerId;
}
public Long getCustomerId()
{
return customerId;
}
public void setCustomerName(String customerName)
{
this.customerName = customerName;
}
public String getCustomerName()
{
return customerName;
}
public void setCustomerPhone(String customerPhone)
{
this.customerPhone = customerPhone;
}
public String getCustomerPhone()
{
return customerPhone;
}
public void setRentalType(String rentalType)
{
this.rentalType = rentalType;
}
public String getRentalType()
{
return rentalType;
}
public void setRentalDays(Long rentalDays)
{
this.rentalDays = rentalDays;
}
public Long getRentalDays()
{
return rentalDays;
}
public void setRentalPrice(BigDecimal rentalPrice)
{
this.rentalPrice = rentalPrice;
}
public BigDecimal getRentalPrice()
{
return rentalPrice;
}
public void setDepositPrice(BigDecimal depositPrice)
{
this.depositPrice = depositPrice;
}
public BigDecimal getDepositPrice()
{
return depositPrice;
}
public void setOverdueFee(BigDecimal overdueFee)
{
this.overdueFee = overdueFee;
}
public BigDecimal getOverdueFee()
{
return overdueFee;
}
public void setIsDepositFree(Integer isDepositFree)
{
this.isDepositFree = isDepositFree;
}
public Integer getIsDepositFree()
{
return isDepositFree;
}
public void setIsAutoDeduct(Integer isAutoDeduct)
{
this.isAutoDeduct = isAutoDeduct;
}
public Integer getIsAutoDeduct()
{
return isAutoDeduct;
}
public void setFirstOrderTime(Date firstOrderTime)
{
this.firstOrderTime = firstOrderTime;
}
public Date getFirstOrderTime()
{
return firstOrderTime;
}
public void setStartRentTime(Date startRentTime)
{
this.startRentTime = startRentTime;
}
public Date getStartRentTime()
{
return startRentTime;
}
public void setOverdueDays(Long overdueDays)
{
this.overdueDays = overdueDays;
}
public Long getOverdueDays()
{
return overdueDays;
}
public void setRenewalTimes(Long renewalTimes)
{
this.renewalTimes = renewalTimes;
}
public Long getRenewalTimes()
{
return renewalTimes;
}
public void setChargeTimes(Long chargeTimes)
{
this.chargeTimes = chargeTimes;
}
public Long getChargeTimes()
{
return chargeTimes;
}
public void setRentCarRuleId(Long rentCarRuleId)
{
this.rentCarRuleId = rentCarRuleId;
}
public Long getRentCarRuleId()
{
return rentCarRuleId;
}
public void setRentBatteyRuleId(Long rentBatteyRuleId)
{
this.rentBatteyRuleId = rentBatteyRuleId;
}
public Long getRentBatteyRuleId()
{
return rentBatteyRuleId;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
{
return delFlag;
}
public List<ZcOrderSub> getZcOrderSubList()
{
return zcOrderSubList;
}
public void setZcOrderSubList(List<ZcOrderSub> zcOrderSubList)
{
this.zcOrderSubList = zcOrderSubList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("orderId", getOrderId())
.append("orderNo", getOrderNo())
.append("orderStatus", getOrderStatus())
.append("operatorId", getOperatorId())
.append("storeId", getStoreId())
.append("vehicleId", getVehicleId())
.append("customerId", getCustomerId())
.append("customerName", getCustomerName())
.append("customerPhone", getCustomerPhone())
.append("rentalType", getRentalType())
.append("rentalDays", getRentalDays())
.append("rentalPrice", getRentalPrice())
.append("depositPrice", getDepositPrice())
.append("overdueFee", getOverdueFee())
.append("isDepositFree", getIsDepositFree())
.append("isAutoDeduct", getIsAutoDeduct())
.append("firstOrderTime", getFirstOrderTime())
.append("startRentTime", getStartRentTime())
.append("overdueDays", getOverdueDays())
.append("renewalTimes", getRenewalTimes())
.append("chargeTimes", getChargeTimes())
.append("rentCarRuleId", getRentCarRuleId())
.append("rentBatteyRuleId", getRentBatteyRuleId())
.append("delFlag", getDelFlag())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("zcOrderSubList", getZcOrderSubList())
.toString();
}
}

View File

@ -0,0 +1,184 @@
package com.ruoyi.orders.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 租车子订单对象 zc_order_sub
*
* @author ruoyi
* @date 2025-07-19
*/
public class ZcOrderSub extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 子订单ID主键 */
private Long suborderId;
/** 关联的订单ID外键 */
@Excel(name = "关联的订单ID", readConverterExp = "外=键")
private Long orderId;
/** 子订单编号 */
@Excel(name = "子订单编号")
private String suborderNo;
/** 子订单类型(首租、续租、逾期、押金、租电等) */
@Excel(name = "子订单类型", readConverterExp = "首=租、续租、逾期、押金、租电等")
private String suborderType;
/** 订单金额 */
@Excel(name = "订单金额")
private BigDecimal amount;
/** 支付方式 */
@Excel(name = "支付方式")
private String paymentMethod;
/** 车架/电池编号 */
@Excel(name = "车架/电池编号")
private String vinBatteryNo;
/** 订单产生时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "订单产生时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createdAt;
/** 支付ID */
@Excel(name = "支付ID")
private String paymentId;
/** 实际支付时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "实际支付时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date paidAt;
/** 删除标志0代表存在 2代表删除 */
private String delFlag;
public void setSuborderId(Long suborderId)
{
this.suborderId = suborderId;
}
public Long getSuborderId()
{
return suborderId;
}
public void setOrderId(Long orderId)
{
this.orderId = orderId;
}
public Long getOrderId()
{
return orderId;
}
public void setSuborderNo(String suborderNo)
{
this.suborderNo = suborderNo;
}
public String getSuborderNo()
{
return suborderNo;
}
public void setSuborderType(String suborderType)
{
this.suborderType = suborderType;
}
public String getSuborderType()
{
return suborderType;
}
public void setAmount(BigDecimal amount)
{
this.amount = amount;
}
public BigDecimal getAmount()
{
return amount;
}
public void setPaymentMethod(String paymentMethod)
{
this.paymentMethod = paymentMethod;
}
public String getPaymentMethod()
{
return paymentMethod;
}
public void setVinBatteryNo(String vinBatteryNo)
{
this.vinBatteryNo = vinBatteryNo;
}
public String getVinBatteryNo()
{
return vinBatteryNo;
}
public void setCreatedAt(Date createdAt)
{
this.createdAt = createdAt;
}
public Date getCreatedAt()
{
return createdAt;
}
public void setPaymentId(String paymentId)
{
this.paymentId = paymentId;
}
public String getPaymentId()
{
return paymentId;
}
public void setPaidAt(Date paidAt)
{
this.paidAt = paidAt;
}
public Date getPaidAt()
{
return paidAt;
}
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("suborderId", getSuborderId())
.append("orderId", getOrderId())
.append("suborderNo", getSuborderNo())
.append("suborderType", getSuborderType())
.append("amount", getAmount())
.append("paymentMethod", getPaymentMethod())
.append("vinBatteryNo", getVinBatteryNo())
.append("createdAt", getCreatedAt())
.append("paymentId", getPaymentId())
.append("paidAt", getPaidAt())
.append("remark", getRemark())
.append("delFlag", getDelFlag())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,87 @@
package com.ruoyi.orders.mapper;
import java.util.List;
import com.ruoyi.orders.domain.ZcOrderMain;
import com.ruoyi.orders.domain.ZcOrderSub;
/**
* 租车订单Mapper接口
*
* @author ruoyi
* @date 2025-07-19
*/
public interface ZcOrderMainMapper
{
/**
* 查询租车订单
*
* @param orderId 租车订单主键
* @return 租车订单
*/
public ZcOrderMain selectZcOrderMainByOrderId(Long orderId);
/**
* 查询租车订单列表
*
* @param zcOrderMain 租车订单
* @return 租车订单集合
*/
public List<ZcOrderMain> selectZcOrderMainList(ZcOrderMain zcOrderMain);
/**
* 新增租车订单
*
* @param zcOrderMain 租车订单
* @return 结果
*/
public int insertZcOrderMain(ZcOrderMain zcOrderMain);
/**
* 修改租车订单
*
* @param zcOrderMain 租车订单
* @return 结果
*/
public int updateZcOrderMain(ZcOrderMain zcOrderMain);
/**
* 删除租车订单
*
* @param orderId 租车订单主键
* @return 结果
*/
public int deleteZcOrderMainByOrderId(Long orderId);
/**
* 批量删除租车订单
*
* @param orderIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteZcOrderMainByOrderIds(String[] orderIds);
/**
* 批量删除租车子订单
*
* @param orderIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteZcOrderSubByOrderIds(String[] orderIds);
/**
* 批量新增租车子订单
*
* @param zcOrderSubList 租车子订单列表
* @return 结果
*/
public int batchZcOrderSub(List<ZcOrderSub> zcOrderSubList);
/**
* 通过租车订单主键删除租车子订单信息
*
* @param orderId 租车订单ID
* @return 结果
*/
public int deleteZcOrderSubByOrderId(Long orderId);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.orders.mapper;
import java.util.List;
import com.ruoyi.orders.domain.ZcOrderSub;
/**
* 租车子订单Mapper接口
*
* @author ruoyi
* @date 2025-07-19
*/
public interface ZcOrderSubMapper
{
/**
* 查询租车子订单
*
* @param suborderId 租车子订单主键
* @return 租车子订单
*/
public ZcOrderSub selectZcOrderSubBySuborderId(Long suborderId);
/**
* 查询租车子订单列表
*
* @param zcOrderSub 租车子订单
* @return 租车子订单集合
*/
public List<ZcOrderSub> selectZcOrderSubList(ZcOrderSub zcOrderSub);
/**
* 新增租车子订单
*
* @param zcOrderSub 租车子订单
* @return 结果
*/
public int insertZcOrderSub(ZcOrderSub zcOrderSub);
/**
* 修改租车子订单
*
* @param zcOrderSub 租车子订单
* @return 结果
*/
public int updateZcOrderSub(ZcOrderSub zcOrderSub);
/**
* 删除租车子订单
*
* @param suborderId 租车子订单主键
* @return 结果
*/
public int deleteZcOrderSubBySuborderId(Long suborderId);
/**
* 批量删除租车子订单
*
* @param suborderIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteZcOrderSubBySuborderIds(String[] suborderIds);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.orders.service;
import java.util.List;
import com.ruoyi.orders.domain.ZcOrderMain;
/**
* 租车订单Service接口
*
* @author ruoyi
* @date 2025-07-19
*/
public interface IZcOrderMainService
{
/**
* 查询租车订单
*
* @param orderId 租车订单主键
* @return 租车订单
*/
public ZcOrderMain selectZcOrderMainByOrderId(Long orderId);
/**
* 查询租车订单列表
*
* @param zcOrderMain 租车订单
* @return 租车订单集合
*/
public List<ZcOrderMain> selectZcOrderMainList(ZcOrderMain zcOrderMain);
/**
* 新增租车订单
*
* @param zcOrderMain 租车订单
* @return 结果
*/
public int insertZcOrderMain(ZcOrderMain zcOrderMain);
/**
* 修改租车订单
*
* @param zcOrderMain 租车订单
* @return 结果
*/
public int updateZcOrderMain(ZcOrderMain zcOrderMain);
/**
* 批量删除租车订单
*
* @param orderIds 需要删除的租车订单主键集合
* @return 结果
*/
public int deleteZcOrderMainByOrderIds(String orderIds);
/**
* 删除租车订单信息
*
* @param orderId 租车订单主键
* @return 结果
*/
public int deleteZcOrderMainByOrderId(Long orderId);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.orders.service;
import java.util.List;
import com.ruoyi.orders.domain.ZcOrderSub;
/**
* 租车子订单Service接口
*
* @author ruoyi
* @date 2025-07-19
*/
public interface IZcOrderSubService
{
/**
* 查询租车子订单
*
* @param suborderId 租车子订单主键
* @return 租车子订单
*/
public ZcOrderSub selectZcOrderSubBySuborderId(Long suborderId);
/**
* 查询租车子订单列表
*
* @param zcOrderSub 租车子订单
* @return 租车子订单集合
*/
public List<ZcOrderSub> selectZcOrderSubList(ZcOrderSub zcOrderSub);
/**
* 新增租车子订单
*
* @param zcOrderSub 租车子订单
* @return 结果
*/
public int insertZcOrderSub(ZcOrderSub zcOrderSub);
/**
* 修改租车子订单
*
* @param zcOrderSub 租车子订单
* @return 结果
*/
public int updateZcOrderSub(ZcOrderSub zcOrderSub);
/**
* 批量删除租车子订单
*
* @param suborderIds 需要删除的租车子订单主键集合
* @return 结果
*/
public int deleteZcOrderSubBySuborderIds(String suborderIds);
/**
* 删除租车子订单信息
*
* @param suborderId 租车子订单主键
* @return 结果
*/
public int deleteZcOrderSubBySuborderId(Long suborderId);
}

View File

@ -0,0 +1,135 @@
package com.ruoyi.orders.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 java.util.ArrayList;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.orders.domain.ZcOrderSub;
import com.ruoyi.orders.mapper.ZcOrderMainMapper;
import com.ruoyi.orders.domain.ZcOrderMain;
import com.ruoyi.orders.service.IZcOrderMainService;
import com.ruoyi.common.core.text.Convert;
/**
* 租车订单Service业务层处理
*
* @author ruoyi
* @date 2025-07-19
*/
@Service
public class ZcOrderMainServiceImpl implements IZcOrderMainService
{
@Autowired
private ZcOrderMainMapper zcOrderMainMapper;
/**
* 查询租车订单
*
* @param orderId 租车订单主键
* @return 租车订单
*/
@Override
public ZcOrderMain selectZcOrderMainByOrderId(Long orderId)
{
return zcOrderMainMapper.selectZcOrderMainByOrderId(orderId);
}
/**
* 查询租车订单列表
*
* @param zcOrderMain 租车订单
* @return 租车订单
*/
@Override
public List<ZcOrderMain> selectZcOrderMainList(ZcOrderMain zcOrderMain)
{
return zcOrderMainMapper.selectZcOrderMainList(zcOrderMain);
}
/**
* 新增租车订单
*
* @param zcOrderMain 租车订单
* @return 结果
*/
@Transactional
@Override
public int insertZcOrderMain(ZcOrderMain zcOrderMain)
{
zcOrderMain.setCreateTime(DateUtils.getNowDate());
int rows = zcOrderMainMapper.insertZcOrderMain(zcOrderMain);
insertZcOrderSub(zcOrderMain);
return rows;
}
/**
* 修改租车订单
*
* @param zcOrderMain 租车订单
* @return 结果
*/
@Transactional
@Override
public int updateZcOrderMain(ZcOrderMain zcOrderMain)
{
zcOrderMain.setUpdateTime(DateUtils.getNowDate());
zcOrderMainMapper.deleteZcOrderSubByOrderId(zcOrderMain.getOrderId());
insertZcOrderSub(zcOrderMain);
return zcOrderMainMapper.updateZcOrderMain(zcOrderMain);
}
/**
* 批量删除租车订单
*
* @param orderIds 需要删除的租车订单主键
* @return 结果
*/
@Transactional
@Override
public int deleteZcOrderMainByOrderIds(String orderIds)
{
zcOrderMainMapper.deleteZcOrderSubByOrderIds(Convert.toStrArray(orderIds));
return zcOrderMainMapper.deleteZcOrderMainByOrderIds(Convert.toStrArray(orderIds));
}
/**
* 删除租车订单信息
*
* @param orderId 租车订单主键
* @return 结果
*/
@Transactional
@Override
public int deleteZcOrderMainByOrderId(Long orderId)
{
zcOrderMainMapper.deleteZcOrderSubByOrderId(orderId);
return zcOrderMainMapper.deleteZcOrderMainByOrderId(orderId);
}
/**
* 新增租车子订单信息
*
* @param zcOrderMain 租车订单对象
*/
public void insertZcOrderSub(ZcOrderMain zcOrderMain)
{
List<ZcOrderSub> zcOrderSubList = zcOrderMain.getZcOrderSubList();
Long orderId = zcOrderMain.getOrderId();
if (StringUtils.isNotNull(zcOrderSubList))
{
List<ZcOrderSub> list = new ArrayList<ZcOrderSub>();
for (ZcOrderSub zcOrderSub : zcOrderSubList)
{
zcOrderSub.setOrderId(orderId);
list.add(zcOrderSub);
}
if (list.size() > 0)
{
zcOrderMainMapper.batchZcOrderSub(list);
}
}
}
}

View File

@ -0,0 +1,97 @@
package com.ruoyi.orders.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.orders.mapper.ZcOrderSubMapper;
import com.ruoyi.orders.domain.ZcOrderSub;
import com.ruoyi.orders.service.IZcOrderSubService;
import com.ruoyi.common.core.text.Convert;
/**
* 租车子订单Service业务层处理
*
* @author ruoyi
* @date 2025-07-19
*/
@Service
public class ZcOrderSubServiceImpl implements IZcOrderSubService
{
@Autowired
private ZcOrderSubMapper zcOrderSubMapper;
/**
* 查询租车子订单
*
* @param suborderId 租车子订单主键
* @return 租车子订单
*/
@Override
public ZcOrderSub selectZcOrderSubBySuborderId(Long suborderId)
{
return zcOrderSubMapper.selectZcOrderSubBySuborderId(suborderId);
}
/**
* 查询租车子订单列表
*
* @param zcOrderSub 租车子订单
* @return 租车子订单
*/
@Override
public List<ZcOrderSub> selectZcOrderSubList(ZcOrderSub zcOrderSub)
{
return zcOrderSubMapper.selectZcOrderSubList(zcOrderSub);
}
/**
* 新增租车子订单
*
* @param zcOrderSub 租车子订单
* @return 结果
*/
@Override
public int insertZcOrderSub(ZcOrderSub zcOrderSub)
{
zcOrderSub.setCreateTime(DateUtils.getNowDate());
return zcOrderSubMapper.insertZcOrderSub(zcOrderSub);
}
/**
* 修改租车子订单
*
* @param zcOrderSub 租车子订单
* @return 结果
*/
@Override
public int updateZcOrderSub(ZcOrderSub zcOrderSub)
{
zcOrderSub.setUpdateTime(DateUtils.getNowDate());
return zcOrderSubMapper.updateZcOrderSub(zcOrderSub);
}
/**
* 批量删除租车子订单
*
* @param suborderIds 需要删除的租车子订单主键
* @return 结果
*/
@Override
public int deleteZcOrderSubBySuborderIds(String suborderIds)
{
return zcOrderSubMapper.deleteZcOrderSubBySuborderIds(Convert.toStrArray(suborderIds));
}
/**
* 删除租车子订单信息
*
* @param suborderId 租车子订单主键
* @return 结果
*/
@Override
public int deleteZcOrderSubBySuborderId(Long suborderId)
{
return zcOrderSubMapper.deleteZcOrderSubBySuborderId(suborderId);
}
}

View File

@ -0,0 +1,216 @@
<?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.orders.mapper.ZcOrderMainMapper">
<resultMap type="ZcOrderMain" id="ZcOrderMainResult">
<result property="orderId" column="order_id" />
<result property="orderNo" column="order_no" />
<result property="orderStatus" column="order_status" />
<result property="operatorId" column="operator_id" />
<result property="storeId" column="store_id" />
<result property="vehicleId" column="vehicle_id" />
<result property="customerId" column="customer_id" />
<result property="customerName" column="customer_name" />
<result property="customerPhone" column="customer_phone" />
<result property="rentalType" column="rental_type" />
<result property="rentalDays" column="rental_days" />
<result property="rentalPrice" column="rental_price" />
<result property="depositPrice" column="deposit_price" />
<result property="overdueFee" column="overdue_fee" />
<result property="isDepositFree" column="is_deposit_free" />
<result property="isAutoDeduct" column="is_auto_deduct" />
<result property="firstOrderTime" column="first_order_time" />
<result property="startRentTime" column="start_rent_time" />
<result property="overdueDays" column="overdue_days" />
<result property="renewalTimes" column="renewal_times" />
<result property="chargeTimes" column="charge_times" />
<result property="rentCarRuleId" column="rent_car_rule_id" />
<result property="rentBatteyRuleId" column="rent_battey_rule_id" />
<result property="delFlag" column="del_flag" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<resultMap id="ZcOrderMainZcOrderSubResult" type="ZcOrderMain" extends="ZcOrderMainResult">
<collection property="zcOrderSubList" notNullColumn="sub_suborder_id" javaType="java.util.List" resultMap="ZcOrderSubResult" />
</resultMap>
<resultMap type="ZcOrderSub" id="ZcOrderSubResult">
<result property="suborderId" column="sub_suborder_id" />
<result property="orderId" column="sub_order_id" />
<result property="suborderNo" column="sub_suborder_no" />
<result property="suborderType" column="sub_suborder_type" />
<result property="amount" column="sub_amount" />
<result property="paymentMethod" column="sub_payment_method" />
<result property="vinBatteryNo" column="sub_vin_battery_no" />
<result property="createdAt" column="sub_created_at" />
<result property="paymentId" column="sub_payment_id" />
<result property="paidAt" column="sub_paid_at" />
<result property="remark" column="sub_remark" />
<result property="delFlag" column="sub_del_flag" />
<result property="createTime" column="sub_create_time" />
<result property="updateTime" column="sub_update_time" />
</resultMap>
<sql id="selectZcOrderMainVo">
select order_id, order_no, order_status, operator_id, store_id, vehicle_id, customer_id, customer_name, customer_phone, rental_type, rental_days, rental_price, deposit_price, overdue_fee, is_deposit_free, is_auto_deduct, first_order_time, start_rent_time, overdue_days, renewal_times, charge_times, rent_car_rule_id, rent_battey_rule_id, del_flag, create_time, update_time from zc_order_main
</sql>
<select id="selectZcOrderMainList" parameterType="ZcOrderMain" resultMap="ZcOrderMainResult">
<include refid="selectZcOrderMainVo"/>
<where>
<if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
<if test="orderStatus != null and orderStatus != ''"> and order_status = #{orderStatus}</if>
<if test="operatorId != null "> and operator_id = #{operatorId}</if>
<if test="storeId != null "> and store_id = #{storeId}</if>
<if test="vehicleId != null "> and vehicle_id = #{vehicleId}</if>
<if test="customerId != null "> and customer_id = #{customerId}</if>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<if test="customerPhone != null and customerPhone != ''"> and customer_phone = #{customerPhone}</if>
<if test="rentalType != null and rentalType != ''"> and rental_type = #{rentalType}</if>
<if test="rentalDays != null "> and rental_days = #{rentalDays}</if>
<if test="rentalPrice != null "> and rental_price = #{rentalPrice}</if>
<if test="depositPrice != null "> and deposit_price = #{depositPrice}</if>
<if test="overdueFee != null "> and overdue_fee = #{overdueFee}</if>
<if test="isDepositFree != null "> and is_deposit_free = #{isDepositFree}</if>
<if test="isAutoDeduct != null "> and is_auto_deduct = #{isAutoDeduct}</if>
<if test="firstOrderTime != null "> and first_order_time = #{firstOrderTime}</if>
<if test="startRentTime != null "> and start_rent_time = #{startRentTime}</if>
<if test="overdueDays != null "> and overdue_days = #{overdueDays}</if>
<if test="renewalTimes != null "> and renewal_times = #{renewalTimes}</if>
<if test="chargeTimes != null "> and charge_times = #{chargeTimes}</if>
<if test="rentCarRuleId != null "> and rent_car_rule_id = #{rentCarRuleId}</if>
<if test="rentBatteyRuleId != null "> and rent_battey_rule_id = #{rentBatteyRuleId}</if>
</where>
</select>
<select id="selectZcOrderMainByOrderId" parameterType="Long" resultMap="ZcOrderMainZcOrderSubResult">
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.customer_id, a.customer_name, a.customer_phone, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.start_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.del_flag, a.create_time, a.update_time,
b.suborder_id as sub_suborder_id, b.order_id as sub_order_id, b.suborder_no as sub_suborder_no, b.suborder_type as sub_suborder_type, b.amount as sub_amount, b.payment_method as sub_payment_method, b.vin_battery_no as sub_vin_battery_no, b.created_at as sub_created_at, b.payment_id as sub_payment_id, b.paid_at as sub_paid_at, b.remark as sub_remark, b.del_flag as sub_del_flag, b.create_time as sub_create_time, b.update_time as sub_update_time
from zc_order_main a
left join zc_order_sub b on b.order_id = a.order_id
where a.order_id = #{orderId}
</select>
<insert id="insertZcOrderMain" parameterType="ZcOrderMain" useGeneratedKeys="true" keyProperty="orderId">
insert into zc_order_main
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderNo != null and orderNo != ''">order_no,</if>
<if test="orderStatus != null and orderStatus != ''">order_status,</if>
<if test="operatorId != null">operator_id,</if>
<if test="storeId != null">store_id,</if>
<if test="vehicleId != null">vehicle_id,</if>
<if test="customerId != null">customer_id,</if>
<if test="customerName != null and customerName != ''">customer_name,</if>
<if test="customerPhone != null and customerPhone != ''">customer_phone,</if>
<if test="rentalType != null and rentalType != ''">rental_type,</if>
<if test="rentalDays != null">rental_days,</if>
<if test="rentalPrice != null">rental_price,</if>
<if test="depositPrice != null">deposit_price,</if>
<if test="overdueFee != null">overdue_fee,</if>
<if test="isDepositFree != null">is_deposit_free,</if>
<if test="isAutoDeduct != null">is_auto_deduct,</if>
<if test="firstOrderTime != null">first_order_time,</if>
<if test="startRentTime != null">start_rent_time,</if>
<if test="overdueDays != null">overdue_days,</if>
<if test="renewalTimes != null">renewal_times,</if>
<if test="chargeTimes != null">charge_times,</if>
<if test="rentCarRuleId != null">rent_car_rule_id,</if>
<if test="rentBatteyRuleId != null">rent_battey_rule_id,</if>
<if test="delFlag != null">del_flag,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderNo != null and orderNo != ''">#{orderNo},</if>
<if test="orderStatus != null and orderStatus != ''">#{orderStatus},</if>
<if test="operatorId != null">#{operatorId},</if>
<if test="storeId != null">#{storeId},</if>
<if test="vehicleId != null">#{vehicleId},</if>
<if test="customerId != null">#{customerId},</if>
<if test="customerName != null and customerName != ''">#{customerName},</if>
<if test="customerPhone != null and customerPhone != ''">#{customerPhone},</if>
<if test="rentalType != null and rentalType != ''">#{rentalType},</if>
<if test="rentalDays != null">#{rentalDays},</if>
<if test="rentalPrice != null">#{rentalPrice},</if>
<if test="depositPrice != null">#{depositPrice},</if>
<if test="overdueFee != null">#{overdueFee},</if>
<if test="isDepositFree != null">#{isDepositFree},</if>
<if test="isAutoDeduct != null">#{isAutoDeduct},</if>
<if test="firstOrderTime != null">#{firstOrderTime},</if>
<if test="startRentTime != null">#{startRentTime},</if>
<if test="overdueDays != null">#{overdueDays},</if>
<if test="renewalTimes != null">#{renewalTimes},</if>
<if test="chargeTimes != null">#{chargeTimes},</if>
<if test="rentCarRuleId != null">#{rentCarRuleId},</if>
<if test="rentBatteyRuleId != null">#{rentBatteyRuleId},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateZcOrderMain" parameterType="ZcOrderMain">
update zc_order_main
<trim prefix="SET" suffixOverrides=",">
<if test="orderNo != null and orderNo != ''">order_no = #{orderNo},</if>
<if test="orderStatus != null and orderStatus != ''">order_status = #{orderStatus},</if>
<if test="operatorId != null">operator_id = #{operatorId},</if>
<if test="storeId != null">store_id = #{storeId},</if>
<if test="vehicleId != null">vehicle_id = #{vehicleId},</if>
<if test="customerId != null">customer_id = #{customerId},</if>
<if test="customerName != null and customerName != ''">customer_name = #{customerName},</if>
<if test="customerPhone != null and customerPhone != ''">customer_phone = #{customerPhone},</if>
<if test="rentalType != null and rentalType != ''">rental_type = #{rentalType},</if>
<if test="rentalDays != null">rental_days = #{rentalDays},</if>
<if test="rentalPrice != null">rental_price = #{rentalPrice},</if>
<if test="depositPrice != null">deposit_price = #{depositPrice},</if>
<if test="overdueFee != null">overdue_fee = #{overdueFee},</if>
<if test="isDepositFree != null">is_deposit_free = #{isDepositFree},</if>
<if test="isAutoDeduct != null">is_auto_deduct = #{isAutoDeduct},</if>
<if test="firstOrderTime != null">first_order_time = #{firstOrderTime},</if>
<if test="startRentTime != null">start_rent_time = #{startRentTime},</if>
<if test="overdueDays != null">overdue_days = #{overdueDays},</if>
<if test="renewalTimes != null">renewal_times = #{renewalTimes},</if>
<if test="chargeTimes != null">charge_times = #{chargeTimes},</if>
<if test="rentCarRuleId != null">rent_car_rule_id = #{rentCarRuleId},</if>
<if test="rentBatteyRuleId != null">rent_battey_rule_id = #{rentBatteyRuleId},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where order_id = #{orderId}
</update>
<delete id="deleteZcOrderMainByOrderId" parameterType="Long">
delete from zc_order_main where order_id = #{orderId}
</delete>
<delete id="deleteZcOrderMainByOrderIds" parameterType="String">
delete from zc_order_main where order_id in
<foreach item="orderId" collection="array" open="(" separator="," close=")">
#{orderId}
</foreach>
</delete>
<delete id="deleteZcOrderSubByOrderIds" parameterType="String">
delete from zc_order_sub where order_id in
<foreach item="orderId" collection="array" open="(" separator="," close=")">
#{orderId}
</foreach>
</delete>
<delete id="deleteZcOrderSubByOrderId" parameterType="Long">
delete from zc_order_sub where order_id = #{orderId}
</delete>
<insert id="batchZcOrderSub">
insert into zc_order_sub( suborder_id, order_id, suborder_no, suborder_type, amount, payment_method, vin_battery_no, created_at, payment_id, paid_at, remark, del_flag, create_time, update_time) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.suborderId}, #{item.orderId}, #{item.suborderNo}, #{item.suborderType}, #{item.amount}, #{item.paymentMethod}, #{item.vinBatteryNo}, #{item.createdAt}, #{item.paymentId}, #{item.paidAt}, #{item.remark}, #{item.delFlag}, #{item.createTime}, #{item.updateTime})
</foreach>
</insert>
</mapper>

View File

@ -0,0 +1,113 @@
<?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.orders.mapper.ZcOrderSubMapper">
<resultMap type="ZcOrderSub" id="ZcOrderSubResult">
<result property="suborderId" column="suborder_id" />
<result property="orderId" column="order_id" />
<result property="suborderNo" column="suborder_no" />
<result property="suborderType" column="suborder_type" />
<result property="amount" column="amount" />
<result property="paymentMethod" column="payment_method" />
<result property="vinBatteryNo" column="vin_battery_no" />
<result property="createdAt" column="created_at" />
<result property="paymentId" column="payment_id" />
<result property="paidAt" column="paid_at" />
<result property="remark" column="remark" />
<result property="delFlag" column="del_flag" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectZcOrderSubVo">
select suborder_id, order_id, suborder_no, suborder_type, amount, payment_method, vin_battery_no, created_at, payment_id, paid_at, remark, del_flag, create_time, update_time from zc_order_sub
</sql>
<select id="selectZcOrderSubList" parameterType="ZcOrderSub" resultMap="ZcOrderSubResult">
<include refid="selectZcOrderSubVo"/>
<where>
<if test="orderId != null "> and order_id = #{orderId}</if>
<if test="suborderNo != null and suborderNo != ''"> and suborder_no = #{suborderNo}</if>
<if test="suborderType != null and suborderType != ''"> and suborder_type = #{suborderType}</if>
<if test="amount != null "> and amount = #{amount}</if>
<if test="paymentMethod != null and paymentMethod != ''"> and payment_method = #{paymentMethod}</if>
<if test="vinBatteryNo != null and vinBatteryNo != ''"> and vin_battery_no = #{vinBatteryNo}</if>
<if test="createdAt != null "> and created_at = #{createdAt}</if>
<if test="paymentId != null and paymentId != ''"> and payment_id = #{paymentId}</if>
<if test="paidAt != null "> and paid_at = #{paidAt}</if>
</where>
</select>
<select id="selectZcOrderSubBySuborderId" parameterType="Long" resultMap="ZcOrderSubResult">
<include refid="selectZcOrderSubVo"/>
where suborder_id = #{suborderId}
</select>
<insert id="insertZcOrderSub" parameterType="ZcOrderSub" useGeneratedKeys="true" keyProperty="suborderId">
insert into zc_order_sub
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderId != null">order_id,</if>
<if test="suborderNo != null and suborderNo != ''">suborder_no,</if>
<if test="suborderType != null and suborderType != ''">suborder_type,</if>
<if test="amount != null">amount,</if>
<if test="paymentMethod != null and paymentMethod != ''">payment_method,</if>
<if test="vinBatteryNo != null and vinBatteryNo != ''">vin_battery_no,</if>
<if test="createdAt != null">created_at,</if>
<if test="paymentId != null and paymentId != ''">payment_id,</if>
<if test="paidAt != null">paid_at,</if>
<if test="remark != null">remark,</if>
<if test="delFlag != null">del_flag,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderId != null">#{orderId},</if>
<if test="suborderNo != null and suborderNo != ''">#{suborderNo},</if>
<if test="suborderType != null and suborderType != ''">#{suborderType},</if>
<if test="amount != null">#{amount},</if>
<if test="paymentMethod != null and paymentMethod != ''">#{paymentMethod},</if>
<if test="vinBatteryNo != null and vinBatteryNo != ''">#{vinBatteryNo},</if>
<if test="createdAt != null">#{createdAt},</if>
<if test="paymentId != null and paymentId != ''">#{paymentId},</if>
<if test="paidAt != null">#{paidAt},</if>
<if test="remark != null">#{remark},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateZcOrderSub" parameterType="ZcOrderSub">
update zc_order_sub
<trim prefix="SET" suffixOverrides=",">
<if test="orderId != null">order_id = #{orderId},</if>
<if test="suborderNo != null and suborderNo != ''">suborder_no = #{suborderNo},</if>
<if test="suborderType != null and suborderType != ''">suborder_type = #{suborderType},</if>
<if test="amount != null">amount = #{amount},</if>
<if test="paymentMethod != null and paymentMethod != ''">payment_method = #{paymentMethod},</if>
<if test="vinBatteryNo != null and vinBatteryNo != ''">vin_battery_no = #{vinBatteryNo},</if>
<if test="createdAt != null">created_at = #{createdAt},</if>
<if test="paymentId != null and paymentId != ''">payment_id = #{paymentId},</if>
<if test="paidAt != null">paid_at = #{paidAt},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where suborder_id = #{suborderId}
</update>
<delete id="deleteZcOrderSubBySuborderId" parameterType="Long">
delete from zc_order_sub where suborder_id = #{suborderId}
</delete>
<delete id="deleteZcOrderSubBySuborderIds" parameterType="String">
delete from zc_order_sub where suborder_id in
<foreach item="suborderId" collection="array" open="(" separator="," close=")">
#{suborderId}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,360 @@
<!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-order-add">
<h4 class="form-header h4">租车订单信息</h4>
<div class="form-group">
<label class="col-sm-3 control-label is-required">订单编号:</label>
<div class="col-sm-8">
<input name="orderNo" 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">
<div class="radio-box" th:each="dict : ${@dict.getType('key_order_status')}">
<input type="radio" th:id="${'orderStatus_' + dict.dictCode}" name="orderStatus" th:value="${dict.dictValue}" th:checked="${dict.default}" required>
<label th:for="${'orderStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">所属运营商ID</label>
<div class="col-sm-8">
<input name="operatorId" 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="storeId" 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="vehicleId" 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="customerId" 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="customerName" 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="customerPhone" 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">
<select name="rentalType" class="form-control m-b" th:with="type=${@dict.getType('key_order_rental_type')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">租赁天数(当类型为"按天数"时使用)</label>
<div class="col-sm-8">
<input name="rentalDays" 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="rentalPrice" 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="depositPrice" 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="overdueFee" 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="isDepositFree" 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="isAutoDeduct" 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">
<div class="input-group date">
<input name="firstOrderTime" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<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 is-required">开始计费时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="startRentTime" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<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 is-required">逾期天数:</label>
<div class="col-sm-8">
<input name="overdueDays" 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="renewalTimes" 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="chargeTimes" 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="rentCarRuleId" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">租电套餐id</label>
<div class="col-sm-8">
<input name="rentBatteyRuleId" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">删除标志:</label>
<div class="col-sm-8">
<input name="delFlag" class="form-control" type="text">
</div>
</div>
<h4 class="form-header h4">租车子订单信息</h4>
<div class="row">
<div class="col-sm-12">
<button type="button" class="btn btn-white btn-sm" onclick="addRow()"><i class="fa fa-plus"> 增加</i></button>
<button type="button" class="btn btn-white btn-sm" onclick="sub.delRow()"><i class="fa fa-minus"> 删除</i></button>
<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" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "orders/order"
var suborderTypeDatas = [[${@dict.getType('key_order_suborder_type')}]];
$("#form-order-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-order-add').serialize());
}
}
$("input[name='firstOrderTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='startRentTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$(function() {
var options = {
pagination: false,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
sidePagination: "client",
columns: [{
checkbox: true
},
{
field: 'index',
align: 'center',
title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
return columnIndex + $.table.serialNumber(index);
}
},
{
field: 'suborderNo',
align: 'center',
title: '子订单编号',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcOrderSubList[%s].suborderNo' value='%s'>", index, value);
return html;
}
},
{
field: 'suborderType',
align: 'center',
title: '子订单类型',
formatter: function(value, row, index) {
var name = $.common.sprintf("zcOrderSubList[%s].suborderType", index);
return $.common.dictToSelect(suborderTypeDatas, value, name);
}
},
{
field: 'amount',
align: 'center',
title: '订单金额',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcOrderSubList[%s].amount' value='%s'>", index, value);
return html;
}
},
{
field: 'paymentMethod',
align: 'center',
title: '支付方式',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcOrderSubList[%s].paymentMethod' value='%s'>", index, value);
return html;
}
},
{
field: 'vinBatteryNo',
align: 'center',
title: '车架/电池编号',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcOrderSubList[%s].vinBatteryNo' value='%s'>", index, value);
return html;
}
},
{
field: 'createdAt',
align: 'center',
title: '订单产生时间',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcOrderSubList[%s].createdAt' value='%s'>", index, value);
return html;
}
},
{
field: 'paymentId',
align: 'center',
title: '支付ID',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcOrderSubList[%s].paymentId' value='%s'>", index, value);
return html;
}
},
{
field: 'paidAt',
align: 'center',
title: '实际支付时间',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcOrderSubList[%s].paidAt' value='%s'>", index, value);
return html;
}
},
{
field: 'remark',
align: 'center',
title: '备注',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcOrderSubList[%s].remark' value='%s'>", index, value);
return html;
}
},
{
field: 'delFlag',
align: 'center',
title: '删除标志',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcOrderSubList[%s].delFlag' value='%s'>", index, value);
return html;
}
},
{
field: 'createTime',
align: 'center',
title: '创建时间',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcOrderSubList[%s].createTime' value='%s'>", index, value);
return html;
}
},
{
field: 'updateTime',
align: 'center',
title: '更新时间',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcOrderSubList[%s].updateTime' value='%s'>", index, value);
return html;
}
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var value = $.common.isNotEmpty(row.index) ? row.index : $.table.serialNumber(index);
return '<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="sub.delRowByIndex(\'' + value + '\')"><i class="fa fa-remove"></i>删除</a>';
}
}]
};
$.table.init(options);
});
function addRow() {
var count = $("#" + table.options.id).bootstrapTable('getData').length;
var row = {
index: $.table.serialNumber(count),
suborderNo: "",
suborderType: "",
amount: "",
paymentMethod: "",
vinBatteryNo: "",
createdAt: "",
paymentId: "",
paidAt: "",
remark: "",
delFlag: "",
createTime: "",
updateTime: "",
}
sub.addRow(row);
}
</script>
</body>
</html>

View File

@ -0,0 +1,343 @@
<!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-order-edit" th:object="${zcOrderMain}">
<h4 class="form-header h4">租车订单信息</h4>
<input name="orderId" th:field="*{orderId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label is-required">订单编号:</label>
<div class="col-sm-8">
<input name="orderNo" th:field="*{orderNo}" 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">
<select name="orderStatus" class="form-control m-b" th:with="type=${@dict.getType('key_order_status')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{rentalType}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">所属运营商:</label>
<div class="col-sm-8">
<input name="operatorId" th:field="*{operatorId}" 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="storeId" th:field="*{storeId}" 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="vehicleId" th:field="*{vehicleId}" 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="customerName" th:field="*{customerName}" 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="customerPhone" th:field="*{customerPhone}" 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">
<select name="rentalType" class="form-control m-b" th:with="type=${@dict.getType('key_order_rental_type')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{rentalType}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">租赁天数:</label>
<div class="col-sm-8">
<input name="rentalDays" th:field="*{rentalDays}" 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="rentalPrice" th:field="*{rentalPrice}" 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="depositPrice" th:field="*{depositPrice}" 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="overdueFee" th:field="*{overdueFee}" 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="isDepositFree" th:field="*{isDepositFree}" 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="isAutoDeduct" th:field="*{isAutoDeduct}" 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">
<div class="input-group date">
<input name="firstOrderTime" th:value="${#dates.format(zcOrderMain.firstOrderTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<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 is-required">开始计费时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="startRentTime" th:value="${#dates.format(zcOrderMain.startRentTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<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 is-required">逾期天数:</label>
<div class="col-sm-8">
<input name="overdueDays" th:field="*{overdueDays}" 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="renewalTimes" th:field="*{renewalTimes}" 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="chargeTimes" th:field="*{chargeTimes}" 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="rentCarRuleId" th:field="*{rentCarRuleId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">租电套餐id</label>
<div class="col-sm-8">
<input name="rentBatteyRuleId" th:field="*{rentBatteyRuleId}" class="form-control" type="text">
</div>
</div>
<h4 class="form-header h4">租车子订单信息</h4>
<div class="row">
<div class="col-sm-12">
<!-- <button type="button" class="btn btn-white btn-sm" onclick="addRow()"><i class="fa fa-plus"> 增加</i></button>-->
<!-- <button type="button" class="btn btn-white btn-sm" onclick="sub.delRow()"><i class="fa fa-minus"> 删除</i></button>-->
<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" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "orders/order";
var suborderTypeDatas = [[${@dict.getType('key_order_suborder_type')}]];
$("#form-order-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-order-edit').serialize());
}
}
$("input[name='firstOrderTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='startRentTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$(function() {
var options = {
data: [[${zcOrderMain.zcOrderSubList}]],
pagination: false,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
sidePagination: "client",
columns: [{
checkbox: true
},
{
field: 'index',
align: 'center',
title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
return columnIndex + $.table.serialNumber(index);
}
},
{
field: 'suborderNo',
align: 'center',
title: '子订单编号',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcOrderSubList[%s].suborderNo' value='%s'>", index, value);
return html;
}
},
{
field: 'suborderType',
align: 'center',
title: '子订单类型',
formatter: function(value, row, index) {
var name = $.common.sprintf("zcOrderSubList[%s].suborderType", index);
return $.common.dictToSelect(suborderTypeDatas, value, name);
}
},
{
field: 'amount',
align: 'center',
title: '订单金额',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcOrderSubList[%s].amount' value='%s'>", index, value);
return html;
}
},
{
field: 'paymentMethod',
align: 'center',
title: '支付方式',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcOrderSubList[%s].paymentMethod' value='%s'>", index, value);
return html;
}
},
{
field: 'vinBatteryNo',
align: 'center',
title: '车架/电池编号',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcOrderSubList[%s].vinBatteryNo' value='%s'>", index, value);
return html;
}
},
{
field: 'createdAt',
align: 'center',
title: '订单产生时间',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcOrderSubList[%s].createdAt' value='%s'>", index, value);
return html;
}
},
{
field: 'paymentId',
align: 'center',
title: '支付ID',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcOrderSubList[%s].paymentId' value='%s'>", index, value);
return html;
}
},
{
field: 'paidAt',
align: 'center',
title: '实际支付时间',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcOrderSubList[%s].paidAt' value='%s'>", index, value);
return html;
}
},
{
field: 'remark',
align: 'center',
title: '备注',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcOrderSubList[%s].remark' value='%s'>", index, value);
return html;
}
},
{
field: 'createTime',
align: 'center',
title: '创建时间',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcOrderSubList[%s].createTime' value='%s'>", index, value);
return html;
}
},
{
field: 'updateTime',
align: 'center',
title: '更新时间',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcOrderSubList[%s].updateTime' value='%s'>", index, value);
return html;
}
},
]
};
$.table.init(options);
});
function addRow() {
var count = $("#" + table.options.id).bootstrapTable('getData').length;
var row = {
index: $.table.serialNumber(count),
suborderNo: "",
suborderType: "",
amount: "",
paymentMethod: "",
vinBatteryNo: "",
createdAt: "",
paymentId: "",
paidAt: "",
remark: "",
delFlag: "",
createTime: "",
updateTime: "",
}
sub.addRow(row);
}
</script>
</body>
</html>

View File

@ -0,0 +1,189 @@
<!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>
<select name="operatorId" id="operatorId" >
<option value="">请选择所属运营商</option>
<option th:each="company : ${companyList}" th:value="${company.id}" th:text="${company.companyName}"></option>
</select>
</li>
<li>
<label>所属门店:</label>
<input type="text" name="storeId"/>
</li>
<li>
<label>车辆:</label>
<input type="text" name="vehicleId"/>
</li>
<li>
<label>订单编号:</label>
<input type="text" name="orderNo"/>
</li>
<li>
<label>订单状态:</label>
<select name="orderStatus" th:with="type=${@dict.getType('key_order_status')}">
<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="customerPhone"/>
</li>
<li>
<label>租赁类型:</label>
<select name="rentalType" th:with="type=${@dict.getType('key_order_rental_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>&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="orders:order:add">-->
<!-- <i class="fa fa-plus"></i> 添加-->
<!-- </a>-->
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="orders:order:edit">-->
<!-- <i class="fa fa-edit"></i> 修改-->
<!-- </a>-->
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="orders:order:remove">-->
<!-- <i class="fa fa-remove"></i> 删除-->
<!-- </a>-->
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="orders:order: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('orders:order:edit')}]];
var removeFlag = [[${@permission.hasPermi('orders:order:remove')}]];
var orderStatusDatas = [[${@dict.getType('key_order_status')}]];
var rentalTypeDatas = [[${@dict.getType('key_order_rental_type')}]];
var prefix = ctx + "orders/order";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "租车订单",
columns: [{
checkbox: true
},
{
field: 'orderId',
title: '订单ID',
visible: false
},
{
field: 'orderNo',
title: '订单编号'
},
{
field: 'orderStatus',
title: '订单状态',
formatter: function(value, row, index) {
return $.table.selectDictLabel(orderStatusDatas, value);
}
},
{
field: 'operatorId',
title: '所属运营商'
},
{
field: 'storeId',
title: '所属门店'
},
{
field: 'vehicleId',
title: '车辆'
},
{
field: 'customerName',
title: '客户姓名'
},
{
field: 'customerPhone',
title: '客户联系电话'
},
{
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: 'isDepositFree',
title: '是否开通免押'
},
{
field: 'isAutoDeduct',
title: '是否开通代扣'
},
{
field: 'firstOrderTime',
title: '首次下单时间'
},
{
field: 'startRentTime',
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.editCustomize(\'' + row.orderId + '\',1300,700)"><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.orderId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -0,0 +1,113 @@
<!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-orderSub-add">
<div class="form-group">
<label class="col-sm-3 control-label is-required">关联的订单ID</label>
<div class="col-sm-8">
<input name="orderId" 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="suborderNo" 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">
<select name="suborderType" class="form-control m-b" th:with="type=${@dict.getType('key_order_suborder_type')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">订单金额:</label>
<div class="col-sm-8">
<input name="amount" 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="paymentMethod" 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="vinBatteryNo" 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">
<div class="input-group date">
<input name="createdAt" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<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 is-required">支付ID</label>
<div class="col-sm-8">
<input name="paymentId" 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">
<div class="input-group date">
<input name="paidAt" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<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">
<input name="remark" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">删除标志:</label>
<div class="col-sm-8">
<input name="delFlag" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "orders/orderSub"
$("#form-orderSub-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-orderSub-add').serialize());
}
}
$("input[name='createdAt']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='paidAt']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

View File

@ -0,0 +1,108 @@
<!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-orderSub-edit" th:object="${zcOrderSub}">
<input name="suborderId" th:field="*{suborderId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label is-required">关联的订单ID</label>
<div class="col-sm-8">
<input name="orderId" th:field="*{orderId}" 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="suborderNo" th:field="*{suborderNo}" 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">
<select name="suborderType" class="form-control m-b" th:with="type=${@dict.getType('key_order_suborder_type')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{suborderType}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">订单金额:</label>
<div class="col-sm-8">
<input name="amount" th:field="*{amount}" 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="paymentMethod" th:field="*{paymentMethod}" 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="vinBatteryNo" th:field="*{vinBatteryNo}" 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">
<div class="input-group date">
<input name="createdAt" th:value="${#dates.format(zcOrderSub.createdAt, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<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 is-required">支付ID</label>
<div class="col-sm-8">
<input name="paymentId" th:field="*{paymentId}" 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">
<div class="input-group date">
<input name="paidAt" th:value="${#dates.format(zcOrderSub.paidAt, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<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">
<input name="remark" th:field="*{remark}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "orders/orderSub";
$("#form-orderSub-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-orderSub-edit').serialize());
}
}
$("input[name='createdAt']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='paidAt']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

View File

@ -0,0 +1,151 @@
<!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="orderId"/>
</li>
<li>
<label>子订单编号:</label>
<input type="text" name="suborderNo"/>
</li>
<li>
<label>子订单类型:</label>
<select name="suborderType" th:with="type=${@dict.getType('key_order_suborder_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="amount"/>
</li>
<li>
<label>支付方式:</label>
<input type="text" name="paymentMethod"/>
</li>
<li>
<label>车架/电池编号:</label>
<input type="text" name="vinBatteryNo"/>
</li>
<li>
<label>订单产生时间:</label>
<input type="text" class="time-input" placeholder="请选择订单产生时间" name="createdAt"/>
</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="orders:orderSub:add">-->
<!-- <i class="fa fa-plus"></i> 添加-->
<!-- </a>-->
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="orders:orderSub:edit">-->
<!-- <i class="fa fa-edit"></i> 修改-->
<!-- </a>-->
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="orders:orderSub:remove">-->
<!-- <i class="fa fa-remove"></i> 删除-->
<!-- </a>-->
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="orders:orderSub: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('orders:orderSub:edit')}]];
var removeFlag = [[${@permission.hasPermi('orders:orderSub:remove')}]];
var suborderTypeDatas = [[${@dict.getType('key_order_suborder_type')}]];
var prefix = ctx + "orders/orderSub";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "租车子订单",
columns: [{
checkbox: true
},
{
field: 'suborderId',
title: '子订单',
visible: false
},
{
field: 'orderId',
title: '订单号'
},
{
field: 'suborderNo',
title: '子订单编号'
},
{
field: 'suborderType',
title: '子订单类型',
formatter: function(value, row, index) {
return $.table.selectDictLabel(suborderTypeDatas, value);
}
},
{
field: 'amount',
title: '订单金额'
},
{
field: 'paymentMethod',
title: '支付方式'
},
{
field: 'vinBatteryNo',
title: '车架/电池编号'
},
{
field: 'createdAt',
title: '订单产生时间'
},
{
field: 'paymentId',
title: '支付方式'
},
{
field: 'paidAt',
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.suborderId + '\')"><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.suborderId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>