无关风月
2024-08-07 57909bfeb70e80689cfe515198e3a30ad3868bb8
Merge branch '2.0' of http://120.76.84.145:10101/gitblit/r/java/IgoTravel into 2.0
47个文件已修改
2个文件已添加
2261 ■■■■ 已修改文件
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/SettlementRecordController.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/impl/OrderCrossCityServiceImpl.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/model/OrderLogistics.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/IOrderLogisticsService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/model/OrderPrivateCar.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/IOrderPrivateCarService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java 81 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/CompanyMapper.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DriverMapper.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/CarModelMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/CompanyMapper.xml 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverActivityHistoryMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverActivityOnlineMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverActivityOrderMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverActivityRegisteredMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverMapper.xml 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/DriverActivityHistory.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ICompanyCityService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IDriverService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IOrderService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IPushOrderService.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/CompanyCityServiceImpl.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverOnlineServiceImpl.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverServiceImpl.java 151 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/OrderServiceImpl.java 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/PushOrderServiceImpl.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/ReassignServiceImpl.java 477 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/SettlementRecordServiceImpl.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushUtil.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/quartz/jobs/OrderTimeOutJob.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/LoginWarpper.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/OrderInfoWarpper.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCarController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TIntegralOrderController.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/controller/OrderLogisticsController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/dao/mapping/OrderLogisticsMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java 413 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java 413 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/DriverActivityHistory.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushUtil.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/OrderInfoWarpper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/OrderWarpper.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java
@@ -25,6 +25,7 @@
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -808,7 +809,7 @@
                return ResultUtil.tokenErr();
            }
            Map<String, Object> map = driverService.queryInfo(language, uid);
            map.put("qrCodeIsOpen",driverService.getAppOpenInfo(1)==1);
            map.put("qrCodeIsOpen", driverService.getAppOpenInfo(1)==1);
            DriverInfoWarpper driverInfoWarpper = DriverInfoWarpper.getDriverInfoWarpper(map);
//            Double money = driverService.getThisWeekMoney(uid);
//            driverInfoWarpper.setLaveBusinessMoney(driverInfoWarpper.getLaveBusinessMoney()-(money==null?0d:money));
@@ -1760,6 +1761,9 @@
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            if(!StringUtils.hasLength(vehicleId)){
                return ResultUtil.paranErr();
            }
            Map<String, Object> s = fleetEngineUtil.fleetEngineAuth(2, vehicleId);
            return ResultUtil.success(s);
        }catch (Exception e){
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
@@ -448,9 +448,14 @@
            @ApiImplicitParam(value = "过路费", name = "crossingFee", required = false, dataType = "double"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil confirmFees(Integer language, Integer orderId, Integer orderType, Integer type, Double travelFee, Double parkingFee, Double crossingFee){
    public ResultUtil confirmFees(Integer language, Integer orderId, Integer orderType, Integer type,
                                  Double travelFee, Double parkingFee, Double crossingFee, HttpServletRequest request){
        try{
            return orderService.confirmFees(language, orderId, orderType, type, travelFee, parkingFee, crossingFee);
            Integer uid = driverService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            return orderService.confirmFees(language, orderId, orderType, type, travelFee, parkingFee, crossingFee, uid);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
@@ -530,11 +535,11 @@
            //更新小号绑定关系
            orderService.RebindMidAxbBindSend(orderId, orderType);
            pushUtil.pushOrderReassign(Integer.valueOf(String.valueOf(map.get("driverId"))), 2,Integer.valueOf(String.valueOf(map.get("orderId"))), orderType);
            pushUtil.pushOrderReassign(Integer.valueOf(String.valueOf(map.get("driverId"))), 2,Integer.valueOf(String.valueOf(map.get("orderId"))), orderType, "");
            pushUtil.pushOrderReassign(Integer.valueOf(String.valueOf(map.get("userId"))), 1,Integer.valueOf(String.valueOf(map.get("orderId"))), orderType);
            pushUtil.pushOrderReassign(Integer.valueOf(String.valueOf(map.get("userId"))), 1,Integer.valueOf(String.valueOf(map.get("orderId"))), orderType, "");
            pushUtil.pushOrderState(1, Integer.valueOf(String.valueOf(map.get("userId"))), Integer.valueOf(String.valueOf(map.get("orderId"))), orderType,
                    Integer.valueOf(String.valueOf(map.get("orderState"))));
                    Integer.valueOf(String.valueOf(map.get("orderState"))), 0, "");
            return JSON.toJSONString(ResultUtil.success());
        }catch (Exception e){
            e.printStackTrace();
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/SettlementRecordController.java
@@ -158,9 +158,11 @@
                String order_id = payments.getPayer_transaction_id();
                if(ToolUtil.isNotEmpty(out_trade_no)){
                    Integer language = Integer.valueOf(out_trade_no.substring(17, 18));
                    Integer id = Integer.valueOf(out_trade_no.substring(18));
                    Integer payType = Integer.valueOf(out_trade_no.substring(18, 19));
                    Integer id = Integer.valueOf(out_trade_no.substring(19));
                    SettlementRecord settlementRecord = settlementRecordService.selectById(id);
                    settlementRecord.setPayType(payType);
                    settlementRecord.setPaymentStatus(2);
                    settlementRecord.setPayTime(new Date());
                    settlementRecord.setCode(order_id);
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/impl/OrderCrossCityServiceImpl.java
@@ -297,8 +297,8 @@
        new Thread(new Runnable() {
            @Override
            public void run() {
                pushUtil.pushOrderState(1, orderCrossCity.getUserId(), orderCrossCity.getId(), 2, orderCrossCity.getState());
                pushUtil.pushOrderState(2, orderCrossCity.getDriverId(), orderCrossCity.getId(), 2, orderCrossCity.getState());
                pushUtil.pushOrderState(1, orderCrossCity.getUserId(), orderCrossCity.getId(), 2, orderCrossCity.getState(), 0, "");
                pushUtil.pushOrderState(2, orderCrossCity.getDriverId(), orderCrossCity.getId(), 2, orderCrossCity.getState(), 0, "");
            }
        }).start();
        return ResultUtil.success();
@@ -612,8 +612,8 @@
        new Thread(new Runnable() {
            @Override
            public void run() {
                pushUtil.pushOrderState(1, orderCrossCity.getUserId(), orderCrossCity.getId(), 3, orderCrossCity.getState());
                pushUtil.pushOrderState(2, orderCrossCity.getDriverId(), orderCrossCity.getId(), 3, orderCrossCity.getState());
                pushUtil.pushOrderState(1, orderCrossCity.getUserId(), orderCrossCity.getId(), 3, orderCrossCity.getState(), 0, "");
                pushUtil.pushOrderState(2, orderCrossCity.getDriverId(), orderCrossCity.getId(), 3, orderCrossCity.getState(), 0, "");
            }
        }).start();
@@ -748,8 +748,8 @@
            new Thread(new Runnable() {
                @Override
                public void run() {
                    pushUtil.pushOrderState(1, orderCrossCity.getUserId(), orderCrossCity.getId(), 3, orderCrossCity.getState());
                    pushUtil.pushOrderState(2, orderCrossCity.getDriverId(), orderCrossCity.getId(), 3, orderCrossCity.getState());
                    pushUtil.pushOrderState(1, orderCrossCity.getUserId(), orderCrossCity.getId(), 3, orderCrossCity.getState(), 0, "");
                    pushUtil.pushOrderState(2, orderCrossCity.getDriverId(), orderCrossCity.getId(), 3, orderCrossCity.getState(), 0, "");
                }
            }).start();
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/model/OrderLogistics.java
@@ -445,4 +445,9 @@
     */
    @TableField("startDuration")
    private Integer startDuration;
    /**
     * 预估里程
     */
    @TableField("estimatedMileage")
    private Double estimatedMileage;
}
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/IOrderLogisticsService.java
@@ -49,7 +49,7 @@
     * @return
     * @throws Exception
     */
    ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address, String pickUpCode, Integer language) throws Exception;
    ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address, String pickUpCode, Integer language, Integer uid) throws Exception;
    /**
@@ -156,7 +156,7 @@
     * @return
     * @throws Exception
     */
    ResultUtil confirmFees(Integer language, Integer orderId, Integer type, Double parkingFee, Double crossingFee) throws Exception;
    ResultUtil confirmFees(Integer language, Integer orderId, Integer type, Double parkingFee, Double crossingFee, Integer uid) throws Exception;
    
    
    /**
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java
@@ -53,6 +53,9 @@
    @Resource
    private OrderLogisticsMapper orderLogisticsMapper;
    @Resource
    private IOrderCancelService orderCancelService;
    @Autowired
    private IDriverService driverService;
@@ -218,7 +221,7 @@
            CancleOrder cancleOrder = cancleOrderService.selectOne(new EntityWrapper<CancleOrder>().eq("companyId", driver.getCompanyId()));
            Integer driverTimeout = JSON.parseObject(cancleOrder.getContent()).getInteger("driverTimeout");
            //超时时间
            long timeOut = orderLogistics.getEstimateArriveTime().getTime() + (driverTimeout * 60 * 1000);
            long timeOut = orderLogistics.getEstimateArriveTime().getTime() + (driverTimeout * 60000);
            //乘客取消不收费提醒
            JobDataMap jobDataMap = new JobDataMap();
            jobDataMap.put("driverId", uid);
@@ -227,9 +230,10 @@
            jobDataMap.put("orderType", 4);
            jobDataMap.put("language", language);
            jobDataMap.put("timeOut", timeOut);
            jobDataMap.put("driverTimeout", driverTimeout);
            jobDataMap.put("describe", language == 1 ? "您已超时" + driverTimeout + "分钟,用户可免费取消订单" : language == 2 ? "Reminder You are overdue for " + driverTimeout + " minutes The subscriber could cancel the order for free Confirm" : "Rappel Vous êtes en retard de " + driverTimeout + " minutes L’abonné peut annuler la commande gratuitement Confirmer");
            QuartzUtil.addSimpleQuartzTask(
                    new OrderTimeOutJob().buildQuartzJob(UUIDUtil.getRandomCode(5) + "_" + orderLogistics.getId() + "_4", "ORDER_TIME_OUT", jobDataMap)
                    new OrderTimeOutJob().buildQuartzJob("1_" + orderLogistics.getId() + "_4", "ORDER_TIME_OUT", jobDataMap)
                    , new Date(timeOut), timeOut, 0);
    
            //超时循环提醒
@@ -240,9 +244,10 @@
            jobDataMap.put("orderType", 4);
            jobDataMap.put("language", language);
            jobDataMap.put("timeOut", orderLogistics.getEstimateArriveTime().getTime());
            jobDataMap.put("driverTimeout", driverTimeout);
            jobDataMap.put("describe", "");
            QuartzUtil.addSimpleQuartzTask(
                    new OrderTimeOutJob().buildQuartzJob(UUIDUtil.getRandomCode(5) + "_" + orderLogistics.getId() + "_4", "ORDER_TIME_OUT", jobDataMap)
                    new OrderTimeOutJob().buildQuartzJob("3_" + orderLogistics.getId() + "_4", "ORDER_TIME_OUT", jobDataMap)
                    , orderLogistics.getEstimateArriveTime(), reminderRules.getCar() * 60000, -1);
        }
    
@@ -275,8 +280,8 @@
        new Thread(new Runnable() {
            @Override
            public void run() {
                pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState());
                pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState());
                pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "");
                pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "");
            }
        }).start();
@@ -299,11 +304,28 @@
    @Override
    public Map<String, Object> queryOrderInfo(Integer language, Integer orderId) throws Exception {
        Map<String, Object> map = orderLogisticsMapper.queryOrderInfo(orderId);
        OrderLogistics orderLogistics = this.selectById(orderId);
        if(null != map.get("travelTime_")){
            String travelTime_ = map.get("travelTime_").toString();
            map.put("travelTime_", DateUtil.conversionFormat1(language, travelTime_));
        }
        Integer orderState = Integer.valueOf(map.get("orderState").toString());
        if(orderState == 12){
            OrderCancel orderCancel = orderCancelService.selectOne(new EntityWrapper<OrderCancel>().eq("orderId", orderId)
                    .eq("orderType", 4).eq("state", 1).orderBy("insertTime desc limit 0, 1"));
            if(null != orderCancel){
                map.put("cancelPayMoney", orderCancel.getMoney());
            }
        }
        map.put("cancelUser", language == 1 ? "用户" : language == 2 ? "The client" : "Le client");
        map.put("timeOutCancel", 0);
        if(null != orderLogistics.getEstimateArriveTime()){
            CancleOrder cancleOrder = cancleOrderService.selectOne(new EntityWrapper<CancleOrder>().eq("companyId", orderLogistics.getCompanyId()));
            JSONObject jsonObject = JSON.parseObject(cancleOrder.getContent());
            int driverTimeout = jsonObject.getIntValue("driverTimeout");
            long timeOutCancel = orderLogistics.getEstimateArriveTime().getTime() + driverTimeout;
            map.put("timeOutCancel", timeOutCancel);
        }
        return map;
    }
@@ -328,8 +350,11 @@
     * @throws Exception
     */
    @Override
    public ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address, String pickUpCode, Integer language) throws Exception {
    public ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address, String pickUpCode, Integer language, Integer uid) throws Exception {
        OrderLogistics orderLogistics = this.selectById(orderId);
        if(!uid.equals(orderLogistics.getDriverId())){
            return ResultUtil.error(language == 1 ? "操作失败,请刷新订单" : language == 2 ? "Operation failed, please refresh the order" : "L’opération a échoué, veuillez actualiser la commande");
        }
        if(orderLogistics.getState().compareTo(state) == 0){
            return ResultUtil.error(language == 1 ? "不能重复操作" : language == 2 ? "Unable to recur operate" : "Impossible de récurrence des opérer");
        }
@@ -395,8 +420,8 @@
        new Thread(new Runnable() {
            @Override
            public void run() {
                pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState());
                pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState());
                pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "");
                pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "");
            }
        }).start();
        
@@ -531,8 +556,8 @@
        new Thread(new Runnable() {
            @Override
            public void run() {
                pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState());
                pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState());
                pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "");
                pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "");
            }
        }).start();
@@ -725,6 +750,7 @@
        OrderLogistics orderLogistics = this.selectById(orderId);
        if(orderLogistics.getState() == 6){//服务中的时候获取实时费用数据
            this.setMoney(orderLogistics, 0D, 0D);
            orderLogistics.setOrderMoney(orderLogistics.getOrderMoney() + orderLogistics.getPriceDifference());
        }
    
        Map<String, Object> map = new HashMap<>();
@@ -971,10 +997,13 @@
     * @throws Exception
     */
    @Override
    public ResultUtil confirmFees(Integer language, Integer orderId, Integer type, Double parkingFee, Double crossingFee) throws Exception {
    public ResultUtil confirmFees(Integer language, Integer orderId, Integer type, Double parkingFee, Double crossingFee, Integer uid) throws Exception {
        OrderLogistics orderLogistics = this.selectById(orderId);
        if(!uid.equals(orderLogistics.getDriverId())){
            return ResultUtil.error(language == 1 ? "操作失败,请刷新订单" : language == 2 ? "Operation failed, please refresh the order" : "L’opération a échoué, veuillez actualiser la commande");
        }
        if(6 != orderLogistics.getState()){
            return ResultUtil.error("操作异常,请刷新订单");
            return ResultUtil.error(language == 1 ? "操作失败,请刷新订单" : language == 2 ? "Operation failed, please refresh the order" : "L’opération a échoué, veuillez actualiser la commande");
        }
        if(orderLogistics.getArriveTime()==null){
            orderLogistics.setArriveTime(orderLogistics.getStartServiceTime());
@@ -1050,8 +1079,8 @@
        new Thread(new Runnable() {
            @Override
            public void run() {
                pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 4, finalOrderTaxi.getState());
                pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 4, finalOrderTaxi.getState());
                pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 4, finalOrderTaxi.getState(), 0, "");
                pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 4, finalOrderTaxi.getState(), 0, "");
            }
        }).start();
    
