提交 25295cb4 authored 作者: liuhaiquan's avatar liuhaiquan

Merge remote-tracking branch 'origin/v10.7_borrowing_and_repayment_20240118'…

Merge remote-tracking branch 'origin/v10.7_borrowing_and_repayment_20240118' into v10.7_borrowing_and_repayment_20240118
......@@ -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,25 +139,27 @@ 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})
public void listen(OrderChildCancelEvent event) {
log.info("OrderChildCancelEvent事件执行");
List<String> childNoList = event.getChildNoList();
log.info("需要解冻借款的的运单号:{}", JSONUtil.parse(childNoList));
String childNo = event.getChildNo();
log.info("需要解冻借款的的运单号:{}", childNo);
List<OwnerLoanAccountRunningWaterRecord> runningWaterRecordList = ownerLoanAccountRunningWaterRecordDao.getListByChildNoAndRunningWaterType(childNoList, OwnerLoanAccountRunningWaterRecordEnum.RunWaterType.APPROVE_FROZEN.getCode());
List<OwnerLoanAccountRunningWaterRecord> runningWaterRecordList = ownerLoanAccountRunningWaterRecordDao.getListByChildNoAndRunningWaterType(childNo, OwnerLoanAccountRunningWaterRecordEnum.RunWaterType.APPROVE_FROZEN.getCode());
if (CollectionUtil.isEmpty(runningWaterRecordList)) {
return;
......@@ -173,7 +172,6 @@ public class EventListenerComponent {
Long loanNo = record.getLoanNo();
Integer loanType = record.getLoanType();
String ownerUserName = record.getOwnerUserName();
String childNo = record.getChildNo();
BigDecimal balance = record.getAlterationBalance();
//解冻借款
orderChildLoanComponent.thawOwnerLoanAccount(loanNo, loanType, ownerUserNo, record.getMobile(), ownerUserName, childNo, balance);
......
......@@ -11,7 +11,7 @@ import java.util.List;
public class OrderChildCancelEvent extends ApplicationEvent {
private List<String> childNoList;
private String childNo;
/**
......@@ -24,9 +24,10 @@ public class OrderChildCancelEvent extends ApplicationEvent {
super(source);
}
public OrderChildCancelEvent(Object source, List<String> childNoList) {
public OrderChildCancelEvent(Object source, String childNo) {
super(source);
this.childNoList = childNoList;
this.childNo = childNo;
}
}
......@@ -13,6 +13,7 @@ import com.clx.performance.constant.RabbitKeyConstants;
import com.clx.performance.dto.dts.DataTransportDTO;
import com.clx.performance.enums.DtsOperationTypeEnum;
import com.clx.performance.enums.OrderChildEnum;
import com.clx.performance.event.OrderChildCancelEvent;
import com.clx.performance.model.OrderChild;
import com.clx.performance.service.LastTruckService;
import com.clx.performance.struct.OrderChildStruct;
......@@ -23,6 +24,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;
import java.util.Objects;
......@@ -44,6 +46,9 @@ public class OrderChildDtsListener {
@Autowired
OrderChildStruct orderChildStruct;
@Autowired
private ApplicationEventPublisher applicationEventPublisher;
@RabbitListener(queues = RabbitKeyConstants.CLX_PERFORMANCE_ORDER_CHILD_QUEUE)
public void onMessage(Message message) {
......@@ -91,6 +96,10 @@ public class OrderChildDtsListener {
//如果订单是取消操作,同步给交易平台统一 10000 的code
if(OrderChildEnum.DTS_LISTEN_CANCEL_lIST.contains(after.getStatus())){
after.setStatus(com.clx.open.sdk.enums.OrderChildEnum.Status.COMMON_CANCEL.getCode());
//运单取消释放借款冻结金额
log.info("DTS运单取消释放借款冻结金额");
applicationEventPublisher.publishEvent(new OrderChildCancelEvent(this, after.getChildNo()));
}
after.setLastFlag(ResultStatusEnum.NO.getCode());
OpenCallBackClient client = new OpenCallBackClient(mslAppConfig.getUrl(),mslAppConfig.getAppId(),mslAppConfig.getSecret());
......
......@@ -109,7 +109,7 @@ public class OwnerLoanAccountServiceImpl implements OwnerLoanAccountService {
OwnerRepayment ownerRepayment = ownerRepaymentDao.getOneByField(OwnerRepayment::getRepaymentNo, param.getRepaymentNo()).get();
OwnerLoanRecord ownerLoanRecord = ownerLoanRecordDao.getOneByField(OwnerLoanRecord::getLoanNo, ownerRepayment.getLoanNo()).get();
BankTrade bankTrade = new BankTrade();
OwnerBindCardRecord ownerBindCardRecord = ownerBindCardRecordDao.getOwnerBindCardByUserNo(ownerRepayment.getLoanNo());
OwnerBindCardRecord ownerBindCardRecord = ownerBindCardRecordDao.getOwnerBindCardByUserNo(ownerRepayment.getOwnerUserNo());
if (OwnerLoanRecordEnum.PayChannel.ORDER_DIRECT_PAY.getCode().equals(param.getPayChannel())) {
// 订单支付
......@@ -132,7 +132,7 @@ public class OwnerLoanAccountServiceImpl implements OwnerLoanAccountService {
ownerRepayment.setStatus(OwnerLoanRecordEnum.Status.PAYING.getCode());
ownerRepayment.setPayChannel(param.getPayChannel());
OwnerInfoFeignVO ownerInfo = ownerInfoService.getOwnerInfo(TokenUtil.getLoginUserInfo().getUserNo());
ownerRepayment.setPayment(ownerInfo.getName());
ownerRepayment.setPayment(ownerBindCardRecord.getAccountBankName());
ownerRepayment.setPaymentAccount(ownerInfo.getOwnerBankAccount());
ownerRepayment.setOperateBy(TokenUtil.getLoginUserInfo().getUserName());
......
......@@ -354,6 +354,7 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic
settlementOwner.setLossFreight(settlementOwnerDetail.getLossFreight());
settlementOwner.setPrepayFreight(settlementOwnerDetail.getPrepayFreight());
settlementOwner.setSettlementFreight(settlementOwnerDetail.getSettlementFreight());
settlementOwner.setLoanFreight(settlementOwnerDetail.getLoanFreight());
settlementOwner.setInvoiceFreight(settlementOwnerDetail.getInvoiceFreight());
List<SettlementOwnerDetail> details = settlementOwnerDetailDao.getBySettlementNo(settlementOwner.getSettlementNo());
......@@ -431,6 +432,7 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic
settlementOwner.setWeight(settlementOwnerDetail.getWeight());
settlementOwner.setFreight(settlementOwnerDetail.getFreight());
settlementOwner.setLossWeight(settlementOwnerDetail.getLossWeight());
settlementOwner.setLoanFreight(settlementOwnerDetail.getLoanFreight());
settlementOwner.setLossFreight(settlementOwnerDetail.getLossFreight());
settlementOwner.setPrepayFreight(settlementOwnerDetail.getPrepayFreight());
settlementOwner.setSettlementFreight(settlementOwnerDetail.getSettlementFreight());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论