diff --git a/src/main/java/com/zcloud/controller/assignedManage/AssignedManageController.java b/src/main/java/com/zcloud/controller/assignedManage/AssignedManageController.java index 23ea01a..06c5c84 100644 --- a/src/main/java/com/zcloud/controller/assignedManage/AssignedManageController.java +++ b/src/main/java/com/zcloud/controller/assignedManage/AssignedManageController.java @@ -35,26 +35,28 @@ public class AssignedManageController extends BaseController { @Autowired private FreightTrailerService freightTrailerService; - /**新增 + /** + * 新增 + * * @param * @throws Exception */ - @RequestMapping(value="/add") + @RequestMapping(value = "/add") @ResponseBody - public Object add() throws Exception{ - Map map = new HashMap(); + public Object add() throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); - pd.put("ASSIGNED_ID", this.get32UUID()); //车船税主键 - pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) - pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id - pd.put("CREATORNAME", Jurisdiction.getUsername()); //添加人名字 - pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 + pd.put("ASSIGNED_ID", this.get32UUID()); //车船税主键 + pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) + pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id + pd.put("CREATORNAME", Jurisdiction.getUsername()); //添加人名字 + pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 pd.put("ASSIGNED_DATE", pd.get("TRANSACTION_DATE")); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); - pd.put("VEHICLE_TYPE",pd.get("ASSIGNED_VEHICLE_MODEL")); - pd.put("NOW_CONTACT_NUMBER",pd.get("NOW_OWNERS_NUMBER")); + pd.put("VEHICLE_TYPE", pd.get("ASSIGNED_VEHICLE_MODEL")); + pd.put("NOW_CONTACT_NUMBER", pd.get("NOW_OWNERS_NUMBER")); assignedManageService.save(pd); PageData pageData = assignedManageService.findById(pd); String vehicle = pageData.getString("RAW_PLATE_NUMBER"); @@ -69,7 +71,7 @@ public class AssignedManageController extends BaseController { operating.put("OPERATING_ID", vehicleInfo.get(0).get("ID")); operating.put("ISASSIGNED", "1"); operatingVehiclesService.setAssinedStatus(operating); - }else if("2".equals(vehicleInfo.get(0).get("TRAFFIC_TYPE") + "")) { + } else if ("2".equals(vehicleInfo.get(0).get("TRAFFIC_TYPE") + "")) { // 货运挂车 PageData freightTrailer = new PageData(); freightTrailer.put("CORPINFO_ID", pd.get("CORPINFO_ID")); @@ -82,14 +84,16 @@ public class AssignedManageController extends BaseController { return map; } - /**删除 + /** + * 删除 + * * @param * @throws Exception */ - @RequestMapping(value="/delete") + @RequestMapping(value = "/delete") @ResponseBody - public Object delete() throws Exception{ - Map map = new HashMap(); + public Object delete() throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); @@ -113,7 +117,7 @@ public class AssignedManageController extends BaseController { operating.put("OPERATING_ID", vehicleInfo.get(0).get("ID")); operating.put("ISASSIGNED", "0"); operatingVehiclesService.setAssinedStatus(operating); - }else if("2".equals(vehicleInfo.get(0).get("TRAFFIC_TYPE") + "")) { + } else if ("2".equals(vehicleInfo.get(0).get("TRAFFIC_TYPE") + "")) { // 货运挂车 PageData freightTrailer = new PageData(); freightTrailer.put("CORPINFO_ID", pd.get("CORPINFO_ID")); @@ -122,49 +126,54 @@ public class AssignedManageController extends BaseController { freightTrailerService.setAssinedStatus(freightTrailer); } assignedManageService.delete(pd); - map.put("result", errInfo); //返回结果 + map.put("result", errInfo); //返回结果 return map; } - /**修改 + /** + * 修改 + * * @param * @throws Exception */ - @RequestMapping(value="/edit") + @RequestMapping(value = "/edit") @ResponseBody - public Object edit() throws Exception{ - Map map = new HashMap(); + public Object edit() throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); - pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) - pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id - pd.put("CREATORNAME", Jurisdiction.getUsername()); //添加人名字 - pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 - pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id + pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) + pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id + pd.put("CREATORNAME", Jurisdiction.getUsername()); //添加人名字 + pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 + pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id pd.put("OPERATORNAME", Jurisdiction.getUsername()); // 修改人名字 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 String expireDate = pd.getString("EXPIRE_DATE"); String day = DateUtil.getDay(); boolean flag = DateUtil.compareDate(expireDate, day); - if(flag) { - pd.put("EXPIRE_STATUS","expirestatus_01"); - }else{ - pd.put("EXPIRE_STATUS","expirestatus_02"); + if (flag) { + pd.put("EXPIRE_STATUS", "expirestatus_01"); + } else { + pd.put("EXPIRE_STATUS", "expirestatus_02"); } assignedManageService.edit(pd); map.put("pd", pd); map.put("result", errInfo); return map; } - /**去修改页面获取数据 + + /** + * 去修改页面获取数据 + * * @param * @throws Exception */ - @RequestMapping(value="/goEdit") + @RequestMapping(value = "/goEdit") @ResponseBody - public Object goEdit() throws Exception{ - Map map = new HashMap(); + public Object goEdit() throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); @@ -174,11 +183,11 @@ public class AssignedManageController extends BaseController { pd2.put("CORPINFO_ID", pd.getString("CORPINFO_ID")); pd2.put("ID", pd.get("RAW_PLATE_NUMBER")); List pageData = freightTrailerService.vehicleList(pd2); - pd.put("PLATE_NUMBER",pageData.get(0).get("PLATE_NUMBER")); + pd.put("PLATE_NUMBER", pageData.get(0).get("PLATE_NUMBER")); pd.put("FOREIGN_KEY", pd.getString("ASSIGNED_ID")); - pd.put("TYPE",120); + pd.put("TYPE", 120); List nowVehicleOperationCertificateImgs = imgfilesService.listAll(pd);//车头照片 - pd.put("TYPE",121); + pd.put("TYPE", 121); List nowDrivinglicenseImg = imgfilesService.listAll(pd);//行驶证照片 map.put("nowVehicleOperationCertificateImgs", nowVehicleOperationCertificateImgs); map.put("nowDrivinglicenseImg", nowDrivinglicenseImg); @@ -187,18 +196,18 @@ public class AssignedManageController extends BaseController { return map; } - @RequestMapping(value="/list") + @RequestMapping(value = "/list") @ResponseBody - public Object list(Page page) throws Exception{ - Map map = new HashMap(); + public Object list(Page page) throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); - String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 - if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); + String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 + if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim()); page.setPd(pd); - List varList = assignedManageService.list(page); //列出MajorDangerSource列表 + List varList = assignedManageService.list(page); //列出MajorDangerSource列表 map.put("varList", varList); map.put("page", page); @@ -230,26 +239,6 @@ public class AssignedManageController extends BaseController { return map; } - /*@RequestMapping(value = "/getassignedoperationvehiclelist") - @ResponseBody - public Object getAssignedOperationVehicleList() throws Exception { - Map map = new HashMap(); - String errInfo = "success"; - String corpId = Jurisdiction.getCORPINFO_ID(); - List operationList = operatingVehiclesService.operationVehicleList(corpId); //列出Question列表 - List assignedList = assignedManageService.assignedList(corpId); - for (int i = 0; i < assignedList.size(); i++) { - for (int j = 0; j < operationList.size(); j++) { - if(assignedList.get(i).get("RAW_PLATE_NUMBER").equals(operationList.get(j).get("PLATE_NUMBER"))) { - operationList.remove(j); - } - } - } - map.put("varList", operationList); - map.put("result", errInfo); - return map; - }*/ - @RequestMapping(value = "/getAssignedVehicleList") @ResponseBody public Object getAssignedVehicleList() throws Exception { @@ -260,17 +249,14 @@ public class AssignedManageController extends BaseController { pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); List allOperatingVehicleList = operatingVehiclesService.getPulldownVehicleList(pd); // 查询出所有不包括 删除、报废的营运车辆 List allAssignedList = assignedManageService.assignedList(corpId); // 所有过户的车辆 + List varList = new ArrayList<>(); - if(!CollectionUtil.isEmpty(allAssignedList)) { - varList = allOperatingVehicleList.stream().filter(operating -> { - for (PageData assigned : allAssignedList) { - if(!StringUtils.equals(operating.getString("OPERATING_ID"),assigned.getString("RAW_PLATE_NUMBER"))) { - return true; - } - } - return false; - }).collect(Collectors.toList()); - }else{ + if (!CollectionUtils.isEmpty(allAssignedList)) { + varList = allOperatingVehicleList.stream().parallel() + .filter(operating -> allAssignedList.stream() + .noneMatch(assigned -> StringUtils.equals(operating.getString("OPERATING_ID"), assigned.getString("RAW_PLATE_NUMBER")))) + .collect(Collectors.toList()); + } else { varList = allOperatingVehicleList; } map.put("varList", varList); @@ -286,19 +272,17 @@ public class AssignedManageController extends BaseController { String corpId = Jurisdiction.getCORPINFO_ID(); List freightList = freightTrailerService.getPulldownVehicleList(corpId); List assignedList = assignedManageService.assignedList(corpId); + List varList = new ArrayList<>(); - if(!CollectionUtils.isEmpty(assignedList)) { - varList = freightList.stream().filter(freight -> { - for (PageData assigned : assignedList) { - if(!StringUtils.equals(freight.getString("FREIGHTTRAILER_ID"),assigned.getString("RAW_PLATE_NUMBER"))) { - return true; - } - } - return false; - }).collect(Collectors.toList()); - }else { + if (!CollectionUtils.isEmpty(assignedList)) { + varList = freightList.stream().parallel() + .filter(freight -> assignedList.stream() + .noneMatch(assigned -> StringUtils.equals(freight.getString("FREIGHTTRAILER_ID"), assigned.getString("RAW_PLATE_NUMBER")))) + .collect(Collectors.toList()); + } else { varList = freightList; } + map.put("varList", varList); map.put("result", errInfo); return map; diff --git a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java index 9208c83..fbcda9d 100644 --- a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java +++ b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java @@ -232,30 +232,30 @@ public class TrafficSecurityWaybillRegistrationController extends BaseController PageData contactInfo = trafficSecurityCustomerManagementService.findByContactName(pd2); if(!ObjectUtil.isEmpty(contactInfo)) { pd.put("ENTRUST_PERSON", contactInfo.getString("CONTACT_ID")); - } - if(!contactInfo.getString("CONTACTPHONE").equals(pd.getString("CLIENTCONTACTPHONE"))) { - PageData entrust = new PageData(); - entrust.put("CONTACTPHONE", pd.getString("CLIENTCONTACTPHONE")); - entrust.put("CUSTOMERCONTACT_ID",contactInfo.getString("CUSTOMERCONTACT_ID")); - entrust.put("OPERATOR", Jurisdiction.getUSER_ID()); // 修改人id - entrust.put("OPERATORNAME", Jurisdiction.getName()); // 修改人姓名 - entrust.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 - trafficSecurityCustomerManagementService.editContactPhone(entrust); + if(!contactInfo.getString("CONTACTPHONE").equals(pd.getString("CLIENTCONTACTPHONE"))) { + PageData entrust = new PageData(); + entrust.put("CONTACTPHONE", pd.getString("CLIENTCONTACTPHONE")); + entrust.put("CUSTOMERCONTACT_ID",contactInfo.getString("CUSTOMERCONTACT_ID")); + entrust.put("OPERATOR", Jurisdiction.getUSER_ID()); // 修改人id + entrust.put("OPERATORNAME", Jurisdiction.getName()); // 修改人姓名 + entrust.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 + trafficSecurityCustomerManagementService.editContactPhone(entrust); + } } PageData pd3 = new PageData(); pd3.put("CONTACT", pd.getString("CONFIRM_PERSON")); PageData pageData = trafficSecurityCustomerManagementService.findByContactName(pd3); if(!ObjectUtil.isEmpty(pageData)) { pd.put("CONFIRM_PERSON", pageData.getString("CONTACT_ID")); - } - if(!pageData.getString("CONTACTPHONE").equals(pd.getString("CONFIRMINGPHONE"))) { - PageData entrust = new PageData(); - entrust.put("CONTACTPHONE", pd.getString("CONFIRMINGPHONE")); - entrust.put("CUSTOMERCONTACT_ID",pageData.getString("CUSTOMERCONTACT_ID")); - entrust.put("OPERATOR", Jurisdiction.getUSER_ID()); // 修改人id - entrust.put("OPERATORNAME", Jurisdiction.getName()); // 修改人姓名 - entrust.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 - trafficSecurityCustomerManagementService.editContactPhone(entrust); + if(!pd.getString("CONFIRMINGPHONE").equals(pageData.getString("CONTACTPHONE"))) { + PageData entrust = new PageData(); + entrust.put("CONTACTPHONE", pd.getString("CONFIRMINGPHONE")); + entrust.put("CUSTOMERCONTACT_ID",pageData.getString("CUSTOMERCONTACT_ID")); + entrust.put("OPERATOR", Jurisdiction.getUSER_ID()); // 修改人id + entrust.put("OPERATORNAME", Jurisdiction.getName()); // 修改人姓名 + entrust.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 + trafficSecurityCustomerManagementService.editContactPhone(entrust); + } } trafficSecurityWaybillRegistrationService.edit(pd); diff --git a/src/main/java/com/zcloud/controller/freighttrailer/FreighttTrailerController.java b/src/main/java/com/zcloud/controller/freighttrailer/FreighttTrailerController.java index e847931..678ac31 100644 --- a/src/main/java/com/zcloud/controller/freighttrailer/FreighttTrailerController.java +++ b/src/main/java/com/zcloud/controller/freighttrailer/FreighttTrailerController.java @@ -14,6 +14,7 @@ import com.zcloud.service.taxationManage.TaxationManageService; import com.zcloud.util.*; import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; +import org.apache.shiro.util.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.transaction.annotation.Transactional; @@ -540,13 +541,27 @@ public class FreighttTrailerController extends BaseController { List operatingList = operatingVehiclesService.operationVehicleList(pd.getString("CORPINFO_ID")); page.setPd(pd); List insAnnually = inspectAnnuallyService.annuallyList(page); - for (int i = 0; i < insAnnually.size(); i++) { + + // 获取所有的营运车辆 + List operatings = insAnnually.stream().filter(data -> StringUtils.equals("1",data.getString("VEHICLE_MODEL"))) + .collect(Collectors.toList()); + + // 过滤掉年检车辆中已经存在的营运车辆 + List varList = new ArrayList<>(); + if(!CollectionUtils.isEmpty(operatings)) { + varList = operatingList.stream().parallel().filter(operating -> operatings.stream() + .noneMatch(ins -> Objects.equals(operating.getString("OPERATING_ID"), ins.getString("VEHICLE")))) + .collect(Collectors.toList()); + }else{ + varList = operatingList; + } + /*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); } } - } + }*/ if(pd.containsKey("ID")){ pd.put("OPERATING_ID", pd.getString("ID")); pd.put("FOREIGN_KEY", pd.getString("OPERATING_ID")); @@ -554,10 +569,10 @@ public class FreighttTrailerController 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; } @@ -566,13 +581,28 @@ public class FreighttTrailerController extends BaseController { List freightList = freightTrailerService.trailerList(pd.getString("CORPINFO_ID")); page.setPd(pd); List insAnnually = inspectAnnuallyService.annuallyList(page); - for (int i = 0; i < insAnnually.size(); i++) { + + // 获取所有的货运挂车 + List freights = insAnnually.stream().filter(data -> "2".equals(data.getString("VEHICLE_MODEL"))) + .collect(Collectors.toList()); + + // 过滤掉年检列表中的所有货运挂车信息 + List varList = new ArrayList<>(); + if(!CollectionUtils.isEmpty(freights)) { + varList = freightList.stream().parallel().filter(freight -> freights.stream() + .noneMatch(ins -> freight.getString("FREIGHTTRAILER_ID").equals(ins.getString("VEHICLE")))) + .collect(Collectors.toList()); + }else{ + varList = freightList; + } + + /*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")); @@ -580,10 +610,10 @@ public class FreighttTrailerController extends BaseController { List drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片 map.put("drivingLicenseImgs", drivingLicenseImgs); } - freightList.forEach(freight -> { + varList.forEach(freight -> { freight.put("ID", freight.getString("FREIGHTTRAILER_ID")); }); - map.put("list", freightList); + map.put("list", varList); map.put("result", errInfo); return map; } diff --git a/src/main/java/com/zcloud/controller/inspectAnnually/InspectAnnuallyController.java b/src/main/java/com/zcloud/controller/inspectAnnually/InspectAnnuallyController.java index 33e03d7..9408bb3 100644 --- a/src/main/java/com/zcloud/controller/inspectAnnually/InspectAnnuallyController.java +++ b/src/main/java/com/zcloud/controller/inspectAnnually/InspectAnnuallyController.java @@ -64,7 +64,7 @@ public class InspectAnnuallyController extends BaseController { pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID pd.put("ARCHIVES_TYPE", "0"); //档案状态 - pd.put("VEHICLE",pd.get("PLATE_NUMBER")); + pd.put("VEHICLE", pd.get("PLATE_NUMBER")); inspectAnnuallyService.save(pd); map.put("pd", pd); map.put("result", errInfo); @@ -192,7 +192,7 @@ public class InspectAnnuallyController extends BaseController { pd = this.getPageData(); pd = inspectAnnuallyService.findById(pd); //根据ID读取 - if("1".equals(pd.getString("VEHICLE_MODEL"))) { + if ("1".equals(pd.getString("VEHICLE_MODEL"))) { PageData opearting = new PageData(); opearting.put("OPERATING_ID", pd.get("VEHICLE")); opearting.put("CORPINFO_ID", pd.get("CORPINFO_ID")); @@ -200,7 +200,7 @@ public class InspectAnnuallyController extends BaseController { pd.put("VEHICLE_BRAND", pageData.get("VEHICLE_BRAND")); pd.put("VEHICLE_TYPE", pageData.get("VEHICLE_MODEL")); pd.put("PLATE_NUMBER", pageData.get("PLATE_NUMBER")); - }else{ + } else { PageData freight = new PageData(); freight.put("FREIGHTTRAILER_ID", pd.get("VEHICLE")); freight.put("CORPINFO_ID", pd.get("CORPINFO_ID")); @@ -210,7 +210,7 @@ public class InspectAnnuallyController extends BaseController { } pd.put("FOREIGN_KEY", pd.getString("INSPECTANNUALLY_ID")); - pd.put("TYPE",124); + pd.put("TYPE", 124); List inspectinfoImgs = imgfilesService.listAll(pd);//年检资料图片 map.put("pd", pd); @@ -239,44 +239,46 @@ public class InspectAnnuallyController extends BaseController { } - /**导出到excel + /** + * 导出到excel + * * @param * @throws Exception */ - @RequestMapping(value="/excel") + @RequestMapping(value = "/excel") // // @RequiresPermissions("toExcel") - public ModelAndView exportExcel() throws Exception{ + public ModelAndView exportExcel() throws Exception { ModelAndView mv = new ModelAndView(); PageData pd = new PageData(); pd = this.getPageData(); String DATA_IDS = pd.getString("DATA_IDS"); - if(Tools.notEmpty(DATA_IDS)){ + if (Tools.notEmpty(DATA_IDS)) { String[] ArrayDATA_IDS = DATA_IDS.split(","); - pd.put("ArrayDATA_IDS",ArrayDATA_IDS); + pd.put("ArrayDATA_IDS", ArrayDATA_IDS); } - Map dataMap = new HashMap(); + Map dataMap = new HashMap(); List titles = new ArrayList(); - titles.add("自编号"); //1 - titles.add("年检车辆"); //2 - titles.add("车辆品牌"); //3 - titles.add("年检车型"); //4 - titles.add("车主业户"); //5 - titles.add("联系电话"); //6 - titles.add("登记人"); //7 - titles.add("办理日期"); //8 - titles.add("年检周期"); //9 - titles.add("到期日期"); //10 - titles.add("年检费用"); //11 - titles.add("实收费用"); //12 - titles.add("年检地址"); //13 - titles.add("提醒天数"); //14 - titles.add("提醒日期"); //15 - titles.add("年检资料"); //16 - titles.add("备注"); //17 + titles.add("自编号"); //1 + titles.add("年检车辆"); //2 + titles.add("车辆品牌"); //3 + titles.add("年检车型"); //4 + titles.add("车主业户"); //5 + titles.add("联系电话"); //6 + titles.add("登记人"); //7 + titles.add("办理日期"); //8 + titles.add("年检周期"); //9 + titles.add("到期日期"); //10 + titles.add("年检费用"); //11 + titles.add("实收费用"); //12 + titles.add("年检地址"); //13 + titles.add("提醒天数"); //14 + titles.add("提醒日期"); //15 + titles.add("年检资料"); //16 + titles.add("备注"); //17 dataMap.put("titles", titles); List varOList = inspectAnnuallyService.listOut(pd); List varList = new ArrayList(); - for(int i=0;i insureinfoImgs = imgfilesService.listAll(pd);//保险资料图片 - pd.put("TYPE",129); + pd.put("TYPE", 129); List attachmentUploadImgs = imgfilesService.listAll(pd);//保险附件上传 map.put("pd", pd); @@ -211,64 +210,83 @@ public class InsureController extends BaseController { String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); - pd.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID()); - if(!StringUtils.isEmpty(pd.getString("TRAFFIC_TYPE")) && pd.getString("TRAFFIC_TYPE").equals("1")) { + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + 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 insAnnually = insureService.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 insures = insAnnually.stream() + .filter(data -> StringUtils.equals(data.getString("VEHICLE_MODEL"), "1")) + .collect(Collectors.toList()); + + // 过滤掉保险列表中所有的营运车辆 + List varList = new ArrayList<>(); + if (!CollectionUtils.isEmpty(insures)) { + varList = operatingList.stream().parallel() + .filter(operating -> insures.stream() + .noneMatch(ins -> StringUtils.equals(operating.getString("OPERATING_ID"), ins.getString("VEHICLE")))) + .collect(Collectors.toList()); + } else { + varList = operatingList; } - if(pd.containsKey("ID")){ + + if (pd.containsKey("ID")) { pd.put("OPERATING_ID", pd.getString("ID")); pd.put("FOREIGN_KEY", pd.getString("OPERATING_ID")); - pd.put("TYPE",121); + pd.put("TYPE", 121); 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; } - if("2".equals(pd.getString("TRAFFIC_TYPE"))) { + if ("2".equals(pd.getString("TRAFFIC_TYPE"))) { // 货运挂车 List freightList = freightTrailerService.trailerList(pd.getString("CORPINFO_ID")); page.setPd(pd); - List insAnnually = insureService.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); - } - } + List insureList = insureService.list(page); + + // 获取保险列表中所有挂车信息 + List insures = insureList.stream().filter(data -> StringUtils.equals(data.getString("VEHICLE_MODEL"), "2")) + .collect(Collectors.toList()); + + // 过滤掉保险列表中所有已存在的挂车 + List varList = new ArrayList<>(); + if (!CollectionUtils.isEmpty(insures)) { + varList = freightList.stream().parallel() + .filter(freight -> insures.stream() + .noneMatch(ins -> StringUtils.equals(freight.getString("FREIGHTTRAILER_ID"), ins.getString("VEHICLE")))) + .collect(Collectors.toList()); + } else { + varList = freightList; } - if(pd.containsKey("ID")){ + + if (pd.containsKey("ID")) { pd.put("FREIGHTTRAILER_ID", pd.getString("ID")); pd.put("FOREIGN_KEY", pd.getString("FREIGHTTRAILER_ID")); - pd.put("TYPE",121); + pd.put("TYPE", 121); List drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片 map.put("drivingLicenseImgs", drivingLicenseImgs); } - freightList.forEach(freight -> { + varList.forEach(freight -> { freight.put("ID", freight.getString("FREIGHTTRAILER_ID")); }); - map.put("list", freightList); + map.put("list", varList); map.put("result", errInfo); return map; } List resData = freightTrailerService.vehicleList(pd); - if(pd.containsKey("ID")){ + if (pd.containsKey("ID")) { pd.put("FOREIGN_KEY", pd.getString("ID")); - pd.put("TYPE",121); + pd.put("TYPE", 121); List drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片 map.put("drivingLicenseImgs", drivingLicenseImgs); } diff --git a/src/main/java/com/zcloud/controller/maintenance/MaintenanceController.java b/src/main/java/com/zcloud/controller/maintenance/MaintenanceController.java index 0e8d720..bc69cd6 100644 --- a/src/main/java/com/zcloud/controller/maintenance/MaintenanceController.java +++ b/src/main/java/com/zcloud/controller/maintenance/MaintenanceController.java @@ -11,15 +11,14 @@ import com.zcloud.service.system.ImgFilesService; import com.zcloud.util.DateUtil; import com.zcloud.util.Jurisdiction; import org.apache.commons.lang.StringUtils; +import org.apache.shiro.util.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; /** * 维保管理 @@ -158,11 +157,11 @@ public class MaintenanceController extends BaseController { page.setPd(pd); List varList = maintenanceService.list(page); //列出Question列表 for (PageData operation : varList) { - if("1".equals(operation.get("OPEAR_ISSCRAP")) || "1".equals(operation.get("FREIGHT_ISSCRAP"))) { + if ("1".equals(operation.get("OPEAR_ISSCRAP")) || "1".equals(operation.get("FREIGHT_ISSCRAP"))) { operation.put("ARCHIVES_TYPE", "2"); - } else if("1".equals(operation.get("OPEAR_ISASSIGNED")) || "1".equals(operation.get("FREIGHT_ISASSIGNED"))) { + } else if ("1".equals(operation.get("OPEAR_ISASSIGNED")) || "1".equals(operation.get("FREIGHT_ISASSIGNED"))) { operation.put("ARCHIVES_TYPE", "1"); - }else{ + } else { operation.put("ARCHIVES_TYPE", "0"); } } @@ -190,7 +189,7 @@ public class MaintenanceController extends BaseController { pd = maintenanceService.findById(pd); //根据ID读取 pd.put("FOREIGN_KEY", pd.getString("MAINTENANCE_ID")); - pd.put("TYPE",127); + pd.put("TYPE", 127); List maintenanceinfoImgs = imgfilesService.listAll(pd);//维保资料图片 map.put("pd", pd); map.put("maintenanceinfoImgs", maintenanceinfoImgs); @@ -205,68 +204,32 @@ public class MaintenanceController extends BaseController { String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); - pd.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID()); - 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 insAnnually = maintenanceService.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); - } - } - } - 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); - } - operatingList.forEach(operating -> { - operating.put("ID", operating.getString("OPERATING_ID")); - }); - map.put("list", operatingList); - map.put("result", errInfo); - return map; - } - 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; - } + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + // 营运车辆 + List operatingList = operatingVehiclesService.operationVehicleList(pd.getString("CORPINFO_ID")); + page.setPd(pd); + List maintenanceList = maintenanceService.list(page); - List resData = freightTrailerService.vehicleList(pd); - if(pd.containsKey("ID")){ - pd.put("FOREIGN_KEY", pd.getString("ID")); - pd.put("TYPE",121); + 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); } - map.put("list", resData); + varList.forEach(operating -> { + operating.put("ID", operating.getString("OPERATING_ID")); + }); + map.put("list", varList); 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 e255bef..7a469cb 100644 --- a/src/main/java/com/zcloud/controller/operatingvehicles/OperatingVehiclesController.java +++ b/src/main/java/com/zcloud/controller/operatingvehicles/OperatingVehiclesController.java @@ -61,7 +61,7 @@ public class OperatingVehiclesController extends BaseController { pd.put("OPERATING_ID", this.get32UUID()); //运营车辆主键 pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id - pd.put("CREATORNAME", Jurisdiction.getUsername()); //添加人名字 + pd.put("CREATORNAME", Jurisdiction.getName()); //添加人名字 pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); pd.put("NETWORK_STATUS", "未入网"); diff --git a/src/main/java/com/zcloud/controller/operations/OperationsController.java b/src/main/java/com/zcloud/controller/operations/OperationsController.java index fd1b8e6..a2a429c 100644 --- a/src/main/java/com/zcloud/controller/operations/OperationsController.java +++ b/src/main/java/com/zcloud/controller/operations/OperationsController.java @@ -11,15 +11,14 @@ import com.zcloud.service.system.ImgFilesService; import com.zcloud.util.DateUtil; import com.zcloud.util.Jurisdiction; import org.apache.commons.lang.StringUtils; +import org.apache.shiro.util.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; /** * 营运管理 @@ -217,14 +216,23 @@ public class OperationsController extends BaseController { // 营运车辆 List operatingList = operatingVehiclesService.operationVehicleList(pd.getString("CORPINFO_ID")); page.setPd(pd); - List insAnnually = operationsService.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 operationsList = operationsService.list(page); + + // 获取营运车辆列表中所有的运营车辆 + List operations = operationsList.stream().filter(data -> StringUtils.equals(data.getString("VEHICLE_MODEL"), "1")) + .collect(Collectors.toList()); + + // 过滤掉营运管理列表中所有营运车辆信息 + List varList = new ArrayList<>(); + if(!CollectionUtils.isEmpty(operations)) { + varList = operatingList.stream().parallel() + .filter(operating -> operations.stream(). + noneMatch(operation -> StringUtils.equals(operating.getString("OPERATING_ID"), operation.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")); @@ -232,10 +240,10 @@ public class OperationsController 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; } @@ -243,14 +251,23 @@ public class OperationsController extends BaseController { // 货运挂车 List freightList = freightTrailerService.trailerList(pd.getString("CORPINFO_ID")); page.setPd(pd); - List insAnnually = operationsService.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); - } - } + List operationsList = operationsService.list(page); + + // 获取营运管理列表中所有的货运挂车 + List operations = operationsList.stream() + .filter(data -> StringUtils.equals(data.getString("VEHICLE_MODEL"), "2")) + .collect(Collectors.toList()); + + List varList = new ArrayList<>(); + if(!CollectionUtils.isEmpty(operations)) { + varList = freightList.stream().parallel() + .filter(freight -> operations.stream() + .noneMatch(operation -> StringUtils.equals(freight.getString("FREIGHTTRAILER_ID"), operation.getString("VEHICLE")))) + .collect(Collectors.toList()); + }else{ + varList = freightList; } + if(pd.containsKey("ID")){ pd.put("FREIGHTTRAILER_ID", pd.getString("ID")); pd.put("FOREIGN_KEY", pd.getString("FREIGHTTRAILER_ID")); @@ -258,10 +275,10 @@ public class OperationsController extends BaseController { List drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片 map.put("drivingLicenseImgs", drivingLicenseImgs); } - freightList.forEach(freight -> { + varList.forEach(freight -> { freight.put("ID", freight.getString("FREIGHTTRAILER_ID")); }); - map.put("list", freightList); + map.put("list", varList); map.put("result", errInfo); return map; } diff --git a/src/main/java/com/zcloud/controller/scrapManage/ScrapManageController.java b/src/main/java/com/zcloud/controller/scrapManage/ScrapManageController.java index a86a02d..e9cb5e8 100644 --- a/src/main/java/com/zcloud/controller/scrapManage/ScrapManageController.java +++ b/src/main/java/com/zcloud/controller/scrapManage/ScrapManageController.java @@ -212,11 +212,20 @@ public class ScrapManageController extends BaseController { pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); List operationList = operatingVehiclesService.getScrapPulldownVehicleList(pd); //列出Question列表 List scrapList = scrapManageService.scrapListAll(corpId); + List varList = new ArrayList<>(); if(!CollectionUtils.isEmpty(scrapList)) { + varList = operationList.stream().parallel() + .filter(operating -> scrapList.stream() + .noneMatch(scrap -> StringUtils.equals(operating.getString("PLATE_NUMBER"), scrap.getString("PLATE_NUMBER")))) + .collect(Collectors.toList()); + }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"))) { + if(!StringUtils.equals(operation.getString("PLATE_NUMBER"),scrap.getString("PLATE_NUMBER"))) { return true; } } @@ -224,7 +233,7 @@ public class ScrapManageController extends BaseController { }).collect(Collectors.toList()); }else { varList = operationList; - } + }*/ map.put("varList", varList); map.put("result", errInfo); return map; @@ -238,16 +247,13 @@ public class ScrapManageController extends BaseController { String corpId = Jurisdiction.getCORPINFO_ID(); List freightList = freightTrailerService.getScrapPulldownVehicleList(corpId); List scrapList = scrapManageService.scrapListAll(corpId); + List varList = new ArrayList<>(); if(!CollectionUtils.isEmpty(scrapList)) { - varList = freightList.stream().filter(freight -> { - for (PageData scrap : scrapList) { - if(StringUtils.equals(freight.getString("PLATE_NUMBER"),scrap.getString("PLATE_NUMBER"))){ - return true; - } - } - return false; - }).collect(Collectors.toList()); + varList = freightList.stream().parallel() + .filter(freight -> scrapList.stream() + .noneMatch(scrap -> StringUtils.equals(freight.getString("PLATE_NUMBER"), scrap.getString("PLATE_NUMBER")))) + .collect(Collectors.toList()); }else{ varList = freightList; } diff --git a/src/main/java/com/zcloud/controller/taxationManage/TaxationManageController.java b/src/main/java/com/zcloud/controller/taxationManage/TaxationManageController.java index c5219aa..74fb950 100644 --- a/src/main/java/com/zcloud/controller/taxationManage/TaxationManageController.java +++ b/src/main/java/com/zcloud/controller/taxationManage/TaxationManageController.java @@ -41,31 +41,33 @@ public class TaxationManageController extends BaseController { @Autowired private FreightTrailerService freightTrailerService; - /**新增 + /** + * 新增 + * * @param * @throws Exception */ - @RequestMapping(value="/add") + @RequestMapping(value = "/add") @ResponseBody - public Object add() throws Exception{ - Map map = new HashMap(); + public Object add() throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); - pd.put("TAXATION_ID", this.get32UUID()); //车船税主键 - pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) - pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id - pd.put("CREATORNAME", Jurisdiction.getName()); //添加人名字 - pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 + pd.put("TAXATION_ID", this.get32UUID()); //车船税主键 + pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) + pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id + pd.put("CREATORNAME", Jurisdiction.getName()); //添加人名字 + pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 pd.put("ARCHIVES_TYPE", "0"); //档案状态 - if("".equals(pd.getString("EXPIRE_STATUS"))) { + if ("".equals(pd.getString("EXPIRE_STATUS"))) { String expireDate = pd.getString("EXPIRE_DATE"); String day = DateUtil.getDay(); boolean flag = DateUtil.compareDate(expireDate, day); - if(flag) { - pd.put("EXPIRE_STATUS","1"); - }else{ - pd.put("EXPIRE_STATUS","0"); + if (flag) { + pd.put("EXPIRE_STATUS", "1"); + } else { + pd.put("EXPIRE_STATUS", "0"); } } pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); @@ -75,14 +77,16 @@ public class TaxationManageController extends BaseController { return map; } - /**删除 + /** + * 删除 + * * @param * @throws Exception */ - @RequestMapping(value="/delete") + @RequestMapping(value = "/delete") @ResponseBody - public Object delete() throws Exception{ - Map map = new HashMap(); + public Object delete() throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); @@ -90,46 +94,51 @@ public class TaxationManageController extends BaseController { pd.put("DELETORNAME", Jurisdiction.getName()); pd.put("DELETTIME", DateUtil.date2Str(new Date())); taxationManageService.delete(pd); - map.put("result", errInfo); //返回结果 + map.put("result", errInfo); //返回结果 return map; } - /**修改 + /** + * 修改 + * * @param * @throws Exception */ - @RequestMapping(value="/edit") + @RequestMapping(value = "/edit") @ResponseBody - public Object edit() throws Exception{ - Map map = new HashMap(); + public Object edit() throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); - pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) - pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id + pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) + pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id pd.put("OPERATORNAME", Jurisdiction.getName()); // 修改人名字 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 String expireDate = pd.getString("EXPIRE_DATE"); String day = DateUtil.getDay(); boolean flag = DateUtil.compareDate(expireDate, day); - if(flag) { - pd.put("EXPIRE_STATUS","1"); - }else{ - pd.put("EXPIRE_STATUS","0"); + if (flag) { + pd.put("EXPIRE_STATUS", "1"); + } else { + pd.put("EXPIRE_STATUS", "0"); } taxationManageService.edit(pd); map.put("pd", pd); map.put("result", errInfo); return map; } - /**去修改页面获取数据 + + /** + * 去修改页面获取数据 + * * @param * @throws Exception */ - @RequestMapping(value="/goEdit") + @RequestMapping(value = "/goEdit") @ResponseBody - public Object goEdit() throws Exception{ - Map map = new HashMap(); + public Object goEdit() throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); @@ -139,20 +148,20 @@ public class TaxationManageController extends BaseController { return map; } - @RequestMapping(value="/list") + @RequestMapping(value = "/list") @ResponseBody - public Object list(Page page) throws Exception{ - Map map = new HashMap(); + public Object list(Page page) throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); - String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 - if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); + String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 + if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim()); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); page.setPd(pd); - List taxationList = taxationManageService.list(page); //列出MajorDangerSource列表 + List taxationList = taxationManageService.list(page); //列出MajorDangerSource列表 taxationList.forEach(taxation -> { - if("1".equals(taxation.get("ISSCRAP"))) { + if ("1".equals(taxation.get("ISSCRAP"))) { taxation.put("ARCHIVES_TYPE", "1"); } else if ("1".equals(taxation.get("ISASSIGNED"))) { taxation.put("ARCHIVES_TYPE", "2"); @@ -185,23 +194,19 @@ public class TaxationManageController extends BaseController { pd = this.getPageData(); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID page.setPd(pd); - List varList = freightTrailerService.list(page); // 列出所有挂车列表 + List freightTrailerList = freightTrailerService.list(page); // 列出所有挂车列表 List taxationList = taxationManageService.taxationList(pd.getString("CORPINFO_ID")); // 列出车船税列表 - List pageDataStream = new ArrayList<>(); - if(!CollectionUtils.isEmpty(taxationList)) { - pageDataStream = varList.stream().filter(trailer -> { // 去除车船税类表中已有的车辆 - for (PageData taxation : taxationList) { - if (!StringUtils.equals(taxation.getString("PLATE_NUMBER"), trailer.getString("PLATE_NUMBER"))) { - return true; - } - } - return false; - }).collect(Collectors.toList()); - }else{ - pageDataStream = varList; + + List varList = new ArrayList<>(); + if (!CollectionUtils.isEmpty(taxationList)) { + varList = freightTrailerList.stream().parallel() + .filter(freight -> taxationList.stream() + .noneMatch(taxation -> StringUtils.equals(freight.getString("PLATE_NUMBER"), taxation.getString("PLATE_NUMBER")))) + .collect(Collectors.toList()); } + // 过滤掉车船税下拉列表中已报废的车辆信息 - List choiceTrailerList = pageDataStream.stream().filter(data -> !"1".equals(data.get("ISSCRAP"))).collect(Collectors.toList()); + List choiceTrailerList = varList.stream().filter(data -> !"1".equals(data.get("ISSCRAP"))).collect(Collectors.toList()); map.put("varList", choiceTrailerList); map.put("page", page); map.put("result", errInfo);