联调
This commit is contained in:
parent
b16dee9ff8
commit
a36d5b405d
|
@ -284,12 +284,12 @@ public class AppController extends BaseController
|
||||||
if(order.getRuleId() == null){
|
if(order.getRuleId() == null){
|
||||||
return error("计费规则id不能为空");
|
return error("计费规则id不能为空");
|
||||||
}
|
}
|
||||||
if(order.getAgentId() == null){
|
// if(order.getAgentId() == null){
|
||||||
return error("代理商id不能为空");
|
// return error("代理商id不能为空");
|
||||||
}
|
// }
|
||||||
if(order.getDeliveryMethod() == null){
|
// if(order.getDeliveryMethod() == null){
|
||||||
return error("配送方式不能为空");
|
// return error("配送方式不能为空");
|
||||||
}
|
// }
|
||||||
if(StrUtil.isBlank(order.getType())){
|
if(StrUtil.isBlank(order.getType())){
|
||||||
return error("类型不能为空");
|
return error("类型不能为空");
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,6 +196,10 @@ public class AppVerifyController extends BaseController
|
||||||
if(order.getType() == null){
|
if(order.getType() == null){
|
||||||
throw new ServiceException("订单类型不能为空");
|
throw new ServiceException("订单类型不能为空");
|
||||||
}
|
}
|
||||||
|
// 订单类型sn不能为空
|
||||||
|
if(StrUtil.isBlank(order.getSn())){
|
||||||
|
throw new ServiceException("sn不能为空");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -673,6 +677,29 @@ public class AppVerifyController extends BaseController
|
||||||
return success(device);
|
return success(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 切换默认展示车辆
|
||||||
|
*/
|
||||||
|
@PutMapping("/toggleDefault")
|
||||||
|
public AjaxResult toggleDefault(String sn)
|
||||||
|
{
|
||||||
|
if(StrUtil.isBlank(sn)){
|
||||||
|
logger.info("【切换默认展示车辆】没有sn号参数:【sn={}】",sn);
|
||||||
|
return error("【切换默认展示车辆】sn不能为空");
|
||||||
|
}
|
||||||
|
EDeviceQuery asDevice = new EDeviceQuery();
|
||||||
|
asDevice.setSn(sn);
|
||||||
|
asDevice.setUserId(getUserId());
|
||||||
|
asDevice.setIsDefault(ServiceConstants.IS_DEFAULT_YES);
|
||||||
|
Boolean execute = transactionTemplate.execute(e -> {
|
||||||
|
int i = deviceService.updateEDeviceBySn(asDevice);
|
||||||
|
int i1 = deviceService.cancelDefault(getUserId(), sn);
|
||||||
|
return Boolean.TRUE;
|
||||||
|
});
|
||||||
|
if(Boolean.FALSE.equals(execute))throw new ServiceException("【切换默认展示车辆】失败");
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据mac号查询车辆信息
|
* 根据mac号查询车辆信息
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -45,25 +45,25 @@ public class ServiceConstants {
|
||||||
/**----------------------------支付场景end----------------------------*/
|
/**----------------------------支付场景end----------------------------*/
|
||||||
|
|
||||||
/**----------------------------订单状态start----------------------------*/
|
/**----------------------------订单状态start----------------------------*/
|
||||||
/** 状态:0-待支付;1-待取、2-待送、3-配送中、4-进行中、8-已结束、5-超时自动取消、6-已取消
|
/** 状态:0-待支付;4-进行中、8-已结束、5-超时自动取消、6-已取消
|
||||||
* 订单状态:0-待支付
|
* 订单状态:0-待支付
|
||||||
*/
|
*/
|
||||||
public static final String ORDER_STATUS_TO_BE_PAID = "0";
|
public static final String ORDER_STATUS_TO_BE_PAID = "0";
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 订单状态:1-待取
|
// * 订单状态:1-待取
|
||||||
*/
|
// */
|
||||||
public static final String ORDER_STATUS_TO_BE_TAKEN = "1";
|
// public static final String ORDER_STATUS_TO_BE_TAKEN = "1";
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 订单状态:2-待送
|
||||||
|
// */
|
||||||
|
// public static final String ORDER_STATUS_TO_BE_SENT = "2";
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 订单状态:2-待送
|
// * 订单状态:3-配送中
|
||||||
*/
|
// */
|
||||||
public static final String ORDER_STATUS_TO_BE_SENT = "2";
|
// public static final String ORDER_STATUS_IN_DELIVERY = "3";
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单状态:3-配送中
|
|
||||||
*/
|
|
||||||
public static final String ORDER_STATUS_IN_DELIVERY = "3";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单状态:4-进行中
|
* 订单状态:4-进行中
|
||||||
|
@ -740,11 +740,6 @@ public class ServiceConstants {
|
||||||
*/
|
*/
|
||||||
public static final String KEY_STATUS_NEW = "0";
|
public static final String KEY_STATUS_NEW = "0";
|
||||||
|
|
||||||
// /**
|
|
||||||
// * 钥匙状态: 1-待领取
|
|
||||||
// */
|
|
||||||
// public static final String KEY_STATUS_PENDING = "1";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 钥匙状态: 2-已领取
|
* 钥匙状态: 2-已领取
|
||||||
*/
|
*/
|
||||||
|
@ -757,5 +752,18 @@ public class ServiceConstants {
|
||||||
|
|
||||||
/**----------------------------钥匙状态end----------------------------*/
|
/**----------------------------钥匙状态end----------------------------*/
|
||||||
|
|
||||||
|
/**----------------------------是否默认展示设备start----------------------------*/
|
||||||
|
/**
|
||||||
|
* 是否默认展示设备: 0-否
|
||||||
|
*/
|
||||||
|
public static final String IS_DEFAULT_NO = "0";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否默认展示设备: 1-是
|
||||||
|
*/
|
||||||
|
public static final String IS_DEFAULT_YES = "1";
|
||||||
|
|
||||||
|
/**----------------------------是否默认展示设备end----------------------------*/
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 回调日志对象 rl_callback_log
|
* 回调日志对象 e_callback_log
|
||||||
*
|
*
|
||||||
* @author 邱贞招
|
* @author 邱贞招
|
||||||
* @date 2024-06-18
|
* @date 2024-06-18
|
||||||
|
|
|
@ -201,4 +201,7 @@ public class EDevice extends BaseEntityPlus implements Serializable {
|
||||||
/** 是否启用震动报警:0-否;1-是 */
|
/** 是否启用震动报警:0-否;1-是 */
|
||||||
private String isVibrationAlarm;
|
private String isVibrationAlarm;
|
||||||
|
|
||||||
|
/** 是否默认展示设备:0-否,1-是 */
|
||||||
|
private String isDefault;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -266,12 +266,6 @@ public class EOrder extends BaseEntity {
|
||||||
@Excel(name = "取车时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
@Excel(name = "取车时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date pickupTime;
|
private Date pickupTime;
|
||||||
|
|
||||||
/**
|
|
||||||
* 代理商id
|
|
||||||
*/
|
|
||||||
@Excel(name = "代理商id")
|
|
||||||
private Long agentId;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 店铺id
|
* 店铺id
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -14,9 +14,6 @@ public class EOrderQuery extends EOrder {
|
||||||
/** 手机号*/
|
/** 手机号*/
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
/** 店铺id (还车店铺)*/
|
|
||||||
private Long returnStoreId;
|
|
||||||
|
|
||||||
/** jscode*/
|
/** jscode*/
|
||||||
private String jscode;
|
private String jscode;
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,4 @@ public class PriceVO {
|
||||||
|
|
||||||
/** 租金 */
|
/** 租金 */
|
||||||
private BigDecimal rent = BigDecimal.ZERO;
|
private BigDecimal rent = BigDecimal.ZERO;
|
||||||
|
|
||||||
/** 配送费 */
|
|
||||||
private BigDecimal deliveryFee = BigDecimal.ZERO;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.ruoyi.system.domain.device.EDevice;
|
import com.ruoyi.system.domain.device.EDevice;
|
||||||
|
import com.ruoyi.system.domain.device.EDeviceQuery;
|
||||||
import com.ruoyi.system.domain.device.EDeviceVO;
|
import com.ruoyi.system.domain.device.EDeviceVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
@ -158,4 +159,12 @@ public interface EDeviceMapper extends BaseMapper<EDevice>
|
||||||
* 获取到该代理商下所有的车辆数
|
* 获取到该代理商下所有的车辆数
|
||||||
*/
|
*/
|
||||||
Integer getTatalDeviceCount(@Param("merchantId") Long merchantId, @Param("status")String status, @Param("statusList")String[] statusList);
|
Integer getTatalDeviceCount(@Param("merchantId") Long merchantId, @Param("status")String status, @Param("statusList")String[] statusList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消默认
|
||||||
|
*
|
||||||
|
* @param sn 设备
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int cancelDefault(@Param("userId") Long userId, @Param("sn") String sn);
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,6 +102,15 @@ public interface IEDeviceService extends IService<EDevice>
|
||||||
*/
|
*/
|
||||||
public int updateEDeviceBySn(EDeviceQuery device);
|
public int updateEDeviceBySn(EDeviceQuery device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消默认
|
||||||
|
*
|
||||||
|
* @param userId 用户id
|
||||||
|
* @param sn sn
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int cancelDefault(Long userId, String sn);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除设备
|
* 批量删除设备
|
||||||
*
|
*
|
||||||
|
|
|
@ -138,17 +138,11 @@ public class CallbackServiceImpl implements CallbackService {
|
||||||
updateOrder.setPaid("1");
|
updateOrder.setPaid("1");
|
||||||
updateOrder.setPayTime(DateUtils.getNowDate());
|
updateOrder.setPayTime(DateUtils.getNowDate());
|
||||||
updateOrder.setPayType(payType);
|
updateOrder.setPayType(payType);
|
||||||
// if(originalOrder.getDeliveryMethod().equals(ServiceConstants.DELIVERY_METHOD_SELF_PICKUP)){
|
updateOrder.setStatus(ServiceConstants.ORDER_STATUS_IN_USE);
|
||||||
// updateOrder.setStatus(ServiceConstants.ORDER_STATUS_TO_BE_TAKEN);
|
/** 如果是续租的订单,结束原订单*/
|
||||||
// }else{
|
if(originalOrder.getType().equals(ServiceConstants.ORDER_TYPE_RELET)){
|
||||||
// updateOrder.setStatus(ServiceConstants.ORDER_STATUS_TO_BE_SENT);
|
closeOriginalOrder(originalOrder, updateOrder);
|
||||||
// }
|
}
|
||||||
// updateOrder.setCost(getCost(channelVO,originalOrder.getPayFee()));
|
|
||||||
//
|
|
||||||
// /** 如果是续租的订单,结束原订单*/
|
|
||||||
// if(originalOrder.getType().equals(ServiceConstants.ORDER_TYPE_RELET)){
|
|
||||||
// closeOriginalOrder(originalOrder, updateOrder);
|
|
||||||
// }else{
|
|
||||||
// // 如果是免费送取车或收费送取车则创建新的配送工单
|
// // 如果是免费送取车或收费送取车则创建新的配送工单
|
||||||
// if(originalOrder.getDeliveryMethod().equals(ServiceConstants.DELIVERY_METHOD_FREE_DELIVERY_CAR) || originalOrder.getDeliveryMethod().equals(ServiceConstants.DELIVERY_METHOD_CHARGE_DELIVERY_CAR)){
|
// if(originalOrder.getDeliveryMethod().equals(ServiceConstants.DELIVERY_METHOD_FREE_DELIVERY_CAR) || originalOrder.getDeliveryMethod().equals(ServiceConstants.DELIVERY_METHOD_CHARGE_DELIVERY_CAR)){
|
||||||
// /** 创建配送工单,状态为:待接单 */
|
// /** 创建配送工单,状态为:待接单 */
|
||||||
|
|
|
@ -32,6 +32,7 @@ import com.ruoyi.system.mapper.ECommandLogMapper;
|
||||||
import com.ruoyi.system.service.*;
|
import com.ruoyi.system.service.*;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
@ -350,6 +351,19 @@ public class EDeviceServiceImpl extends ServiceImpl<EDeviceMapper, EDevice> impl
|
||||||
return deviceMapper.updateEDeviceBySn(asDevice);
|
return deviceMapper.updateEDeviceBySn(asDevice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消默认
|
||||||
|
*
|
||||||
|
* @param userId 用户id
|
||||||
|
* @param sn sn
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int cancelDefault(Long userId, String sn)
|
||||||
|
{
|
||||||
|
return deviceMapper.cancelDefault(userId,sn);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除设备
|
* 批量删除设备
|
||||||
*
|
*
|
||||||
|
@ -1245,7 +1259,6 @@ public class EDeviceServiceImpl extends ServiceImpl<EDeviceMapper, EDevice> impl
|
||||||
updateOrder.setReturnType(orderQuery.getReturnType());
|
updateOrder.setReturnType(orderQuery.getReturnType());
|
||||||
updateOrder.setReturnTime(DateUtils.getNowDate());
|
updateOrder.setReturnTime(DateUtils.getNowDate());
|
||||||
updateOrder.setStatus(ServiceConstants.ORDER_STATUS_TO_BE_AUDITED);// 还车后订单状态变成待审核,只有商户确认才算完成
|
updateOrder.setStatus(ServiceConstants.ORDER_STATUS_TO_BE_AUDITED);// 还车后订单状态变成待审核,只有商户确认才算完成
|
||||||
updateOrder.setReturnTime(DateUtils.getNowDate());
|
|
||||||
String token = Token.getToken();
|
String token = Token.getToken();
|
||||||
|
|
||||||
EDevice device = deviceMapper.selectEDeviceBySn(order.getSn());
|
EDevice device = deviceMapper.selectEDeviceBySn(order.getSn());
|
||||||
|
|
|
@ -384,7 +384,7 @@ public class EOrderServiceImpl implements IEOrderService
|
||||||
@NotNull
|
@NotNull
|
||||||
private PrepayResponseVO getPrepayResponseVO(EOrderQuery order, String orderNo, String type, Long userId) {
|
private PrepayResponseVO getPrepayResponseVO(EOrderQuery order, String orderNo, String type, Long userId) {
|
||||||
EFeeRule feeRule = feeRuleService.selectRlFeeRuleByRuleId(order.getRuleId());
|
EFeeRule feeRule = feeRuleService.selectRlFeeRuleByRuleId(order.getRuleId());
|
||||||
setFeeRule(order, feeRule);
|
setFeeRule(type,order, feeRule);
|
||||||
/** 解析地址 analyzeAddress */
|
/** 解析地址 analyzeAddress */
|
||||||
// analyzeAddress(order);
|
// analyzeAddress(order);
|
||||||
order.setCreateTime(DateUtils.getNowDate());
|
order.setCreateTime(DateUtils.getNowDate());
|
||||||
|
@ -402,6 +402,14 @@ public class EOrderServiceImpl implements IEOrderService
|
||||||
order.setAutoCancelTime(DateUtils.getTimeAfterXMinutes(order.getCreateTime(),Integer.parseInt(configByKey)));
|
order.setAutoCancelTime(DateUtils.getTimeAfterXMinutes(order.getCreateTime(),Integer.parseInt(configByKey)));
|
||||||
|
|
||||||
/** 计算价格 */
|
/** 计算价格 */
|
||||||
|
EDevice eDevice = deviceService.selectEDeviceBySn(order.getSn());
|
||||||
|
if(eDevice == null){
|
||||||
|
throw new ServiceException("设备不存在");
|
||||||
|
}
|
||||||
|
if(eDevice.getModelId() == null){
|
||||||
|
throw new ServiceException("设备sn【"+order.getSn()+"】的车型不存在");
|
||||||
|
}
|
||||||
|
order.setModelId(eDevice.getModelId());
|
||||||
onceMoreCalculatePrice(order);
|
onceMoreCalculatePrice(order);
|
||||||
order.setStatus(ServiceConstants.ORDER_STATUS_TO_BE_PAID);
|
order.setStatus(ServiceConstants.ORDER_STATUS_TO_BE_PAID);
|
||||||
EModelVO rlModelVO = modelService.selectEModelByModelId(order.getModelId());
|
EModelVO rlModelVO = modelService.selectEModelByModelId(order.getModelId());
|
||||||
|
@ -443,7 +451,6 @@ public class EOrderServiceImpl implements IEOrderService
|
||||||
PriceVO priceVO = calculatePrice(order);
|
PriceVO priceVO = calculatePrice(order);
|
||||||
order.setDeposit(priceVO.getDeposit());
|
order.setDeposit(priceVO.getDeposit());
|
||||||
order.setLeaseFee(priceVO.getRent());
|
order.setLeaseFee(priceVO.getRent());
|
||||||
// order.setDeliveryFee(priceVO.getDeliveryFee());
|
|
||||||
order.setTotalFee(priceVO.getTotalFee());
|
order.setTotalFee(priceVO.getTotalFee());
|
||||||
order.setPayFee(priceVO.getTotalFee());
|
order.setPayFee(priceVO.getTotalFee());
|
||||||
}
|
}
|
||||||
|
@ -454,7 +461,7 @@ public class EOrderServiceImpl implements IEOrderService
|
||||||
// order.setPickupLoc(address);
|
// order.setPickupLoc(address);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
private void setFeeRule(EOrderQuery order, EFeeRule feeRule) {
|
private void setFeeRule(String type, EOrderQuery order, EFeeRule feeRule) {
|
||||||
order.setNum(order.getNum());
|
order.setNum(order.getNum());
|
||||||
order.setPrice(feeRule.getPrice());
|
order.setPrice(feeRule.getPrice());
|
||||||
order.setExplain(feeRule.getExplain());
|
order.setExplain(feeRule.getExplain());
|
||||||
|
@ -465,7 +472,7 @@ public class EOrderServiceImpl implements IEOrderService
|
||||||
/** 如果是租赁订单,根据取车时间计算到期时间
|
/** 如果是租赁订单,根据取车时间计算到期时间
|
||||||
* 如果是续费订单,根据到期时间计算续费订单的到期时间 */
|
* 如果是续费订单,根据到期时间计算续费订单的到期时间 */
|
||||||
Date startTime = null;
|
Date startTime = null;
|
||||||
if(order.getType().equals(ServiceConstants.ORDER_TYPE_LEASE)){
|
if(ServiceConstants.ORDER_TYPE_LEASE.equals(type)){
|
||||||
startTime = DateUtils.getNowDate();
|
startTime = DateUtils.getNowDate();
|
||||||
}else{
|
}else{
|
||||||
startTime = order.getExpiryTime();
|
startTime = order.getExpiryTime();
|
||||||
|
@ -584,7 +591,7 @@ public class EOrderServiceImpl implements IEOrderService
|
||||||
public PrepayResponseVO relet(EOrderQuery query) {
|
public PrepayResponseVO relet(EOrderQuery query) {
|
||||||
EOrderVO order = orderMapper.selectRlOrderByOrderNo(query.getOrderNo());
|
EOrderVO order = orderMapper.selectRlOrderByOrderNo(query.getOrderNo());
|
||||||
if(ObjectUtil.isNull(order)){
|
if(ObjectUtil.isNull(order)){
|
||||||
throw new RuntimeException("订单["+query.getOrderNo()+"]不存在");
|
throw new RuntimeException("订单【"+query.getOrderNo()+"】不存在");
|
||||||
}
|
}
|
||||||
EOrderQuery orderQuery = new EOrderQuery();
|
EOrderQuery orderQuery = new EOrderQuery();
|
||||||
BeanUtils.copyBeanProp(orderQuery,order);
|
BeanUtils.copyBeanProp(orderQuery,order);
|
||||||
|
@ -631,9 +638,9 @@ public class EOrderServiceImpl implements IEOrderService
|
||||||
}
|
}
|
||||||
// 取消订单改成配送工单还没有接单前可以取消订单
|
// 取消订单改成配送工单还没有接单前可以取消订单
|
||||||
// 判断是否在配送工单还没有接单前
|
// 判断是否在配送工单还没有接单前
|
||||||
if(Integer.parseInt(order.getStatus()) >= Integer.parseInt(ServiceConstants.ORDER_STATUS_IN_DELIVERY)){
|
// if(Integer.parseInt(order.getStatus()) >= Integer.parseInt(ServiceConstants.ORDER_STATUS_IN_DELIVERY)){
|
||||||
throw new RuntimeException("订单已配送或已使用,不能取消");
|
// throw new RuntimeException("订单已配送或已使用,不能取消");
|
||||||
}
|
// }
|
||||||
Boolean execute = transactionTemplate.execute(e -> {
|
Boolean execute = transactionTemplate.execute(e -> {
|
||||||
logger.info("=================【订单取消】==================");
|
logger.info("=================【订单取消】==================");
|
||||||
if(ServiceConstants.ORDER_PAY_STATUS_PAID.equals(order.getPaid())){
|
if(ServiceConstants.ORDER_PAY_STATUS_PAID.equals(order.getPaid())){
|
||||||
|
@ -855,9 +862,7 @@ public class EOrderServiceImpl implements IEOrderService
|
||||||
if(ObjectUtil.isNull(rlOrderVO)){
|
if(ObjectUtil.isNull(rlOrderVO)){
|
||||||
throw new ServiceException("订单不存在");
|
throw new ServiceException("订单不存在");
|
||||||
}
|
}
|
||||||
if (!(ServiceConstants.ORDER_STATUS_ORDER_END.equals(rlOrderVO.getStatus()) ||
|
if (!ServiceConstants.ORDER_STATUS_ORDER_END.equals(rlOrderVO.getStatus())) {
|
||||||
ServiceConstants.ORDER_STATUS_TO_BE_TAKEN.equals(rlOrderVO.getStatus()) ||
|
|
||||||
ServiceConstants.ORDER_STATUS_TO_BE_SENT.equals(rlOrderVO.getStatus()))) {
|
|
||||||
throw new ServiceException("退款失败,订单未结束");
|
throw new ServiceException("退款失败,订单未结束");
|
||||||
}
|
}
|
||||||
if(ServiceConstants.ORDER_PAY_STATUS_NON_PAYMENT.equals(rlOrderVO.getPaid())){
|
if(ServiceConstants.ORDER_PAY_STATUS_NON_PAYMENT.equals(rlOrderVO.getPaid())){
|
||||||
|
@ -904,7 +909,7 @@ public class EOrderServiceImpl implements IEOrderService
|
||||||
BigDecimal totalFee = BigDecimal.ZERO;
|
BigDecimal totalFee = BigDecimal.ZERO;
|
||||||
if(order.getType().equals(ServiceConstants.ORDER_TYPE_LEASE)){
|
if(order.getType().equals(ServiceConstants.ORDER_TYPE_LEASE)){
|
||||||
// 押金
|
// 押金
|
||||||
BigDecimal deposit = deposit(order.getSn(), priceVO);
|
BigDecimal deposit = deposit(order.getModelId(), priceVO);
|
||||||
totalFee = totalFee.add(deposit);
|
totalFee = totalFee.add(deposit);
|
||||||
}
|
}
|
||||||
// 租金
|
// 租金
|
||||||
|
@ -1060,22 +1065,14 @@ public class EOrderServiceImpl implements IEOrderService
|
||||||
return indexAdminVo;
|
return indexAdminVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
private BigDecimal deposit(String sn, PriceVO priceVO) {
|
private BigDecimal deposit(Long modelId, PriceVO priceVO) {
|
||||||
EDevice eDevice = deviceService.selectEDeviceBySn(sn);
|
|
||||||
if(eDevice == null){
|
|
||||||
throw new ServiceException("设备不存在SN:"+sn);
|
|
||||||
}
|
|
||||||
Long modelId = eDevice.getModelId();
|
|
||||||
if(modelId == null){
|
|
||||||
throw new ServiceException("设备:【"+sn+"】车型未设置");
|
|
||||||
}
|
|
||||||
EModelVO rlModelVO = modelService.selectEModelByModelId(modelId);
|
EModelVO rlModelVO = modelService.selectEModelByModelId(modelId);
|
||||||
if(rlModelVO == null){
|
if(rlModelVO == null){
|
||||||
throw new ServiceException("车型不存在");
|
throw new ServiceException("车型不存在");
|
||||||
}
|
}
|
||||||
BigDecimal deposit = rlModelVO.getDeposit();
|
BigDecimal deposit = rlModelVO.getDeposit();
|
||||||
if(deposit == null){
|
if(deposit == null){
|
||||||
throw new ServiceException("车型:【"+modelId+"】押金未设置");
|
throw new ServiceException("车型【"+modelId+"未设置押金】");
|
||||||
}
|
}
|
||||||
priceVO.setDeposit(deposit);
|
priceVO.setDeposit(deposit);
|
||||||
return deposit;
|
return deposit;
|
||||||
|
|
|
@ -13,7 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectEtCallbackLogVo">
|
<sql id="selectEtCallbackLogVo">
|
||||||
select id, body2, body, create_time, type from rl_callback_log
|
select id, body2, body, create_time, type from e_callback_log
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectEtCallbackLogList" parameterType="EtCallbackLog" resultMap="EtCallbackLogResult">
|
<select id="selectEtCallbackLogList" parameterType="EtCallbackLog" resultMap="EtCallbackLogResult">
|
||||||
|
@ -31,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertEtCallbackLog" parameterType="EtCallbackLog">
|
<insert id="insertEtCallbackLog" parameterType="EtCallbackLog">
|
||||||
insert into rl_callback_log
|
insert into e_callback_log
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="id != null">id,</if>
|
<if test="id != null">id,</if>
|
||||||
<if test="body2 != null">body2,</if>
|
<if test="body2 != null">body2,</if>
|
||||||
|
@ -49,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateEtCallbackLog" parameterType="EtCallbackLog">
|
<update id="updateEtCallbackLog" parameterType="EtCallbackLog">
|
||||||
update rl_callback_log
|
update e_callback_log
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="body2 != null">body2 = #{body2},</if>
|
<if test="body2 != null">body2 = #{body2},</if>
|
||||||
<if test="body != null">body = #{body},</if>
|
<if test="body != null">body = #{body},</if>
|
||||||
|
@ -60,11 +60,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteEtCallbackLogById" parameterType="Long">
|
<delete id="deleteEtCallbackLogById" parameterType="Long">
|
||||||
delete from rl_callback_log where id = #{id}
|
delete from e_callback_log where id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteEtCallbackLogByIds" parameterType="String">
|
<delete id="deleteEtCallbackLogByIds" parameterType="String">
|
||||||
delete from rl_callback_log where id in
|
delete from e_callback_log where id in
|
||||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
|
@ -9,13 +9,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<sql id="selectEDeviceVo">
|
<sql id="selectEDeviceVo">
|
||||||
select device_id, picture, device_name, mac, sn, model_id, hardware_version_id, vehicle_num, activation_time, online_status,
|
select device_id, picture, device_name, mac, sn, model_id, hardware_version_id, vehicle_num, activation_time, online_status,
|
||||||
create_by, create_time, update_by, update_time, last_time, last_location_time, gps, remark, status, lock_status, location,
|
create_by, create_time, update_by, update_time, last_time, last_location_time, gps, remark, status, lock_status, location,
|
||||||
remaining_power, voltage, qrcode, longitude, latitude, lock_status, location, remaining_power, voltage,
|
remaining_power, voltage, qrcode, longitude, latitude, lock_status, location, remaining_power, voltage, is_default,
|
||||||
version, user_id, is_senseless_unlock, is_auto_shutdown, is_auto_defense, is_vibration_alarm, is_admin_unlocking from e_device
|
version, user_id, is_senseless_unlock, is_auto_shutdown, is_auto_defense, is_vibration_alarm, is_admin_unlocking from e_device
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectEDeviceList" parameterType="EDevice" resultMap="EDeviceResult">
|
<select id="selectEDeviceList" parameterType="EDevice" resultMap="EDeviceResult">
|
||||||
select de.device_id, de.picture, de.device_name, de.mac, de.sn, de.model_id, de.hardware_version_id, de.vehicle_num,
|
select de.device_id, de.picture, de.device_name, de.mac, de.sn, de.model_id, de.hardware_version_id, de.vehicle_num,
|
||||||
de.activation_time, de.online_status, de.create_by, de.create_time, de.update_by,
|
de.activation_time, de.online_status, de.create_by, de.create_time, de.update_by,de.is_default,
|
||||||
de.update_time, de.last_time, de.last_location_time, de.gps, de.remark, de.status, de.lock_status, de.location,
|
de.update_time, de.last_time, de.last_location_time, de.gps, de.remark, de.status, de.lock_status, de.location,
|
||||||
de.remaining_power, de.voltage, de.qrcode, de.longitude, de.latitude from e_device de
|
de.remaining_power, de.voltage, de.qrcode, de.longitude, de.latitude from e_device de
|
||||||
where 1 = 1
|
where 1 = 1
|
||||||
|
@ -34,7 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<select id="selectEDeviceListWithIsolate" parameterType="EDevice" resultMap="EDeviceResult">
|
<select id="selectEDeviceListWithIsolate" parameterType="EDevice" resultMap="EDeviceResult">
|
||||||
select de.device_id, de.picture, de.device_name, de.mac, de.sn, de.model_id, de.hardware_version_id, de.vehicle_num,
|
select de.device_id, de.picture, de.device_name, de.mac, de.sn, de.model_id, de.hardware_version_id, de.vehicle_num,
|
||||||
de.activation_time, de.online_status, de.create_by, de.create_time, de.update_by,de.user_id,
|
de.activation_time, de.online_status, de.create_by, de.create_time, de.update_by,de.user_id,de.is_default,
|
||||||
de.update_time, de.last_time, de.last_location_time, de.gps, de.remark, de.status, de.lock_status, de.location,
|
de.update_time, de.last_time, de.last_location_time, de.gps, de.remark, de.status, de.lock_status, de.location,
|
||||||
de.remaining_power, de.voltage, de.version, de.qrcode, de.longitude, de.latitude, de.signal_strength, de.satellites, de.quality from e_device de
|
de.remaining_power, de.voltage, de.version, de.qrcode, de.longitude, de.latitude, de.signal_strength, de.satellites, de.quality from e_device de
|
||||||
left join e_hardware_version hv on hv.id = de.hardware_version_id
|
left join e_hardware_version hv on hv.id = de.hardware_version_id
|
||||||
|
@ -141,6 +141,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="isAutoShutdown != null">is_auto_shutdown,</if>
|
<if test="isAutoShutdown != null">is_auto_shutdown,</if>
|
||||||
<if test="isAutoDefense != null">is_auto_defense,</if>
|
<if test="isAutoDefense != null">is_auto_defense,</if>
|
||||||
<if test="isVibrationAlarm != null">is_vibration_alarm,</if>
|
<if test="isVibrationAlarm != null">is_vibration_alarm,</if>
|
||||||
|
<if test="isDefault != null">is_default,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="picture != null">#{picture},</if>
|
<if test="picture != null">#{picture},</if>
|
||||||
|
@ -178,6 +179,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="isAutoShutdown != null">#{isAutoShutdown},</if>
|
<if test="isAutoShutdown != null">#{isAutoShutdown},</if>
|
||||||
<if test="isAutoDefense != null">#{isAutoDefense},</if>
|
<if test="isAutoDefense != null">#{isAutoDefense},</if>
|
||||||
<if test="isVibrationAlarm != null">#{isVibrationAlarm},</if>
|
<if test="isVibrationAlarm != null">#{isVibrationAlarm},</if>
|
||||||
|
<if test="isDefault != null">#{isDefault},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
@ -219,6 +221,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="isAutoShutdown != null">is_auto_shutdown = #{isAutoShutdown},</if>
|
<if test="isAutoShutdown != null">is_auto_shutdown = #{isAutoShutdown},</if>
|
||||||
<if test="isAutoDefense != null">is_auto_defense = #{isAutoDefense},</if>
|
<if test="isAutoDefense != null">is_auto_defense = #{isAutoDefense},</if>
|
||||||
<if test="isVibrationAlarm != null">is_vibration_alarm = #{isVibrationAlarm},</if>
|
<if test="isVibrationAlarm != null">is_vibration_alarm = #{isVibrationAlarm},</if>
|
||||||
|
<if test="isDefault != null">is_default = #{isDefault},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where device_id = #{deviceId}
|
where device_id = #{deviceId}
|
||||||
</update>
|
</update>
|
||||||
|
@ -261,6 +264,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="isAutoShutdown != null">is_auto_shutdown = #{isAutoShutdown},</if>
|
<if test="isAutoShutdown != null">is_auto_shutdown = #{isAutoShutdown},</if>
|
||||||
<if test="isAutoDefense != null">is_auto_defense = #{isAutoDefense},</if>
|
<if test="isAutoDefense != null">is_auto_defense = #{isAutoDefense},</if>
|
||||||
<if test="isVibrationAlarm != null">is_vibration_alarm = #{isVibrationAlarm},</if>
|
<if test="isVibrationAlarm != null">is_vibration_alarm = #{isVibrationAlarm},</if>
|
||||||
|
<if test="isDefault != null">is_default = #{isDefault},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where device_id = #{deviceId}
|
where device_id = #{deviceId}
|
||||||
</update>
|
</update>
|
||||||
|
@ -302,6 +306,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="isAutoShutdown != null">is_auto_shutdown = #{isAutoShutdown},</if>
|
<if test="isAutoShutdown != null">is_auto_shutdown = #{isAutoShutdown},</if>
|
||||||
<if test="isAutoDefense != null">is_auto_defense = #{isAutoDefense},</if>
|
<if test="isAutoDefense != null">is_auto_defense = #{isAutoDefense},</if>
|
||||||
<if test="isVibrationAlarm != null">is_vibration_alarm = #{isVibrationAlarm},</if>
|
<if test="isVibrationAlarm != null">is_vibration_alarm = #{isVibrationAlarm},</if>
|
||||||
|
<if test="isDefault != null">is_default = #{isDefault},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where sn = #{sn}
|
where sn = #{sn}
|
||||||
</update>
|
</update>
|
||||||
|
@ -347,4 +352,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
#{deviceId}
|
#{deviceId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<update id="cancelDefault" >
|
||||||
|
update e_device set is_default = '0' where user_id = #{userId} and sn != #{sn}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -8,7 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<sql id="selectRlFeeRuleVo">
|
<sql id="selectRlFeeRuleVo">
|
||||||
select r.rule_id, r.rental_unit, r.price, r.`explain`, r.instructions, r.out_unit, r.out_price ,r.merchant_id from e_fee_rule r
|
select r.rule_id, r.rental_unit, r.price, r.`explain`, r.instructions, r.out_unit, r.out_price ,r.merchant_id from e_fee_rule r
|
||||||
left join e_fee_rule mr on mr.rule_id = r.rule_id
|
left join e_model_rule mr on mr.rule_id = r.rule_id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectRlFeeRuleList" parameterType="EFeeRule" resultMap="RlFeeRuleResult">
|
<select id="selectRlFeeRuleList" parameterType="EFeeRule" resultMap="RlFeeRuleResult">
|
||||||
|
|
|
@ -43,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="selectEModelByModelId" parameterType="Long" resultMap="EModelResult">
|
<select id="selectEModelByModelId" parameterType="Long" resultMap="EModelResult">
|
||||||
select mo.model_id, mo.model, mo.brand_id, mo.brand_name, mo.brand_name, mo.full_voltage, mo.low_voltage,
|
select mo.model_id, mo.model, mo.brand_id, mo.brand_name, mo.brand_name, mo.full_voltage, mo.low_voltage,
|
||||||
mo.full_endurance, mo.create_by, mo.create_time,mo.deposit,mo.picture,
|
mo.full_endurance, mo.create_by, mo.create_time,mo.deposit,mo.picture,
|
||||||
mo.update_by, mo.update_time, mo.remark from e_model m
|
mo.update_by, mo.update_time, mo.remark from e_model mo
|
||||||
where mo.model_id = #{modelId}
|
where mo.model_id = #{modelId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user