From a36d5b405d814001ad58fbfef68eb10984083bcb Mon Sep 17 00:00:00 2001 From: 18650502300 <18650502300@163.com> Date: Tue, 19 Nov 2024 10:55:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/app/AppController.java | 12 ++--- .../controller/app/AppVerifyController.java | 27 +++++++++++ .../common/constant/ServiceConstants.java | 46 +++++++++++-------- .../ruoyi/system/domain/EtCallbackLog.java | 2 +- .../ruoyi/system/domain/device/EDevice.java | 3 ++ .../com/ruoyi/system/domain/order/EOrder.java | 6 --- .../system/domain/order/EOrderQuery.java | 3 -- .../com/ruoyi/system/domain/vo/PriceVO.java | 3 -- .../ruoyi/system/mapper/EDeviceMapper.java | 9 ++++ .../ruoyi/system/service/IEDeviceService.java | 9 ++++ .../service/impl/CallbackServiceImpl.java | 16 ++----- .../service/impl/EDeviceServiceImpl.java | 15 +++++- .../service/impl/EOrderServiceImpl.java | 41 ++++++++--------- .../mapper/system/ECallbackLogMapper.xml | 10 ++-- .../resources/mapper/system/EDeviceMapper.xml | 15 ++++-- .../mapper/system/EFeeRuleMapper.xml | 2 +- .../resources/mapper/system/EModelMapper.xml | 2 +- 17 files changed, 139 insertions(+), 82 deletions(-) diff --git a/eride-admin/src/main/java/com/ruoyi/web/controller/app/AppController.java b/eride-admin/src/main/java/com/ruoyi/web/controller/app/AppController.java index fec609b..67b893e 100644 --- a/eride-admin/src/main/java/com/ruoyi/web/controller/app/AppController.java +++ b/eride-admin/src/main/java/com/ruoyi/web/controller/app/AppController.java @@ -284,12 +284,12 @@ public class AppController extends BaseController if(order.getRuleId() == null){ return error("计费规则id不能为空"); } - if(order.getAgentId() == null){ - return error("代理商id不能为空"); - } - if(order.getDeliveryMethod() == null){ - return error("配送方式不能为空"); - } +// if(order.getAgentId() == null){ +// return error("代理商id不能为空"); +// } +// if(order.getDeliveryMethod() == null){ +// return error("配送方式不能为空"); +// } if(StrUtil.isBlank(order.getType())){ return error("类型不能为空"); } diff --git a/eride-admin/src/main/java/com/ruoyi/web/controller/app/AppVerifyController.java b/eride-admin/src/main/java/com/ruoyi/web/controller/app/AppVerifyController.java index 5026ec7..fccdee8 100644 --- a/eride-admin/src/main/java/com/ruoyi/web/controller/app/AppVerifyController.java +++ b/eride-admin/src/main/java/com/ruoyi/web/controller/app/AppVerifyController.java @@ -196,6 +196,10 @@ public class AppVerifyController extends BaseController if(order.getType() == null){ 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); } + /** + * 切换默认展示车辆 + */ + @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号查询车辆信息 */ diff --git a/eride-common/src/main/java/com/ruoyi/common/constant/ServiceConstants.java b/eride-common/src/main/java/com/ruoyi/common/constant/ServiceConstants.java index 84fb4bb..8c725cc 100644 --- a/eride-common/src/main/java/com/ruoyi/common/constant/ServiceConstants.java +++ b/eride-common/src/main/java/com/ruoyi/common/constant/ServiceConstants.java @@ -45,25 +45,25 @@ public class ServiceConstants { /**----------------------------支付场景end----------------------------*/ /**----------------------------订单状态start----------------------------*/ - /** 状态:0-待支付;1-待取、2-待送、3-配送中、4-进行中、8-已结束、5-超时自动取消、6-已取消 + /** 状态:0-待支付;4-进行中、8-已结束、5-超时自动取消、6-已取消 * 订单状态:0-待支付 */ public static final String ORDER_STATUS_TO_BE_PAID = "0"; - /** - * 订单状态:1-待取 - */ - public static final String ORDER_STATUS_TO_BE_TAKEN = "1"; +// /** +// * 订单状态:1-待取 +// */ +// public static final String ORDER_STATUS_TO_BE_TAKEN = "1"; +// +// /** +// * 订单状态:2-待送 +// */ +// public static final String ORDER_STATUS_TO_BE_SENT = "2"; - /** - * 订单状态:2-待送 - */ - public static final String ORDER_STATUS_TO_BE_SENT = "2"; - - /** - * 订单状态:3-配送中 - */ - public static final String ORDER_STATUS_IN_DELIVERY = "3"; +// /** +// * 订单状态:3-配送中 +// */ +// public static final String ORDER_STATUS_IN_DELIVERY = "3"; /** * 订单状态:4-进行中 @@ -740,11 +740,6 @@ public class ServiceConstants { */ public static final String KEY_STATUS_NEW = "0"; -// /** -// * 钥匙状态: 1-待领取 -// */ -// public static final String KEY_STATUS_PENDING = "1"; - /** * 钥匙状态: 2-已领取 */ @@ -757,5 +752,18 @@ public class ServiceConstants { /**----------------------------钥匙状态end----------------------------*/ + /**----------------------------是否默认展示设备start----------------------------*/ + /** + * 是否默认展示设备: 0-否 + */ + public static final String IS_DEFAULT_NO = "0"; + + /** + * 是否默认展示设备: 1-是 + */ + public static final String IS_DEFAULT_YES = "1"; + + /**----------------------------是否默认展示设备end----------------------------*/ + } diff --git a/eride-system/src/main/java/com/ruoyi/system/domain/EtCallbackLog.java b/eride-system/src/main/java/com/ruoyi/system/domain/EtCallbackLog.java index ff768bc..711662e 100644 --- a/eride-system/src/main/java/com/ruoyi/system/domain/EtCallbackLog.java +++ b/eride-system/src/main/java/com/ruoyi/system/domain/EtCallbackLog.java @@ -5,7 +5,7 @@ import com.ruoyi.common.core.domain.BaseEntity; import lombok.Data; /** - * 回调日志对象 rl_callback_log + * 回调日志对象 e_callback_log * * @author 邱贞招 * @date 2024-06-18 diff --git a/eride-system/src/main/java/com/ruoyi/system/domain/device/EDevice.java b/eride-system/src/main/java/com/ruoyi/system/domain/device/EDevice.java index 4a5a458..5a90d21 100644 --- a/eride-system/src/main/java/com/ruoyi/system/domain/device/EDevice.java +++ b/eride-system/src/main/java/com/ruoyi/system/domain/device/EDevice.java @@ -201,4 +201,7 @@ public class EDevice extends BaseEntityPlus implements Serializable { /** 是否启用震动报警:0-否;1-是 */ private String isVibrationAlarm; + /** 是否默认展示设备:0-否,1-是 */ + private String isDefault; + } diff --git a/eride-system/src/main/java/com/ruoyi/system/domain/order/EOrder.java b/eride-system/src/main/java/com/ruoyi/system/domain/order/EOrder.java index 65d76c7..90345c4 100644 --- a/eride-system/src/main/java/com/ruoyi/system/domain/order/EOrder.java +++ b/eride-system/src/main/java/com/ruoyi/system/domain/order/EOrder.java @@ -266,12 +266,6 @@ public class EOrder extends BaseEntity { @Excel(name = "取车时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date pickupTime; - /** - * 代理商id - */ - @Excel(name = "代理商id") - private Long agentId; - /** * 店铺id */ diff --git a/eride-system/src/main/java/com/ruoyi/system/domain/order/EOrderQuery.java b/eride-system/src/main/java/com/ruoyi/system/domain/order/EOrderQuery.java index affaf6c..7c5f247 100644 --- a/eride-system/src/main/java/com/ruoyi/system/domain/order/EOrderQuery.java +++ b/eride-system/src/main/java/com/ruoyi/system/domain/order/EOrderQuery.java @@ -14,9 +14,6 @@ public class EOrderQuery extends EOrder { /** 手机号*/ private String phone; - /** 店铺id (还车店铺)*/ - private Long returnStoreId; - /** jscode*/ private String jscode; diff --git a/eride-system/src/main/java/com/ruoyi/system/domain/vo/PriceVO.java b/eride-system/src/main/java/com/ruoyi/system/domain/vo/PriceVO.java index 419d74a..4539350 100644 --- a/eride-system/src/main/java/com/ruoyi/system/domain/vo/PriceVO.java +++ b/eride-system/src/main/java/com/ruoyi/system/domain/vo/PriceVO.java @@ -15,7 +15,4 @@ public class PriceVO { /** 租金 */ private BigDecimal rent = BigDecimal.ZERO; - - /** 配送费 */ - private BigDecimal deliveryFee = BigDecimal.ZERO; } diff --git a/eride-system/src/main/java/com/ruoyi/system/mapper/EDeviceMapper.java b/eride-system/src/main/java/com/ruoyi/system/mapper/EDeviceMapper.java index 1fd2794..0d11a9a 100644 --- a/eride-system/src/main/java/com/ruoyi/system/mapper/EDeviceMapper.java +++ b/eride-system/src/main/java/com/ruoyi/system/mapper/EDeviceMapper.java @@ -2,6 +2,7 @@ package com.ruoyi.system.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.domain.device.EDevice; +import com.ruoyi.system.domain.device.EDeviceQuery; import com.ruoyi.system.domain.device.EDeviceVO; import org.apache.ibatis.annotations.Param; @@ -158,4 +159,12 @@ public interface EDeviceMapper extends BaseMapper * 获取到该代理商下所有的车辆数 */ 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); } diff --git a/eride-system/src/main/java/com/ruoyi/system/service/IEDeviceService.java b/eride-system/src/main/java/com/ruoyi/system/service/IEDeviceService.java index d8b51ee..594589e 100644 --- a/eride-system/src/main/java/com/ruoyi/system/service/IEDeviceService.java +++ b/eride-system/src/main/java/com/ruoyi/system/service/IEDeviceService.java @@ -102,6 +102,15 @@ public interface IEDeviceService extends IService */ public int updateEDeviceBySn(EDeviceQuery device); + /** + * 取消默认 + * + * @param userId 用户id + * @param sn sn + * @return 结果 + */ + public int cancelDefault(Long userId, String sn); + /** * 批量删除设备 * diff --git a/eride-system/src/main/java/com/ruoyi/system/service/impl/CallbackServiceImpl.java b/eride-system/src/main/java/com/ruoyi/system/service/impl/CallbackServiceImpl.java index e177265..e2ecbca 100644 --- a/eride-system/src/main/java/com/ruoyi/system/service/impl/CallbackServiceImpl.java +++ b/eride-system/src/main/java/com/ruoyi/system/service/impl/CallbackServiceImpl.java @@ -138,17 +138,11 @@ public class CallbackServiceImpl implements CallbackService { updateOrder.setPaid("1"); updateOrder.setPayTime(DateUtils.getNowDate()); updateOrder.setPayType(payType); -// if(originalOrder.getDeliveryMethod().equals(ServiceConstants.DELIVERY_METHOD_SELF_PICKUP)){ -// updateOrder.setStatus(ServiceConstants.ORDER_STATUS_TO_BE_TAKEN); -// }else{ -// updateOrder.setStatus(ServiceConstants.ORDER_STATUS_TO_BE_SENT); -// } -// updateOrder.setCost(getCost(channelVO,originalOrder.getPayFee())); -// -// /** 如果是续租的订单,结束原订单*/ -// if(originalOrder.getType().equals(ServiceConstants.ORDER_TYPE_RELET)){ -// closeOriginalOrder(originalOrder, updateOrder); -// }else{ + updateOrder.setStatus(ServiceConstants.ORDER_STATUS_IN_USE); + /** 如果是续租的订单,结束原订单*/ + if(originalOrder.getType().equals(ServiceConstants.ORDER_TYPE_RELET)){ + closeOriginalOrder(originalOrder, updateOrder); + } // // 如果是免费送取车或收费送取车则创建新的配送工单 // if(originalOrder.getDeliveryMethod().equals(ServiceConstants.DELIVERY_METHOD_FREE_DELIVERY_CAR) || originalOrder.getDeliveryMethod().equals(ServiceConstants.DELIVERY_METHOD_CHARGE_DELIVERY_CAR)){ // /** 创建配送工单,状态为:待接单 */ diff --git a/eride-system/src/main/java/com/ruoyi/system/service/impl/EDeviceServiceImpl.java b/eride-system/src/main/java/com/ruoyi/system/service/impl/EDeviceServiceImpl.java index 9c561cb..08492f2 100644 --- a/eride-system/src/main/java/com/ruoyi/system/service/impl/EDeviceServiceImpl.java +++ b/eride-system/src/main/java/com/ruoyi/system/service/impl/EDeviceServiceImpl.java @@ -32,6 +32,7 @@ import com.ruoyi.system.mapper.ECommandLogMapper; import com.ruoyi.system.service.*; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; +import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -350,6 +351,19 @@ public class EDeviceServiceImpl extends ServiceImpl impl 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 impl updateOrder.setReturnType(orderQuery.getReturnType()); updateOrder.setReturnTime(DateUtils.getNowDate()); updateOrder.setStatus(ServiceConstants.ORDER_STATUS_TO_BE_AUDITED);// 还车后订单状态变成待审核,只有商户确认才算完成 - updateOrder.setReturnTime(DateUtils.getNowDate()); String token = Token.getToken(); EDevice device = deviceMapper.selectEDeviceBySn(order.getSn()); diff --git a/eride-system/src/main/java/com/ruoyi/system/service/impl/EOrderServiceImpl.java b/eride-system/src/main/java/com/ruoyi/system/service/impl/EOrderServiceImpl.java index 295933b..91f18af 100644 --- a/eride-system/src/main/java/com/ruoyi/system/service/impl/EOrderServiceImpl.java +++ b/eride-system/src/main/java/com/ruoyi/system/service/impl/EOrderServiceImpl.java @@ -384,7 +384,7 @@ public class EOrderServiceImpl implements IEOrderService @NotNull private PrepayResponseVO getPrepayResponseVO(EOrderQuery order, String orderNo, String type, Long userId) { EFeeRule feeRule = feeRuleService.selectRlFeeRuleByRuleId(order.getRuleId()); - setFeeRule(order, feeRule); + setFeeRule(type,order, feeRule); /** 解析地址 analyzeAddress */ // analyzeAddress(order); order.setCreateTime(DateUtils.getNowDate()); @@ -402,6 +402,14 @@ public class EOrderServiceImpl implements IEOrderService 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); order.setStatus(ServiceConstants.ORDER_STATUS_TO_BE_PAID); EModelVO rlModelVO = modelService.selectEModelByModelId(order.getModelId()); @@ -443,7 +451,6 @@ public class EOrderServiceImpl implements IEOrderService PriceVO priceVO = calculatePrice(order); order.setDeposit(priceVO.getDeposit()); order.setLeaseFee(priceVO.getRent()); -// order.setDeliveryFee(priceVO.getDeliveryFee()); order.setTotalFee(priceVO.getTotalFee()); order.setPayFee(priceVO.getTotalFee()); } @@ -454,7 +461,7 @@ public class EOrderServiceImpl implements IEOrderService // order.setPickupLoc(address); // } - private void setFeeRule(EOrderQuery order, EFeeRule feeRule) { + private void setFeeRule(String type, EOrderQuery order, EFeeRule feeRule) { order.setNum(order.getNum()); order.setPrice(feeRule.getPrice()); order.setExplain(feeRule.getExplain()); @@ -465,7 +472,7 @@ public class EOrderServiceImpl implements IEOrderService /** 如果是租赁订单,根据取车时间计算到期时间 * 如果是续费订单,根据到期时间计算续费订单的到期时间 */ Date startTime = null; - if(order.getType().equals(ServiceConstants.ORDER_TYPE_LEASE)){ + if(ServiceConstants.ORDER_TYPE_LEASE.equals(type)){ startTime = DateUtils.getNowDate(); }else{ startTime = order.getExpiryTime(); @@ -584,7 +591,7 @@ public class EOrderServiceImpl implements IEOrderService public PrepayResponseVO relet(EOrderQuery query) { EOrderVO order = orderMapper.selectRlOrderByOrderNo(query.getOrderNo()); if(ObjectUtil.isNull(order)){ - throw new RuntimeException("订单["+query.getOrderNo()+"]不存在"); + throw new RuntimeException("订单【"+query.getOrderNo()+"】不存在"); } EOrderQuery orderQuery = new EOrderQuery(); 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)){ - throw new RuntimeException("订单已配送或已使用,不能取消"); - } +// if(Integer.parseInt(order.getStatus()) >= Integer.parseInt(ServiceConstants.ORDER_STATUS_IN_DELIVERY)){ +// throw new RuntimeException("订单已配送或已使用,不能取消"); +// } Boolean execute = transactionTemplate.execute(e -> { logger.info("=================【订单取消】=================="); if(ServiceConstants.ORDER_PAY_STATUS_PAID.equals(order.getPaid())){ @@ -855,9 +862,7 @@ public class EOrderServiceImpl implements IEOrderService if(ObjectUtil.isNull(rlOrderVO)){ throw new ServiceException("订单不存在"); } - 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()))) { + if (!ServiceConstants.ORDER_STATUS_ORDER_END.equals(rlOrderVO.getStatus())) { throw new ServiceException("退款失败,订单未结束"); } if(ServiceConstants.ORDER_PAY_STATUS_NON_PAYMENT.equals(rlOrderVO.getPaid())){ @@ -904,7 +909,7 @@ public class EOrderServiceImpl implements IEOrderService BigDecimal totalFee = BigDecimal.ZERO; if(order.getType().equals(ServiceConstants.ORDER_TYPE_LEASE)){ // 押金 - BigDecimal deposit = deposit(order.getSn(), priceVO); + BigDecimal deposit = deposit(order.getModelId(), priceVO); totalFee = totalFee.add(deposit); } // 租金 @@ -1060,22 +1065,14 @@ public class EOrderServiceImpl implements IEOrderService return indexAdminVo; } - private BigDecimal deposit(String sn, 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+"】车型未设置"); - } + private BigDecimal deposit(Long modelId, PriceVO priceVO) { EModelVO rlModelVO = modelService.selectEModelByModelId(modelId); if(rlModelVO == null){ throw new ServiceException("车型不存在"); } BigDecimal deposit = rlModelVO.getDeposit(); if(deposit == null){ - throw new ServiceException("车型:【"+modelId+"】押金未设置"); + throw new ServiceException("车型【"+modelId+"未设置押金】"); } priceVO.setDeposit(deposit); return deposit; diff --git a/eride-system/src/main/resources/mapper/system/ECallbackLogMapper.xml b/eride-system/src/main/resources/mapper/system/ECallbackLogMapper.xml index 5f6b5de..1ba1041 100644 --- a/eride-system/src/main/resources/mapper/system/ECallbackLogMapper.xml +++ b/eride-system/src/main/resources/mapper/system/ECallbackLogMapper.xml @@ -13,7 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, body2, body, create_time, type from rl_callback_log + select id, body2, body, create_time, type from e_callback_log - insert into rl_callback_log + insert into e_callback_log id, body2, @@ -49,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - update rl_callback_log + update e_callback_log body2 = #{body2}, body = #{body}, @@ -60,11 +60,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from rl_callback_log where id = #{id} + delete from e_callback_log where id = #{id} - delete from rl_callback_log where id in + delete from e_callback_log where id in #{id} diff --git a/eride-system/src/main/resources/mapper/system/EDeviceMapper.xml b/eride-system/src/main/resources/mapper/system/EDeviceMapper.xml index a3ee000..09bce5d 100644 --- a/eride-system/src/main/resources/mapper/system/EDeviceMapper.xml +++ b/eride-system/src/main/resources/mapper/system/EDeviceMapper.xml @@ -9,13 +9,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 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, - 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 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.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 @@ -141,6 +141,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" is_auto_shutdown, is_auto_defense, is_vibration_alarm, + is_default, #{picture}, @@ -178,6 +179,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{isAutoShutdown}, #{isAutoDefense}, #{isVibrationAlarm}, + #{isDefault}, @@ -219,6 +221,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" is_auto_shutdown = #{isAutoShutdown}, is_auto_defense = #{isAutoDefense}, is_vibration_alarm = #{isVibrationAlarm}, + is_default = #{isDefault}, where device_id = #{deviceId} @@ -261,6 +264,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" is_auto_shutdown = #{isAutoShutdown}, is_auto_defense = #{isAutoDefense}, is_vibration_alarm = #{isVibrationAlarm}, + is_default = #{isDefault}, where device_id = #{deviceId} @@ -302,6 +306,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" is_auto_shutdown = #{isAutoShutdown}, is_auto_defense = #{isAutoDefense}, is_vibration_alarm = #{isVibrationAlarm}, + is_default = #{isDefault}, where sn = #{sn} @@ -347,4 +352,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{deviceId} + + + update e_device set is_default = '0' where user_id = #{userId} and sn != #{sn} + diff --git a/eride-system/src/main/resources/mapper/system/EFeeRuleMapper.xml b/eride-system/src/main/resources/mapper/system/EFeeRuleMapper.xml index 945a24d..a4ad2b2 100644 --- a/eride-system/src/main/resources/mapper/system/EFeeRuleMapper.xml +++ b/eride-system/src/main/resources/mapper/system/EFeeRuleMapper.xml @@ -8,7 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 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 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.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}