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..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
@@ -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,26 @@ public class PhoneRecordServiceImpl implements PhoneRecordService {
         // 校验存在
         validatePhoneRecordExists(id);
         // 删除
-        phoneRecordMapper.delete(Wrappers.lambdaQuery().eq(PhoneRecordDO::getRechargeOrderId, id));
+        phoneRecordMapper.deleteById(id);;
+    }
+
+    @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);
+                int i = phoneRecordMapper.updateById(e);
+                log.info("-------------------------i{}---------------------",i);
+            });
+        }
+        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) {
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