提交 ef9f72e7 authored 作者: huyufan's avatar huyufan

bug处理

上级 9fd8220a
......@@ -13,6 +13,7 @@ import com.msl.common.dao.impl.BaseDaoImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Objects;
import java.util.Set;
......@@ -61,7 +62,7 @@ public class SettlementDriverDaoImpl extends BaseDaoImpl<SettlementDriverMapper,
}
@Override
public void updateLoanFlagByChildNoList(Set<String> childNoList) {
public void updateLoanFlagByChildNoList(List<String> childNoList) {
update(lUdWrapper().in(SettlementDriver::getChildNo, childNoList)
.set(SettlementDriver::getLoanFlag, OwnerLoanRecordEnum.LoanFlag.RE_PAY.getCode())
);
......
......@@ -85,7 +85,7 @@ public class SettlementDriverDetailDaoImpl extends BaseDaoImpl<SettlementDriverD
}
@Override
public void updateLoanFlagByChildNoList(Set<String> childNoList) {
public void updateLoanFlagByChildNoList(List<String> childNoList) {
update(lUdWrapper()
.in(SettlementDriverDetail::getChildNo, childNoList)
.set(SettlementDriverDetail::getLoanFlag, OwnerLoanRecordEnum.LoanFlag.RE_PAY.getCode())
......
......@@ -7,6 +7,7 @@ import com.clx.performance.param.pc.driver.PageCarrierSettlementDriverParam;
import com.msl.common.base.Optional;
import com.msl.common.dao.BaseDao;
import java.util.List;
import java.util.Set;
/**
......@@ -21,5 +22,5 @@ public interface SettlementDriverDao extends BaseDao<SettlementDriverMapper, Set
Optional<SettlementDriver> getByChildNo(String childNo);
void updateLoanFlagByChildNoList(Set<String> childNoList);
void updateLoanFlagByChildNoList(List<String> childNoList);
}
......@@ -32,7 +32,7 @@ public interface SettlementDriverDetailDao extends BaseDao<SettlementDriverDetai
List<SettlementDriverDetail> findByDriverSettlementIds(List<Integer> ids);
void updateLoanFlagByChildNoList(Set<String> childNoList);
void updateLoanFlagByChildNoList(List<String> childNoList);
SettlementDriverDetail selectLoanFlag(String orderNo);
}
......@@ -38,10 +38,7 @@ import org.springframework.transaction.event.TransactionPhase;
import org.springframework.transaction.event.TransactionalEventListener;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.*;
import java.util.stream.Collectors;
@Component
......@@ -142,16 +139,18 @@ public class EventListenerComponent {
Map<String, List<OwnerLoanAccountRunningWaterRecord>> listMap = records.stream().collect(Collectors.groupingBy(OwnerLoanAccountRunningWaterRecord::getChildNo));
List<String> childNoList = new LinkedList<>();
for (Map.Entry<String, List<OwnerLoanAccountRunningWaterRecord>> entry : listMap.entrySet()) {
if (entry.getValue().size() > 1) {
log.info("当前运单{}存在多条流水,不更新还款标志", entry.getKey());
listMap.remove(entry.getKey());
if (entry.getValue().size() == 1) {
childNoList.add(entry.getKey());
} else {
log.info("当前运单:{} 存在多条运单流水记录,无法更新运单的贷款标识",entry.getKey());
}
}
log.info("当前需要更新的运单数量:{}", listMap.size());
settlementDriverDetailDao.updateLoanFlagByChildNoList(listMap.keySet());
settlementDriverDao.updateLoanFlagByChildNoList(listMap.keySet());
settlementDriverDetailDao.updateLoanFlagByChildNoList(childNoList);
settlementDriverDao.updateLoanFlagByChildNoList(childNoList);
}
@EventListener(classes = {OrderChildCancelEvent.class})
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论