From 8121d4d29d0d2802954035f20a6d315f25f66fb7 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期五, 27 九月 2024 10:47:43 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java                 |    6 
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TVipOrderServiceImpl.java                      |    7 
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TShoppingOrderServiceImpl.java                 |    1 
 ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUserIntegralChange.java                   |    3 
 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/PointDetailUtil.java                               |    3 
 ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/factory/WxPaymentFallbackFactory.java               |   15 
 ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/OrderFallbackFactory.java                       |    3 
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TGoodsController.java                            |   20 
 ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/dto/ExchangeBackDto.java                         |    9 
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java                              |    2 
 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserVipDetailController.java             |    2 
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TExchangeOrderController.java                    |    8 
 ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java |   13 
 ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/factory/IntegrationFallbackFactory.java     |    5 
 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java                      |   63 
 ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderClient.java                    |   26 
 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserTagController.java                   |    5 
 ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TChargingOrderMapper.xml                                  |   50 
 ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/controller/WxPayController.java                         |   18 
 ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java                      |    4 
 ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/OrderClient.java                            |    3 
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java                    |   79 
 ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TShoppingOrder.java                               |    2 
 ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/vo/PaymentOrder.java                                |    2 
 ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/feignClient/IntegrationClient.java          | 14707 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/feignClient/WxPaymentClient.java                    |   20 
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/util/task/TaskUtil.java                                     |  120 
 ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TVipOrderMapper.xml                                       |    2 
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TUserTagController.java                          |    2 
 ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TVipOrder.java                                    |    3 
 ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ChargingOrderFallbackFactory.java               |   10 
 ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/dto/PointChangeDto.java                          |    1 
 ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TShoppingOrderMapper.xml                                  |    8 
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCompanyController.java                          |    2 
 ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserFallbackFactory.java                 |    5 
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java                    |   13 
 ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TChargingOrderRefund.java                         |   11 
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TVipOrderController.java                         |    2 
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCouponController.java                           |   19 
 ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/utils/listener/IotMessageListener.java    |    2 
 ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TGoodsMapper.xml                                          |    3 
 ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/GoodsDTO.java                                       |    2 
 42 files changed, 15,144 insertions(+), 137 deletions(-)

diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserFallbackFactory.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserFallbackFactory.java
index 16146dd..67b6a52 100644
--- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserFallbackFactory.java
@@ -49,10 +49,7 @@
                 return R.fail("修改用户失败:"+throwable.getMessage());
             }
 
-            @Override
-            public R change(PointChangeDto points) {
-                return null;
-            }
+
 
             @Override
             public R changeDown(PointChangeDto points) {
diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java
index 3cc881d..0f42ada 100644
--- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java
@@ -57,8 +57,8 @@
     @PostMapping("/t-app-user/user/updateAppUser")
     R updateAppUser(@RequestBody TAppUser appUser);
 
-    @PostMapping("/t-app-user/user/points/change")
-    R change(@RequestBody PointChangeDto points);
+//    @PostMapping("/t-app-user/user/points/change")
+//    R change(@RequestBody PointChangeDto points);
     @PostMapping("/t-app-user/user/points/change/down")
     R changeDown(@RequestBody PointChangeDto points);
 
diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUserIntegralChange.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUserIntegralChange.java
index abd7964..1b5f369 100644
--- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUserIntegralChange.java
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUserIntegralChange.java
@@ -39,6 +39,9 @@
     @TableField("code")
     private String code;
 
+    @ApiModelProperty(value = "对应跳转订单号")
+    @TableField("order_code")
+    private String orderCode;
     @ApiModelProperty(value = "用户id")
     @TableField("app_user_id")
     private Long appUserId;
diff --git a/ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/factory/IntegrationFallbackFactory.java b/ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/factory/IntegrationFallbackFactory.java
index 87a7d65..b30f0fe 100644
--- a/ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/factory/IntegrationFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/factory/IntegrationFallbackFactory.java
@@ -122,6 +122,11 @@
             public R<String> platformRemoteUpdate(PlatformRemoteUpdate platformRemoteUpdate) {
                 return R.fail("远程更新调用失败:" + throwable.getMessage());
             }
+
+            @Override
+            public R<String> setupBillingModel1(String deviceId) {
+                return R.fail("远程更新硬件:" + throwable.getMessage());
+            }
         };
     }
 }
diff --git a/ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/feignClient/IntegrationClient.java b/ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/feignClient/IntegrationClient.java
index a6f1d64..8aae620 100644
--- a/ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/feignClient/IntegrationClient.java
+++ b/ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/feignClient/IntegrationClient.java
@@ -7,6 +7,7 @@
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
 
 /**
  * 充电服务
@@ -149,7 +150,7 @@
      * @param setupBillingModel 实体对象
      * @return
      */
-    @PostMapping("/sendMessage/sendMessagesetupBillingModel")
+    @PostMapping("/sendMessage/setupBillingModel")
     public R<String> setupBillingModel(@RequestBody SetupBillingModel setupBillingModel);
 
     /**
@@ -173,5 +174,14707 @@
      */
     @PostMapping("/sendMessage/sendMessageplatformRemoteUpdate")
     public R<String> platformRemoteUpdate(@RequestBody PlatformRemoteUpdate platformRemoteUpdate);
-    
+
+    @PostMapping("/iot/setupBillingModel")
+    public R<String> setupBillingModel1(@RequestParam("deviceId") String deviceId);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 }
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ChargingOrderFallbackFactory.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ChargingOrderFallbackFactory.java
index 72ebc17..294d7b0 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ChargingOrderFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ChargingOrderFallbackFactory.java
@@ -118,6 +118,16 @@
             public R<String> stopCharging(String id) {
                 return R.fail("手动停止充电失败:" + throwable.getMessage());
             }
+    
+            @Override
+            public void chargingOrderWXCallback(String out_trade_no, String transaction_id, String attach) {
+                log.error("充电支付成功回调通知失败:" + throwable.getMessage());
+            }
+    
+            @Override
+            public void chargingOrderStartupFailureWxRefund(String out_refund_no, String refund_id, String tradeState, String success_time) {
+                log.error("远程启动失败后退款通知失败:" + throwable.getMessage());
+            }
         };
     }
 }
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/OrderFallbackFactory.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/OrderFallbackFactory.java
index 7f2650b..ab55bc6 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/OrderFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/OrderFallbackFactory.java
@@ -1,6 +1,7 @@
 package com.ruoyi.order.api.factory;
 
 import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.dto.ExchangeBackDto;
 import com.ruoyi.common.core.dto.ExchangeDto;
 import com.ruoyi.order.api.feignClient.OrderClient;
 import com.ruoyi.order.api.model.ChargingListQuery;
@@ -49,7 +50,7 @@
             }
 
             @Override
-            public R<Long> exchangeCreate(ExchangeDto exchangeDto) {
+            public R<ExchangeBackDto> exchangeCreate(ExchangeDto exchangeDto) {
                 return R.fail("创建订单" + cause.getMessage());
             }
 
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderClient.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderClient.java
index b395682..c92882a 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderClient.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderClient.java
@@ -137,4 +137,30 @@
      */
     @PutMapping(value = "/t-charging-order/stopCharging/{id}")
     R<String> stopCharging(@PathVariable("id") String id);
+    
+    
+    /**
+     * 充电支付成功回调通知
+     * @param out_trade_no
+     * @param transaction_id
+     * @param attach
+     */
+    @PostMapping("/t-charging-order/chargingOrderWXCallback")
+    void chargingOrderWXCallback(@RequestParam("out_trade_no") String out_trade_no,
+                                 @RequestParam("transaction_id") String transaction_id,
+                                 @RequestParam("attach") String attach);
+    
+    
+    /**
+     * 远程启动失败后退款回调
+     * @param out_refund_no
+     * @param refund_id
+     * @param tradeState
+     * @param success_time
+     */
+    @PostMapping("/t-charging-order/chargingOrderStartupFailureWxRefund")
+    void chargingOrderStartupFailureWxRefund(@RequestParam("out_trade_no") String out_refund_no,
+                                             @RequestParam("out_trade_no") String refund_id,
+                                             @RequestParam("out_trade_no") String tradeState,
+                                             @RequestParam("out_trade_no") String success_time);
 }
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/OrderClient.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/OrderClient.java
index 9e49992..9678610 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/OrderClient.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/OrderClient.java
@@ -2,6 +2,7 @@
 
 import com.ruoyi.common.core.constant.ServiceNameConstants;
 import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.dto.ExchangeBackDto;
 import com.ruoyi.common.core.dto.ExchangeDto;
 import com.ruoyi.order.api.factory.OrderFallbackFactory;
 import com.ruoyi.order.api.model.ChargingListQuery;
