zhangback
2025-11-18 4636b03d801662db1b8712d7a9ae9105462eca37
tms/src/main/java/com/ruoyi/tms/service/impl/TmsQuoteDetailServiceImpl.java
@@ -133,13 +133,14 @@
            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("不同报价方案,不能添加相同【客户-路线-车型】数据");
@@ -152,6 +153,7 @@
        tmsQuoteDetail.setCreateBy(SecurityUtils.getUsername());
        tmsQuoteDetail.setCreateTime(DateUtils.getNowDate());
        tmsQuoteDetail.setPlanType(tmsQuotePlan.getPlanType());
        tmsQuoteDetail.setCustomerId(tmsQuotePlan.getCustomerId());
        return tmsQuoteDetailMapper.insertTmsQuoteDetail(tmsQuoteDetail);
    }
@@ -197,13 +199,14 @@
            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("不同报价方案,不能添加相同【客户-路线-车型】数据");