|
@@ -131,6 +131,17 @@ public class CmsAccountServiceImpl extends ServiceImpl<AccountMapper, Account> i
|
|
|
|
|
|
|
|
int accountSize = accountViews.size();
|
|
int accountSize = accountViews.size();
|
|
|
|
|
|
|
|
|
|
+ if (accountSize < customerSize) {
|
|
|
|
|
+ accountViews.forEach(account->{
|
|
|
|
|
+ int randomIndex = RandomUtil.randomInt(customerSize);
|
|
|
|
|
+ CmsUserVO customer = customers.get(randomIndex);
|
|
|
|
|
+ accountMapper.update(null, Wrappers.lambdaUpdate(Account.class)
|
|
|
|
|
+ .set(Account::getCustomerServiceId, customer.getId())
|
|
|
|
|
+ .eq(Account::getId, account.getId()));
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
int num = accountSize / customerSize;
|
|
int num = accountSize / customerSize;
|
|
|
|
|
|
|
|
int remain = accountSize % customerSize;
|
|
int remain = accountSize % customerSize;
|