|
@@ -56,6 +56,9 @@ public class DriverApiController {
|
|
|
@Autowired
|
|
|
private PaymentInfoService paymentInfoService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CompanyInfoService companyInfoService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private ShiftInfoService shiftInfoService;
|
|
|
|
|
@@ -715,10 +718,30 @@ public class DriverApiController {
|
|
|
throw new Exception("当前车辆不存在");
|
|
|
}
|
|
|
|
|
|
+ String paymentId = "";
|
|
|
+ CompanyInfo companyInfo = companyInfoService.get(vehicleInfo.getCompanyId());
|
|
|
PaymentInfo paymentInfo = paymentInfoService.findByCompanyId(vehicleInfo.getCompanyId());
|
|
|
- if (paymentInfo == null){
|
|
|
- throw new Exception("车辆对应公司为配置收款账户");
|
|
|
+ if (paymentInfo != null){
|
|
|
+ paymentId = paymentInfo.getId();
|
|
|
}
|
|
|
+ else {
|
|
|
+ if ("1".equals(companyInfo.getType())){
|
|
|
+ throw new Exception("车辆对应公司未配置收款账户");
|
|
|
+ }
|
|
|
+ if (!"1".equals(companyInfo.getType())){
|
|
|
+ CompanyInfo companyInfo1 = companyInfoService.get(companyInfo.getParentId());
|
|
|
+ PaymentInfo paymentInfo1 = paymentInfoService.findByCompanyId(companyInfo1.getId());
|
|
|
+ if (paymentInfo1 != null){
|
|
|
+ paymentId = paymentInfo1.getId();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(paymentId)){
|
|
|
+ throw new Exception("对应公司收款账户异常,请核验");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
List<ShiftInfo> shiftInfoList = shiftInfoService.findByVehicleIdAndStatus(vehicleInfo.getId(),"1");
|
|
|
if (shiftInfoList.size() == 0){
|
|
@@ -728,7 +751,7 @@ public class DriverApiController {
|
|
|
PassengerInfo passengerInfo = passengerInfoService.get(id);
|
|
|
|
|
|
|
|
|
- DriverBuyTicketDTO driverBuyTicketDTO = passengerInfoService.driverBuyTicket(passengerInfo,ticketUpStationId,ticketDownStationId,ticketType,goodsTicket,totalFee,payName,paymentInfo.getId());
|
|
|
+ DriverBuyTicketDTO driverBuyTicketDTO = passengerInfoService.driverBuyTicket(passengerInfo,ticketUpStationId,ticketDownStationId,ticketType,goodsTicket,totalFee,payName,paymentId);
|
|
|
|
|
|
messageResult.setData(driverBuyTicketDTO);
|
|
|
messageResult.setResult(true);
|