diff --git a/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppController.java b/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppController.java
index e95ccfe..0c19c01 100644
--- a/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppController.java
+++ b/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppController.java
@@ -203,20 +203,19 @@ public class AppController extends BaseController
     }
 
 
-//    /**
-//     * 根据定位获取运营区信息,并返回所有车辆定位
-//     */
-//    @GetMapping(value = "/vehicleLocalization")
-//    public AjaxResult vehicleLocalization(String longitude,String latitude)
-//    {
-//        if(StrUtil.isBlank(longitude) || StrUtil.isBlank(latitude)){
-//            logger.info("没有经纬度参数:【longitude={}】,【latitude={}】",longitude,latitude);
-//            return error("请传经纬度参数"+"【longitude="+longitude+"】,【latitude="+latitude+"】");
-//        }
-////        webSocket.SendMessage("需要发送的消息", "识别唯一session");
-//        List<AsDevice> asDevices = asDeviceService.vehicleLocalization(longitude,latitude);
-//        return success(asDevices);
-//    }
+    /**
+     * 根据经纬度查询附近500米的所有车辆
+     */
+    @GetMapping(value = "/vehicleLocalization")
+    public AjaxResult vehicleLocalization(String longitude,String latitude)
+    {
+        if(StrUtil.isBlank(longitude) || StrUtil.isBlank(latitude)){
+            logger.info("没有经纬度参数:【longitude={}】,【latitude={}】",longitude,latitude);
+            return error("请传经纬度参数"+"【longitude="+longitude+"】,【latitude="+latitude+"】");
+        }
+        List<AsDevice> asDevices = asDeviceService.vehicleLocalization(longitude,latitude);
+        return success(asDevices);
+    }
 
     /**
      * 根据运营区id获取所有车辆
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 e84de05..9797282 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
@@ -24,9 +24,7 @@ import com.ruoyi.system.domain.*;
 import com.ruoyi.system.domain.response.FaultResponse;
 import com.ruoyi.system.domain.response.OrderResponse;
 import com.ruoyi.system.domain.vo.*;
-import com.ruoyi.system.mapper.AsDeviceMapper;
-import com.ruoyi.system.mapper.AsUserMapper;
-import com.ruoyi.system.mapper.EtOrderMapper;
+import com.ruoyi.system.mapper.*;
 import com.ruoyi.system.service.*;
 import com.wechat.pay.java.service.payments.jsapi.model.PrepayWithRequestPaymentResponse;
 import org.jetbrains.annotations.NotNull;
@@ -36,10 +34,8 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Optional;
+import java.text.SimpleDateFormat;
+import java.util.*;
 
 /**
  * app接口(需要登录校验的)
@@ -104,6 +100,13 @@ public class AppVerifyController extends BaseController
     @Autowired
     private IWxPayService wxPayService;
 
+    @Resource
+    private EtCapitalFlowMapper etCapitalFlowMapper;
+
+    @Resource
+    private EtOperatingAreaMapper etOperatingAreaMapper;
+
+
 
     /**
      * 故障上报
@@ -890,9 +893,43 @@ public class AppVerifyController extends BaseController
     {
         logger.info("【获取运营商信息】获取到areaId:【{}】", areaId);
         SysDept sysDept = wxPayService.getDeptObjByAreaId(areaId);
+
+        BigDecimal todayOrderAmount = getTodayOrderAmount(sysDept);
+        // 更新 sysDept 的余额字段
+        if (sysDept.getBalance() != null) {
+            sysDept.setBalance(sysDept.getBalance().subtract(todayOrderAmount));
+        }
         return success(sysDept);
     }
 
+    /** 获取今日订单金额 */
+    @NotNull
+    private BigDecimal getTodayOrderAmount(SysDept sysDept) {
+        // 获取今天的日期字符串
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        String startDateStr = dateFormat.format(new Date()) + " 00:00:00";
+        String endDateStr = dateFormat.format(new Date()) + " 23:59:59";
+
+        //今日订单金额
+        BigDecimal todayOrderAmount = BigDecimal.ZERO;
+        List<Long> longs = etOperatingAreaMapper.selectAreaListByDeptId(sysDept.getDeptId());
+        for (Long id:longs) {
+            BigDecimal payFee = defaultIfNull(etOrderMapper.getPayFee(startDateStr, endDateStr, null, id), BigDecimal.ZERO);//新增
+            BigDecimal refundFee = defaultIfNull(etOrderMapper.getRefundFee(startDateStr, endDateStr, null, id), BigDecimal.ZERO);//退款
+            BigDecimal serviceFee = etCapitalFlowMapper.getHandlingFee(startDateStr, endDateStr, null, id);//手续费,扣除掉退款部分的
+            BigDecimal platformServiceFee = etCapitalFlowMapper.getServiceFee(startDateStr, endDateStr, null,id);//平台服务费 ,扣除掉退款部分的
+            BigDecimal areaOrderAmount = defaultIfNull(payFee.subtract(serviceFee).subtract(refundFee).subtract(platformServiceFee), BigDecimal.ZERO);//营收 = 新增 - 手续费 - 退款 - 平台服务费
+            if (areaOrderAmount != null) {
+                todayOrderAmount = todayOrderAmount.add(areaOrderAmount);
+            }
+        }
+        return todayOrderAmount;
+    }
+
+    private BigDecimal defaultIfNull(BigDecimal value, BigDecimal defaultValue) {
+        return value != null ? value : defaultValue;
+    }
+
     /**
      * 绑定APP用户
      */
