From d0418534932c5d86d9e4c6642bdbe99b085852eb Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期五, 21 七月 2023 14:04:08 +0800
Subject: [PATCH] 更新接口

---
 DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java |   47 +++++++++++++++++++++++++++++++++--------------
 1 files changed, 33 insertions(+), 14 deletions(-)

diff --git a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java
index dd8fbc8..98ceb7d 100644
--- a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java
+++ b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java
@@ -10,14 +10,8 @@
 import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsSpreadService;
 import com.stylefeng.guns.modular.system.dao.RegionMapper;
 import com.stylefeng.guns.modular.system.dao.UserInfoMapper;
-import com.stylefeng.guns.modular.system.model.Company;
-import com.stylefeng.guns.modular.system.model.Driver;
-import com.stylefeng.guns.modular.system.model.Region;
-import com.stylefeng.guns.modular.system.model.UserInfo;
-import com.stylefeng.guns.modular.system.service.ICompanyService;
-import com.stylefeng.guns.modular.system.service.IDriverService;
-import com.stylefeng.guns.modular.system.service.IIncomeService;
-import com.stylefeng.guns.modular.system.service.ISystemNoticeService;
+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.taxi.model.OrderTaxi;
 import org.jsoup.Jsoup;
@@ -83,6 +77,12 @@
     @Value("${spring.mail.template-path}")
     private String templatePath;
 
+    @Autowired
+    private IPaymentRecordService paymentRecordService;
+
+    @Autowired
+    private ITransactionDetailsService transactionDetailsService;
+
 
 
 
@@ -95,8 +95,8 @@
      * @throws Exception
      */
     @Override
-    public Map<String, Object> queryPushOrder(Integer orderId) throws Exception {
-        return orderLogisticsMapper.queryPushOrder(orderId);
+    public Map<String, Object> queryPushOrder(Integer orderId, Integer language) throws Exception {
+        return orderLogisticsMapper.queryPushOrder(orderId, language);
     }
 
 
@@ -310,8 +310,8 @@
     }
 
     @Override
-    public List<Map<String, Object>> queryOrderList(Integer driverId) throws Exception {
-        return orderLogisticsMapper.queryOrderList(driverId);
+    public List<Map<String, Object>> queryOrderList(Integer driverId, Integer language) throws Exception {
+        return orderLogisticsMapper.queryOrderList(driverId, language);
     }
 
     /**
@@ -322,8 +322,8 @@
      * @throws Exception
      */
     @Override
-    public List<Map<String, Object>> queryMyAllOrder(Integer state, Integer uid) throws Exception {
-        return orderLogisticsMapper.queryMyAllOrder(state, uid);
+    public List<Map<String, Object>> queryMyAllOrder(Integer state, Integer uid, Integer language) throws Exception {
+        return orderLogisticsMapper.queryMyAllOrder(state, uid, language);
     }
 
 
@@ -480,4 +480,23 @@
         }
 
     }
+
+
+    @Override
+    public void payOrderLogisticsCallback(Integer id, String order_id, Integer language) throws Exception {
+        OrderLogistics orderLogistics = this.selectById(id);
+        PaymentRecord query = paymentRecordService.query(1, null, 2, Integer.valueOf(id), orderLogistics.getType(), null, 1);
+        if(null != query){
+            //添加交易明细
+            transactionDetailsService.saveData(orderLogistics.getDriverId(), language == 1 ? "现金收款代付" : language == 2 ? "Cash collection on behalf of payment" : "Paiement en espèces", query.getAmount(), 2, 1, 2, orderLogistics.getType(), id);
+            orderLogistics.setDriverPay(2);
+            this.updateById(orderLogistics);
+
+            query.setState(2);
+            query.setCode(order_id);
+            paymentRecordService.updateById(query);
+        }else{
+            System.err.println("预支付数据异常(orderId = "  + id + ")");
+        }
+    }
 }

--
Gitblit v1.7.1