| | |
| | | throw new RuntimeException("同一报价清单,不能添加相同【路线-车型】数据"); |
| | | } |
| | | // 2、不同报价方案,不能添加相同【客户-路线-车型】数据 |
| | | int l1 = tmsQuoteDetailMapper.countSameCustomerRouteVehicle(new TmsQuoteDetail(){{ |
| | | setQuotePlanId(quotePlanId); |
| | | setCustomerId(tmsQuotePlan.getCustomerId()); |
| | | setTransportRoute(tmsQuoteDetail.getTransportRoute()); |
| | | setPlanType(tmsQuotePlan.getPlanType()); |
| | | setVehicleType(tmsQuoteDetail.getVehicleType()); |
| | | }}); |
| | | Long l1 = tmsQuoteDetailMapper.selectCount(new LambdaQueryWrapper<TmsQuoteDetail>() |
| | | .ne(TmsQuoteDetail::getQuotePlanId, quotePlanId) |
| | | .eq(TmsQuoteDetail::getCustomerId, tmsQuotePlan.getCustomerId()) |
| | | .eq(TmsQuoteDetail::getTransportRoute, tmsQuoteDetail.getTransportRoute()) |
| | | .eq(TmsQuoteDetail::getPlanType, tmsQuotePlan.getPlanType()) |
| | | .eq(TmsQuoteDetail::getVehicleType, tmsQuoteDetail.getVehicleType()) |
| | | ); |
| | | |
| | | |
| | | if (l1 > 0){ |
| | | throw new RuntimeException("不同报价方案,不能添加相同【客户-路线-车型】数据"); |
| | |
| | | tmsQuoteDetail.setCreateBy(SecurityUtils.getUsername()); |
| | | tmsQuoteDetail.setCreateTime(DateUtils.getNowDate()); |
| | | tmsQuoteDetail.setPlanType(tmsQuotePlan.getPlanType()); |
| | | tmsQuoteDetail.setCustomerId(tmsQuotePlan.getCustomerId()); |
| | | return tmsQuoteDetailMapper.insertTmsQuoteDetail(tmsQuoteDetail); |
| | | } |
| | | |
| | |
| | | throw new RuntimeException("同一报价清单,不能添加相同【路线-车型】数据"); |
| | | } |
| | | // 2、不同报价方案,不能添加相同【客户-路线-车型】数据 |
| | | int l1 = tmsQuoteDetailMapper.countSameCustomerRouteVehicle(new TmsQuoteDetail(){{ |
| | | setQuotePlanId(quotePlanId); |
| | | setCustomerId(tmsQuotePlan.getCustomerId()); |
| | | setTransportRoute(tmsQuoteDetail.getTransportRoute()); |
| | | setVehicleType(tmsQuoteDetail.getVehicleType()); |
| | | setId(tmsQuoteDetail.getId()); |
| | | }}); |
| | | Long l1 = tmsQuoteDetailMapper.selectCount(new LambdaQueryWrapper<TmsQuoteDetail>() |
| | | .ne(TmsQuoteDetail::getQuotePlanId, quotePlanId) |
| | | .ne(TmsQuoteDetail::getId, tmsQuoteDetail.getId()) |
| | | .eq(TmsQuoteDetail::getCustomerId, tmsQuotePlan.getCustomerId()) |
| | | .eq(TmsQuoteDetail::getTransportRoute, tmsQuoteDetail.getTransportRoute()) |
| | | .eq(TmsQuoteDetail::getPlanType, tmsQuotePlan.getPlanType()) |
| | | .eq(TmsQuoteDetail::getVehicleType, tmsQuoteDetail.getVehicleType()) |
| | | ); |
| | | |
| | | if (l1 > 0){ |
| | | throw new RuntimeException("不同报价方案,不能添加相同【客户-路线-车型】数据"); |