From 43abb7c7e07bbec9db9e8cdf82280b18aa7db668 Mon Sep 17 00:00:00 2001 From: xiepeng Date: Fri, 19 Apr 2024 12:08:05 +0800 Subject: [PATCH] =?UTF-8?q?BUG=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AssignedManageController.java | 2 + .../controller/beidou/BeidouController.java | 28 ++++--- .../maintenance/MaintenanceController.java | 79 ++++++++++++++----- .../OperatingVehiclesController.java | 2 +- .../scrapManage/ScrapManageController.java | 31 -------- .../TaxationManageController.java | 2 + 6 files changed, 79 insertions(+), 65 deletions(-) diff --git a/src/main/java/com/zcloud/controller/assignedManage/AssignedManageController.java b/src/main/java/com/zcloud/controller/assignedManage/AssignedManageController.java index 06c5c84..336cff3 100644 --- a/src/main/java/com/zcloud/controller/assignedManage/AssignedManageController.java +++ b/src/main/java/com/zcloud/controller/assignedManage/AssignedManageController.java @@ -259,6 +259,7 @@ public class AssignedManageController extends BaseController { } else { varList = allOperatingVehicleList; } + map.put("varList", varList); map.put("result", errInfo); return map; @@ -268,6 +269,7 @@ public class AssignedManageController extends BaseController { @ResponseBody public Object getAssignedFreightTrailerList() throws Exception { Map map = new HashMap(); + String errInfo = "success"; String corpId = Jurisdiction.getCORPINFO_ID(); List freightList = freightTrailerService.getPulldownVehicleList(corpId); diff --git a/src/main/java/com/zcloud/controller/beidou/BeidouController.java b/src/main/java/com/zcloud/controller/beidou/BeidouController.java index 8c5ba41..6b98bce 100644 --- a/src/main/java/com/zcloud/controller/beidou/BeidouController.java +++ b/src/main/java/com/zcloud/controller/beidou/BeidouController.java @@ -18,16 +18,15 @@ import com.zcloud.util.Smb; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; +import org.springframework.util.CollectionUtils; import org.springframework.util.ObjectUtils; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; /** * 北斗管理 @@ -266,13 +265,16 @@ public class BeidouController extends BaseController { // 营运车辆 List operatingList = operatingVehiclesService.operationVehicleList(pd.getString("CORPINFO_ID")); page.setPd(pd); - List insAnnually = beidouService.list(page); - for (int i = 0; i < insAnnually.size(); i++) { - for (int j = 0; j < operatingList.size(); j++) { - if(operatingList.get(j).get("OPERATING_ID").equals(insAnnually.get(i).get("VEHICLE"))) { - operatingList.remove(j); - } - } + List compassList = beidouService.list(page); + + List varList = new ArrayList<>(); + if(!CollectionUtils.isEmpty(compassList)) { + varList = operatingList.stream().parallel() + .filter(operating -> compassList.stream() + .noneMatch(compass -> StringUtils.equals(operating.getString("OPERATING_ID"), compass.getString("VEHICLE")))) + .collect(Collectors.toList()); + }else{ + varList = operatingList; } if(pd.containsKey("ID")){ pd.put("OPERATING_ID", pd.getString("ID")); @@ -281,10 +283,10 @@ public class BeidouController extends BaseController { List drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片 map.put("drivingLicenseImgs", drivingLicenseImgs); } - operatingList.forEach(operating -> { + varList.forEach(operating -> { operating.put("ID", operating.getString("OPERATING_ID")); }); - map.put("list", operatingList); + map.put("list", varList); map.put("result", errInfo); return map; } diff --git a/src/main/java/com/zcloud/controller/maintenance/MaintenanceController.java b/src/main/java/com/zcloud/controller/maintenance/MaintenanceController.java index bc69cd6..a16d60a 100644 --- a/src/main/java/com/zcloud/controller/maintenance/MaintenanceController.java +++ b/src/main/java/com/zcloud/controller/maintenance/MaintenanceController.java @@ -205,31 +205,70 @@ public class MaintenanceController extends BaseController { PageData pd = new PageData(); pd = this.getPageData(); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); - // 营运车辆 - List operatingList = operatingVehiclesService.operationVehicleList(pd.getString("CORPINFO_ID")); - page.setPd(pd); - List maintenanceList = maintenanceService.list(page); + if (!StringUtils.isEmpty(pd.getString("TRAFFIC_TYPE")) && pd.getString("TRAFFIC_TYPE").equals("1")) { + // 营运车辆 + List operatingList = operatingVehiclesService.operationVehicleList(pd.getString("CORPINFO_ID")); + page.setPd(pd); + List maintenanceList = maintenanceService.list(page); - List varList = new ArrayList<>(); - if (!CollectionUtils.isEmpty(maintenanceList)) { - varList = operatingList.stream().parallel() - .filter(operating -> maintenanceList.stream() - .noneMatch(maintenance -> StringUtils.equals(operating.getString("OPERATING_ID"), maintenance.getString("VEHICLE")))) - .collect(Collectors.toList()); - } else { - varList = operatingList; + List varList = new ArrayList<>(); + if (!CollectionUtils.isEmpty(maintenanceList)) { + varList = operatingList.stream().parallel() + .filter(operating -> maintenanceList.stream() + .noneMatch(maintenance -> StringUtils.equals(operating.getString("OPERATING_ID"), maintenance.getString("VEHICLE")))) + .collect(Collectors.toList()); + } else { + varList = operatingList; + } + if (pd.containsKey("ID")) { + pd.put("OPERATING_ID", pd.getString("ID")); + pd.put("FOREIGN_KEY", pd.getString("OPERATING_ID")); + pd.put("TYPE", 121); + List drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片 + map.put("drivingLicenseImgs", drivingLicenseImgs); + } + varList.forEach(operating -> { + operating.put("ID", operating.getString("OPERATING_ID")); + }); + map.put("list", varList); + map.put("result", errInfo); + return map; } - if (pd.containsKey("ID")) { - pd.put("OPERATING_ID", pd.getString("ID")); - pd.put("FOREIGN_KEY", pd.getString("OPERATING_ID")); - pd.put("TYPE", 121); + if("2".equals(pd.getString("TRAFFIC_TYPE"))) { + // 货运挂车 + List freightList = freightTrailerService.trailerList(pd.getString("CORPINFO_ID")); + page.setPd(pd); + List insAnnually = maintenanceService.list(page); + for (int i = 0; i < insAnnually.size(); i++) { + for (int j = 0; j < freightList.size(); j++) { + if(freightList.get(j).get("FREIGHTTRAILER_ID").equals(insAnnually.get(i).get("VEHICLE"))) { + freightList.remove(j); + } + } + } + if(pd.containsKey("ID")){ + pd.put("FREIGHTTRAILER_ID", pd.getString("ID")); + pd.put("FOREIGN_KEY", pd.getString("FREIGHTTRAILER_ID")); + pd.put("TYPE",121); + List drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片 + map.put("drivingLicenseImgs", drivingLicenseImgs); + } + freightList.forEach(freight -> { + freight.put("ID", freight.getString("FREIGHTTRAILER_ID")); + }); + map.put("list", freightList); + map.put("result", errInfo); + return map; + } + + List resData = freightTrailerService.vehicleList(pd); + if(pd.containsKey("ID")){ + pd.put("FOREIGN_KEY", pd.getString("ID")); + pd.put("TYPE",121); List drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片 map.put("drivingLicenseImgs", drivingLicenseImgs); } - varList.forEach(operating -> { - operating.put("ID", operating.getString("OPERATING_ID")); - }); - map.put("list", varList); + map.put("list", resData); map.put("result", errInfo); return map; } diff --git a/src/main/java/com/zcloud/controller/operatingvehicles/OperatingVehiclesController.java b/src/main/java/com/zcloud/controller/operatingvehicles/OperatingVehiclesController.java index 7a469cb..03f37be 100644 --- a/src/main/java/com/zcloud/controller/operatingvehicles/OperatingVehiclesController.java +++ b/src/main/java/com/zcloud/controller/operatingvehicles/OperatingVehiclesController.java @@ -232,7 +232,7 @@ public class OperatingVehiclesController extends BaseController { pd.put("FOREIGN_KEY", pd.getString("OPERATING_ID")); pd.put("TYPE",130); List headstockphoto = imgfilesService.listAll(pd);//车头照片 - pd.put("TYPE",131); + pd.put("TYPE",121); List drivinglicensephoto = imgfilesService.listAll(pd);//行驶证照片 pd.put("TYPE",132); List operatingcertificatephoto = imgfilesService.listAll(pd);//运营证照片 diff --git a/src/main/java/com/zcloud/controller/scrapManage/ScrapManageController.java b/src/main/java/com/zcloud/controller/scrapManage/ScrapManageController.java index e9cb5e8..c2c5ac5 100644 --- a/src/main/java/com/zcloud/controller/scrapManage/ScrapManageController.java +++ b/src/main/java/com/zcloud/controller/scrapManage/ScrapManageController.java @@ -182,25 +182,6 @@ public class ScrapManageController extends BaseController { return map; } - /*@RequestMapping(value = "/getscrapoperationvehiclelist") - @ResponseBody - public Object getScrapOperationVehicleList() throws Exception { - Map map = new HashMap(); - String errInfo = "success"; - String corpId = Jurisdiction.getCORPINFO_ID(); - List operationList = operatingVehiclesService.operationVehicleList(corpId); //列出Question列表 - List scrapList = scrapManageService.scrapListAll(corpId); - for (int i = 0; i < scrapList.size(); i++) { - for (int j = 0; j < operationList.size(); j++) { - if(scrapList.get(i).get("PLATE_NUMBER").equals(operationList.get(j).get("PLATE_NUMBER"))) { - operationList.remove(j); - } - } - } - map.put("varList", operationList); - map.put("result", errInfo); - return map; - }*/ @RequestMapping(value = "/getScrapOperationVehicleList") @ResponseBody @@ -222,18 +203,6 @@ public class ScrapManageController extends BaseController { }else { varList = operationList; } - /*if(!CollectionUtils.isEmpty(scrapList)) { - varList = operationList.stream().filter(operation -> { - for (PageData scrap : scrapList) { - if(!StringUtils.equals(operation.getString("PLATE_NUMBER"),scrap.getString("PLATE_NUMBER"))) { - return true; - } - } - return false; - }).collect(Collectors.toList()); - }else { - varList = operationList; - }*/ map.put("varList", varList); map.put("result", errInfo); return map; diff --git a/src/main/java/com/zcloud/controller/taxationManage/TaxationManageController.java b/src/main/java/com/zcloud/controller/taxationManage/TaxationManageController.java index 74fb950..beb4408 100644 --- a/src/main/java/com/zcloud/controller/taxationManage/TaxationManageController.java +++ b/src/main/java/com/zcloud/controller/taxationManage/TaxationManageController.java @@ -203,6 +203,8 @@ public class TaxationManageController extends BaseController { .filter(freight -> taxationList.stream() .noneMatch(taxation -> StringUtils.equals(freight.getString("PLATE_NUMBER"), taxation.getString("PLATE_NUMBER")))) .collect(Collectors.toList()); + }else{ + varList = freightTrailerList; } // 过滤掉车船税下拉列表中已报废的车辆信息