jiangqs
2023-06-07 fa960ac22a90b4d960865a66f88558924720d608
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java
@@ -83,6 +83,10 @@
    @Resource
    private ShopAuthenticationService shopAuthenticationService;
    @Resource
    private ShopProportionService shopProportionService;
    /**
     * 获取商户详情
@@ -220,6 +224,7 @@
            }
        }
        if(newShop){
            //商户账户信息初始化
            ShopAccount shopAccount = new ShopAccount();
            shopAccount.setShopId(shop.getShopId());
            shopAccount.setDelFlag(0);
@@ -228,13 +233,23 @@
            shopAccount.setTotalRefund(new BigDecimal("0"));
            shopAccount.setTotalProfitsharing(new BigDecimal("0"));
            shopAccount.setTotalMoney(new BigDecimal("0"));
            shopAccountService.saveOrUpdate(shopAccount);
            shopAccountService.save(shopAccount);
            //商户认证信息初始化
            String authId = IdUtils.simpleUUID();
            ShopAuthentication shopAuthentication = new ShopAuthentication();
            shopAuthentication.setAuthId(authId);
            shopAuthentication.setDelFlag(0);
            shopAuthentication.setShopId(shop.getShopId());
            shopAuthenticationService.saveOrUpdate(shopAuthentication);
            shopAuthenticationService.save(shopAuthentication);
            //商户分成信息初始化
            ShopProportion shopProportion = new ShopProportion();
            shopProportion.setDelFlag(0);
            shopProportion.setShopId(shop.getShopId());
            shopProportion.setShopType(shop.getShopType());
            shopProportion.setProportionPercent(new BigDecimal("100.00"));
            shopProportion.setUpdateTime(new Date());
            shopProportion.setUpdateUserId(MGTEditShopDto.getUserId());
            shopProportionService.save(shopProportion);
        }
    }