BUG优化

dev
xiepeng 2024-04-19 12:08:05 +08:00
parent faabbc8b54
commit 43abb7c7e0
6 changed files with 79 additions and 65 deletions

View File

@ -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<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
String corpId = Jurisdiction.getCORPINFO_ID();
List<PageData> freightList = freightTrailerService.getPulldownVehicleList(corpId);

View File

@ -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<PageData> operatingList = operatingVehiclesService.operationVehicleList(pd.getString("CORPINFO_ID"));
page.setPd(pd);
List<PageData> 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<PageData> compassList = beidouService.list(page);
List<PageData> 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<PageData> 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;
}

View File

@ -205,31 +205,70 @@ public class MaintenanceController extends BaseController {
PageData pd = new PageData();
pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
// 营运车辆
List<PageData> operatingList = operatingVehiclesService.operationVehicleList(pd.getString("CORPINFO_ID"));
page.setPd(pd);
List<PageData> maintenanceList = maintenanceService.list(page);
if (!StringUtils.isEmpty(pd.getString("TRAFFIC_TYPE")) && pd.getString("TRAFFIC_TYPE").equals("1")) {
// 营运车辆
List<PageData> operatingList = operatingVehiclesService.operationVehicleList(pd.getString("CORPINFO_ID"));
page.setPd(pd);
List<PageData> maintenanceList = maintenanceService.list(page);
List<PageData> 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<PageData> 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<PageData> 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<PageData> freightList = freightTrailerService.trailerList(pd.getString("CORPINFO_ID"));
page.setPd(pd);
List<PageData> 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<PageData> 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<PageData> resData = freightTrailerService.vehicleList(pd);
if(pd.containsKey("ID")){
pd.put("FOREIGN_KEY", pd.getString("ID"));
pd.put("TYPE",121);
List<PageData> 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;
}

View File

@ -232,7 +232,7 @@ public class OperatingVehiclesController extends BaseController {
pd.put("FOREIGN_KEY", pd.getString("OPERATING_ID"));
pd.put("TYPE",130);
List<PageData> headstockphoto = imgfilesService.listAll(pd);//车头照片
pd.put("TYPE",131);
pd.put("TYPE",121);
List<PageData> drivinglicensephoto = imgfilesService.listAll(pd);//行驶证照片
pd.put("TYPE",132);
List<PageData> operatingcertificatephoto = imgfilesService.listAll(pd);//运营证照片

View File

@ -182,25 +182,6 @@ public class ScrapManageController extends BaseController {
return map;
}
/*@RequestMapping(value = "/getscrapoperationvehiclelist")
@ResponseBody
public Object getScrapOperationVehicleList() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
String corpId = Jurisdiction.getCORPINFO_ID();
List<PageData> operationList = operatingVehiclesService.operationVehicleList(corpId); //列出Question列表
List<PageData> 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;

View File

@ -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;
}
// 过滤掉车船税下拉列表中已报废的车辆信息