From 3cd30ccaeab2161102ac1f68c44b04747c62cc03 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期一, 12 一月 2026 18:58:57 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev
---
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/impl/LineShiftDriverServiceImpl.java | 32 +++++++++++++++++++++++++++++++-
1 files changed, 31 insertions(+), 1 deletions(-)
diff --git a/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/impl/LineShiftDriverServiceImpl.java b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/impl/LineShiftDriverServiceImpl.java
index 1f46395..3e9c9c5 100644
--- a/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/impl/LineShiftDriverServiceImpl.java
+++ b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/impl/LineShiftDriverServiceImpl.java
@@ -1,5 +1,9 @@
package com.stylefeng.guns.modular.crossCity.server.impl;
+import cn.hutool.core.date.DateUnit;
+import cn.hutool.cron.CronUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.core.util.ToolUtil;
@@ -243,6 +247,16 @@
DriverShiftListWarpper result = new DriverShiftListWarpper();
+ // 获取司机的服务车型ID(跨城业务 type=3)
+ Integer serverCarModelId = null;
+ Integer carId = driverService.selectById(driverId).getCarId();
+ if (carId != null) {
+ CarService carServiceQuery = carServiceMapper.query(3, carId);
+ if (carServiceQuery != null) {
+ serverCarModelId = carServiceQuery.getServerCarModelId();
+ }
+ }
+
// 查询司机在指定日期的排班信息
List<Map<String, Object>> shiftList = lineShiftDriverMapper.queryDriverShiftByDate(driverId, date);
@@ -272,6 +286,22 @@
DriverShiftListWarpper.LineItemWarpper lineItem = new DriverShiftListWarpper.LineItemWarpper();
lineItem.setLineId(entry.getKey());
lineItem.setLineName(lineNameMap.get(entry.getKey()));
+
+ // 查询线路单价
+ Double unitPrice = null;
+ if (serverCarModelId != null) {
+ Map<String, Object> priceInfo = linePriceMapper.query(entry.getKey(), serverCarModelId);
+ if (priceInfo != null && priceInfo.get("content") != null) {
+ // 解析 content JSON,获取 num1(单人价格)
+ String content = priceInfo.get("content").toString();
+ JSONObject jsonObject = JSON.parseObject(content);
+ String num1 = jsonObject.getString("num1");
+ if (num1 != null && !num1.isEmpty()) {
+ unitPrice = Double.parseDouble(num1);
+ }
+ }
+ }
+ lineItem.setUnitPrice(unitPrice);
List<LineShiftItemWarpper> shifts = new ArrayList<>();
for (Map<String, Object> shiftMap : entry.getValue()) {
@@ -304,7 +334,7 @@
} else {
// 已预约可操作
shiftItem.setStatus(1);
- shiftItem.setStatusText("预约");
+ shiftItem.setStatusText("已预约");
shiftItem.setCanOperate(true);
}
--
Gitblit v1.7.1