Procházet zdrojové kódy

商家结算卡信息

guomengjiao před 3 měsíci
rodič
revize
3dc6981702

+ 1 - 0
ruoyi-api/src/main/java/com/ruoyi/api/controller/shop/ApiShopOrderController.java

@@ -134,6 +134,7 @@ public class ApiShopOrderController extends AbstractApiController {
             if (!shopOrderVo.getUserId().equals(userId)) {
                 throw new ServiceException("无权限访问");
             }
+            shopOrderVo.loadCustomerServicePhone();
             shopOrderVo.loadOrderAddress();
             shopOrderVo.loadOrderSelfPickup();
             shopOrderVo.loadOrderPackages();

+ 2 - 0
ruoyi-business/src/main/java/com/ruoyi/business/service/IBusinessService.java

@@ -153,4 +153,6 @@ public interface IBusinessService {
     String queryInviteCodeById(Long businessId);
 
     List<Long> queryBusinessIdsByBusinessId(Long businessId);
+
+    String loadCustomerServicePhone(Long businessId);
 }

+ 6 - 0
ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BusinessServiceImpl.java

@@ -738,4 +738,10 @@ public class BusinessServiceImpl implements IBusinessService {
         return baseMapper.queryBusinessIdsByBusinessId(businessId);
     }
 
+    @Override
+    public String loadCustomerServicePhone(Long businessId) {
+        Business business = baseMapper.selectOne(new LambdaQueryWrapper<Business>().select(Business::getCustomerServicePhone).eq(Business::getBusinessId, businessId));
+        return ObjectUtil.isNotNull(business) ? business.getCustomerServicePhone() : null;
+    }
+
 }

+ 11 - 0
ruoyi-shop/src/main/java/com/ruoyi/shop/order/domain/vo/ShopOrderVo.java

@@ -608,6 +608,17 @@ public class ShopOrderVo extends BaseVo {
     @ApiModelProperty("订单地址")
     private ShopOrderAddressVo orderAddress;
 
+    @ApiModelProperty("商家客服电话")
+    private String customerServicePhone;
+
+    public String loadCustomerServicePhone() {
+        if (customerServicePhone == null) {
+            IBusinessService businessService = SpringUtil.getBean("businessService", IBusinessService.class);
+            customerServicePhone = businessService.loadCustomerServicePhone(this.getBusinessId());
+        }
+        return customerServicePhone;
+    }
+
     public ShopOrderAddressVo loadOrderAddress() {
         if (orderAddress == null) {
             IShopOrderAddressService shopOrderAddressService = SpringUtil.getBean("shopOrderAddressServiceImpl", IShopOrderAddressService.class);