From 51a0a7ac431f11683958c8e4972f78c52a5dedb2 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期二, 24 十二月 2024 19:03:53 +0800
Subject: [PATCH] 修改 bug

---
 ManagementAHTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java |  491 +++++++++++++++++++++++++-----------------------------
 1 files changed, 226 insertions(+), 265 deletions(-)

diff --git a/ManagementAHTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java b/ManagementAHTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java
index 6f2a6a1..6d69640 100644
--- a/ManagementAHTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java
+++ b/ManagementAHTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java
@@ -10,6 +10,7 @@
 import com.stylefeng.guns.core.common.constant.factory.PageFactory;
 import com.stylefeng.guns.core.shiro.ShiroKit;
 import com.stylefeng.guns.core.util.*;
+import com.stylefeng.guns.core.util.DateUtil;
 import com.stylefeng.guns.modular.system.dao.DriverPunishMapper;
 import com.stylefeng.guns.modular.system.dao.DriverTrainMapper;
 import com.stylefeng.guns.modular.system.model.*;
@@ -20,10 +21,7 @@
 import com.stylefeng.guns.modular.system.util.ResultUtil;
 import org.apache.commons.lang.time.DateUtils;
 import org.apache.poi.hdf.extractor.TC;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.ss.usermodel.*;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
@@ -39,6 +37,7 @@
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * 司机审核列表控制器
@@ -78,6 +77,9 @@
 
     @Value("${pushMinistryOfTransport}")
     private boolean pushMinistryOfTransport;
+    
+    @Autowired
+    private ITLineCompanyService lineCompanyService;
 
 
 
@@ -240,8 +242,14 @@
         model.addAttribute("seven",seven);
 
         //查询线路列表
-        List<TLine> lineList = itLineService.selectList(new EntityWrapper<TLine>().eq("state", 1));
-        model.addAttribute("lineList",lineList);
+        List<TLineCompany> lineCompanies = lineCompanyService.selectList(new EntityWrapper<TLineCompany>().eq("companyId", tDriver.getCompanyId()));
+        if(lineCompanies.size() > 0){
+            List<Integer> collect = lineCompanies.stream().map(TLineCompany::getLineId).collect(Collectors.toList());
+            List<TLine> lineList = itLineService.selectList(new EntityWrapper<TLine>().eq("state", 1).in("id", collect));
+            model.addAttribute("lineList",lineList);
+        }else{
+            model.addAttribute("lineList",new ArrayList<>());
+        }
         //查询驾驶员已添加的线路列表
         List<Map<String, Object>> driverLineList = tDriverLineService.getDriverLineListByDriverId(tDriverId);
         model.addAttribute("driverLineList",driverLineList);
@@ -259,8 +267,38 @@
         model.addAttribute("id", id);
         return PREFIX + "training.html";
     }
