提交 b8c84f34 authored 作者: huningning's avatar huningning

Merge remote-tracking branch 'origin/v6.4_transportation_20231110' into…

Merge remote-tracking branch 'origin/v6.4_transportation_20231110' into v6.4_transportation_20231110
...@@ -13,4 +13,6 @@ public interface DriverService { ...@@ -13,4 +13,6 @@ public interface DriverService {
Optional<DriverInfoFeignVo> getTruckOwnInfo(String truckNo); Optional<DriverInfoFeignVo> getTruckOwnInfo(String truckNo);
Optional<DriverInfoFeignVo> getDriverInfo(Long driverUserNo);
} }
...@@ -44,4 +44,14 @@ public class DriverServiceImpl implements DriverService { ...@@ -44,4 +44,14 @@ public class DriverServiceImpl implements DriverService {
return null; return null;
} }
@Override
public Optional<DriverInfoFeignVo> getDriverInfo(Long driverUserNo) {
Result<DriverInfoFeignVo> result = Optional.ofNullable(driverFeign.getDriverInfo(driverUserNo)).filter(Result::succeed).orElseThrow(ResultCodeEnum.FAIL);
if (!Objects.equals(result.getCode(), 0)){
throw new ServiceSystemException(ResultCodeEnum.FAIL, result.getMsg());
}
return Optional.ofNullable(result.getData());
}
} }
...@@ -5,16 +5,20 @@ import com.clx.performance.dao.settle.SettlementDriverDetailDao; ...@@ -5,16 +5,20 @@ import com.clx.performance.dao.settle.SettlementDriverDetailDao;
import com.clx.performance.dao.settle.SettlementOwnerDao; import com.clx.performance.dao.settle.SettlementOwnerDao;
import com.clx.performance.dao.settle.SettlementOwnerDetailDao; import com.clx.performance.dao.settle.SettlementOwnerDetailDao;
import com.clx.performance.enums.OrderChildLogEnum; import com.clx.performance.enums.OrderChildLogEnum;
import com.clx.performance.enums.PayRemarkEnum;
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.SettlementDriverEnum;
import com.clx.performance.enums.settle.SettlementLogEnum; import com.clx.performance.enums.settle.SettlementLogEnum;
import com.clx.performance.enums.settle.SettlementOwnerEnum; import com.clx.performance.enums.settle.SettlementOwnerEnum;
import com.clx.performance.enums.settle.SettlementPlatformEnum; import com.clx.performance.enums.settle.SettlementPlatformEnum;
import com.clx.performance.extranal.user.DriverService;
import com.clx.performance.extranal.user.OwnerInfoService; import com.clx.performance.extranal.user.OwnerInfoService;
import com.clx.performance.model.settle.SettlementDriver; import com.clx.performance.model.settle.SettlementDriver;
import com.clx.performance.model.settle.SettlementDriverDetail; import com.clx.performance.model.settle.SettlementDriverDetail;
import com.clx.performance.model.settle.SettlementOwner; import com.clx.performance.model.settle.SettlementOwner;
import com.clx.performance.model.settle.SettlementOwnerDetail; import com.clx.performance.model.settle.SettlementOwnerDetail;
import com.clx.performance.param.pc.payment.PayParam;
import com.clx.performance.service.PaymentService;
import com.clx.performance.service.impl.UniqueOrderNumService; import com.clx.performance.service.impl.UniqueOrderNumService;
import com.clx.performance.service.settle.SettlementLogService; import com.clx.performance.service.settle.SettlementLogService;
import com.clx.performance.service.settle.SettlementMqHandlerService; import com.clx.performance.service.settle.SettlementMqHandlerService;
...@@ -22,7 +26,9 @@ import com.clx.performance.service.settle.SettlementService; ...@@ -22,7 +26,9 @@ import com.clx.performance.service.settle.SettlementService;
import com.clx.performance.utils.LocalDateTimeUtils; import com.clx.performance.utils.LocalDateTimeUtils;
import com.clx.performance.vo.mq.SettlementDetailAddMqParam; import com.clx.performance.vo.mq.SettlementDetailAddMqParam;
import com.clx.performance.vo.mq.SettlementDetailInvoiceTypeSyncMqParam; import com.clx.performance.vo.mq.SettlementDetailInvoiceTypeSyncMqParam;
import com.clx.user.vo.feign.DriverInfoFeignVo;
import com.clx.user.vo.feign.OwnerInfoFeignVO; import com.clx.user.vo.feign.OwnerInfoFeignVO;
import com.msl.common.enums.ResultCodeEnum;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -33,6 +39,7 @@ import java.math.BigDecimal; ...@@ -33,6 +39,7 @@ import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.UUID;
@Slf4j @Slf4j
@Service @Service
...@@ -59,6 +66,12 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic ...@@ -59,6 +66,12 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic
@Autowired @Autowired
private SettlementLogService settlementLogService; private SettlementLogService settlementLogService;
@Autowired
private DriverService driverService;
@Autowired
private PaymentService paymentService;
@Override @Override
...@@ -96,6 +109,9 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic ...@@ -96,6 +109,9 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic
settlementDriverSave(settlementDriverDetail,settlementNo); settlementDriverSave(settlementDriverDetail,settlementNo);
//车主结算单自动支付
paySettlementDriver(settlementDriverDetail);
// 更新结算单 // 更新结算单
settlementOwnerDetail.setSettlementNo(settlementNo); settlementOwnerDetail.setSettlementNo(settlementNo);
settlementDriverDetail.setSettlementNo(settlementNo); settlementDriverDetail.setSettlementNo(settlementNo);
...@@ -140,6 +156,23 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic ...@@ -140,6 +156,23 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic
settlementDriverDao.saveEntity(settlementDriver); settlementDriverDao.saveEntity(settlementDriver);
} }
/**
* 车主结算单自动支付
*/
private void paySettlementDriver(SettlementDriverDetail detail){
DriverInfoFeignVo driverInfoFeignVo = driverService.getDriverInfo(detail.getDriverUserNo()).orElseThrow(ResultCodeEnum.FAIL);
PayParam noCheckPwd = PayParam.builder().from(
Integer.valueOf("100012896"))
.to(Integer.valueOf(driverInfoFeignVo.getWalletCode()))
.figure(detail.getSettlementFreight().intValue())
.tradeNo(UUID.randomUUID().toString().replaceAll("-", ""))
.tradeId(12345)
.pwd("noCheckPwd")
.remark(PayRemarkEnum.toString(PayRemarkEnum.FREIGHT_TO_OWNER.getValue()))
.build();
paymentService.paymentWallet(noCheckPwd);
}
/** /**
* 月结初始化 * 月结初始化
*/ */
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论