From fa5b5ff12dca20ad243a262009088ca548fe4e7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E7=A3=8A?= <45566618@qq.com> Date: Thu, 18 Jul 2024 20:18:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=97=E9=A4=90=E5=BE=85=E8=A1=A5=E5=8D=95?= =?UTF-8?q?=E8=BD=A6=E8=B4=B9=E8=AE=A1=E7=AE=97=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/OrdersServiceImpl.java | 14 ++- .../resources/mapper/artificer/OrdersDao.xml | 96 +++++++++++-------- 2 files changed, 66 insertions(+), 44 deletions(-) diff --git a/src/main/java/com/sqx/modules/artificer/service/impl/OrdersServiceImpl.java b/src/main/java/com/sqx/modules/artificer/service/impl/OrdersServiceImpl.java index f4fc3bc..f22b5bc 100644 --- a/src/main/java/com/sqx/modules/artificer/service/impl/OrdersServiceImpl.java +++ b/src/main/java/com/sqx/modules/artificer/service/impl/OrdersServiceImpl.java @@ -1205,7 +1205,17 @@ public class OrdersServiceImpl extends ServiceImpl implements return Result.error("预约时间正忙,请更换其他时间!"); } - TravelPriceVo travelPriceVo = travelConfService.calcTravelPrice(orders.getArtificerId(), orders.getLongitude(), orders.getLatitude(),orders.getServeTime()); + TravelPriceVo travelPriceVo = null; + if(orders.getUserPackageDetailId() != null) { + String isTravelFree = commonInfoService.findOne(460).getValue(); + if(isTravelFree.equals("是")){ + tripWay = 3; + orders.setTripWay(3); + travelPriceVo = travelConfService.calcTravelPrice(orders.getArtificerId(), orders.getLongitude(), orders.getLatitude(),orders.getServeTime(),tripWay); + } + }else{ + travelPriceVo = travelConfService.calcTravelPrice(orders.getArtificerId(), orders.getLongitude(), orders.getLatitude(),orders.getServeTime()); + } if (travelPriceVo == null) { return Result.error("暂不支持当前地址,请更换其他地址!"); } @@ -2229,7 +2239,7 @@ public class OrdersServiceImpl extends ServiceImpl implements } if(CommonEnum.V3_ORDER_FORM_CANCEL_START_02 == commonEnum){ //服务开始n分钟后不可以取消订单 - return Result.error("订单已进行"+values[0]+"后,无法取消!"); + return Result.error("订单已进行"+values[0]+"分钟后,无法取消!"); } artificerTimeService.remove(new QueryWrapper().eq("orders_id", orders.getOrdersId())); if(orders.getUserPackageDetailId() !=null){ diff --git a/src/main/resources/mapper/artificer/OrdersDao.xml b/src/main/resources/mapper/artificer/OrdersDao.xml index 32f745d..14ae918 100644 --- a/src/main/resources/mapper/artificer/OrdersDao.xml +++ b/src/main/resources/mapper/artificer/OrdersDao.xml @@ -418,6 +418,7 @@ left join tb_user u on u.user_id=o1.user_id left join consortia c on c.consortia_id=o1.consortia_id where o1.parent_id = 0 + and o1.old_orders_id is null and o1.orders_id not in ( select orders_id from orders where old_orders_id is not null @@ -595,6 +596,7 @@ from orders o where o.artificer_id = #{userId} and o.parent_id = 0 + and o.old_orders_id is null and o.orders_id not in ( select orders_id from orders where old_orders_id is not null @@ -757,6 +759,7 @@ LEFT JOIN bl_user_package_detail bl ON bl.id = om.massage_id where o.artificer_id = #{artificerId} and o.parent_id = 0 + and o.old_orders_id is null and o.orders_id not in ( select orders_id from orders where old_orders_id is not null @@ -857,6 +860,7 @@ LEFT JOIN bl_user_package_detail bl ON bl.id = om.massage_id where o.artificer_id = #{artificerId} and o.parent_id = 0 + and o.old_orders_id is null and o.orders_id not in ( select orders_id from orders where old_orders_id is not null @@ -1192,15 +1196,16 @@ left join orders_massage om on om.orders_id=o.orders_id where o.artificer_id = #{artificerId} and o.parent_id = 0 + and o.old_orders_id is null and o.orders_id not in ( - select orders_id from orders - where old_orders_id is not null - and status != 4 + select orders_id from orders + where old_orders_id is not null + and status != 4 ) and o.orders_id not in ( - select old_orders_id from orders - where old_orders_id is not null - and status != 4 + select old_orders_id from orders + where old_orders_id is not null + and status != 4 ) and date_format(o.end_times,'%Y-%m-%d %H:%i:%s') >= #{startDate} @@ -1237,15 +1242,16 @@ from orders o where o.artificer_id = #{artificerId} and o.parent_id = 0 + and o.old_orders_id is null and o.orders_id not in ( - select orders_id from orders - where old_orders_id is not null - and status != 4 + select orders_id from orders + where old_orders_id is not null + and status != 4 ) and o.orders_id not in ( - select old_orders_id from orders - where old_orders_id is not null - and status != 4 + select old_orders_id from orders + where old_orders_id is not null + and status != 4 ) and date_format(o.end_times,'%Y-%m-%d %H:%i:%s') >= #{startDate} @@ -1283,15 +1289,16 @@ from orders o where o.artificer_id = #{artificerId} and o.parent_id = 0 + and o.old_orders_id is null and o.orders_id not in ( - select orders_id from orders - where old_orders_id is not null - and status != 4 + select orders_id from orders + where old_orders_id is not null + and status != 4 ) and o.orders_id not in ( - select old_orders_id from orders - where old_orders_id is not null - and status != 4 + select old_orders_id from orders + where old_orders_id is not null + and status != 4 ) and date_format(o.end_times,'%Y-%m-%d %H:%i:%s') >= #{startDate} @@ -1328,15 +1335,16 @@ from orders o where o.artificer_id = #{artificerId} and o.parent_id = 0 + and o.old_orders_id is null and o.orders_id not in ( - select orders_id from orders - where old_orders_id is not null - and status != 4 + select orders_id from orders + where old_orders_id is not null + and status != 4 ) and o.orders_id not in ( - select old_orders_id from orders - where old_orders_id is not null - and status != 4 + select old_orders_id from orders + where old_orders_id is not null + and status != 4 ) and date_format(o.end_times,'%Y-%m-%d') >= date_format(#{startDate},'%Y-%m-%d') @@ -1371,15 +1379,16 @@ from orders o where o.artificer_id = #{artificerId} and o.parent_id = 0 + and o.old_orders_id is null and o.orders_id not in ( - select orders_id from orders - where old_orders_id is not null - and status != 4 + select orders_id from orders + where old_orders_id is not null + and status != 4 ) and o.orders_id not in ( - select old_orders_id from orders - where old_orders_id is not null - and status != 4 + select old_orders_id from orders + where old_orders_id is not null + and status != 4 ) and o.add_num > 0 @@ -1453,6 +1462,7 @@ LEFT JOIN bl_user_package_detail bl ON bl.id = om.massage_id where o.artificer_id = #{artificerId} and o.parent_id = 0 + and o.old_orders_id is null and o.orders_id not in ( select orders_id from orders where old_orders_id is not null @@ -1624,15 +1634,16 @@ LEFT JOIN bl_user_package_detail bl ON bl.id = om.massage_id where o.artificer_id = #{artificerId} and o.parent_id = 0 + and o.old_orders_id is null and o.orders_id not in ( - select orders_id from orders - where old_orders_id is not null - and status != 4 + select orders_id from orders + where old_orders_id is not null + and status != 4 ) and o.orders_id not in ( - select old_orders_id from orders - where old_orders_id is not null - and status != 4 + select old_orders_id from orders + where old_orders_id is not null + and status != 4 ) and date_format(o.end_times,'%Y-%m-%d %H:%i:%s') >= #{startTime} @@ -1688,15 +1699,16 @@ left join orders_massage om on om.orders_id=o.orders_id where o.artificer_id = ${userId} and o.parent_id = 0 + and o.old_orders_id is null and o.orders_id not in ( - select orders_id from orders - where old_orders_id is not null - and status != 4 + select orders_id from orders + where old_orders_id is not null + and status != 4 ) and o.orders_id not in ( - select old_orders_id from orders - where old_orders_id is not null - and status != 4 + select old_orders_id from orders + where old_orders_id is not null + and status != 4 ) and date_format(o.end_times,'%Y-%m-%d %H:%i:%s') >= #{startTime}