From 88c8c3e459e7fbf62682408ba4fcff25b8e2f244 Mon Sep 17 00:00:00 2001 From: tangqian Date: Thu, 25 May 2023 17:44:35 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E5=85=85=E5=80=BC=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/notify/WxPayNotifyController.java | 2 +- .../order/impl/StoreOrderServiceImpl.java | 2 +- .../service/recharge/PhoneRecordService.java | 11 +++++++++++ .../recharge/PhoneRecordServiceImpl.java | 18 +++++++++++++++--- .../recharge/RechargeOrderServiceImpl.java | 10 +++++++++- 5 files changed, 37 insertions(+), 6 deletions(-) diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/notify/WxPayNotifyController.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/notify/WxPayNotifyController.java index 5fb07fcf5..c6fb90d34 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/notify/WxPayNotifyController.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/notify/WxPayNotifyController.java @@ -147,7 +147,7 @@ public class WxPayNotifyController { //删除提报记录 phoneRecordService.deletePhoneGear(orderDO.getOrderId()); //删除本地提报记录 - phoneRecordService.deletePhoneRecord(orderDO.getId()); + phoneRecordService.deletePhoneGearByOrderId(orderDO.getId()); // 修改订单状态 // 写入 response.setStatus(HttpServletResponse.SC_OK); diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java index cbbb3d003..ecccfd747 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java @@ -1227,7 +1227,7 @@ public class StoreOrderServiceImpl extends ServiceImpl */ Boolean deletePhoneGear(String orderId); + /** + *
+     * deletePhoneGear
+     * Description:删除档位信息
+     * @author: zenghuapei
+     * @date: 2023/5/24 12:44
+     * @return
+     * 
+ */ + Boolean deletePhoneGearByOrderId(Long orderId); /** *
     * insertPhone
diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/PhoneRecordServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/PhoneRecordServiceImpl.java
index 1a818f28b..2fef75a26 100644
--- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/PhoneRecordServiceImpl.java
+++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/PhoneRecordServiceImpl.java
@@ -18,6 +18,7 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 
+import org.springframework.util.CollectionUtils;
 import org.springframework.validation.annotation.Validated;
 
 import java.util.*;
@@ -76,12 +77,23 @@ public class PhoneRecordServiceImpl implements PhoneRecordService {
         // 校验存在
         validatePhoneRecordExists(id);
         // 删除
-        phoneRecordMapper.delete(Wrappers.lambdaQuery().eq(PhoneRecordDO::getRechargeOrderId, id));
+        phoneRecordMapper.deleteById(id);;
+    }
+
+    @Override
+    public Boolean deletePhoneGearByOrderId(Long orderId) {
+        List recordDOS = phoneRecordMapper.selectList(Wrappers.lambdaQuery().eq(PhoneRecordDO::getRechargeOrderId, orderId));
+        if (!CollectionUtils.isEmpty(recordDOS)) {
+            recordDOS.forEach(e->{
+                e.setDeleted(Boolean.TRUE);
+                phoneRecordMapper.updateById(e);
+            });
+        }
+        return null;
     }
 
     private void validatePhoneRecordExists(Long id) {
-        PhoneRecordDO phoneRecordDO = phoneRecordMapper.selectOne(Wrappers.lambdaQuery().eq(PhoneRecordDO::getRechargeOrderId, id));
-        if (phoneRecordDO == null) {
+        if (phoneRecordMapper.selectById(id) == null) {
             throw exception(PHONE_RECORD_NOT_EXISTS);
         }
     }
diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java
index 8813f9654..d3fc5ad04 100644
--- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java
+++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java
@@ -2,12 +2,15 @@ package cn.iocoder.yudao.module.shop.service.recharge;
 
 import cn.iocoder.yudao.framework.security.core.LoginUser;
 import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
+import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
+import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
 import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderInfoDO;
 import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeOrderInfoMapper;
 import cn.iocoder.yudao.module.shop.request.member.RefundRequest;
 import cn.iocoder.yudao.module.shop.response.member.MemberHeadResponse;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -44,6 +47,10 @@ public class RechargeOrderServiceImpl implements RechargeOrderService {
     private RechargeOrderMapper rechargeOrderMapper;
     @Resource
     private RechargeOrderInfoMapper infoMapper;
+    @Resource
+    private MemberUserApi userService;
+    @Resource
+    private PhoneRecordService phoneRecordService;
 
     @Override
     public Long createRechargeOrder(RechargeOrderCreateReqVO createReqVO) {
@@ -151,7 +158,8 @@ public class RechargeOrderServiceImpl implements RechargeOrderService {
         MemberHeadResponse response = new MemberHeadResponse();
         LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
         Assert.notNull(loginUser, "登录失效,请重新登录!");
-        List orderDOS = rechargeOrderMapper.selectList(Wrappers.lambdaQuery().eq(RechargeOrderDO::getUid, loginUser.getId()).eq(RechargeOrderDO::getPaid, 1));
+        MemberUserRespDTO user = userService.getUser(loginUser.getId());
+        List orderDOS = rechargeOrderMapper.selectList(Wrappers.lambdaQuery().eq(RechargeOrderDO::getUserPhone, user.getMobile()).eq(RechargeOrderDO::getPaid, 1));
         if (!CollectionUtils.isEmpty(orderDOS)) {
             BigDecimal amount = new BigDecimal("0");
             for (RechargeOrderDO orderDO : orderDOS) {

From 65a76c4efdc938cf29bdd9338cfe83b9af26d968 Mon Sep 17 00:00:00 2001
From: tangqian 
Date: Thu, 25 May 2023 18:05:56 +0800
Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E5=85=85=E5=80=BC=E7=9B=B8=E5=85=B3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../module/shop/service/recharge/PhoneRecordServiceImpl.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/PhoneRecordServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/PhoneRecordServiceImpl.java
index 2fef75a26..e10907369 100644
--- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/PhoneRecordServiceImpl.java
+++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/PhoneRecordServiceImpl.java
@@ -82,11 +82,14 @@ public class PhoneRecordServiceImpl implements PhoneRecordService {
 
     @Override
     public Boolean deletePhoneGearByOrderId(Long orderId) {
+        log.info("-------------------------orderId{}",orderId);
         List recordDOS = phoneRecordMapper.selectList(Wrappers.lambdaQuery().eq(PhoneRecordDO::getRechargeOrderId, orderId));
+        log.info("-------------------------recordDOS{},{}",recordDOS,recordDOS.size());
         if (!CollectionUtils.isEmpty(recordDOS)) {
             recordDOS.forEach(e->{
                 e.setDeleted(Boolean.TRUE);
-                phoneRecordMapper.updateById(e);
+                int i = phoneRecordMapper.updateById(e);
+                log.info("-------------------------i{}---------------------",i);
             });
         }
         return null;

From dc4c7504a79c0667042c5983331246598ad9e13c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B0=8F=E5=B0=8F=E5=BC=A0?= <1085577365@qq.com>
Date: Thu, 25 May 2023 18:08:07 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E5=90=8E=E5=8F=B0--=E8=BF=90=E8=B4=B9?=
 =?UTF-8?q?=E6=A8=A1=E6=9D=BF=EF=BC=9A=E9=85=8D=E9=80=81=E5=8C=BA=E5=9F=9F?=
 =?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../resources/mapper/express/ShippingTemplatesFreeMapper.xml    | 2 +-
 .../mapper/express/ShippingTemplatesNoDeliveryMapper.xml        | 2 +-
 .../resources/mapper/express/ShippingTemplatesRegionMapper.xml  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesFreeMapper.xml b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesFreeMapper.xml
index b82a15ce5..e6be679e1 100644
--- a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesFreeMapper.xml
+++ b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesFreeMapper.xml
@@ -14,7 +14,7 @@
                 FROM
                     eb_shipping_templates_free
                 where
-                    temp_id = #{tempId, jdbcType=INTEGER}
+                    temp_id = #{tempId, jdbcType=INTEGER} AND `status` = true
                 GROUP BY
                     `uniqid`
                 ORDER BY id ASC
diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesNoDeliveryMapper.xml b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesNoDeliveryMapper.xml
index 6b042f88e..f44c5a622 100644
--- a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesNoDeliveryMapper.xml
+++ b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesNoDeliveryMapper.xml
@@ -14,7 +14,7 @@
                 FROM
                     eb_shipping_templates_no_delivery
                 where
-                    temp_id = #{tempId, jdbcType=INTEGER}
+                    temp_id = #{tempId, jdbcType=INTEGER} AND `status` = true
                 GROUP BY
                     `uniqid`
                 ORDER BY id ASC
diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesRegionMapper.xml b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesRegionMapper.xml
index 1aefe98c4..ff7e60eb3 100644
--- a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesRegionMapper.xml
+++ b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesRegionMapper.xml
@@ -14,7 +14,7 @@
                 FROM
                     eb_shipping_templates_region
                 where
-                    temp_id = #{tempId, jdbcType=INTEGER}
+                    temp_id = #{tempId, jdbcType=INTEGER} AND `status` = true
                 GROUP BY
                     `uniqid`
                 ORDER BY id ASC