From ea719b0443b8ccbc6d17349796936664ff3261d0 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期六, 11 二月 2023 19:04:43 +0800
Subject: [PATCH] 修改bug

---
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java |  488 +++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 341 insertions(+), 147 deletions(-)

diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java
index 7c61785..59f16db 100644
--- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java
@@ -11,24 +11,30 @@
 import com.stylefeng.guns.modular.smallLogistics.model.OrderLogisticsSpread;
 import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService;
 import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsSpreadService;
-import com.stylefeng.guns.modular.system.dao.RegionMapper;
-import com.stylefeng.guns.modular.system.dao.SensitiveWordsMapper;
-import com.stylefeng.guns.modular.system.dao.SysIntegralMapper;
-import com.stylefeng.guns.modular.system.dao.SystemPriceMapper;
+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.*;
+import com.stylefeng.guns.modular.system.util.Tingg.TinggPayUtil;
+import com.stylefeng.guns.modular.system.util.Tingg.model.CheckoutRequest;
 import com.stylefeng.guns.modular.system.warpper.BaseWarpper;
 import com.stylefeng.guns.modular.taxi.model.PaymentRecord;
 import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService;
 import com.stylefeng.guns.modular.taxi.service.ITransactionDetailsService;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.io.File;
 import java.math.BigDecimal;
+import java.math.MathContext;
+import java.math.RoundingMode;
+import java.text.SimpleDateFormat;
 import java.util.*;
 
 
@@ -107,8 +113,17 @@
     @Autowired
     private IUserCouponRecordService userCouponRecordService;
 
+    @Resource
+    private CarMapper carMapper;
+
+    @Autowired
+    private IOrderEvaluateService orderEvaluateService;
+
     @Value("${callbackPath}")
     private String callbackPath;
+
+    @Value("${spring.mail.template-path}")
+    private String templatePath;
 
     private static List<Integer> orderIds = new ArrayList<>();
 
@@ -122,18 +137,18 @@
      */
     @Override
     public ResultUtil judgingTheCity(String startLonLat, String endAddress) throws Exception {
-        Map<String, String> sgeocode = gdMapGeocodingUtil.geocode(startLonLat.split(",")[0], startLonLat.split(",")[1]);
-        String scityCode = sgeocode.get("cityCode");
-        Map<String, Object> geocoding = gdMapGeocodingUtil.geocoding(endAddress);
-        if(Integer.valueOf(geocoding.get("status").toString()) != 0){
-            return ResultUtil.error("收货地址有误,无法查询具体地址信息");
-        }
-        List<String> list = (List<String>)geocoding.get("data");
-        Map<String, String> egeocode = gdMapGeocodingUtil.geocode(list.get(0).split(",")[0], list.get(0).split(",")[1]);
-        String ecityCode = egeocode.get("cityCode");
-        if(!scityCode.equals(ecityCode)){
-            return ResultUtil.error("已超出服务范围,请重新选择跨城小件物流");
-        }
+//        Map<String, String> sgeocode = gdMapGeocodingUtil.geocode(startLonLat.split(",")[0], startLonLat.split(",")[1]);
+//        String scityCode = sgeocode.get("cityCode");
+//        Map<String, Object> geocoding = gdMapGeocodingUtil.geocoding(endAddress);
+//        if(Integer.valueOf(geocoding.get("status").toString()) != 0){
+//            return ResultUtil.error("收货地址有误,无法查询具体地址信息");
+//        }
+//        List<String> list = (List<String>)geocoding.get("data");
+//        Map<String, String> egeocode = gdMapGeocodingUtil.geocode(list.get(0).split(",")[0], list.get(0).split(",")[1]);
+//        String ecityCode = egeocode.get("cityCode");
+//        if(!scityCode.equals(ecityCode)){
+//            return ResultUtil.error("已超出服务范围");
+//        }
         return ResultUtil.success();
     }
 
@@ -147,47 +162,21 @@
      * @throws Exception
      */
     @Override
