From 9ef2e272c6ef99d152c5d6afc95af70a3822c57d Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期六, 09 九月 2023 18:12:28 +0800
Subject: [PATCH] 修改bug

---
 DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java |   92 +++++++++++++++++++++++++++++++++-------------
 1 files changed, 66 insertions(+), 26 deletions(-)

diff --git a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java
index 2705c47..a989545 100644
--- a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java
+++ b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java
@@ -1,6 +1,7 @@
 package com.stylefeng.guns.modular.api;
 
 import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.stylefeng.guns.core.util.ToolUtil;
 import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity;
 import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService;
@@ -8,10 +9,7 @@
 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.model.City;
-import com.stylefeng.guns.modular.system.model.Driver;
-import com.stylefeng.guns.modular.system.model.Income;
-import com.stylefeng.guns.modular.system.model.OrderPosition;
+import com.stylefeng.guns.modular.system.model.*;
 import com.stylefeng.guns.modular.system.service.*;
 import com.stylefeng.guns.modular.system.util.ALiSendSms;
 import com.stylefeng.guns.modular.system.util.ResultUtil;
@@ -80,6 +78,9 @@
 
     @Value("${share.url}")
     private String shareUrl;
+
+    @Autowired
+    private TEmailService emailService;
 
 
 
@@ -231,6 +232,20 @@
             if(phone.indexOf("233") < 0){
                 phone = "233" + phone;
             }
+            switch (phoneOperator){
+                case "MTN":
+                    phoneOperator = "GH-MTN-B2C";
+                    break;
+                case "TIGO":
+                    phoneOperator = "GH-TIGO-B2C";
+                    break;
+                case "VODAFONE":
+                    phoneOperator = "GH-VODAFONE-B2C";
+                    break;
+                case "AIRTEL":
+                    phoneOperator = "GH-AIRTEL-B2C";
+                    break;
+            }
             return driverService.registeredDriver(phoneOperator, phone, code, password, uid, type, userType, language);
         }catch (Exception e){
             e.printStackTrace();
@@ -266,6 +281,20 @@
             }
             if(phone.indexOf("233") < 0){
                 phone = "233" + phone;
+            }
+            switch (phoneOperator){
+                case "MTN":
+                    phoneOperator = "GH-MTN-B2C";
+                    break;
+                case "TIGO":
+                    phoneOperator = "GH-TIGO-B2C";
+                    break;
+                case "VODAFONE":
+                    phoneOperator = "GH-VODAFONE-B2C";
+                    break;
+                case "AIRTEL":
+                    phoneOperator = "GH-AIRTEL-B2C";
+                    break;
             }
             return driverService.registeredDriver(phoneOperator, phone, code, password, uid, type, userType, language);
         }catch (Exception e){
@@ -338,6 +367,25 @@
         }
     }
 
+
+    @ResponseBody
+    @PostMapping("/api/driver/getEmailList")
+    @ApiOperation(value = "获取邮箱信息", tags = {"司机端-个人中心"}, notes = "")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
+    })
+    public ResultUtil<?> getEmailList(HttpServletRequest request){
+        try {
+            Integer uid = driverService.getUserIdFormRedis(request);
+            if(null == uid){
+                return ResultUtil.tokenErr();
+            }
+            return ResultUtil.success(emailService.selectList(new EntityWrapper<TEmail>().eq("userId",uid).eq("type",2).orderBy("createTime",false)));
+        }catch (Exception e){
+            e.printStackTrace();
+            return ResultUtil.runErr();
+        }
+    }
 
 
     /**
@@ -448,7 +496,6 @@
         }
     }
 
-
     /**
      * 获取忘记密码页面的电话
      * @return
@@ -525,7 +572,6 @@
             return ResultUtil.runErr();
         }
     }
-
 
     /**
      * 司机上下班操作
@@ -607,7 +653,6 @@
         }
     }
 
-
     @ResponseBody
     @PostMapping("/api/driver/work2")
     @ApiOperation(value = "司机上下班操作,同时设置接单类型【1.0】", tags = {"司机端-车载端"}, notes = "")
@@ -628,7 +673,6 @@
         }
     }
 
-
     @ResponseBody
     @PostMapping("/api/driver/queryHomeNum")
     @ApiOperation(value = "获取首页统计数据", tags = {"司机端-车载端"}, notes = "")
@@ -648,8 +692,6 @@
             return ResultUtil.runErr();
         }
     }
-
-
 
     /**
      * 上班时选择的业务类型
@@ -685,7 +727,6 @@
         }
     }
 
-
     /**
      * 存储订单服务中的司机位置
      * @param orderPosition
@@ -703,8 +744,6 @@
         }
     }
 
-
-
     @ResponseBody
     @PostMapping("/base/driver/queryInfo_")
     @ApiOperation(value = "根据用户id获取数据", tags = {"司机端-注册"}, notes = "")
@@ -720,9 +759,6 @@
             return ResultUtil.runErr();
         }
     }
-
-
-
 
     /**
      * 获取个人中心详情
@@ -754,7 +790,6 @@
         }
     }
 
-
     /**
      * 修改手机号码
      * @param phone
@@ -784,6 +819,20 @@
             if(phone.indexOf("233") < 0){
                 phone = "233" + phone;
             }
+            switch (phoneOperator){
+                case "MTN":
+                    phoneOperator = "GH-MTN-B2C";
+                    break;
+                case "TIGO":
+                    phoneOperator = "GH-TIGO-B2C";
+                    break;
+                case "VODAFONE":
+                    phoneOperator = "GH-VODAFONE-B2C";
+                    break;
+                case "AIRTEL":
+                    phoneOperator = "GH-AIRTEL-B2C";
+                    break;
+            }
             return driverService.updatePhone(phoneOperator, phone, code, uid, language);
         }catch (Exception e){
             e.printStackTrace();
@@ -812,8 +861,6 @@
         }
     }
 
-
-
     /**
      * 修改密码
      * @param password
@@ -840,7 +887,6 @@
             return ResultUtil.runErr();
         }
     }
-
 
     /**
      * 获取设置接单的业务类型列表
@@ -876,10 +922,6 @@
         }
     }
 
-
-
-
-
     /**
      * 设置接单规则
      * @param type
@@ -906,7 +948,6 @@
         }
     }
 
-
     /**
      * 获取当前车辆及空闲车辆
      * @param request
@@ -931,7 +972,6 @@
             return ResultUtil.runErr();
         }
     }
-
 
     /**
      * 更换车辆

--
Gitblit v1.7.1