提交 68413ebd authored 作者: huyufan's avatar huyufan

Merge remote-tracking branch 'origin/v6.5_transport_open_20231115' into test

...@@ -47,6 +47,21 @@ public enum SettlementDriverEnum { ...@@ -47,6 +47,21 @@ public enum SettlementDriverEnum {
} }
} }
@Getter
@AllArgsConstructor
public enum PrepayFreightFlag {
PAYED(1, "已预付"),
NO_PAY(0, "未预付");
private final Integer code;
private final String msg;
public static Optional<PrepayFreightFlag> getByCode(int code) {
return Arrays.stream(values()).filter(e -> Objects.equals(e.getCode(), code)).findFirst();
}
public static String getMsgByCode(int code) {
return getByCode(code).map(PrepayFreightFlag::getMsg).orElse(null);
}
}
} }
...@@ -149,7 +149,8 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic ...@@ -149,7 +149,8 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic
if (!settlementDriverDetail.getInvoiceType().equals(SettlementOwnerEnum.InvoiceType.ONLINE.getCode())) { if (!settlementDriverDetail.getInvoiceType().equals(SettlementOwnerEnum.InvoiceType.ONLINE.getCode())) {
paySettlementDriver(settlementDriverDetail); paySettlementDriver(settlementDriverDetail);
} else { } else {
if (settlementDriverDetail.getPrepayFreight().compareTo(BigDecimal.ZERO) > 0) { if (settlementDriverDetail.getPrepayFreightFlag().equals(SettlementDriverEnum.PrepayFreightFlag.PAYED.getCode())
&& settlementDriverDetail.getPrepayFreight().compareTo(BigDecimal.ZERO) > 0) {
settlementDriverDetail.setSettlementNo(settlementNo); settlementDriverDetail.setSettlementNo(settlementNo);
//插入同步网络货运待支付记录 //插入同步网络货运待支付记录
childSyncTransportRecordService.addOrderChildSyncTransportRecord(settlementDriverDetail); childSyncTransportRecordService.addOrderChildSyncTransportRecord(settlementDriverDetail);
......
...@@ -15,6 +15,7 @@ import com.clx.performance.enums.IdTypeEnum; ...@@ -15,6 +15,7 @@ import com.clx.performance.enums.IdTypeEnum;
import com.clx.performance.enums.NetworkDriverAccountEnum; import com.clx.performance.enums.NetworkDriverAccountEnum;
import com.clx.performance.enums.OwnerAccountEnum; import com.clx.performance.enums.OwnerAccountEnum;
import com.clx.performance.enums.PerformanceResultEnum; import com.clx.performance.enums.PerformanceResultEnum;
import com.clx.performance.enums.settle.SettlementDriverEnum;
import com.clx.performance.enums.settle.SettlementOwnerDetailEnum; import com.clx.performance.enums.settle.SettlementOwnerDetailEnum;
import com.clx.performance.enums.settle.SettlementOwnerEnum; import com.clx.performance.enums.settle.SettlementOwnerEnum;
import com.clx.performance.enums.settle.SettlementWayEnum; import com.clx.performance.enums.settle.SettlementWayEnum;
...@@ -92,7 +93,7 @@ public class SettlementServiceImpl implements SettlementService { ...@@ -92,7 +93,7 @@ public class SettlementServiceImpl implements SettlementService {
settlementOwnerDetail.setInvoiceFreight(invoiceFreightCalc(orderChild.getSettlementWay(), settlementOwnerDetail)); settlementOwnerDetail.setInvoiceFreight(invoiceFreightCalc(orderChild.getSettlementWay(), settlementOwnerDetail));
if (settlementDriverDetail.getSettlementFreight().compareTo(BigDecimal.ZERO) < 0) { if (settlementDriverDetail.getSettlementFreight().compareTo(BigDecimal.ZERO) < 0) {
invoiceType = SettlementOwnerEnum.InvoiceType.ORDINARY.getCode(); invoiceType = SettlementOwnerEnum.InvoiceType.ORDINARY.getCode();
settlementDriverDetail.setPrepayFreightFlag(0); settlementDriverDetail.setPrepayFreightFlag(SettlementDriverEnum.PrepayFreightFlag.NO_PAY.getCode());
settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO); settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO);
} else { } else {
OrderGoods orderGoods = orderGoodsDao.getByOrderGoodsNo(orderChild.getOrderGoodsNo()).get(); OrderGoods orderGoods = orderGoodsDao.getByOrderGoodsNo(orderChild.getOrderGoodsNo()).get();
...@@ -127,7 +128,7 @@ public class SettlementServiceImpl implements SettlementService { ...@@ -127,7 +128,7 @@ public class SettlementServiceImpl implements SettlementService {
//冻结的预付运费为0 或者 此刻预付运费也可能为0,那么就不用生成扣除相关流水逻辑 //冻结的预付运费为0 或者 此刻预付运费也可能为0,那么就不用生成扣除相关流水逻辑
if (subtract.compareTo(BigDecimal.ZERO) <= 0 || ans.compareTo(BigDecimal.ZERO) == 0) { if (subtract.compareTo(BigDecimal.ZERO) <= 0 || ans.compareTo(BigDecimal.ZERO) == 0) {
settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO); settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO);
settlementDriverDetail.setPrepayFreightFlag(0); settlementDriverDetail.setPrepayFreightFlag(SettlementDriverEnum.PrepayFreightFlag.NO_PAY.getCode());
} else { } else {
if (subtract.subtract(ans).compareTo(BigDecimal.ZERO) >= 0) { if (subtract.subtract(ans).compareTo(BigDecimal.ZERO) >= 0) {
//账户扣钱并生成扣除流水 //账户扣钱并生成扣除流水
...@@ -146,13 +147,13 @@ public class SettlementServiceImpl implements SettlementService { ...@@ -146,13 +147,13 @@ public class SettlementServiceImpl implements SettlementService {
} else { } else {
settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO); settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO);
settlementDriverDetail.setPrepayFreightFlag(0); settlementDriverDetail.setPrepayFreightFlag(SettlementDriverEnum.PrepayFreightFlag.NO_PAY.getCode());
} }
} }
} else { } else {
settlementDriverDetail.setPrepayFreightFlag(0); settlementDriverDetail.setPrepayFreightFlag(SettlementDriverEnum.PrepayFreightFlag.NO_PAY.getCode());
settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO); settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO);
settlementOwnerDetail.setFinalPaymentStatus(SettlementOwnerDetailEnum.FinalPaymentStatus.NO.getCode()); settlementOwnerDetail.setFinalPaymentStatus(SettlementOwnerDetailEnum.FinalPaymentStatus.NO.getCode());
} }
...@@ -204,7 +205,7 @@ public class SettlementServiceImpl implements SettlementService { ...@@ -204,7 +205,7 @@ public class SettlementServiceImpl implements SettlementService {
OwnerAccountEnum.AccountTypeStatus.PREPAID_FREIGHT_ACCOUNT.getCode()); OwnerAccountEnum.AccountTypeStatus.PREPAID_FREIGHT_ACCOUNT.getCode());
settlementOwnerDetail.setPrepayFreight(ans); settlementOwnerDetail.setPrepayFreight(ans);
settlementDriverDetail.setPrepayFreightFlag(1); settlementDriverDetail.setPrepayFreightFlag(SettlementDriverEnum.PrepayFreightFlag.PAYED.getCode());
settlementOwnerDetail.setFinalPaymentStatus(SettlementOwnerDetailEnum.FinalPaymentStatus.NO_REQUIRE.getCode()); settlementOwnerDetail.setFinalPaymentStatus(SettlementOwnerDetailEnum.FinalPaymentStatus.NO_REQUIRE.getCode());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论