-    public ResultUtil queryLogisticsUnitPrice(Integer type, String startLonLat, String endAddress, Integer uid) throws Exception {
-        ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(startLonLat.split(",")[1]), Double.valueOf(startLonLat.split(",")[0]));
-        if(null == reverseGeocode){
-            return ResultUtil.error("地理位置解析失败");
+    public ResultUtil queryLogisticsUnitPrice(Integer type, String startLonLat, String endAddress, Integer uid, Integer language) throws Exception {
+        FindPlaceFromTextVo findplacefromtext = GoogleMapUtil.textsearch(endAddress);
+        if(null == findplacefromtext){
+            return ResultUtil.error(language == 1 ? "收货地址有误,无法查询具体地址信息" : language == 2 ? "The delivery address is incorrect, and the specific address information cannot be queried" : "L’adresse de livraison est incorrecte, impossible de vérifier l’adresse spécifique");
         }
-        AddressComponentsVo[] addressComponentsVos = reverseGeocode.getAddressComponentsVos();
-        String[] city = new String[addressComponentsVos.length];
-        for (int i = 0; i < addressComponentsVos.length; i++) {
-            city[i] = addressComponentsVos[i].getLongName();
+        Double lng = findplacefromtext.getLng();
+        Double lat = findplacefromtext.getLat();
+        ResultUtil<Map<String, Double>> price = this.getPrice1(type, startLonLat.split(",")[0], startLonLat.split(",")[1], lng.toString(), lat.toString(), language);
+        if(price.getCode() != 200){
+            return price;
         }
-        Company query = companyCityService.query(city);
-        if(null == query){
-            return ResultUtil.error("预约取货点暂无企业服务");
-        }
-        Double price1 = 0D;
-        Double price2 = 0D;
-        if(type == 4){//同城
-            Map<String, Object> query1 = systemPriceMapper.query(query.getId(), type, null);
-            if(null == query1){
-                return ResultUtil.error("请先完善价格设定");
-            }
-            String content = String.valueOf(query1.get("content"));
-            JSONObject jsonObject = JSON.parseObject(content);
-            price1 = jsonObject.getDouble("num2");
-            price2 = jsonObject.getDouble("num13");
-        }else{
-            Map<String, Object> query1 = systemPriceMapper.query(query.getId(), type, null);
-            if(null == query1){
-                return ResultUtil.error("请先完善价格设定");
-            }
-            String content = String.valueOf(query1.get("content"));
-            JSONObject jsonObject = JSON.parseObject(content);
-            price1 = jsonObject.getDouble("num1");
-            price2 = jsonObject.getDouble("num2");
-        }
-        int i = this.selectCount(new EntityWrapper<OrderLogistics>().eq("userId", uid).eq("isDelete", 1));
-        Map<String, Object> map = new HashMap<>();
-        map.put("ordinary", price1);
-        map.put("precious", price2);
-        map.put("first", i);
-        return ResultUtil.success(map);
+        Integer i = this.selectCount(new EntityWrapper<OrderLogistics>().eq("userId", uid).eq("isDelete", 1));
+        Map<String, Double> map = price.getData();
+        map.put("first", i.doubleValue());
+        return price;
     }
 
 
@@ -199,14 +188,14 @@
      * @return
      * @throws Exception
      */
-    public ResultUtil queryPayMoney(Integer number, Integer type, String startLonLat, String endAddress) throws Exception{
-        FindPlaceFromTextVo findplacefromtext = GoogleMapUtil.findplacefromtext(endAddress);
+    public ResultUtil queryPayMoney(Integer number, Integer type, String startLonLat, String endAddress, Integer language) throws Exception{
+        FindPlaceFromTextVo findplacefromtext = GoogleMapUtil.textsearch(endAddress);
         if(null == findplacefromtext){
-            return ResultUtil.error("收货地址有误,无法查询具体地址信息");
+            return ResultUtil.error(language == 1 ? "收货地址有误,无法查询具体地址信息" : language == 2 ? "The delivery address is incorrect, and the specific address information cannot be queried" : "L’adresse de livraison est incorrecte, impossible de vérifier l’adresse spécifique");
         }
         Double lng = findplacefromtext.getLng();
         Double lat = findplacefromtext.getLat();
-        ResultUtil<Map<String, Double>> price = this.getPrice1(type, startLonLat.split(",")[0], startLonLat.split(",")[1], lng.toString(), lat.toString());
+        ResultUtil<Map<String, Double>> price = this.getPrice1(type, startLonLat.split(",")[0], startLonLat.split(",")[1], lng.toString(), lat.toString(), language);
         if(price.getCode() == 200 && type == 5){
             Map<String, Double> data = price.getData();
             data.put("ordinary", data.get("ordinary") * number);
@@ -240,7 +229,7 @@
      */
     @Override
     public ResultUtil smallLogistics(Integer type, Integer cargoType, Integer cargoNumber, String remark, String placementLon, String placementLat, String startLon, String startLat, String startAddress, String recipient,
-                                     String recipientPhone, String endAddress, Integer urgent, Double tipMoney, Date travelTime, Integer orderSource, Integer uid) throws Exception {
+                                     String recipientPhone, String endAddress, Integer urgent, Double tipMoney, Date travelTime, Integer orderSource, Integer uid, Integer language) throws Exception {
         startAddress = startAddress.replaceAll("& #40;", "(");
         startAddress = startAddress.replaceAll("& #41;", ")");
         endAddress = endAddress.replaceAll("& #40;", "(");
@@ -248,7 +237,7 @@
         OrderLogistics orderLogistics = new OrderLogistics();
         Company query = companyCityService.query1(placementLon, placementLat);
         if(null == query){
-            return ResultUtil.error("该地点暂无企业服务");
+            return ResultUtil.error(language == 1 ? "该地点暂无企业服务" : language == 2 ? "No corporate services are available at this location" : "Aucun service d’entreprise n’est disponible pour cet emplacement");
         }
         orderLogistics.setCompanyId(query.getId());
         orderLogistics.setType(type);
@@ -261,7 +250,7 @@
         orderLogistics.setPlacementLat(Double.valueOf(placementLat));
         ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(placementLat), Double.valueOf(placementLon));
         if(null == reverseGeocode){
-            return ResultUtil.error("解析地址出错");
+            return ResultUtil.error(language == 1 ? "解析地址出错" : language == 2 ? "Resolve address error" : "Erreur dans la résolution de l’adresse");
         }
 
         String address = reverseGeocode.getAddress();
@@ -269,9 +258,9 @@
         orderLogistics.setStartLon(Double.valueOf(startLon));
         orderLogistics.setStartLat(Double.valueOf(startLat));
         orderLogistics.setStartAddress(startAddress);
-        FindPlaceFromTextVo findplacefromtext = GoogleMapUtil.findplacefromtext(endAddress);
+        FindPlaceFromTextVo findplacefromtext = GoogleMapUtil.textsearch(endAddress);
         if(null == findplacefromtext){
-            return ResultUtil.error("收货地址有误,无法查询具体地址信息");
+            return ResultUtil.error(language == 1 ? "收货地址有误,无法查询具体地址信息" : language == 2 ? "The delivery address is incorrect, and the specific address information cannot be queried" : "L’adresse de livraison est incorrecte, impossible de vérifier l’adresse spécifique");
         }
         Double lng = findplacefromtext.getLng();
         Double lat = findplacefromtext.getLat();
@@ -284,7 +273,7 @@
         orderLogistics.setMileage(0D);
         orderLogistics.setIsReassign(1);
         orderLogistics.setReassignNotice(0);
-        ResultUtil<Map<String, Double>> price = this.getPrice1(type, String.valueOf(startLon), String.valueOf(startLat), lng.toString(), lat.toString());
+        ResultUtil<Map<String, Double>> price = this.getPrice1(type, String.valueOf(startLon), String.valueOf(startLat), lng.toString(), lat.toString(), language);
         if(price.getCode() != 200){
             return price;
         }
@@ -298,13 +287,14 @@
         orderLogistics.setTipMoney(tipMoney);
         orderLogistics.setState(7);//待支付
         orderLogistics.setInsertTime(new Date());
-        orderLogistics.setTravelTime(travelTime);
+        orderLogistics.setTravelTime(null == travelTime ? new Date() : travelTime);
         orderLogistics.setOrderSource(orderSource);
         orderLogistics.setIsDelete(1);
         this.insert(orderLogistics);
 
         //添加消息
-        systemNoticeService.addSystemNotice(1, "您的"+ (type == 4 ? "同城" : "跨城") + "小件物流订单已下单成功,我们正在为您指派司机,请稍后!", orderLogistics.getUserId(), 1);
+        systemNoticeService.addSystemNotice(1, language == 1 ? "您的市内小件物流订单已下单成功,我们正在为您指派司机,请稍后!" :
+                                            language == 2 ? "Your local small parts logistics order has been successfully placed, we are assigning you a driver, please wait!" : "Votre commande de city small pieces logistics a été passée avec succès. Nous vous assignons un chauffeur. Plus tard!", orderLogistics.getUserId(), 1);
 
         BaseWarpper baseWarpper = new BaseWarpper();
         baseWarpper.setId(orderLogistics.getId());
@@ -319,7 +309,7 @@
      * @throws Exception
      */
     public ResultUtil<Map<String, Double>> getPrice(Integer type, String startLon, String startLat, String endLon, String endLat) throws Exception{
-        Company query = companyCityService.query(startLon, startLat);
+        Company query = companyCityService.query1(startLon, startLat);
         if(null == query){
             return ResultUtil.error("预约取货点暂无企业服务");
         }
@@ -335,29 +325,17 @@
             if(dist.compareTo(0D) >= 0 && dist.compareTo(jsonObject.getDouble("num1")) < 0){
                 price1 = jsonObject.getDouble("num2");
             }
-            if(dist.compareTo(0D) >= 0 && dist.compareTo(jsonObject.getDouble("num12")) < 0){
-                price2 = jsonObject.getDouble("num13");
-            }
 
             if(dist.compareTo(jsonObject.getDouble("num3")) >= 0 && dist.compareTo(jsonObject.getDouble("num4")) < 0){
                 price1 = jsonObject.getDouble("num5");
-            }
-            if(dist.compareTo(jsonObject.getDouble("num14")) >= 0 && dist.compareTo(jsonObject.getDouble("num15")) < 0){
-                price2 = jsonObject.getDouble("num16");
             }
 
             if(dist.compareTo(jsonObject.getDouble("num6")) >= 0 && dist.compareTo(jsonObject.getDouble("num7")) < 0){
                 price1 = jsonObject.getDouble("num8");
             }
-            if(dist.compareTo(jsonObject.getDouble("num17")) >= 0 && dist.compareTo(jsonObject.getDouble("num18")) < 0){
-                price2 = jsonObject.getDouble("num19");
-            }
 
             if(dist.compareTo(jsonObject.getDouble("num9")) >= 0 && dist.compareTo(jsonObject.getDouble("num10")) < 0){
                 price1 = jsonObject.getDouble("num11");
-            }
-            if(dist.compareTo(jsonObject.getDouble("num20")) >= 0 && dist.compareTo(jsonObject.getDouble("num21")) < 0){
-                price2 = jsonObject.getDouble("num22");
             }
         }else{
             Map<String, Object> query1 = systemPriceMapper.query(query.getId(), type, null);
@@ -374,10 +352,11 @@
 
 
 
-    public ResultUtil<Map<String, Double>> getPrice1(Integer type, String startLon, String startLat, String endLon, String endLat) throws Exception{
+    public ResultUtil<Map<String, Double>> getPrice1(Integer type, String startLon, String startLat, String endLon, String endLat, Integer language) throws Exception{
         Company query = companyCityService.query1(startLon, startLat);
         if(null == query){
-            return ResultUtil.error("预约取货点暂无企业服务");
+            return ResultUtil.error(language == 1 ? "预约取货点暂无企业服务" : language == 2 ?
+                    "There is no enterprise service at the reservation pickup point" : "Prise de rendez-vous point de collecte pas encore disponible pour les entreprises");
         }
         Double price1 = 0D;
         Double price2 = 0D;
@@ -385,7 +364,10 @@
             Map<String, Object> query1 = systemPriceMapper.query(query.getId(), type, null);
             DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(startLat), Double.valueOf(startLon), Double.valueOf(endLat), Double.valueOf(endLon));
             if(null == distancematrix){
-                return ResultUtil.error("计算距离出错");
+                return ResultUtil.error(language == 1 ? "计算距离出错" : language == 2 ? "Error in distance calculation" : "Erreur de calcul des distances");
+            }
+            if(distancematrix.getDistance() == 0){
+                return ResultUtil.error(language == 1 ? "未获取到有效的距离" : language == 2 ? "A valid distance was not obtained" : "La distance effective n’est pas acquise");
             }
             String content = String.valueOf(query1.get("content"));
             JSONObject jsonObject = JSON.parseObject(content);
@@ -394,29 +376,17 @@
             if(dist.compareTo(0D) >= 0 && dist.compareTo(jsonObject.getDouble("num1")) < 0){
                 price1 = jsonObject.getDouble("num2");
             }
-            if(dist.compareTo(0D) >= 0 && dist.compareTo(jsonObject.getDouble("num12")) < 0){
-                price2 = jsonObject.getDouble("num13");
-            }
-
             if(dist.compareTo(jsonObject.getDouble("num3")) >= 0 && dist.compareTo(jsonObject.getDouble("num4")) < 0){
                 price1 = jsonObject.getDouble("num5");
             }
-            if(dist.compareTo(jsonObject.getDouble("num14")) >= 0 && dist.compareTo(jsonObject.getDouble("num15")) < 0){
-                price2 = jsonObject.getDouble("num16");
-            }
-
             if(dist.compareTo(jsonObject.getDouble("num6")) >= 0 && dist.compareTo(jsonObject.getDouble("num7")) < 0){
                 price1 = jsonObject.getDouble("num8");
             }
-            if(dist.compareTo(jsonObject.getDouble("num17")) >= 0 && dist.compareTo(jsonObject.getDouble("num18")) < 0){
-                price2 = jsonObject.getDouble("num19");
-            }
-
             if(dist.compareTo(jsonObject.getDouble("num9")) >= 0 && dist.compareTo(jsonObject.getDouble("num10")) < 0){
                 price1 = jsonObject.getDouble("num11");
             }
-            if(dist.compareTo(jsonObject.getDouble("num20")) >= 0 && dist.compareTo(jsonObject.getDouble("num21")) < 0){
-                price2 = jsonObject.getDouble("num22");
+            if(dist.compareTo(jsonObject.getDouble("num10")) > 0){
+                return ResultUtil.error(language == 1 ? "超出可服务范围" : language == 2 ? "Out of service range" : "Au-delà du service disponible");
             }
         }else{
             Map<String, Object> query1 = systemPriceMapper.query(query.getId(), type, null);
@@ -449,7 +419,7 @@
                     if(ToolUtil.isNotEmpty(vehicle)){
                         integers = JSON.parseArray(vehicle).toJavaList(Integer.class);
                     }
-                    Company query = companyCityService.query(String.valueOf(orderLogistics.getStartLon()), String.valueOf(orderLogistics.getStartLat()));//获取起点所属分公司
+                    Company query = companyCityService.query1(String.valueOf(orderLogistics.getStartLon()), String.valueOf(orderLogistics.getStartLat()));//获取起点所属分公司
                     List<PushOrder> querys = pushOrderService.querys(null, 1, query.getId());//用专车的推单配置
                     for(int i = 1; i <= querys.size(); i++){
                         PushOrder pushOrder = pushOrderService.querys(i, 1, query.getId()).get(0);
@@ -502,10 +472,10 @@
      * @throws Exception
      */
     @Override
-    public ResultUtil payLogisticsOrder(Integer payType, Integer orderId, Integer type) throws Exception {
+    public ResultUtil payLogisticsOrder(Integer payType, String accountNumber, Integer orderId, Integer type, Integer language) throws Exception {
         OrderLogistics orderLogistics = this.selectById(orderId);
         if(orderLogistics.getState() != 7){
-            return ResultUtil.error("订单已完成支付,不允许重复支付", "");
+            return ResultUtil.error("订单已完成支付,不允许重复支付");
         }
         Integer uid = orderLogistics.getUserId();
         Double orderMoney = orderLogistics.getOrderMoney();
@@ -513,33 +483,30 @@
             orderMoney += null != orderLogistics.getTipMoney() ? orderLogistics.getTipMoney() : 0;
         }
         UserInfo userInfo = userInfoService.selectById(uid);
-        ResultUtil resultUtil = ResultUtil.success(new HashMap<>());
+        ResultUtil resultUtil = ResultUtil.success();
 
-        if(payType == 1){//手机支付
-           return payMoneyUtil.weixinpay("小件物流下单支付",orderId +"",orderId + "_" + orderLogistics.getType(),orderMoney+"","/base/wxPayOrderTaxi","JSAPI",userInfo.getAppletsOpenId());
-                  /*  icbcPayUtil.placeAnOrder(orderId + "," + orderLogistics.getType(), 9, 5, uid.toString(),
-                            "小件物流下单支付", orderMoney, callbackPath + "/base/wxPayOrderTaxi", "",
-                            type, userInfo.getAppletsOpenId());*/
-            /*if(map.get("code").equals("200")){
-                paymentRecordService.saveData(1, null, null, orderId, orderLogistics.getType(), 1, orderMoney, map.get("order_id"), 1);//添加预支付数据
-                resultUtil = ResultUtil.success(map.get("data"));
-            }else{
-                resultUtil = ResultUtil.error(map.get("msg"), "");
-            }*/
+        if(payType == 1) {//手机支付
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
+            String merchantTransactionId = sdf.format(new Date()) + "4" + language + orderId;
+            CheckoutRequest checkoutRequest = new CheckoutRequest();
+            checkoutRequest.setMsisdn(Long.valueOf(userInfo.getPhone()));
+            checkoutRequest.setCustomerEmail(userInfo.getEmail());
+            checkoutRequest.setAccountNumber(accountNumber);
+            checkoutRequest.setCustomerFirstName(userInfo.getFirstName());
+            checkoutRequest.setCustomerLastName(userInfo.getLastName());
+            checkoutRequest.setRequestAmount(orderMoney);
+            checkoutRequest.setMerchantTransactionId(merchantTransactionId);
+            checkoutRequest.setRequestDescription("Travel completion payment");
+            checkoutRequest.setCallbackUrl(callbackPath + "/base/wxPayOrderTaxi");
+            checkoutRequest.setPendingRedirectUrl("");
+            checkoutRequest.setSuccessRedirectUrl("https://10pz685243.zicp.fun");
+            checkoutRequest.setFailRedirectUrl("https://www.baidu.com");
+            return TinggPayUtil.checkoutRequest(checkoutRequest);
         }
-        if(payType == 2){//银行卡支付
-            return payMoneyUtil.alipay("小件物流下单支付","小件物流下单支付",orderId + "," + orderLogistics.getType(),orderMoney+"","/base/aliPayOrderTaxi");
-           /* Map<String, String> map = icbcPayUtil.placeAnOrder(orderId + "," + orderLogistics.getType(), 10, 5, uid.toString(), "小件物流下单支付", orderMoney, callbackPath + "/base/aliPayOrderTaxi", "", type, null);
-            if(map.get("code").equals("200")){
-                paymentRecordService.saveData(1, null, null, orderId, orderLogistics.getType(), 2, orderMoney, map.get("order_id"), 1);//添加预支付数据
-                resultUtil = ResultUtil.success(map.get("data"));
-            }else{
-                resultUtil = ResultUtil.error(map.get("msg"), "");
-            }*/
-        }
+
         if(payType == 3){//余额支付
             if(userInfo.getBalance() == null || userInfo.getBalance() < orderMoney){
-                return ResultUtil.error("余额不足,无法完成支付", "");
+                return ResultUtil.error(language == 1 ? "账户余额不足" : language == 2 ? "Insufficient account balance" : "Solde de compte insuffisant");
             }
 
             userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
@@ -555,6 +522,77 @@
             orderLogistics.setPayType(3);
             orderLogistics.setPayMoney(orderMoney);
 
+
+
+            if(ToolUtil.isNotEmpty(userInfo.getEmail())){
+                String path = templatePath + "user/receiptLogistics.html";
+                Document document = Jsoup.parse(new File(path), "UTF-8");
+                SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy年MM月dd日");
+                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/MM/dd HH:mm");
+                if(1 == language){
+                    document.getElementById("english").attr("style", "display: none;");
+                    document.getElementById("french").attr("style", "display: none;");
+                    Element title_chinese = document.getElementById("title_chinese");
+                    title_chinese.text(sdf2.format(orderLogistics.getTravelTime()) + ",您在I-GO1个订单消费GHS " + orderLogistics.getPayMoney());
+                    Element xcf_chinese = document.getElementById("xcf_chinese");
+                    xcf_chinese.text("GHS " + orderLogistics.getOrderMoney());
+                    Element xj_chinese = document.getElementById("xj_chinese");
+                    xj_chinese.text("GHS " + orderLogistics.getOrderMoney());
+                    Element pay_type_chinese = document.getElementById("pay_type_chinese");
+                    pay_type_chinese.text("余额");
+                    Element pay_money_chinese = document.getElementById("pay_money_chinese");
+                    pay_money_chinese.text("GHS " + orderLogistics.getPayMoney());
+                    Element pay_time_chinese = document.getElementById("pay_time_chinese");
+                    pay_time_chinese.text(sdf1.format(orderLogistics.getTravelTime()));
+                    Element start_address_chinese = document.getElementById("start_address_chinese");
+                    start_address_chinese.text(orderLogistics.getStartAddress());
+                    Element end_address_chinese = document.getElementById("end_address_chinese");
+                    end_address_chinese.text(orderLogistics.getEndAddress());
+                }
+                if(2 == language){
+                    document.getElementById("chinese").attr("style", "display: none;");
+                    document.getElementById("french").attr("style", "display: none;");
+                    Element title_english = document.getElementById("title_english");
+                    title_english.text(sdf2.format(orderLogistics.getTravelTime()) + ",You spent GHS " + orderLogistics.getPayMoney() + " on the trip ");
+                    Element xcf_english = document.getElementById("xcf_english");
+                    xcf_english.text("GHS " + orderLogistics.getOrderMoney());
+                    Element xj_english = document.getElementById("xj_english");
+                    xj_english.text("GHS " + orderLogistics.getOrderMoney());
+                    Element pay_type_english = document.getElementById("pay_type_english");
+                    pay_type_english.text("balance");
+                    Element pay_money_english = document.getElementById("pay_money_english");
+                    pay_money_english.text("GHS " + orderLogistics.getPayMoney());
+                    Element pay_time_english = document.getElementById("pay_time_english");
+                    pay_time_english.text(sdf1.format(orderLogistics.getTravelTime()));
+                    Element start_address_english = document.getElementById("start_address_english");
+                    start_address_english.text(orderLogistics.getStartAddress());
+                    Element end_address_english = document.getElementById("end_address_english");
+                    end_address_english.text(orderLogistics.getEndAddress());
+                }
+                if(3 == language){
+                    document.getElementById("chinese").attr("style", "display: none;");
+                    document.getElementById("english").attr("style", "display: none;");
+                    Element title_french = document.getElementById("title_french");
+                    title_french.text(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 " + orderLogistics.getOrderMoney());
+                    Element xj_french = document.getElementById("xj_french");
+                    xj_french.text("GHS " + orderLogistics.getOrderMoney());
+                    Element pay_type_french = document.getElementById("pay_type_french");
+                    pay_type_french.text("Le solde");
+                    Element pay_money_french = document.getElementById("pay_money_french");
+                    pay_money_french.text("GHS " + orderLogistics.getPayMoney());
+                    Element pay_time_french = document.getElementById("pay_time_french");
+                    pay_time_french.text(sdf1.format(orderLogistics.getTravelTime()));
+                    Element start_address_french = document.getElementById("start_address_french");
+                    start_address_french.text(orderLogistics.getStartAddress());
+                    Element end_address_french = document.getElementById("end_address_french");
+                    end_address_french.text(orderLogistics.getEndAddress());
+                }
+
+                EmailUtil.send(userInfo.getEmail(), language == 1 ? "市内小件物流收据" : language == 2 ? "Reset password" : "Réinitialiser le mot de passe",  document.html());
+            }
+
             // TODO: 2020/5/24 这里需要给司机和用户推送订单状态
             new Thread(new Runnable() {
                 @Override
@@ -562,9 +600,9 @@
                     pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0);
                 }
             }).start();
-
-            systemNoticeService.addSystemNotice(1, "您已使用余额成功完成小件物流订单支付,谢谢使用!", uid, 1);
-
+            systemNoticeService.addSystemNotice(1, language == 1 ? "您已使用余额成功完成小件物流订单支付,谢谢使用!" : language == 2
+                    ? "You have successfully used the balance to complete the small logistics order payment, thank you for using!"
+                    : "Vous avez utilisé le solde pour compléter avec succès le paiement de la commande logistique de petites pièces. Merci d’utiliser!", uid, 1);
             this.pushOrder(orderLogistics);//推单
         }
 
@@ -581,15 +619,88 @@
             orderLogistics.setPayType(4);
             orderLogistics.setPayMoney(orderMoney);
 
+            if(ToolUtil.isNotEmpty(userInfo.getEmail())){
+                String path = templatePath + "user/receiptLogistics.html";
+                Document document = Jsoup.parse(new File(path), "UTF-8");
+                SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy年MM月dd日");
+                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/MM/dd HH:mm");
+                if(1 == language){
+                    document.getElementById("english").attr("style", "display: none;");
+                    document.getElementById("french").attr("style", "display: none;");
+                    Element title_chinese = document.getElementById("title_chinese");
+                    title_chinese.text(sdf2.format(orderLogistics.getTravelTime()) + ",您在I-GO1个订单消费GHS " + orderLogistics.getPayMoney());
+                    Element xcf_chinese = document.getElementById("xcf_chinese");
+                    xcf_chinese.text("GHS " + orderLogistics.getOrderMoney());
+                    Element xj_chinese = document.getElementById("xj_chinese");
+                    xj_chinese.text("GHS " + orderLogistics.getOrderMoney());
+                    Element pay_type_chinese = document.getElementById("pay_type_chinese");
+                    pay_type_chinese.text("现金");
+                    Element pay_money_chinese = document.getElementById("pay_money_chinese");
+                    pay_money_chinese.text("GHS " + orderLogistics.getPayMoney());
+                    Element pay_time_chinese = document.getElementById("pay_time_chinese");
+                    pay_time_chinese.text(sdf1.format(orderLogistics.getTravelTime()));
+                    Element start_address_chinese = document.getElementById("start_address_chinese");
+                    start_address_chinese.text(orderLogistics.getStartAddress());
+                    Element end_address_chinese = document.getElementById("end_address_chinese");
+                    end_address_chinese.text(orderLogistics.getEndAddress());
+                }
+                if(2 == language){
+                    document.getElementById("chinese").attr("style", "display: none;");
+                    document.getElementById("french").attr("style", "display: none;");
+                    Element title_english = document.getElementById("title_english");
+                    title_english.text(sdf2.format(orderLogistics.getTravelTime()) + ",You spent GHS " + orderLogistics.getPayMoney() + " on the trip ");
+                    Element xcf_english = document.getElementById("xcf_english");
+                    xcf_english.text("GHS " + orderLogistics.getOrderMoney());
+                    Element xj_english = document.getElementById("xj_english");
+                    xj_english.text("GHS " + orderLogistics.getOrderMoney());
+                    Element pay_type_english = document.getElementById("pay_type_english");
+                    pay_type_english.text("cash");
+                    Element pay_money_english = document.getElementById("pay_money_english");
+                    pay_money_english.text("GHS " + orderLogistics.getPayMoney());
+                    Element pay_time_english = document.getElementById("pay_time_english");
+                    pay_time_english.text(sdf1.format(orderLogistics.getTravelTime()));
+                    Element start_address_english = document.getElementById("start_address_english");
+                    start_address_english.text(orderLogistics.getStartAddress());
+                    Element end_address_english = document.getElementById("end_address_english");
+                    end_address_english.text(orderLogistics.getEndAddress());
+                }
+                if(3 == language){
+                    document.getElementById("chinese").attr("style", "display: none;");
+                    document.getElementById("english").attr("style", "display: none;");
+                    Element title_french = document.getElementById("title_french");
+                    title_french.text(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 " + orderLogistics.getOrderMoney());
+                    Element xj_french = document.getElementById("xj_french");
+                    xj_french.text("GHS " + orderLogistics.getOrderMoney());
+                    Element pay_type_french = document.getElementById("pay_type_french");
+                    pay_type_french.text("espèces");
+                    Element pay_money_french = document.getElementById("pay_money_french");
+                    pay_money_french.text("GHS " + orderLogistics.getPayMoney());
+                    Element pay_time_french = document.getElementById("pay_time_french");
+                    pay_time_french.text(sdf1.format(orderLogistics.getTravelTime()));
+                    Element start_address_french = document.getElementById("start_address_french");
+                    start_address_french.text(orderLogistics.getStartAddress());
+                    Element end_address_french = document.getElementById("end_address_french");
+                    end_address_french.text(orderLogistics.getEndAddress());
+                }
+
+                EmailUtil.send(userInfo.getEmail(), language == 1 ? "市内小件物流收据" : language == 2 ? "Reset password" : "Réinitialiser le mot de passe",  document.html());
+            }
+
+
             // TODO: 2020/5/24 这里需要给司机和用户推送订单状态
             new Thread(new Runnable() {
                 @Override
                 public void run() {
                     pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0);
+                    pushUtil.pushOfflinePayment(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4);
                 }
             }).start();
 
-            systemNoticeService.addSystemNotice(1, "您已使用现金成功完成小件物流订单支付,谢谢使用!", uid, 1);
+            systemNoticeService.addSystemNotice(1, language == 1 ? "您已使用现金成功完成小件物流订单支付,谢谢使用!" : language == 2
+                    ? "You have successfully completed the payment of small logistics order with cash, thank you for using!" :
+                    "Vous avez utilisé de l’argent pour compléter avec succès le paiement de la commande small pieces logistics. Merci d’utiliser!", uid, 1);
 
             this.pushOrder(orderLogistics);//推单
         }
@@ -610,22 +721,36 @@
      * @throws Exception
      */
     @Override
-    public ResultUtil payLogisticsOrder_(Integer payType, Integer orderId, Integer type) throws Exception {
+    public ResultUtil payLogisticsOrder_(Integer payType, String accountNumber, Integer orderId, Integer type, Integer language) throws Exception {
         OrderLogistics orderLogistics = this.selectById(orderId);
         Integer uid = orderLogistics.getUserId();
         OrderLogisticsSpread orderLogisticsSpread = orderLogisticsSpreadService.selectOne(new EntityWrapper<OrderLogisticsSpread>().eq("orderLogisticsId", orderId));
         Double orderMoney = orderLogisticsSpread.getPrice();
         UserInfo userInfo = userInfoService.selectById(uid);
         ResultUtil resultUtil = ResultUtil.success("");
-        if(payType == 1){//手机支付
-            return payMoneyUtil.weixinpay("小件物流下单支付",orderId +"",orderId + "_" + orderLogistics.getType(),orderMoney+"","/base/wxPayOrderTaxi","JSAPI",userInfo.getAppletsOpenId());
-        }
-        if(payType == 2){//银行卡支付
-            return payMoneyUtil.alipay("小件物流下单支付","小件物流下单支付",orderId + "," + orderLogistics.getType(),orderMoney+"","/base/aliPayOrderTaxi");
+        if(payType == 1){//线上支付
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
+            String merchantTransactionId = sdf.format(new Date()) + "4" + language + orderId;
+            CheckoutRequest checkoutRequest = new CheckoutRequest();
+            checkoutRequest.setMsisdn(Long.valueOf(userInfo.getPhone()));
+            checkoutRequest.setCustomerEmail(userInfo.getEmail());
+            checkoutRequest.setAccountNumber(accountNumber);
+            checkoutRequest.setCustomerFirstName(userInfo.getFirstName());
+            checkoutRequest.setCustomerLastName(userInfo.getLastName());
+            checkoutRequest.setRequestAmount(orderMoney);
+            checkoutRequest.setMerchantTransactionId(merchantTransactionId);
+            checkoutRequest.setRequestDescription("Travel completion payment");
+            checkoutRequest.setCallbackUrl(callbackPath + "/base/wxPayOrderTaxi");
+            checkoutRequest.setPendingRedirectUrl("");
+            checkoutRequest.setSuccessRedirectUrl("https://10pz685243.zicp.fun");
+            checkoutRequest.setFailRedirectUrl("https://www.baidu.com");
+            return TinggPayUtil.checkoutRequest(checkoutRequest);
+
+
         }
         if(payType == 3){//余额支付
             if(userInfo.getBalance() == null || userInfo.getBalance() < orderMoney){
-                return ResultUtil.error("余额不足,无法完成支付", "");
+                return ResultUtil.error(language == 1 ? "账户余额不足" : language == 2 ? "Insufficient account balance" : "Solde de compte insuffisant");
             }
 
             userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
@@ -655,14 +780,14 @@
                 c = new BigDecimal(orderMoney).subtract(d);
             }
             if(company.getIsSpeFixedOrProportional() == 1){//比例
-                d = new BigDecimal(orderMoney).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                d = new BigDecimal(orderMoney).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN)));
                 c = new BigDecimal(orderMoney).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
             }
 
             Income income = incomeService.selectOne(new EntityWrapper<Income>().eq("userType", 1).eq("objectId", orderLogistics.getCompanyId()).eq("type", 2).eq("incomeId", orderLogistics.getId()).eq("orderType", orderLogistics.getType()));
             income.setMoney(income.getMoney() + d.doubleValue());
             incomeService.updateById(income);
-            income = incomeService.selectOne(new EntityWrapper<Income>().eq("userType", 2).eq("objectId", orderLogistics.getCompanyId()).eq("type", 2).eq("incomeId", orderLogistics.getId()).eq("orderType", orderLogistics.getType()));
+            income = incomeService.selectOne(new EntityWrapper<Income>().eq("userType", 2).eq("objectId", orderLogistics.getDriverId()).eq("type", 2).eq("incomeId", orderLogistics.getId()).eq("orderType", orderLogistics.getType()));
             income.setMoney(income.getMoney() + c.doubleValue());
             incomeService.updateById(income);
             Driver driver = driverService.selectById(orderLogistics.getDriverId());
@@ -680,16 +805,12 @@
                 }
             }).start();
 
-            systemNoticeService.addSystemNotice(1, "您已使用余额成功完成小件物流订单差价支付,谢谢使用!", uid, 1);
+            systemNoticeService.addSystemNotice(1, language == 1 ? "您已使用余额成功完成小件物流订单差价支付,谢谢使用!" : language == 2
+                    ? "You have successfully completed the price difference payment of small logistics order with the balance, thank you for using!"
+                    : "Vous avez utilisé le solde pour compléter avec succès le paiement de la différence de prix de la commande de petites pièces logistiques. Merci d’utiliser!", uid, 1);
         }
 
         if(payType == 4){//现金支付
-            if(userInfo.getBalance() == null || userInfo.getBalance() < orderMoney){
-                return ResultUtil.error("余额不足,无法完成支付", "");
-            }
-
-            userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
-
             SysIntegral query1 = sysIntegralMapper.query(orderLogistics.getCompanyId());
             userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分
 
@@ -716,7 +837,7 @@
                 c = new BigDecimal(orderMoney).subtract(d);
             }
             if(company.getIsSpeFixedOrProportional() == 1){//比例
-                d = new BigDecimal(orderMoney).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                d = new BigDecimal(orderMoney).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN)));
                 c = new BigDecimal(orderMoney).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
             }
 
@@ -741,7 +862,9 @@
                 }
             }).start();
 