-
-
+    
+    
+    /**
+     * 跳转到司机佣金设置页面
+     * @param id
+     * @param model
+     * @return
+     */
+    @RequestMapping("/driverCommissionSetting")
+    public String driverCommissionSetting(Integer id, Model model){
+        TDriver tDriver = tDriverService.selectById(id);
+        model.addAttribute("item", tDriver);
+        return PREFIX + "driverCommissionSetting.html";
+    }
+    
+    
+    /**
+     * 跳转到提现冻结额度设置
+     * @param id
+     * @param model
+     * @return
+     */
+    @RequestMapping("/freezingAmountOfWithdrawalSet")
+    public String freezingAmountOfWithdrawalSet(Integer id, Model model){
+        TDriver tDriver = tDriverService.selectById(id);
+        model.addAttribute("item", tDriver);
+        return PREFIX + "freezingAmountOfWithdrawalSet.html";
+    }
+    
+    
+    
+    
     /**
      * 保存培训数据
      * @param train
@@ -881,11 +919,7 @@
             shellList.add("出租车资格证号");
             shellList.add("工号[选填]");
             shellList.add("经营业务:专车[是/否]");
-            shellList.add("经营业务:出租车[是/否]");
             shellList.add("经营业务:跨城[是/否]");
-            shellList.add("经营业务:小件同城物流[是/否]");
-            shellList.add("经营业务:小件跨城物流[是/否]");
-            shellList.add("经营业务:包车[是/否]");
             shellList.add("登录账号[手机号]");
             shellList.add("登录密码[密码长度为6-18]");
         }else if (ShiroKit.getUser().getRoleType() == 2){
@@ -901,11 +935,7 @@
             shellList.add("出租车资格证号");
             shellList.add("工号[选填]");
             shellList.add("经营业务:专车[是/否]");
-            shellList.add("经营业务:出租车[是/否]");
             shellList.add("经营业务:跨城[是/否]");
-            shellList.add("经营业务:小件同城物流[是/否]");
-            shellList.add("经营业务:小件跨城物流[是/否]");
-            shellList.add("经营业务:包车[是/否]");
             shellList.add("登录账号[手机号]");
             shellList.add("登录密码[密码长度为6-18]");
         }else if (ShiroKit.getUser().getRoleType() == 3){
@@ -920,11 +950,7 @@
             shellList.add("出租车资格证号");
             shellList.add("工号[选填]");
             shellList.add("经营业务:专车[是/否]");
-            shellList.add("经营业务:出租车[是/否]");
             shellList.add("经营业务:跨城[是/否]");
-            shellList.add("经营业务:小件同城物流[是/否]");
-            shellList.add("经营业务:小件跨城物流[是/否]");
-            shellList.add("经营业务:包车[是/否]");
             shellList.add("登录账号[手机号]");
             shellList.add("登录密码[密码长度为6-18]");
         }
@@ -988,19 +1014,31 @@
                     Cell cell5 = row.getCell(5);  //驾驶证号码
                     String five = null;
                     if (SinataUtil.isNotEmpty(cell5)){
-                        five = String.valueOf(cell5.getStringCellValue()).trim();
+                        if(cell5.getCellType().equals(CellType.NUMERIC)){
+                            five = String.valueOf(cell5.getNumericCellValue()).trim();
+                        }else{
+                            five = String.valueOf(cell5.getStringCellValue()).trim();
+                        }
                     }
 
                     Cell cell6 = row.getCell(6);  //驾龄
                     String six = null;
                     if (SinataUtil.isNotEmpty(cell6)){
-                        six = String.valueOf(cell6.getStringCellValue()).trim();
+                        if(cell6.getCellType().equals(CellType.NUMERIC)){
+                            six = String.valueOf(cell6.getNumericCellValue()).trim();
+                        }else{
+                            six = String.valueOf(cell6.getStringCellValue()).trim();
+                        }
                     }
 
                     Cell cell7 = row.getCell(7);  //身份证号
                     String seven = null;
                     if (SinataUtil.isNotEmpty(cell7)){
-                        seven = String.valueOf(cell7.getStringCellValue()).trim();
+                        if(cell7.getCellType().equals(CellType.NUMERIC)){
+                            seven = String.valueOf(cell7.getNumericCellValue()).trim();
+                        }else{
+                            seven = String.valueOf(cell7.getStringCellValue()).trim();
+                        }
                     }
 
                     Cell cell8 = row.getCell(8);  //居住地址
@@ -1012,13 +1050,21 @@
                     Cell cell9 = row.getCell(9);  //出租车资格证号
                     String nine = null;
                     if (SinataUtil.isNotEmpty(cell9)){
-                        nine = String.valueOf(cell9.getStringCellValue()).trim();
+                        if(cell9.getCellType().equals(CellType.NUMERIC)){
+                            nine = String.valueOf(cell9.getNumericCellValue()).trim();
+                        }else{
+                            nine = String.valueOf(cell9.getStringCellValue()).trim();
+                        }
                     }
 
                     Cell cell10 = row.getCell(10);  //工号[选填]
                     String ten = null;
                     if (SinataUtil.isNotEmpty(cell10)){
-                        ten = String.valueOf(cell10.getStringCellValue()).trim();
+                        if(cell10.getCellType().equals(CellType.NUMERIC)){
+                            ten = String.valueOf(cell10.getNumericCellValue()).trim();
+                        }else{
+                            ten = String.valueOf(cell10.getStringCellValue()).trim();
+                        }
                     }
 
                     Cell cell11 = row.getCell(11);  //经营业务:专车[是/否]
@@ -1027,52 +1073,35 @@
                         eleven = String.valueOf(cell11.getStringCellValue()).trim();
                     }
 
-                    Cell cell12 = row.getCell(12);  //经营业务:专车[是/否]
-                    String twelve = null;
-                    if (SinataUtil.isNotEmpty(cell12)){
-                        twelve = String.valueOf(cell12.getStringCellValue()).trim();
-                    }
-
-                    Cell cell13 = row.getCell(13);  //经营业务:跨城出行[是/否]
+                    Cell cell13 = row.getCell(12);  //经营业务:跨城出行[是/否]
                     String thirteen = null;
                     if (SinataUtil.isNotEmpty(cell13)){
                         thirteen = String.valueOf(cell13.getStringCellValue()).trim();
                     }
 
-                    Cell cell14 = row.getCell(14);  //经营业务:小件同城物流[是/否]
-                    String fourteen = null;
-                    if (SinataUtil.isNotEmpty(cell14)){
-                        fourteen = String.valueOf(cell14.getStringCellValue()).trim();
-                    }
-
-                    Cell cell15 = row.getCell(15);  //经营业务:小件跨城物流[是/否]
-                    String fifteen = null;
-                    if (SinataUtil.isNotEmpty(cell15)){
-                        fifteen = String.valueOf(cell15.getStringCellValue()).trim();
-                    }
-
-                    Cell cell16 = row.getCell(16);  //经营业务:包车[是/否]
-                    String sixteen = null;
-                    if (SinataUtil.isNotEmpty(cell16)){
-                        sixteen = String.valueOf(cell16.getStringCellValue()).trim();
-                    }
-
-                    Cell cell17 = row.getCell(17);  //登录账号[手机号]
+                    Cell cell17 = row.getCell(13);  //登录账号[手机号]
                     String seventeen = null;
                     if (SinataUtil.isNotEmpty(cell17)){
-                        seventeen = String.valueOf(cell17.getStringCellValue()).trim();
+                        if(cell17.getCellType().equals(CellType.NUMERIC)){
+                            seventeen = String.valueOf(cell17.getNumericCellValue()).trim();
+                        }else{
+                            seventeen = String.valueOf(cell17.getStringCellValue()).trim();
+                        }
                     }
 
-                    Cell cell18 = row.getCell(18);  //登录密码[密码长度为6-18]
+                    Cell cell18 = row.getCell(14);  //登录密码[密码长度为6-18]
                     String eighteen = null;
                     if (SinataUtil.isNotEmpty(cell18)){
-                        eighteen = String.valueOf(cell18.getStringCellValue()).trim();
+                        if(cell18.getCellType().equals(CellType.NUMERIC)){
+                            eighteen = String.valueOf(cell18.getNumericCellValue()).trim();
+                        }else{
+                            eighteen = String.valueOf(cell18.getStringCellValue()).trim();
+                        }
                     }
 
                     if (SinataUtil.isEmpty(zero) || SinataUtil.isEmpty(one) || SinataUtil.isEmpty(four)
                             || SinataUtil.isEmpty(five) || SinataUtil.isEmpty(six) || SinataUtil.isEmpty(nine)
-                            || SinataUtil.isEmpty(eleven) || SinataUtil.isEmpty(twelve) || SinataUtil.isEmpty(thirteen)
-                            || SinataUtil.isEmpty(fourteen) || SinataUtil.isEmpty(fifteen) || SinataUtil.isEmpty(sixteen)
+                            || SinataUtil.isEmpty(eleven) || SinataUtil.isEmpty(thirteen)
                             || SinataUtil.isEmpty(seventeen)|| SinataUtil.isEmpty(eighteen)){
                         return new ErrorTip(500, "单元格不能为空");
                     }else{
@@ -1094,25 +1123,9 @@
                         if (!eleven.equals("是") && !eleven.equals("否")){
                             return new ErrorTip(500, "经营业务【专车】内容不正确");
                         }
-                        //判断经营业务【出租车】
-                        if (!twelve.equals("是") && !twelve.equals("否")){
-                            return new ErrorTip(500, "经营业务【出租车】内容不正确");
-                        }
                         //判断经营业务【跨城出行】
                         if (!thirteen.equals("是") && !thirteen.equals("否")){
                             return new ErrorTip(500, "经营业务【跨城】内容不正确");
-                        }
-                        //判断经营业务【小件同城物流】
-                        if (!fourteen.equals("是") && !fourteen.equals("否")){
-                            return new ErrorTip(500, "经营业务【小件同城物流】内容不正确");
-                        }
-                        //判断经营业务【小件跨城物流】
-                        if (!fifteen.equals("是") && !fifteen.equals("否")){
-                            return new ErrorTip(500, "经营业务【小件跨城物流】内容不正确");
-                        }
-                        //判断经营业务【包车】
-                        if (!sixteen.equals("是") && !sixteen.equals("否")){
-                            return new ErrorTip(500, "经营业务【包车】内容不正确");
                         }
                         //判断驾龄
                         if (!isInteger(six)){
@@ -1169,7 +1182,7 @@
                         }
                         driver.setCompanyId(companyId);
                         driver.setFranchiseeId(franchiseeId);
-                        driver.setState(2);
+                        driver.setState(1);
                         driver.setAuthState(2);
                         driver.setFlag("1");
                         driver.setInsertUser(ShiroKit.getUser().getId());
@@ -1189,39 +1202,11 @@
                             service.setType(1);
                             itDriverServiceService.insert(service);
                         }
-                        //添加出租车服务模式
-                        if ("是".equals(twelve)){
-                            TDriverService service = new TDriverService();
-                            service.setDriverId(driver.getId());
-                            service.setType(2);
-                            itDriverServiceService.insert(service);
-                        }
                         //添加跨城出行服务模式
                         if ("是".equals(thirteen)){
                             TDriverService service = new TDriverService();
                             service.setDriverId(driver.getId());
                             service.setType(3);
-                            itDriverServiceService.insert(service);
-                        }
-                        //添加小件同城物流服务模式
-                        if ("是".equals(fourteen)){
-                            TDriverService service = new TDriverService();
-                            service.setDriverId(driver.getId());
-                            service.setType(4);
-                            itDriverServiceService.insert(service);
-                        }
-                        //添加小件跨城物流服务模式
-                        if ("是".equals(fifteen)){
-                            TDriverService service = new TDriverService();
-                            service.setDriverId(driver.getId());
-                            service.setType(5);
-                            itDriverServiceService.insert(service);
-                        }
-                        //添加包车服务模式
-                        if ("是".equals(sixteen)){
-                            TDriverService service = new TDriverService();
-                            service.setDriverId(driver.getId());
-                            service.setType(6);
                             itDriverServiceService.insert(service);
                         }
                     }
@@ -1253,19 +1238,31 @@
                     Cell cell3 = row.getCell(3);  //驾驶证号码
                     String three = null;
                     if (SinataUtil.isNotEmpty(cell3)){
-                        three = String.valueOf(cell3.getStringCellValue()).trim();
+                        if(cell3.getCellType().equals(CellType.NUMERIC)){
+                            three = String.valueOf(cell3.getNumericCellValue()).trim();
+                        }else{
+                            three = String.valueOf(cell3.getStringCellValue()).trim();
+                        }
                     }
 
                     Cell cell4 = row.getCell(4);  //驾龄
                     String four = null;
                     if (SinataUtil.isNotEmpty(cell4)){
-                        four = String.valueOf(cell4.getStringCellValue()).trim();
+                        if(cell4.getCellType().equals(CellType.NUMERIC)){
+                            four = String.valueOf(cell4.getNumericCellValue()).trim();
+                        }else{
+                            four = String.valueOf(cell4.getStringCellValue()).trim();
+                        }
                     }
 
                     Cell cell5 = row.getCell(5);  //身份证号
                     String five = null;
                     if (SinataUtil.isNotEmpty(cell5)){
-                        five = String.valueOf(cell5.getStringCellValue()).trim();
+                        if(cell5.getCellType().equals(CellType.NUMERIC)){
+                            five = String.valueOf(cell5.getNumericCellValue()).trim();
+                        }else{
+                            five = String.valueOf(cell5.getStringCellValue()).trim();
+                        }
                     }
 
                     Cell cell6 = row.getCell(6);  //居住地址
@@ -1277,13 +1274,21 @@
                     Cell cell7 = row.getCell(7);  //出租车资格证号
                     String seven = null;
                     if (SinataUtil.isNotEmpty(cell7)){
-                        seven = String.valueOf(cell7.getStringCellValue()).trim();
+                        if(cell7.getCellType().equals(CellType.NUMERIC)){
+                            seven = String.valueOf(cell7.getNumericCellValue()).trim();
+                        }else{
+                            seven = String.valueOf(cell7.getStringCellValue()).trim();
+                        }
                     }
 
                     Cell cell8 = row.getCell(8);  //工号[选填]
                     String eight = null;
                     if (SinataUtil.isNotEmpty(cell8)){
-                        eight = String.valueOf(cell8.getStringCellValue()).trim();
+                        if(cell8.getCellType().equals(CellType.NUMERIC)){
+                            eight = String.valueOf(cell8.getNumericCellValue()).trim();
+                        }else{
+                            eight = String.valueOf(cell8.getStringCellValue()).trim();
+                        }
                     }
 
                     Cell cell9 = row.getCell(9);  //经营业务:专车[是/否]
@@ -1292,52 +1297,35 @@
                         nine = String.valueOf(cell9.getStringCellValue()).trim();
                     }
 
-                    Cell cell10 = row.getCell(10);  //经营业务:出租车[是/否]
-                    String ten = null;
-                    if (SinataUtil.isNotEmpty(cell10)){
-                        ten = String.valueOf(cell10.getStringCellValue()).trim();
-                    }
-
-                    Cell cell11 = row.getCell(11);  //经营业务:跨城出行[是/否]
+                    Cell cell11 = row.getCell(10);  //经营业务:跨城出行[是/否]
                     String eleven = null;
                     if (SinataUtil.isNotEmpty(cell11)){
                         eleven = String.valueOf(cell11.getStringCellValue()).trim();
                     }
 
-                    Cell cell12 = row.getCell(12);  //经营业务:小件同城物流[是/否]
-                    String twelve = null;
-                    if (SinataUtil.isNotEmpty(cell12)){
-                        twelve = String.valueOf(cell12.getStringCellValue()).trim();
-                    }
-
-                    Cell cell13 = row.getCell(13);  //经营业务:小件跨城物流[是/否]
-                    String thirteen = null;
-                    if (SinataUtil.isNotEmpty(cell13)){
-                        thirteen = String.valueOf(cell13.getStringCellValue()).trim();
-                    }
-
-                    Cell cell14 = row.getCell(14);  //经营业务:包车[是/否]
-                    String fourteen = null;
-                    if (SinataUtil.isNotEmpty(cell14)){
-                        fourteen = String.valueOf(cell14.getStringCellValue()).trim();
-                    }
-
-                    Cell cell15 = row.getCell(15);  //登录账号[手机号]
+                    Cell cell15 = row.getCell(11);  //登录账号[手机号]
                     String fifteen = null;
                     if (SinataUtil.isNotEmpty(cell15)){
-                        fifteen = String.valueOf(cell15.getStringCellValue()).trim();
+                        if(cell15.getCellType().equals(CellType.NUMERIC)){
+                            fifteen = String.valueOf(cell15.getNumericCellValue()).trim();
+                        }else{
+                            fifteen = String.valueOf(cell15.getStringCellValue()).trim();
+                        }
                     }
 
-                    Cell cell16 = row.getCell(16);  //登录密码[密码长度为6-18]
+                    Cell cell16 = row.getCell(12);  //登录密码[密码长度为6-18]
                     String sixteen = null;
                     if (SinataUtil.isNotEmpty(cell16)){
-                        sixteen = String.valueOf(cell16.getStringCellValue()).trim();
+                        if(cell16.getCellType().equals(CellType.NUMERIC)){
+                            sixteen = String.valueOf(cell16.getNumericCellValue()).trim();
+                        }else{
+                            sixteen = String.valueOf(cell16.getStringCellValue()).trim();
+                        }
                     }
                     if (SinataUtil.isEmpty(zero) || SinataUtil.isEmpty(two) || SinataUtil.isEmpty(three) || SinataUtil.isEmpty(four)
                             || SinataUtil.isEmpty(five) || SinataUtil.isEmpty(seven)
-                            || SinataUtil.isEmpty(nine) || SinataUtil.isEmpty(ten)
-                            || SinataUtil.isEmpty(eleven) || SinataUtil.isEmpty(twelve) || SinataUtil.isEmpty(thirteen)
-                            || SinataUtil.isEmpty(fourteen) || SinataUtil.isEmpty(fifteen) || SinataUtil.isEmpty(sixteen)){
+                            || SinataUtil.isEmpty(nine)
+                            || SinataUtil.isEmpty(eleven) || SinataUtil.isEmpty(fifteen) || SinataUtil.isEmpty(sixteen)){
                         return new ErrorTip(500, "单元格不能为空");
                     }else{
                         //判断账号是否存在
@@ -1353,25 +1341,9 @@
                         if (!nine.equals("是") && !nine.equals("否")){
                             return new ErrorTip(500, "经营业务【专车】内容不正确");
                         }
-                        //判断经营业务【出租车】
-                        if (!ten.equals("是") && !ten.equals("否")){
-                            return new ErrorTip(500, "经营业务【出租车】内容不正确");
-                        }
                         //判断经营业务【跨城出行】
                         if (!eleven.equals("是") && !eleven.equals("否")){
                             return new ErrorTip(500, "经营业务【跨城】内容不正确");
-                        }
-                        //判断经营业务【小件同城物流】
-                        if (!twelve.equals("是") && !twelve.equals("否")){
-                            return new ErrorTip(500, "经营业务【小件同城物流】内容不正确");
-                        }
-                        //判断经营业务【小件跨城物流】
-                        if (!thirteen.equals("是") && !thirteen.equals("否")){
-                            return new ErrorTip(500, "经营业务【小件跨城物流】内容不正确");
-                        }
-                        //判断经营业务【包车】
-                        if (!fourteen.equals("是") && !fourteen.equals("否")){
-                            return new ErrorTip(500, "经营业务【包车】内容不正确");
                         }
                         //判断驾龄
                         if (!isInteger(four)){
@@ -1415,7 +1387,7 @@
                         driver.setCompanyId(companyId);
                         driver.setFranchiseeId(franchiseeId);
                         driver.setState(1);
-                        driver.setAuthState(1);
+                        driver.setAuthState(2);
                         driver.setFlag("1");
                         driver.setInsertUser(ShiroKit.getUser().getId());
                         driver.setInsertTime(new Date());
@@ -1433,39 +1405,12 @@
                             service.setType(1);
                             itDriverServiceService.insert(service);
                         }
-                        //添加出租车服务模式
-                        if ("是".equals(ten)){
-                            TDriverService service = new TDriverService();
-                            service.setDriverId(driver.getId());
-                            service.setType(2);
-                            itDriverServiceService.insert(service);
-                        }
+                      
                         //添加跨城出行服务模式
                         if ("是".equals(eleven)){
                             TDriverService service = new TDriverService();
                             service.setDriverId(driver.getId());
                             service.setType(3);
-                            itDriverServiceService.insert(service);
-                        }
-                        //添加小件同城物流服务模式
-                        if ("是".equals(twelve)){
-                            TDriverService service = new TDriverService();
-                            service.setDriverId(driver.getId());
-                            service.setType(4);
-                            itDriverServiceService.insert(service);
-                        }
-                        //添加小件跨城物流服务模式
-                        if ("是".equals(thirteen)){
-                            TDriverService service = new TDriverService();
-                            service.setDriverId(driver.getId());
-                            service.setType(5);
-                            itDriverServiceService.insert(service);
-                        }
-                        //添加包车服务模式
-                        if ("是".equals(fourteen)){
-                            TDriverService service = new TDriverService();
-                            service.setDriverId(driver.getId());
-                            service.setType(6);
                             itDriverServiceService.insert(service);
                         }
 
@@ -1492,19 +1437,31 @@
                     Cell cell3 = row.getCell(2);  //驾驶证号码
                     String two = null;
                     if (SinataUtil.isNotEmpty(cell3)){
-                        two = String.valueOf(cell3.getStringCellValue()).trim();
+                        if(cell3.getCellType().equals(CellType.NUMERIC)){
+                            two = String.valueOf(cell3.getNumericCellValue()).trim();
+                        }else{
+                            two = String.valueOf(cell3.getStringCellValue()).trim();
+                        }
                     }
 
                     Cell cell4 = row.getCell(3);  //驾龄
                     String three = null;
                     if (SinataUtil.isNotEmpty(cell4)){
-                        three = String.valueOf(cell4.getStringCellValue()).trim();
+                        if(cell4.getCellType().equals(CellType.NUMERIC)){
+                            three = String.valueOf(cell4.getNumericCellValue()).trim();
+                        }else{
+                            three = String.valueOf(cell4.getStringCellValue()).trim();
+                        }
                     }
 
                     Cell cell5 = row.getCell(4);  //身份证号
                     String four = null;
                     if (SinataUtil.isNotEmpty(cell5)){
-                        four = String.valueOf(cell5.getStringCellValue()).trim();
+                        if(cell5.getCellType().equals(CellType.NUMERIC)){
+                            four = String.valueOf(cell5.getNumericCellValue()).trim();
+                        }else{
+                            four = String.valueOf(cell5.getStringCellValue()).trim();
+                        }
                     }
 
                     Cell cell6 = row.getCell(5);  //居住地址
@@ -1516,66 +1473,61 @@
                     Cell cell7 = row.getCell(6);  //出租车资格证号
                     String six = null;
                     if (SinataUtil.isNotEmpty(cell7)){
-                        six = String.valueOf(cell7.getStringCellValue()).trim();
+                        if(cell7.getCellType().equals(CellType.NUMERIC)){
+                            six = String.valueOf(cell7.getNumericCellValue()).trim();
+                        }else{
+                            six = String.valueOf(cell7.getStringCellValue()).trim();
+                        }
                     }
 
                     Cell cell8 = row.getCell(7);  //工号[选填]
                     String seven = null;
                     if (SinataUtil.isNotEmpty(cell8)){
-                        seven = String.valueOf(cell8.getStringCellValue()).trim();
+                        if(cell8.getCellType().equals(CellType.NUMERIC)){
+                            seven = String.valueOf(cell8.getNumericCellValue()).trim();
+                        }else{
+                            seven = String.valueOf(cell8.getStringCellValue()).trim();
+                        }
                     }
 
                     Cell cell9 = row.getCell(8);  //经营业务:专车[是/否]
                     String eight = null;
                     if (SinataUtil.isNotEmpty(cell9)){
-                        eight = String.valueOf(cell9.getStringCellValue()).trim();
+                        if(cell9.getCellType().equals(CellType.NUMERIC)){
+                            eight = String.valueOf(cell9.getNumericCellValue()).trim();
+                        }else{
+                            eight = String.valueOf(cell9.getStringCellValue()).trim();
+                        }
                     }
 
-                    Cell cell10 = row.getCell(9);  //经营业务:出租车[是/否]
-                    String nine = null;
-                    if (SinataUtil.isNotEmpty(cell10)){
-                        nine = String.valueOf(cell10.getStringCellValue()).trim();
-                    }
-
-                    Cell cell11 = row.getCell(10);  //经营业务:跨城出行[是/否]
+                    Cell cell11 = row.getCell(9);  //经营业务:跨城出行[是/否]
                     String ten = null;
                     if (SinataUtil.isNotEmpty(cell11)){
                         ten = String.valueOf(cell11.getStringCellValue()).trim();
                     }
 
-                    Cell cell12 = row.getCell(11);  //经营业务:小件同城物流[是/否]
-                    String eleven = null;
-                    if (SinataUtil.isNotEmpty(cell12)){
-                        eleven = String.valueOf(cell12.getStringCellValue()).trim();
-                    }
-
-                    Cell cell13 = row.getCell(12);  //经营业务:小件跨城物流[是/否]
-                    String twelve = null;
-                    if (SinataUtil.isNotEmpty(cell13)){
-                        twelve = String.valueOf(cell13.getStringCellValue()).trim();
-                    }
-
-                    Cell cell14 = row.getCell(13);  //经营业务:包车[是/否]
-                    String thirteen = null;
-                    if (SinataUtil.isNotEmpty(cell14)){
-                        thirteen = String.valueOf(cell14.getStringCellValue()).trim();
-                    }
-
-                    Cell cell15 = row.getCell(14);  //登录账号[手机号]
+                    Cell cell15 = row.getCell(10);  //登录账号[手机号]
                     String fourteen = null;
                     if (SinataUtil.isNotEmpty(cell15)){
-                        fourteen = String.valueOf(cell15.getStringCellValue()).trim();
+                        if(cell15.getCellType().equals(CellType.NUMERIC)){
+                            fourteen = String.valueOf(cell15.getNumericCellValue()).trim();
+                        }else{
+                            fourteen = String.valueOf(cell15.getStringCellValue()).trim();
+                        }
                     }
 
-                    Cell cell16 = row.getCell(15);  //登录密码[密码长度为6-18]
+                    Cell cell16 = row.getCell(11);  //登录密码[密码长度为6-18]
                     String fifteen = null;
                     if (SinataUtil.isNotEmpty(cell16)){
-                        fifteen = String.valueOf(cell16.getStringCellValue()).trim();
+                        if(cell16.getCellType().equals(CellType.NUMERIC)){
+                            fifteen = String.valueOf(cell16.getNumericCellValue()).trim();
+                        }else{
+                            fifteen = String.valueOf(cell16.getStringCellValue()).trim();
+                        }
                     }
                     if (SinataUtil.isEmpty(zero) || SinataUtil.isEmpty(one)  || SinataUtil.isEmpty(two) || SinataUtil.isEmpty(three) || SinataUtil.isEmpty(four)
                             || SinataUtil.isEmpty(six) || SinataUtil.isEmpty(eight)
-                            || SinataUtil.isEmpty(nine) || SinataUtil.isEmpty(ten)
-                            || SinataUtil.isEmpty(eleven) || SinataUtil.isEmpty(twelve) || SinataUtil.isEmpty(thirteen)
+                            || SinataUtil.isEmpty(ten)
                             || SinataUtil.isEmpty(fourteen) || SinataUtil.isEmpty(fifteen) ){
                         return new ErrorTip(500, "单元格不能为空");
                     }else{
@@ -1592,25 +1544,9 @@
                         if (!eight.equals("是") && !eight.equals("否")){
                             return new ErrorTip(500, "经营业务【专车】内容不正确");
                         }
-                        //判断经营业务【出租车】
-                        if (!nine.equals("是") && !nine.equals("否")){
-                            return new ErrorTip(500, "经营业务【出租车】内容不正确");
-                        }
                         //判断经营业务【跨城出行】
                         if (!ten.equals("是") && !ten.equals("否")){
                             return new ErrorTip(500, "经营业务【跨城】内容不正确");
-                        }
-                        //判断经营业务【小件同城物流】
-                        if (!eleven.equals("是") && !eleven.equals("否")){
-                            return new ErrorTip(500, "经营业务【小件同城物流】内容不正确");
-                        }
-                        //判断经营业务【小件跨城物流】
-                        if (!twelve.equals("是") && !twelve.equals("否")){
-                            return new ErrorTip(500, "经营业务【小件跨城物流】内容不正确");
-                        }
-                        //判断经营业务【包车】
-                        if (!thirteen.equals("是") && !thirteen.equals("否")){
-                            return new ErrorTip(500, "经营业务【包车】内容不正确");
                         }
                         //判断驾龄
                         if (!isInteger(three)){
@@ -1673,39 +1609,11 @@
                             service.setType(1);
                             itDriverServiceService.insert(service);
                         }
-                        //添加出租车服务模式
-                        if ("是".equals(nine)){
-                            TDriverService service = new TDriverService();
-                            service.setDriverId(driver.getId());
-                            service.setType(2);
-                            itDriverServiceService.insert(service);
-                        }
                         //添加跨城出行服务模式
                         if ("是".equals(ten)){
                             TDriverService service = new TDriverService();
                             service.setDriverId(driver.getId());
                             service.setType(3);
-                            itDriverServiceService.insert(service);
-                        }
-                        //添加小件同城物流服务模式
-                        if ("是".equals(eleven)){
-                            TDriverService service = new TDriverService();
-                            service.setDriverId(driver.getId());
-                            service.setType(4);
-                            itDriverServiceService.insert(service);
-                        }
-                        //添加小件跨城物流服务模式
-                        if ("是".equals(twelve)){
-                            TDriverService service = new TDriverService();
-                            service.setDriverId(driver.getId());
-                            service.setType(5);
-                            itDriverServiceService.insert(service);
-                        }
-                        //添加包车服务模式
-                        if ("是".equals(thirteen)){
-                            TDriverService service = new TDriverService();
-                            service.setDriverId(driver.getId());
-                            service.setType(6);
                             itDriverServiceService.insert(service);
                         }
                     }
@@ -1909,5 +1817,58 @@
             e.printStackTrace();
         }
     }
-
+    
+    
+    /**
+     * 设置司机抽成方式
+     * @param id
+     * @param zc
+     * @param zc_cc
+     * @param cjpc
+     * @param cjpc_cc
+     * @return
+     */
+    @ResponseBody
+    @PostMapping("/setDriverCommissionSetting")
+    public ResultUtil setDriverCommissionSetting(Integer id, Integer zc, Double zc_cc, Integer cjpc, Double cjpc_cc){
+        TDriver tDriver = tDriverService.selectById(id);
+        tDriver.setSpecialCarCommissionType(zc);
+        tDriver.setSpecialCarCommission(zc_cc);
+        tDriver.setIntercityCommissionType(cjpc);
+        tDriver.setIntercityCommission(cjpc_cc);
+        tDriverService.updateById(tDriver);
+        return ResultUtil.success();
+    }
+    
+    
+    /**
+     * 设置提现冻结金额额度
+     * @param id
+     * @param withdrawFrozenAmount
+     * @return
+     */
+    @ResponseBody
+    @PostMapping("/setFreezingAmountOfWithdrawalSet")
+    public ResultUtil setFreezingAmountOfWithdrawalSet(Integer id, Double withdrawFrozenAmount){
+        TDriver tDriver = tDriverService.selectById(id);
+        tDriver.setWithdrawFrozenAmount(withdrawFrozenAmount);
+        tDriverService.updateById(tDriver);
+        return ResultUtil.success();
+    }
+    
+    
+    
+    @ResponseBody
+    @PostMapping("/getCompanyLine")
+    public List<TLine> getCompanyLine(Integer companyId){
+        //查询线路列表
+        List<TLineCompany> lineCompanies = lineCompanyService.selectList(new EntityWrapper<TLineCompany>().eq("companyId", companyId));
+        if(lineCompanies.size() > 0){
+            List<Integer> collect = lineCompanies.stream().map(TLineCompany::getLineId).collect(Collectors.toList());
+            return itLineService.selectList(new EntityWrapper<TLine>().eq("state", 1).in("id", collect));
+        }else{
+            return new ArrayList<>();
+        }
+    }
+    
 }

--
Gitblit v1.7.1