zhibing.pu
2024-08-01 287cbb376dea7b3972e5f38a38fad043aa4d3b68
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
package com.stylefeng.guns.modular.smallLogistics.controller;
 
 
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics;
import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService;
import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar;
import com.stylefeng.guns.modular.system.model.Driver;
import com.stylefeng.guns.modular.system.model.Region;
import com.stylefeng.guns.modular.system.model.UserRedPacketRecord;
import com.stylefeng.guns.modular.system.service.IDriverService;
import com.stylefeng.guns.modular.system.service.IDriverServiceService;
import com.stylefeng.guns.modular.system.service.IUserInfoService;
import com.stylefeng.guns.modular.system.util.GoogleMap.DistancematrixVo;
import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil;
import com.stylefeng.guns.modular.system.util.PushUtil;
import com.stylefeng.guns.modular.system.util.RedisUtil;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.util.TextToSpeechUtil;
import com.stylefeng.guns.modular.system.warpper.BaseWarpper;
import com.stylefeng.guns.modular.system.warpper.OrderTimeInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
 
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
 
/**
 * 小件物流控制器
 */
@Api
@RestController
@RequestMapping("")
public class OrderLogisticsController {
 
    @Autowired
    private IOrderLogisticsService orderLogisticsService;
    @Autowired
    private IUserInfoService userInfoService;
    @Autowired
    private PushUtil pushUtil;
    
    @Autowired
    private IDriverService driverService;
    
