提交 9c243c1e authored 作者: 艾庆国's avatar 艾庆国

承运与无车承运对接

上级 65a11510
......@@ -73,6 +73,9 @@ public class OrderChildSyncTransportListener {
private final InvoicingCompanyService invoicingCompanyService;
private final SettlementConfig settlementConfig;
/**
* 承运同步网络货运运单
*/
@RabbitListener(queues = RabbitKeyConstants.ORDER_CHILD_SYNC_TRANSPORT_QUEUE)
public void onMessage(String message) {
OrderChild orderChild = JSONUtil.toBean(message, OrderChild.class);
......@@ -165,12 +168,15 @@ public class OrderChildSyncTransportListener {
settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO);
settlementOwnerDetail.setFinalPaymentStatus(SettlementOwnerDetailEnum.FinalPaymentStatus.NO.getCode());
}
} else {
}
else {
log.info("当前OrderChildSyncTransportListener监听同步网络货运失败,变为普通单,运单号{}, 错误信息{}", orderChild.getChildNo(), remark);
settlementDriverDetail.setPrepayFreightFlag(SettlementDriverEnum.PrepayFreightFlag.NO_PAY.getCode());
settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO);
settlementOwnerDetail.setFinalPaymentStatus(SettlementOwnerDetailEnum.FinalPaymentStatus.NO.getCode());
}
// 结算金额
settlementOwnerDetail.setSettlementFreight(settlementFreightCalc(orderChild.getSettlementWay(), settlementOwnerDetail));
if (SettlementOwnerEnum.InvoiceType.ORDINARY.getCode().equals(invoiceType)) {
......
......@@ -418,10 +418,7 @@ public class OrderChildServiceImpl implements OrderChildService {
// 平台服务费
orderChild.setPlatformServiceFeeRate(orderGoods.getPlatformServiceFeeRate());
orderChild.setPlatformServiceFee(orderChild.getPlatformServiceFeeRate()!=null
? orderChild.getFreight().multiply(orderChild.getPlatformServiceFeeRate())
.movePointLeft(2).setScale(0,RoundingMode.HALF_UP)
: null);
orderChild.setDeposit(orderGoods.getDeposit());
// 更新货单数据
......@@ -1169,7 +1166,6 @@ public class OrderChildServiceImpl implements OrderChildService {
orderChild.setStatus(OrderChildEnum.Status.UNSETTLE.getCode());
orderChild.setConfirmTime(LocalDateTime.now());
orderChildDao.updateDriverConfirm(orderChild);
// 更新车辆状态
......
......@@ -6,10 +6,7 @@ import com.clx.performance.config.MslPaymentConfig;
import com.clx.performance.constant.RedissonConstants;
import com.clx.performance.dao.OrderChildDao;
import com.clx.performance.dao.OrderGoodsDao;
import com.clx.performance.dao.settle.SettlementDriverDao;
import com.clx.performance.dao.settle.SettlementDriverDetailDao;
import com.clx.performance.dao.settle.SettlementOwnerDao;
import com.clx.performance.dao.settle.SettlementOwnerDetailDao;
import com.clx.performance.dao.settle.*;
import com.clx.performance.enums.OrderChildEnum;
import com.clx.performance.enums.OrderChildLogEnum;
import com.clx.performance.enums.PayRemarkEnum;
......@@ -20,10 +17,7 @@ import com.clx.performance.extranal.user.OrderService;
import com.clx.performance.extranal.user.OwnerInfoService;
import com.clx.performance.model.OrderChild;
import com.clx.performance.model.OrderGoods;
import com.clx.performance.model.settle.SettlementDriver;
import com.clx.performance.model.settle.SettlementDriverDetail;
import com.clx.performance.model.settle.SettlementOwner;
import com.clx.performance.model.settle.SettlementOwnerDetail;
import com.clx.performance.model.settle.*;
import com.clx.performance.param.pc.payment.PayParam;
import com.clx.performance.service.OrderChildLogService;
import com.clx.performance.service.PaymentService;
......@@ -94,6 +88,9 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic
@Autowired
private OrderChildDao orderChildDao;
@Autowired
private SettlementPlatformServiceFeeDao settlementPlatformServiceFeeDao;
@Autowired
private OrderChildLogService orderChildLogService;
......@@ -200,8 +197,30 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic
@Transactional(rollbackFor = Exception.class)
public void settlementDetailAdd(SettlementDetailAddMqParam mq) {
SettlementOwnerDetail settlementOwnerDetail = settlementOwnerDetailDao.getEntityByKey(mq.getSettlementOwnerDetailId()).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
//SettlementDriverDetail settlementDriverDetail = settlementDriverDetailDao.getEntityByKey(mq.getSettlementDriverDetailId()).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
SettlementDriverDetail settlementDriverDetail = settlementDriverDetailDao.getEntityByKey(mq.getSettlementDriverDetailId()).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
OrderChild orderChild = orderChildDao.getByChildNo(settlementDriverDetail.getChildNo()).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
SettlementPlatformServiceFee settlementPlatformServiceFee = new SettlementPlatformServiceFee();
settlementPlatformServiceFee.setChildNo(settlementDriverDetail.getChildNo());
settlementPlatformServiceFee.setDriverUserNo(settlementDriverDetail.getDriverUserNo());
settlementPlatformServiceFee.setDriverName(settlementDriverDetail.getDriverName());
settlementPlatformServiceFee.setSendAddressId(orderChild.getSendAddressId());
settlementPlatformServiceFee.setSendAddress(orderChild.getSendAddress());
settlementPlatformServiceFee.setReceiveAddressId(orderChild.getReceiveAddressId());
settlementPlatformServiceFee.setReceiveAddress(orderChild.getReceiveAddress());
settlementPlatformServiceFee.setTruckNo(orderChild.getTruckNo());
settlementPlatformServiceFee.setSettlementFreight(settlementDriverDetail.getSettlementFreight());
settlementPlatformServiceFee.setInvoiceServiceFeeRate(settlementDriverDetail.getPlatformServiceFeeRate());
settlementPlatformServiceFee.setInvoiceServiceFee(settlementDriverDetail.getPlatformServiceFee());
// 平台服务费
orderChild.setPlatformServiceFee(settlementDriverDetail.getPlatformServiceFee());
orderChildDao.updatePlatformServiceFee(orderChild);
settlementPlatformServiceFeeDao.saveEntity(settlementPlatformServiceFee);
// 更新网络标识
settlementService.updateSettlementDetailInvoiceType(settlementOwnerDetail.getChildNo(), SettlementOwnerEnum.InvoiceType.ORDINARY.getCode());
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论