|
|
|
@ -1170,7 +1170,19 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
|
|
|
|
|
String defaultBank = config.getRemainsTo();
|
|
|
|
|
clearingDetailMapper.updateAllBanks(defaultBank, clearingId);
|
|
|
|
|
List<JSONObject> details = clearingDetailMapper.listReportsOfSettlement(clearingId);
|
|
|
|
|
details.sort((log1, log2) -> log2.getBigDecimal("clearing_amount").compareTo(log1.getBigDecimal("clearing_amount")));
|
|
|
|
|
details.sort((log1, log2) -> {
|
|
|
|
|
if (StringUtils.equals(defaultBank, log1.getString("account_bank")) ==
|
|
|
|
|
StringUtils.equals(defaultBank, log2.getString("account_bank"))) {
|
|
|
|
|
//两个银行都是defaultBank或者都不是defaultBank, all true or all false,比较清算金额,金额大的在前
|
|
|
|
|
return log2.getBigDecimal("clearing_amount").compareTo(log1.getBigDecimal("clearing_amount"));
|
|
|
|
|
}
|
|
|
|
|
//有一个是defaultBank,defaultBank在后
|
|
|
|
|
if (defaultBank.equals(log1.getString("account_bank"))) {
|
|
|
|
|
return -1;
|
|
|
|
|
} else {
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
bankDistribution.remove(defaultBank);
|
|
|
|
|
for (String bank : bankDistribution.keySet()) {
|
|
|
|
|
List<String> detailIds = new ArrayList<>();
|
|
|
|
|