|
@@ -148,54 +148,12 @@ public class ApiService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public Set<TbBusinessCar> searchPartCar(String carNo) {
|
|
|
+ public List<TbBusinessCar> searchPartCar(String carNo) {
|
|
|
if (StrUtil.isEmpty(carNo) || StrUtil.length(carNo) < 3) {
|
|
|
- return new HashSet<>();
|
|
|
+ return Collections.emptyList();
|
|
|
}
|
|
|
- Set<TbBusinessCar> set = new HashSet<>();
|
|
|
//查询出未缴费的车辆
|
|
|
- List<TbBusinessCar> list = tbBusinessCarService.searchNoPayCar(carNo);
|
|
|
- for (TbBusinessCar businessCar : list) {
|
|
|
- String businessCarId = businessCar.getId();
|
|
|
- List<TbBusiness> businessList = tbBusinessService.findOtherBusinessByCarId(businessCarId);
|
|
|
- for (TbBusiness tbBusiness : businessList) {
|
|
|
- Integer payStep = tbBusiness.getPayStep();
|
|
|
- //确认之后才可以缴费
|
|
|
- if (TbGoods.PayStep.AFTER_CONFIRM.getCode().equals(payStep)&&tbBusiness.getAdminConfirmInput()==1){
|
|
|
- set.add(businessCar);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- set.add(businessCar);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- list = list.stream().filter(tbBusinessCar -> {
|
|
|
- String businessId = tbBusinessCar.getBusinessId();
|
|
|
- if (StrUtil.isEmpty(businessId)) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- TbBusiness tbBusiness = tbBusinessService.getById(businessId);
|
|
|
- return tbBusiness.getAdminConfirmInput() == 1;
|
|
|
- }).collect(Collectors.toList());
|
|
|
-
|
|
|
- List<TbBusinessCar> otherBusinessCarList = tbBusinessCarService.searchOtherBusinessCar(carNo);
|
|
|
- otherBusinessCarList = otherBusinessCarList.stream().filter(tbBusinessCar -> {
|
|
|
- String businessCarId = tbBusinessCar.getId();
|
|
|
- List<TbBusiness> businesses = tbBusinessService.findOtherBusinessByCarId(businessCarId);
|
|
|
- return businesses.stream().anyMatch(tbBusiness -> tbBusiness.getPayMoney().doubleValue() < tbBusiness.getTotalMoney().doubleValue()
|
|
|
- && (((TbGoods.PayStep.BEFORE_CONFIRM.getCode().equals(tbBusiness.getPayStep()) && tbBusiness.getAdminConfirmInput() >= 0)
|
|
|
- || (TbGoods.PayStep.AFTER_CONFIRM.getCode().equals(tbBusiness.getPayStep()) && tbBusiness.getAdminConfirmInput() == 1))
|
|
|
- ));
|
|
|
- }).collect(Collectors.toList());
|
|
|
-
|
|
|
-
|
|
|
- List<TbBusinessCar> cars = tbBusinessCarService.findTheNoBusinessCar(carNo);
|
|
|
- //过滤掉不用缴费的车
|
|
|
- list.addAll(cars);
|
|
|
- list.addAll(otherBusinessCarList);
|
|
|
- return new HashSet<>(list);
|
|
|
+ return tbBusinessCarService.searchForPayCar(carNo);
|
|
|
}
|
|
|
|
|
|
public void confirm(List<String> ids) {
|