longz
2026-06-25 2d4b0522eecb66bad049aac3f0e440bf44d2691a
ManagementYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TLineController.java
@@ -232,6 +232,10 @@
        if (!hasCommissionSetting(tLine.getOutSetting())) {
            return ResultUtil.error("请设置司机抽成");
        }
        ResultUtil charterPriceResult = validateCharterPrice(tLine);
        if (200 != charterPriceResult.getStatus()) {
            return charterPriceResult;
        }
        JSONArray jsonArray1 = JSON.parseArray(shuArr);
        int size1 = jsonArray1.size();
        for (int i = 0; i < size1; i++) {
@@ -731,6 +735,10 @@
        if (!hasCommissionSetting(tLine.getOutSetting())) {
            return ResultUtil.error("请设置司机抽成");
        }
        ResultUtil charterPriceResult = validateCharterPrice(tLine);
        if (200 != charterPriceResult.getStatus()) {
            return charterPriceResult;
        }
        JSONArray jsonArray1 = JSON.parseArray(shuArr);
        int size1 = jsonArray1.size();
        for (int i = 0; i < size1; i++) {
@@ -827,6 +835,24 @@
        return false;
    }
    private ResultUtil validateCharterPrice(TLine tLine) {
        if (tLine.getCharterPrice5() == null) {
            return ResultUtil.error("请填写5座包车价格");
        }
        if (tLine.getCharterPrice6() == null) {
            return ResultUtil.error("请填写6座包车价格");
        }
        if (tLine.getCharterPrice7() == null) {
            return ResultUtil.error("请填写7座包车价格");
        }
        if (tLine.getCharterPrice5().compareTo(BigDecimal.ZERO) < 0
                || tLine.getCharterPrice6().compareTo(BigDecimal.ZERO) < 0
                || tLine.getCharterPrice7().compareTo(BigDecimal.ZERO) < 0) {
            return ResultUtil.error("包车价格不能小于0");
        }
        return ResultUtil.success();
    }
    private boolean hasCommissionRule(JSONArray rules) {
        if (rules == null || rules.size() <= 0) {
            return false;
@@ -869,14 +895,16 @@
            }
            BigDecimal price5;
            BigDecimal price6;
            BigDecimal price7;
            try {
                price5 = new BigDecimal(jsonObject.getString("price5"));
                price6 = jsonObject.getString("price6") != null ? new BigDecimal(jsonObject.getString("price6")) : BigDecimal.ZERO;
                price7 = new BigDecimal(jsonObject.getString("price7"));
            } catch (Exception ex) {
                return ResultUtil.error("目的地价格格式不正确");
            }
            if (price5.compareTo(BigDecimal.ZERO) < 0 || price7.compareTo(BigDecimal.ZERO) < 0) {
            if (price5.compareTo(BigDecimal.ZERO) < 0 || price6.compareTo(BigDecimal.ZERO) < 0 || price7.compareTo(BigDecimal.ZERO) < 0) {
                return ResultUtil.error("目的地价格不能小于0");
            }
@@ -923,6 +951,7 @@
            destination.setDefaultPointLon(defaultPointLon);
            destination.setDefaultPointLat(defaultPointLat);
            destination.setPrice5(price5);
            destination.setPrice6(price6);
            destination.setPrice7(price7);
            Integer state = jsonObject.getInteger("state");
            destination.setState(state == null ? 1 : state);