订单详情等相关,手动还车结束订单
This commit is contained in:
@ -44,8 +44,8 @@ public class ZcRentCarRule extends BaseEntity
|
||||
@Excel(name = "押金价格(元)")
|
||||
private BigDecimal depositPrice;
|
||||
|
||||
/** 逾期金额(元) */
|
||||
@Excel(name = "逾期金额(元)")
|
||||
/** 逾期价格(元) */
|
||||
@Excel(name = "逾期价格(元)")
|
||||
private BigDecimal overdueFee;
|
||||
|
||||
/** 逾期计费类型 */
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
package com.ruoyi.operation.util;
|
||||
|
||||
public enum CarStatusEnum {
|
||||
|
||||
CAR_STATUS_0("0", "正常"),
|
||||
CAR_STATUS_1("1", "下架"),
|
||||
CAR_STATUS_9("9", "租赁中");
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
CarStatusEnum(String code, String info) {
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo() {
|
||||
return info;
|
||||
}
|
||||
|
||||
}
|
||||
@ -117,6 +117,8 @@ public class ZcOrderMainController extends BaseController
|
||||
{
|
||||
ZcOrderMain zcOrderMain = zcOrderMainService.selectZcOrderMainByOrderId(orderId);
|
||||
mmap.put("zcOrderMain", zcOrderMain);
|
||||
ZcOrderMain zcOrderMainImg = zcOrderMainService.selectZcOrderMainImgByOrderId(orderId);
|
||||
mmap.put("zcOrderMainImg", zcOrderMainImg);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
@ -150,13 +152,7 @@ public class ZcOrderMainController extends BaseController
|
||||
@ResponseBody
|
||||
public AjaxResult manualEndOrder(Long orderId)
|
||||
{
|
||||
ZcOrderMain zcOrderMain =new ZcOrderMain();
|
||||
zcOrderMain.setOrderId(orderId);
|
||||
zcOrderMain.setOrderStatus(OrderStatusEnum.MANUAL_END.getCode());
|
||||
zcOrderMain.setUpdateBy(getLoginName());
|
||||
zcOrderMain.setUpdateTime(DateUtils.getNowDate());
|
||||
|
||||
return toAjax(zcOrderMainService.updateManualEndOrder(zcOrderMain));
|
||||
return toAjax(zcOrderMainService.updateManualEndOrder(orderId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,108 @@
|
||||
package com.ruoyi.orders.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 订单租车车辆图片信息对象 zc_order_car_img
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
public class ZcOrderCarImg extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
/** 订单ID(外键) */
|
||||
@Excel(name = "订单ID", readConverterExp = "外=键")
|
||||
private Long orderId;
|
||||
|
||||
/** 订单编号 */
|
||||
@Excel(name = "订单编号")
|
||||
private String orderNo;
|
||||
|
||||
/** 图片类型:RENT租车,RETURN还车 */
|
||||
@Excel(name = "图片类型:RENT租车,RETURN还车")
|
||||
private String imgType;
|
||||
|
||||
/** 图片地址 */
|
||||
@Excel(name = "图片地址")
|
||||
private String imgUrl;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
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 setImgType(String imgType)
|
||||
{
|
||||
this.imgType = imgType;
|
||||
}
|
||||
|
||||
public String getImgType()
|
||||
{
|
||||
return imgType;
|
||||
}
|
||||
public void setImgUrl(String imgUrl)
|
||||
{
|
||||
this.imgUrl = imgUrl;
|
||||
}
|
||||
|
||||
public String getImgUrl()
|
||||
{
|
||||
return imgUrl;
|
||||
}
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("orderId", getOrderId())
|
||||
.append("orderNo", getOrderNo())
|
||||
.append("imgType", getImgType())
|
||||
.append("imgUrl", getImgUrl())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -86,8 +86,8 @@ public class ZcOrderMain extends BaseEntity
|
||||
@Excel(name = "押金价格(元)")
|
||||
private BigDecimal depositPrice;
|
||||
|
||||
/** 逾期金额(元) */
|
||||
@Excel(name = "逾期金额(元)")
|
||||
/** 逾期价格(元) */
|
||||
@Excel(name = "逾期价格(元)")
|
||||
private BigDecimal overdueFee;
|
||||
|
||||
@Excel(name = "逾期计费类型")
|
||||
@ -158,6 +158,8 @@ public class ZcOrderMain extends BaseEntity
|
||||
@Excel(name = "订单结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endOrderTime;
|
||||
|
||||
/** 订单逾期金额 */
|
||||
private BigDecimal overdueAmount;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
@ -165,6 +167,9 @@ public class ZcOrderMain extends BaseEntity
|
||||
/** 租车子订单信息 */
|
||||
private List<ZcOrderSub> zcOrderSubList;
|
||||
|
||||
/** 订单租车车辆图片信息信息 */
|
||||
private List<ZcOrderCarImg> zcOrderCarImgList;
|
||||
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
@ -480,6 +485,14 @@ public class ZcOrderMain extends BaseEntity
|
||||
this.endOrderTime = endOrderTime;
|
||||
}
|
||||
|
||||
public BigDecimal getOverdueAmount() {
|
||||
return overdueAmount;
|
||||
}
|
||||
|
||||
public void setOverdueAmount(BigDecimal overdueAmount) {
|
||||
this.overdueAmount = overdueAmount;
|
||||
}
|
||||
|
||||
public String getOverdueType() {
|
||||
return overdueType;
|
||||
}
|
||||
@ -504,6 +517,14 @@ public class ZcOrderMain extends BaseEntity
|
||||
this.damageDesc = damageDesc;
|
||||
}
|
||||
|
||||
public List<ZcOrderCarImg> getZcOrderCarImgList() {
|
||||
return zcOrderCarImgList;
|
||||
}
|
||||
|
||||
public void setZcOrderCarImgList(List<ZcOrderCarImg> zcOrderCarImgList) {
|
||||
this.zcOrderCarImgList = zcOrderCarImgList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
|
||||
@ -19,6 +19,13 @@ public interface ZcOrderMainMapper
|
||||
* @return 租车订单
|
||||
*/
|
||||
public ZcOrderMain selectZcOrderMainByOrderId(Long orderId);
|
||||
/**
|
||||
* 查询租车订单图片
|
||||
*
|
||||
* @param orderId 租车订单主键
|
||||
* @return 租车订单
|
||||
*/
|
||||
public ZcOrderMain selectZcOrderMainImgByOrderId(Long orderId);
|
||||
|
||||
/**
|
||||
* 查询租车订单列表
|
||||
|
||||
@ -19,6 +19,8 @@ public interface IZcOrderMainService
|
||||
*/
|
||||
public ZcOrderMain selectZcOrderMainByOrderId(Long orderId);
|
||||
|
||||
public ZcOrderMain selectZcOrderMainImgByOrderId(Long orderId);
|
||||
|
||||
/**
|
||||
* 查询租车订单列表
|
||||
*
|
||||
@ -59,6 +61,6 @@ public interface IZcOrderMainService
|
||||
*/
|
||||
public int deleteZcOrderMainByOrderId(Long orderId);
|
||||
|
||||
public int updateManualEndOrder(ZcOrderMain zcOrderMain);
|
||||
public int updateManualEndOrder(Long orderId);
|
||||
|
||||
}
|
||||
|
||||
@ -1,7 +1,13 @@
|
||||
package com.ruoyi.orders.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.operation.domain.ZcCar;
|
||||
import com.ruoyi.operation.service.IZcCarService;
|
||||
import com.ruoyi.operation.util.CarStatusEnum;
|
||||
import com.ruoyi.orders.util.OrderStatusEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.ArrayList;
|
||||
@ -25,6 +31,8 @@ public class ZcOrderMainServiceImpl implements IZcOrderMainService
|
||||
@Autowired
|
||||
private ZcOrderMainMapper zcOrderMainMapper;
|
||||
|
||||
@Autowired
|
||||
private IZcCarService zcCarService;
|
||||
/**
|
||||
* 查询租车订单
|
||||
*
|
||||
@ -37,6 +45,12 @@ public class ZcOrderMainServiceImpl implements IZcOrderMainService
|
||||
return zcOrderMainMapper.selectZcOrderMainByOrderId(orderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZcOrderMain selectZcOrderMainImgByOrderId(Long orderId)
|
||||
{
|
||||
return zcOrderMainMapper.selectZcOrderMainImgByOrderId(orderId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询租车订单列表
|
||||
*
|
||||
@ -110,9 +124,31 @@ public class ZcOrderMainServiceImpl implements IZcOrderMainService
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateManualEndOrder(ZcOrderMain zcOrderMain) {
|
||||
public int updateManualEndOrder(Long orderId) {
|
||||
//订单手动结束逻辑待完善
|
||||
return zcOrderMainMapper.updateZcOrderMain(zcOrderMain);
|
||||
//1、修改订单状态,2计算逾期费用(如果有逾期),3、释放车辆状态
|
||||
//1、修改订单状态
|
||||
ZcOrderMain zcOrderMain =new ZcOrderMain();
|
||||
zcOrderMain.setOrderId(orderId);
|
||||
zcOrderMain.setOrderStatus(OrderStatusEnum.MANUAL_END.getCode());
|
||||
zcOrderMain.setUpdateBy(ShiroUtils.getSysUser().getLoginName());
|
||||
zcOrderMain.setUpdateTime(DateUtils.getNowDate());
|
||||
// 2计算逾期费用
|
||||
long overdueDays = DateUtils.daysBetween(DateUtils.getNowDate(),zcOrderMain.getEndRentTime());
|
||||
if(overdueDays > 0) {
|
||||
zcOrderMain.setOverdueDays(overdueDays);
|
||||
zcOrderMain.setOverdueAmount(zcOrderMain.getOverdueFee().multiply(new BigDecimal(zcOrderMain.getOverdueDays())));
|
||||
}
|
||||
zcOrderMain.setEndOrderTime(DateUtils.getNowDate());
|
||||
int flag = zcOrderMainMapper.updateZcOrderMain(zcOrderMain);
|
||||
if(flag > 0){
|
||||
//3释放车辆状态
|
||||
ZcCar zcCar = new ZcCar();
|
||||
zcCar.setId(zcOrderMain.getVehicleId());
|
||||
zcCar.setStatus(CarStatusEnum.CAR_STATUS_0.getCode());
|
||||
zcCarService.updateZcCar(zcCar);
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -7,7 +7,7 @@ ruoyi:
|
||||
# 版权年份
|
||||
copyrightYear: 2025
|
||||
# 实例演示开关
|
||||
demoEnabled: false
|
||||
demoEnabled: true
|
||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||
#profile: D:/ruoyi/uploadPath
|
||||
profile: /home/sczx/uploadPath
|
||||
|
||||
@ -204,6 +204,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="iotCode != null">iot_code = #{iotCode},</if>
|
||||
<if test="operatorId != null">operator_id = #{operatorId},</if>
|
||||
<if test="operatorName != null">operator_name = #{operatorName},</if>
|
||||
<if test="storeId != null">store_id = #{storeId},</if>
|
||||
<if test="storeName != null">store_name = #{storeName},</if>
|
||||
<if test="packageId != null">package_id = #{packageId},</if>
|
||||
<if test="packageName != null">package_name = #{packageName},</if>
|
||||
@ -219,7 +220,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="extend3 != null">extend3 = #{extend3},</if>
|
||||
<if test="extend4 != null">extend4 = #{extend4},</if>
|
||||
<if test="extend5 != null">extend5 = #{extend5},</if>
|
||||
store_id = #{storeId}
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
@ -38,6 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="damageAmount" column="damage_amount" />
|
||||
<result property="damageDesc" column="damage_desc" />
|
||||
<result property="orderAmount" column="order_amount" />
|
||||
<result property="overdueAmount" column="overdue_amount" />
|
||||
<result property="endOrderTime" column="end_order_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createTime" column="create_time" />
|
||||
@ -68,12 +69,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updateTime" column="sub_update_time" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ZcOrderMainZcOrderCarImgResult" type="ZcOrderMain" extends="ZcOrderMainResult">
|
||||
<collection property="zcOrderCarImgList" notNullColumn="sub_id" javaType="java.util.List" resultMap="ZcOrderCarImgResult" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="ZcOrderCarImg" id="ZcOrderCarImgResult">
|
||||
<result property="id" column="sub_id" />
|
||||
<result property="orderId" column="sub_order_id" />
|
||||
<result property="orderNo" column="sub_order_no" />
|
||||
<result property="imgType" column="sub_img_type" />
|
||||
<result property="imgUrl" column="sub_img_url" />
|
||||
<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, car_model_id, customer_id, customer_name, customer_phone, battery_type, rental_type, rental_days, rental_price, deposit_price, overdue_fee, overdue_type, is_deposit_free, is_auto_deduct, first_order_time, pick_car_time, start_rent_time, end_rent_time, req_end_rent_time, act_end_rent_time, overdue_days, renewal_times, charge_times, rent_car_rule_id, rent_battey_rule_id, damage_amount,damage_desc, order_amount, end_order_time, del_flag, create_time, update_time from zc_order_main
|
||||
select order_id, order_no, order_status, operator_id, store_id, vehicle_id, car_model_id, customer_id, customer_name, customer_phone, battery_type, rental_type, rental_days, rental_price, deposit_price, overdue_fee, overdue_type, is_deposit_free, is_auto_deduct, first_order_time, pick_car_time, start_rent_time, end_rent_time, req_end_rent_time, act_end_rent_time, overdue_days, renewal_times, charge_times, rent_car_rule_id, rent_battey_rule_id, damage_amount,damage_desc, order_amount, overdue_amount, end_order_time, del_flag, create_time, update_time from zc_order_main
|
||||
</sql>
|
||||
|
||||
<select id="selectZcOrderMainList" parameterType="ZcOrderMain" resultMap="ZcOrderMainResult">
|
||||
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.damage_amount,a.damage_desc, a.order_amount, a.end_order_time, a.del_flag, a.create_time, a.update_time,
|
||||
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.damage_amount,a.damage_desc, a.order_amount, a.overdue_amount, a.end_order_time, a.del_flag, a.create_time, a.update_time,
|
||||
c.company_name as operator_name,s.name as store_name,zc.license_plate as license_plate
|
||||
from zc_order_main a
|
||||
left join zc_company c on c.id = a.operator_id
|
||||
@ -110,14 +126,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</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.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.damage_amount,a.damage_desc,a.order_amount, a.end_order_time, a.del_flag, a.create_time, a.update_time,
|
||||
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.damage_amount,a.damage_desc,a.order_amount, a.overdue_amount, a.end_order_time, 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,
|
||||
c.company_name as operator_name,s.name as store_name,zc.license_plate as license_plate
|
||||
c.company_name as operator_name,s.name as store_name,zc.license_plate as license_plate,
|
||||
i.id as sub_id, i.order_id as sub_order_id, i.order_no as sub_order_no, i.img_type as sub_img_type, i.img_url as sub_img_url, i.create_time as sub_create_time, i.update_time as sub_update_time
|
||||
from zc_order_main a
|
||||
left join zc_company c on c.id = a.operator_id
|
||||
left join zc_company_store s on s.id = a.store_id
|
||||
left join zc_car zc on zc.id = a.vehicle_id
|
||||
left join zc_order_sub b on b.order_id = a.order_id
|
||||
left join zc_order_car_img i on i.order_id = a.order_id
|
||||
where a.order_id = #{orderId}
|
||||
</select>
|
||||
|
||||
<select id="selectZcOrderMainImgByOrderId" parameterType="Long" resultMap="ZcOrderMainZcOrderCarImgResult">
|
||||
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.damage_amount,a.damage_desc,a.order_amount, a.overdue_amount, a.end_order_time, a.del_flag, a.create_time, a.update_time,
|
||||
c.company_name as operator_name,s.name as store_name,zc.license_plate as license_plate,
|
||||
i.id as sub_id, i.order_id as sub_order_id, i.order_no as sub_order_no, i.img_type as sub_img_type, i.img_url as sub_img_url, i.create_time as sub_create_time, i.update_time as sub_update_time
|
||||
from zc_order_main a
|
||||
left join zc_company c on c.id = a.operator_id
|
||||
left join zc_company_store s on s.id = a.store_id
|
||||
left join zc_car zc on zc.id = a.vehicle_id
|
||||
left join zc_order_car_img i on i.order_id = a.order_id
|
||||
where a.order_id = #{orderId}
|
||||
</select>
|
||||
|
||||
@ -204,6 +234,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<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="orderAmount != null">order_amount = #{orderAmount},</if>
|
||||
<if test="overdueAmount != null">overdue_amount = #{overdueAmount},</if>
|
||||
<if test="endOrderTime != null">end_order_time = #{endOrderTime},</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>
|
||||
|
||||
@ -37,6 +37,13 @@
|
||||
<label>所属门店:</label>
|
||||
<input type="text" name="storeName"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>车辆状态:</label>
|
||||
<select name="status" th:with="type=${@dict.getType('key_car_status')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
@ -163,14 +170,16 @@
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
if (row.status != '9') {
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>修改</a> ');
|
||||
actions.push('<a class="btn btn-success btn-xs ' + distributeFlag + ' btnOption" href="javascript:void(0)" onclick="distribute(\'' + row.id + '\')"><i class="fa fa-edit"></i>分配</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + ' btnOption" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
if (row.status == 1) {
|
||||
if (row.status == '1') {
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="enable(\'' + row.id + '\')"><i class="fa fa-edit"></i>上架</a> ');
|
||||
} else {
|
||||
} else if (row.status == '0') {
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="disable(\'' + row.id + '\')"><i class="fa fa-edit"></i>下架</a> ');
|
||||
}
|
||||
}
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
|
||||
@ -201,7 +201,7 @@
|
||||
},
|
||||
{
|
||||
field: 'overdueFee',
|
||||
title: '逾期金额(元)'
|
||||
title: '逾期价格(元)'
|
||||
},
|
||||
{
|
||||
field: 'overdueType',
|
||||
|
||||
@ -165,7 +165,7 @@
|
||||
},
|
||||
{
|
||||
field: 'overdueFee',
|
||||
title: '逾期金额(元)'
|
||||
title: '逾期价格(元)'
|
||||
},
|
||||
{
|
||||
field: 'overdueType',
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">逾期金额(元):</label>
|
||||
<label class="col-sm-3 control-label is-required">逾期价格(元):</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="overdueFee" name="overdueFee" class="form-control" type="text" required>
|
||||
</div>
|
||||
@ -114,7 +114,7 @@
|
||||
$(document).ready(function() {
|
||||
// 初始隐藏租赁天数
|
||||
var $rentalDaysGroup = $('input[name="rentalDays"]').closest('.form-group').hide();
|
||||
// 初始隐藏逾期金额
|
||||
// 初始隐藏逾期价格
|
||||
var $overdueFeeGroup = $('input[name="overdueFee"]').closest('.form-group').show();
|
||||
|
||||
// 保存当前选中的值
|
||||
@ -139,7 +139,7 @@
|
||||
// 更新当前值
|
||||
currentRentalType = newRentalType;
|
||||
|
||||
// 处理逾期金额显示/隐藏
|
||||
// 处理逾期价格显示/隐藏
|
||||
// if(newRentalType === '1') {
|
||||
// $overdueFeeGroup.hide().find('input').val('');
|
||||
// } else {
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">逾期金额(元):</label>
|
||||
<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" readonly>
|
||||
</div>
|
||||
@ -118,7 +118,7 @@
|
||||
|
||||
// 初始隐藏租赁天数
|
||||
$('input[name="rentalDays"]').closest('.form-group').hide();
|
||||
// 初始显示逾期金额
|
||||
// 初始显示逾期价格
|
||||
var $overdueFeeGroup = $('input[name="overdueFee"]').closest('.form-group');
|
||||
|
||||
// 检查初始选中项
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label is-required">逾期金额(元):</label>
|
||||
<label class="col-sm-2 control-label is-required">逾期价格(元):</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="form-control-static" th:text="*{overdueFee}"></div>
|
||||
</div>
|
||||
@ -86,7 +86,7 @@
|
||||
|
||||
// 初始隐藏租赁天数
|
||||
$('input[name="rentalDays"]').closest('.form-group').hide();
|
||||
// 初始显示逾期金额
|
||||
// 初始显示逾期价格
|
||||
var $overdueFeeGroup = $('input[name="overdueFee"]').closest('.form-group');
|
||||
|
||||
// 检查初始选中项
|
||||
|
||||
@ -141,7 +141,7 @@
|
||||
},
|
||||
{
|
||||
field: 'overdueFee',
|
||||
title: '逾期金额(元)'
|
||||
title: '逾期价格(元)'
|
||||
},
|
||||
{
|
||||
field: 'overdueType',
|
||||
|
||||
@ -86,7 +86,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">逾期金额(元):</label>
|
||||
<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>
|
||||
|
||||
@ -75,7 +75,7 @@
|
||||
<div class="col-sm-4">
|
||||
<div class="form-control-static" th:text="*{depositPrice}"></div>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label is-required">逾期金额(元):</label>
|
||||
<label class="col-sm-2 control-label is-required">逾期价格(元):</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="form-control-static" th:text="*{overdueFee}"></div>
|
||||
</div>
|
||||
@ -113,21 +113,24 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label is-required">逾期天数:</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="form-control-static" th:text="*{overdueDays}"></div>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label is-required">续租次数:</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="form-control-static" th:text="*{renewalTimes}"></div>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label is-required">逾期天数:</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="form-control-static" th:text="*{overdueDays}"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label is-required">充电次数:</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="form-control-static" th:text="*{chargeTimes}"></div>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label is-required">逾期金额(元):</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="form-control-static" th:text="*{overdueAmount}"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label is-required">车损金额(元):</label>
|
||||
@ -148,12 +151,22 @@
|
||||
<!-- <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>
|
||||
<table id="bootstrap-table-sub"></table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<button type="button" th:if="not (*{orderStatus} == 'AUTO_END' or *{orderStatus} == 'MANUAL_END')" class="btn btn-white btn-sm" onclick="manualEndOrder()">手动结束订单</i></button>
|
||||
<h4 class="form-header h4">租车订单图片信息</h4>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<button type="button" th:if="not (*{orderStatus} == 'AUTO_END' or *{orderStatus} == 'MANUAL_END')" class="btn btn-success btn-xs" onclick="manualEndOrder()">手动结束订单</i></button>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
@ -162,6 +175,7 @@
|
||||
var prefix = ctx + "orders/order";
|
||||
var suborderTypeDatas = [[${@dict.getType('key_order_suborder_type')}]];
|
||||
var paymentMethodDatas = [[${@dict.getType('key_order_payment_method')}]];
|
||||
var imgTypeDatas = [[${@dict.getType('key_order_img_type')}]];
|
||||
$("#form-order-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
@ -194,15 +208,6 @@
|
||||
showColumns: false,
|
||||
sidePagination: "client",
|
||||
columns: [
|
||||
{
|
||||
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',
|
||||
@ -264,11 +269,53 @@
|
||||
field: 'updateTime',
|
||||
align: 'center',
|
||||
title: '更新时间'
|
||||
},
|
||||
|
||||
}
|
||||
]
|
||||
};
|
||||
$.table.init(options);
|
||||
$('#bootstrap-table-sub').bootstrapTable(options);
|
||||
|
||||
var options2 = {
|
||||
data: [[${zcOrderMainImg.zcOrderCarImgList}]],
|
||||
pagination: false,
|
||||
showSearch: false,
|
||||
showRefresh: false,
|
||||
showToggle: false,
|
||||
showColumns: false,
|
||||
sidePagination: "client",
|
||||
columns: [
|
||||
{
|
||||
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: 'imgType',
|
||||
align: 'center',
|
||||
title: '图片类型',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(imgTypeDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'imgUrl',
|
||||
align: 'center',
|
||||
title: '图片',
|
||||
formatter: function(value, row, index) {
|
||||
// 图片预览(注意:如存储在本地直接获取数据库路径,如有配置context-path需要使用ctx+路径)
|
||||
return $.table.imageView(value, "600px", "600px");
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
align: 'center',
|
||||
title: '创建时间'
|
||||
}]
|
||||
};
|
||||
$.table.init(options2);
|
||||
});
|
||||
|
||||
function manualEndOrder(){
|
||||
|
||||
@ -9,6 +9,8 @@ import java.time.LocalTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
|
||||
/**
|
||||
@ -185,4 +187,25 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault());
|
||||
return Date.from(zdt.toInstant());
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算两个Date之间的天数差
|
||||
* @param startDate 开始日期
|
||||
* @param endDate 结束日期
|
||||
* @return 相差的天数(如果endDate在startDate之后,返回正数;否则返回负数)
|
||||
*/
|
||||
public static long daysBetween(Date startDate, Date endDate) {
|
||||
long diffInMillis = endDate.getTime() - startDate.getTime();
|
||||
return TimeUnit.DAYS.convert(diffInMillis, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算两个Date之间的天数差(绝对值)
|
||||
* @param startDate 开始日期
|
||||
* @param endDate 结束日期
|
||||
* @return 相差的天数(总是返回正数)
|
||||
*/
|
||||
public static long daysBetweenAbs(Date startDate, Date endDate) {
|
||||
return Math.abs(daysBetween(startDate, endDate));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user