From c788ca1640f080f821cb1cbe07da741302d355ef Mon Sep 17 00:00:00 2001
From: longz <longzhaoz@qq.com>
Date: 星期四, 02 七月 2026 14:43:08 +0800
Subject: [PATCH] Merge branch 'feature/3.0' into feature/fangxinxing

---
 ManagementYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TLineController.java |   31 ++++++++++++++++++++++++++++++-
 1 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/ManagementYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TLineController.java b/ManagementYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TLineController.java
index 1bd6cc4..9452b82 100644
--- a/ManagementYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TLineController.java
+++ b/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);

--
Gitblit v1.7.1