|
@@ -100,17 +100,16 @@ public class OpenService {
|
|
|
TbBusinessCar tbBusinessCar = tbBusinessCarService.findTheLastRecord(carNo);
|
|
|
Date now = new Date();
|
|
|
TbCar tbCar = tbCarService.findByCardNo(carNo);
|
|
|
- boolean bindBusiness = false;
|
|
|
- if (tbBusinessCar != null) {
|
|
|
- bindBusiness = tbBusinessService.findOtherBusinessByCarId(tbBusinessCar.getId()).size() > 0;
|
|
|
- }
|
|
|
- if (tbBusinessCar == null || (tbBusinessCar.getRealInTime() != null && tbBusinessCar.getRealOutTime() != null && bindBusiness) || tbBusinessCar.getPay() == 1) {
|
|
|
+ if (tbBusinessCar == null
|
|
|
+ || (tbBusinessCar.getRealInTime() != null && tbBusinessCar.getRealOutTime() != null)
|
|
|
+ || tbBusinessCar.getRealInTime() != null && tbBusinessCar.getRealOutTime() == null
|
|
|
+ || tbBusinessCar.getPay() == 1) {
|
|
|
tbBusinessCar = new TbBusinessCar();
|
|
|
tbBusinessCar.setCarNo(carNo).setPay(0).setCarSize(0D).setIsLock(0).setCarCompany(tbCar != null ? tbCar.getCustomerName() : "临时")
|
|
|
.setInChannel(channel).setRealInTime(now).setBasePartMoney(new BigDecimal("0")).setTimeUpdate(now)
|
|
|
.setNo(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm")) + RandomUtil.randomNumbers(4));
|
|
|
tbBusinessCarService.save(tbBusinessCar);
|
|
|
- CoverBase64ToUrl(image, tbBusinessCar.getId(), carNo,1);
|
|
|
+ CoverBase64ToUrl(image, tbBusinessCar.getId(), carNo, 1);
|
|
|
return;
|
|
|
}
|
|
|
tbBusinessCar.setRealInTime(now).setInChannel(channel).setTimeUpdate(now)
|