From c8638df756d5c56f2d0c3ed35522fc5a340122c8 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期五, 04 七月 2025 15:12:22 +0800 Subject: [PATCH] 修改bug --- ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java | 213 +++++----------------------------------------------- 1 files changed, 23 insertions(+), 190 deletions(-) diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java index 78e019b..a7704f2 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java @@ -228,8 +228,12 @@ public String tDriver_look(@PathVariable Integer tDriverId, Model model) { Map<String, Object> tDriver = tDriverService.getDriverById(tDriverId); model.addAttribute("item",tDriver); - String placeOfPractice = tDriver.get("placeOfPractice").toString().replaceAll(",", "-"); - model.addAttribute("placeOfPractice", placeOfPractice); + Object placeOfPractice1 = tDriver.get("placeOfPractice"); + if(placeOfPractice1==null){ + model.addAttribute("placeOfPractice", ""); + }else { + model.addAttribute("placeOfPractice", placeOfPractice1.toString().replaceAll(",", "-")); + } LogObjectHolder.me().set(tDriver); return PREFIX + "tDriver_look.html"; } @@ -672,8 +676,7 @@ System.out.println("司机注册审核发送短信 :【driverId=" + tDriver.getId().toString() + "】,调用接口:" + result); //审核通过,在中台添加司机账号 if (2 == tDriver.getAuthState()) { - ShiroUser user = shiroExtUtil.getUser(); - Integer objectId = user.getObjectId(); + Integer objectId = tDriver.getCompanyId(); TCompany tCompany = itCompanyService.selectById(objectId); List<QYTUserInfo> userInfoByPhone = UserUtil.getUserInfoByPhone(tDriver.getPhone(), tCompany.getEnterCode()); Long empId = null; @@ -696,10 +699,9 @@ }else{ empId = userInfoByPhone.get(0).getEmpId(); } - TCompany tCompany1 = itCompanyService.selectById(tDriver.getCompanyId()); tDriver.setEmpId(empId); - tDriver.setEntercode(tCompany1.getEnterCode()); - tDriver.setEnterId(Long.valueOf(tCompany1.getEnterCode())); + tDriver.setEntercode(tCompany.getEnterCode()); + tDriver.setEnterId(Long.valueOf(tCompany.getEnterCode())); } tDriverService.updateById(tDriver); } @@ -774,7 +776,7 @@ tDriver.setInsertTime(new Date()); tDriver.setInsertUser(shiroExtUtil.getUser().getId()); // tDriver.setPassword(MD5Util.encrypt(tDriver.getPassword())); - + tDriver.setAccount(tDriver.getPhone()); tDriver.setPassword(ShiroKit.md5(tDriver.getPassword(), "SA;d5#")); //审核通过,在中台添加司机账号 if (2 == tDriver.getAuthState()) { @@ -924,8 +926,7 @@ tDriver.setRemark(remark); //审核通过,在中台添加司机账号 if (2 == tDriver.getAuthState() && tDriver.getEmpId() == null) { - ShiroUser user = shiroExtUtil.getUser(); - Integer objectId = user.getObjectId(); + Integer objectId = tDriver.getCompanyId(); TCompany tCompany = itCompanyService.selectById(objectId); List<QYTUserInfo> userInfoByPhone = UserUtil.getUserInfoByPhone(tDriver.getPhone(), tCompany.getEnterCode()); Long empId = null; @@ -949,10 +950,9 @@ empId = userInfoByPhone.get(0).getEmpId(); } - TCompany tCompany1 = itCompanyService.selectById(tDriver.getCompanyId()); tDriver.setEmpId(empId); - tDriver.setEntercode(tCompany1.getEnterCode()); - tDriver.setEnterId(Long.valueOf(tCompany1.getEnterCode())); + tDriver.setEntercode(tCompany.getEnterCode()); + tDriver.setEnterId(Long.valueOf(tCompany.getEnterCode())); } tDriverService.updateById(tDriver); @@ -1124,9 +1124,6 @@ shellList.add("经营业务:快车[是/否]"); shellList.add("经营业务:出租车[是/否]"); shellList.add("经营业务:跨城出行[是/否]"); - shellList.add("经营业务:小件同城物流[是/否]"); - shellList.add("经营业务:小件跨城物流[是/否]"); - shellList.add("经营业务:包车[是/否]"); shellList.add("登录账号[手机号]"); shellList.add("登录密码[密码长度为6-18]"); } else if (shiroExtUtil.getUser().getRoleType() == 2) { @@ -1144,9 +1141,6 @@ shellList.add("经营业务:快车[是/否]"); shellList.add("经营业务:出租车[是/否]"); shellList.add("经营业务:跨城出行[是/否]"); - shellList.add("经营业务:小件同城物流[是/否]"); - shellList.add("经营业务:小件跨城物流[是/否]"); - shellList.add("经营业务:包车[是/否]"); shellList.add("登录账号[手机号]"); shellList.add("登录密码[密码长度为6-18]"); } else if (shiroExtUtil.getUser().getRoleType() == 3) { @@ -1163,9 +1157,6 @@ shellList.add("经营业务:快车[是/否]"); shellList.add("经营业务:出租车[是/否]"); shellList.add("经营业务:跨城出行[是/否]"); - shellList.add("经营业务:小件同城物流[是/否]"); - shellList.add("经营业务:小件跨城物流[是/否]"); - shellList.add("经营业务:包车[是/否]"); shellList.add("登录账号[手机号]"); shellList.add("登录密码[密码长度为6-18]"); } @@ -1280,31 +1271,13 @@ 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(14); //登录账号[手机号] String seventeen = null; if (SinataUtil.isNotEmpty(cell17)){ seventeen = String.valueOf(cell17.getStringCellValue()).trim(); } - Cell cell18 = row.getCell(18); //登录密码[密码长度为6-18] + Cell cell18 = row.getCell(15); //登录密码[密码长度为6-18] String eighteen = null; if (SinataUtil.isNotEmpty(cell18)){ eighteen = String.valueOf(cell18.getStringCellValue()).trim(); @@ -1313,7 +1286,6 @@ 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(seventeen)|| SinataUtil.isEmpty(eighteen)){ return new ErrorTip(500, "单元格不能为空"); }else{ @@ -1342,18 +1314,6 @@ //判断经营业务【跨城出行】 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)){ @@ -1423,8 +1383,7 @@ //审核通过,在中台添加司机账号 if (2 == driver.getAuthState()) { - ShiroUser user = shiroExtUtil.getUser(); - Integer objectId = user.getObjectId(); + Integer objectId = driver.getCompanyId(); TCompany tCompany = itCompanyService.selectById(objectId); List<QYTUserInfo> userInfoByPhone = UserUtil.getUserInfoByPhone(driver.getPhone(), tCompany.getEnterCode()); Long empId = null; @@ -1448,10 +1407,9 @@ empId = userInfoByPhone.get(0).getEmpId(); } - TCompany tCompany1 = itCompanyService.selectById(driver.getCompanyId()); driver.setEmpId(empId); - driver.setEntercode(tCompany1.getEnterCode()); - driver.setEnterId(Long.valueOf(tCompany1.getEnterCode())); + driver.setEntercode(tCompany.getEnterCode()); + driver.setEnterId(Long.valueOf(tCompany.getEnterCode())); } tDriverService.insert(driver); @@ -1475,27 +1433,6 @@ 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); } } @@ -1578,31 +1515,13 @@ 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(12); //登录账号[手机号] String fifteen = null; if (SinataUtil.isNotEmpty(cell15)){ fifteen = String.valueOf(cell15.getStringCellValue()).trim(); } - Cell cell16 = row.getCell(16); //登录密码[密码长度为6-18] + Cell cell16 = row.getCell(13); //登录密码[密码长度为6-18] String sixteen = null; if (SinataUtil.isNotEmpty(cell16)){ sixteen = String.valueOf(cell16.getStringCellValue()).trim(); @@ -1610,8 +1529,7 @@ 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(eleven) || SinataUtil.isEmpty(fifteen) || SinataUtil.isEmpty(sixteen)){ return new ErrorTip(500, "单元格不能为空"); }else{ //判断账号是否存在 @@ -1634,18 +1552,6 @@ //判断经营业务【跨城出行】 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)){ @@ -1719,27 +1625,6 @@ 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); } @@ -1817,31 +1702,13 @@ 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(11); //登录账号[手机号] String fourteen = null; if (SinataUtil.isNotEmpty(cell15)){ fourteen = String.valueOf(cell15.getStringCellValue()).trim(); } - Cell cell16 = row.getCell(15); //登录密码[密码长度为6-18] + Cell cell16 = row.getCell(12); //登录密码[密码长度为6-18] String fifteen = null; if (SinataUtil.isNotEmpty(cell16)){ fifteen = String.valueOf(cell16.getStringCellValue()).trim(); @@ -1849,7 +1716,6 @@ 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(fourteen) || SinataUtil.isEmpty(fifteen) ){ return new ErrorTip(500, "单元格不能为空"); }else{ @@ -1873,18 +1739,6 @@ //判断经营业务【跨城出行】 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)){ @@ -1959,27 +1813,6 @@ 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); } } -- Gitblit v1.7.1