diff --git a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtCouponClaimLogController.java b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtCouponClaimLogController.java
new file mode 100644
index 0000000..0ed3e3c
--- /dev/null
+++ b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtCouponClaimLogController.java
@@ -0,0 +1,104 @@
+package com.ruoyi.web.controller.system;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.domain.EtCouponClaimLog;
+import com.ruoyi.system.service.IEtCouponClaimLogService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 优惠券领取记录Controller
+ *
+ * @author qzz
+ * @date 2024-08-08
+ */
+@RestController
+@RequestMapping("/system/claimLog")
+public class EtCouponClaimLogController extends BaseController
+{
+    @Autowired
+    private IEtCouponClaimLogService etCouponClaimLogService;
+
+    /**
+     * 查询优惠券领取记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:claimLog:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(EtCouponClaimLog etCouponClaimLog)
+    {
+        startPage();
+        List<EtCouponClaimLog> list = etCouponClaimLogService.selectEtCouponClaimLogList(etCouponClaimLog);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出优惠券领取记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:claimLog:export')")
+    @Log(title = "优惠券领取记录", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, EtCouponClaimLog etCouponClaimLog)
+    {
+        List<EtCouponClaimLog> list = etCouponClaimLogService.selectEtCouponClaimLogList(etCouponClaimLog);
+        ExcelUtil<EtCouponClaimLog> util = new ExcelUtil<EtCouponClaimLog>(EtCouponClaimLog.class);
+        util.exportExcel(response, list, "优惠券领取记录数据");
+    }
+
+    /**
+     * 获取优惠券领取记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:claimLog:query')")
+    @GetMapping(value = "/{claimId}")
+    public AjaxResult getInfo(@PathVariable("claimId") Long claimId)
+    {
+        return success(etCouponClaimLogService.selectEtCouponClaimLogByClaimId(claimId));
+    }
+
+    /**
+     * 新增优惠券领取记录
+     */
+    @PreAuthorize("@ss.hasPermi('system:claimLog:add')")
+    @Log(title = "优惠券领取记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody EtCouponClaimLog etCouponClaimLog)
+    {
+        return toAjax(etCouponClaimLogService.insertEtCouponClaimLog(etCouponClaimLog));
+    }
+
+    /**
+     * 修改优惠券领取记录
+     */
+    @PreAuthorize("@ss.hasPermi('system:claimLog:edit')")
+    @Log(title = "优惠券领取记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody EtCouponClaimLog etCouponClaimLog)
+    {
+        return toAjax(etCouponClaimLogService.updateEtCouponClaimLog(etCouponClaimLog));
+    }
+
+    /**
+     * 删除优惠券领取记录
+     */
+    @PreAuthorize("@ss.hasPermi('system:claimLog:remove')")
+    @Log(title = "优惠券领取记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{claimIds}")
+    public AjaxResult remove(@PathVariable Long[] claimIds)
+    {
+        return toAjax(etCouponClaimLogService.deleteEtCouponClaimLogByClaimIds(claimIds));
+    }
+}
diff --git a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtCouponController.java b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtCouponController.java
new file mode 100644
index 0000000..5223bd4
--- /dev/null
+++ b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtCouponController.java
@@ -0,0 +1,104 @@
+package com.ruoyi.web.controller.system;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.domain.EtCoupon;
+import com.ruoyi.system.service.IEtCouponService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 优惠券Controller
+ *
+ * @author 邱贞招
+ * @date 2024-08-05
+ */
+@RestController
+@RequestMapping("/system/coupon")
+public class EtCouponController extends BaseController
+{
+    @Autowired
+    private IEtCouponService etCouponService;
+
+    /**
+     * 查询优惠券列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:coupon:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(EtCoupon etCoupon)
+    {
+        startPage();
+        List<EtCoupon> list = etCouponService.selectEtCouponList(etCoupon);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出优惠券列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:coupon:export')")
+    @Log(title = "优惠券", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, EtCoupon etCoupon)
+    {
+        List<EtCoupon> list = etCouponService.selectEtCouponList(etCoupon);
+        ExcelUtil<EtCoupon> util = new ExcelUtil<EtCoupon>(EtCoupon.class);
+        util.exportExcel(response, list, "优惠券数据");
+    }
+
+    /**
+     * 获取优惠券详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:coupon:query')")
+    @GetMapping(value = "/{couponId}")
+    public AjaxResult getInfo(@PathVariable("couponId") Long couponId)
+    {
+        return success(etCouponService.selectEtCouponByCouponId(couponId));
+    }
+
+    /**
+     * 新增优惠券
+     */
+    @PreAuthorize("@ss.hasPermi('system:coupon:add')")
+    @Log(title = "优惠券", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody EtCoupon etCoupon)
+    {
+        return toAjax(etCouponService.insertEtCoupon(etCoupon));
+    }
+
+    /**
+     * 修改优惠券
+     */
+    @PreAuthorize("@ss.hasPermi('system:coupon:edit')")
+    @Log(title = "优惠券", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody EtCoupon etCoupon)
+    {
+        return toAjax(etCouponService.updateEtCoupon(etCoupon));
+    }
+
+    /**
+     * 删除优惠券
+     */
+    @PreAuthorize("@ss.hasPermi('system:coupon:remove')")
+    @Log(title = "优惠券", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{couponIds}")
+    public AjaxResult remove(@PathVariable Long[] couponIds)
+    {
+        return toAjax(etCouponService.deleteEtCouponByCouponIds(couponIds));
+    }
+}
diff --git a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java
index 77a7482..4021ae3 100644
--- a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java
+++ b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java
@@ -19,6 +19,7 @@ import com.ruoyi.system.mapper.EtOrderMapper;
 import com.ruoyi.system.service.IEtOperatingAreaService;
 import com.ruoyi.system.service.ISysDeptService;
 import org.apache.commons.lang3.ArrayUtils;
+import org.jetbrains.annotations.NotNull;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
@@ -103,11 +104,42 @@ public class SysDeptController extends BaseController
     {
         AjaxResult ajax = AjaxResult.success();
         deptService.checkDeptDataScope(deptId);
-        ajax.put(AjaxResult.DATA_TAG,deptService.selectDeptById(deptId));
+        SysDept sysDept = deptService.selectDeptById(deptId);
+        BigDecimal todayOrderAmount = getTodayOrderAmount(deptId);
+
+        // 更新 sysDept 的余额字段
+        if (sysDept.getBalance() != null) {
+            sysDept.setBalance(sysDept.getBalance().subtract(todayOrderAmount));
+        }
+
+        ajax.put(AjaxResult.DATA_TAG,sysDept);
         ajax.put("areaIds", etOperatingAreaService.selectAreaListByDeptId(deptId));
         return ajax;
     }
 
+    @NotNull
+    private BigDecimal getTodayOrderAmount(@PathVariable Long deptId) {
+        // 获取今天的日期字符串
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        String startDateStr = dateFormat.format(new Date()) + " 00:00:00";
+        String endDateStr = dateFormat.format(new Date()) + " 23:59:59";
+
+        //今日订单金额
+        BigDecimal todayOrderAmount = BigDecimal.ZERO;
+        List<Long> longs = etOperatingAreaMapper.selectAreaListByDeptId(deptId);
+        for (Long areaId:longs) {
+            BigDecimal payFee = defaultIfNull(etOrderMapper.getPayFee(startDateStr, endDateStr, null, areaId), BigDecimal.ZERO);//新增
+            BigDecimal refundFee = defaultIfNull(etOrderMapper.getRefundFee(startDateStr, endDateStr, null, areaId), BigDecimal.ZERO);//退款
+            BigDecimal serviceFee = etCapitalFlowMapper.getHandlingFee(startDateStr, endDateStr, null, areaId);//手续费,扣除掉退款部分的
+            BigDecimal platformServiceFee = etCapitalFlowMapper.getServiceFee(startDateStr, endDateStr, null,areaId);//平台服务费 ,扣除掉退款部分的
+            BigDecimal areaOrderAmount = defaultIfNull(payFee.subtract(serviceFee).subtract(refundFee).subtract(platformServiceFee), BigDecimal.ZERO);//营收 = 新增 - 手续费 - 退款 - 平台服务费
+            if (areaOrderAmount != null) {
+                todayOrderAmount = todayOrderAmount.add(areaOrderAmount);
+            }
+        }
+        return todayOrderAmount;
+    }
+
     /**
      * 新增运营商
      */
@@ -216,25 +248,7 @@ public class SysDeptController extends BaseController
         }
         AjaxResult ajax = AjaxResult.success();
         SysDept sysDept = deptService.selectDeptById(deptId);
-
-        // 获取今天的日期字符串
-        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-        String startDateStr = dateFormat.format(new Date()) + " 00:00:00";
-        String endDateStr = dateFormat.format(new Date()) + " 23:59:59";
-
-        //今日订单金额
-        BigDecimal todayOrderAmount = BigDecimal.ZERO;
-        List<Long> longs = etOperatingAreaMapper.selectAreaListByDeptId(deptId);
-        for (Long areaId:longs) {
-            BigDecimal payFee = defaultIfNull(etOrderMapper.getPayFee(startDateStr, endDateStr, null, areaId), BigDecimal.ZERO);//新增
-            BigDecimal refundFee = defaultIfNull(etOrderMapper.getRefundFee(startDateStr, endDateStr, null, areaId), BigDecimal.ZERO);//退款
-            BigDecimal serviceFee = etCapitalFlowMapper.getHandlingFee(startDateStr, endDateStr, null, areaId);//手续费,扣除掉退款部分的
-            BigDecimal platformServiceFee = etCapitalFlowMapper.getServiceFee(startDateStr, endDateStr, null,areaId);//平台服务费 ,扣除掉退款部分的
-            BigDecimal areaOrderAmount = defaultIfNull(payFee.subtract(serviceFee).subtract(refundFee).subtract(platformServiceFee), BigDecimal.ZERO);//营收 = 新增 - 手续费 - 退款 - 平台服务费
-            if (areaOrderAmount != null) {
-                todayOrderAmount = todayOrderAmount.add(areaOrderAmount);
-            }
-        }
+        BigDecimal todayOrderAmount = getTodayOrderAmount(deptId);//获取今日金额
         // 更新 sysDept 的余额字段
         if (sysDept.getBalance() != null) {
             sysDept.setBalance(sysDept.getBalance().subtract(todayOrderAmount));
diff --git a/electripper-system/src/main/java/com/ruoyi/system/domain/EtCoupon.java b/electripper-system/src/main/java/com/ruoyi/system/domain/EtCoupon.java
new file mode 100644
index 0000000..350cb27
--- /dev/null
+++ b/electripper-system/src/main/java/com/ruoyi/system/domain/EtCoupon.java
@@ -0,0 +1,66 @@
+package com.ruoyi.system.domain;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+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;
+
+/**
+ * 优惠券对象 et_coupon
+ *
+ * @author 邱贞招
+ * @date 2024-08-05
+ */
+@Data
+public class EtCoupon extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 优惠券id */
+    private Long couponId;
+
+    /** 类型 */
+    @Excel(name = "类型")
+    private String type;
+
+    /** 折扣比例 */
+    @Excel(name = "折扣比例")
+    private BigDecimal discountPercent;
+
+    /** 区域 */
+    @Excel(name = "区域")
+    private Long areaId;
+
+    /** 区域名称 */
+    @Excel(name = "区域名称")
+    private String areaName;
+
+    /** 用户 */
+    @Excel(name = "用户")
+    private Long userId;
+
+    /** 用户名 */
+    @Excel(name = "用户名")
+    private String userName;
+
+    /** 抵扣金额 */
+    @Excel(name = "抵扣金额")
+    private BigDecimal discountAmount;
+
+    /** 有效时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "有效时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date expirationTime;
+
+    /** 状态 */
+    @Excel(name = "状态")
+    private String status;
+
+    /** 限制次数: 0无限制 */
+    @Excel(name = "限制次数:0无限制")
+    private String limitNum;
+}
diff --git a/electripper-system/src/main/java/com/ruoyi/system/domain/EtCouponClaimLog.java b/electripper-system/src/main/java/com/ruoyi/system/domain/EtCouponClaimLog.java
new file mode 100644
index 0000000..8791c16
--- /dev/null
+++ b/electripper-system/src/main/java/com/ruoyi/system/domain/EtCouponClaimLog.java
@@ -0,0 +1,43 @@
+package com.ruoyi.system.domain;
+
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 优惠券领取记录对象 et_coupon_claim_log
+ *
+ * @author qzz
+ * @date 2024-08-08
+ */
+@Data
+public class EtCouponClaimLog extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 领取id */
+    private Long claimId;
+
+    /** 区域 */
+    @Excel(name = "区域")
+    private Long areaId;
+
+    /** 区域名称 */
+    @Excel(name = "区域名称")
+    private String areaName;
+
+    /** 用户 */
+    @Excel(name = "用户")
+    private Long userId;
+
+    /** 用户名 */
+    @Excel(name = "用户名")
+    private String userName;
+
+    /** 优惠券 */
+    @Excel(name = "优惠券")
+    private Long couponId;
+
+
+
+}
diff --git a/electripper-system/src/main/java/com/ruoyi/system/mapper/EtCouponClaimLogMapper.java b/electripper-system/src/main/java/com/ruoyi/system/mapper/EtCouponClaimLogMapper.java
new file mode 100644
index 0000000..f215643
--- /dev/null
+++ b/electripper-system/src/main/java/com/ruoyi/system/mapper/EtCouponClaimLogMapper.java
@@ -0,0 +1,61 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+import com.ruoyi.system.domain.EtCouponClaimLog;
+
+/**
+ * 优惠券领取记录Mapper接口
+ * 
+ * @author qzz
+ * @date 2024-08-08
+ */
+public interface EtCouponClaimLogMapper 
+{
+    /**
+     * 查询优惠券领取记录
+     * 
+     * @param claimId 优惠券领取记录主键
+     * @return 优惠券领取记录
+     */
+    public EtCouponClaimLog selectEtCouponClaimLogByClaimId(Long claimId);
+
+    /**
+     * 查询优惠券领取记录列表
+     * 
+     * @param etCouponClaimLog 优惠券领取记录
+     * @return 优惠券领取记录集合
+     */
+    public List<EtCouponClaimLog> selectEtCouponClaimLogList(EtCouponClaimLog etCouponClaimLog);
+
+    /**
+     * 新增优惠券领取记录
+     * 
+     * @param etCouponClaimLog 优惠券领取记录
+     * @return 结果
+     */
+    public int insertEtCouponClaimLog(EtCouponClaimLog etCouponClaimLog);
+
+    /**
+     * 修改优惠券领取记录
+     * 
+     * @param etCouponClaimLog 优惠券领取记录
+     * @return 结果
+     */
+    public int updateEtCouponClaimLog(EtCouponClaimLog etCouponClaimLog);
+
+    /**
+     * 删除优惠券领取记录
+     * 
+     * @param claimId 优惠券领取记录主键
+     * @return 结果
+     */
+    public int deleteEtCouponClaimLogByClaimId(Long claimId);
+
+    /**
+     * 批量删除优惠券领取记录
+     * 
+     * @param claimIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteEtCouponClaimLogByClaimIds(Long[] claimIds);
+}
diff --git a/electripper-system/src/main/java/com/ruoyi/system/mapper/EtCouponMapper.java b/electripper-system/src/main/java/com/ruoyi/system/mapper/EtCouponMapper.java
new file mode 100644
index 0000000..084034a
--- /dev/null
+++ b/electripper-system/src/main/java/com/ruoyi/system/mapper/EtCouponMapper.java
@@ -0,0 +1,61 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+import com.ruoyi.system.domain.EtCoupon;
+
+/**
+ * 优惠券Mapper接口
+ * 
+ * @author 邱贞招
+ * @date 2024-08-05
+ */
+public interface EtCouponMapper 
+{
+    /**
+     * 查询优惠券
+     * 
+     * @param couponId 优惠券主键
+     * @return 优惠券
+     */
+    public EtCoupon selectEtCouponByCouponId(Long couponId);
+
+    /**
+     * 查询优惠券列表
+     * 
+     * @param etCoupon 优惠券
+     * @return 优惠券集合
+     */
+    public List<EtCoupon> selectEtCouponList(EtCoupon etCoupon);
+
+    /**
+     * 新增优惠券
+     * 
+     * @param etCoupon 优惠券
+     * @return 结果
+     */
+    public int insertEtCoupon(EtCoupon etCoupon);
+
+    /**
+     * 修改优惠券
+     * 
+     * @param etCoupon 优惠券
+     * @return 结果
+     */
+    public int updateEtCoupon(EtCoupon etCoupon);
+
+    /**
+     * 删除优惠券
+     * 
+     * @param couponId 优惠券主键
+     * @return 结果
+     */
+    public int deleteEtCouponByCouponId(Long couponId);
+
+    /**
+     * 批量删除优惠券
+     * 
+     * @param couponIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteEtCouponByCouponIds(Long[] couponIds);
+}
diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/IAsDeviceService.java b/electripper-system/src/main/java/com/ruoyi/system/service/IAsDeviceService.java
index 3f9ae71..9c4175b 100644
--- a/electripper-system/src/main/java/com/ruoyi/system/service/IAsDeviceService.java
+++ b/electripper-system/src/main/java/com/ruoyi/system/service/IAsDeviceService.java
@@ -149,7 +149,7 @@ public interface IAsDeviceService extends IService<AsDevice>
     public int deleteAsDeviceByDeviceId(Long deviceId);
 
     /**
-     * 根据定位获取运营区信息,并返回所有车辆定位
+     * 根据经纬度查询附近500米的所有车辆
      *
      * @param longitude 经度
      * @param latitude 纬度
diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/IEtCouponClaimLogService.java b/electripper-system/src/main/java/com/ruoyi/system/service/IEtCouponClaimLogService.java
new file mode 100644
index 0000000..0806561
--- /dev/null
+++ b/electripper-system/src/main/java/com/ruoyi/system/service/IEtCouponClaimLogService.java
@@ -0,0 +1,61 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+import com.ruoyi.system.domain.EtCouponClaimLog;
+
+/**
+ * 优惠券领取记录Service接口
+ * 
+ * @author qzz
+ * @date 2024-08-08
+ */
+public interface IEtCouponClaimLogService 
+{
+    /**
+     * 查询优惠券领取记录
+     * 
+     * @param claimId 优惠券领取记录主键
+     * @return 优惠券领取记录
+     */
+    public EtCouponClaimLog selectEtCouponClaimLogByClaimId(Long claimId);
+
+    /**
+     * 查询优惠券领取记录列表
+     * 
+     * @param etCouponClaimLog 优惠券领取记录
+     * @return 优惠券领取记录集合
+     */
+    public List<EtCouponClaimLog> selectEtCouponClaimLogList(EtCouponClaimLog etCouponClaimLog);
+
+    /**
+     * 新增优惠券领取记录
+     * 
+     * @param etCouponClaimLog 优惠券领取记录
+     * @return 结果
+     */
+    public int insertEtCouponClaimLog(EtCouponClaimLog etCouponClaimLog);
+
+    /**
+     * 修改优惠券领取记录
+     * 
+     * @param etCouponClaimLog 优惠券领取记录
+     * @return 结果
+     */
+    public int updateEtCouponClaimLog(EtCouponClaimLog etCouponClaimLog);
+
+    /**
+     * 批量删除优惠券领取记录
+     * 
+     * @param claimIds 需要删除的优惠券领取记录主键集合
+     * @return 结果
+     */
+    public int deleteEtCouponClaimLogByClaimIds(Long[] claimIds);
+
+    /**
+     * 删除优惠券领取记录信息
+     * 
+     * @param claimId 优惠券领取记录主键
+     * @return 结果
+     */
+    public int deleteEtCouponClaimLogByClaimId(Long claimId);
+}
diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/IEtCouponService.java b/electripper-system/src/main/java/com/ruoyi/system/service/IEtCouponService.java
new file mode 100644
index 0000000..fd946a2
--- /dev/null
+++ b/electripper-system/src/main/java/com/ruoyi/system/service/IEtCouponService.java
@@ -0,0 +1,61 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+import com.ruoyi.system.domain.EtCoupon;
+
+/**
+ * 优惠券Service接口
+ * 
+ * @author 邱贞招
+ * @date 2024-08-05
+ */
+public interface IEtCouponService 
+{
+    /**
+     * 查询优惠券
+     * 
+     * @param couponId 优惠券主键
+     * @return 优惠券
+     */
+    public EtCoupon selectEtCouponByCouponId(Long couponId);
+
+    /**
+     * 查询优惠券列表
+     * 
+     * @param etCoupon 优惠券
+     * @return 优惠券集合
+     */
+    public List<EtCoupon> selectEtCouponList(EtCoupon etCoupon);
+
+    /**
+     * 新增优惠券
+     * 
+     * @param etCoupon 优惠券
+     * @return 结果
+     */
+    public int insertEtCoupon(EtCoupon etCoupon);
+
+    /**
+     * 修改优惠券
+     * 
+     * @param etCoupon 优惠券
+     * @return 结果
+     */
+    public int updateEtCoupon(EtCoupon etCoupon);
+
+    /**
+     * 批量删除优惠券
+     * 
+     * @param couponIds 需要删除的优惠券主键集合
+     * @return 结果
+     */
+    public int deleteEtCouponByCouponIds(Long[] couponIds);
+
+    /**
+     * 删除优惠券信息
+     * 
+     * @param couponId 优惠券主键
+     * @return 结果
+     */
+    public int deleteEtCouponByCouponId(Long couponId);
+}
diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java
index 55be23a..d8c1254 100644
--- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java
+++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java
@@ -111,6 +111,9 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
     @Autowired
     private CallbackService callbackService;
 
+    @Autowired
+    private ISysConfigService sysConfigService;
+
     @Value(value = "${iot.iotUrl}")
     private String iotUrl;
 
@@ -517,39 +520,38 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
     }
 
     /**
-     * 根据定位获取运营区信息,并返回所有车辆定位
-     *   a. 将前端的边界值获取后转成geometry格式
-     *   b. 模拟gps定位根据定位计算在哪个运营区内
-     *   c. 获取到运营区信息,查询出该运营区下所有的车辆信息并获取所有车辆的定位返回前端
+     * 根据经纬度查询附近500米的所有车辆
      * @param longitude 经度
      * @param latitude 纬度
      * @return 结果
      */
     @Override
     public List<AsDevice> vehicleLocalization(String longitude, String latitude) {
-        List<EtOperatingArea> etOperatingAreas = etOperatingAreaService.selectEtOperatingAreaList(new EtOperatingArea());
-        EtOperatingArea area = null;
-        for(EtOperatingArea etOperatingArea:etOperatingAreas){
-            Geometry geometry = GeoUtils.fromWkt(etOperatingArea.getBoundary());
-            Boolean inCircle = GeoUtils.isInCircle(longitude, latitude, geometry);
-            if(inCircle){
-                area = etOperatingArea;
-                break;
+        QueryWrapper<AsDevice> wrapper = new QueryWrapper<>();
+        wrapper.eq("status", "1"); // 设备状态正常
+
+        // 查询所有设备
+        List<AsDevice> allDevices = asDeviceMapper.selectList(wrapper);
+
+        List<AsDevice> nearbyDevices = new ArrayList<>();
+        double targetLon = Double.parseDouble(longitude);
+        double targetLat = Double.parseDouble(latitude);
+
+        int nearbyVehicle = 500;// 默认距离小于等于 500 米
+        String nearbyVehicles = sysConfigService.selectConfigByKey("nearby.vehicles");
+        if(StrUtil.isNotBlank(nearbyVehicles)){
+            nearbyVehicle = Integer.parseInt(nearbyVehicles);
+        }
+        for (AsDevice device : allDevices) {
+            double deviceLon = Double.parseDouble(device.getLongitude());
+            double deviceLat = Double.parseDouble(device.getLatitude());
+            double distance = GeoUtils.calculateDistance(targetLat, targetLon, deviceLat, deviceLon);
+
+            if (distance <= nearbyVehicle) {
+                nearbyDevices.add(device);
             }
         }
-        List<AsDevice> asDevices = new ArrayList<>();
-        if(ObjectUtil.isNotNull(area)){
-            /** c. 获取到运营区信息,查询出该运营区下所有的车辆信息并获取所有车辆的定位返回前端*/
-            log.info("在【{}】运营区内",area.getAreaName());
-            QueryWrapper<AsDevice> wrapper = new QueryWrapper<>();
-            wrapper.eq("area_id", area.getAreaId());
-            wrapper.in("status","1");//0 未上架,1-正常
-            asDevices = asDeviceMapper.selectList(wrapper);
-            return asDevices;
-        }else{
-            log.info("不在任何运营区内");
-            return asDevices;
-        }
+        return nearbyDevices;
     }
 
     /**
@@ -1673,40 +1675,41 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
         EtFeeRule rule = etFeeRuleService.selectEtFeeRuleByRuleIdIncludeDelete(order.getRuleId());
         Integer autoRefundDeposit = rule.getAutoRefundDeposit();
         log.info("【还车关锁】进入押金抵扣环节--------"+autoRefundDeposit+"个小时后退还押金");
+        /** 2. 获取最后一次押金*/
+        EtOrder depositOrder = etOrderService.getDepositOrder(order.getUserId());
+        BigDecimal deposit = depositOrder.getTotalFee();
+        BigDecimal ridingFee = order.getTotalFee();
+        BigDecimal afterDeductionFee;
+        String mark;
+        if(deposit.compareTo(ridingFee) <= 0){// 骑行费大于押金,订单为未支付, 抵扣后的金额 = 骑行费 - 押金
+            afterDeductionFee = BigDecimal.ZERO;
+            mark = "押金抵扣成功,骑行费【"+ridingFee+"】大于押金【"+deposit+"】";
+            order.setStatus(ServiceConstants.ORDER_STATUS_RIDING_END);
+            order.setPayFee(deposit);
+        }else{
+            // 押金大于订单金额  扣除后
+            afterDeductionFee = deposit.subtract(ridingFee);
+            mark = "押金抵扣成功,骑行费【"+ridingFee+"】小于押金【"+deposit+"】,扣除后金额【"+afterDeductionFee+"】";
+            order.setStatus(ServiceConstants.ORDER_STATUS_ORDER_END);
+        }
+        /** 更新骑行订单*/
+        order.setPaid(ServiceConstants.ORDER_PAY_STATUS_PAID);
+        order.setPayTime(DateUtils.getNowDate());
+        order.setPayType(ServiceConstants.PAY_TYPE_YJ);
+        order.setMark(mark);
+        order.setDepositDeduction(ServiceConstants.IS_DEPOSIT_DEDUCTION);
+        /** 更新押金订单*/
+        depositOrder.setDepositDeduction(ServiceConstants.IS_DEPOSIT_DEDUCTION);
+        int updateEtOrder1 = etOrderMapper.updateEtOrder(depositOrder);
+        if(updateEtOrder1 == 0){
+            throw new ServiceException("押金抵扣失败,更新押金订单失败");
+        }
+        /** 押金抵扣后生成资金流水记录 */
+        callbackService.capitalFlowRecords(order,ServiceConstants.FLOW_TYPE_INCOME,ServiceConstants.ORDER_TYPE_RIDING,ServiceConstants.OWNER_TYPE_OPERATOR,null,ServiceConstants.PAY_TYPE_YJ);
+        //创建一个定时器,计算出退还时间后,执行退款操作
+        // 往后推autoRefundDeposit小时执行
         if(autoRefundDeposit!=null){
-            //创建一个定时器,计算出退还时间后,执行退款操作
-            // 往后推autoRefundDeposit小时执行
-            EtOrder finalOrder = order;
             scheduledExecutorService.schedule(() -> {
-                /** 2. 获取最后一次押金*/
-                EtOrder depositOrder = etOrderService.getDepositOrder(finalOrder.getUserId());
-                BigDecimal deposit = depositOrder.getTotalFee();
-                BigDecimal ridingFee = finalOrder.getTotalFee();
-                BigDecimal afterDeductionFee;
-                String mark;
-                if(deposit.compareTo(ridingFee) <= 0){// 骑行费大于押金,订单为未支付, 抵扣后的金额 = 骑行费 - 押金
-                    afterDeductionFee = BigDecimal.ZERO;
-                    mark = "押金抵扣成功,骑行费【"+ridingFee+"】大于押金【"+deposit+"】";
-                    finalOrder.setStatus(ServiceConstants.ORDER_STATUS_RIDING_END);
-                    finalOrder.setPayFee(deposit);
-                }else{
-                    // 押金大于订单金额  扣除后
-                    afterDeductionFee = deposit.subtract(ridingFee);
-                    mark = "押金抵扣成功,骑行费【"+ridingFee+"】小于押金【"+deposit+"】,扣除后金额【"+afterDeductionFee+"】";
-                    finalOrder.setStatus(ServiceConstants.ORDER_STATUS_ORDER_END);
-                }
-                /** 更新骑行订单*/
-                finalOrder.setPaid(ServiceConstants.ORDER_PAY_STATUS_PAID);
-                finalOrder.setPayTime(DateUtils.getNowDate());
-                finalOrder.setPayType(ServiceConstants.PAY_TYPE_YJ);
-                finalOrder.setMark(mark);
-                finalOrder.setDepositDeduction(ServiceConstants.IS_DEPOSIT_DEDUCTION);
-                /** 更新押金订单*/
-                depositOrder.setDepositDeduction(ServiceConstants.IS_DEPOSIT_DEDUCTION);
-                int updateEtOrder1 = etOrderMapper.updateEtOrder(depositOrder);
-                if(updateEtOrder1 == 0){
-                    throw new ServiceException("押金抵扣失败,更新押金订单失败");
-                }
                 if(afterDeductionFee.compareTo(BigDecimal.ZERO) > 0){
                     /** 退款剩余押金*/
                     Refund refund = wxPayService.refund(depositOrder, "押金抵扣退款",afterDeductionFee,IdUtils.getOrderNo("ref"));
@@ -1731,8 +1734,6 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
                         }
                     }
                 }
-                /** 押金抵扣后生成资金流水记录 */
-                callbackService.capitalFlowRecords(finalOrder,ServiceConstants.FLOW_TYPE_INCOME,ServiceConstants.ORDER_TYPE_RIDING,ServiceConstants.OWNER_TYPE_OPERATOR,null,ServiceConstants.PAY_TYPE_YJ);
             }, autoRefundDeposit , TimeUnit.HOURS);
         }
     }
diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtCouponClaimLogServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtCouponClaimLogServiceImpl.java
new file mode 100644
index 0000000..dff54b6
--- /dev/null
+++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtCouponClaimLogServiceImpl.java
@@ -0,0 +1,95 @@
+package com.ruoyi.system.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.system.mapper.EtCouponClaimLogMapper;
+import com.ruoyi.system.domain.EtCouponClaimLog;
+import com.ruoyi.system.service.IEtCouponClaimLogService;
+
+/**
+ * 优惠券领取记录Service业务层处理
+ * 
+ * @author qzz
+ * @date 2024-08-08
+ */
+@Service
+public class EtCouponClaimLogServiceImpl implements IEtCouponClaimLogService 
+{
+    @Autowired
+    private EtCouponClaimLogMapper etCouponClaimLogMapper;
+
+    /**
+     * 查询优惠券领取记录
+     * 
+     * @param claimId 优惠券领取记录主键
+     * @return 优惠券领取记录
+     */
+    @Override
+    public EtCouponClaimLog selectEtCouponClaimLogByClaimId(Long claimId)
+    {
+        return etCouponClaimLogMapper.selectEtCouponClaimLogByClaimId(claimId);
+    }
+
+    /**
+     * 查询优惠券领取记录列表
+     * 
+     * @param etCouponClaimLog 优惠券领取记录
+     * @return 优惠券领取记录
+     */
+    @Override
+    public List<EtCouponClaimLog> selectEtCouponClaimLogList(EtCouponClaimLog etCouponClaimLog)
+    {
+        return etCouponClaimLogMapper.selectEtCouponClaimLogList(etCouponClaimLog);
+    }
+
+    /**
+     * 新增优惠券领取记录
+     * 
+     * @param etCouponClaimLog 优惠券领取记录
+     * @return 结果
+     */
+    @Override
+    public int insertEtCouponClaimLog(EtCouponClaimLog etCouponClaimLog)
+    {
+        etCouponClaimLog.setCreateTime(DateUtils.getNowDate());
+        return etCouponClaimLogMapper.insertEtCouponClaimLog(etCouponClaimLog);
+    }
+
+    /**
+     * 修改优惠券领取记录
+     * 
+     * @param etCouponClaimLog 优惠券领取记录
+     * @return 结果
+     */
+    @Override
+    public int updateEtCouponClaimLog(EtCouponClaimLog etCouponClaimLog)
+    {
+        return etCouponClaimLogMapper.updateEtCouponClaimLog(etCouponClaimLog);
+    }
+
+    /**
+     * 批量删除优惠券领取记录
+     * 
+     * @param claimIds 需要删除的优惠券领取记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteEtCouponClaimLogByClaimIds(Long[] claimIds)
+    {
+        return etCouponClaimLogMapper.deleteEtCouponClaimLogByClaimIds(claimIds);
+    }
+
+    /**
+     * 删除优惠券领取记录信息
+     * 
+     * @param claimId 优惠券领取记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteEtCouponClaimLogByClaimId(Long claimId)
+    {
+        return etCouponClaimLogMapper.deleteEtCouponClaimLogByClaimId(claimId);
+    }
+}
diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtCouponServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtCouponServiceImpl.java
new file mode 100644
index 0000000..28e9377
--- /dev/null
+++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtCouponServiceImpl.java
@@ -0,0 +1,95 @@
+package com.ruoyi.system.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.system.mapper.EtCouponMapper;
+import com.ruoyi.system.domain.EtCoupon;
+import com.ruoyi.system.service.IEtCouponService;
+
+/**
+ * 优惠券Service业务层处理
+ * 
+ * @author 邱贞招
+ * @date 2024-08-05
+ */
+@Service
+public class EtCouponServiceImpl implements IEtCouponService 
+{
+    @Autowired
+    private EtCouponMapper etCouponMapper;
+
+    /**
+     * 查询优惠券
+     * 
+     * @param couponId 优惠券主键
+     * @return 优惠券
+     */
+    @Override
+    public EtCoupon selectEtCouponByCouponId(Long couponId)
+    {
+        return etCouponMapper.selectEtCouponByCouponId(couponId);
+    }
+
+    /**
+     * 查询优惠券列表
+     * 
+     * @param etCoupon 优惠券
+     * @return 优惠券
+     */
+    @Override
+    public List<EtCoupon> selectEtCouponList(EtCoupon etCoupon)
+    {
+        return etCouponMapper.selectEtCouponList(etCoupon);
+    }
+
+    /**
+     * 新增优惠券
+     * 
+     * @param etCoupon 优惠券
+     * @return 结果
+     */
+    @Override
+    public int insertEtCoupon(EtCoupon etCoupon)
+    {
+        etCoupon.setCreateTime(DateUtils.getNowDate());
+        return etCouponMapper.insertEtCoupon(etCoupon);
+    }
+
+    /**
+     * 修改优惠券
+     * 
+     * @param etCoupon 优惠券
+     * @return 结果
+     */
+    @Override
+    public int updateEtCoupon(EtCoupon etCoupon)
+    {
+        return etCouponMapper.updateEtCoupon(etCoupon);
+    }
+
+    /**
+     * 批量删除优惠券
+     * 
+     * @param couponIds 需要删除的优惠券主键
+     * @return 结果
+     */
+    @Override
+    public int deleteEtCouponByCouponIds(Long[] couponIds)
+    {
+        return etCouponMapper.deleteEtCouponByCouponIds(couponIds);
+    }
+
+    /**
+     * 删除优惠券信息
+     * 
+     * @param couponId 优惠券主键
+     * @return 结果
+     */
+    @Override
+    public int deleteEtCouponByCouponId(Long couponId)
+    {
+        return etCouponMapper.deleteEtCouponByCouponId(couponId);
+    }
+}
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 95789a6..c5d21af 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
@@ -320,7 +320,7 @@ public class EtOrderServiceImpl implements IEtOrderService
             refund.setRefundResult(Constants.SUCCESS2);
             refund.setUserName(etOrder.getUserName());
             PageUtils.startPage();
-            List<EtRefund> etRefunds = etRefundMapper.selectEtRefundList(refund);;
+            List<EtRefund> etRefunds = etRefundMapper.selectEtRefundList(refund);
             etRefunds.forEach(etRefund -> {
                 AsUser asUser = asUserService.selectUserById(etRefund.getUserId());
                 RechargeVo rechargeVo = new RechargeVo();
diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java
index d6cee80..fbb7288 100644
--- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java
+++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java
@@ -27,7 +27,7 @@ import com.ruoyi.system.service.ISysRoleService;
 
 /**
  * 角色 业务层处理
- * 
+ *
  * @author ruoyi
  */
 @Service
@@ -47,12 +47,12 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 根据条件分页查询角色数据
-     * 
+     *
      * @param role 角色信息
      * @return 角色数据集合信息
      */
     @Override
-    @DataScope(deptAlias = "d")
+//    @DataScope(deptAlias = "d")
     public List<SysRole> selectRoleList(SysRole role)
     {
         return roleMapper.selectRoleList(role);
@@ -60,7 +60,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 根据用户ID查询角色
-     * 
+     *
      * @param userId 用户ID
      * @return 角色列表
      */
@@ -85,7 +85,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 根据用户ID查询权限
-     * 
+     *
      * @param userId 用户ID
      * @return 权限列表
      */
@@ -106,7 +106,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 查询所有角色
-     * 
+     *
      * @return 角色列表
      */
     @Override
@@ -117,7 +117,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 根据用户ID获取角色选择框列表
-     * 
+     *
      * @param userId 用户ID
      * @return 选中角色ID列表
      */
@@ -129,7 +129,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 通过角色ID查询角色
-     * 
+     *
      * @param roleId 角色ID
      * @return 角色对象信息
      */
@@ -141,7 +141,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 校验角色名称是否唯一
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -159,7 +159,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 校验角色权限是否唯一
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -177,7 +177,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 校验角色是否允许操作
-     * 
+     *
      * @param role 角色信息
      */
     @Override
@@ -191,7 +191,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 校验角色是否有数据权限
-     * 
+     *
      * @param roleId 角色id
      */
     @Override
@@ -211,7 +211,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 通过角色ID查询角色使用数量
-     * 
+     *
      * @param roleId 角色ID
      * @return 结果
      */
@@ -223,7 +223,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 新增保存角色信息
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -238,7 +238,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 修改保存角色信息
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -255,7 +255,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 修改角色状态
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -267,7 +267,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 修改数据权限信息
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -285,7 +285,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 新增角色菜单信息
-     * 
+     *
      * @param role 角色对象
      */
     public int insertRoleMenu(SysRole role)
@@ -333,7 +333,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 通过角色ID删除角色
-     * 
+     *
      * @param roleId 角色ID
      * @return 结果
      */
@@ -350,7 +350,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 批量删除角色信息
-     * 
+     *
      * @param roleIds 需要删除的角色ID
      * @return 结果
      */
@@ -377,7 +377,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 取消授权用户角色
-     * 
+     *
      * @param userRole 用户和角色关联信息
      * @return 结果
      */
@@ -389,7 +389,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 批量取消授权用户角色
-     * 
+     *
      * @param roleId 角色ID
      * @param userIds 需要取消授权的用户数据ID
      * @return 结果
@@ -402,7 +402,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 批量选择授权用户角色
-     * 
+     *
      * @param roleId 角色ID
      * @param userIds 需要授权的用户数据ID
      * @return 结果
diff --git a/electripper-system/src/main/resources/mapper/system/EtCouponClaimLogMapper.xml b/electripper-system/src/main/resources/mapper/system/EtCouponClaimLogMapper.xml
new file mode 100644
index 0000000..c872e66
--- /dev/null
+++ b/electripper-system/src/main/resources/mapper/system/EtCouponClaimLogMapper.xml
@@ -0,0 +1,82 @@
+<?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.system.mapper.EtCouponClaimLogMapper">
+
+    <resultMap type="EtCouponClaimLog" id="EtCouponClaimLogResult">
+        <result property="claimId"    column="claim_id"    />
+        <result property="areaId"    column="area_id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="couponId"    column="coupon_id"    />
+        <result property="createTime"    column="create_time"    />
+    </resultMap>
+
+    <sql id="selectEtCouponClaimLogVo">
+        select claim_id, area_id, user_id, coupon_id, create_time from et_coupon_claim_log
+    </sql>
+
+    <select id="selectEtCouponClaimLogList" parameterType="EtCouponClaimLog" resultMap="EtCouponClaimLogResult">
+        select
+           l.claim_id,
+           l.area_id,
+           a.area_name areaName,
+           l.user_id,
+           u.user_name userName,
+           l.coupon_id,
+           l.create_time
+        from et_coupon_claim_log l
+        left join et_operating_area a on a.area_id = l.area_id
+        left join et_user u on u.user_id = l.user_id
+        <where>
+            <if test="areaId != null "> and l.area_id like concat('%', #{areaId}, '%')</if>
+            <if test="areaName != null "> and a.area_name like concat('%', #{areaName}, '%')</if>
+            <if test="userId != null "> and l.user_id like concat('%', #{userId}, '%')</if>
+            <if test="userName != null "> and u.user_name = #{userName}</if>
+            <if test="couponId != null "> and l.coupon_id like concat('%', #{couponId}, '%')</if>
+        </where>
+    </select>
+
+    <select id="selectEtCouponClaimLogByClaimId" parameterType="Long" resultMap="EtCouponClaimLogResult">
+        <include refid="selectEtCouponClaimLogVo"/>
+        where claim_id = #{claimId}
+    </select>
+
+    <insert id="insertEtCouponClaimLog" parameterType="EtCouponClaimLog" useGeneratedKeys="true" keyProperty="claimId">
+        insert into et_coupon_claim_log
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="areaId != null">area_id,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="couponId != null">coupon_id,</if>
+            <if test="createTime != null">create_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="areaId != null">#{areaId},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="couponId != null">#{couponId},</if>
+            <if test="createTime != null">#{createTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateEtCouponClaimLog" parameterType="EtCouponClaimLog">
+        update et_coupon_claim_log
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="areaId != null">area_id = #{areaId},</if>
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="couponId != null">coupon_id = #{couponId},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+        </trim>
+        where claim_id = #{claimId}
+    </update>
+
+    <delete id="deleteEtCouponClaimLogByClaimId" parameterType="Long">
+        delete from et_coupon_claim_log where claim_id = #{claimId}
+    </delete>
+
+    <delete id="deleteEtCouponClaimLogByClaimIds" parameterType="String">
+        delete from et_coupon_claim_log where claim_id in
+        <foreach item="claimId" collection="array" open="(" separator="," close=")">
+            #{claimId}
+        </foreach>
+    </delete>
+</mapper>
diff --git a/electripper-system/src/main/resources/mapper/system/EtCouponMapper.xml b/electripper-system/src/main/resources/mapper/system/EtCouponMapper.xml
new file mode 100644
index 0000000..8ecf65d
--- /dev/null
+++ b/electripper-system/src/main/resources/mapper/system/EtCouponMapper.xml
@@ -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.system.mapper.EtCouponMapper">
+
+    <resultMap type="EtCoupon" id="EtCouponResult">
+        <result property="couponId"    column="coupon_id"    />
+        <result property="type"    column="type"    />
+        <result property="discountPercent"    column="discount_percent"    />
+        <result property="areaId"    column="area_id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="discountAmount"    column="discount_amount"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="expirationTime"    column="expiration_time"    />
+        <result property="status"    column="status"    />
+        <result property="limitNum"    column="limit_num"    />
+    </resultMap>
+
+    <sql id="selectEtCouponVo">
+        select coupon_id, type, discount_percent, area_id, user_id, discount_amount, create_time, expiration_time, status, limit_num from et_coupon
+    </sql>
+
+    <select id="selectEtCouponList" parameterType="EtCoupon" resultMap="EtCouponResult">
+        SELECT
+            c.coupon_id,
+            c.type,
+            c.discount_percent,
+            c.area_id,
+            a.area_name areaName,
+            c.user_id,
+            u.user_name userName,
+            c.discount_amount,
+            c.create_time,
+            c.expiration_time,
+            c.STATUS,
+            c.limit_num
+        FROM
+        et_coupon c
+        left join et_operating_area a on a.area_id = c.area_id
+        left join et_user u on u.user_id = c.user_id
+        <where>
+            <if test="type != null  and type != ''"> and c.type = #{type}</if>
+            <if test="discountPercent != null "> and c.discount_percent = #{discountPercent}</if>
+            <if test="areaId != null "> and c.area_id = #{areaId}</if>
+            <if test="areaName != null "> and a.area_name like concat('%', #{areaName}, '%')</if>
+            <if test="userId != null "> and c.user_id = like concat('%', #{userId}, '%')</if>
+            <if test="userName != null "> and u.user_name = #{userName}</if>
+            <if test="discountAmount != null "> and c.discount_amount = #{discountAmount}</if>
+            <if test="expirationTime != null "> and c.expiration_time = #{expirationTime}</if>
+            <if test="status != null  and status != ''"> and c.status = #{status}</if>
+            <if test="limitNum != null  and limitNum != ''"> and c.limit_num = #{limitNum}</if>
+        </where>
+    </select>
+
+    <select id="selectEtCouponByCouponId" parameterType="Long" resultMap="EtCouponResult">
+        <include refid="selectEtCouponVo"/>
+        where coupon_id = #{couponId}
+    </select>
+
+    <insert id="insertEtCoupon" parameterType="EtCoupon" useGeneratedKeys="true" keyProperty="couponId">
+        insert into et_coupon
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="type != null">type,</if>
+            <if test="discountPercent != null">discount_percent,</if>
+            <if test="areaId != null">area_id,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="discountAmount != null">discount_amount,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="expirationTime != null">expiration_time,</if>
+            <if test="status != null">status,</if>
+            <if test="limitNum != null">limit_num,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="type != null">#{type},</if>
+            <if test="discountPercent != null">#{discountPercent},</if>
+            <if test="areaId != null">#{areaId},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="discountAmount != null">#{discountAmount},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="expirationTime != null">#{expirationTime},</if>
+            <if test="status != null">#{status},</if>
+            <if test="limitNum != null">#{limitNum},</if>
+         </trim>
+    </insert>
+
+    <update id="updateEtCoupon" parameterType="EtCoupon">
+        update et_coupon
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="type != null">type = #{type},</if>
+            <if test="discountPercent != null">discount_percent = #{discountPercent},</if>
+            <if test="areaId != null">area_id = #{areaId},</if>
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="discountAmount != null">discount_amount = #{discountAmount},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="expirationTime != null">expiration_time = #{expirationTime},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="limitNum != null">limit_num = #{limitNum},</if>
+        </trim>
+        where coupon_id = #{couponId}
+    </update>
+
+    <delete id="deleteEtCouponByCouponId" parameterType="Long">
+        delete from et_coupon where coupon_id = #{couponId}
+    </delete>
+
+    <delete id="deleteEtCouponByCouponIds" parameterType="String">
+        delete from et_coupon where coupon_id in
+        <foreach item="couponId" collection="array" open="(" separator="," close=")">
+            #{couponId}
+        </foreach>
+    </delete>
+</mapper>
diff --git a/electripper-system/src/main/resources/mapper/system/EtFaultMapper.xml b/electripper-system/src/main/resources/mapper/system/EtFaultMapper.xml
index 2a1aaa6..20bdcf1 100644
--- a/electripper-system/src/main/resources/mapper/system/EtFaultMapper.xml
+++ b/electripper-system/src/main/resources/mapper/system/EtFaultMapper.xml
@@ -31,6 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where 1 = 1
         <if test="userId != null "> and f.user_id = #{userId}</if>
         <if test="type != null  and type != ''"> and f.type = #{type}</if>
+        <if test="sn != null  and sn != ''"> and f.sn = #{sn}</if>
         <if test="status != null  and status != ''"> and f.status = #{status}</if>
         <!-- 数据范围过滤 -->
         ${params.dataScope}