@@ -38,7 +39,7 @@
     public R<Long> getExchangeById(@RequestParam("goodId") Integer goodId,@RequestParam("userId")  Long userId,@RequestParam("goodType") Integer goodType);
 
     @PostMapping("/t-exchange-order/create")
-    public R<Long> exchangeCreate(@RequestBody ExchangeDto exchangeDto);
+    public R<ExchangeBackDto> exchangeCreate(@RequestBody ExchangeDto exchangeDto);
     @PostMapping("/t-vip-order//addVipOrder")
     public R<Long> addVipOrder(@RequestBody TVipOrder vipOrder);
     @PostMapping("/t-shopping-order/create")
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TChargingOrderRefund.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TChargingOrderRefund.java
index c95a809..4f762b6 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TChargingOrderRefund.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TChargingOrderRefund.java
@@ -5,6 +5,8 @@
 import java.time.LocalDateTime;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -56,6 +58,7 @@
 
     @ApiModelProperty(value = "退款成功时间")
     @TableField("refund_time")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private LocalDateTime refundTime;
 
     @ApiModelProperty(value = "订单编号")
@@ -96,7 +99,11 @@
     private BigDecimal paymentAmount;
     @ApiModelProperty(value = "支付时间")
     @TableField(exist = false)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private LocalDateTime payTime;
-
-
+    @ApiModelProperty(value = "订单id")
+    @TableField(exist = false)
+    private String orderId;
+    @TableField(exist = false)
+    private String userId;
 }
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TShoppingOrder.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TShoppingOrder.java
index 44c70a3..b1e370b 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TShoppingOrder.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TShoppingOrder.java
@@ -105,7 +105,7 @@
     @TableField("remark")
     private String remark;
 
-    @ApiModelProperty(value = "状态(1=待发货,2=待收货,3=已完成,4=已取消)")
+    @ApiModelProperty(value = "状态(1=待发货,2=待收货,3=已完成,4=已取消 5=交易关闭)")
     @TableField("status")
     private Integer status;
 
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TVipOrder.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TVipOrder.java
index 541c529..beebeea 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TVipOrder.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TVipOrder.java
@@ -101,5 +101,8 @@
     @ApiModelProperty(value = "userUid")
     @TableField(exist = false)
     private String userUid;
+    @ApiModelProperty(value = "购买用户")
+    @TableField(exist = false)
+    private String userPhone;
 
 }
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/GoodsDTO.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/GoodsDTO.java
index ea83f00..5f79b6b 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/GoodsDTO.java
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/GoodsDTO.java
@@ -14,6 +14,6 @@
     private String name;
     @ApiModelProperty(value = "1现金购买 2积分兑换 ")
     private Integer type;
-    @ApiModelProperty(value = "1全部 2已售罄 ")
+    @ApiModelProperty(value = "1全部 2已售罄 3已下架")
     private Integer otherState;
 }
diff --git a/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/factory/WxPaymentFallbackFactory.java b/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/factory/WxPaymentFallbackFactory.java
index 71c165e..763ea46 100644
--- a/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/factory/WxPaymentFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/factory/WxPaymentFallbackFactory.java
@@ -38,16 +38,6 @@
             public R<Map<String, Object>> orderPay(PaymentOrder paymentOrder) {
                 return R.fail("调起微信支付失败:" + throwable.getMessage());
             }
-    
-            @Override
-            public R<Map<String, Object>> payNotify(HttpServletRequest request) {
-                return R.fail("微信支付回调失败:" + throwable.getMessage());
-            }
-    
-            @Override
-            public void ack() {
-        
-            }
 
             @Override
             public void close(String outTradeNo) {
@@ -57,11 +47,6 @@
             @Override
             public R<String> refundOrderR(WxPaymentRefundModel model) {
                 return R.fail("微信退款失败:" + throwable.getMessage());
-            }
-    
-            @Override
-            public R<WxRefundNotifyResp> refundNotify(HttpServletRequest request) {
-                return R.fail("微信退款回调失败:" + throwable.getMessage());
             }
         };
     }
diff --git a/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/feignClient/WxPaymentClient.java b/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/feignClient/WxPaymentClient.java
index 8f6e6c2..b96a0d5 100644
--- a/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/feignClient/WxPaymentClient.java
+++ b/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/feignClient/WxPaymentClient.java
@@ -41,20 +41,6 @@
 	R<Map<String, Object>> orderPay(@RequestBody PaymentOrder paymentOrder);
 	
 	
-	/**
-	 * 支付回调
-	 * @param request
-	 * @return
-	 */
-	@PostMapping("/wx/pay/notify")
-	R<Map<String, Object>> payNotify(HttpServletRequest request);
-	
-	/**
-	 * 支付回调成功后的成功应答
-	 */
-	@PostMapping("/wx/pay/ack")
-	void ack();
-	
 	
 	/**
 	 * 关闭订单
@@ -66,10 +52,4 @@
 	@ApiOperation("订单退款")
 	@PostMapping(value = "/wx/refundOrderR")
 	public R<String> refundOrderR(@RequestBody WxPaymentRefundModel model);
-	
-	
-	
-	@ApiOperation("订单退款回调")
-	@PostMapping(value = "/wx/refund/notify")
-	R<WxRefundNotifyResp> refundNotify(HttpServletRequest request);
 }
diff --git a/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/vo/PaymentOrder.java b/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/vo/PaymentOrder.java
index 08d54c1..3fac737 100644
--- a/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/vo/PaymentOrder.java
+++ b/ruoyi-api/ruoyi-api-payment/src/main/java/com/ruoyi/payment/api/vo/PaymentOrder.java
@@ -29,5 +29,5 @@
 	/**
 	 * 回调地址
 	 */
-	private String notifyUrl ="http://221.182.45.100:9000/payment/wx/pay/notify";
+	private String notifyUrl ="/payment/wx/pay/notify";
 }
diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/dto/ExchangeBackDto.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/dto/ExchangeBackDto.java
new file mode 100644
index 0000000..102ecb9
--- /dev/null
+++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/dto/ExchangeBackDto.java
@@ -0,0 +1,9 @@
+package com.ruoyi.common.core.dto;
+
+import lombok.Data;
+
+@Data
+public class ExchangeBackDto {
+    private Long id;
+    private String code;
+}
diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/dto/PointChangeDto.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/dto/PointChangeDto.java
index 4a6d0fb..3417d40 100644
--- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/dto/PointChangeDto.java
+++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/dto/PointChangeDto.java
@@ -8,4 +8,5 @@
     private Integer points;
     private String remark;
     private Integer type;
