Преглед изворни кода

店铺入驻时绑定storeid

zhangchen пре 1 месец
родитељ
комит
ba89726169

+ 10 - 0
alien-store/src/main/java/shop/alien/store/service/impl/StoreInfoServiceImpl.java

@@ -157,6 +157,8 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
 
     private final StoreImgService storeImgService;
 
+    private final StorePaymentConfigService storePaymentConfigService;
+
     private final StoreOfficialAlbumMapper storeOfficialAlbumMapper;
 
     /**
@@ -1293,6 +1295,14 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         //修改门店店铺用户绑定关系
         String userAccount = storeInfoDto.getUserAccount();
         StoreUser storeUser = storeUserMapper.selectById(userAccount);
+
+        // 通过store_user_id查询支付配置并更新绑定store_id
+        StorePaymentConfig paymentConfig = storePaymentConfigService.getByStoreUserId(storeUser.getId());
+        if (paymentConfig != null) {
+            paymentConfig.setStoreId(storeInfo.getId());
+            storePaymentConfigService.updateById(paymentConfig);
+        }
+
         storeUser.setStoreId(storeInfo.getId());
         if (StringUtils.isNotEmpty(storeInfoDto.getStoreContact())) {
             storeUser.setName(storeInfoDto.getStoreContact());