@@ -1079,6 +1108,9 @@
    @Override
    public boolean calculateMileage(Integer orderId, String lon, String lat) throws Exception {
        OrderLogistics orderLogistics = this.selectById(orderId);
        if(orderLogistics.getState() == 2){
            return false;
        }
        OrderPosition orderPosition = orderPositionService.queryNew(orderId, 4);
        String now = lon + "," + lat;
        String old = null;
@@ -1094,7 +1126,7 @@
        Map<String, Double> distance = GeodesyUtil.getDistance(now, old);
        if(null != distance){
            Double distance1 = distance.get("WGS84");
            if(distance1 > 50 && orderLogistics.getState() < 5){//大于50米表示在移动
            if(distance1 > 50 &&  Arrays.asList(3, 4).contains(orderLogistics.getState())){//大于50米表示在移动
                orderLogistics.setToStartPointMileage(new BigDecimal(orderLogistics.getToStartPointMileage()).add(new BigDecimal(distance1)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                this.updateById(orderLogistics);
                return true;
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/model/OrderPrivateCar.java
@@ -462,4 +462,9 @@
     */
    @TableField("estimateArriveMileage")
    private Long estimateArriveMileage;
    /**
     * 预估里程
     */
    @TableField("estimatedMileage")
    private Double estimatedMileage;
}
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/IOrderPrivateCarService.java
@@ -74,7 +74,7 @@
     * @return
     * @throws Exception
     */
    ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address,String phone, Integer language) throws Exception;
    ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address,String phone, Integer language, Integer uid) throws Exception;
    /**
@@ -86,7 +86,7 @@
     * @return
     * @throws Exception
     */
    ResultUtil confirmFees(Integer language, Integer orderId, Integer type, Double parkingFee, Double crossingFee) throws Exception;
    ResultUtil confirmFees(Integer language, Integer orderId, Integer type, Double parkingFee, Double crossingFee, Integer uid) throws Exception;
    /**
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java
@@ -119,6 +119,9 @@
    
    @Resource
    private RedisUtil redisUtil;
    @Resource
    private IOrderCancelService orderCancelService;
@@ -284,9 +287,10 @@
                jobDataMap.put("orderType", 1);
                jobDataMap.put("language", language);
                jobDataMap.put("timeOut", timeOut);
                jobDataMap.put("driverTimeout", driverTimeout);
                jobDataMap.put("describe", language == 1 ? "您已超时" + driverTimeout + "分钟,用户可免费取消订单" : language == 2 ? "Reminder You are overdue for " + driverTimeout + " minutes The subscriber could cancel the order for free Confirm" : "Rappel Vous êtes en retard de " + driverTimeout + " minutes L’abonné peut annuler la commande gratuitement Confirmer");
                QuartzUtil.addSimpleQuartzTask(
                        new OrderTimeOutJob().buildQuartzJob(UUIDUtil.getRandomCode(5) + "_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap)
                        new OrderTimeOutJob().buildQuartzJob("1_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap)
                        , new Date(timeOut), timeOut, 0);
    
                //超时循环提醒
@@ -297,9 +301,10 @@
                jobDataMap.put("orderType", 1);
                jobDataMap.put("language", language);
                jobDataMap.put("timeOut", orderPrivateCar.getEstimateArriveTime().getTime());
                jobDataMap.put("driverTimeout", 0);
                jobDataMap.put("describe", "");
                QuartzUtil.addSimpleQuartzTask(
                        new OrderTimeOutJob().buildQuartzJob(UUIDUtil.getRandomCode(5) + "_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap)
                        new OrderTimeOutJob().buildQuartzJob("3_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap)
                        , orderPrivateCar.getEstimateArriveTime(), reminderRules.getCar() * 60000, -1);
            }else{
                //超时时间
@@ -312,9 +317,10 @@
                jobDataMap.put("orderType", 1);
                jobDataMap.put("language", language);
                jobDataMap.put("timeOut", timeOut);
                jobDataMap.put("driverTimeout", driverTimeout);
                jobDataMap.put("describe", language == 1 ? "您已超时" + driverTimeout + "分钟,用户可免费取消订单" : language == 2 ? "Reminder You are overdue for " + driverTimeout + " minutes The subscriber could cancel the order for free Confirm" : "Rappel Vous êtes en retard de " + driverTimeout + " minutes L’abonné peut annuler la commande gratuitement Confirmer");
                QuartzUtil.addSimpleQuartzTask(
                        new OrderTimeOutJob().buildQuartzJob(UUIDUtil.getRandomCode(5) + "_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap)
                        new OrderTimeOutJob().buildQuartzJob("1_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap)
                        , new Date(timeOut), timeOut, 0);
                
                
@@ -330,11 +336,12 @@
                jobDataMap.put("orderType", 1);
                jobDataMap.put("language", language);
                jobDataMap.put("timeOut", timeOut);
                jobDataMap.put("driverTimeout", 0);
                jobDataMap.put("describe", language == 1 ? "您将于" + sdf.format(orderPrivateCar.getTravelTime()) + "去接" + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName())  + ",请准时!" :
                        language == 2 ? "You are going to pick up " + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName()) + " at " + sdf.format(orderPrivateCar.getTravelTime()) + ", please be on time. " :
                                "Vous allez chercher " + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName()) + " à " + sdf.format(orderPrivateCar.getTravelTime()) + ", s’il vous plaît soyez à l’heure.");
                QuartzUtil.addSimpleQuartzTask(
                        new OrderTimeOutJob().buildQuartzJob(UUIDUtil.getRandomCode(5) + "_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap)
                        new OrderTimeOutJob().buildQuartzJob("2_1_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap)
                        , new Date(travelTime), travelTime, 0);
    
                //预约单出发循环提醒
@@ -345,11 +352,12 @@
                jobDataMap.put("orderType", 1);
                jobDataMap.put("language", language);
                jobDataMap.put("timeOut", orderPrivateCar.getTravelTime().getTime());
                jobDataMap.put("driverTimeout", 0);
                jobDataMap.put("describe", language == 1 ? "您将于" + sdf.format(orderPrivateCar.getTravelTime()) + "去接" + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName())  + ",请准时!" :
                        language == 2 ? "You are going to pick up " + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName()) + " at " + sdf.format(orderPrivateCar.getTravelTime()) + ", please be on time. " :
                                "Vous allez chercher " + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName()) + " à " + sdf.format(orderPrivateCar.getTravelTime()) + ", s’il vous plaît soyez à l’heure.");
                QuartzUtil.addSimpleQuartzTask(
                        new OrderTimeOutJob().buildQuartzJob(UUIDUtil.getRandomCode(5) + "_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap)
                        new OrderTimeOutJob().buildQuartzJob("2_2_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap)
                        , new Date(travelTime + reminderRules.getReserveNext() * 60000), reminderRules.getReserveNext() * 60000, -1);
    
                //超时循环提醒
@@ -360,9 +368,10 @@
                jobDataMap.put("orderType", 1);
                jobDataMap.put("language", language);
                jobDataMap.put("timeOut", orderPrivateCar.getTravelTime().getTime());
                jobDataMap.put("driverTimeout", 0);
                jobDataMap.put("describe", "");
                QuartzUtil.addSimpleQuartzTask(
                        new OrderTimeOutJob().buildQuartzJob(UUIDUtil.getRandomCode(5) + "_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap)
                        new OrderTimeOutJob().buildQuartzJob("3_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap)
                        , orderPrivateCar.getTravelTime(), reminderRules.getCar() * 60000, -1);
            }
        }
@@ -395,8 +404,8 @@
        new Thread(new Runnable() {
            @Override
            public void run() {
                pushUtil.pushOrderState(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState());
                pushUtil.pushOrderState(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState());
                pushUtil.pushOrderState(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0, "");
                pushUtil.pushOrderState(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0, "");
                if(orderPrivateCar.getType() == 2){
                    pushUtil.pushFerryOrderState(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1, 2);
                }
@@ -424,11 +433,30 @@
    @Override
    public Map<String, Object> queryOrderInfo(Integer language, Integer orderId) throws Exception {
        Map<String, Object> map = orderPrivateCarMapper.queryOrderInfo(orderId);
        OrderPrivateCar orderPrivateCar = this.selectById(orderId);
        if(null != map.get("travelTime_")){
            String travelTime_ = map.get("travelTime_").toString();
            map.put("travelTime_", DateUtil.conversionFormat1(language, travelTime_));
        }
        Integer orderState = Integer.valueOf(map.get("orderState").toString());
        if(orderState == 12){
            OrderCancel orderCancel = orderCancelService.selectOne(new EntityWrapper<OrderCancel>().eq("orderId", orderId)
                    .eq("orderType", 1).eq("state", 1).orderBy("insertTime desc limit 0, 1"));
            if(null != orderCancel){
                map.put("cancelPayMoney", orderCancel.getMoney());
            }
        }
        map.put("cancelUser", language == 1 ? "用户" : language == 2 ? "The client" : "Le client");
        long timeOutCancel = 0L;
//        CancleOrder cancleOrder = cancleOrderService.selectOne(new EntityWrapper<CancleOrder>().eq("companyId", orderPrivateCar.getCompanyId()));
//        JSONObject jsonObject = JSON.parseObject(cancleOrder.getContent());
//        int driverTimeout = jsonObject.getIntValue("driverTimeout") * 60000;
        if(orderPrivateCar.getOrderType() == 1 && null != orderPrivateCar.getEstimateArriveTime()){
            timeOutCancel = orderPrivateCar.getEstimateArriveTime().getTime();
        }else{
            timeOutCancel = orderPrivateCar.getTravelTime().getTime();
        }
        map.put("timeOutCancel", timeOutCancel);
        return map;
    }
@@ -442,8 +470,11 @@
     * @throws Exception
     */
    @Override
    public ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address,String phone, Integer language) throws Exception {
    public ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address,String phone, Integer language, Integer uid) throws Exception {
        OrderPrivateCar orderPrivateCar = this.selectById(orderId);
        if(!uid.equals(orderPrivateCar.getDriverId())){
            return ResultUtil.error(language == 1 ? "操作失败,请刷新订单" : language == 2 ? "Operation failed, please refresh the order" : "L’opération a échoué, veuillez actualiser la commande");
        }
        if(orderPrivateCar.getState().compareTo(state) == 0){
            return ResultUtil.error(language == 1 ? "不能重复操作" : language == 2 ? "Unable to recur operate" : "Impossible de récurrence des opérer");
        }
@@ -505,13 +536,13 @@
                tripStatus = "ENROUTE_TO_DROPOFF";
                switch (language){
                    case 1:
                        audioUrl = "http://182.160.16.251:81/files/audio/OnboardReminder-CN.mp3";
                        audioUrl = "http://182.160.16.251:81/files/audio/system/OnboardReminder-CN.mp3";
                        break;
                    case 2:
                        audioUrl = "http://182.160.16.251:81/files/audio/OnboardReminder-EN.mp3";
                        audioUrl = "http://182.160.16.251:81/files/audio/system/OnboardReminder-EN.mp3";
                        break;
                    case 3:
                        audioUrl = "http://182.160.16.251:81/files/audio/OnboardReminder-FR.mp3";
                        audioUrl = "http://182.160.16.251:81/files/audio/system/OnboardReminder-FR.mp3";
                        break;
                }
                break;
@@ -525,13 +556,13 @@
                tripStatus = "COMPLETE";
                switch (language){
                    case 1:
                        audioUrl = "http://182.160.16.251:81/files/audio/ReachDestination-CN.mp3";
                        audioUrl = "http://182.160.16.251:81/files/audio/system/ReachDestination-CN.mp3";
                        break;
                    case 2:
                        audioUrl = "http://182.160.16.251:81/files/audio/ReachDestination-EN.mp3";
                        audioUrl = "http://182.160.16.251:81/files/audio/system/ReachDestination-EN.mp3";
                        break;
                    case 3:
                        audioUrl = "http://182.160.16.251:81/files/audio/ReachDestination-FR.mp3";
                        audioUrl = "http://182.160.16.251:81/files/audio/system/ReachDestination-FR.mp3";
                        break;
                }
                break;
@@ -554,8 +585,8 @@
        new Thread(new Runnable() {
            @Override
            public void run() {
                pushUtil.pushOrderState(1, finalOrderPrivateCar.getUserId(), finalOrderPrivateCar.getId(), 1, finalOrderPrivateCar.getState());
                pushUtil.pushOrderState(2, finalOrderPrivateCar.getDriverId(), finalOrderPrivateCar.getId(), 1, finalOrderPrivateCar.getState());
                pushUtil.pushOrderState(1, finalOrderPrivateCar.getUserId(), finalOrderPrivateCar.getId(), 1, finalOrderPrivateCar.getState(), 0, "");
                pushUtil.pushOrderState(2, finalOrderPrivateCar.getDriverId(), finalOrderPrivateCar.getId(), 1, finalOrderPrivateCar.getState(), 0, "");
            }
        }).start();
        return ResultUtil.success(audioUrl);
@@ -573,10 +604,13 @@
     * @throws Exception
     */
    @Override
    public ResultUtil confirmFees(Integer language, Integer orderId, Integer type, Double parkingFee, Double crossingFee) throws Exception {
    public ResultUtil confirmFees(Integer language, Integer orderId, Integer type, Double parkingFee, Double crossingFee, Integer uid) throws Exception {
        OrderPrivateCar orderPrivateCar = this.selectById(orderId);
        if(!uid.equals(orderPrivateCar.getDriverId())){
            return ResultUtil.error(language == 1 ? "操作失败,请刷新订单" : language == 2 ? "Operation failed, please refresh the order" : "L’opération a échoué, veuillez actualiser la commande");
        }
        if(6 != orderPrivateCar.getState()){
            return ResultUtil.error("操作异常,请刷新订单");
            return ResultUtil.error(language == 1 ? "操作失败,请刷新订单" : language == 2 ? "Operation failed, please refresh the order" : "L’opération a échoué, veuillez actualiser la commande");
        }
        if(orderPrivateCar.getArriveTime()==null){
            orderPrivateCar.setArriveTime(orderPrivateCar.getStartServiceTime());
@@ -653,8 +687,8 @@
        new Thread(new Runnable() {
            @Override
            public void run() {
                pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 1, finalOrderTaxi.getState());
                pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 1, finalOrderTaxi.getState());
                pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 1, finalOrderTaxi.getState(), 0, "");
                pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 1, finalOrderTaxi.getState(), 0, "");
            }
        }).start();
    
@@ -716,6 +750,9 @@
    @Override
    public boolean calculateMileage(Integer orderId, String lon, String lat) throws Exception {
        OrderPrivateCar orderPrivateCar = this.selectById(orderId);
        if(orderPrivateCar.getState() == 2){
            return false;
        }
        OrderPosition orderPosition = orderPositionService.queryNew(orderId, 1);
        String now = lon + "," + lat;
        String old = null;
@@ -731,7 +768,7 @@
        Map<String, Double> distance = GeodesyUtil.getDistance(now, old);
        if(null != distance){
            Double distance1 = distance.get("WGS84");
            if(distance1 > 50 && orderPrivateCar.getState() < 5){//大于50米表示在移动
            if(distance1 > 50 && Arrays.asList(3, 4).contains(orderPrivateCar.getState())){//大于50米表示在移动
                orderPrivateCar.setToStartPointMileage(new BigDecimal(orderPrivateCar.getToStartPointMileage()).add(new BigDecimal(distance1)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                this.updateById(orderPrivateCar);
                return true;
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/CompanyMapper.java
@@ -16,8 +16,18 @@
     */
    List<Company> query(@Param("province") String province, @Param("city") String city,
                        @Param("code") String code);
    /**
     * 根据行政区域代码获取企业
     * @param code
     * @return
     */
    Company query1(@Param("cityIds") List<Integer> cityIds);
    List<Company> queryList(@Param("city") String[] city, @Param("type") Integer type);
}
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DriverMapper.java
@@ -132,4 +132,15 @@
     * @return
     */
    Double getThisWeekMoney(@Param("driverId") Integer driverId);
    /**
     * 获取当前已上班type业务类型、设置了可以接此类型的单据、服务车型匹配且空闲的司机
     * @param type
     * @param serverCarModelId
     * @param companyId
     * @return
     */
    List<Driver> queryIdleDriver_(@Param("type") Integer type, @Param("serverCarModelId") Integer serverCarModelId,
                                  @Param("companyId") Integer companyId);
}
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/CarModelMapper.xml
@@ -18,6 +18,6 @@
        select
        id as id,
        name as name
        from t_car_model where state = 1 and brandId = #{brandId} and remark != '1'
        from t_car_model where state = 1 and brandId = #{brandId}
    </select>
</mapper>
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/CompanyMapper.xml
@@ -118,8 +118,70 @@
        </if>
        )
    </select>
    <select id="query1" resultType="Company">
        select
        id as id,
        isSpe as isSpe,
        isTaxi as isTaxi,
        isCross as isCross,
        isCrossLogistics as isCrossLogistics,
        isSameLogistics as isSameLogistics,
        isCharter as isCharter,
        isSpeFixedOrProportional as isSpeFixedOrProportional,
        isTaxiFixedOrProportional as isTaxiFixedOrProportional,
        isCrossLogisticsFixedOrProportional as isCrossLogisticsFixedOrProportional,
        isSameLogisticsFixedOrProportional as isSameLogisticsFixedOrProportional,
        speMoney as speMoney,
        taxiMoney as taxiMoney,
        crossLogisticsMoney as crossLogisticsMoney,
        sameLogisticsMoney as sameLogisticsMoney,
        isNeedFerry as isNeedFerry,
        name as name,
        type as type,
        superiorId as superiorId,
        principalName as principalName,
        principalPhone as principalPhone,
        adminName as adminName,
        adminPhone as adminPhone,
        urgentPhoen as urgentPhoen,
        setupTime as setupTime,
        identifier as identifier,
        addressCode as addressCode,
        businessScope as businessScope,
        contactAddress as contactAddress,
        documentAddress as documentAddress,
        economicType as economicType,
        regCapital as regCapital,
        legalName as legalName,
        legalId as legalId,
        legalPhone as legalPhone,
        legalPhotoUrl as legalPhotoUrl,
        licensingAgency as licensingAgency,
        licenseTime as licenseTime,
        licenseStartTime as licenseStartTime,
        licenseEndTime as licenseEndTime,
        licenseNumber as licenseNumber,
        carNum as carNum,
        driverNum as driverNum,
        mac as mac,
        state as state,
        flag as flag,
        upload as upload,
        insertTime as insertTime
        from t_company where flag != 3 and state = 0 and id in (
        select companyId from t_company_city where state = 1
        <if test="null != cityIds">
            and cityId in
            <foreach collection="cityIds" item="item" index="index" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        ) order by `type` desc limit 0, 1
    </select>
    <select id="queryList" resultType="Company">
        select
        id as id,
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverActivityHistoryMapper.xml
@@ -39,7 +39,7 @@
        carryOut as carryOut,
        money as money,
        insertTime as insertTime
        from t_driver_activity_history where `day` between #{start} and #{end}
        from t_driver_activity_history where `day` between #{start} and #{end} and driverActivityId in (select id from t_driver_activity where status = 3 and now() between startTime and endTime)
        <if test="null != type">
            and `type` = #{type}
        </if>
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverActivityOnlineMapper.xml
@@ -21,7 +21,8 @@
        a.id as id,
        a.type as type,
        a.online as online,
        a.money as money
        a.money as money,
        a.driverActivityId
        from t_driver_activity_online a
        left join t_driver_activity b on (a.driverActivityId = b.id)
        where (now() between b.startTime and b.endTime) and a.companyId = #{companyId} and b.status = 3
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverActivityOrderMapper.xml
@@ -23,7 +23,8 @@
        a.money as money,
        a.orderNum as orderNum,
        a.start as start,
        a.`end` as `end`
        a.`end` as `end`,
        a.driverActivityId
        from t_driver_activity_order a
        left join t_driver_activity b on (a.driverActivityId = b.id)
        where a.companyId = #{companyId} and (now() between a.startTime and a.endTime)  and b.status = 3
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverActivityRegisteredMapper.xml
@@ -20,7 +20,8 @@
        select
        a.id as id,
        CONCAT('邀请', if(a.`type` = 1, '司机', '用户'), '注册奖励GHS', a.money) as content,
        a.money as money
        a.money as money,
        a.driverActivityId
        from t_driver_activity_registered a
        left join t_driver_activity b on (a.driverActivityId = b.id)
        where now() between a.startTime and a.endTime and a.companyId = #{companyId} and a.`type` = #{type} and b.status = 3
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverMapper.xml
@@ -309,4 +309,40 @@
            date_format(insertTime, '%Y-%m-%d')
        ) = YEARWEEK(now())
    </select>
    <select id="queryIdleDriver_" resultType="Driver">
        select * from (
        select
        *
        from t_driver
        where flag != 3 and state = 2 and authState = 2
        <if test="null != companyId">
            <choose>
                <when test="companyId != 1">
                    and companyId = #{companyId} or franchiseeId = #{companyId}
                </when>
                <otherwise>
                    and companyId is null or companyId = 0 or companyId = 1 or franchiseeId is null or franchiseeId = 0
                </otherwise>
            </choose>
        </if>
        and id in
        (
        select driverId from t_driver_work where startTime &lt; now() and state = 1 and `type` like CONCAT('%', #{type}, '%')
        )
        and id in (select driverId from t_driver_orders where `type` = #{type})
        and carId in (select carId from t_car_service where `type` = #{type}
        <if test="null != serverCarModelId">
            and serverCarModelId = #{serverCarModelId}
        </if>
        )
        ) as aa <!--where aa.id not in (
        select driverId from t_order_private_car where isDelete = 1 and driverPay = 1 and state in (7, 8, 9)
        union all
        select driverId from t_order_logistics where isDelete = 1 and driverPay = 1 and state != 10
        )-->
    </select>
</mapper>
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/DriverActivityHistory.java
@@ -34,6 +34,11 @@
    @TableField("type")
    private Integer type;
    /**
     * 司机活动id
     */
    @TableField("driverActivityId")
    private Integer driverActivityId;
    /**
     * 活动id
     */
    @TableField("activityId")
@@ -85,7 +90,15 @@
    public void setType(Integer type) {
        this.type = type;
    }
    public Integer getDriverActivityId() {
        return driverActivityId;
    }
    public void setDriverActivityId(Integer driverActivityId) {
        this.driverActivityId = driverActivityId;
    }
    public Integer getActivityId() {
        return activityId;
    }
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ICompanyCityService.java
@@ -15,6 +15,7 @@
     * @throws Exception
     */
    Company query(String lon, String lat) throws Exception;
    Company query1(String lon, String lat) throws Exception;
    /**
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IDriverService.java
@@ -420,4 +420,18 @@
     * @return
     */
    Double getThisWeekMoney(@Param("driverId") Integer driverId);
    /**
     * 获取给定车型且空闲的司机
     * @param type
     * @param serverCarModelId
     * @param lon
     * @param lat
     * @param distance
     * @param companyId
     * @return
     * @throws Exception
     */
    List<Driver> queryIdleDriver(Integer type, Integer serverCarModelId, Double lon, Double lat, Double distance, Integer companyId) throws Exception;
}
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IOrderService.java
@@ -115,7 +115,8 @@
     * @return
     * @throws Exception
     */
    ResultUtil confirmFees(Integer language, Integer orderId, Integer orderType, Integer type, Double travelFee, Double parkingFee, Double crossingFee) throws Exception;
    ResultUtil confirmFees(Integer language, Integer orderId, Integer orderType, Integer type,
                           Double travelFee, Double parkingFee, Double crossingFee, Integer uid) throws Exception;
    /**
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IPushOrderService.java
New file
@@ -0,0 +1,19 @@
package com.stylefeng.guns.modular.system.service;
import com.baomidou.mybatisplus.service.IService;
import com.stylefeng.guns.modular.system.model.PushOrder;
import java.util.List;
public interface IPushOrderService extends IService<PushOrder> {
    /**
     * 获取推送配置数据
     * @param type
     * @param pushType
     * @return
     * @throws Exception
     */
    List<PushOrder> querys(Integer type, Integer pushType, Integer companyId) throws Exception;
}
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/CompanyCityServiceImpl.java
@@ -1,18 +1,26 @@
package com.stylefeng.guns.modular.system.service.impl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.modular.system.dao.CompanyCityMapper;
import com.stylefeng.guns.modular.system.dao.CompanyMapper;
import com.stylefeng.guns.modular.system.model.City;
import com.stylefeng.guns.modular.system.model.Company;
import com.stylefeng.guns.modular.system.model.CompanyCity;
import com.stylefeng.guns.modular.system.service.ICityService;
import com.stylefeng.guns.modular.system.service.ICompanyCityService;
import com.stylefeng.guns.modular.system.util.GDMapGeocodingUtil;
import com.stylefeng.guns.modular.system.util.GoogleMap.AddressComponentsVo;
import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil;
import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
@@ -23,6 +31,9 @@
    @Autowired
    private GDMapGeocodingUtil gdMapGeocodingUtil;
    @Autowired
    private ICityService cityService;
    /**
@@ -39,8 +50,22 @@
        Company query = this.query(districtCode);
        return query;
    }
    @Override
    public Company query1(String lon, String lat) throws Exception {
        ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(lat), Double.valueOf(lon));
        if(null == reverseGeocode){
            return null;
        }
        AddressComponentsVo[] addressComponentsVos = reverseGeocode.getAddressComponentsVos();
        String[] citys = new String[addressComponentsVos.length];
        for (int i = 0; i < addressComponentsVos.length; i++) {
            citys[i] = addressComponentsVos[i].getLongName();
        }
        Company query = this.query1(citys);
        return query;
    }
    /**
     * 根据行政编号获取所属企业
     * @param code
@@ -82,4 +107,16 @@
        }
        return null;
    }
    public Company query1(String[] city) throws Exception {
        List<City> cities = cityService.selectList(new EntityWrapper<City>().in("chineseName", Arrays.asList(city)).or()
                .in("englishName", Arrays.asList(city)).or().in("frenchName", Arrays.asList(city)));
        List<Integer> collect = cities.stream().map(City::getId).collect(Collectors.toList());
        if(collect.size() == 0){
            return null;
        }
        return companyMapper.query1(collect);
    }
}
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverOnlineServiceImpl.java
@@ -156,7 +156,7 @@
        }
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        List<DriverActivityHistory> driverActivityHistories = driverActivityHistoryMapper.selectList(new EntityWrapper<DriverActivityHistory>().eq("driverId", driverId)
                .eq("type", 3).eq("carryOut", 1).last(" and day = '" + sdf.format(new Date()) + "'"));
                .eq("type", 3).eq("carryOut", 1).last(" and day = '" + sdf.format(new Date()) + "' and driverActivityId in (select id from t_driver_activity where status = 3 and now() between startTime and endTime)"));
        //生成每个活动从开始上班到当前时间的时长记录
        for (DriverActivityHistory driverActivityHistory : driverActivityHistories) {
            String value = redisUtil.getValue("driverActivity_" + driverId + "_" + driverActivityHistory.getId());
@@ -164,10 +164,10 @@
                JSONObject jsonObject = JSON.parseObject(value);
                Long startTime = jsonObject.getLong("startTime");
                long time = System.currentTimeMillis() - startTime;
                redisUtil.setStrValue("driverActivity_" + driverId + "_" + driverActivityHistory.getId(), "{\"startTime\":" + startTime + ", \"time\":" + time + "}");
                redisUtil.setStrValue("driverActivity_" + driverId + "_" + driverActivityHistory.getId(), "{\"startTime\":" + startTime + ", \"time\":" + time + "}", 172800);
            }else{
                long time = System.currentTimeMillis() - driverWork.getStartTime().getTime();
                redisUtil.setStrValue("driverActivity_" + driverId + "_" + driverActivityHistory.getId(), "{\"startTime\":" + driverWork.getStartTime().getTime() + ", \"time\":" + time + "}");
                redisUtil.setStrValue("driverActivity_" + driverId + "_" + driverActivityHistory.getId(), "{\"startTime\":" + driverWork.getStartTime().getTime() + ", \"time\":" + time + "}", 172800);
            }
        }
    }
@@ -241,16 +241,17 @@
                String msg = language == 1 ? "您已连续" + driverActivityOnline.getOfflineTime() + "小时未接单,系统将强制更改您的状态为:下班" :
                        language == 2 ? "You have not been accepting orders for " + driverActivityOnline.getOfflineTime() + " hour(s) System will change your state to Off-work" :
                                "Vous n’acceptez pas de commandes depuis " + driverActivityOnline.getOfflineTime() + " heure(s) Le système changera votre état en Hors travail";
                String fileName = "OffLine" + driver.getId() + ".mp3";
                String audioUrl = null;
                try {
                    audioUrl = TextToSpeechUtil.create(language == 1 ? "cmn-CN" : language == 2 ? "en-US" : "fr-FR", msg, "OffLine" + driver.getId() + ".mp3");
                    audioUrl = TextToSpeechUtil.create(language == 1 ? "cmn-CN" : language == 2 ? "en-US" : "fr-FR", msg, fileName);
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
                Map<String, String> map = new HashMap<>();
                map.put("msg", msg);
                map.put("audioUrl", audioUrl);
                pushUtil.pushOffline(driverOnline.getDriverId(), 2, map);
                pushUtil.afterWork(driverOnline.getDriverId(), 2, map);
                
                //定时任务删除语音文件
                new Timer().schedule(new TimerTask() {
@@ -258,7 +259,7 @@
                    public void run() {
                        Process process = null;
                        try {
                            process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/OffLine" + driver.getId() + ".mp3");
                            process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName);
                        } catch (IOException e) {
                            throw new RuntimeException(e);
                        }
@@ -279,7 +280,7 @@
    public void deductionDuration1() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        List<DriverActivityHistory> driverActivityHistories = driverActivityHistoryMapper.selectList(new EntityWrapper<DriverActivityHistory>()
                .eq("type", 3).eq("carryOut", 1).last(" and day = '" + sdf.format(new Date()) + "'"));
                .eq("type", 3).eq("carryOut", 1).last(" and day = '" + sdf.format(new Date()) + "' and driverActivityId in (select id from t_driver_activity where status = 3 and now() between startTime and endTime)"));
        for (DriverActivityHistory driverActivityHistory : driverActivityHistories) {
            DriverWork driverWork = driverWorkService.selectOne(new EntityWrapper<DriverWork>().eq("driverId", driverActivityHistory.getDriverId()).eq("state", 1));
            if(null == driverWork){
@@ -317,16 +318,17 @@
                String msg = language == 1 ? "您已连续" + driverActivityOnline.getOfflineTime() + "小时未接单,系统将强制更改您的状态为:下班" :
                        language == 2 ? "You have not been accepting orders for " + driverActivityOnline.getOfflineTime() + " hour(s) System will change your state to Off-work" :
                                "Vous n’acceptez pas de commandes depuis " + driverActivityOnline.getOfflineTime() + " heure(s) Le système changera votre état en Hors travail";
                String fileName = "OffLine" + driver.getId() + ".mp3";
                String audioUrl = null;
                try {
                    audioUrl = TextToSpeechUtil.create(language == 1 ? "cmn-CN" : language == 2 ? "en-US" : "fr-FR", msg, "OffLine" + driver.getId() + ".mp3");
                    audioUrl = TextToSpeechUtil.create(language == 1 ? "cmn-CN" : language == 2 ? "en-US" : "fr-FR", msg, fileName);
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
                Map<String, String> map = new HashMap<>();
                map.put("msg", msg);
                map.put("audioUrl", audioUrl);
                pushUtil.pushOffline(driverWork.getDriverId(), 2, map);
                pushUtil.afterWork(driverWork.getDriverId(), 2, map);
    
                //定时任务删除语音文件
                new Timer().schedule(new TimerTask() {
@@ -334,7 +336,7 @@
                    public void run() {
                        Process process = null;
                        try {
                            process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/OffLine" + driver.getId() + ".mp3");
                            process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName);
                        } catch (IOException e) {
                            throw new RuntimeException(e);
                        }
@@ -359,7 +361,7 @@
                    driverOnline.setDuration(driverOnline.getDuration() + (time * 60));
                    this.updateById(driverOnline);
                }
                redisUtil.setStrValue("driverActivity_" + driverActivityHistory.getDriverId() + "_" + driverActivityHistory.getId(), "{\"startTime\":" + System.currentTimeMillis() + ", \"time\":" + 0 + "}");
                redisUtil.setStrValue("driverActivity_" + driverActivityHistory.getDriverId() + "_" + driverActivityHistory.getId(), "{\"startTime\":" + System.currentTimeMillis() + ", \"time\":" + 0 + "}", 172800);
            }
        }
    }
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverServiceImpl.java
@@ -17,10 +17,7 @@
import com.stylefeng.guns.modular.system.model.*;
import com.stylefeng.guns.modular.system.service.*;
import com.stylefeng.guns.modular.system.util.*;
import com.stylefeng.guns.modular.system.util.GoogleMap.AddressComponentsVo;
import com.stylefeng.guns.modular.system.util.GoogleMap.FleetEngineUtil;
import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil;
import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo;
import com.stylefeng.guns.modular.system.util.GoogleMap.*;
import com.stylefeng.guns.modular.system.util.itextpdf.HtmlToPdfUtils;
import com.stylefeng.guns.modular.system.warpper.*;
import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService;
@@ -334,6 +331,7 @@
                BigDecimal bigDecimal = new BigDecimal("0");
                for(Map<String, Object> map : query){
                    DriverActivityHistory dah = new DriverActivityHistory();
                    dah.setDriverActivityId(Integer.valueOf(map.get("driverActivityId").toString()));
                    dah.setActivityId(Integer.valueOf(map.get("id").toString()));
                    dah.setDriverId(uid);
                    dah.setType(1);
@@ -529,6 +527,7 @@
                BigDecimal bigDecimal = new BigDecimal("0");
                for(Map<String, Object> map : query){
                    DriverActivityHistory dah = new DriverActivityHistory();
                    dah.setDriverActivityId(Integer.valueOf(map.get("driverActivityId").toString()));
                    dah.setActivityId(Integer.valueOf(map.get("id").toString()));
                    dah.setDriverId(uid);
                    dah.setType(1);
@@ -1097,22 +1096,25 @@
                loginWarpper.setJumpCode("200000");
            }
        }
        //司机登录,添加谷歌上的车辆信息
        Car car = carService.selectById(driver.getCarId());
        if(null == car){
            return ResultUtil.error(language == 1 ? "登录失败,请先绑定车辆" : language == 2 ? "Login failed, please bind the vehicle first" : "La connexion a échoué, veuillez d’abord lier le véhicule");
        if(null != driver.getCarId()){
            Car car = carService.selectById(driver.getCarId());
            if(!StringUtils.hasLength(car.getVehicleId())){
                car.setVehicleId(UUIDUtil.getRandomCode());
                carService.updateById(car);
            }
            new Thread(()->{
                try {
                    CarModel carModel = carModelMapper.selectById(car.getCarModelId());
                    String vehicles = fleetEngineUtil.getVehicles(car.getVehicleId());
                    if(ToolUtil.isEmpty(vehicles)) {
                        fleetEngineUtil.createVehicles(carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
                    }
                }catch (Exception e){
                    e.printStackTrace();
                }
            }).start();
            loginWarpper.setVehicleId(car.getVehicleId());
        }
        if(!StringUtils.hasLength(car.getVehicleId())){
            car.setVehicleId(UUIDUtil.getRandomCode());
            carService.updateById(car);
        }
        String vehicles = fleetEngineUtil.getVehicles(car.getVehicleId());
        if(ToolUtil.isEmpty(vehicles)){
            CarModel carModel = carModelMapper.selectById(car.getCarModelId());
            fleetEngineUtil.createVehicles(carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
        }
        loginWarpper.setVehicleId(car.getVehicleId());
        return ResultUtil.success(loginWarpper);
    }
@@ -1125,6 +1127,9 @@
     */
    @Override
    public Map<String, Object> queryHomeData(Integer uid, Integer language) throws Exception {
        Driver driver = this.selectById(uid);
        driver.setLanguage(language);
        this.updateById(driver);
        Map<String, Object> map = driverMapper.queryHomeData(uid);
        int size = this.queryMyActivity(uid, new Date(), language).size();
        map.put("activity", size);
@@ -1186,8 +1191,10 @@
    public ResultUtil work(Integer uid, String type, Integer language) throws Exception {
        DriverWork driverWork = driverWorkMapper.queryNewWork(uid, null, 1);
        Driver driver = this.selectById(uid);
        driver.setLanguage(language);
        Car car = carService.selectById(driver.getCarId());
        String audioUrl = "";
        LoginWarpper loginWarpper = new LoginWarpper();
        if(null != driverWork){//作下班操作
            //检测是否有未完成的订单
            List<Map<String, Object>> list = orderService.queryOrderList(1, 1, 10, uid, language);
@@ -1205,26 +1212,32 @@
            }
    
            //司机下班,修改谷歌上的车辆信息
            CarModel carModel = carModelMapper.selectById(car.getCarModelId());
            String vehicles = fleetEngineUtil.getVehicles(car.getVehicleId());
            if(ToolUtil.isEmpty(vehicles)){
                fleetEngineUtil.createVehicles(carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
            }else{
                fleetEngineUtil.updateVehicles("OFFLINE", carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
            }
            new Thread(()->{
                try {
                    CarModel carModel = carModelMapper.selectById(car.getCarModelId());
                    String vehicles = fleetEngineUtil.getVehicles(car.getVehicleId());
                    if(ToolUtil.isEmpty(vehicles)){
                        fleetEngineUtil.createVehicles(carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
                        fleetEngineUtil.updateVehicles("OFFLINE", carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
                    }else{
                        fleetEngineUtil.updateVehicles("OFFLINE", carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
                    }
                }catch (Exception e){
                    e.printStackTrace();
                }
            }).start();
            switch (language){
                case 1:
                    audioUrl = "http://182.160.16.251:81/files/audio/AfterWork-CN.mp3";
                    audioUrl = "http://182.160.16.251:81/files/audio/system/AfterWork-CN.mp3";
                    break;
                case 2:
                    audioUrl = "http://182.160.16.251:81/files/audio/AfterWork-EN.mp3";
                    audioUrl = "http://182.160.16.251:81/files/audio/system/AfterWork-EN.mp3";
                    break;
                case 3:
                    audioUrl = "http://182.160.16.251:81/files/audio/AfterWork-FR.mp3";
                    audioUrl = "http://182.160.16.251:81/files/audio/system/AfterWork-FR.mp3";
                    break;
            }
        }else{
            LoginWarpper loginWarpper = new LoginWarpper();
            if(driver.getCompanyId()==null){
                loginWarpper.setJumpCode("100000");
                return ResultUtil.success(loginWarpper);
@@ -1250,6 +1263,8 @@
            if(car.getAuthState()==4){
                return ResultUtil.error(language == 1 ? "请完善资料后再出车" : language == 2 ? "Please complete data before driving." : "Veuillez compléter les données avant de conduire.");
            }
            driverWork = new DriverWork();
            driverWork.setState(1);
            driverWork.setDriverId(uid);
@@ -1264,28 +1279,40 @@
            }
            
            //司机上班,修改谷歌上的车辆信息
            CarModel carModel = carModelMapper.selectById(car.getCarModelId());
            String vehicles = fleetEngineUtil.getVehicles(car.getVehicleId());
            if(ToolUtil.isEmpty(vehicles)){
                fleetEngineUtil.createVehicles(carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
            }else{
                fleetEngineUtil.updateVehicles("ONLINE", carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
            }
            new Thread(new Runnable() {
                @Override
                public void run() {
                    try {
                        CarModel carModel = carModelMapper.selectById(car.getCarModelId());
                        String vehicles = fleetEngineUtil.getVehicles(car.getVehicleId());
                        if(ToolUtil.isEmpty(vehicles)){
                            fleetEngineUtil.createVehicles(carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
                            fleetEngineUtil.updateVehicles("ONLINE", carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
                        }else{
                            fleetEngineUtil.updateVehicles("ONLINE", carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
                        }
                    }catch (Exception e){
                        e.printStackTrace();
                    }
                }
            }).start();
    
            switch (language){
                case 1:
                    audioUrl = "http://182.160.16.251:81/files/audio/AtWork-CN.mp3";
                    audioUrl = "http://182.160.16.251:81/files/audio/system/AtWork-CN.mp3";
                    break;
                case 2:
                    audioUrl = "http://182.160.16.251:81/files/audio/AtWork-EN.mp3";
                    audioUrl = "http://182.160.16.251:81/files/audio/system/AtWork-EN.mp3";
                    break;
                case 3:
                    audioUrl = "http://182.160.16.251:81/files/audio/AtWork-FR.mp3";
                    audioUrl = "http://182.160.16.251:81/files/audio/system/AtWork-FR.mp3";
                    break;
            }
        }
        this.updateById(driver);
        return ResultUtil.success(audioUrl);
        loginWarpper.setAudioUrl(audioUrl);
        loginWarpper.setVehicleId(car.getVehicleId());
        return ResultUtil.success(loginWarpper);
    }
@@ -1409,13 +1436,6 @@
                    break;
            }
            maps.add(baseWarpper);
        }
        DriverOrders query = driverOrdersMapper.query(uid, 1);
        if(null == query){
            query = new DriverOrders();
            query.setDriverId(uid);
            query.setType(1);
            driverOrdersMapper.insert(query);
        }
        return maps;
    }
@@ -1854,6 +1874,7 @@
            for(Map<String, Object> map : query){
                for(Driver driver : drivers){
                    DriverActivityHistory driverActivityHistory = new DriverActivityHistory();
                    driverActivityHistory.setDriverActivityId(Integer.valueOf(map.get("driverActivityId").toString()));
                    driverActivityHistory.setActivityId(Integer.valueOf(String.valueOf(map.get("id"))));
                    driverActivityHistory.setType(1);
                    driverActivityHistory.setDriverId(driver.getId());
@@ -1981,6 +2002,7 @@
            for(Map<String, Object> map : query){
                for(Driver driver : drivers){
                    DriverActivityHistory driverActivityHistory = new DriverActivityHistory();
                    driverActivityHistory.setDriverActivityId(Integer.valueOf(map.get("driverActivityId").toString()));
                    driverActivityHistory.setActivityId(Integer.valueOf(String.valueOf(map.get("id"))));
                    driverActivityHistory.setType(2);
                    driverActivityHistory.setDriverId(driver.getId());
@@ -2104,6 +2126,7 @@
                DriverActivityOnline driverActivityOnline = driverActivityOnlineMapper.selectById(Integer.valueOf(String.valueOf(map.get("id"))));
                for(Driver driver : drivers){
                    DriverActivityHistory driverActivityHistory = new DriverActivityHistory();
                    driverActivityHistory.setDriverActivityId(Integer.valueOf(map.get("driverActivityId").toString()));
                    driverActivityHistory.setActivityId(Integer.valueOf(String.valueOf(map.get("id"))));
                    driverActivityHistory.setType(3);
                    driverActivityHistory.setDriverId(driver.getId());
@@ -2227,6 +2250,7 @@
                DriverActivityOrder driverActivityOrder = driverActivityOrderMapper.selectById(Integer.valueOf(String.valueOf(map.get("id"))));
                for(Driver driver : drivers){
                    DriverActivityHistory driverActivityHistory = new DriverActivityHistory();
                    driverActivityHistory.setDriverActivityId(Integer.valueOf(map.get("driverActivityId").toString()));
                    driverActivityHistory.setActivityId(Integer.valueOf(String.valueOf(map.get("id"))));
                    driverActivityHistory.setType(4);
                    driverActivityHistory.setDriverId(driver.getId());
@@ -3078,4 +3102,35 @@
    public Double getThisWeekMoney(Integer driverId) {
        return this.baseMapper.getThisWeekMoney(driverId);
    }
    /**
     * 获取给定车型且空闲的司机
     * @param type
     * @param serverCarModelId
     * @param lon
     * @param lat
     * @param distance
     * @param companyId
     * @return
     * @throws Exception
     */
    @Override
    public List<Driver> queryIdleDriver(Integer type, Integer serverCarModelId, Double lon, Double lat, Double distance, Integer companyId) throws Exception {
        List<Driver> drivers = driverMapper.queryIdleDriver_(type, serverCarModelId, companyId);
        List<Driver> list = new ArrayList<>();
        for(Driver driver : drivers){
            String value = redisUtil.getValue("DRIVER" + driver.getId());
            if(ToolUtil.isNotEmpty(value)){
                DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(lat, lon, Double.parseDouble(value.split(",")[1]), Double.parseDouble(value.split(",")[0]));
                if(null != distancematrix){
                    if(distancematrix.getDistance() < (distance * 1000)){
                        list.add(driver);
                    }
                }
            }
        }
        return list;
    }
}
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/OrderServiceImpl.java
@@ -521,25 +521,6 @@
        if(null != map.get("telX")){
            map.put("phone", map.get("telX"));
        }
        Integer companyId = 1;
        if(null != map.get("driverId")){
            companyId = Integer.valueOf(String.valueOf(map.get("companyId")));
        }
        CancleOrder cancleOrder = cancleOrderService.selectOne(new EntityWrapper<CancleOrder>().eq("companyId", companyId));
        JSONObject jsonObject = JSON.parseObject(cancleOrder.getContent());
        int driverTimeout = jsonObject.getIntValue("driverTimeout");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Integer type = Integer.valueOf(map.get("orderType").toString());
        if(type == 2){
            String travelTime = map.get("travelTime").toString();
            long time = System.currentTimeMillis() - sdf.parse(travelTime).getTime() - (driverTimeout * 60000);
            map.put("timeOutCancel", Double.valueOf(time / 60000).intValue());
        }else{
            String estimateArriveTime = map.get("estimateArriveTime").toString();
            long time = System.currentTimeMillis() - sdf.parse(estimateArriveTime).getTime() - (driverTimeout * 60000);
            map.put("timeOutCancel", Double.valueOf(time / 60000).intValue());
        }
        return map;
    }
@@ -594,13 +575,13 @@
        String address = reverseGeocode.getAddress();
        switch (orderType){
            case 1://专车
                return orderPrivateCarService.process(orderId, state, lon, lat, address, phone, language);
                return orderPrivateCarService.process(orderId, state, lon, lat, address, phone, language, uid);
            case 2://出租
//                return orderTaxiService.process(orderId, state, lon, lat, address);
            case 3://城际
//                return orderCrossCityService.process(orderId, state, lon, lat, address);
            case 4://同城小件
                return orderLogisticsService.process(orderId, state, lon, lat, address, pickUpCode, language);
                return orderLogisticsService.process(orderId, state, lon, lat, address, pickUpCode, language, uid);
            case 5://跨城小件
//                return orderLogisticsService.process(orderId, state, lon, lat, address);
            case 6:
@@ -622,16 +603,17 @@
     * @throws Exception
     */
    @Override
    public ResultUtil confirmFees(Integer language, Integer orderId, Integer orderType, Integer type, Double travelFee, Double parkingFee, Double crossingFee) throws Exception {
    public ResultUtil confirmFees(Integer language, Integer orderId, Integer orderType, Integer type, Double travelFee,
                                  Double parkingFee, Double crossingFee, Integer uid) throws Exception {
        switch (orderType){
            case 1://专车
                return orderPrivateCarService.confirmFees(language, orderId, type, parkingFee, crossingFee);
                return orderPrivateCarService.confirmFees(language, orderId, type, parkingFee, crossingFee, uid);
            case 2://出租
                return orderTaxiService.confirmFees(orderId, type, travelFee, parkingFee, crossingFee);
            case 3://城际(没有此流程)
                break;
            case 4://
                return orderLogisticsService.confirmFees(language, orderId, type, parkingFee, crossingFee);
                return orderLogisticsService.confirmFees(language, orderId, type, parkingFee, crossingFee, uid);
            case 5:
                break;
            case 6:
@@ -1056,8 +1038,8 @@
        new Thread(new Runnable() {
            @Override
            public void run() {
                pushUtil.pushOrderState(1, finalUserId, orderId, orderType, finalState);
                pushUtil.pushOrderState(2, finalDriverId, orderId, orderType, finalState);
                pushUtil.pushOrderState(1, finalUserId, orderId, orderType, finalState, 0, "");
                pushUtil.pushOrderState(2, finalDriverId, orderId, orderType, finalState, 0, "");
            }
        }).start();
        return ResultUtil.success();
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/PushOrderServiceImpl.java
New file
@@ -0,0 +1,31 @@
package com.stylefeng.guns.modular.system.service.impl;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.modular.system.dao.PushOrderMapper;
import com.stylefeng.guns.modular.system.model.PushOrder;
import com.stylefeng.guns.modular.system.service.IPushOrderService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class PushOrderServiceImpl extends ServiceImpl<PushOrderMapper, PushOrder> implements IPushOrderService {
    @Resource
    private PushOrderMapper pushOrderMapper;
    /**
     * 获取推送配置
     * @param type
     * @param pushType
     * @return
     * @throws Exception
     */
    @Override
    public List<PushOrder> querys(Integer type, Integer pushType, Integer companyId) throws Exception {
        return pushOrderMapper.querys(type, pushType, companyId);
    }
}
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/ReassignServiceImpl.java
@@ -1,5 +1,7 @@
package com.stylefeng.guns.modular.system.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity;
@@ -9,14 +11,20 @@
import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsSpreadService;
import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar;
import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService;
import com.stylefeng.guns.modular.system.dao.DispatchMapper;
import com.stylefeng.guns.modular.system.dao.ReassignMapper;
import com.stylefeng.guns.modular.system.dao.SensitiveWordsMapper;
import com.stylefeng.guns.modular.specialTrain.server.impl.OrderPrivateCarServiceImpl;
import com.stylefeng.guns.modular.system.dao.*;
import com.stylefeng.guns.modular.system.model.*;
import com.stylefeng.guns.modular.system.service.*;
import com.stylefeng.guns.modular.system.util.*;
import com.stylefeng.guns.modular.system.util.GoogleMap.DistancematrixVo;
import com.stylefeng.guns.modular.system.util.GoogleMap.FleetEngineUtil;
import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil;
import com.stylefeng.guns.modular.system.util.quartz.QuartzUtil;
import com.stylefeng.guns.modular.system.util.quartz.jobs.OrderTimeOutJob;
import com.stylefeng.guns.modular.taxi.model.OrderTaxi;
import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService;
import org.apache.shiro.util.StringUtils;
import org.quartz.JobDataMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@@ -25,7 +33,9 @@
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
@@ -68,6 +78,15 @@
    @Autowired
    private IOrderPrivateCarService orderPrivateCarService;
    @Autowired
    private ICompanyCityService companyCityService;
    @Autowired
    private IPushOrderService pushOrderService;
    @Autowired
    private PushUtil pushUtil;
    @Autowired
    private IOrderCrossCityService orderCrossCityService;
@@ -83,6 +102,27 @@
    @Value("${callbackPath}")
    private String callbackPath;
    @Resource
    private RedisUtil redisUtil;
    @Resource
    private ICarService carService;
    @Resource
    private ISysOvertimeService sysOvertimeService;
    @Resource
    private ICancleOrderService cancleOrderService;
    @Resource
    private UserInfoMapper userInfoMapper;
    @Resource
    private FleetEngineUtil fleetEngineUtil;
    @Resource
    private CarModelMapper carModelMapper;
@@ -155,6 +195,437 @@
                "Your request for reassignment was submitted, we shall handle it for you as soon as possible." :
                "Votre demande de réaffectation a été soumise. Nous la traiterons pour vous dans les plus brefs délais.", uid);
        //开始自动完成改派
        switch (reassign.getOrderType()){
            case 1:
                OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(reassign.getOrderId());
                Company company = companyCityService.query1(String.valueOf(orderPrivateCar.getStartLon()), String.valueOf(orderPrivateCar.getStartLat()));//获取起点所属分公司
                PushOrder pushOrder = pushOrderService.querys(1, 1, company.getId()).get(0);
                //获取空闲司机
                List<Driver> list = driverService.queryIdleDriver(1, orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机
                System.err.println("【" + orderPrivateCar.getId() + "】空闲司机:" + JSON.toJSONString(list));
                if(list.size() > 0){
                    String text = "";
                    Driver driver1 = list.get(0);
                    reassign.setState(3);
                    reassign.setNowDriverId(driver1.getId());
                    reassign.setNowCarId(driver1.getCarId());
                    reassign.setCompleteTime(new Date());
                    this.updateById(reassign);
                    Integer language1 = driver1.getLanguage();
                    switch (language1){
                        case 1:
                            text = "收到新的打车订单,从" + orderPrivateCar.getStartAddress() + "出发,全程约" + orderPrivateCar.getEstimatedMileage() + "公里";
                            break;
                        case 2:
                            text = "Received a new ride order, starting from " + orderPrivateCar.getStartAddress() + ", the whole journey is about " + orderPrivateCar.getEstimatedMileage() + "kilometre";
                            break;
                        case 3:
                            text = "J'ai reçu une nouvelle commande de course, à partir de " + orderPrivateCar.getStartAddress() + ", le trajet complet est d’environ " + orderPrivateCar.getEstimatedMileage() + "kilométrage";
                            break;
                    }
                    String audioUrl = "";
                    String fileName = "pushOrder" + orderPrivateCar.getDriverId() + UUIDUtil.getRandomCode(5) + ".mp3";
                    try {
                        audioUrl = TextToSpeechUtil.create(language1 == 1 ? "cmn-CN" : language1 == 2 ? "en-US" : "fr-FR", text, fileName);
                    } catch (Exception e) {
                        throw new RuntimeException(e);
                    }
                    //定时任务删除语音文件
                    new Timer().schedule(new TimerTask() {
                        @Override
                        public void run() {
                            Process process = null;
                            try {
                                process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName);
                            } catch (IOException e) {
                                throw new RuntimeException(e);
                            }
                            if (process != null) {
                                process.destroy();
                            }
                        }
                    }, 30000);
                    orderPrivateCar.setDriverId(driver1.getId());
                    orderPrivateCar.setCarId(driver1.getCarId());
                    orderPrivateCar.setCompanyId(driver1.getFranchiseeId() != null && driver1.getFranchiseeId() != 0 ? driver1.getFranchiseeId() : (
                            driver1.getCompanyId() != null && driver1.getCompanyId() != 0 ? driver1.getCompanyId() : 1));
                    orderPrivateCar.setSnatchOrderTime(new Date());
                    orderPrivateCar.setState(orderPrivateCar.getOldState());
                    orderPrivateCar.setOldState(null);
                    if(!StringUtils.hasLength(orderPrivateCar.getTripId())){
                        orderPrivateCar.setTripId(UUIDUtil.getRandomCode());
                    }
                    if(orderPrivateCar.getOrderType() == 1){
                        String value = redisUtil.getValue("DRIVER" + driver1.getId());
                        if(ToolUtil.isNotEmpty(value)) {
                            String[] split = value.split(",");
                            DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]));
                            //超时时间
                            long timeOut = System.currentTimeMillis() + (distancematrix.getDuration() * 1000);
                            orderPrivateCar.setEstimateArriveTime(new Date(timeOut));
                            orderPrivateCar.setEstimateArriveMileage(distancematrix.getDistance());
                        }
                    }
                    orderPrivateCarService.updateAllColumnById(orderPrivateCar);
                    driver1.setState(3);
                    driverService.updateById(driver1);
                    driver.setState(2);
                    driverService.updateById(driver);
                    //删除定时任务
                    QuartzUtil.deleteQuartzTask("1_" + orderPrivateCar.getId() + "_1","ORDER_TIME_OUT");
                    QuartzUtil.deleteQuartzTask("2_1_" + orderPrivateCar.getId() + "_1","ORDER_TIME_OUT");
                    QuartzUtil.deleteQuartzTask("2_2_" + orderPrivateCar.getId() + "_1","ORDER_TIME_OUT");
                    QuartzUtil.deleteQuartzTask("3_" + orderPrivateCar.getId() + "_1","ORDER_TIME_OUT");
                    /**
                     * 超时用户取消不收费的提醒
                     *   预约单:行程时间 + 配置不收费的时间 > 当前时间 (只弹一次)
                     *   即时单:预估到达预约点时间 + 配置不收费的时间 > 当前时间 (只弹一次)
                     *
                     * 超时用户取消订单后需要弹给司机提醒弹框,超时时间 = 当前时间 - 行程时间 - 配置不收费的时间
                     *
                     * 定时提醒弹框
                     *   司机只要开始超时且还未到达预约点,则需要定时提醒
                     *
                     * 预约单需要提前xx分钟提醒司机需要接乘客,过后每隔xx分钟提醒一次。超时后停止提醒
                     */
                    //添加定时任务(普通任务)
                    SysOvertime reminderRules = sysOvertimeService.selectOne(new EntityWrapper<SysOvertime>().eq("companyId", driver1.getCompanyId()));
                    if(null != reminderRules){
                        CancleOrder cancleOrder = cancleOrderService.selectOne(new EntityWrapper<CancleOrder>().eq("companyId", driver1.getCompanyId()));
                        Integer driverTimeout = JSON.parseObject(cancleOrder.getContent()).getInteger("driverTimeout");
                        //即时单
                        if(orderPrivateCar.getOrderType() == 1){
                            //超时时间
                            long timeOut = orderPrivateCar.getEstimateArriveTime().getTime() + (driverTimeout * 60 * 1000);
                            //乘客取消不收费提醒
                            JobDataMap jobDataMap = new JobDataMap();
                            jobDataMap.put("driverId", driver1.getId());
                            jobDataMap.put("timeOutType", 1);
                            jobDataMap.put("orderId", orderPrivateCar.getId());
                            jobDataMap.put("orderType", 1);
                            jobDataMap.put("language", language1);
                            jobDataMap.put("timeOut", timeOut);
                            jobDataMap.put("driverTimeout", driverTimeout);
                            jobDataMap.put("describe", language1 == 1 ? "您已超时" + driverTimeout + "分钟,用户可免费取消订单" : language1 == 2 ? "Reminder You are overdue for " + driverTimeout + " minutes The subscriber could cancel the order for free Confirm" : "Rappel Vous êtes en retard de " + driverTimeout + " minutes L’abonné peut annuler la commande gratuitement Confirmer");
                            QuartzUtil.addSimpleQuartzTask(
                                    new OrderTimeOutJob().buildQuartzJob("1_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap)
                                    , new Date(timeOut), timeOut, 0);
                            //超时循环提醒
                            jobDataMap = new JobDataMap();
                            jobDataMap.put("driverId", driver1.getId());
                            jobDataMap.put("timeOutType", 3);
                            jobDataMap.put("orderId", orderPrivateCar.getId());
                            jobDataMap.put("orderType", 1);
                            jobDataMap.put("language", language1);
                            jobDataMap.put("timeOut", orderPrivateCar.getEstimateArriveTime().getTime());
                            jobDataMap.put("driverTimeout", 0);
                            jobDataMap.put("describe", "");
                            QuartzUtil.addSimpleQuartzTask(
                                    new OrderTimeOutJob().buildQuartzJob("3_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap)
                                    , orderPrivateCar.getEstimateArriveTime(), reminderRules.getCar() * 60000, -1);
                        }else{
                            //超时时间
                            long timeOut = orderPrivateCar.getTravelTime().getTime() + (driverTimeout * 60000);
                            //乘客取消不收费提醒
                            JobDataMap jobDataMap = new JobDataMap();
                            jobDataMap.put("driverId", driver1.getId());
                            jobDataMap.put("timeOutType", 1);
                            jobDataMap.put("orderId", orderPrivateCar.getId());
                            jobDataMap.put("orderType", 1);
                            jobDataMap.put("language", language1);
                            jobDataMap.put("timeOut", timeOut);
                            jobDataMap.put("driverTimeout", driverTimeout);
                            jobDataMap.put("describe", language1 == 1 ? "您已超时" + driverTimeout + "分钟,用户可免费取消订单" : language1 == 2 ? "Reminder You are overdue for " + driverTimeout + " minutes The subscriber could cancel the order for free Confirm" : "Rappel Vous êtes en retard de " + driverTimeout + " minutes L’abonné peut annuler la commande gratuitement Confirmer");
                            QuartzUtil.addSimpleQuartzTask(
                                    new OrderTimeOutJob().buildQuartzJob("1_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap)
                                    , new Date(timeOut), timeOut, 0);
                            UserInfo userInfo = userInfoMapper.selectById(orderPrivateCar.getUserId());
                            //预约单出发首次提醒
                            long travelTime = orderPrivateCar.getTravelTime().getTime() - reminderRules.getReserveTime() * 60000;
                            SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
                            jobDataMap = new JobDataMap();
                            jobDataMap.put("driverId", driver1.getId());
                            jobDataMap.put("timeOutType", 2);
                            jobDataMap.put("orderId", orderPrivateCar.getId());
                            jobDataMap.put("orderType", 1);
                            jobDataMap.put("language", language1);
                            jobDataMap.put("timeOut", timeOut);
                            jobDataMap.put("driverTimeout", 0);
                            jobDataMap.put("describe", language1 == 1 ? "您将于" + sdf.format(orderPrivateCar.getTravelTime()) + "去接" + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName())  + ",请准时!" :
                                    language1 == 2 ? "You are going to pick up " + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName()) + " at " + sdf.format(orderPrivateCar.getTravelTime()) + ", please be on time. " :
                                            "Vous allez chercher " + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName()) + " à " + sdf.format(orderPrivateCar.getTravelTime()) + ", s’il vous plaît soyez à l’heure.");
                            QuartzUtil.addSimpleQuartzTask(
                                    new OrderTimeOutJob().buildQuartzJob("2_1_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap)
                                    , new Date(travelTime), travelTime, 0);
                            //预约单出发循环提醒
                            jobDataMap = new JobDataMap();
                            jobDataMap.put("driverId", driver1.getId());
                            jobDataMap.put("timeOutType", 2);
                            jobDataMap.put("orderId", orderPrivateCar.getId());
                            jobDataMap.put("orderType", 1);
                            jobDataMap.put("language", language1);
                            jobDataMap.put("timeOut", orderPrivateCar.getTravelTime().getTime());
                            jobDataMap.put("driverTimeout", 0);
                            jobDataMap.put("describe", language1 == 1 ? "您将于" + sdf.format(orderPrivateCar.getTravelTime()) + "去接" + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName())  + ",请准时!" :
                                    language1 == 2 ? "You are going to pick up " + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName()) + " at " + sdf.format(orderPrivateCar.getTravelTime()) + ", please be on time. " :
                                            "Vous allez chercher " + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName()) + " à " + sdf.format(orderPrivateCar.getTravelTime()) + ", s’il vous plaît soyez à l’heure.");
                            QuartzUtil.addSimpleQuartzTask(
                                    new OrderTimeOutJob().buildQuartzJob("2_2_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap)
                                    , new Date(travelTime + reminderRules.getReserveNext() * 60000), reminderRules.getReserveNext() * 60000, -1);
                            //超时循环提醒
                            jobDataMap = new JobDataMap();
                            jobDataMap.put("driverId", driver1.getId());
                            jobDataMap.put("timeOutType", 3);
                            jobDataMap.put("orderId", orderPrivateCar.getId());
                            jobDataMap.put("orderType", 1);
                            jobDataMap.put("language", language1);
                            jobDataMap.put("timeOut", orderPrivateCar.getTravelTime().getTime());
                            jobDataMap.put("driverTimeout", 0);
                            jobDataMap.put("describe", "");
                            QuartzUtil.addSimpleQuartzTask(
                                    new OrderTimeOutJob().buildQuartzJob("3_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap)
                                    , orderPrivateCar.getTravelTime(), reminderRules.getCar() * 60000, -1);
                        }
                    }
                    new Thread(()->{
                        try {
                            Car car = carService.selectById(orderPrivateCar.getCarId());
                            if(!StringUtils.hasLength(car.getVehicleId())){
                                car.setVehicleId(UUIDUtil.getRandomCode());
                                carService.updateById(car);
                            }
                            String trip = fleetEngineUtil.getTrip(orderPrivateCar.getTripId());
                            if(ToolUtil.isEmpty(trip)){
                                String vehicles = fleetEngineUtil.getVehicles(car.getVehicleId());
                                if(ToolUtil.isEmpty(vehicles)){
                                    CarModel carModel = carModelMapper.selectById(car.getCarModelId());
                                    fleetEngineUtil.createVehicles(carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
                                }
                                fleetEngineUtil.createTrip(car.getVehicleId(), 1, orderPrivateCar.getTripId(),
                                        orderPrivateCar.getStartLat().toString(), orderPrivateCar.getStartLon().toString(),  orderPrivateCar.getEndLat().toString(), orderPrivateCar.getEndLon().toString());
                            }
                            //开始修改行程数据
                            fleetEngineUtil.updateTrip(null, car.getVehicleId(), null, orderPrivateCar.getTripId(), null, null, null, null);
                        }catch (Exception e){
                            e.printStackTrace();
                        }
                    }).start();
                    //推送相关代码------------------start----------------
                    String finalAudioUrl = audioUrl;
                    new Thread(new Runnable() {
                        @Override
                        public void run() {
                            pushUtil.pushOrderReassign(orderPrivateCar.getUserId(), 1, orderPrivateCar.getId(), 1, "");
                            pushUtil.pushOrderReassign(orderPrivateCar.getDriverId(), 2, orderPrivateCar.getId(), 1, finalAudioUrl);
                        }
                    }).start();
                    systemNoticeService.addSystemNotice(2, language1 == 1 ? "您已成功抢得打车订单,请及时联系客户!" :
                            language1 == 2 ? "You have grabbed the ride order, please contact the client timely."
                                    : "Vous avez saisi la commande de course, veuillez contacter le client en temps opportun.", orderPrivateCar.getDriverId());
                    systemNoticeService.addSystemNotice(1, language1 == 1 ? "您的订单已指派给" + driver1.getFirstName() + "师傅,请保持电话畅通!" :
                            language1 == 2 ? "Your order has been assigned to the driver- " + driver1.getFirstName() + ", please keep your line on."
                                    : "Votre commande a été attribuée au chauffeur- " + driver1.getFirstName() + ", S'il vous plaît, restez en ligne.", orderPrivateCar.getUserId());
                }
                break;
            case 4:
                OrderLogistics orderLogistics = orderLogisticsService.selectById(reassign.getOrderId());
                Company company1 = companyCityService.query1(String.valueOf(orderLogistics.getStartLon()), String.valueOf(orderLogistics.getStartLat()));//获取起点所属分公司
                PushOrder pushOrder1 = pushOrderService.querys(1, 1, company1.getId()).get(0);
                //获取空闲司机
                List<Driver> list1 = driverService.queryIdleDriver(orderLogistics.getType(), orderLogistics.getServerCarModelId(), orderLogistics.getStartLon(), orderLogistics.getStartLat(), pushOrder1.getPushDistance(), null);//所有附近空闲司机
                System.err.println("【" + orderLogistics.getId() + "】空闲司机:" + JSON.toJSONString(list1));
                if(list1.size() > 0){
                    Driver driver1 = list1.get(0);
                    reassign.setState(3);
                    reassign.setNowDriverId(driver1.getId());
                    reassign.setNowCarId(driver1.getCarId());
                    reassign.setCompleteTime(new Date());
                    this.updateById(reassign);
                    String text = "";
                    Integer language1 = driver1.getLanguage();
                    switch (language1){
                        case 1:
                            text = "收到新的包裹订单,从" + orderLogistics.getStartAddress() + "出发,全程约" + orderLogistics.getEstimatedMileage() + "公里";
                            break;
                        case 2:
                            text = "Received a new delivery order, starting from " + orderLogistics.getStartAddress() + ", the whole journey is about " + orderLogistics.getEstimatedMileage() + "kilometre";
                            break;
                        case 3:
                            text = "J'ai reçu une nouvelle commande de livraison, à partir de " + orderLogistics.getStartAddress() + ", le trajet complet est d’environ " + orderLogistics.getEstimatedMileage() + "kilométrage";
                            break;
                    }
                    String audioUrl = "";
                    String fileName = "pushOrder" + driver1.getId() + UUIDUtil.getRandomCode(5) + ".mp3";
                    try {
                        audioUrl = TextToSpeechUtil.create(language1 == 1 ? "cmn-CN" : language1 == 2 ? "en-US" : "fr-FR", text, fileName);
                    } catch (Exception e) {
                        throw new RuntimeException(e);
                    }
                    //定时任务删除语音文件
                    new Timer().schedule(new TimerTask() {
                        @Override
                        public void run() {
                            Process process = null;
                            try {
                                process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName);
                            } catch (IOException e) {
                                throw new RuntimeException(e);
                            }
                            if (process != null) {
                                process.destroy();
                            }
                        }
                    }, 30000);
                    orderLogistics.setDriverId(driver1.getId());
                    orderLogistics.setCarId(driver1.getCarId());
                    orderLogistics.setCompanyId(driver1.getFranchiseeId() != null && driver1.getFranchiseeId() != 0 ? driver1.getFranchiseeId() : (
                            driver1.getCompanyId() != null && driver1.getCompanyId() != 0 ? driver1.getCompanyId() : 1));
                    orderLogistics.setState(orderLogistics.getOldState());
                    orderLogistics.setOldState(null);
                    orderLogistics.setSnatchOrderTime(new Date());
                    if(!StringUtils.hasLength(orderLogistics.getTripId())){
                        orderLogistics.setTripId(UUIDUtil.getRandomCode());
                    }
                    String value = redisUtil.getValue("DRIVER" + driver1.getId());
                    if(ToolUtil.isNotEmpty(value)) {
                        String[] split = value.split(",");
                        DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]));
                        //超时时间
                        long timeOut = System.currentTimeMillis() + (distancematrix.getDuration() * 1000);
                        orderLogistics.setEstimateArriveTime(new Date(timeOut));
                        orderLogistics.setEstimateArriveMileage(distancematrix.getDistance());
                    }
                    orderLogisticsService.updateAllColumnById(orderLogistics);
                    //修改司机为服务中
                    driver1.setState(3);
                    driverService.updateById(driver1);
                    driver.setState(2);
                    driverService.updateById(driver);
                    //删除定时任务
                    QuartzUtil.deleteQuartzTask("1_" + orderLogistics.getId() + "_4","ORDER_TIME_OUT");
                    QuartzUtil.deleteQuartzTask("2_1_" + orderLogistics.getId() + "_4","ORDER_TIME_OUT");
                    QuartzUtil.deleteQuartzTask("2_2_" + orderLogistics.getId() + "_4","ORDER_TIME_OUT");
                    QuartzUtil.deleteQuartzTask("3_" + orderLogistics.getId() + "_4","ORDER_TIME_OUT");
                    /**
                     * 超时用户取消不收费的提醒
                     *   即时单:预估到达预约点时间 + 配置不收费的时间 > 当前时间 (只弹一次)
                     *
                     * 超时用户取消订单后需要弹给司机提醒弹框,超时时间 = 当前时间 - 行程时间 - 配置不收费的时间
                     *
                     * 定时提醒弹框
                     *   司机只要开始超时且还未到达预约点,则需要定时提醒
                     */
                    //添加定时任务(普通任务)
                    SysOvertime reminderRules = sysOvertimeService.selectOne(new EntityWrapper<SysOvertime>().eq("companyId", driver1.getCompanyId()));
                    if(null != reminderRules){
                        CancleOrder cancleOrder = cancleOrderService.selectOne(new EntityWrapper<CancleOrder>().eq("companyId", driver1.getCompanyId()));
                        Integer driverTimeout = JSON.parseObject(cancleOrder.getContent()).getInteger("driverTimeout");
                        //超时时间
                        long timeOut = orderLogistics.getEstimateArriveTime().getTime() + (driverTimeout * 60 * 1000);
                        //乘客取消不收费提醒
                        JobDataMap jobDataMap = new JobDataMap();
                        jobDataMap.put("driverId", driver1.getId());
                        jobDataMap.put("timeOutType", 1);
                        jobDataMap.put("orderId", orderLogistics.getId());
                        jobDataMap.put("orderType", 4);
                        jobDataMap.put("language", language1);
                        jobDataMap.put("timeOut", timeOut);
                        jobDataMap.put("driverTimeout", driverTimeout);
                        jobDataMap.put("describe", language1 == 1 ? "您已超时" + driverTimeout + "分钟,用户可免费取消订单" : language1 == 2 ? "Reminder You are overdue for " + driverTimeout + " minutes The subscriber could cancel the order for free Confirm" : "Rappel Vous êtes en retard de " + driverTimeout + " minutes L’abonné peut annuler la commande gratuitement Confirmer");
                        QuartzUtil.addSimpleQuartzTask(
                                new OrderTimeOutJob().buildQuartzJob("1_" + orderLogistics.getId() + "_4", "ORDER_TIME_OUT", jobDataMap)
                                , new Date(timeOut), timeOut, 0);
                        //超时循环提醒
                        jobDataMap = new JobDataMap();
                        jobDataMap.put("driverId", driver1.getId());
                        jobDataMap.put("timeOutType", 3);
                        jobDataMap.put("orderId", orderLogistics.getId());
                        jobDataMap.put("orderType", 4);
                        jobDataMap.put("language", language1);
                        jobDataMap.put("timeOut", orderLogistics.getEstimateArriveTime().getTime());
                        jobDataMap.put("driverTimeout", driverTimeout);
                        jobDataMap.put("describe", "");
                        QuartzUtil.addSimpleQuartzTask(
                                new OrderTimeOutJob().buildQuartzJob("3_" + orderLogistics.getId() + "_4", "ORDER_TIME_OUT", jobDataMap)
                                , orderLogistics.getEstimateArriveTime(), reminderRules.getCar() * 60000, -1);
                    }
                    new Thread(()->{
                        try {
                            Car car = carService.selectById(orderLogistics.getCarId());
                            if(!StringUtils.hasLength(car.getVehicleId())){
                                car.setVehicleId(UUIDUtil.getRandomCode());
                                carService.updateById(car);
                            }
                            String trip = fleetEngineUtil.getTrip(orderLogistics.getTripId());
                            if(ToolUtil.isEmpty(trip)){
                                String vehicles = fleetEngineUtil.getVehicles(car.getVehicleId());
                                if(ToolUtil.isEmpty(vehicles)){
                                    CarModel carModel = carModelMapper.selectById(car.getCarModelId());
                                    fleetEngineUtil.createVehicles(carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
                                }
                                fleetEngineUtil.createTrip(car.getVehicleId(), 1, orderLogistics.getTripId(),
                                        orderLogistics.getStartLat().toString(), orderLogistics.getStartLon().toString(),  orderLogistics.getEndLat().toString(), orderLogistics.getEndLon().toString());
                            }else{
                                //开始修改行程数据
                                fleetEngineUtil.updateTrip(null, car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null);
                            }
                        }catch (Exception e){
                            e.printStackTrace();
                        }
                    }).start();
                    //推送相关代码------------------start----------------
                    String finalAudioUrl = audioUrl;
                    new Thread(new Runnable() {
                        @Override
                        public void run() {
                            pushUtil.pushOrderReassign(orderLogistics.getUserId(), 1, orderLogistics.getId(), 4, "");
                            pushUtil.pushOrderReassign(orderLogistics.getDriverId(), 2, orderLogistics.getId(), 4, finalAudioUrl);
                        }
                    }).start();
                    systemNoticeService.addSystemNotice(2, language1 == 1 ? "您已成功抢得包裹订单,请及时联系客户!" :
                            language1 == 2 ? "You have grabbed the delivery order, please contact the client timely."
                                    : "Vous avez saisi la commande du livraison. Veuillez contacter le client en temps opportun.", orderLogistics.getDriverId());
                    systemNoticeService.addSystemNotice(1, language1 == 1 ? "您的订单已指派给" + driver1.getFirstName() + "师傅,请保持电话畅通!" :
                            language1 == 2 ? "Your order has been assigned to the driver- " + driver1.getFirstName() + ", please keep your line on."
                                    : "Votre commande a été attribuée au chauffeur- " + driver1.getFirstName() + ", S'il vous plaît, restez en ligne.", orderLogistics.getUserId());
                }
                break;
        }
        return resultUtil;
    }
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/SettlementRecordServiceImpl.java
@@ -99,13 +99,13 @@
        Driver driver1 = driverService.selectById(driverId);
        SettlementRecord settlementRecord = this.selectOne(new EntityWrapper<SettlementRecord>().eq("driverId", driverId).eq("paymentStatus", 1));
        if(null == settlementRecord){
            return ResultUtil.error(language == 1 ? "暂无需支付" : language == 2 ? "No need to make payments for the time being" : "Pas besoin d’effectuer de paiements pour le moment");
            return ResultUtil.error(language == 1 ? "暂无需支付" : language == 2 ? "No payment is required" : "Aucun paiement n’est requis");
        }
        Double payMoney = settlementRecord.getPayMoney();
        ResultUtil resultUtil = ResultUtil.success("");
        if(payType == 1){//手机支付
            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
            String merchantTransactionId = sdf.format(new Date()) + language + settlementRecord.getId();
            String merchantTransactionId = sdf.format(new Date()) + language + payType + settlementRecord.getId();
            CheckoutRequest checkoutRequest = new CheckoutRequest();
            checkoutRequest.setMsisdn(Long.valueOf(driver1.getPhone()));
            checkoutRequest.setCustomerEmail(driver1.getEmail());
@@ -129,7 +129,7 @@
        if(payType == 2){//银行卡支付
            BankCard bankCard = bankCardService.selectById(bankCardId);
            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
            String merchantTransactionId = sdf.format(new Date()) + language + settlementRecord.getId();
            String merchantTransactionId = sdf.format(new Date()) + language + payType + settlementRecord.getId();
            CheckoutRequest checkoutRequest = new CheckoutRequest();
            checkoutRequest.setMsisdn(Long.valueOf(bankCard.getCode()));
            checkoutRequest.setCustomerEmail(driver1.getEmail());
@@ -193,7 +193,7 @@
                driver1.setLaveBusinessMoney(new BigDecimal(laveBusinessMoney).subtract(new BigDecimal(payMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                settlementRecord.setPaymentStatus(2);
                settlementRecord.setPayType(payType);
                settlementRecord.setBalanceType(1);
                settlementRecord.setBalanceType(2);
                settlementRecord.setPayTime(new Date());
                this.updateById(settlementRecord);
                balanceUsageRecordService.saveBalanceUsageRecord(settlementRecord.getDriverId(), 2, payMoney, settlementRecord.getType() + 2);
@@ -233,7 +233,6 @@
                queryHistoricalSettlement.setType(Integer.valueOf(map.get("type").toString()));
            }
            if(null != map.get("payType")){
                Integer balanceType = Integer.valueOf(map.get("balanceType").toString());
                switch (map.get("payType").toString()){
                    case "1":
                        queryHistoricalSettlement.setPayType(language == 1 ? "手机支付" : language == 2 ? "Mobile Money" : "Paiement mobile");
@@ -242,6 +241,7 @@
                        queryHistoricalSettlement.setPayType(language == 1 ? "线上支付" : language == 2 ? "Bank Card" : "Carte bancaire");
                        break;
                    default:
                        Integer balanceType = Integer.valueOf(map.get("balanceType").toString());
                        queryHistoricalSettlement.setPayType(language == 1 ? "余额支付(" + (balanceType == 1 ? "奖励" : "收入") + ")" : language == 2 ? "Wallet (" + (balanceType == 1 ? "Reward" : "Income") + ")" : "Portefeuille (" + (balanceType == 1 ? "Récompense" : "Revenu") + ")");
                        break;
                }
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushUtil.java
@@ -75,7 +75,7 @@
     * @param orderType     订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)
     * @param state         订单状态(1=待接单,2=待出发,3=待到达预约地点,4=待乘客上车,5=服务中,6=完成服务,7=待支付,8=待评价,9=已完成,10=已取消,11=改派中)
     */
    public void pushOrderState(Integer type, Integer uid, Integer orderId, Integer orderType, Integer state){
    public void pushOrderState(Integer type, Integer uid, Integer orderId, Integer orderType, Integer state, Integer time, String audioUrl){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("code", 200);
        jsonObject.put("msg", "SUCCESS");
@@ -84,6 +84,7 @@
        map.put("orderId", orderId);
        map.put("orderType", orderType);
        map.put("state", state);
        map.put("audioUrl", audioUrl);
        jsonObject.put("data", map);
        //调用推送
@@ -145,7 +146,7 @@
     * @param orderId
     * @param orderType
     */
    public void pushOrderReassign(Integer uid, Integer type, Integer orderId, Integer orderType){
    public void pushOrderReassign(Integer uid, Integer type, Integer orderId, Integer orderType, String audioUrl){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("code", 200);
        jsonObject.put("msg", "SUCCESS");
@@ -153,6 +154,7 @@
        Map<String, Object> map = new HashMap<>();
        map.put("orderId", orderId);
        map.put("orderType", orderType);
        map.put("audioUrl", audioUrl);
        jsonObject.put("data", map);
        //调用推送
@@ -444,6 +446,32 @@
            System.err.println(jsonObject1.getString("msg"));
        }
    }
    public void afterWork(Integer id, Integer type, Object object){
        JSONObject msg = new JSONObject();
        msg.put("code", 200);
        msg.put("msg", "SUCCESS");
        msg.put("method", "AFTER_WORK");
        msg.put("data", object);
        //调用推送
        HttpHeaders headers = new HttpHeaders();
        // 以表单的方式提交
        headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
        //将请求头部和参数合成一个请求
        MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
        params.add("msg", msg.toJSONString());
        params.add("id", id.toString());
        params.add("type", type.toString());
        HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers);
        String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class);
        JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class);
        if(jsonObject1.getIntValue("code") != 200){
            System.err.println(jsonObject1.getString("msg"));
        }
    }
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/quartz/jobs/OrderTimeOutJob.java
@@ -6,6 +6,12 @@
import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService;
import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar;
import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService;
import com.stylefeng.guns.modular.system.dao.UserInfoMapper;
import com.stylefeng.guns.modular.system.model.Driver;
import com.stylefeng.guns.modular.system.model.User;
import com.stylefeng.guns.modular.system.model.UserInfo;
import com.stylefeng.guns.modular.system.service.IDriverService;
import com.stylefeng.guns.modular.system.service.IUserService;
import com.stylefeng.guns.modular.system.util.PushUtil;
import com.stylefeng.guns.modular.system.util.TextToSpeechUtil;
import com.stylefeng.guns.modular.system.util.quartz.QuartzUtil;
@@ -17,6 +23,7 @@
import javax.annotation.Resource;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.List;
import java.util.Timer;
@@ -37,6 +44,10 @@
    private IOrderPrivateCarService orderPrivateCarService;
    @Resource
    private IOrderLogisticsService orderLogisticsService;
    @Resource
    private IDriverService driverService;
    @Resource
    private UserInfoMapper userInfoMapper;
    
    
    
@@ -88,9 +99,31 @@
        Integer driverId = jobDataMap.getIntValue("driverId");
        Integer orderId = jobDataMap.getIntValue("orderId");
        Integer orderType = jobDataMap.getIntValue("orderType");
        Integer language = jobDataMap.getIntValue("language");
        Integer driverTimeout = jobDataMap.getIntValue("driverTimeout");
        long timeOut = jobDataMap.getLongValue("timeOut");
        String describe = jobDataMap.getString("describe");
        Driver driver = driverService.selectById(driverId);
        Integer language = driver.getLanguage();
        if(1 == timeOutType){
            if(orderType == 1){
                describe = language == 1 ? "您已超时" + driverTimeout + "分钟,用户可免费取消订单" : language == 2 ? "Reminder You are overdue for " + driverTimeout + " minutes The subscriber could cancel the order for free Confirm" : "Rappel Vous êtes en retard de " + driverTimeout + " minutes L’abonné peut annuler la commande gratuitement Confirmer";
            }
            if(orderType == 4){
                describe = language == 1 ? "您已超时" + driverTimeout + "分钟,用户可免费取消订单" : language == 2 ? "Reminder You are overdue for " + driverTimeout + " minutes The subscriber could cancel the order for free Confirm" : "Rappel Vous êtes en retard de " + driverTimeout + " minutes L’abonné peut annuler la commande gratuitement Confirmer";
            }
        }
        if(2 == timeOutType){
            if(orderType == 1){
                OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId);
                UserInfo userInfo = userInfoMapper.selectById(orderPrivateCar.getUserId());
                SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
                describe = language == 1 ? "您将于" + sdf.format(orderPrivateCar.getTravelTime()) + "去接" + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName())  + ",请准时!" :
                        language == 2 ? "You are going to pick up " + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName()) + " at " + sdf.format(orderPrivateCar.getTravelTime()) + ", please be on time. " :
                                "Vous allez chercher " + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName()) + " à " + sdf.format(orderPrivateCar.getTravelTime()) + ", s’il vous plaît soyez à l’heure.";
            }
            if(orderType == 4){
            }
        }
        if(3 == timeOutType){
            Integer m = Double.valueOf((System.currentTimeMillis() - timeOut) / 60000).intValue();
            if(orderType == 1){
@@ -165,9 +198,10 @@
            }
        }
        
        String fileName = "orderTimeOut" + driverId + "_" + timeOutType + ".mp3";
        String audioUrl = null;
        try {
            audioUrl = TextToSpeechUtil.create(language == 1 ? "cmn-CN" : language == 2 ? "en-US" : "fr-FR", describe, "orderTimeOut" + driverId + "_" + timeOutType + ".mp3");
            audioUrl = TextToSpeechUtil.create(language == 1 ? "cmn-CN" : language == 2 ? "en-US" : "fr-FR", describe, fileName);
        } catch (Exception e) {
            e.printStackTrace();
        }
@@ -178,7 +212,7 @@
            public void run() {
                Process process = null;
                try {
                    process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/orderTimeOut" + driverId + "_" + timeOutType + ".mp3");
                    process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/LoginWarpper.java
@@ -22,6 +22,8 @@
    
    @ApiModelProperty("google车辆id")
    private String vehicleId;
    private String audioUrl;
    public String getJumpCode() {
@@ -79,4 +81,12 @@
    public void setVehicleId(String vehicleId) {
        this.vehicleId = vehicleId;
    }
    public String getAudioUrl() {
        return audioUrl;
    }
    public void setAudioUrl(String audioUrl) {
        this.audioUrl = audioUrl;
    }
}
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/OrderInfoWarpper.java
@@ -96,7 +96,7 @@
    @ApiModelProperty("是否冻结(1=否,2=是)")
    private Integer isFrozen;
    @ApiModelProperty("超时取消时间")
    private Integer timeOutCancel;
    private Long timeOutCancel;
    @ApiModelProperty("超时语音文件地址")
    private String audioUrl;
    @ApiModelProperty("接单时间")
@@ -433,11 +433,11 @@
        this.isFrozen = isFrozen;
    }
    
    public Integer getTimeOutCancel() {
    public Long getTimeOutCancel() {
        return timeOutCancel;
    }
    
    public void setTimeOutCancel(Integer timeOutCancel) {
    public void setTimeOutCancel(Long timeOutCancel) {
        this.timeOutCancel = timeOutCancel;
    }
    
@@ -574,7 +574,7 @@
            orderInfoWarpper.setUserName(null != map.get("userName") ? String.valueOf(map.get("userName")) : "");
            orderInfoWarpper.setDriverPay(null != map.get("driverPay") ? Integer.valueOf(map.get("driverPay").toString()) : 0);
            orderInfoWarpper.setIsFrozen(null != map.get("isFrozen") ? Integer.valueOf(map.get("isFrozen").toString()) : 1);
            orderInfoWarpper.setTimeOutCancel(null != map.get("timeOutCancel") ? Integer.valueOf(map.get("timeOutCancel").toString()) : 0);
            orderInfoWarpper.setTimeOutCancel(null != map.get("timeOutCancel") ? Long.valueOf(map.get("timeOutCancel").toString()) : 0);
            orderInfoWarpper.setSnatchOrderTime(null != map.get("snatchOrderTime") ? map.get("snatchOrderTime").toString() : "");
            orderInfoWarpper.setUserPhone(null != map.get("userPhone") ? map.get("userPhone").toString() : "");
            orderInfoWarpper.setTripId(null != map.get("tripId") ? map.get("tripId").toString() : "");
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java
@@ -221,8 +221,8 @@
        new Thread(new Runnable() {
            @Override
            public void run() {
                pushUtil.pushOrderState(1, orderTaxi.getUserId(), orderTaxi.getId(), 2, orderTaxi.getState());
                pushUtil.pushOrderState(2, orderTaxi.getDriverId(), orderTaxi.getId(), 2, orderTaxi.getState());
                pushUtil.pushOrderState(1, orderTaxi.getUserId(), orderTaxi.getId(), 2, orderTaxi.getState(), 0, "");
                pushUtil.pushOrderState(2, orderTaxi.getDriverId(), orderTaxi.getId(), 2, orderTaxi.getState(), 0, "");
                if(orderTaxi.getType() == 2){
                    pushUtil.pushFerryOrderState(1, orderTaxi.getUserId(), orderTaxi.getId(), 2, 2);
                    System.err.println("----------------------------------推送摆渡订单-----------------------------");
@@ -304,8 +304,8 @@
        new Thread(new Runnable() {
            @Override
            public void run() {
                pushUtil.pushOrderState(1, orderTaxi.getUserId(), orderTaxi.getId(), 2, orderTaxi.getState());
                pushUtil.pushOrderState(2, orderTaxi.getDriverId(), orderTaxi.getId(), 2, orderTaxi.getState());
                pushUtil.pushOrderState(1, orderTaxi.getUserId(), orderTaxi.getId(), 2, orderTaxi.getState(), 0, "");
                pushUtil.pushOrderState(2, orderTaxi.getDriverId(), orderTaxi.getId(), 2, orderTaxi.getState(), 0, "");
            }
        }).start();
@@ -392,8 +392,8 @@
        new Thread(new Runnable() {
            @Override
            public void run() {
                pushUtil.pushOrderState(1, orderTaxi.getUserId(), orderTaxi.getId(), 2, orderTaxi.getState());
                pushUtil.pushOrderState(2, orderTaxi.getDriverId(), orderTaxi.getId(), 2, orderTaxi.getState());
                pushUtil.pushOrderState(1, orderTaxi.getUserId(), orderTaxi.getId(), 2, orderTaxi.getState(), 0, "");
                pushUtil.pushOrderState(2, orderTaxi.getDriverId(), orderTaxi.getId(), 2, orderTaxi.getState(), 0, "");
            }
        }).start();
        return ResultUtil.success();
@@ -440,8 +440,8 @@
        new Thread(new Runnable() {
            @Override
            public void run() {
                pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState());
                pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState());
                pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState(), 0, "");
                pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState(), 0, "");
            }
        }).start();
        return ResultUtil.success();
@@ -485,8 +485,8 @@
            new Thread(new Runnable() {
                @Override
                public void run() {
                    pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState());
                    pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState());
                    pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState(), 0, "");
                    pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState(), 0, "");
                }
            }).start();
            //添加定时任务6分钟司机不确认收款自动完成支付(仅车载端),6分钟之内司机无法接单
@@ -527,8 +527,8 @@
                        new Thread(new Runnable() {
                            @Override
                            public void run() {
                                pushUtil.pushOrderState(1, orderTaxi1.getUserId(), orderId, 2, 8);
                                pushUtil.pushOrderState(2, orderTaxi1.getDriverId(), orderId, 2, 8);
                                pushUtil.pushOrderState(1, orderTaxi1.getUserId(), orderId, 2, 8, 0, "");
                                pushUtil.pushOrderState(2, orderTaxi1.getDriverId(), orderId, 2, 8, 0, "");
                            }
                        }).start();
                    }
@@ -578,8 +578,8 @@
        new Thread(new Runnable() {
            @Override
            public void run() {
                pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState());
                pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState());
                pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState(), 0, "");
                pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState(), 0, "");
            }
        }).start();
@@ -621,8 +621,8 @@
                    new Thread(new Runnable() {
                        @Override
                        public void run() {
                            pushUtil.pushOrderState(1, orderTaxi1.getUserId(), orderId, 2, 8);
                            pushUtil.pushOrderState(2, orderTaxi1.getDriverId(), orderId, 2, 8);
                            pushUtil.pushOrderState(1, orderTaxi1.getUserId(), orderId, 2, 8, 0, "");
                            pushUtil.pushOrderState(2, orderTaxi1.getDriverId(), orderId, 2, 8, 0, "");
                        }
                    }).start();
                }
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCarController.java
@@ -653,7 +653,7 @@
                    if(2 == finalTCar.getAuthState()){
                        car_audit1_content.text("You vehicle application has been approved. See the I-GO platform for details.");
                    }else{
                        car_audit1_content.text("Sorry, your vehicle application was not approved. The reason for the failure is: incomplete filling of vehicle information.");
                        car_audit1_content.text("We are sorry to inform you that your vehicle application was rejected. Please contact our service for relevant details, call 0577777767 or send e-mail to support@i-go.group");
                    }
                    EmailUtil.send(tDriver.getEmail(), 2 == finalTCar.getAuthState() ? "Vehicle is verified and qualified" : "Vehicle is not verified and qualified",  document.html());
                }catch (Exception e){
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java
@@ -591,7 +591,6 @@
                type = 6;
                tDriver.setAuthState(4);
            }
            new Thread(new Runnable() {
                @Override
                public void run() {
@@ -617,7 +616,7 @@
                        if(1 == authState){
                            driver_audit1_content.text("You application has been approved.");
                        }else{
                            driver_audit1_content.text("I'm sorry, your application was rejected. Reason for rejection: Incomplete filling in personal information.");
                            driver_audit1_content.text("We are sorry to inform you that your application was rejected. Please contact our service for relevant details, call 0577777767 or send e-mail to support@i-go.group");
                        }
                        EmailUtil.send(tDriver.getEmail(), 1 == authState ? "Driver is verified and qualified" : "Driver is not verified and qualified",  document.html());
                    }catch (Exception e){
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TIntegralOrderController.java
@@ -9,9 +9,7 @@
import com.stylefeng.guns.modular.system.model.TEmail;
import com.stylefeng.guns.modular.system.model.TOrderCharter;
import com.stylefeng.guns.modular.system.model.TUser;
import com.stylefeng.guns.modular.system.service.ITUserService;
import com.stylefeng.guns.modular.system.service.IUserService;
import com.stylefeng.guns.modular.system.service.TEmailService;
import com.stylefeng.guns.modular.system.service.*;
import com.stylefeng.guns.modular.system.util.EmailUtil;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
@@ -26,7 +24,6 @@
import com.stylefeng.guns.core.log.LogObjectHolder;
import org.springframework.web.bind.annotation.RequestParam;
import com.stylefeng.guns.modular.system.model.TIntegralOrder;
import com.stylefeng.guns.modular.system.service.ITIntegralOrderService;
import javax.annotation.Resource;
import java.io.File;
@@ -57,6 +54,9 @@
    
    @Resource
    private TEmailService emailService;
    @Resource
    private ITSystemNoticeService systemNoticeService;
    
    
    
@@ -123,10 +123,18 @@
        tIntegralOrder.setRemark(null);
        tIntegralOrderService.updateById(tIntegralOrder);
        TIntegralOrder tIntegralOrder1 = tIntegralOrderService.selectById(tIntegralOrder.getId());
        TUser tUser = userService.selectById(tIntegralOrder1.getUserId());
        try {
            Integer language = tUser.getLanguage();
            systemNoticeService.addSystemNotice(1, language == 1 ? "您的积分兑换请求已通过审核,平台客服将会联系您,请耐心等待!" :
                    language == 2 ? "Your points redemption request has been approved, and I-GO customer service will contact you. Please be patient!" :
                            "Votre demande d’échange de points a été approuvée et le service client d’I-GO vous contactera. Soyez patient !", tIntegralOrder.getUserId());
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        new Thread(new Runnable() {
            @Override
            public void run() {
                TUser tUser = userService.selectById(tIntegralOrder1.getUserId());
                if(ToolUtil.isNotEmpty(tUser.getEmail())){
                    try {
                        Integer language = tUser.getLanguage();
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
@@ -3,6 +3,7 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.google.api.client.http.UrlEncodedParser;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.CharteredCar.server.IOrderCharteredCarService;
import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity;
@@ -27,8 +28,12 @@
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.http.client.utils.URLEncodedUtils;
import org.bouncycastle.util.encoders.UrlBase64Encoder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -36,6 +41,9 @@
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.*;
@@ -201,6 +209,9 @@
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            UserInfo userInfo = userInfoService.selectById(uid);
            userInfo.setLanguage(language);
            userInfoService.updateById(userInfo);
            List<Map<String, Object>> list = null;
            switch (type){
                case 1:
@@ -639,7 +650,31 @@
    })
    public ResultUtil queryTrack_(Integer orderId, Integer orderType){
        try {
            List<Map<String, Object>> list = orderPositionService.queryTrack(orderId, orderType);
            List<Map<String, Object>> list = new ArrayList<>();
                    switch (orderType){
                case 1:
                    OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId);
                    Map<String, Object> map = new HashMap<>();
                    map.put("lon", orderPrivateCar.getStartLon());
                    map.put("lat", orderPrivateCar.getStartLat());
                    list.add(map);
                    map = new HashMap<>();
                    map.put("lon", orderPrivateCar.getEndLon());
                    map.put("lat", orderPrivateCar.getEndLat());
                    list.add(map);
                    break;
                case 4:
                    OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId);
                    Map<String, Object> map1 = new HashMap<>();
                    map1.put("lon", orderLogistics.getStartLon());
                    map1.put("lat", orderLogistics.getStartLat());
                    list.add(map1);
                    map1 = new HashMap<>();
                    map1.put("lon", orderLogistics.getEndLon());
                    map1.put("lat", orderLogistics.getEndLat());
                    list.add(map1);
                    break;
            }
            return ResultUtil.success(list);
        }catch (Exception e){
            e.printStackTrace();
@@ -889,6 +924,20 @@
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            reason = reason.replaceAll("& #40;", "(")
                    .replaceAll("& #41;", ")")
                    .replaceAll("& #40;", "(")
                    .replaceAll("& #41;", ")")
                    .replaceAll("& #39;", "'")
                    .replaceAll("& lt;", "<")
                    .replaceAll("& gt;", ">");
            remark = remark.replaceAll("& #40;", "(")
                    .replaceAll("& #41;", ")")
                    .replaceAll("& #40;", "(")
                    .replaceAll("& #41;", ")")
                    .replaceAll("& #39;", "'")
                    .replaceAll("& lt;", "<")
                    .replaceAll("& gt;", ">");
            switch (orderType){
                case 1:
                    return orderPrivateCarService.addCancle(id, reason, remark, uid, lon, lat, address, language);
@@ -909,8 +958,9 @@
            return ResultUtil.runErr();
        }
    }
    /**
     * 取消订单退款回调
     * @param request
@@ -1702,17 +1752,39 @@
                return ResultUtil.tokenErr();
            }
            Double payMoney = 0D;
            Integer companyId = 1;
            switch (orderType){
                case 1:
                    OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId);
                    payMoney = orderPrivateCar.getPayMoney();
                    Double orderMoney = orderPrivateCar.getOrderMoney();
                    UserActivityDiscount1 query2 = userActivityDiscount1Mapper.query(orderPrivateCar.getCompanyId());
                    if(null != query2){
                        Integer orderNum=orderPrivateCarService.selectCount(new EntityWrapper<OrderPrivateCar>().eq("userId", uid).eq("activityId",query2.getId()).last(" and to_days(getoffTime) = to_days(now())"));
                        if(query2.getDistance()*1000>orderPrivateCar.getMileage() && query2.getOrderNum()>orderNum){
                            Double special = query2.getSpecial();
                            if(null != special){
                                double v = new BigDecimal(orderMoney).multiply(new BigDecimal(special / 10)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
                                payMoney = v;
                            }
                        }
                    }
                    break;
                case 4:
                    OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId);
                    payMoney = orderLogistics.getPayMoney();
                    Double orderMoney1 = orderLogistics.getOrderMoney();
                    UserActivityDiscount1 query1 = userActivityDiscount1Mapper.query(orderLogistics.getCompanyId());
                    if(null != query1){
                        Integer orderNum=orderLogisticsService.selectCount(new EntityWrapper<OrderLogistics>().eq("userId", uid).eq("activityId",query1.getId()).last(" and to_days(getoffTime) = to_days(now())"));
                        if(query1.getDistance()*1000>orderLogistics.getMileage() && query1.getOrderNum()>orderNum){
                            Double special = query1.getSpecial();
                            if(null != special){
                                double v = new BigDecimal(orderMoney1).multiply(new BigDecimal(special / 10)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
                                payMoney = v;
                            }
                        }
                    }
                    break;
            }
            Double aDouble = userRedPacketRecordService.queryRemainingAmount(uid);
            Map<String, Object> map = new HashMap<>();
            map.put("redTotal", aDouble);
@@ -1721,7 +1793,7 @@
                map.put("deductionAmount", 0D);
                return ResultUtil.success(map);
            }
            Double deductionAmount = new BigDecimal(payMoney).multiply(redEnvelopePaymentSettings.getDeductionRatio().divide(new BigDecimal(100))).doubleValue();
            Double deductionAmount = new BigDecimal(payMoney).multiply(redEnvelopePaymentSettings.getDeductionRatio().divide(new BigDecimal(100))).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
            map.put("deductionAmount", deductionAmount);
            return ResultUtil.success(map);
        }catch (Exception e){
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/controller/OrderLogisticsController.java
@@ -407,8 +407,9 @@
                    break;
                    
            }
            String fileName = "difference" + driver.getId() + ".mp3";
            try {
                audioUrl = TextToSpeechUtil.create(language == 1 ? "cmn-CN" : language == 2 ? "en-US" : "fr-FR", text, "difference" + driver.getId() + ".mp3");
                audioUrl = TextToSpeechUtil.create(language == 1 ? "cmn-CN" : language == 2 ? "en-US" : "fr-FR", text, fileName);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
@@ -418,7 +419,7 @@
                public void run() {
                    Process process = null;
                    try {
                        process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/difference" + driver.getId() + ".mp3");
                        process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/dao/mapping/OrderLogisticsMapper.xml
@@ -162,7 +162,8 @@
        (select price from t_order_logistics_spread where orderLogisticsId = a.id) as differenceMoney,
        cancelMidway,
        tripId,
        remark
        remark,
        companyId
        from t_order_logistics as a where userId = #{uid} and isDelete = 1 order by insertTime desc limit #{pageNum}, #{size}
    </select>
@@ -286,7 +287,8 @@
        h.reason as cancelReason,
        h.remark as cancelRemark,
        a.tripId,
        a.snatchOrderTime
        a.snatchOrderTime,
        a.startDuration
        from t_order_logistics a
        left join t_driver b on (a.driverId = b.id)
        left join t_car c on (a.carId = c.id)
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java
@@ -574,8 +574,9 @@
        
                                }
                                String audioUrl = "";
                                String fileName = "pushOrder" + orderLogistics.getDriverId() + UUIDUtil.getRandomCode(5) + ".mp3";
                                try {
                                    audioUrl = TextToSpeechUtil.create(language1 == 1 ? "cmn-CN" : language1 == 2 ? "en-US" : "fr-FR", text, "pushOrder" + orderLogistics.getDriverId() + ".mp3");
                                    audioUrl = TextToSpeechUtil.create(language1 == 1 ? "cmn-CN" : language1 == 2 ? "en-US" : "fr-FR", text, fileName);
                                } catch (Exception e) {
                                    throw new RuntimeException(e);
                                }
@@ -585,7 +586,7 @@
                                    public void run() {
                                        Process process = null;
                                        try {
                                            process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/pushOrder" + orderLogistics.getDriverId() + ".mp3");
                                            process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName);
                                        } catch (IOException e) {
                                            throw new RuntimeException(e);
                                        }
@@ -643,12 +644,12 @@
         * 1.下了即时单就不能下预约单和即时单
         * 2.下了预约单和再下一张即时单不能再下预约单
         */
        List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.queryByState(uid, 1, 1, 1, 2, 3, 4, 5, 6,  11);
        List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.queryByState(uid, 1, 1, 1, 2, 3, 4, 5, 6, 7, 11, 12);
        if(orderPrivateCars.size() > 0){
            return ResultUtil.error(language == 1 ? "有未完成的订单" : language == 2 ? "Uncompleted order(s)" : "Commande(s) non complétée(s)");
        }
        int selectCount = this.selectCount(new EntityWrapper<OrderLogistics>().eq("userId", uid).eq("isDelete", 1)
                .in("state", Arrays.asList(1, 2, 3, 4, 5, 7, 11, 12)));
                .in("state", Arrays.asList(1, 2, 3, 4, 5, 6, 7, 11, 12)));
        if(0 < selectCount){
            return ResultUtil.error(language == 1 ? "有未完成的订单" : language == 2 ? "Uncompleted order(s)" : "Commande(s) non complétée(s)");
        }
@@ -744,6 +745,10 @@
        orderLogistics.setEstimatedMileage(new BigDecimal(distance1).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue());
        this.insert(orderLogistics);
    
        UserInfo userInfo = userInfoService.selectById(uid);
        userInfo.setLanguage(language);
        userInfoService.updateById(userInfo);
        new Thread(() -> {
            try {
                String vehicleId = null;
@@ -789,8 +794,9 @@
        
            }
            String audioUrl = "";
            String fileName = "pushOrder" + orderLogistics.getDriverId() + UUIDUtil.getRandomCode(5) + ".mp3";
            try {
                audioUrl = TextToSpeechUtil.create(language1 == 1 ? "cmn-CN" : language1 == 2 ? "en-US" : "fr-FR", text, "pushOrder" + orderLogistics.getDriverId() + ".mp3");
                audioUrl = TextToSpeechUtil.create(language1 == 1 ? "cmn-CN" : language1 == 2 ? "en-US" : "fr-FR", text, fileName);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
@@ -800,7 +806,7 @@
                public void run() {
                    Process process = null;
                    try {
                        process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/pushOrder" + orderLogistics.getDriverId() + ".mp3");
                        process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
@@ -901,8 +907,9 @@
        
                    }
                    String audioUrl = "";
                    String fileName = "pushOrder" + orderLogistics.getDriverId() + UUIDUtil.getRandomCode(5) + ".mp3";
                    try {
                        audioUrl = TextToSpeechUtil.create(language1 == 1 ? "cmn-CN" : language1 == 2 ? "en-US" : "fr-FR", text, "pushOrder" + orderLogistics.getDriverId() + ".mp3");
                        audioUrl = TextToSpeechUtil.create(language1 == 1 ? "cmn-CN" : language1 == 2 ? "en-US" : "fr-FR", text, fileName);
                    } catch (Exception e) {
                        throw new RuntimeException(e);
                    }
@@ -912,7 +919,7 @@
                        public void run() {
                            Process process = null;
                            try {
                                process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/pushOrder" + orderLogistics.getDriverId() + ".mp3");
                                process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName);
                            } catch (IOException e) {
                                throw new RuntimeException(e);
                            }
@@ -1270,8 +1277,43 @@
                    document.getElementsByTag("title").get(0).text("I-GO电子收据");
                    Element title_chinese = document.getElementById("title_chinese");
                    title_chinese.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",您在I-GO此订单消费GHS " + orderLogistics.getPayMoney());
                    Element xcf_chinese = document.getElementById("xcf_chinese");
                    xcf_chinese.text("GHS " + new BigDecimal(orderLogistics.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    Element qbj_chinese = document.getElementById("qbj_chinese");
                    qbj_chinese.text("GHS " + new BigDecimal(orderLogistics.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    Element scf_chinese = document.getElementById("scf_chinese");
                    if(null != orderLogistics.getDurationMoney() && orderLogistics.getDurationMoney() > 0){
                        scf_chinese.text("GHS " + new BigDecimal(orderLogistics.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element scf_chinese_div = document.getElementById("scf_chinese_div");
                        scf_chinese_div.remove();
                    }
                    Element lcf_chinese = document.getElementById("lcf_chinese");
                    if(null != orderLogistics.getMileageMoney() && orderLogistics.getMileageMoney() > 0){
                        lcf_chinese.text("GHS " + new BigDecimal(orderLogistics.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element lcf_chinese_div = document.getElementById("lcf_chinese_div");
                        lcf_chinese_div.remove();
                    }
                    Element ddf_chinese = document.getElementById("ddf_chinese");
                    if(null != orderLogistics.getWaitMoney() && orderLogistics.getWaitMoney() > 0){
                        ddf_chinese.text("GHS " + new BigDecimal(orderLogistics.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element ddf_chinese_div = document.getElementById("ddf_chinese_div");
                        ddf_chinese_div.remove();
                    }
                    Element glf_chinese = document.getElementById("glf_chinese");
                    if(null != orderLogistics.getRoadTollMoney() && orderLogistics.getRoadTollMoney() > 0){
                        glf_chinese.text("GHS " + new BigDecimal(orderLogistics.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element glf_chinese_div = document.getElementById("glf_chinese_div");
                        glf_chinese_div.remove();
                    }
                    Element tcf_chinese = document.getElementById("tcf_chinese");
                    if(null != orderLogistics.getParkMoney() && orderLogistics.getParkMoney() > 0){
                        tcf_chinese.text("GHS " + new BigDecimal(orderLogistics.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element tcf_chinese_div = document.getElementById("tcf_chinese_div");
                        tcf_chinese_div.remove();
                    }
                    Element bcj_chinese = document.getElementById("bcj_chinese");
                    if(null != orderLogistics.getPriceDifference() && orderLogistics.getPriceDifference() > 0){
                        bcj_chinese.text("GHS " + new BigDecimal(orderLogistics.getPriceDifference()).setScale(2, RoundingMode.HALF_EVEN));
@@ -1337,8 +1379,43 @@
                    document.getElementsByTag("title").get(0).text("Receipt");
                    Element title_english = document.getElementById("title_english");
                    title_english.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",You spent GHS " + orderLogistics.getPayMoney() + " on the trip ");
                    Element xcf_english = document.getElementById("xcf_english");
                    xcf_english.text("GHS " + new BigDecimal(orderLogistics.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    Element qbj_english = document.getElementById("qbj_english");
                    qbj_english.text("GHS " + new BigDecimal(orderLogistics.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    Element scf_english = document.getElementById("scf_english");
                    if(null != orderLogistics.getDurationMoney() && orderLogistics.getDurationMoney() > 0){
                        scf_english.text("GHS " + new BigDecimal(orderLogistics.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element scf_english_div = document.getElementById("scf_english_div");
                        scf_english_div.remove();
                    }
                    Element lcf_english = document.getElementById("lcf_english");
                    if(null != orderLogistics.getMileageMoney() && orderLogistics.getMileageMoney() > 0){
                        lcf_english.text("GHS " + new BigDecimal(orderLogistics.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element lcf_english_div = document.getElementById("lcf_english_div");
                        lcf_english_div.remove();
                    }
                    Element ddf_english = document.getElementById("ddf_english");
                    if(null != orderLogistics.getWaitMoney() && orderLogistics.getWaitMoney() > 0){
                        ddf_english.text("GHS " + new BigDecimal(orderLogistics.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element ddf_english_div = document.getElementById("ddf_english_div");
                        ddf_english_div.remove();
                    }
                    Element glf_english = document.getElementById("glf_english");
                    if(null != orderLogistics.getRoadTollMoney() && orderLogistics.getRoadTollMoney() > 0){
                        glf_english.text("GHS " + new BigDecimal(orderLogistics.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element glf_english_div = document.getElementById("glf_english_div");
                        glf_english_div.remove();
                    }
                    Element tcf_english = document.getElementById("tcf_english");
                    if(null != orderLogistics.getParkMoney() && orderLogistics.getParkMoney() > 0){
                        tcf_english.text("GHS " + new BigDecimal(orderLogistics.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element tcf_english_div = document.getElementById("tcf_english_div");
                        tcf_english_div.remove();
                    }
                    Element bcj_english = document.getElementById("bcj_english");
                    if(null != orderLogistics.getPriceDifference() && orderLogistics.getPriceDifference() > 0){
                        bcj_english.text("GHS " + new BigDecimal(orderLogistics.getPriceDifference()).setScale(2, RoundingMode.HALF_EVEN));
@@ -1404,8 +1481,43 @@
                    document.getElementsByTag("title").get(0).text("Reçu");
                    Element title_french = document.getElementById("title_french");
                    title_french.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",Vous consommez GHS " + orderLogistics.getPayMoney() + " sur votre commande i-go1 le ");
                    Element xcf_french = document.getElementById("xcf_french");
                    xcf_french.text("GHS " + new BigDecimal(orderLogistics.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    Element qbj_french = document.getElementById("qbj_french");
                    qbj_french.text("GHS " + new BigDecimal(orderLogistics.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    Element scf_french = document.getElementById("scf_french");
                    if(null != orderLogistics.getDurationMoney() && orderLogistics.getDurationMoney() > 0){
                        scf_french.text("GHS " + new BigDecimal(orderLogistics.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element scf_french_div = document.getElementById("scf_french_div");
                        scf_french_div.remove();
                    }
                    Element lcf_french = document.getElementById("lcf_french");
                    if(null != orderLogistics.getMileageMoney() && orderLogistics.getMileageMoney() > 0){
                        lcf_french.text("GHS " + new BigDecimal(orderLogistics.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element lcf_french_div = document.getElementById("lcf_french_div");
                        lcf_french_div.remove();
                    }
                    Element ddf_french = document.getElementById("ddf_french");
                    if(null != orderLogistics.getWaitMoney() && orderLogistics.getWaitMoney() > 0){
                        ddf_french.text("GHS " + new BigDecimal(orderLogistics.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element ddf_french_div = document.getElementById("ddf_french_div");
                        ddf_french_div.remove();
                    }
                    Element glf_french = document.getElementById("glf_french");
                    if(null != orderLogistics.getRoadTollMoney() && orderLogistics.getRoadTollMoney() > 0){
                        glf_french.text("GHS " + new BigDecimal(orderLogistics.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element glf_french_div = document.getElementById("glf_french_div");
                        glf_french_div.remove();
                    }
                    Element tcf_french = document.getElementById("tcf_french");
                    if(null != orderLogistics.getParkMoney() && orderLogistics.getParkMoney() > 0){
                        tcf_french.text("GHS " + new BigDecimal(orderLogistics.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element tcf_french_div = document.getElementById("tcf_french_div");
                        tcf_french_div.remove();
                    }
                    Element bcj_french = document.getElementById("bcj_french");
                    if(null != orderLogistics.getPriceDifference() && orderLogistics.getPriceDifference() > 0){
                        bcj_french.text("GHS " + new BigDecimal(orderLogistics.getPriceDifference()).setScale(2, RoundingMode.HALF_EVEN));
@@ -1647,7 +1759,7 @@
                public void run() {
                    pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "");
                    pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "");
                    pushUtil.pushOfflinePayment(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4);
                    pushUtil.pushOfflinePayment(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, orderLogistics.getPayMoney());
                }
            }).start();
@@ -1681,8 +1793,43 @@
                    document.getElementsByTag("title").get(0).text("I-GO电子收据");
                    Element title_chinese = document.getElementById("title_chinese");
                    title_chinese.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",您在I-GO此订单消费GHS " + orderLogistics.getPayMoney());
                    Element xcf_chinese = document.getElementById("xcf_chinese");
                    xcf_chinese.text("GHS " + new BigDecimal(orderLogistics.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    Element qbj_chinese = document.getElementById("qbj_chinese");
                    qbj_chinese.text("GHS " + new BigDecimal(orderLogistics.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    Element scf_chinese = document.getElementById("scf_chinese");
                    if(null != orderLogistics.getDurationMoney() && orderLogistics.getDurationMoney() > 0){
                        scf_chinese.text("GHS " + new BigDecimal(orderLogistics.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element scf_chinese_div = document.getElementById("scf_chinese_div");
                        scf_chinese_div.remove();
                    }
                    Element lcf_chinese = document.getElementById("lcf_chinese");
                    if(null != orderLogistics.getMileageMoney() && orderLogistics.getMileageMoney() > 0){
                        lcf_chinese.text("GHS " + new BigDecimal(orderLogistics.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element lcf_chinese_div = document.getElementById("lcf_chinese_div");
                        lcf_chinese_div.remove();
                    }
                    Element ddf_chinese = document.getElementById("ddf_chinese");
                    if(null != orderLogistics.getWaitMoney() && orderLogistics.getWaitMoney() > 0){
                        ddf_chinese.text("GHS " + new BigDecimal(orderLogistics.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element ddf_chinese_div = document.getElementById("ddf_chinese_div");
                        ddf_chinese_div.remove();
                    }
                    Element glf_chinese = document.getElementById("glf_chinese");
                    if(null != orderLogistics.getRoadTollMoney() && orderLogistics.getRoadTollMoney() > 0){
                        glf_chinese.text("GHS " + new BigDecimal(orderLogistics.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element glf_chinese_div = document.getElementById("glf_chinese_div");
                        glf_chinese_div.remove();
                    }
                    Element tcf_chinese = document.getElementById("tcf_chinese");
                    if(null != orderLogistics.getParkMoney() && orderLogistics.getParkMoney() > 0){
                        tcf_chinese.text("GHS " + new BigDecimal(orderLogistics.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element tcf_chinese_div = document.getElementById("tcf_chinese_div");
                        tcf_chinese_div.remove();
                    }
                    Element bcj_chinese = document.getElementById("bcj_chinese");
                    if(null != orderLogistics.getPriceDifference() && orderLogistics.getPriceDifference() > 0){
                        bcj_chinese.text("GHS " + new BigDecimal(orderLogistics.getPriceDifference()).setScale(2, RoundingMode.HALF_EVEN));
@@ -1748,8 +1895,43 @@
                    document.getElementsByTag("title").get(0).text("Receipt");
                    Element title_english = document.getElementById("title_english");
                    title_english.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",You spent GHS " + orderLogistics.getPayMoney() + " on the trip ");
                    Element xcf_english = document.getElementById("xcf_english");
                    xcf_english.text("GHS " + new BigDecimal(orderLogistics.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    Element qbj_english = document.getElementById("qbj_english");
                    qbj_english.text("GHS " + new BigDecimal(orderLogistics.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    Element scf_english = document.getElementById("scf_english");
                    if(null != orderLogistics.getDurationMoney() && orderLogistics.getDurationMoney() > 0){
                        scf_english.text("GHS " + new BigDecimal(orderLogistics.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element scf_english_div = document.getElementById("scf_english_div");
                        scf_english_div.remove();
                    }
                    Element lcf_english = document.getElementById("lcf_english");
                    if(null != orderLogistics.getMileageMoney() && orderLogistics.getMileageMoney() > 0){
                        lcf_english.text("GHS " + new BigDecimal(orderLogistics.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element lcf_english_div = document.getElementById("lcf_english_div");
                        lcf_english_div.remove();
                    }
                    Element ddf_english = document.getElementById("ddf_english");
                    if(null != orderLogistics.getWaitMoney() && orderLogistics.getWaitMoney() > 0){
                        ddf_english.text("GHS " + new BigDecimal(orderLogistics.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element ddf_english_div = document.getElementById("ddf_english_div");
                        ddf_english_div.remove();
                    }
                    Element glf_english = document.getElementById("glf_english");
                    if(null != orderLogistics.getRoadTollMoney() && orderLogistics.getRoadTollMoney() > 0){
                        glf_english.text("GHS " + new BigDecimal(orderLogistics.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element glf_english_div = document.getElementById("glf_english_div");
                        glf_english_div.remove();
                    }
                    Element tcf_english = document.getElementById("tcf_english");
                    if(null != orderLogistics.getParkMoney() && orderLogistics.getParkMoney() > 0){
                        tcf_english.text("GHS " + new BigDecimal(orderLogistics.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element tcf_english_div = document.getElementById("tcf_english_div");
                        tcf_english_div.remove();
                    }
                    Element bcj_english = document.getElementById("bcj_english");
                    if(null != orderLogistics.getPriceDifference() && orderLogistics.getPriceDifference() > 0){
                        bcj_english.text("GHS " + new BigDecimal(orderLogistics.getPriceDifference()).setScale(2, RoundingMode.HALF_EVEN));
@@ -1815,8 +1997,43 @@
                    document.getElementsByTag("title").get(0).text("Reçu");
                    Element title_french = document.getElementById("title_french");
                    title_french.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",Vous consommez GHS " + orderLogistics.getPayMoney() + " sur votre commande i-go1 le ");
                    Element xcf_french = document.getElementById("xcf_french");
                    xcf_french.text("GHS " + new BigDecimal(orderLogistics.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    Element qbj_french = document.getElementById("qbj_french");
                    qbj_french.text("GHS " + new BigDecimal(orderLogistics.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    Element scf_french = document.getElementById("scf_french");
                    if(null != orderLogistics.getDurationMoney() && orderLogistics.getDurationMoney() > 0){
                        scf_french.text("GHS " + new BigDecimal(orderLogistics.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element scf_french_div = document.getElementById("scf_french_div");
                        scf_french_div.remove();
                    }
                    Element lcf_french = document.getElementById("lcf_french");
                    if(null != orderLogistics.getMileageMoney() && orderLogistics.getMileageMoney() > 0){
                        lcf_french.text("GHS " + new BigDecimal(orderLogistics.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element lcf_french_div = document.getElementById("lcf_french_div");
                        lcf_french_div.remove();
                    }
                    Element ddf_french = document.getElementById("ddf_french");
                    if(null != orderLogistics.getWaitMoney() && orderLogistics.getWaitMoney() > 0){
                        ddf_french.text("GHS " + new BigDecimal(orderLogistics.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element ddf_french_div = document.getElementById("ddf_french_div");
                        ddf_french_div.remove();
                    }
                    Element glf_french = document.getElementById("glf_french");
                    if(null != orderLogistics.getRoadTollMoney() && orderLogistics.getRoadTollMoney() > 0){
                        glf_french.text("GHS " + new BigDecimal(orderLogistics.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element glf_french_div = document.getElementById("glf_french_div");
                        glf_french_div.remove();
                    }
                    Element tcf_french = document.getElementById("tcf_french");
                    if(null != orderLogistics.getParkMoney() && orderLogistics.getParkMoney() > 0){
                        tcf_french.text("GHS " + new BigDecimal(orderLogistics.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element tcf_french_div = document.getElementById("tcf_french_div");
                        tcf_french_div.remove();
                    }
                    Element bcj_french = document.getElementById("bcj_french");
                    if(null != orderLogistics.getPriceDifference() && orderLogistics.getPriceDifference() > 0){
                        bcj_french.text("GHS " + new BigDecimal(orderLogistics.getPriceDifference()).setScale(2, RoundingMode.HALF_EVEN));
@@ -2193,8 +2410,43 @@
                    document.getElementsByTag("title").get(0).text("I-GO电子收据");
                    Element title_chinese = document.getElementById("title_chinese");
                    title_chinese.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",您在I-GO此订单消费GHS " + orderLogistics.getPayMoney());
                    Element xcf_chinese = document.getElementById("xcf_chinese");
                    xcf_chinese.text("GHS " + new BigDecimal(orderLogistics.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    Element qbj_chinese = document.getElementById("qbj_chinese");
                    qbj_chinese.text("GHS " + new BigDecimal(orderLogistics.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    Element scf_chinese = document.getElementById("scf_chinese");
                    if(null != orderLogistics.getDurationMoney() && orderLogistics.getDurationMoney() > 0){
                        scf_chinese.text("GHS " + new BigDecimal(orderLogistics.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element scf_chinese_div = document.getElementById("scf_chinese_div");
                        scf_chinese_div.remove();
                    }
                    Element lcf_chinese = document.getElementById("lcf_chinese");
                    if(null != orderLogistics.getMileageMoney() && orderLogistics.getMileageMoney() > 0){
                        lcf_chinese.text("GHS " + new BigDecimal(orderLogistics.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element lcf_chinese_div = document.getElementById("lcf_chinese_div");
                        lcf_chinese_div.remove();
                    }
                    Element ddf_chinese = document.getElementById("ddf_chinese");
                    if(null != orderLogistics.getWaitMoney() && orderLogistics.getWaitMoney() > 0){
                        ddf_chinese.text("GHS " + new BigDecimal(orderLogistics.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element ddf_chinese_div = document.getElementById("ddf_chinese_div");
                        ddf_chinese_div.remove();
                    }
                    Element glf_chinese = document.getElementById("glf_chinese");
                    if(null != orderLogistics.getRoadTollMoney() && orderLogistics.getRoadTollMoney() > 0){
                        glf_chinese.text("GHS " + new BigDecimal(orderLogistics.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element glf_chinese_div = document.getElementById("glf_chinese_div");
                        glf_chinese_div.remove();
                    }
                    Element tcf_chinese = document.getElementById("tcf_chinese");
                    if(null != orderLogistics.getParkMoney() && orderLogistics.getParkMoney() > 0){
                        tcf_chinese.text("GHS " + new BigDecimal(orderLogistics.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element tcf_chinese_div = document.getElementById("tcf_chinese_div");
                        tcf_chinese_div.remove();
                    }
                    Element bcj_chinese = document.getElementById("bcj_chinese");
                    if(null != orderLogistics.getPriceDifference() && orderLogistics.getPriceDifference() > 0){
                        bcj_chinese.text("GHS " + new BigDecimal(orderLogistics.getPriceDifference()).setScale(2, RoundingMode.HALF_EVEN));
@@ -2260,8 +2512,43 @@
                    document.getElementsByTag("title").get(0).text("Receipt");
                    Element title_english = document.getElementById("title_english");
                    title_english.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",You spent GHS " + orderLogistics.getPayMoney() + " on the trip ");
                    Element xcf_english = document.getElementById("xcf_english");
                    xcf_english.text("GHS " + new BigDecimal(orderLogistics.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    Element qbj_english = document.getElementById("qbj_english");
                    qbj_english.text("GHS " + new BigDecimal(orderLogistics.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    Element scf_english = document.getElementById("scf_english");
                    if(null != orderLogistics.getDurationMoney() && orderLogistics.getDurationMoney() > 0){
                        scf_english.text("GHS " + new BigDecimal(orderLogistics.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element scf_english_div = document.getElementById("scf_english_div");
                        scf_english_div.remove();
                    }
                    Element lcf_english = document.getElementById("lcf_english");
                    if(null != orderLogistics.getMileageMoney() && orderLogistics.getMileageMoney() > 0){
                        lcf_english.text("GHS " + new BigDecimal(orderLogistics.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element lcf_english_div = document.getElementById("lcf_english_div");
                        lcf_english_div.remove();
                    }
                    Element ddf_english = document.getElementById("ddf_english");
                    if(null != orderLogistics.getWaitMoney() && orderLogistics.getWaitMoney() > 0){
                        ddf_english.text("GHS " + new BigDecimal(orderLogistics.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element ddf_english_div = document.getElementById("ddf_english_div");
                        ddf_english_div.remove();
                    }
                    Element glf_english = document.getElementById("glf_english");
                    if(null != orderLogistics.getRoadTollMoney() && orderLogistics.getRoadTollMoney() > 0){
                        glf_english.text("GHS " + new BigDecimal(orderLogistics.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element glf_english_div = document.getElementById("glf_english_div");
                        glf_english_div.remove();
                    }
                    Element tcf_english = document.getElementById("tcf_english");
                    if(null != orderLogistics.getParkMoney() && orderLogistics.getParkMoney() > 0){
                        tcf_english.text("GHS " + new BigDecimal(orderLogistics.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element tcf_english_div = document.getElementById("tcf_english_div");
                        tcf_english_div.remove();
                    }
                    Element bcj_english = document.getElementById("bcj_english");
                    if(null != orderLogistics.getPriceDifference() && orderLogistics.getPriceDifference() > 0){
                        bcj_english.text("GHS " + new BigDecimal(orderLogistics.getPriceDifference()).setScale(2, RoundingMode.HALF_EVEN));
@@ -2327,8 +2614,43 @@
                    document.getElementsByTag("title").get(0).text("Reçu");
                    Element title_french = document.getElementById("title_french");
                    title_french.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",Vous consommez GHS " + orderLogistics.getPayMoney() + " sur votre commande i-go1 le ");
                    Element xcf_french = document.getElementById("xcf_french");
                    xcf_french.text("GHS " + new BigDecimal(orderLogistics.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    Element qbj_french = document.getElementById("qbj_french");
                    qbj_french.text("GHS " + new BigDecimal(orderLogistics.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    Element scf_french = document.getElementById("scf_french");
                    if(null != orderLogistics.getDurationMoney() && orderLogistics.getDurationMoney() > 0){
                        scf_french.text("GHS " + new BigDecimal(orderLogistics.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element scf_french_div = document.getElementById("scf_french_div");
                        scf_french_div.remove();
                    }
                    Element lcf_french = document.getElementById("lcf_french");
                    if(null != orderLogistics.getMileageMoney() && orderLogistics.getMileageMoney() > 0){
                        lcf_french.text("GHS " + new BigDecimal(orderLogistics.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element lcf_french_div = document.getElementById("lcf_french_div");
                        lcf_french_div.remove();
                    }
                    Element ddf_french = document.getElementById("ddf_french");
                    if(null != orderLogistics.getWaitMoney() && orderLogistics.getWaitMoney() > 0){
                        ddf_french.text("GHS " + new BigDecimal(orderLogistics.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element ddf_french_div = document.getElementById("ddf_french_div");
                        ddf_french_div.remove();
                    }
                    Element glf_french = document.getElementById("glf_french");
                    if(null != orderLogistics.getRoadTollMoney() && orderLogistics.getRoadTollMoney() > 0){
                        glf_french.text("GHS " + new BigDecimal(orderLogistics.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element glf_french_div = document.getElementById("glf_french_div");
                        glf_french_div.remove();
                    }
                    Element tcf_french = document.getElementById("tcf_french");
                    if(null != orderLogistics.getParkMoney() && orderLogistics.getParkMoney() > 0){
                        tcf_french.text("GHS " + new BigDecimal(orderLogistics.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN));
                    }else{
                        Element tcf_french_div = document.getElementById("tcf_french_div");
                        tcf_french_div.remove();
                    }
                    Element bcj_french = document.getElementById("bcj_french");
                    if(null != orderLogistics.getPriceDifference() && orderLogistics.getPriceDifference() > 0){
                        bcj_french.text("GHS " + new BigDecimal(orderLogistics.getPriceDifference()).setScale(2, RoundingMode.HALF_EVEN));
@@ -2584,12 +2906,15 @@
    
            OrderLogistics orderLogistics = this.selectById(orderId);
            long timeOutCancel = 0L;
            long driverTimeOut = 0L;
            if(null != orderLogistics.getEstimateArriveTime()){
                CancleOrder cancleOrder = cancleOrderService.selectOne(new EntityWrapper<CancleOrder>().eq("companyId", orderLogistics.getCompanyId()));
                JSONObject jsonObject = JSON.parseObject(cancleOrder.getContent());
                int driverTimeout = jsonObject.getIntValue("driverTimeout") * 60000;
                timeOutCancel = orderLogistics.getEstimateArriveTime().getTime() + driverTimeout;
                driverTimeOut = orderLogistics.getEstimateArriveTime().getTime();
            }
            map.put("driverTimeOut", driverTimeOut);
            map.put("timeOutCancel", timeOutCancel);
        }
        return maps;
@@ -2648,7 +2973,7 @@
        if(null == orderLogistics){
            return ResultUtil.error(language == 1 ? "取消订单失败,订单信息有误" : language == 2 ? "Failed to cancel order, order-information error." : "Échec de l’annulation de la commande, erreur d’information de commande.");
        }
        if(orderLogistics.getState() > 5 && orderLogistics.getState() != 11){
        if(orderLogistics.getState() > 5 && orderLogistics.getState() != 12){
            return ResultUtil.error(language == 1 ? "取消订单失败,不合法的操作" : language == 2 ? "Failed to cancel order, illegal operation." : "Échec de l’annulation de la commande, opération illégale.");
        }
    
@@ -2699,13 +3024,13 @@
                    String audioUrl = "";
                    switch (language1){
                        case 1:
                            audioUrl = "http://182.160.16.251:81/files/audio/UserCancelledOrder-CN.mp3";
                            audioUrl = "http://182.160.16.251:81/files/audio/system/UserCancelledOrder-CN.mp3";
                            break;
                        case 2:
                            audioUrl = "http://182.160.16.251:81/files/audio/UserCancelledOrder-EN.mp3";
                            audioUrl = "http://182.160.16.251:81/files/audio/system/UserCancelledOrder-EN.mp3";
                            break;
                        case 3:
                            audioUrl = "http://182.160.16.251:81/files/audio/UserCancelledOrder-FR.mp3";
                            audioUrl = "http://182.160.16.251:81/files/audio/system/UserCancelledOrder-FR.mp3";
                            break;
                    }
                    pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0, "");
@@ -2812,6 +3137,11 @@
        if(state == 11){
            map.put("state", map.get("oldState"));
        }
        if(state == 12){
            OrderCancel query = orderCancelService.query(orderId, 4, null, null, 1);
            map.put("cancelPayMoney", null == query ? 0 : query.getMoney());
            map.put("cancelMoney", null == query ? 0 : query.getMoney());
        }
        if(Integer.valueOf(String.valueOf(map.get("state"))) != 8 && Integer.valueOf(String.valueOf(map.get("state"))) != 9){
            map.put("redPacketMoney", null);
            map.put("couponMoney", null);
@@ -2822,6 +3152,7 @@
                Integer orderNum=this.selectCount(new EntityWrapper<OrderLogistics>().eq("userId",orderLogistics.getUserId()).eq("activityId",query2.getId()).last(" and to_days(getoffTime) = to_days(now())"));
                if(query2.getDistance()*1000>orderLogistics.getMileage() && query2.getOrderNum()>orderNum){
                    Double special = query2.getLogistics();
                    map.put("discount", special);
                    orderLogistics.setDiscount(special);
                    Double orderMoney = orderLogistics.getOrderMoney();
                    double v = new BigDecimal(orderMoney).multiply(new BigDecimal(special / 10)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
@@ -2832,17 +3163,11 @@
            
            }
        }
//        Map<String, String> geocode = gdMapGeocodingUtil.geocode(map.get("startLon").toString(), map.get("startLat").toString());
//        map.put("startCity", geocode.get("city"));
//        geocode = gdMapGeocodingUtil.geocode(map.get("endLon").toString(), map.get("endLat").toString());
//        map.put("endCity", geocode.get("city"));
//        GoogleMapUtil.getReverseGeocode()
        String driverId = redisUtil.getValue("DEVICE_" + map.get("driverId"));
        map.put("device", ToolUtil.isNotEmpty(driverId) ? 2 : 1);
        map.put("orderType", orderLogistics.getType());
        if(state == 8){
        if(state == 8 || state == 9){
            map.put("receipt", "http://182.160.16.251:81/files/html/parcel_receipt_" + orderId + ".html");
        }else{
            map.put("receipt", "");
@@ -2852,12 +3177,14 @@
            companyId = Integer.valueOf(String.valueOf(map.get("companyId")));
        }
        map.put("timeOutCancel", 0);
        map.put("driverTimeOut", 0);
        if(null != orderLogistics.getEstimateArriveTime()){
            CancleOrder cancleOrder = cancleOrderService.selectOne(new EntityWrapper<CancleOrder>().eq("companyId", companyId));
            JSONObject jsonObject = JSON.parseObject(cancleOrder.getContent());
            int driverTimeout = jsonObject.getIntValue("driverTimeout");
            long timeOutCancel = orderLogistics.getEstimateArriveTime().getTime() + driverTimeout;
            map.put("timeOutCancel", timeOutCancel);
            map.put("driverTimeOut", orderLogistics.getEstimateArriveTime().getTime());
        }
        return map;
    }
@@ -2980,7 +3307,7 @@
        if(null == orderLogistics){
            return ResultUtil.error(language == 1 ? "取消订单失败,订单信息有误" : language == 2 ? "Failed to cancel order, order-information error." : "Échec de l’annulation de la commande, erreur d’information de commande.", "");
        }
        if(orderLogistics.getState() != 13){
        if(orderLogistics.getState() != 12){
            return ResultUtil.error(language == 1 ? "取消订单失败,不合法的操作" : language == 2 ? "Failed to cancel order, illegal operation." : "Échec de l’annulation de la commande, opération illégale.", "");
        }
        OrderCancel orderCancel = null;
@@ -2990,7 +3317,7 @@
            orderCancel = orderCancelService.selectById(cancleId);
        }
        
        Double amount = queryCancleAmount(id, language).getData().getAmount();
        Double amount = orderCancel.getMoney();
        if(0 < amount){
            if(payType == 1){//手机支付
                orderCancel.setPayType(1);
@@ -3212,13 +3539,13 @@
            String audioUrl = "";
            switch (language1){
                case 1:
                    audioUrl = "http://182.160.16.251:81/files/audio/ChangeAddress-CN.mp3";
                    audioUrl = "http://182.160.16.251:81/files/audio/system/ChangeAddress-CN.mp3";
                    break;
                case 2:
                    audioUrl = "http://182.160.16.251:81/files/audio/ChangeAddress-EN.mp3";
                    audioUrl = "http://182.160.16.251:81/files/audio/system/ChangeAddress-EN.mp3";
                    break;
                case 3:
                    audioUrl = "http://182.160.16.251:81/files/audio/ChangeAddress-FR.mp3";
                    audioUrl = "http://182.160.16.251:81/files/audio/system/ChangeAddress-FR.mp3";
                    break;
            }
            pushUtil.pushModifyAddress(2, orderLogistics.getDriverId(), orderId, 4, 1, audioUrl);
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java
@@ -247,8 +247,8 @@
        if(orderPrivateCars.size() > 0){
            return ResultUtil.error(language == 1 ? "有未完成的订单" : language == 2 ? "Uncompleted order(s)" : "Commande(s) non complétée(s)");
        }
        List<OrderTaxi> list = orderTaxiMapper.queryByState_(uid, 1, 1, 1, 2, 3, 4, 5, 6, 11);
        if(list.size() > 0){
        int i1 = orderLogisticsService.selectCount(new EntityWrapper<OrderLogistics>().eq("userId", uid).in("state", Arrays.asList(1, 2, 3, 4, 5, 6, 7, 11, 12)).eq("isDelete", 1));
        if(i1 > 0){
            return ResultUtil.error(language == 1 ? "有未完成的订单" : language == 2 ? "Uncompleted order(s)" : "Commande(s) non complétée(s)");
        }
@@ -263,12 +263,6 @@
            baseWarpper.setState(7);
            baseWarpper.setId(orderPrivateCars.get(0).getId());
            return ResultUtil.success(baseWarpper);
        }
        list = orderTaxiMapper.queryByState_(uid, 2, 1, 1, 2, 3, 4, 5, 6, 11);
        if(list.size() > 0 && reservation == 2){
            return ResultUtil.error(language == 1 ? "有未完成的订单" : language == 2 ? "Uncompleted order(s)" : "Commande(s) non complétée(s)");
        }
        startAddress = startAddress.replaceAll("& #40;", "(");
@@ -371,6 +365,9 @@
        orderPrivateCar.setEstimatedMileage(new BigDecimal(distance1).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue());
        this.insert(orderPrivateCar);
    
        UserInfo userInfo = userInfoService.selectById(uid);
        userInfo.setLanguage(language);
        userInfoService.updateById(userInfo);
    
        new Thread(() -> {
            try {
@@ -416,8 +413,9 @@
        
            }
            String audioUrl = "";
            String fileName = "pushOrder" + orderPrivateCar.getDriverId() + UUIDUtil.getRandomCode(5) + ".mp3";
            try {
                audioUrl = TextToSpeechUtil.create(language1 == 1 ? "cmn-CN" : language1 == 2 ? "en-US" : "fr-FR", text, "pushOrder" + orderPrivateCar.getDriverId() + ".mp3");
                audioUrl = TextToSpeechUtil.create(language1 == 1 ? "cmn-CN" : language1 == 2 ? "en-US" : "fr-FR", text, fileName);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
@@ -427,7 +425,7 @@
                public void run() {
                    Process process = null;
                    try {
                        process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/pushOrder" + orderPrivateCar.getDriverId() + ".mp3");
                        process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
@@ -528,8 +526,9 @@
        
                    }
                    String audioUrl = "";
                    String fileName = "pushOrder" + orderPrivateCar.getDriverId() + UUIDUtil.getRandomCode(5) + ".mp3";
                    try {
                        audioUrl = TextToSpeechUtil.create(language1 == 1 ? "cmn-CN" : language1 == 2 ? "en-US" : "fr-FR", text, "pushOrder" + orderPrivateCar.getDriverId() + ".mp3");
                        audioUrl = TextToSpeechUtil.create(language1 == 1 ? "cmn-CN" : language1 == 2 ? "en-US" : "fr-FR", text, fileName);
                    } catch (Exception e) {
                        throw new RuntimeException(e);
                    }
@@ -539,7 +538,7 @@
                        public void run() {
                            Process process = null;
                            try {
                                process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/pushOrder" + orderPrivateCar.getDriverId() + ".mp3");
                                process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName);
                            } catch (IOException e) {
                                throw new RuntimeException(e);
                            }
@@ -750,7 +749,7 @@
        if(null == orderPrivateCar){
            return ResultUtil.error(language == 1 ? "取消订单失败,订单信息有误" : language == 2 ? "Failed to cancel order, order-information error." : "Échec de l’annulation de la commande, erreur d’information de commande.");
        }
        if(orderPrivateCar.getState() > 5 && orderPrivateCar.getState() != 11){
        if(orderPrivateCar.getState() > 5 && orderPrivateCar.getState() != 12){
            return ResultUtil.error(language == 1 ? "取消订单失败,不合法的操作" : language == 2 ? "Failed to cancel order, illegal operation." : "Échec de l’annulation de la commande, opération illégale.");
        }
        
@@ -816,13 +815,25 @@
                    String audioUrl = "";
                    switch (language1){
                        case 1:
                            audioUrl = "http://182.160.16.251:81/files/audio/UserCancelledOrder-CN.mp3";
                            if(orderPrivateCar.getState() == 6){
                                audioUrl = "http://182.160.16.251:81/files/audio/system/MidwayCancellation-CN.mp3";
                            }else{
                                audioUrl = "http://182.160.16.251:81/files/audio/system/UserCancelledOrder-CN.mp3";
                            }
                            break;
                        case 2:
                            audioUrl = "http://182.160.16.251:81/files/audio/UserCancelledOrder-EN.mp3";
                            if(orderPrivateCar.getState() == 6){
                                audioUrl = "http://182.160.16.251:81/files/audio/system/MidwayCancellation-EN.mp3";
                            }else{
                                audioUrl = "http://182.160.16.251:81/files/audio/system/UserCancelledOrder-EN.mp3";
                            }
                            break;
                        case 3:
                            audioUrl = "http://182.160.16.251:81/files/audio/UserCancelledOrder-FR.mp3";
                            if(orderPrivateCar.getState() == 6){
                                audioUrl = "http://182.160.16.251:81/files/audio/system/MidwayCancellation-FR.mp3";
                            }else{
                                audioUrl = "http://182.160.16.251:81/files/audio/system/UserCancelledOrder-FR.mp3";
                            }
                            break;
                    }
                    pushUtil.pushOrderState(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0, "");
@@ -1052,8 +1063,9 @@
        
                                }
                                String audioUrl = "";
                                String fileName = "pushOrder" + orderPrivateCar.getDriverId() + UUIDUtil.getRandomCode(5) + ".mp3";
                                try {
                                    audioUrl = TextToSpeechUtil.create(language == 1 ? "cmn-CN" : language == 2 ? "en-US" : "fr-FR", text, "pushOrder" + orderPrivateCar.getDriverId() + ".mp3");
                                    audioUrl = TextToSpeechUtil.create(language == 1 ? "cmn-CN" : language == 2 ? "en-US" : "fr-FR", text, fileName);
                                } catch (Exception e) {
                                    throw new RuntimeException(e);
                                }
@@ -1063,7 +1075,7 @@
                                    public void run() {
                                        Process process = null;
                                        try {
                                            process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/pushOrder" + orderPrivateCar.getDriverId() + ".mp3");
                                            process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName);
                                        } catch (IOException e) {
                                            throw new RuntimeException(e);
                                        }
@@ -1423,8 +1435,43 @@
                                document.getElementsByTag("title").get(0).text("I-GO电子收据");
                                Element title_chinese = document.getElementById("title_chinese");
                                title_chinese.text(DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ",您在I-GO此订单消费GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                                Element xcf_chinese = document.getElementById("xcf_chinese");
                                xcf_chinese.text("GHS " + new BigDecimal(orderPrivateCar.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                Element qbj_chinese = document.getElementById("qbj_chinese");
                                qbj_chinese.text("GHS " + new BigDecimal(orderPrivateCar.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                Element scf_chinese = document.getElementById("scf_chinese");
                                if(null != orderPrivateCar.getDurationMoney() && orderPrivateCar.getDurationMoney() > 0){
                                    scf_chinese.text("GHS " + new BigDecimal(orderPrivateCar.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element scf_chinese_div = document.getElementById("scf_chinese_div");
                                    scf_chinese_div.remove();
                                }
                                Element lcf_chinese = document.getElementById("lcf_chinese");
                                if(null != orderPrivateCar.getMileageMoney() && orderPrivateCar.getMileageMoney() > 0){
                                    lcf_chinese.text("GHS " + new BigDecimal(orderPrivateCar.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element lcf_chinese_div = document.getElementById("lcf_chinese_div");
                                    lcf_chinese_div.remove();
                                }
                                Element ddf_chinese = document.getElementById("ddf_chinese");
                                if(null != orderPrivateCar.getWaitMoney() && orderPrivateCar.getWaitMoney() > 0){
                                    ddf_chinese.text("GHS " + new BigDecimal(orderPrivateCar.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element ddf_chinese_div = document.getElementById("ddf_chinese_div");
                                    ddf_chinese_div.remove();
                                }
                                Element glf_chinese = document.getElementById("glf_chinese");
                                if(null != orderPrivateCar.getRoadTollMoney() && orderPrivateCar.getRoadTollMoney() > 0){
                                    glf_chinese.text("GHS " + new BigDecimal(orderPrivateCar.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element glf_chinese_div = document.getElementById("glf_chinese_div");
                                    glf_chinese_div.remove();
                                }
                                Element tcf_chinese = document.getElementById("tcf_chinese");
                                if(null != orderPrivateCar.getParkMoney() && orderPrivateCar.getParkMoney() > 0){
                                    tcf_chinese.text("GHS " + new BigDecimal(orderPrivateCar.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element tcf_chinese_div = document.getElementById("tcf_chinese_div");
                                    tcf_chinese_div.remove();
                                }
                                if(null != orderPrivateCar.getCouponMoney() && orderPrivateCar.getCouponMoney() > 0){
                                    Element yhq_chinese = document.getElementById("yhq_chinese");
                                    yhq_chinese.text("GHS -" + new BigDecimal(orderPrivateCar.getCouponMoney()).setScale(2, RoundingMode.HALF_EVEN));
@@ -1489,8 +1536,43 @@
                                document.getElementsByTag("title").get(0).text("Receipt");
                                Element title_english = document.getElementById("title_english");
                                title_english.text(DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ",You spent GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue() + " on the trip ");
                                Element xcf_english = document.getElementById("xcf_english");
                                xcf_english.text("GHS " + new BigDecimal(orderPrivateCar.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                Element qbj_english = document.getElementById("qbj_english");
                                qbj_english.text("GHS " + new BigDecimal(orderPrivateCar.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                Element scf_english = document.getElementById("scf_english");
                                if(null != orderPrivateCar.getDurationMoney() && orderPrivateCar.getDurationMoney() > 0){
                                    scf_english.text("GHS " + new BigDecimal(orderPrivateCar.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element scf_english_div = document.getElementById("scf_english_div");
                                    scf_english_div.remove();
                                }
                                Element lcf_english = document.getElementById("lcf_english");
                                if(null != orderPrivateCar.getMileageMoney() && orderPrivateCar.getMileageMoney() > 0){
                                    lcf_english.text("GHS " + new BigDecimal(orderPrivateCar.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element lcf_english_div = document.getElementById("lcf_english_div");
                                    lcf_english_div.remove();
                                }
                                Element ddf_english = document.getElementById("ddf_english");
                                if(null != orderPrivateCar.getWaitMoney() && orderPrivateCar.getWaitMoney() > 0){
                                    ddf_english.text("GHS " + new BigDecimal(orderPrivateCar.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element ddf_english_div = document.getElementById("ddf_english_div");
                                    ddf_english_div.remove();
                                }
                                Element glf_english = document.getElementById("glf_english");
                                if(null != orderPrivateCar.getRoadTollMoney() && orderPrivateCar.getRoadTollMoney() > 0){
                                    glf_english.text("GHS " + new BigDecimal(orderPrivateCar.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element glf_english_div = document.getElementById("glf_english_div");
                                    glf_english_div.remove();
                                }
                                Element tcf_english = document.getElementById("tcf_english");
                                if(null != orderPrivateCar.getParkMoney() && orderPrivateCar.getParkMoney() > 0){
                                    tcf_english.text("GHS " + new BigDecimal(orderPrivateCar.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element tcf_english_div = document.getElementById("tcf_english_div");
                                    tcf_english_div.remove();
                                }
                                if(null != orderPrivateCar.getCouponMoney() && orderPrivateCar.getCouponMoney() > 0){
                                    Element yhq_english = document.getElementById("yhq_english");
                                    yhq_english.text("GHS -" + new BigDecimal(orderPrivateCar.getCouponMoney()).setScale(2, RoundingMode.HALF_EVEN));
@@ -1555,8 +1637,43 @@
                                document.getElementsByTag("title").get(0).text("Reçu");
                                Element title_french = document.getElementById("title_french");
                                title_french.text("Le " + DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ", vous avez dépensé GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue() + " sur le voyage");
                                Element xcf_french = document.getElementById("xcf_french");
                                xcf_french.text("GHS " + new BigDecimal(orderPrivateCar.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                Element qbj_french = document.getElementById("qbj_french");
                                qbj_french.text("GHS " + new BigDecimal(orderPrivateCar.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                Element scf_french = document.getElementById("scf_french");
                                if(null != orderPrivateCar.getDurationMoney() && orderPrivateCar.getDurationMoney() > 0){
                                    scf_french.text("GHS " + new BigDecimal(orderPrivateCar.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element scf_french_div = document.getElementById("scf_french_div");
                                    scf_french_div.remove();
                                }
                                Element lcf_french = document.getElementById("lcf_french");
                                if(null != orderPrivateCar.getMileageMoney() && orderPrivateCar.getMileageMoney() > 0){
                                    lcf_french.text("GHS " + new BigDecimal(orderPrivateCar.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element lcf_french_div = document.getElementById("lcf_french_div");
                                    lcf_french_div.remove();
                                }
                                Element ddf_french = document.getElementById("ddf_french");
                                if(null != orderPrivateCar.getWaitMoney() && orderPrivateCar.getWaitMoney() > 0){
                                    ddf_french.text("GHS " + new BigDecimal(orderPrivateCar.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element ddf_french_div = document.getElementById("ddf_french_div");
                                    ddf_french_div.remove();
                                }
                                Element glf_french = document.getElementById("glf_french");
                                if(null != orderPrivateCar.getRoadTollMoney() && orderPrivateCar.getRoadTollMoney() > 0){
                                    glf_french.text("GHS " + new BigDecimal(orderPrivateCar.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element glf_french_div = document.getElementById("glf_french_div");
                                    glf_french_div.remove();
                                }
                                Element tcf_french = document.getElementById("tcf_french");
                                if(null != orderPrivateCar.getParkMoney() && orderPrivateCar.getParkMoney() > 0){
                                    tcf_french.text("GHS " + new BigDecimal(orderPrivateCar.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element tcf_french_div = document.getElementById("tcf_french_div");
                                    tcf_french_div.remove();
                                }
                                if(null != orderPrivateCar.getCouponMoney() && orderPrivateCar.getCouponMoney() > 0){
                                    Element yhq_french = document.getElementById("yhq_french");
                                    yhq_french.text("GHS -" + new BigDecimal(orderPrivateCar.getCouponMoney()).setScale(2, RoundingMode.HALF_EVEN));
@@ -1835,8 +1952,43 @@
                                document.getElementsByTag("title").get(0).text("I-GO电子收据");
                                Element title_chinese = document.getElementById("title_chinese");
                                title_chinese.text(DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ",您在I-GO此订单消费GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                                Element xcf_chinese = document.getElementById("xcf_chinese");
                                xcf_chinese.text("GHS " + new BigDecimal(orderPrivateCar.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                Element qbj_chinese = document.getElementById("qbj_chinese");
                                qbj_chinese.text("GHS " + new BigDecimal(orderPrivateCar.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                Element scf_chinese = document.getElementById("scf_chinese");
                                if(null != orderPrivateCar.getDurationMoney() && orderPrivateCar.getDurationMoney() > 0){
                                    scf_chinese.text("GHS " + new BigDecimal(orderPrivateCar.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element scf_chinese_div = document.getElementById("scf_chinese_div");
                                    scf_chinese_div.remove();
                                }
                                Element lcf_chinese = document.getElementById("lcf_chinese");
                                if(null != orderPrivateCar.getMileageMoney() && orderPrivateCar.getMileageMoney() > 0){
                                    lcf_chinese.text("GHS " + new BigDecimal(orderPrivateCar.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element lcf_chinese_div = document.getElementById("lcf_chinese_div");
                                    lcf_chinese_div.remove();
                                }
                                Element ddf_chinese = document.getElementById("ddf_chinese");
                                if(null != orderPrivateCar.getWaitMoney() && orderPrivateCar.getWaitMoney() > 0){
                                    ddf_chinese.text("GHS " + new BigDecimal(orderPrivateCar.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element ddf_chinese_div = document.getElementById("ddf_chinese_div");
                                    ddf_chinese_div.remove();
                                }
                                Element glf_chinese = document.getElementById("glf_chinese");
                                if(null != orderPrivateCar.getRoadTollMoney() && orderPrivateCar.getRoadTollMoney() > 0){
                                    glf_chinese.text("GHS " + new BigDecimal(orderPrivateCar.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element glf_chinese_div = document.getElementById("glf_chinese_div");
                                    glf_chinese_div.remove();
                                }
                                Element tcf_chinese = document.getElementById("tcf_chinese");
                                if(null != orderPrivateCar.getParkMoney() && orderPrivateCar.getParkMoney() > 0){
                                    tcf_chinese.text("GHS " + new BigDecimal(orderPrivateCar.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element tcf_chinese_div = document.getElementById("tcf_chinese_div");
                                    tcf_chinese_div.remove();
                                }
                                if(null != orderPrivateCar.getCouponMoney() && orderPrivateCar.getCouponMoney() > 0){
                                    Element yhq_chinese = document.getElementById("yhq_chinese");
                                    yhq_chinese.text("GHS -" + new BigDecimal(orderPrivateCar.getCouponMoney()).setScale(2, RoundingMode.HALF_EVEN));
@@ -1901,8 +2053,43 @@
                                document.getElementsByTag("title").get(0).text("Receipt");
                                Element title_english = document.getElementById("title_english");
                                title_english.text(DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ",You spent GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue() + " on the trip ");
                                Element xcf_english = document.getElementById("xcf_english");
                                xcf_english.text("GHS " + new BigDecimal(orderPrivateCar.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                Element qbj_english = document.getElementById("qbj_english");
                                qbj_english.text("GHS " + new BigDecimal(orderPrivateCar.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                Element scf_english = document.getElementById("scf_english");
                                if(null != orderPrivateCar.getDurationMoney() && orderPrivateCar.getDurationMoney() > 0){
                                    scf_english.text("GHS " + new BigDecimal(orderPrivateCar.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element scf_english_div = document.getElementById("scf_english_div");
                                    scf_english_div.remove();
                                }
                                Element lcf_english = document.getElementById("lcf_english");
                                if(null != orderPrivateCar.getMileageMoney() && orderPrivateCar.getMileageMoney() > 0){
                                    lcf_english.text("GHS " + new BigDecimal(orderPrivateCar.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element lcf_english_div = document.getElementById("lcf_english_div");
                                    lcf_english_div.remove();
                                }
                                Element ddf_english = document.getElementById("ddf_english");
                                if(null != orderPrivateCar.getWaitMoney() && orderPrivateCar.getWaitMoney() > 0){
                                    ddf_english.text("GHS " + new BigDecimal(orderPrivateCar.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element ddf_english_div = document.getElementById("ddf_english_div");
                                    ddf_english_div.remove();
                                }
                                Element glf_english = document.getElementById("glf_english");
                                if(null != orderPrivateCar.getRoadTollMoney() && orderPrivateCar.getRoadTollMoney() > 0){
                                    glf_english.text("GHS " + new BigDecimal(orderPrivateCar.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element glf_english_div = document.getElementById("glf_english_div");
                                    glf_english_div.remove();
                                }
                                Element tcf_english = document.getElementById("tcf_english");
                                if(null != orderPrivateCar.getParkMoney() && orderPrivateCar.getParkMoney() > 0){
                                    tcf_english.text("GHS " + new BigDecimal(orderPrivateCar.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element tcf_english_div = document.getElementById("tcf_english_div");
                                    tcf_english_div.remove();
                                }
                                if(null != orderPrivateCar.getCouponMoney() && orderPrivateCar.getCouponMoney() > 0){
                                    Element yhq_english = document.getElementById("yhq_english");
                                    yhq_english.text("GHS -" + new BigDecimal(orderPrivateCar.getCouponMoney()).setScale(2, RoundingMode.HALF_EVEN));
@@ -1967,8 +2154,43 @@
                                document.getElementsByTag("title").get(0).text("Reçu");
                                Element title_french = document.getElementById("title_french");
                                title_french.text("Le " + DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ", vous avez dépensé GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue() + " sur le voyage");
                                Element xcf_french = document.getElementById("xcf_french");
                                xcf_french.text("GHS " + new BigDecimal(orderPrivateCar.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                Element qbj_french = document.getElementById("qbj_french");
                                qbj_french.text("GHS " + new BigDecimal(orderPrivateCar.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                Element scf_french = document.getElementById("scf_french");
                                if(null != orderPrivateCar.getDurationMoney() && orderPrivateCar.getDurationMoney() > 0){
                                    scf_french.text("GHS " + new BigDecimal(orderPrivateCar.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element scf_french_div = document.getElementById("scf_french_div");
                                    scf_french_div.remove();
                                }
                                Element lcf_french = document.getElementById("lcf_french");
                                if(null != orderPrivateCar.getMileageMoney() && orderPrivateCar.getMileageMoney() > 0){
                                    lcf_french.text("GHS " + new BigDecimal(orderPrivateCar.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element lcf_french_div = document.getElementById("lcf_french_div");
                                    lcf_french_div.remove();
                                }
                                Element ddf_french = document.getElementById("ddf_french");
                                if(null != orderPrivateCar.getWaitMoney() && orderPrivateCar.getWaitMoney() > 0){
                                    ddf_french.text("GHS " + new BigDecimal(orderPrivateCar.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element ddf_french_div = document.getElementById("ddf_french_div");
                                    ddf_french_div.remove();
                                }
                                Element glf_french = document.getElementById("glf_french");
                                if(null != orderPrivateCar.getRoadTollMoney() && orderPrivateCar.getRoadTollMoney() > 0){
                                    glf_french.text("GHS " + new BigDecimal(orderPrivateCar.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element glf_french_div = document.getElementById("glf_french_div");
                                    glf_french_div.remove();
                                }
                                Element tcf_french = document.getElementById("tcf_french");
                                if(null != orderPrivateCar.getParkMoney() && orderPrivateCar.getParkMoney() > 0){
                                    tcf_french.text("GHS " + new BigDecimal(orderPrivateCar.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element tcf_french_div = document.getElementById("tcf_french_div");
                                    tcf_french_div.remove();
                                }
                                if(null != orderPrivateCar.getCouponMoney() && orderPrivateCar.getCouponMoney() > 0){
                                    Element yhq_french = document.getElementById("yhq_french");
                                    yhq_french.text("GHS -" + new BigDecimal(orderPrivateCar.getCouponMoney()).setScale(2, RoundingMode.HALF_EVEN));
@@ -2093,7 +2315,7 @@
                public void run() {
                    pushUtil.pushOrderState(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0, "");
                    pushUtil.pushOrderState(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0, "");
                    pushUtil.pushOfflinePayment(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1);
                    pushUtil.pushOfflinePayment(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, orderPrivateCar.getPayMoney());
                }
            }).start();
@@ -2406,8 +2628,43 @@
                                document.getElementsByTag("title").get(0).text("I-GO电子收据");
                                Element title_chinese = document.getElementById("title_chinese");
                                title_chinese.text(DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ",您在I-GO此订单消费GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                                Element xcf_chinese = document.getElementById("xcf_chinese");
                                xcf_chinese.text("GHS " + new BigDecimal(orderPrivateCar.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                Element qbj_chinese = document.getElementById("qbj_chinese");
                                qbj_chinese.text("GHS " + new BigDecimal(orderPrivateCar.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                Element scf_chinese = document.getElementById("scf_chinese");
                                if(null != orderPrivateCar.getDurationMoney() && orderPrivateCar.getDurationMoney() > 0){
                                    scf_chinese.text("GHS " + new BigDecimal(orderPrivateCar.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element scf_chinese_div = document.getElementById("scf_chinese_div");
                                    scf_chinese_div.remove();
                                }
                                Element lcf_chinese = document.getElementById("lcf_chinese");
                                if(null != orderPrivateCar.getMileageMoney() && orderPrivateCar.getMileageMoney() > 0){
                                    lcf_chinese.text("GHS " + new BigDecimal(orderPrivateCar.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element lcf_chinese_div = document.getElementById("lcf_chinese_div");
                                    lcf_chinese_div.remove();
                                }
                                Element ddf_chinese = document.getElementById("ddf_chinese");
                                if(null != orderPrivateCar.getWaitMoney() && orderPrivateCar.getWaitMoney() > 0){
                                    ddf_chinese.text("GHS " + new BigDecimal(orderPrivateCar.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element ddf_chinese_div = document.getElementById("ddf_chinese_div");
                                    ddf_chinese_div.remove();
                                }
                                Element glf_chinese = document.getElementById("glf_chinese");
                                if(null != orderPrivateCar.getRoadTollMoney() && orderPrivateCar.getRoadTollMoney() > 0){
                                    glf_chinese.text("GHS " + new BigDecimal(orderPrivateCar.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element glf_chinese_div = document.getElementById("glf_chinese_div");
                                    glf_chinese_div.remove();
                                }
                                Element tcf_chinese = document.getElementById("tcf_chinese");
                                if(null != orderPrivateCar.getParkMoney() && orderPrivateCar.getParkMoney() > 0){
                                    tcf_chinese.text("GHS " + new BigDecimal(orderPrivateCar.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element tcf_chinese_div = document.getElementById("tcf_chinese_div");
                                    tcf_chinese_div.remove();
                                }
                                if(null != orderPrivateCar.getCouponMoney() && orderPrivateCar.getCouponMoney() > 0){
                                    Element yhq_chinese = document.getElementById("yhq_chinese");
                                    yhq_chinese.text("GHS -" + new BigDecimal(orderPrivateCar.getCouponMoney()).setScale(2, RoundingMode.HALF_EVEN));
@@ -2472,8 +2729,43 @@
                                document.getElementsByTag("title").get(0).text("Receipt");
                                Element title_english = document.getElementById("title_english");
                                title_english.text(DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ",You spent GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue() + " on the trip ");
                                Element xcf_english = document.getElementById("xcf_english");
                                xcf_english.text("GHS " + new BigDecimal(orderPrivateCar.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                Element qbj_english = document.getElementById("qbj_english");
                                qbj_english.text("GHS " + new BigDecimal(orderPrivateCar.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                Element scf_english = document.getElementById("scf_english");
                                if(null != orderPrivateCar.getDurationMoney() && orderPrivateCar.getDurationMoney() > 0){
                                    scf_english.text("GHS " + new BigDecimal(orderPrivateCar.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element scf_english_div = document.getElementById("scf_english_div");
                                    scf_english_div.remove();
                                }
                                Element lcf_english = document.getElementById("lcf_english");
                                if(null != orderPrivateCar.getMileageMoney() && orderPrivateCar.getMileageMoney() > 0){
                                    lcf_english.text("GHS " + new BigDecimal(orderPrivateCar.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element lcf_english_div = document.getElementById("lcf_english_div");
                                    lcf_english_div.remove();
                                }
                                Element ddf_english = document.getElementById("ddf_english");
                                if(null != orderPrivateCar.getWaitMoney() && orderPrivateCar.getWaitMoney() > 0){
                                    ddf_english.text("GHS " + new BigDecimal(orderPrivateCar.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element ddf_english_div = document.getElementById("ddf_english_div");
                                    ddf_english_div.remove();
                                }
                                Element glf_english = document.getElementById("glf_english");
                                if(null != orderPrivateCar.getRoadTollMoney() && orderPrivateCar.getRoadTollMoney() > 0){
                                    glf_english.text("GHS " + new BigDecimal(orderPrivateCar.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element glf_english_div = document.getElementById("glf_english_div");
                                    glf_english_div.remove();
                                }
                                Element tcf_english = document.getElementById("tcf_english");
                                if(null != orderPrivateCar.getParkMoney() && orderPrivateCar.getParkMoney() > 0){
                                    tcf_english.text("GHS " + new BigDecimal(orderPrivateCar.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element tcf_english_div = document.getElementById("tcf_english_div");
                                    tcf_english_div.remove();
                                }
                                if(null != orderPrivateCar.getCouponMoney() && orderPrivateCar.getCouponMoney() > 0){
                                    Element yhq_english = document.getElementById("yhq_english");
                                    yhq_english.text("GHS -" + new BigDecimal(orderPrivateCar.getCouponMoney()).setScale(2, RoundingMode.HALF_EVEN));
@@ -2538,8 +2830,43 @@
                                document.getElementsByTag("title").get(0).text("Reçu");
                                Element title_french = document.getElementById("title_french");
                                title_french.text("Le " + DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ", vous avez dépensé GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue() + " sur le voyage");
                                Element xcf_french = document.getElementById("xcf_french");
                                xcf_french.text("GHS " + new BigDecimal(orderPrivateCar.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                Element qbj_french = document.getElementById("qbj_french");
                                qbj_french.text("GHS " + new BigDecimal(orderPrivateCar.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                Element scf_french = document.getElementById("scf_french");
                                if(null != orderPrivateCar.getDurationMoney() && orderPrivateCar.getDurationMoney() > 0){
                                    scf_french.text("GHS " + new BigDecimal(orderPrivateCar.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element scf_french_div = document.getElementById("scf_french_div");
                                    scf_french_div.remove();
                                }
                                Element lcf_french = document.getElementById("lcf_french");
                                if(null != orderPrivateCar.getMileageMoney() && orderPrivateCar.getMileageMoney() > 0){
                                    lcf_french.text("GHS " + new BigDecimal(orderPrivateCar.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element lcf_french_div = document.getElementById("lcf_french_div");
                                    lcf_french_div.remove();
                                }
                                Element ddf_french = document.getElementById("ddf_french");
                                if(null != orderPrivateCar.getWaitMoney() && orderPrivateCar.getWaitMoney() > 0){
                                    ddf_french.text("GHS " + new BigDecimal(orderPrivateCar.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element ddf_french_div = document.getElementById("ddf_french_div");
                                    ddf_french_div.remove();
                                }
                                Element glf_french = document.getElementById("glf_french");
                                if(null != orderPrivateCar.getRoadTollMoney() && orderPrivateCar.getRoadTollMoney() > 0){
                                    glf_french.text("GHS " + new BigDecimal(orderPrivateCar.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element glf_french_div = document.getElementById("glf_french_div");
                                    glf_french_div.remove();
                                }
                                Element tcf_french = document.getElementById("tcf_french");
                                if(null != orderPrivateCar.getParkMoney() && orderPrivateCar.getParkMoney() > 0){
                                    tcf_french.text("GHS " + new BigDecimal(orderPrivateCar.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN));
                                }else{
                                    Element tcf_french_div = document.getElementById("tcf_french_div");
                                    tcf_french_div.remove();
                                }
                                if(null != orderPrivateCar.getCouponMoney() && orderPrivateCar.getCouponMoney() > 0){
                                    Element yhq_french = document.getElementById("yhq_french");
                                    yhq_french.text("GHS -" + new BigDecimal(orderPrivateCar.getCouponMoney()).setScale(2, RoundingMode.HALF_EVEN));
@@ -2752,6 +3079,11 @@
        if(state == 11){
            map.put("state", map.get("oldState"));
        }
        if(state == 12){
            OrderCancel query = orderCancelService.query(orderId, 1, null, null, 1);
            map.put("cancelPayMoney", null == query ? 0 : query.getMoney());
            map.put("cancelMoney", null == query ? 0 : query.getMoney());
        }
        if(Integer.valueOf(String.valueOf(map.get("state"))) != 8 && Integer.valueOf(String.valueOf(map.get("state"))) != 9){
            map.put("redPacketMoney", null);
            map.put("couponMoney", null);
@@ -2762,6 +3094,7 @@
                Integer orderNum=this.selectCount(new EntityWrapper<OrderPrivateCar>().eq("userId",orderPrivateCar.getUserId()).eq("activityId",query2.getId()).last(" and to_days(getoffTime) = to_days(now())"));
                if(query2.getDistance()*1000>orderPrivateCar.getMileage() && query2.getOrderNum()>orderNum){
                    Double special = query2.getSpecial();
                    map.put("discount", special);
                    orderPrivateCar.setDiscount(special);
                    Double orderMoney = orderPrivateCar.getOrderMoney();
                    double v = new BigDecimal(orderMoney).multiply(new BigDecimal(special / 10)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
@@ -2990,13 +3323,13 @@
            String audioUrl = "";
            switch (language1){
                case 1:
                    audioUrl = "http://182.160.16.251:81/files/audio/ChangeAddress-CN.mp3";
                    audioUrl = "http://182.160.16.251:81/files/audio/system/ChangeAddress-CN.mp3";
                    break;
                case 2:
                    audioUrl = "http://182.160.16.251:81/files/audio/ChangeAddress-EN.mp3";
                    audioUrl = "http://182.160.16.251:81/files/audio/system/ChangeAddress-EN.mp3";
                    break;
                case 3:
                    audioUrl = "http://182.160.16.251:81/files/audio/ChangeAddress-FR.mp3";
                    audioUrl = "http://182.160.16.251:81/files/audio/system/ChangeAddress-FR.mp3";
                    break;
            }
            pushUtil.pushModifyAddress(2, orderPrivateCar.getDriverId(), orderId, 1, 1, audioUrl);
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/DriverActivityHistory.java
@@ -34,6 +34,11 @@
    @TableField("type")
    private Integer type;
    /**
     * 司机活动id
     */
    @TableField("driverActivityId")
    private Integer driverActivityId;
    /**
     * 活动id
     */
    @TableField("activityId")
@@ -85,7 +90,15 @@
    public void setType(Integer type) {
        this.type = type;
    }
    public Integer getDriverActivityId() {
        return driverActivityId;
    }
    public void setDriverActivityId(Integer driverActivityId) {
        this.driverActivityId = driverActivityId;
    }
    public Integer getActivityId() {
        return activityId;
    }
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushUtil.java
@@ -460,7 +460,7 @@
     * @param orderId
     * @param orderType
     */
    public void pushOfflinePayment(Integer type, Integer uid, Integer orderId, Integer orderType){
    public void pushOfflinePayment(Integer type, Integer uid, Integer orderId, Integer orderType, Double money){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("code", 200);
        jsonObject.put("msg", "SUCCESS");
@@ -468,6 +468,7 @@
        Map<String, Object> map = new HashMap<>();
        map.put("orderId", orderId);
        map.put("orderType", orderType);
        map.put("money", money);
        jsonObject.put("data", map);
        //调用推送
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/OrderInfoWarpper.java
@@ -69,9 +69,9 @@
    private Integer cancelId;
    @ApiModelProperty("订单总金额")
    private Double orderMoney;
    @ApiModelProperty("起步里程")
    private Double startMoney;
    @ApiModelProperty("起步价")
    private Double startMoney;
    @ApiModelProperty("起步里程")
    private Double startMileage;
    @ApiModelProperty("里程数")
    private Double mileage;
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/OrderWarpper.java
@@ -60,6 +60,8 @@
    private String remark;
    @ApiModelProperty("超时取消时间")
    private Long timeOutCancel;
    @ApiModelProperty("司机超时时间")
    private Long driverTimeOut;
    
    private String tripId;
@@ -223,6 +225,14 @@
        this.timeOutCancel = timeOutCancel;
    }
    
    public Long getDriverTimeOut() {
        return driverTimeOut;
    }
    public void setDriverTimeOut(Long driverTimeOut) {
        this.driverTimeOut = driverTimeOut;
    }
    @Override
    public String toString() {
        return "OrderWarpper{" +
@@ -274,6 +284,7 @@
                orderWarpper.setTripId(null != map.get("tripId") ? String.valueOf(map.get("tripId")) : "");
                orderWarpper.setRemark(null != map.get("remark") ? String.valueOf(map.get("remark")) : "");
                orderWarpper.setTimeOutCancel(null != map.get("timeOutCancel") ? Long.valueOf(String.valueOf(map.get("timeOutCancel"))) : 0);
                orderWarpper.setDriverTimeOut(null != map.get("driverTimeOut") ? Long.valueOf(String.valueOf(map.get("driverTimeOut"))) : 0);
                list.add(orderWarpper);
            }
        }
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java
@@ -413,7 +413,7 @@
        if(null == orderTaxi){
            return ResultUtil.error("取消订单失败,订单信息有误");
        }
        if(orderTaxi.getState() > 5 && orderTaxi.getState() != 11){
        if(orderTaxi.getState() > 5 && orderTaxi.getState() != 12){
            return ResultUtil.error("取消订单失败,不合法的操作");
        }
        if(null == orderTaxi.getDriverId()){//没有接单的情况