| | |
| | | * @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 { |
| | | OrderLogistics orderLogistics = this.selectById(orderId); |
| | | if(orderLogistics.getState() == 10){ |
| | | return ResultUtil.error("订单已取消"); |
| | | return ResultUtil.error(language == 1 ? "订单已取消" : language == 2 ? "Order cancelled" : "Commande annulée"); |
| | | } |
| | | if(orderLogistics.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); |
| | | orderLogistics.setDriverId(uid); |
| | |
| | | }).start(); |
| | | |
| | | systemNoticeService.addSystemNotice(2, "您已成功抢得小件物流订单,请及时联系客户!", orderLogistics.getDriverId()); |
| | | systemNoticeService.addSystemNotice(1, "您的订单已指派给" + driver.getName().substring(0, 1) + "师傅,请保持电话畅通!", orderLogistics.getUserId()); |
| | | systemNoticeService.addSystemNotice(1, "您的订单已指派给" + driver.getLastName().substring(0, 1) + "师傅,请保持电话畅通!", orderLogistics.getUserId()); |
| | | |
| | | return ResultUtil.success(); |
| | | } |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address) throws Exception { |
| | | public ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address, Integer language) throws Exception { |
| | | OrderLogistics orderLogistics = this.selectById(orderId); |
| | | switch (state){ |
| | | case 3://出发前往预约点 |
| | | orderLogistics.setState(3); |
| | | orderLogistics.setSetOutTime(new Date()); |
| | | systemNoticeService.addSystemNotice(1, "司机已出发,请耐心等待", orderLogistics.getUserId()); |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "司机已出发,请耐心等待" : language == 2 ? "The driver has left, please wait patiently" : "Le chauffeur est parti, soyez patient", orderLogistics.getUserId()); |
| | | break; |
| | | case 4://到达预约点,等待客户上车 |
| | | orderLogistics.setState(4); |
| | | orderLogistics.setArriveTime(new Date()); |
| | | systemNoticeService.addSystemNotice(1, "司机已到达您设置的预约地点。", orderLogistics.getUserId()); |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "司机已到达您设置的预约地点。" : language == 2 ? "The driver has arrived at the reservation you set" : "e chauffeur est arrivé au lieu de rendez-vous que vous avez défini", orderLogistics.getUserId()); |
| | | break; |
| | | case 5://开始服务 |
| | | orderLogistics.setBoardingLon(lon); |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil fillInPickUpCode(Integer orderId, String pickUpCode) throws Exception { |
| | | public ResultUtil fillInPickUpCode(Integer orderId, String pickUpCode, Integer language) throws Exception { |
| | | OrderLogistics orderLogistics = this.selectById(orderId); |
| | | if(!"1246".equals(pickUpCode) && !orderLogistics.getPickUpCode().equals(pickUpCode)){ |
| | | return ResultUtil.error("验证失败"); |
| | | return ResultUtil.error(language == 1 ? "验证失败" : language == 2 ? "Verification failure" : "Échec de vérification"); |
| | | } |
| | | orderLogistics.setState(9); |
| | | this.updateById(orderLogistics); |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil makeUpTheDifference(Integer orderId, Double difference) throws Exception { |
| | | public ResultUtil makeUpTheDifference(Integer orderId, Double difference, Integer language) throws Exception { |
| | | OrderLogisticsSpread query = orderLogisticsSpreadService.query(orderId); |
| | | OrderLogistics orderLogistics = this.selectById(orderId); |
| | | if(orderLogistics.getState() != 4 && orderLogistics.getState() != 8){ |
| | | return ResultUtil.error("不允许设置差价"); |
| | | return ResultUtil.error(language == 1 ? "不允许设置差价" : language == 2 ? "Price difference is not allowed" : "Les spreads ne sont pas autorisés"); |
| | | } |
| | | if(query != null){ |
| | | query.setPrice(difference); |
| | |
| | | * @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 { |
| | | OrderLogistics orderLogistics = this.selectById(orderId); |
| | | if(orderLogistics.getState() == 10){ |
| | | return ResultUtil.error("订单已取消"); |
| | | return ResultUtil.error(language == 1 ? "订单已取消" : language == 2 ? "Order cancelled" : "Commande annulée"); |
| | | } |
| | | if(orderLogistics.getState() != 1){ |
| | | return ResultUtil.error("手速有点慢哦,订单已被抢啦!"); |
| | | return ResultUtil.error(language == 1 ? "手速有点慢哦,订单已被抢啦!" : language == 2 ? "Hand speed is a little slow oh, the order has been robbed!" : "La main est un peu lente oh, l’ordre a été volé!"); |
| | | } |
| | | Driver driver = driverService.selectById(uid); |
| | | orderLogistics.setDriverId(uid); |
| | |
| | | }).start(); |
| | | |
| | | systemNoticeService.addSystemNotice(2, "您已成功抢得出租车订单,请及时联系客户!", orderLogistics.getDriverId()); |
| | | systemNoticeService.addSystemNotice(1, "您的订单已指派给" + driver.getName().substring(0, 1) + "师傅,请保持电话畅通!", orderLogistics.getUserId()); |
| | | systemNoticeService.addSystemNotice(1, "您的订单已指派给" + driver.getLastName().substring(0, 1) + "师傅,请保持电话畅通!", orderLogistics.getUserId()); |
| | | |
| | | return ResultUtil.success(); |
| | | } |