From d9c4252c54adc1684de9b56ad810465945e442a8 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期日, 09 七月 2023 06:20:31 +0800 Subject: [PATCH] 更新支付相关功能及多语言 --- DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java | 75 +++++++++---------------------------- 1 files changed, 19 insertions(+), 56 deletions(-) diff --git a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java index 4dcd9a2..3db4c01 100644 --- a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java +++ b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java @@ -25,6 +25,8 @@ import java.io.FileWriter; import java.io.PrintWriter; import java.math.BigDecimal; +import java.math.MathContext; +import java.math.RoundingMode; import java.util.*; @@ -65,13 +67,7 @@ private GDMapElectricFenceUtil gdMapElectricFenceUtil; @Autowired - private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; - - @Autowired private IOrderTaxiService orderTaxiService; - - @Value("${pushMinistryOfTransport}") - private boolean pushMinistryOfTransport; @Resource @@ -137,7 +133,7 @@ * @throws Exception */ @Override - public synchronized ResultUtil grabOrder(Integer orderId, Integer uid) throws Exception { + public synchronized ResultUtil grabOrder(Integer orderId, Integer uid, Integer language) throws Exception { OrderPrivateCar orderPrivateCar = this.selectById(orderId); //处理摆渡车的情况 if(orderPrivateCar.getType() == 2){ @@ -159,15 +155,15 @@ .eq("place", orderPrivateCar.getPlace()) ); if(list.size() > 0 || list1.size() > 0){ - return ResultUtil.error("手速有点慢哦,订单已被抢啦!"); + return ResultUtil.error(language == 1 ? "手速有点慢哦,订单已被抢啦" : language == 2 ? "A little slow. The order's been taken" : "La main est un peu lente oh l’ordre a été volé"); } } if(orderPrivateCar.getState() == 9){ - return ResultUtil.error("订单已取消"); + return ResultUtil.error(language == 1 ? "订单已取消" : language == 2 ? "Order cancelled" : "Commande annulée"); } if(orderPrivateCar.getState() != 1){ - return ResultUtil.error("手速有点慢哦,订单已被抢啦!"); + return ResultUtil.error(language == 1 ? "手速有点慢哦,订单已被抢啦" : language == 2 ? "A little slow. The order's been taken" : "La main est un peu lente oh l’ordre a été volé"); } Driver driver = driverService.selectById(uid); orderPrivateCar.setDriverId(uid); @@ -220,19 +216,7 @@ }).start(); systemNoticeService.addSystemNotice(2, "您已成功抢得专车订单,请及时联系客户!", orderPrivateCar.getDriverId()); - systemNoticeService.addSystemNotice(1, "您的订单已指派给" + driver.getName().substring(0, 1) + "师傅,请保持电话畅通!", orderPrivateCar.getUserId()); - - new Thread(new Runnable() { - @Override - public void run() { - if(pushMinistryOfTransport){ - //上传数据 - pushMinistryOfTransportUtil.orderCreate(orderId); - pushMinistryOfTransportUtil.orderMatch(orderId); - } - } - }).start(); - + systemNoticeService.addSystemNotice(1, "您的订单已指派给" + driver.getLastName().substring(0, 1) + "师傅,请保持电话畅通!", orderPrivateCar.getUserId()); return ResultUtil.success(); } @@ -259,19 +243,19 @@ * @throws Exception */ @Override - public ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address,String phone) throws Exception { + public ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address,String phone, Integer language) throws Exception { OrderPrivateCar orderPrivateCar = this.selectById(orderId); - if(state==5){ - UserInfo userInfo = userInfoMapper.selectById(orderPrivateCar.getUserId()); - if(!userInfo.getPhone().substring(7, userInfo.getPhone().length()).equals(phone)){ - return ResultUtil.error("手机号错误"); - } - } +// if(state==5){ +// UserInfo userInfo = userInfoMapper.selectById(orderPrivateCar.getUserId()); +// if(!userInfo.getPhone().substring(7, userInfo.getPhone().length()).equals(phone)){ +// return ResultUtil.error("手机号错误"); +// } +// } if(state==3 && orderPrivateCar.getState()!=2){ - return ResultUtil.error("当前订单不能触发前往预约地点"); + return ResultUtil.error(language == 1 ? "当前订单不能触发前往预约地点" : language == 2 ? "The current order cannot trigger travel to the reservation" : "La commande en cours ne peut pas déclencher une visite au lieu de rendez-vous"); } if(state==4 && orderPrivateCar.getState()!=3){ - return ResultUtil.error("当前订单不能到达预约地点"); + return ResultUtil.error(language == 1 ? "当前订单不能到达预约地点" : language == 2 ? "The current order cannot arrive at the reservation" : "La commande en cours ne peut pas atteindre le rendez-vous"); } /*if(state==5 && orderPrivateCar.getState()!=4){ return ResultUtil.error("当前订单不能开始服务"); @@ -280,12 +264,12 @@ case 3://出发前往预约点 orderPrivateCar.setState(3); orderPrivateCar.setSetOutTime(new Date()); - systemNoticeService.addSystemNotice(1, "司机已出发,请耐心等待", orderPrivateCar.getUserId()); + systemNoticeService.addSystemNotice(1, language == 1 ? "司机已出发,请耐心等待" : language == 2 ? "he driver has left, please wait patiently" : "Le chauffeur est parti, soyez patient", orderPrivateCar.getUserId()); break; case 4://到达预约点,等待客户上车 orderPrivateCar.setState(4); orderPrivateCar.setArriveTime(new Date()); - systemNoticeService.addSystemNotice(1, "司机已到达您设置的预约地点,请及时上车", orderPrivateCar.getUserId()); + systemNoticeService.addSystemNotice(1, language == 1 ? "司机已到达您设置的预约地点,请及时上车" : language == 2 ? "The driver has arrived at the reservation place you set, please get on the bus in time" : "Le chauffeur est arrivé au lieu de rendez-vous que vous avez fixé, s’il vous plaît embarquez à temps", orderPrivateCar.getUserId()); break; case 5://开始服务 orderPrivateCar.setBoardingLon(lon); @@ -297,14 +281,6 @@ pushUtil.pushDriverPosition(orderPrivateCar.getId(), 1);//主动推送司机定位 - new Thread(new Runnable() { - @Override - public void run() { - if(pushMinistryOfTransport){//上传数据 - pushMinistryOfTransportUtil.operateDepart(orderId); - } - } - }).start(); OrderPosition orderPosition = new OrderPosition(); orderPosition.setOrderId(orderId); orderPosition.setOrderType(1); @@ -394,7 +370,7 @@ } if(company.getIsSpeFixedOrProportional() == 1){//比例 Double price = orderPrivateCar.getStartMoney() + orderPrivateCar.getMileageMoney() + orderPrivateCar.getWaitMoney() + orderPrivateCar.getDurationMoney() + orderPrivateCar.getLongDistanceMoney(); - d = new BigDecimal(price).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_EVEN); + d = new BigDecimal(price).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN))); c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); } incomeService.saveData(1, orderPrivateCar.getCompanyId(), 2, orderPrivateCar.getId(), 1, d.doubleValue()); @@ -443,19 +419,6 @@ pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 1, finalOrderTaxi.getState()); } }).start(); - - OrderPrivateCar finalOrderPrivateCar = orderPrivateCar; - new Thread(new Runnable() { - @Override - public void run() { - if(pushMinistryOfTransport){//上传交通数据 - pushMinistryOfTransportUtil.baseInfoVehicleTotalMile(finalOrderPrivateCar.getCarId()); - pushMinistryOfTransportUtil.operateArrive(orderId); - } - } - }).start(); - - return ResultUtil.success(); } -- Gitblit v1.7.1