-            systemNoticeService.addSystemNotice(1, "您已使用现金成功完成小件物流订单差价支付,谢谢使用!", uid, 1);
+            systemNoticeService.addSystemNotice(1, language == 1 ? "您已使用现金成功完成小件物流订单差价支付,谢谢使用!" : language == 2
+                    ? "You have successfully completed the price difference payment of small logistics order with cash, thank you for using!"
+                    : "Vous avez utilisé de l’argent pour compléter avec succès le paiement de la différence de prix de la commande de petites pièces logistiques. Merci d’utiliser!", uid, 1);
         }
 
 
@@ -752,7 +875,7 @@
 
 
     @Override
-    public void payOrderLogisticsCallback(Integer id, String order_id, Integer type) throws Exception {
+    public void payOrderLogisticsCallback(Integer id, String order_id, Integer type, Integer language) throws Exception {
         OrderLogistics orderLogistics = this.selectById(id);
         PaymentRecord query = paymentRecordService.query(1, null, null, Integer.valueOf(id), orderLogistics.getType(), type, 1);
         if(null != query){
@@ -771,6 +894,77 @@
             query.setState(2);
             query.setCode(order_id);
             paymentRecordService.updateById(query);
+
+            if(ToolUtil.isNotEmpty(userInfo.getEmail())){
+                String path = templatePath + "user/receiptLogistics.html";
+                Document document = Jsoup.parse(new File(path), "UTF-8");
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
+                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/MM/dd HH:mm");
+                if(1 == language){
+                    document.getElementById("english").attr("style", "display: none;");
+                    document.getElementById("french").attr("style", "display: none;");
+                    Element title_chinese = document.getElementById("title_chinese");
+                    title_chinese.text(sdf.format(orderLogistics.getTravelTime()) + ",您在I-GO1个订单消费GHS " + orderLogistics.getPayMoney());
+                    Element xcf_chinese = document.getElementById("xcf_chinese");
+                    xcf_chinese.text("GHS " + orderLogistics.getOrderMoney());
+                    Element xj_chinese = document.getElementById("xj_chinese");
+                    xj_chinese.text("GHS " + orderLogistics.getOrderMoney());
+                    Element pay_type_chinese = document.getElementById("pay_type_chinese");
+                    pay_type_chinese.text("余额");
+                    Element pay_money_chinese = document.getElementById("pay_money_chinese");
+                    pay_money_chinese.text("GHS " + orderLogistics.getPayMoney());
+                    Element pay_time_chinese = document.getElementById("pay_time_chinese");
+                    pay_time_chinese.text(sdf1.format(orderLogistics.getTravelTime()));
+                    Element start_address_chinese = document.getElementById("start_address_chinese");
+                    start_address_chinese.text(orderLogistics.getStartAddress());
+                    Element end_address_chinese = document.getElementById("end_address_chinese");
+                    end_address_chinese.text(orderLogistics.getEndAddress());
+                }
+                if(2 == language){
+                    document.getElementById("chinese").attr("style", "display: none;");
+                    document.getElementById("french").attr("style", "display: none;");
+                    Element title_english = document.getElementById("title_english");
+                    title_english.text(sdf.format(orderLogistics.getTravelTime()) + ",You spent GHS " + orderLogistics.getPayMoney() + " on the trip ");
+                    Element xcf_english = document.getElementById("xcf_english");
+                    xcf_english.text("GHS " + orderLogistics.getOrderMoney());
+                    Element xj_english = document.getElementById("xj_english");
+                    xj_english.text("GHS " + orderLogistics.getOrderMoney());
+                    Element pay_type_english = document.getElementById("pay_type_english");
+                    pay_type_english.text("balance");
+                    Element pay_money_english = document.getElementById("pay_money_english");
+                    pay_money_english.text("GHS " + orderLogistics.getPayMoney());
+                    Element pay_time_english = document.getElementById("pay_time_english");
+                    pay_time_english.text(sdf1.format(orderLogistics.getTravelTime()));
+                    Element start_address_english = document.getElementById("start_address_english");
+                    start_address_english.text(orderLogistics.getStartAddress());
+                    Element end_address_english = document.getElementById("end_address_english");
+                    end_address_english.text(orderLogistics.getEndAddress());
+                }
+                if(3 == language){
+                    document.getElementById("chinese").attr("style", "display: none;");
+                    document.getElementById("english").attr("style", "display: none;");
+                    Element title_french = document.getElementById("title_french");
+                    title_french.text(sdf.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 " + orderLogistics.getOrderMoney());
+                    Element xj_french = document.getElementById("xj_french");
+                    xj_french.text("GHS " + orderLogistics.getOrderMoney());
+                    Element pay_type_french = document.getElementById("pay_type_french");
+                    pay_type_french.text("Le solde");
+                    Element pay_money_french = document.getElementById("pay_money_french");
+                    pay_money_french.text("GHS " + orderLogistics.getPayMoney());
+                    Element pay_time_french = document.getElementById("pay_time_french");
+                    pay_time_french.text(sdf1.format(orderLogistics.getTravelTime()));
+                    Element start_address_french = document.getElementById("start_address_french");
+                    start_address_french.text(orderLogistics.getStartAddress());
+                    Element end_address_french = document.getElementById("end_address_french");
+                    end_address_french.text(orderLogistics.getEndAddress());
+                }
+
+                EmailUtil.send(userInfo.getEmail(), language == 1 ? "市内小件物流收据" : language == 2 ? "Reset password" : "Réinitialiser le mot de passe",  document.html());
+            }
+
+
 
             // TODO: 2020/5/24 这里需要给司机和用户推送订单状态
             new Thread(new Runnable() {
@@ -826,7 +1020,7 @@
                 c = new BigDecimal(query.getAmount()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
             }
             if(company.getIsSpeFixedOrProportional() == 1){//比例
-                d = new BigDecimal(query.getAmount()).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                d = new BigDecimal(query.getAmount()).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN)));
                 c = new BigDecimal(query.getAmount()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
             }
             Income income = incomeService.selectOne(new EntityWrapper<Income>().eq("userType", 1).eq("objectId", orderLogistics.getCompanyId()).eq("type", 2).eq("incomeId", orderLogistics.getId()).eq("orderType", orderLogistics.getType()));

--
Gitblit v1.7.1