+    private String code;
 }
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java
index 6d61635..4ab4162 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java
@@ -198,6 +198,10 @@
     @DeleteMapping(value = "/unit/delete")
     @Log(title = "【单位管理】删除单位", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE)
     public R add(@RequestParam String ids) {
+        List<TAppUser> list = appUserService.lambdaQuery().in(TAppUser::getCompanyId, Arrays.asList(ids.split(","))).list();
+        if (!list.isEmpty()){
+            return R.fail("当前单位已存在用户,无法删除!");
+        }
         String[] split = ids.split(",");
         for (String s : split) {
             otherClient.unitDelete(Integer.valueOf(s));
@@ -219,7 +223,7 @@
         Page<TAppUser> page = appUserService.lambdaQuery()
                 .like(userListQueryDto.getUserPhone() != null && !"".equals(userListQueryDto.getUserPhone()), TAppUser::getPhone, userListQueryDto.getUserPhone())
                 .eq(userListQueryDto.getCompanyId() != null, TAppUser::getCompanyId, userListQueryDto.getCompanyId())
-                .like(userListQueryDto.getProvinceCode() != null && !"".equals(userListQueryDto.getProvinceCode()), TAppUser::getProvinceCode, userListQueryDto.getProvinceCode())
+                .eq(userListQueryDto.getProvinceCode() != null && !"".equals(userListQueryDto.getProvinceCode()), TAppUser::getProvinceCode, userListQueryDto.getProvinceCode())
                 .eq(userListQueryDto.getCityCode() != null && !"".equals(userListQueryDto.getCityCode()), TAppUser::getCityCode, userListQueryDto.getCityCode())
                 .eq(userListQueryDto.getStatus() != null, TAppUser::getStatus, userListQueryDto.getStatus())
                 .eq(userListQueryDto.getVipTypeId() != null, TAppUser::getVipId, userListQueryDto.getVipTypeId())
@@ -278,16 +282,25 @@
         if (userListQueryDto.getUserTagId() != null){
             userIds = appUserTagService.lambdaQuery().eq(TAppUserTag::getUserTagId, userListQueryDto.getUserTagId()).list().stream().map(TAppUserTag::getAppUserId).collect(Collectors.toList());
         }
+        LocalDateTime end1 = null;
+        LocalDateTime end2 = null ;
+        if (userListQueryDto.getVipEndTime1()!=null) {
+            end1 =    LocalDateTime.now().plusDays(userListQueryDto.getVipEndTime1());
+        }
+        if (userListQueryDto.getVipEndTime2()!=null){
+            end2 = LocalDateTime.now().plusDays(userListQueryDto.getVipEndTime2());
+        }
         //列表查询
         Page<TAppUser> page = appUserService.lambdaQuery()
                 .ge(TAppUser::getVipEndTime, LocalDateTime.now())
                 .like(userListQueryDto.getUserPhone() != null && !"".equals(userListQueryDto.getUserPhone()), TAppUser::getPhone, userListQueryDto.getUserPhone())
                 .eq(userListQueryDto.getCompanyId() != null, TAppUser::getCompanyId, userListQueryDto.getCompanyId())
+                .eq(userListQueryDto.getProvinceCode() != null && !"".equals(userListQueryDto.getProvinceCode()), TAppUser::getProvinceCode, userListQueryDto.getProvinceCode())
                 .eq(userListQueryDto.getCityCode() != null && !"".equals(userListQueryDto.getCityCode()), TAppUser::getCityCode, userListQueryDto.getCityCode())
                 .eq(userListQueryDto.getStatus() != null, TAppUser::getStatus, userListQueryDto.getStatus())
                 .eq(userListQueryDto.getVipTypeId() != null, TAppUser::getVipId, userListQueryDto.getVipTypeId())
-                .ge(userListQueryDto.getVipEndTime1() != null, TAppUser::getVipEndTime, userListQueryDto.getVipEndTime1() == null ? null : LocalDateTime.now().plusDays(userListQueryDto.getVipEndTime1()))
-                .le(userListQueryDto.getVipEndTime2() != null, TAppUser::getVipEndTime, userListQueryDto.getVipEndTime2() == null ? null : LocalDateTime.now().plusDays(userListQueryDto.getVipEndTime2()))
+                .ge(userListQueryDto.getVipEndTime1() != null, TAppUser::getVipEndTime, end1 )
+                .le(userListQueryDto.getVipEndTime2() != null, TAppUser::getVipEndTime, end2)
                 .in(!userIds.isEmpty(), TAppUser::getId, userIds)
                 .page(Page.of(userListQueryDto.getPageCurr(), userListQueryDto.getPageSize()));
         if (page.getRecords().isEmpty()){
@@ -407,6 +420,11 @@
                 }
             }
 
+        }else {
+           List<TAppUser> list = appUserService.lambdaQuery().eq(TAppUser::getPhone, tAppUser.getPhone()).list();
+           if (!list.isEmpty()){
+               return R.fail("该手机号已注册");
+           }
         }
         appUserService.saveOrUpdate(tAppUser);
         return R.ok();
@@ -416,12 +434,16 @@
     @GetMapping(value = "/user/detail/{id}")
     public R<UserDetailDto> userDetail(@PathVariable Long id) {
         TAppUser user = appUserService.getById(id);
-        UserDetailDto userDetailDto =  new UserDetailDto();
-        BeanUtils.copyProperties(user,userDetailDto);
-        if (user.getVipId()!=null) {
-            R<Map<Integer, String>> vipMap = otherClient.getVipMap(Arrays.asList(user.getVipId()));
+        R<Map<Integer, String>> vipMap = otherClient.getVipMap(Collections.singletonList(user.getVipId()));
+        if (user.getVipEndTime()!=null&&user.getVipEndTime().isAfter(LocalDateTime.now())) {
+            //匹配vipMap的值
             user.setVipName(vipMap.getData().get(user.getVipId()));
         }
+
+
+        UserDetailDto userDetailDto =  new UserDetailDto();
+        BeanUtils.copyProperties(user,userDetailDto);
+
         //获取累计充电数量
         R<Long> useOrderCount = chargingOrderClient.useOrderCount(user.getId());
         userDetailDto.setOrderCount(useOrderCount.getData());
@@ -437,6 +459,9 @@
         userDetailDto.setTagName(tagMap.getData().values()
                 .stream()
                 .collect(Collectors.joining(",")));
+
+
+
         return R.ok(userDetailDto);
     }
 
@@ -552,7 +577,7 @@
         Long count = signService.lambdaQuery().eq(TAppUserSign::getAppUserId,userId).eq(TAppUserSign::getSignDay, LocalDate.now()).count();
         appUserInfoDto.setIsSign(count>0?1:0);
         //获取当前拥有的优惠卷数量
-        Long coupons = appCouponService.lambdaQuery().eq(TAppCoupon::getAppUserId, userId).eq(TAppCoupon::getStatus, 1).count();
+        Long coupons = appCouponService.lambdaQuery().eq(TAppCoupon::getAppUserId, userId).ge(TAppCoupon::getEndTime, LocalDateTime.now()).eq(TAppCoupon::getStatus, 1).count();
         appUserInfoDto.setCouponNum(Math.toIntExact(coupons));
         //当前绑定的车辆
         List<TAppUserCar> list = carService.lambdaQuery().eq(TAppUserCar::getAppUserId, userId).list();
@@ -835,7 +860,7 @@
                 signService.updateById(appUserSign);
             }
         }
-        pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()+points,1,userId,"每日签到","JF");
+        pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()+points,1,userId,"每日签到","JF","");
         byId.setPoints(byId.getPoints()+points);
         appUserService.updateById(byId);
         return R.ok();
@@ -874,19 +899,19 @@
 
 
     //积分变化记录用
-    @PostMapping(value = "/user/points/change")
-    public R change(@RequestBody PointChangeDto points) {
-        TAppUser byId = appUserService.getById(points.getUserId());
-        pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()+points.getPoints(),points.getType(),points.getUserId(),points.getRemark(),"JF");
-        byId.setPoints(byId.getPoints()+points.getPoints());
-        appUserService.updateById(byId);
-        return R.ok();
-    }
+//    @PostMapping(value = "/user/points/change")
+//    public R change(@RequestBody PointChangeDto points) {
+//        TAppUser byId = appUserService.getById(points.getUserId());
+//        pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()+points.getPoints(),points.getType(),points.getUserId(),points.getRemark(),"JF");
+//        byId.setPoints(byId.getPoints()+points.getPoints());
+//        appUserService.updateById(byId);
+//        return R.ok();
+//    }
 
     @PostMapping(value = "/user/points/change/down")
     public R changeDown(@RequestBody PointChangeDto points) {
         TAppUser byId = appUserService.getById(points.getUserId());
-        pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()-points.getPoints(),points.getType(),points.getUserId(),points.getRemark(),"JF");
+        pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()-points.getPoints(),points.getType(),points.getUserId(),points.getRemark(),"JF",points.getCode());
         byId.setPoints(byId.getPoints()-points.getPoints());
         appUserService.updateById(byId);
         return R.ok();
@@ -950,7 +975,7 @@
                 }
 
             //增加积分记录
