|
@@ -853,19 +853,22 @@ public class CoreServiceImpl implements CoreService {
|
|
|
//额外发送
|
|
|
for (AccountSpecialSettings accountSpecialSetting : sendAccountSpecialSettings) {
|
|
|
List<PlanAccount> specialPlanAccount = planAccountService.getSpecialPlanAccount(accountSpecialSetting.getAccountId());
|
|
|
- if (!CollectionUtils.isEmpty(specialPlanAccount)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- List<PlanAccount> planAccountList = planAccountService.getNormalPlanAccount(accountSpecialSetting.getAccountId());
|
|
|
- if (CollectionUtils.isEmpty(planAccountList)) {
|
|
|
- continue;
|
|
|
+ if (CollectionUtils.isEmpty(specialPlanAccount)) {
|
|
|
+ List<PlanAccount> planAccountList = planAccountService.getNormalPlanAccount(accountSpecialSetting.getAccountId());
|
|
|
+ if (CollectionUtils.isEmpty(planAccountList)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ Optional<PlanAccount> firstAccount = planAccountList.stream().min((a1, a2) -> -a1.getPublishNum().compareTo(a2.getPublishNum()));
|
|
|
+ PlanAccount targetPlanAccount = firstAccount.get();
|
|
|
+ updateAccountSetting(accountSpecialSetting, targetPlanAccount);
|
|
|
+ targetPlanAccount.setIsSpecialSetting(1);
|
|
|
+ targetPlanAccount.setId(null);
|
|
|
+ planAccountService.saveOrUpdatePlanAccount(targetPlanAccount);
|
|
|
+ } else {
|
|
|
+ PlanAccount planAccount = specialPlanAccount.get(0);
|
|
|
+ updateAccountSetting(accountSpecialSetting, planAccount);
|
|
|
+ planAccountService.saveOrUpdatePlanAccount(planAccount);
|
|
|
}
|
|
|
- Optional<PlanAccount> firstAccount = planAccountList.stream().min((a1, a2) -> -a1.getPublishNum().compareTo(a2.getPublishNum()));
|
|
|
- PlanAccount targetPlanAccount = firstAccount.get();
|
|
|
- updateAccountSetting(accountSpecialSetting, targetPlanAccount);
|
|
|
- targetPlanAccount.setIsSpecialSetting(1);
|
|
|
- targetPlanAccount.setId(null);
|
|
|
- planAccountService.saveOrUpdatePlanAccount(targetPlanAccount);
|
|
|
}
|
|
|
}
|
|
|
|