    @Autowired
    private RedisUtil redisUtil;
    
    
    
    
    
    
 
 
    /**
     * 根据起点和终点坐标判断是不是同一个市内
     * @param startLonLat
     * @param endAddress
     * @return
     */
    @ResponseBody
    @PostMapping("/base/orderLogistics/judgingTheCity")
    @ApiOperation(value = "根据起点和终点坐标判断是不是同一个市内", tags = {"用户端-小件物流"}, notes = "只有在选择了同城小件物流的时候调用")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "起点经纬度(103.23265,30.2312)", name = "startLonLat", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "终点详细地址", name = "endAddress", required = true, paramType = "query", dataType = "string")
    })
    public ResultUtil judgingTheCity(String startLonLat, String endAddress){
        try {
            return orderLogisticsService.judgingTheCity(startLonLat, endAddress);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
 
 
    @ResponseBody
    @PostMapping("/api/orderLogistics/queryLogisticsUnitPrice")
    @ApiOperation(value = "获取小件物流的单价数据", tags = {"用户端-小件物流"}, notes = "ordinary(普通物品),precious(贵重物品),first=0(首次下单)")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "业务类型(4=同城小件物流,5=跨城小件物流)", name = "type", required = true, paramType = "query", dataType = "int"),
            @ApiImplicitParam(value = "起点经纬度(103.23265,30.2312)", name = "startLonLat", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "终点经纬度(103.23265,30.2312)", name = "endLonLat", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "终点详细地址", name = "endAddress", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil queryLogisticsUnitPrice(Integer type, String startLonLat, String endLonLat, String endAddress, Integer language, HttpServletRequest request){
        try {
            Integer uid = userInfoService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            return orderLogisticsService.queryLogisticsUnitPrice(type, startLonLat, endLonLat, endAddress, uid, language);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
 
 
 
 
    @ResponseBody
    @PostMapping("/base/orderLogistics/queryPayMoney")
    @ApiOperation(value = "获取支付金额", tags = {"用户端-小件物流"}, notes = "ordinary(普通物品),precious(贵重物品)")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "货物数量", name = "number", required = true, paramType = "query", dataType = "int"),
            @ApiImplicitParam(value = "业务类型(4=同城小件物流,5=跨城小件物流)", name = "type", required = true, paramType = "query", dataType = "int"),
            @ApiImplicitParam(value = "起点经纬度(103.23265,30.2312)", name = "startLonLat", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "终点经纬度(103.23265,30.2312)", name = "endLonLat", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "终点详细地址", name = "endAddress", required = true, paramType = "query", dataType = "string")
    })
    public ResultUtil queryPayMoney(Integer number, Integer type, String startLonLat, String endLonLat, String endAddress, Integer language){
        try {
            return orderLogisticsService.queryPayMoney(number, type, startLonLat, endLonLat, endAddress, language);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
 
 
    /**
     * 小件物流下单操作
     * @param type
     * @param cargoType
     * @param cargoNumber
     * @param remark
     * @param placementLon
     * @param placementLat
     * @param startLon
     * @param startLat
     * @param startAddress
     * @param recipient
     * @param recipientPhone
     * @param endAddress
     * @param travelTime
     * @param orderSource
     * @param request
     * @return
     */
    @ResponseBody
    @PostMapping("/api/orderLogistics/smallLogistics")
    @ApiOperation(value = "小件物流下单操作(同城/跨城)", tags = {"用户端-小件物流"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "业务类型(4=同城小件物流,5=跨城小件物流)", name = "type", required = true, paramType = "query", dataType = "int"),
            @ApiImplicitParam(value = "货物类型(1=普通货物,2=贵重货物)", name = "cargoType", required = true, paramType = "query", dataType = "int"),
            @ApiImplicitParam(value = "货物数量", name = "cargoNumber", required = true, paramType = "query", dataType = "int"),
            @ApiImplicitParam(value = "备注", name = "remark", required = false, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "下单点经度(103.23265,30.2312)", name = "placementLon", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "下单点纬度(103.23265,30.2312)", name = "placementLat", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "预约取货点经度(103.23265,30.2312)", name = "startLon", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "预约取货点纬度(103.23265,30.2312)", name = "startLat", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "预约取货点详细地址", name = "startAddress", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "收货人姓名", name = "recipient", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "收货人电话", name = "recipientPhone", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "终点经纬度(103.23265,30.2312)", name = "endLonLat", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "收货详细地址", name = "endAddress", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "是否加急(1=否,2=是)", name = "urgent", required = true, paramType = "query", dataType = "int"),
            @ApiImplicitParam(value = "加急费用", name = "tipMoney", required = true, paramType = "query", dataType = "double"),
            @ApiImplicitParam(value = "预约收货时间(2020-09-17 21:00:00)", name = "travelTime", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "下单方式(1:APP下单,2:扫码下单,3:小程序下单,4:司机下单,5:调度下单)", name = "orderSource", required = true, paramType = "query", dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<BaseWarpper> smallLogistics(Integer type, Integer cargoType, Integer cargoNumber, String remark, String placementLon, String placementLat, String startLon, String startLat, String startAddress,
                                     String recipient, String recipientPhone, String endLonLat, String endAddress, Integer urgent, Double tipMoney, Date travelTime, Integer orderSource, Integer language, HttpServletRequest request){
        try {
            Integer uid = userInfoService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            return orderLogisticsService.smallLogistics(type, cargoType, cargoNumber, remark, placementLon, placementLat, startLon, startLat, startAddress,
                    recipient, recipientPhone, endLonLat, endAddress, urgent, tipMoney, travelTime, orderSource, uid, language);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
    
    
    
    
    @ResponseBody
    @PostMapping("/api/orderLogistics/placeOrderPackage")
    @ApiOperation(value = "小件物流下单操作【2.0】", tags = {"用户端-小件物流"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "备注", name = "remark", required = false, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "下单点经度", name = "placementLon", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "下单点纬度", name = "placementLat", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "起点经度", name = "startLon", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "起点纬度", name = "startLat", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "起点详细地址", name = "startAddress", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "收货人姓名", name = "recipient", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "收货人电话", name = "recipientPhone", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "终点经度", name = "endLon", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "终点纬度", name = "endLat", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "收货详细地址", name = "endAddress", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "车型id", name = "serverCarModelId", required = true, paramType = "query", dataType = "int"),
            @ApiImplicitParam(value = "司机id", name = "driverId", required = false, paramType = "query", dataType = "int"),
            @ApiImplicitParam(value = "下单方式(1:APP下单,2:扫码下单,3:小程序下单,4:司机下单,5:调度下单)", name = "orderSource", required = true, paramType = "query", dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<BaseWarpper> placeOrderPackage(String remark, String placementLon, String placementLat, String startLon, String startLat, String startAddress,
                                                     String recipient, String recipientPhone, String endLon, String endLat, String endAddress, Integer serverCarModelId,
                                                     Integer driverId, Integer orderSource, Integer language, HttpServletRequest request){
        try {
            Integer uid = userInfoService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            return orderLogisticsService.placeOrderPackage(remark, placementLon, placementLat, startLon, startLat, startAddress,
                    recipient, recipientPhone, endLon, endLat, endAddress, serverCarModelId, driverId, orderSource, uid, language);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
    
    
    
 
    @ResponseBody
    @PostMapping("/api/orderLogistics/queryLogisticsNumber")
    @ApiOperation(value = "获取首页小件物流订单数量", tags = {"用户端-小件物流"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<BaseWarpper> queryLogisticsNumber(HttpServletRequest request){
        try {
            Integer uid = userInfoService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            int i = orderLogisticsService.queryLogisticsNumber(uid);
            BaseWarpper baseWarppe = new BaseWarpper();
            baseWarppe.setNumber(i);
            return ResultUtil.success(baseWarppe);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
 
 
 
    @ResponseBody
    @PostMapping("/api/orderLogistics/payOrderLogisticsSpread")
    @ApiOperation(value = "小件物流补差价支付【1.1】", tags = {"用户端-小件物流"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "支付方式(1=手机支付,2=银行卡支付,3=余额,4=现金)", name = "payType", required = true, dataType = "int"),
            @ApiImplicitParam(value = "银行卡id", name = "bankCardId", required = false, dataType = "int"),
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "支付端(1=用户APP端,2=司机APP端,3=用户小程序端)", name = "type", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil payOrderLogisticsSpread(Integer orderId, Integer payType, Integer bankCardId, Integer type, Integer language, HttpServletRequest request){
        try {
            Integer uid = userInfoService.getUserIdFormRedis(request);
            if(null == uid) {
                return ResultUtil.tokenErr();
            }
            return orderLogisticsService.payLogisticsOrder_(payType, bankCardId, orderId, type, language);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
 
 
    /**
     * 获取行政区域数据(小程序)
     * @return
     */
    @ResponseBody
    @PostMapping("/api/orderLogistics/queryRegion")
    public Map<String, Object> queryRegion(){
        try {
            Map<String, Object> map = orderLogisticsService.queryRegion();
            return map;
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
 
    @ResponseBody
    @PostMapping("/base/orderLogistics/queryRegions")
    @ApiOperation(value = "获取行政区域三级联动数据", tags = {"用户端-小件物流"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "上级id。第一层传0", name = "parentId", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil queryRegions(Integer parentId){
        try {
            List<Region> regions = orderLogisticsService.queryRegions(parentId);
            return ResultUtil.success(regions);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
    
    
    @ResponseBody
    @PostMapping("/api/orderLogistics/queryTimeInfo")
    @ApiOperation(value = "获取订单详情中的时间信息内容【2.0】", tags = {"用户端-小件物流"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<OrderTimeInfo> queryTimeInfo(Integer orderId, Integer language){
        try {
            OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId);
            OrderTimeInfo orderTimeInfo = new OrderTimeInfo();
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            if(null != orderLogistics.getSnatchOrderTime()){
                orderTimeInfo.setSnatchOrderTime(sdf.format(orderLogistics.getSnatchOrderTime()));
            }
            if(null != orderLogistics.getStartServiceTime()){
                orderTimeInfo.setStartServiceTime(sdf.format(orderLogistics.getStartServiceTime()));
            }
            //分钟
            long time = (System.currentTimeMillis() - orderLogistics.getSnatchOrderTime().getTime()) / 60000;
    
            int h = Double.valueOf(time / 60).intValue();
            long m = time % 60;
            String usedTime = "";
            if(0 == h){
                usedTime = language == 1 ? m + "分钟" : language == 2 ? m + "-minute" : m + "-minute";
            }else{
                usedTime = language == 1 ? h + "小时" + m + "分钟" : language == 2 ? h + "-hour" + m + "-minute" : h + "-hour" + m + "-minute";
            }
            orderTimeInfo.setUsedTime(usedTime);
            if(null != orderLogistics.getEndServiceTime()){
                orderTimeInfo.setEndServiceTime(sdf.format(orderLogistics.getEndServiceTime()));
            }
            DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), orderLogistics.getEndLat(), orderLogistics.getEndLon());
            Long distance = distancematrix.getDistance();
            orderTimeInfo.setAllMileage(Double.valueOf(distance / 1000));
            orderTimeInfo.setMileage(orderLogistics.getMileage() / 1000);
            String value = redisUtil.getValue("DRIVER" + orderLogistics.getDriverId());
            if(ToolUtil.isNotEmpty(value)){
                String[] split = value.split(",");
                distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(split[1]), Double.valueOf(split[0]), orderLogistics.getEndLat(), orderLogistics.getEndLon());
                //分钟
                Long duration = distancematrix.getDuration() / 60;
                h = Double.valueOf(duration / 60).intValue();
                m = duration % 60;
                String remainingTime = "";
                if(0 == h){
                    remainingTime = language == 1 ? m + "分钟" : language == 2 ? m + "-minute" : m + "-minute";
                }else{
                    remainingTime = language == 1 ? h + "小时" + m + "分钟" : language == 2 ? h + "-hour" + m + "-minute" : h + "-hour" + m + "-minute";
                }
                orderTimeInfo.setRemainingTime(remainingTime);
            }
            return ResultUtil.success(orderTimeInfo);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
    
    
    
    @ResponseBody
    @PostMapping("/api/orderLogistics/confirmDifferencePrice")
    @ApiOperation(value = "确认补差价【2.0】", tags = {"用户端-小件物流"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "差价金额", name = "difference", required = true, dataType = "double"),
            @ApiImplicitParam(value = "状态(2=同意,3=拒绝)", name = "status", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil confirmDifferencePrice(Integer orderId, Double difference, Integer status){
        OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId);
        if(2 == status){
            orderLogistics.setPriceDifference(difference);
            orderLogisticsService.updateById(orderLogistics);
        }
        String audioUrl = "";
        if(3 == status){
            Driver driver = driverService.selectById(orderLogistics.getDriverId());
            Integer language = driver.getLanguage();
            String text = "";
            switch (language){
                case 1:
                    text = "您的包裹订单申请补差价 GSH " + difference + " 已被用户拒绝,请重新与用户协商";
                    break;
                case 2:
                    text = "Your delivery order,Request difference GSH " + difference + " was rejected, please renegotiate with the subscriber";
                    break;
                case 3:
                    text = "Votre commande de livraison,Demande de différence GSH " + difference + " a été rejeté, veuillez renégocier avec l’abonné";
                    break;
                    
            }
            String fileName = "difference" + driver.getId() + ".mp3";
            try {
                audioUrl = TextToSpeechUtil.create(language == 1 ? "cmn-CN" : language == 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);
        }
        pushUtil.pushPayDifference(2, orderLogistics.getDriverId(), orderId, 4, difference, status, audioUrl);
        return ResultUtil.success();
    }
    
    
}