Forráskód Böngészése

fix 客服分配过期账号

zoujiajian 3 éve
szülő
commit
72d0eec2b2

+ 11 - 0
netflix-service/src/main/java/com/cyksj/service/mange/account/CmsAccountServiceImpl.java

@@ -131,6 +131,17 @@ public class CmsAccountServiceImpl extends ServiceImpl<AccountMapper, Account> i
 
 		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 remain = accountSize % customerSize;