diff --git a/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppVerifyController.java b/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppVerifyController.java
index 0b2942b..980e10a 100644
--- a/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppVerifyController.java
+++ b/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppVerifyController.java
@@ -1450,4 +1450,32 @@ public class AppVerifyController extends BaseController
}
return toAjax(1);
}
+
+ /**
+ * 根据用户获取最后一个订单所属的运营区客服电话 latestServicePhone
+ * 1. 查询用户
+ * 2. 最后一个订单
+ * 3. 查询订单所属运营区
+ * 4. 查询运营区客服电话
+ */
+ @Log(title = "", businessType = BusinessType.ZEROORDER)
+ @GetMapping("/latestServicePhone")
+ public AjaxResult latestServicePhone(Long userId)
+ {
+ logger.info("根据用户获取最后一个订单所属的运营区客服电话:【userId="+userId+"】");
+ if (ObjectUtil.isNull(userId)){
+ throw new ServiceException("未传userId");
+ }
+ EtOrder etOrder =new EtOrder();
+ etOrder.setUserId(userId);
+ EtOrder etOrder1 = etOrderService.latestOrder2(etOrder);
+ if(ObjectUtil.isNotNull(etOrder1)){
+ EtOperatingArea area = etOperatingAreaService.selectEtOperatingAreaByAreaId(etOrder1.getAreaId());
+ if(ObjectUtil.isNull(area)){
+ return error("未查询到运营区域信息");
+ }
+ return success(area);
+ }
+ return error();
+ }
}
diff --git a/electripper-system/src/main/java/com/ruoyi/system/mapper/EtOrderMapper.java b/electripper-system/src/main/java/com/ruoyi/system/mapper/EtOrderMapper.java
index b3bc295..45c3203 100644
--- a/electripper-system/src/main/java/com/ruoyi/system/mapper/EtOrderMapper.java
+++ b/electripper-system/src/main/java/com/ruoyi/system/mapper/EtOrderMapper.java
@@ -258,6 +258,11 @@ public interface EtOrderMapper
*/
EtOrder selectLatestOrder(EtOrder etOrder);
+ /**
+ * 最近一笔订单(包含押金订单)
+ */
+ EtOrder selectLatestOrder2(EtOrder etOrder);
+
/**
* 最近一笔订单
*/
diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/IEtOrderService.java b/electripper-system/src/main/java/com/ruoyi/system/service/IEtOrderService.java
index cf58abc..18713c4 100644
--- a/electripper-system/src/main/java/com/ruoyi/system/service/IEtOrderService.java
+++ b/electripper-system/src/main/java/com/ruoyi/system/service/IEtOrderService.java
@@ -159,6 +159,11 @@ public interface IEtOrderService
*/
EtOrder latestOrder(EtOrder etOrder);
+ /**
+ * 最近一笔订单(包含押金订单)
+ */
+ EtOrder latestOrder2(EtOrder etOrder);
+
/**
* 订单退款
*/
diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOrderServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOrderServiceImpl.java
index 6748a78..b01ffee 100644
--- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOrderServiceImpl.java
+++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOrderServiceImpl.java
@@ -1709,6 +1709,15 @@ public class EtOrderServiceImpl implements IEtOrderService
return order;
}
+ /**
+ * 最近一笔订单
+ */
+ @Override
+ public EtOrder latestOrder2(EtOrder etOrder) {
+ EtOrder order = etOrderMapper.selectLatestOrder2(etOrder);
+ return order;
+ }
+
/**
* 退款
*/
diff --git a/electripper-system/src/main/resources/mapper/system/EtOrderMapper.xml b/electripper-system/src/main/resources/mapper/system/EtOrderMapper.xml
index 57211e5..a7194d3 100644
--- a/electripper-system/src/main/resources/mapper/system/EtOrderMapper.xml
+++ b/electripper-system/src/main/resources/mapper/system/EtOrderMapper.xml
@@ -727,6 +727,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LIMIT 1
+
+