-            pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()+point,5,userId,appUserCar.getLicensePlate(),"");
+            pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()+point,5,userId,appUserCar.getLicensePlate(),"","");
             byId.setPoints(byId.getPoints()+point);
             byId.setFirstAdd(1);
 
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserTagController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserTagController.java
index 426f16f..6c8218b 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserTagController.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserTagController.java
@@ -72,6 +72,11 @@
     public R delete(String ids) {
         //拿到单位列表
         String[] split = ids.split(",");
+
+         List<TAppUserTag> list = appUserTagService.lambdaQuery().in(TAppUserTag::getUserTagId).list();
+         if (!list.isEmpty()){
+             return R.fail("当前标签已有用户获取,无法删除");
+         }
         for (String id : split) {
         otherClient.deleteTag(Integer.valueOf(id));
         }
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserVipDetailController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserVipDetailController.java
index 47aab16..2bedb36 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserVipDetailController.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserVipDetailController.java
@@ -48,7 +48,7 @@
 	@ApiOperation(value = "生效会员列表", tags = {"小程序-个人中心"})
 	public R<List<TAppUserVipDetail>> getVipUseDetail(){
         Long userId = tokenService.getLoginUserApplet().getUserId();
-        List<TAppUserVipDetail> list = appUserVipDetailService.lambdaQuery().eq(TAppUserVipDetail::getAppUserId, userId).last(" and now() between start_time and end_time order by start_time desc").list();
+        List<TAppUserVipDetail> list = appUserVipDetailService.lambdaQuery().eq(TAppUserVipDetail::getAppUserId, userId).last(" and now() between start_time and end_time order by start_time asc").list();
 
 		for (TAppUserVipDetail tAppUserVipDetail : list) {
             if(null != tAppUserVipDetail.getVipId()){
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/PointDetailUtil.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/PointDetailUtil.java
index 4b935ac..54fd849 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/PointDetailUtil.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/PointDetailUtil.java
@@ -12,7 +12,7 @@
 public class PointDetailUtil {
     @Resource
     private TAppUserIntegralChangeService appUserIntegralChangeService;
-    public void addDetail(Integer old,Integer now,Integer type,Long userId,String extension,String code){
+    public void addDetail(Integer old,Integer now,Integer type,Long userId,String extension,String code,String orderCode){
 
         TAppUserIntegralChange tAppUserIntegralChange= new TAppUserIntegralChange();
         tAppUserIntegralChange.setCode(OrderCodeUtil.getOrderCode(code));
@@ -22,6 +22,7 @@
         tAppUserIntegralChange.setCurrentIntegral(now);
         tAppUserIntegralChange.setCreateTime(LocalDateTime.now());
         tAppUserIntegralChange.setExtension(extension);
+        tAppUserIntegralChange.setOrderCode(orderCode);
         appUserIntegralChangeService.save(tAppUserIntegralChange);
 
 
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java
index fc961ec..1316ac6 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java
@@ -4,6 +4,7 @@
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.ruoyi.chargingPile.api.dto.TAccountingStrategyDTO;
 import com.ruoyi.chargingPile.api.model.*;
+import com.ruoyi.chargingPile.api.query.BatchSetAccountingStrategy;
 import com.ruoyi.chargingPile.api.query.TAccountingStrategyQuery;
 import com.ruoyi.chargingPile.api.vo.TAccountingStrategyDetailVO;
 import com.ruoyi.chargingPile.api.vo.TAccountingStrategyVO;
@@ -18,7 +19,10 @@
 import com.ruoyi.common.log.annotation.Log;
 import com.ruoyi.common.log.enums.BusinessType;
 import com.ruoyi.common.log.enums.OperatorType;
+import com.ruoyi.common.security.service.TokenService;
 import com.ruoyi.common.security.utils.SecurityUtils;
+import com.ruoyi.integration.api.feignClient.IntegrationClient;
+import com.ruoyi.system.api.domain.SysUser;
 import com.ruoyi.system.api.feignClient.SysUserClient;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.BeanUtils;
@@ -56,8 +60,9 @@
     private TChargingPileService chargingPileService;
     @Autowired
     private ISiteService siteService;
-    @Resource
+    @Autowired
     private SysUserClient sysUserClient;
+
 
     @Autowired
     public TAccountingStrategyController(TAccountingStrategyService accountingStrategyService, TAccountingStrategyDetailService accountingStrategyDetailService) {
@@ -293,6 +298,8 @@
 
         return AjaxResult.ok(accountingStrategyService.pageList(query));
     }
+    @Resource
+    private IntegrationClient integrationClient;
 
     @ApiOperation(tags = {"后台-申请表单-计费模板审核"},value = "审核")
     @PostMapping(value = "/auth/pass")
@@ -329,6 +336,10 @@
                 }
 
                 //硬件
+                 List<TChargingPile> list = chargingPileService.lambdaQuery().eq(TChargingPile::getSiteId, byId.getSiteId()).list();
+                for (TChargingPile tChargingPile : list) {
+                    integrationClient.setupBillingModel1(tChargingPile.getCode());
+                }
 
 
             }
diff --git a/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/utils/listener/IotMessageListener.java b/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/utils/listener/IotMessageListener.java
index e43d689..c3961f0 100644
--- a/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/utils/listener/IotMessageListener.java
+++ b/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/utils/listener/IotMessageListener.java
@@ -351,6 +351,8 @@
         return R.ok(message);
     }
 
+
+
     @ApiOperation(value = "远程重启",tags = {"硬件接口"})
     @PostMapping(value = "/platformRestart")
     public R platformRestart(String deviceId) {
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
index 91a8431..4e351db 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
@@ -68,6 +68,7 @@
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import javax.servlet.ServletInputStream;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.PrintWriter;
@@ -428,22 +429,12 @@
     
     /**
      * 充电充值支付回调
-     * @param request
      */
     @ResponseBody
     @PostMapping(value = "/chargingOrderWXCallback")
-    public void chargingOrderWXCallback(HttpServletRequest request) {
-        System.err.println("-------------------支付回调通知-------------------");
-        Map<String, Object> data = wxPaymentClient.payNotify(request).getData();
-        if (null != data) {
-            String out_trade_no = data.get("out_trade_no").toString();
-            String transaction_id = data.get("transaction_id").toString();
-            String attach = data.get("attach").toString();
-            AjaxResult ajaxResult = chargingOrderService.chargingOrderCallback(1, out_trade_no, transaction_id, attach);
-            if (ajaxResult.isSuccess()) {
-                wxPaymentClient.ack();
-            }
-        }
+    public void chargingOrderWXCallback(@RequestParam("out_trade_no") String out_trade_no, @RequestParam("transaction_id") String transaction_id,
+                                        @RequestParam("attach") String attach) {
+        AjaxResult ajaxResult = chargingOrderService.chargingOrderCallback(1, out_trade_no, transaction_id, attach);
     }
 
 
@@ -472,19 +463,14 @@
     
     /**
      * 远程启动失败后退款回调
-     * @param request
      */
     @ResponseBody
     @PostMapping(value = "/chargingOrderStartupFailureWxRefund")
-    public void chargingOrderStartupFailureWxRefund(HttpServletRequest request){
-        WxRefundNotifyResp data = wxPaymentClient.refundNotify(request).getData();
-        if(null != data){
-            String out_refund_no = data.getOut_refund_no();
-            String refund_id = data.getRefund_id();
-            String tradeState = data.getTradeState();
-            String success_time = data.getSuccess_time();
-            chargingOrderService.chargingOrderStartupFailureWxRefund(out_refund_no, refund_id, tradeState, success_time);
-        }
+    public void chargingOrderStartupFailureWxRefund(@RequestParam("out_trade_no") String out_refund_no,
+                                                    @RequestParam("out_trade_no") String refund_id,
+                                                    @RequestParam("out_trade_no") String tradeState,
+                                                    @RequestParam("out_trade_no") String success_time){
+        chargingOrderService.chargingOrderStartupFailureWxRefund(out_refund_no, refund_id, tradeState, success_time);
     }
     
     
@@ -972,19 +958,50 @@
             siteIds.add(statisticsQueryDto.getSiteId());
         }
         if (statisticsQueryDto.getDayType()==1) {
-          List<Map<String,Object>> charMap = chargingOrderService.getHourType(siteIds,statisticsQueryDto);
+          List<Map<String,Object>> charMap1 = chargingOrderService.getHourType(siteIds,statisticsQueryDto);
+            List<Map<String, Object>> charMap = new ArrayList<>();
+            // 生成从 "00:00" 到 "23:00" 的时间数据
+            for (int hour = 0; hour < 24; hour++) {
+                String time = String.format("%02d:00", hour);
+                 Map<String, Object> mapWithTimeValue = findMapWithTimeValue(charMap1, time);
+                if (mapWithTimeValue!=null){
+                    charMap.add(mapWithTimeValue);
+                }else {
+                    Map<String, Object> timeMap = new HashMap<>();
+                    timeMap.put("time", time); // 初始化值为 null
+                    timeMap.put("electrovalence", 0);
+                    timeMap.put("orderCount", 0);
+                    timeMap.put("servicecharge", 0);
+                    timeMap.put("electricity", 0);
+                    charMap.add(timeMap);
+                }
+            }
           return R.ok(charMap);
         }else if (statisticsQueryDto.getDayType()==2){
             List<Map<String,Object>> charMap =  chargingOrderService.getDateType(siteIds,statisticsQueryDto);
             return R.ok(charMap);
         }else if (statisticsQueryDto.getDayType()==3){
             List<Map<String,Object>> charMap =  chargingOrderService.getMonthType(siteIds,statisticsQueryDto);
-        }
+            return R.ok(charMap);
 
+        }
         return R.ok();
 
 
     }
+
+    private static Map<String, Object> findMapWithTimeValue(List<Map<String, Object>> charMap1,String timeValue) {
+        for (Map<String, Object> map : charMap1) {
+            if (map.containsKey("time") && map.get("time").equals(timeValue)) {
+                return map;
+            }
+        }
+        return null; // 如果没有找到,返回 null
+    }
+
+
+
+
 
     @ResponseBody
     @PostMapping(value = "/work/use")
@@ -1020,9 +1037,9 @@
     @Resource
     private TOrderInvoiceService invoiceService;
     @ResponseBody
-    @PostMapping(value = "/work/shopOrder")
+    @GetMapping(value = "/work/shopOrder")
     @ApiOperation(value = "购物订单统计", tags = {"管理后台-工作台"})
-    public R shopOrder(@RequestBody ChargingStatisticsQueryDto statisticsQueryDto) {
+    public R shopOrder() {
         Long count = shoppingOrderService.lambdaQuery().eq(TShoppingOrder::getStatus, 1).count();
         Long count1 = shoppingOrderService.lambdaQuery().eq(TShoppingOrder::getStatus, 2).count();
         List<Long> counts = new ArrayList<>();
@@ -1032,9 +1049,9 @@
     }
 
     @ResponseBody
-    @PostMapping(value = "/work/invoice")
+    @GetMapping(value = "/work/invoice")
     @ApiOperation(value = "开票统计", tags = {"管理后台-工作台"})
-    public R invoice(@RequestBody ChargingStatisticsQueryDto statisticsQueryDto) {
+    public R invoice() {
         Long count = invoiceService.lambdaQuery().eq(TOrderInvoice::getStatus, 1).count();
         Long count1 = invoiceService.lambdaQuery().eq(TOrderInvoice::getStatus, 3).count();
         List<Long> counts = new ArrayList<>();
@@ -1044,9 +1061,9 @@
     }
 
     @ResponseBody
-    @PostMapping(value = "/work/users/count")
+    @GetMapping(value = "/work/users/count")
     @ApiOperation(value = "用户数量", tags = {"管理后台-工作台"})
-    public R usersCount(@RequestBody ChargingStatisticsQueryDto statisticsQueryDto) {
+    public R usersCount() {
        List<Map<String,Object>>  userMap  =    chargingOrderService.countAllUserData();
             return R.ok(userMap);
 
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TExchangeOrderController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TExchangeOrderController.java
index c07353a..26c049f 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TExchangeOrderController.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TExchangeOrderController.java
@@ -9,6 +9,7 @@
 import com.ruoyi.chargingPile.api.feignClient.ChargingPileClient;
 import com.ruoyi.chargingPile.api.model.TChargingPile;
 import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.dto.ExchangeBackDto;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.core.web.page.PageInfo;
 import com.ruoyi.common.security.service.TokenService;
@@ -265,7 +266,7 @@
     }
 
     @PostMapping("/create")
-    public R<Long> exchangeCreate(@RequestBody ExchangeDto exchangeDto){
+    public R<ExchangeBackDto> exchangeCreate(@RequestBody ExchangeDto exchangeDto){
         TExchangeOrder tExchangeOrder = new TExchangeOrder();
         tExchangeOrder.setCode(OrderCodeUtil.getOrderCode("DH"));
         tExchangeOrder.setAppUserId(exchangeDto.getUserId());
@@ -287,7 +288,10 @@
         tExchangeOrder.setCreateTime(LocalDateTime.now());
         tExchangeOrder.setDelFlag(false);
         exchangeOrderService.save(tExchangeOrder);
-        return R.ok(tExchangeOrder.getId());
+        ExchangeBackDto exchangeBackDto = new ExchangeBackDto();
+        exchangeBackDto.setId(tExchangeOrder.getId());
+        exchangeBackDto.setCode(tExchangeOrder.getCode());
+        return R.ok(exchangeBackDto);
 
     }
     
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java
index 6f50e62..1d39329 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java
@@ -20,6 +20,8 @@
 import com.ruoyi.order.api.query.ShoppingOrderQuery;
 import com.ruoyi.order.dto.*;
 import com.ruoyi.order.service.TShoppingOrderService;
+import com.ruoyi.other.api.domain.TCoupon;
+import com.ruoyi.other.api.domain.TGoods;
 import com.ruoyi.other.api.feignClient.CouponClient;
 import com.ruoyi.other.api.feignClient.GoodsClient;
 import com.ruoyi.payment.api.feignClient.AliPaymentClient;
@@ -119,6 +121,17 @@
 				byId.setReceivingAddress(data.getAddress());
 			}
 		}
+		if (byId.getOrderType()==1){
+			TGoods data = goodsClient.getGoodsById(byId.getGoodsId()).getData();
+			if (data!=null){
+				byId.setName(data.getName());
+			}
+		}else {
+		 TCoupon data = couponClient.getCouponById1(byId.getCouponId()).getData();
+		 if (data!=null){
+			 byId.setName(data.getName());
+		 }
+		}
 		return AjaxResult.success(byId);
 	}
 	
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TVipOrderController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TVipOrderController.java
index 909cf73..16b02cc 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TVipOrderController.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TVipOrderController.java
@@ -70,6 +70,8 @@
     @PostMapping("/addVipOrder")
     @ApiOperation(value = "添加会员订单", tags = {"管理后台-会员订单"})
     public R<Long> addVipOrder(@RequestBody TVipOrder dto) {
+        List<TVipOrder> list = vipOrderService.lambdaQuery().eq(TVipOrder::getCode, dto.getCode()).list();
+        if (!list.isEmpty())return R.fail("订单编号已存在");
         vipOrderService.saveOrUpdate(dto);
         return R.ok(dto.getId());
     }
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java
index 7d09d3d..d656ae9 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java
@@ -498,7 +498,7 @@
 			paymentOrder.setAmount(addChargingOrder.getPaymentAmount());
 			paymentOrder.setOpenId(appUser.getWxOpenid());
 			paymentOrder.setDescription("充电充值");
-			paymentOrder.setNotifyUrl("/order/t-charging-order/chargingOrderWXCallback");
+			paymentOrder.setNotifyUrl("/payment/wx/pay/notify");
 			Map<String, Object> data = wxPaymentClient.orderPay(paymentOrder).getData();
 			return AjaxResult.success(data);
 		}
@@ -717,7 +717,7 @@
 				model.setOut_trade_no(chargingOrder.getCode());
 				model.setOut_refund_no(chargingOrderRefund.getRefundCode());
 				model.setReason("充电失败,取消充电订单");
-				model.setNotify_url("/order/t-charging-order/chargingOrderStartupFailureWxRefund");
+				model.setNotify_url("/payment/wx/refund/notify");
 				WxPaymentRefundModel.RefundAmount amount = new WxPaymentRefundModel.RefundAmount();
 				amount.setRefund(rechargeAmount.multiply(new BigDecimal(100)).intValue());
 				amount.setTotal(rechargeAmount.multiply(new BigDecimal(100)).intValue());
@@ -1121,7 +1121,7 @@
 				model.setOut_trade_no(chargingOrder.getCode());
 				model.setOut_refund_no(chargingOrderRefund.getRefundCode());
 				model.setReason("充电完成退款");
-				model.setNotify_url("/order/t-charging-order/chargingOrderStartupFailureWxRefund");
+				model.setNotify_url("/payment/wx/refund/notify");
 				WxPaymentRefundModel.RefundAmount amount = new WxPaymentRefundModel.RefundAmount();
 				amount.setRefund(refundAmount.multiply(new BigDecimal(100)).intValue());
 				amount.setTotal(rechargeAmount.multiply(new BigDecimal(100)).intValue());
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TShoppingOrderServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TShoppingOrderServiceImpl.java
index 36e040b..30d8358 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TShoppingOrderServiceImpl.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TShoppingOrderServiceImpl.java
@@ -584,6 +584,7 @@
                     if (data1!=null){
                         tShoppingOrder.setName(data1.getName());
                     }
+                    tShoppingOrder.setStatus(3);
                     break;
             }
             if (tShoppingOrder.getAppUserId() != null){
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TVipOrderServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TVipOrderServiceImpl.java
index 2e2f137..0ed6754 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TVipOrderServiceImpl.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TVipOrderServiceImpl.java
@@ -3,6 +3,8 @@
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ruoyi.account.api.dto.GiveVipDto;
+import com.ruoyi.account.api.feignClient.AppUserClient;
+import com.ruoyi.account.api.model.TAppUser;
 import com.ruoyi.common.core.web.page.PageInfo;
 import com.ruoyi.order.api.model.TShoppingOrder;
 import com.ruoyi.order.api.model.TVipOrder;
@@ -33,6 +35,8 @@
 
     @Resource
     private VipClient vipClient;
+    @Resource
+    private AppUserClient appUserClient;
     @Override
     public PageInfo<TVipOrder> pageList(VipShoppingOrderQuery query) {
         String startTime1 = null;
@@ -50,9 +54,12 @@
             tVipOrder.setUid(tVipOrder.getId().toString());
             tVipOrder.setUserUid(tVipOrder.getAppUserId().toString());
             TVip data = vipClient.getInfo(tVipOrder.getVipId()).getData();
+
             if (data!=null){
                 tVipOrder.setName(data.getName());
             }
+            TAppUser data1 = appUserClient.getUserById(tVipOrder.getAppUserId()).getData();
+            if (data1!=null)tVipOrder.setUserPhone(data1.getPhone());
         }
         pageInfo.setRecords(list);
         return pageInfo;
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/util/task/TaskUtil.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/util/task/TaskUtil.java
new file mode 100644
index 0000000..a79ee1a
--- /dev/null
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/util/task/TaskUtil.java
@@ -0,0 +1,120 @@
+package com.ruoyi.order.util.task;
+
+import com.alibaba.fastjson2.util.UUIDUtils;
+import com.alibaba.nacos.common.utils.UuidUtils;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.ruoyi.chargingPile.api.feignClient.SiteClient;
+import com.ruoyi.chargingPile.api.model.Site;
+import com.ruoyi.order.api.model.TChargingBill;
+import com.ruoyi.order.service.TChargingBillService;
+import org.apache.logging.log4j.core.util.UuidUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Random;
+import java.util.stream.Collectors;
+
+/**
+ * @author zhibing.pu
+ * @date 2023/7/11 8:39
+ */
+@Component
+public class TaskUtil {
+
+    @Resource
+    private TChargingBillService chargingBillService;
+    @Resource
+    private SiteClient siteClient;
+
+    public static void main(String[] args) {
+        LocalDate firstDayOfLastMonth = LocalDate.now().minusMonths(1).
+                withDayOfMonth(2);
+        String string = firstDayOfLastMonth.toString();
+        // 将-替换为空字符串
+        string = string.replace("-", "");
+        System.err.println(string);
+    }
+    // 每月2号凌晨12点执行的定时任务
+    @Scheduled(cron = "0 0 0 2 * ?")
+    public void taskMonth() {
+        try {
+            // 获取上个月的开始和结束日期
+            LocalDate firstDayOfLastMonth = LocalDate.now().minusMonths(1).
+                    withDayOfMonth(2);
+            String string = firstDayOfLastMonth.toString();
+            // 将-替换为空字符串
+            string = string.replace("-", "");
+            // 生成一次全站订单
+            TChargingBill tChargingBill = new TChargingBill();
+            // 订单生成规则JSD+20231201(账单所属月份)+1131304205(随机10位数)+001(当月账单序号,每月重置)
+            Random random = new Random();
+            String randomDigits = random.ints(10, 0, 10) // 生成10个随机数字,范围在0-9
+                    .mapToObj(String::valueOf)
+                    .collect(Collectors.joining()); // 将其连接成一个字符串
+            tChargingBill.setCode("JSD"+string+randomDigits+"001" );
+            tChargingBill.setType(1);
+            tChargingBill.setBillTime(LocalDateTime.now());
+            tChargingBill.setStatus(1);
+            tChargingBill.setOrderState(2);
+            chargingBillService.save(tChargingBill);
+            // 每月二号给每个站点生成上月账单
+            List<Integer> collect = siteClient.getSiteAll().getData().stream().map(Site::getId).collect(Collectors.toList());
+            List<TChargingBill> tChargingBills = new ArrayList<>();
+            for (int i = 1; i <= collect.size(); i++) {
+                TChargingBill tChargingBill1 = new TChargingBill();
+                Random random1 = new Random();
+                String randomDigits1 = random1.ints(10, 0, 10) // 生成10个随机数字,范围在0-9
+                        .mapToObj(String::valueOf)
+                        .collect(Collectors.joining()); // 将其连接成一个字符串
+                tChargingBill1.setCode("JSD"+string+randomDigits1+i );
+                tChargingBill1.setType(2);
+                tChargingBill1.setSiteId(collect.get(i));
+                tChargingBill1.setBillTime(LocalDateTime.now());
+                tChargingBill1.setStatus(1);
+                tChargingBill1.setOrderState(2);
+                tChargingBills.add(tChargingBill1);
+            }
+            if (!tChargingBills.isEmpty())chargingBillService.saveBatch(tChargingBills);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+    // 每个月最后一天23点执行的定时任务
+    @Scheduled(cron = "0 0 23 L * ?")
+    public void taskLastDay() {
+        try {
+            // 获取上个月的开始和结束日期
+            LocalDate firstDayOfLastMonth = LocalDate.now().minusMonths(1).
+                    withDayOfMonth(1);
+            LocalDate lastDayOfLastMonth = LocalDate.now().minusMonths(1).
+                    withDayOfMonth(firstDayOfLastMonth.lengthOfMonth());
+            // 将 LocalDate 转换为 LocalDateTime,并设定时间为一天的开始
+            LocalDateTime startDateTime = firstDayOfLastMonth.atStartOfDay();
+            LocalDateTime endDateTime = lastDayOfLastMonth.atTime(23, 59, 59); // 设定到最后一秒
+            // 构建查询条件
+            LambdaQueryWrapper<TChargingBill> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.ge(TChargingBill::getBillTime,
+                            Date.from(startDateTime.atZone(ZoneId.systemDefault()).toInstant()))
+                    .le(TChargingBill::getBillTime,
+                            Date.from(endDateTime.atZone(ZoneId.systemDefault()).toInstant())); // 使用 le 包括最后一天的记录
+            List<TChargingBill> list = chargingBillService.list(queryWrapper);
+            for (TChargingBill tChargingBill : list) {
+                tChargingBill.setStatus(2);
+            }
+            chargingBillService.updateBatchById(list);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+}
diff --git a/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TChargingOrderMapper.xml b/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TChargingOrderMapper.xml
index d5d5760..ed7f52c 100644
--- a/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TChargingOrderMapper.xml
+++ b/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TChargingOrderMapper.xml
@@ -109,12 +109,11 @@
         </if>
     </select>
     <select id="payOrderQuery" resultType="com.ruoyi.order.dto.PayOrderDto">
-        SELECT * FROM (SELECT
+        SELECT o.*,i.phone FROM (SELECT
         id,
         `code`,
         1 as type,
         title,
-        phone,
         `status`,
         order_amount,
         payment_amount ,
@@ -123,7 +122,8 @@
         pay_time,
         refund_status,
         (payment_amount-refund_amount) as final_amount,
-        del_flag
+        del_flag,
+        app_user_id
         FROM
         charging_pile_order.t_charging_order
         where  recharge_payment_status = 2
@@ -133,7 +133,6 @@
         `code`,
         2 as type,
         title,
-        phone,
         `status`,
         order_amount,
         payment_amount ,
@@ -142,7 +141,8 @@
         pay_time,
         refund_status,
         (payment_amount-refund_amount) as final_amount,
-        del_flag
+        del_flag,
+        app_user_id
         FROM
         charging_pile_order.t_shopping_order
         where payment_status = 2
@@ -152,7 +152,6 @@
         `code`,
         3 as type,
         title,
-        phone,
         payment_status AS `status`,
         order_amount,
         payment_amount ,
@@ -161,7 +160,8 @@
         pay_time,
         refund_status,
         (payment_amount-refund_amount) as final_amount,
-        del_flag
+        del_flag,
+        app_user_id
 
         FROM
         charging_pile_order.t_vip_order
@@ -172,7 +172,6 @@
         `code`,
         4 as type,
         title,
-        phone,
         `status`,
         order_amount ,
         order_amount as payment_amount,
@@ -181,9 +180,11 @@
         out_parking_time as pay_time,
         null as refund_status,
         0 as final_amount,
-        0 as del_flag
+        0 as del_flag,
+        app_user_id
         FROM
         charging_pile_service.t_parking_record ) o
+        LEFT JOIN  `charging_pile_account`.`t_app_user` i on o.app_user_id = i.id
                 <where>
                     o.del_flag = 0
                     <if test="data.code != null and data.code != ''">
@@ -207,6 +208,13 @@
                             #{id}
                         </foreach>
                     </if>
+                    <if test="data.isRefund == 1">
+                        AND o.refund_status is not null
+                    </if>
+                    <if test="data.isRefund == 1">
+                        AND o.refund_status is null
+                    </if>
+
                 </where>
         ORDER BY o.create_time desc
 
@@ -226,7 +234,9 @@
         re.refund_remark,
         co.recharge_serial_number as serail_number,
         co.payment_amount,
-        co.pay_time
+        co.create_time as pay_time,
+        co.id as order_id,
+        co.app_user_id as user_id
         FROM t_charging_order_refund re
         LEFT JOIN t_charging_order  co ON re.charging_order_id = co.id
         UNION ALL
@@ -243,7 +253,9 @@
         re.refund_remark,
         so.serial_number,
         so.payment_amount,
-        so.pay_time
+        so.create_time as pay_time,
+        so.id as order_id,
+        so.app_user_id as user_id
         FROM t_shopping_order_refund re
         LEFT JOIN t_shopping_order so on re.shopping_order_id = so.id
         UNION ALL
@@ -260,7 +272,9 @@
         vr.refund_remark,
         vo.serial_number,
         vo.payment_amount,
-        vo.pay_time
+        vo.create_time as pay_time,
+        vo.id as order_id,
+        vo.app_user_id as user_id
         FROM t_vip_order_refund vr
         LEFT JOIN t_vip_order vo on vr.vip_order_id = vo.id
 
@@ -274,7 +288,7 @@
                 AND o.refund_code LIKE CONCAT('%',#{data.refundCode},'%')
             </if>
         </where>
-
+        order by o.refund_time desc
 
     </select>
     <select id="chargingOrderGroup" resultType="com.ruoyi.common.core.dto.ChargingOrderGroup">
@@ -1285,9 +1299,10 @@
         <if test="statisticsQueryDto.type == 2">
             end_time
         </if>
-        , '%Y-%m-%d %H' ) as time,
+        , '%H:00' ) as time,
 	SUM(service_charge) as servicecharge,
 	SUM(electrovalence) as electrovalence,
+    SUM(electricity) as electricity,
     count(1) as orderCount
         FROM
             t_charging_order
@@ -1323,10 +1338,10 @@
         , '%Y-%m-%d' ) as time,
         SUM(service_charge) as servicecharge,
         SUM(electrovalence) as electrovalence,
-        count(1) as orderCount
+        count(1) as orderCount,
+        SUM(electricity) as electricity
         FROM
         t_charging_order
-
         WHERE     del_flag = 0 and recharge_payment_status = 2  and DATE(
         <if test="statisticsQueryDto.type == 1">
             start_time
@@ -1358,7 +1373,8 @@
         , '%Y-%m' ) as time,
         SUM(service_charge) as servicecharge,
         SUM(electrovalence) as electrovalence,
-        count(1) as orderCount
+        count(1) as orderCount,
+        SUM(electricity) as electricity
         FROM
         t_charging_order
 
diff --git a/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TShoppingOrderMapper.xml b/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TShoppingOrderMapper.xml
index d19a9f2..9ca89fb 100644
--- a/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TShoppingOrderMapper.xml
+++ b/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TShoppingOrderMapper.xml
@@ -255,6 +255,7 @@
         </if>
         and t1.payment_status = 2
         AND t1.del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()}
+        order by t1.create_time desc
     </select>
     <select id="sixBefore" resultType="com.ruoyi.order.dto.SixShopDto">
         SELECT
@@ -305,17 +306,16 @@
         payment_amount
         FROM
         t_shopping_order
-        <where>
-            WHERE del_flag = 0 and payment_status = 2 and ISNULL(refund_status) and status!=4
+            WHERE del_flag = 0 and payment_status = 2 and ISNULL(refund_status) and status!=4 and
 
                 DATE_FORMAT(create_time, '%Y-%m-%d') between #{statisticsQueryDto.startTime} and #{statisticsQueryDto.endTime}
 
 
-        </where>
+
 
         ) AS subquery
         GROUP BY
-        DATE_FORMAT( subquery.create_time, '%Y-%m-%d' );
+        DATE_FORMAT( subquery.create_time, '%Y-%m-%d' )
 
 
     </select>
diff --git a/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TVipOrderMapper.xml b/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TVipOrderMapper.xml
index 70127f8..ca0b516 100644
--- a/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TVipOrderMapper.xml
+++ b/ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TVipOrderMapper.xml
@@ -44,7 +44,9 @@
         <if test="startTime1 != null and startTime1!=''">
             and (t1.create_time between #{startTime1} and #{startTime2}
         </if>
+        and t1.payment_status = 2
         AND t1.del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()}
+        order by t1.create_time desc
     </select>
     <select id="sixBefore" resultType="com.ruoyi.order.dto.SixVipDto">
         SELECT
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCompanyController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCompanyController.java
index d355f5c..36138e4 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCompanyController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCompanyController.java
@@ -31,7 +31,7 @@
 	public R<Page<TCompany>> unitPage(@RequestBody UnitListQueryDto unitListQueryDto) {
 		Page<TCompany> page = companyService.lambdaQuery()
 				.orderByDesc(TCompany::getCreateTime)
-				.like(unitListQueryDto.getCompanyName() != null && unitListQueryDto.getCompanyName().isEmpty(), TCompany::getName, unitListQueryDto.getCompanyName())
+				.like(unitListQueryDto.getCompanyName() != null && unitListQueryDto.getCompanyName()!="", TCompany::getName, unitListQueryDto.getCompanyName())
 				.page(Page.of(unitListQueryDto.getPageCurr(), unitListQueryDto.getPageSize()));
 		return R.ok(page);
 	}
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCouponController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCouponController.java
index 07d4925..9a00b7d 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCouponController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCouponController.java
@@ -35,6 +35,7 @@
 import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Objects;
@@ -180,6 +181,24 @@
     public AjaxResult<PageInfo<TCoupon>> pageList(@RequestBody CouponQuery dto) {
         return AjaxResult.ok(tCouponService.pageList(dto));
     }
+    @ApiOperation(tags = {"管理后台-优惠券管理"},value = "优惠券列表分页查询")
+    @PostMapping(value = "/pageList3")
+    public AjaxResult<List<TCoupon>> pageList() {
+        List<TCoupon> tCoupons = new ArrayList<>();
+
+        List<TCoupon> list = tCouponService.lambdaQuery().eq(TCoupon::getStatus, 1)
+                .orderByDesc(TCoupon::getCreateTime).list();
+        for (TCoupon tCoupon : list) {
+            if (tCoupon.getValidityPeriodMode()==1){
+                if (LocalDateTime.now().isBefore(tCoupon.getEndTime())){
+                    tCoupons.add(tCoupon);
+                }
+            }else{
+                tCoupons.add(tCoupon);
+            }
+        }
+        return AjaxResult.ok(tCoupons);
+    }
 
     /**
      * 小程序远程调用 获取优惠券信息
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TGoodsController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TGoodsController.java
index 97901b7..1eb1e82 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TGoodsController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TGoodsController.java
@@ -12,6 +12,7 @@
 import com.ruoyi.account.api.model.TAppUser;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.dto.AppGoodQuery;
+import com.ruoyi.common.core.dto.ExchangeBackDto;
 import com.ruoyi.common.core.dto.PointChangeDto;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.core.web.page.BasePage;
@@ -184,8 +185,7 @@
         return R.ok();
 
     }
-    @ApiOperation(tags = {"小程序-" +
-            "兑换商城"},value = "积分兑换商品")
+    @ApiOperation(tags = {"小程序-兑换商城"},value = "积分兑换商品")
     @PostMapping(value = "/app/shop")
     public AjaxResult<PageInfo<TGoods>> shop(@RequestBody ExchangeDto exchangeDto) {
         //检查当前用户积分是否够
@@ -201,6 +201,9 @@
             Long count = orderClient.getExchangeById(exchangeDto.getGoodId(), userId,exchangeDto.getGoodType()).getData();
             if (good.getLimitExchangeTimes() != -1 && count >= good.getLimitExchangeTimes()) {
                 return AjaxResult.error("当前用户已兑换"+count+"张");
+            }else {
+                //减少库存
+                good.setInventory(good.getInventory()-exchangeDto.getNum());
             }
         if (user.getPoints()<good.getRedeemPoints()){
             return AjaxResult.error("当前用户积分不足");
@@ -210,17 +213,21 @@
             point = coupon.getRedeemPoints();
 
             Long count = orderClient.getExchangeById(exchangeDto.getGoodId(), userId,exchangeDto.getGoodType()).getData();
-            if (coupon.getInventoryQuantity() != -1 && count >= coupon.getInventoryQuantity()) {
-                return AjaxResult.error("当前用户已到达兑换"+coupon+"次");
-            }
             if (user.getPoints()<point){
                 return AjaxResult.error("当前用户积分不足");
             }
+            if (coupon.getInventoryQuantity() != -1 && count >= coupon.getInventoryQuantity()) {
+                return AjaxResult.error("当前用户已到达兑换"+coupon+"次");
+            }else {
+                coupon.setInventoryQuantity(coupon.getInventoryQuantity()-exchangeDto.getNum());
+            }
+
+
         }
         exchangeDto.setPoint(point);
         exchangeDto.setUserId(userId);
         //生成积分兑换成功的订单
-        R<Long> longR = orderClient.exchangeCreate(exchangeDto);
+        R<ExchangeBackDto> longR = orderClient.exchangeCreate(exchangeDto);
         if (exchangeDto.getGoodType()==2) {
             TCoupon coupon = couponService.getById(exchangeDto.getGoodId());
 
@@ -247,6 +254,7 @@
         pointChangeDto.setPoints(point);
         pointChangeDto.setRemark(longR.getData().toString());
         pointChangeDto.setType(6);
+        pointChangeDto.setCode(longR.getData().getCode());
         appUserClient.changeDown(pointChangeDto);
         return AjaxResult.success();
 
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TUserTagController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TUserTagController.java
index cc28ef8..a4f5fa9 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TUserTagController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TUserTagController.java
@@ -37,7 +37,7 @@
     public R<Page<TUserTag>> page(@RequestBody TagListQueryDto tagListQueryDto) {
         Page<TUserTag> page = tUserTagService.lambdaQuery()
                 .orderByDesc(TUserTag::getCreateTime)
-                .like(tagListQueryDto.getTagName()!=null&& tagListQueryDto.getTagName().isEmpty(), TUserTag::getName, tagListQueryDto.getTagName())
+                .like(tagListQueryDto.getTagName()!=null&& tagListQueryDto.getTagName()!="", TUserTag::getName, tagListQueryDto.getTagName())
                 .page(Page.of(tagListQueryDto.getPageCurr(), tagListQueryDto.getPageSize()));
         return R.ok(page);
 
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java
index 797da3c..a6a0e64 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java
@@ -217,6 +217,8 @@
     }
 
 
+
+
     @ApiOperation(value = "购买会员", tags = {"小程序-个人中心"})
     @GetMapping("/vipInfo/pay")
     public R vipInfoPay(@RequestParam("vipId")Integer vipId,@RequestParam("buyType") Integer buyType,
diff --git a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TGoodsMapper.xml b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TGoodsMapper.xml
index fb2632b..8cb9cb5 100644
--- a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TGoodsMapper.xml
+++ b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TGoodsMapper.xml
@@ -45,6 +45,9 @@
             <if test="req.otherState != null and req.otherState == 2">
                 AND  inventory = 0
             </if>
+            <if test="req.otherState != null and req.otherState ==3">
+                AND  status = #{req.status}
+            </if>
             AND del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()}
         </where>
         ORDER BY create_time DESC
diff --git a/ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/controller/WxPayController.java b/ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/controller/WxPayController.java
index 6c834a0..3a1672f 100644
--- a/ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/controller/WxPayController.java
+++ b/ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/controller/WxPayController.java
@@ -3,6 +3,7 @@
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.order.api.feignClient.ChargingOrderClient;
 import com.ruoyi.order.api.feignClient.OrderClient;
 import com.ruoyi.payment.api.vo.PaymentOrder;
 import com.ruoyi.payment.api.vo.WxRefundNotifyResp;
@@ -37,6 +38,9 @@
 
     @Resource
     private OrderClient orderClient;
+    
+    @Resource
+    private ChargingOrderClient chargingOrderClient;
 
 
 
@@ -121,6 +125,7 @@
             log.info("支付回调:{}", params);
             String outRefundNo = (String) params.get("transaction_id");
             String out_trade_no = params.get("out_trade_no").toString();
+            String attach = params.get("attach").toString();
             String substring = out_trade_no.substring(0, 2);
             switch (substring){
                 //购物订单
@@ -131,6 +136,10 @@
                 case "HY":
                     orderClient.vipCallBack(out_trade_no,outRefundNo);
                     System.err.println("----收到会员回调");
+                    break;
+                case "CD":
+                    chargingOrderClient.chargingOrderWXCallback(out_trade_no, outRefundNo, attach);
+                    System.err.println("----充电支付回调");
                     break;
             }
 
@@ -180,6 +189,15 @@
             // 时间不对的话,可以调用  WxTimeUtils.toRfc3339Date(success_time)转换一下
             String success_time = params.get("success_time").toString();
             if (tradeState.equals(RefundEnum.SUCCESS.name())) {
+                String substring = out_refund_no.substring(0, 3);
+                switch (substring){
+                    //购物订单
+                    case "CDF":
+                        chargingOrderClient.chargingOrderStartupFailureWxRefund(out_refund_no, refund_id, tradeState, success_time);
+                        System.err.println("----充电启动失败退款回调通知");
+                        break;
+                }
+                
                 WxRefundNotifyResp resp = new WxRefundNotifyResp();
                 resp.setOut_trade_no(out_trade_no);
                 resp.setOut_refund_no(out_refund_no);

--
Gitblit v1.7.1