BUG优化

dev
xiepeng 2024-04-18 17:49:00 +08:00
parent 06395c0c05
commit faabbc8b54
10 changed files with 351 additions and 327 deletions

View File

@ -35,26 +35,28 @@ public class AssignedManageController extends BaseController {
@Autowired @Autowired
private FreightTrailerService freightTrailerService; private FreightTrailerService freightTrailerService;
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@RequestMapping(value="/add") @RequestMapping(value = "/add")
@ResponseBody @ResponseBody
public Object add() throws Exception{ public Object add() throws Exception {
Map<String,Object> map = new HashMap<String,Object>(); Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success"; String errInfo = "success";
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
pd.put("ASSIGNED_ID", this.get32UUID()); //车船税主键 pd.put("ASSIGNED_ID", this.get32UUID()); //车船税主键
pd.put("ISDELETE", "0"); //是否删除(0:有效 1删除) pd.put("ISDELETE", "0"); //是否删除(0:有效 1删除)
pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id
pd.put("CREATORNAME", Jurisdiction.getUsername()); //添加人名字 pd.put("CREATORNAME", Jurisdiction.getUsername()); //添加人名字
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
pd.put("ASSIGNED_DATE", pd.get("TRANSACTION_DATE")); pd.put("ASSIGNED_DATE", pd.get("TRANSACTION_DATE"));
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
pd.put("VEHICLE_TYPE",pd.get("ASSIGNED_VEHICLE_MODEL")); pd.put("VEHICLE_TYPE", pd.get("ASSIGNED_VEHICLE_MODEL"));
pd.put("NOW_CONTACT_NUMBER",pd.get("NOW_OWNERS_NUMBER")); pd.put("NOW_CONTACT_NUMBER", pd.get("NOW_OWNERS_NUMBER"));
assignedManageService.save(pd); assignedManageService.save(pd);
PageData pageData = assignedManageService.findById(pd); PageData pageData = assignedManageService.findById(pd);
String vehicle = pageData.getString("RAW_PLATE_NUMBER"); 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("OPERATING_ID", vehicleInfo.get(0).get("ID"));
operating.put("ISASSIGNED", "1"); operating.put("ISASSIGNED", "1");
operatingVehiclesService.setAssinedStatus(operating); 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(); PageData freightTrailer = new PageData();
freightTrailer.put("CORPINFO_ID", pd.get("CORPINFO_ID")); freightTrailer.put("CORPINFO_ID", pd.get("CORPINFO_ID"));
@ -82,14 +84,16 @@ public class AssignedManageController extends BaseController {
return map; return map;
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@RequestMapping(value="/delete") @RequestMapping(value = "/delete")
@ResponseBody @ResponseBody
public Object delete() throws Exception{ public Object delete() throws Exception {
Map<String,String> map = new HashMap<String,String>(); Map<String, String> map = new HashMap<String, String>();
String errInfo = "success"; String errInfo = "success";
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
@ -113,7 +117,7 @@ public class AssignedManageController extends BaseController {
operating.put("OPERATING_ID", vehicleInfo.get(0).get("ID")); operating.put("OPERATING_ID", vehicleInfo.get(0).get("ID"));
operating.put("ISASSIGNED", "0"); operating.put("ISASSIGNED", "0");
operatingVehiclesService.setAssinedStatus(operating); 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(); PageData freightTrailer = new PageData();
freightTrailer.put("CORPINFO_ID", pd.get("CORPINFO_ID")); freightTrailer.put("CORPINFO_ID", pd.get("CORPINFO_ID"));
@ -122,49 +126,54 @@ public class AssignedManageController extends BaseController {
freightTrailerService.setAssinedStatus(freightTrailer); freightTrailerService.setAssinedStatus(freightTrailer);
} }
assignedManageService.delete(pd); assignedManageService.delete(pd);
map.put("result", errInfo); //返回结果 map.put("result", errInfo); //返回结果
return map; return map;
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@RequestMapping(value="/edit") @RequestMapping(value = "/edit")
@ResponseBody @ResponseBody
public Object edit() throws Exception{ public Object edit() throws Exception {
Map<String,Object> map = new HashMap<String,Object>(); Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success"; String errInfo = "success";
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
pd.put("ISDELETE", "0"); //是否删除(0:有效 1删除) pd.put("ISDELETE", "0"); //是否删除(0:有效 1删除)
pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id
pd.put("CREATORNAME", Jurisdiction.getUsername()); //添加人名字 pd.put("CREATORNAME", Jurisdiction.getUsername()); //添加人名字
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id
pd.put("OPERATORNAME", Jurisdiction.getUsername()); // 修改人名字 pd.put("OPERATORNAME", Jurisdiction.getUsername()); // 修改人名字
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间
String expireDate = pd.getString("EXPIRE_DATE"); String expireDate = pd.getString("EXPIRE_DATE");
String day = DateUtil.getDay(); String day = DateUtil.getDay();
boolean flag = DateUtil.compareDate(expireDate, day); boolean flag = DateUtil.compareDate(expireDate, day);
if(flag) { if (flag) {
pd.put("EXPIRE_STATUS","expirestatus_01"); pd.put("EXPIRE_STATUS", "expirestatus_01");
}else{ } else {
pd.put("EXPIRE_STATUS","expirestatus_02"); pd.put("EXPIRE_STATUS", "expirestatus_02");
} }
assignedManageService.edit(pd); assignedManageService.edit(pd);
map.put("pd", pd); map.put("pd", pd);
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }
/**
/**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@RequestMapping(value="/goEdit") @RequestMapping(value = "/goEdit")
@ResponseBody @ResponseBody
public Object goEdit() throws Exception{ public Object goEdit() throws Exception {
Map<String,Object> map = new HashMap<String,Object>(); Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success"; String errInfo = "success";
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
@ -174,11 +183,11 @@ public class AssignedManageController extends BaseController {
pd2.put("CORPINFO_ID", pd.getString("CORPINFO_ID")); pd2.put("CORPINFO_ID", pd.getString("CORPINFO_ID"));
pd2.put("ID", pd.get("RAW_PLATE_NUMBER")); pd2.put("ID", pd.get("RAW_PLATE_NUMBER"));
List<PageData> pageData = freightTrailerService.vehicleList(pd2); List<PageData> 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("FOREIGN_KEY", pd.getString("ASSIGNED_ID"));
pd.put("TYPE",120); pd.put("TYPE", 120);
List<PageData> nowVehicleOperationCertificateImgs = imgfilesService.listAll(pd);//车头照片 List<PageData> nowVehicleOperationCertificateImgs = imgfilesService.listAll(pd);//车头照片
pd.put("TYPE",121); pd.put("TYPE", 121);
List<PageData> nowDrivinglicenseImg = imgfilesService.listAll(pd);//行驶证照片 List<PageData> nowDrivinglicenseImg = imgfilesService.listAll(pd);//行驶证照片
map.put("nowVehicleOperationCertificateImgs", nowVehicleOperationCertificateImgs); map.put("nowVehicleOperationCertificateImgs", nowVehicleOperationCertificateImgs);
map.put("nowDrivinglicenseImg", nowDrivinglicenseImg); map.put("nowDrivinglicenseImg", nowDrivinglicenseImg);
@ -187,18 +196,18 @@ public class AssignedManageController extends BaseController {
return map; return map;
} }
@RequestMapping(value="/list") @RequestMapping(value = "/list")
@ResponseBody @ResponseBody
public Object list(Page page) throws Exception{ public Object list(Page page) throws Exception {
Map<String,Object> map = new HashMap<String,Object>(); Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success"; String errInfo = "success";
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
page.setPd(pd); page.setPd(pd);
List<PageData> varList = assignedManageService.list(page); //列出MajorDangerSource列表 List<PageData> varList = assignedManageService.list(page); //列出MajorDangerSource列表
map.put("varList", varList); map.put("varList", varList);
map.put("page", page); map.put("page", page);
@ -230,26 +239,6 @@ public class AssignedManageController extends BaseController {
return map; return map;
} }
/*@RequestMapping(value = "/getassignedoperationvehiclelist")
@ResponseBody
public Object getAssignedOperationVehicleList() 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> 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") @RequestMapping(value = "/getAssignedVehicleList")
@ResponseBody @ResponseBody
public Object getAssignedVehicleList() throws Exception { public Object getAssignedVehicleList() throws Exception {
@ -260,17 +249,14 @@ public class AssignedManageController extends BaseController {
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
List<PageData> allOperatingVehicleList = operatingVehiclesService.getPulldownVehicleList(pd); // 查询出所有不包括 删除、报废的营运车辆 List<PageData> allOperatingVehicleList = operatingVehiclesService.getPulldownVehicleList(pd); // 查询出所有不包括 删除、报废的营运车辆
List<PageData> allAssignedList = assignedManageService.assignedList(corpId); // 所有过户的车辆 List<PageData> allAssignedList = assignedManageService.assignedList(corpId); // 所有过户的车辆
List<PageData> varList = new ArrayList<>(); List<PageData> varList = new ArrayList<>();
if(!CollectionUtil.isEmpty(allAssignedList)) { if (!CollectionUtils.isEmpty(allAssignedList)) {
varList = allOperatingVehicleList.stream().filter(operating -> { varList = allOperatingVehicleList.stream().parallel()
for (PageData assigned : allAssignedList) { .filter(operating -> allAssignedList.stream()
if(!StringUtils.equals(operating.getString("OPERATING_ID"),assigned.getString("RAW_PLATE_NUMBER"))) { .noneMatch(assigned -> StringUtils.equals(operating.getString("OPERATING_ID"), assigned.getString("RAW_PLATE_NUMBER"))))
return true; .collect(Collectors.toList());
} } else {
}
return false;
}).collect(Collectors.toList());
}else{
varList = allOperatingVehicleList; varList = allOperatingVehicleList;
} }
map.put("varList", varList); map.put("varList", varList);
@ -286,19 +272,17 @@ public class AssignedManageController extends BaseController {
String corpId = Jurisdiction.getCORPINFO_ID(); String corpId = Jurisdiction.getCORPINFO_ID();
List<PageData> freightList = freightTrailerService.getPulldownVehicleList(corpId); List<PageData> freightList = freightTrailerService.getPulldownVehicleList(corpId);
List<PageData> assignedList = assignedManageService.assignedList(corpId); List<PageData> assignedList = assignedManageService.assignedList(corpId);
List<PageData> varList = new ArrayList<>(); List<PageData> varList = new ArrayList<>();
if(!CollectionUtils.isEmpty(assignedList)) { if (!CollectionUtils.isEmpty(assignedList)) {
varList = freightList.stream().filter(freight -> { varList = freightList.stream().parallel()
for (PageData assigned : assignedList) { .filter(freight -> assignedList.stream()
if(!StringUtils.equals(freight.getString("FREIGHTTRAILER_ID"),assigned.getString("RAW_PLATE_NUMBER"))) { .noneMatch(assigned -> StringUtils.equals(freight.getString("FREIGHTTRAILER_ID"), assigned.getString("RAW_PLATE_NUMBER"))))
return true; .collect(Collectors.toList());
} } else {
}
return false;
}).collect(Collectors.toList());
}else {
varList = freightList; varList = freightList;
} }
map.put("varList", varList); map.put("varList", varList);
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;

View File

@ -232,30 +232,30 @@ public class TrafficSecurityWaybillRegistrationController extends BaseController
PageData contactInfo = trafficSecurityCustomerManagementService.findByContactName(pd2); PageData contactInfo = trafficSecurityCustomerManagementService.findByContactName(pd2);
if(!ObjectUtil.isEmpty(contactInfo)) { if(!ObjectUtil.isEmpty(contactInfo)) {
pd.put("ENTRUST_PERSON", contactInfo.getString("CONTACT_ID")); pd.put("ENTRUST_PERSON", contactInfo.getString("CONTACT_ID"));
} if(!contactInfo.getString("CONTACTPHONE").equals(pd.getString("CLIENTCONTACTPHONE"))) {
if(!contactInfo.getString("CONTACTPHONE").equals(pd.getString("CLIENTCONTACTPHONE"))) { PageData entrust = new PageData();
PageData entrust = new PageData(); entrust.put("CONTACTPHONE", pd.getString("CLIENTCONTACTPHONE"));
entrust.put("CONTACTPHONE", pd.getString("CLIENTCONTACTPHONE")); entrust.put("CUSTOMERCONTACT_ID",contactInfo.getString("CUSTOMERCONTACT_ID"));
entrust.put("CUSTOMERCONTACT_ID",contactInfo.getString("CUSTOMERCONTACT_ID")); entrust.put("OPERATOR", Jurisdiction.getUSER_ID()); // 修改人id
entrust.put("OPERATOR", Jurisdiction.getUSER_ID()); // 修改人id entrust.put("OPERATORNAME", Jurisdiction.getName()); // 修改人姓名
entrust.put("OPERATORNAME", Jurisdiction.getName()); // 修改人姓名 entrust.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间
entrust.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 trafficSecurityCustomerManagementService.editContactPhone(entrust);
trafficSecurityCustomerManagementService.editContactPhone(entrust); }
} }
PageData pd3 = new PageData(); PageData pd3 = new PageData();
pd3.put("CONTACT", pd.getString("CONFIRM_PERSON")); pd3.put("CONTACT", pd.getString("CONFIRM_PERSON"));
PageData pageData = trafficSecurityCustomerManagementService.findByContactName(pd3); PageData pageData = trafficSecurityCustomerManagementService.findByContactName(pd3);
if(!ObjectUtil.isEmpty(pageData)) { if(!ObjectUtil.isEmpty(pageData)) {
pd.put("CONFIRM_PERSON", pageData.getString("CONTACT_ID")); pd.put("CONFIRM_PERSON", pageData.getString("CONTACT_ID"));
} if(!pd.getString("CONFIRMINGPHONE").equals(pageData.getString("CONTACTPHONE"))) {
if(!pageData.getString("CONTACTPHONE").equals(pd.getString("CONFIRMINGPHONE"))) { PageData entrust = new PageData();
PageData entrust = new PageData(); entrust.put("CONTACTPHONE", pd.getString("CONFIRMINGPHONE"));
entrust.put("CONTACTPHONE", pd.getString("CONFIRMINGPHONE")); entrust.put("CUSTOMERCONTACT_ID",pageData.getString("CUSTOMERCONTACT_ID"));
entrust.put("CUSTOMERCONTACT_ID",pageData.getString("CUSTOMERCONTACT_ID")); entrust.put("OPERATOR", Jurisdiction.getUSER_ID()); // 修改人id
entrust.put("OPERATOR", Jurisdiction.getUSER_ID()); // 修改人id entrust.put("OPERATORNAME", Jurisdiction.getName()); // 修改人姓名
entrust.put("OPERATORNAME", Jurisdiction.getName()); // 修改人姓名 entrust.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间
entrust.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 trafficSecurityCustomerManagementService.editContactPhone(entrust);
trafficSecurityCustomerManagementService.editContactPhone(entrust); }
} }
trafficSecurityWaybillRegistrationService.edit(pd); trafficSecurityWaybillRegistrationService.edit(pd);

View File

@ -14,6 +14,7 @@ import com.zcloud.service.taxationManage.TaxationManageService;
import com.zcloud.util.*; import com.zcloud.util.*;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.shiro.util.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -540,13 +541,27 @@ public class FreighttTrailerController extends BaseController {
List<PageData> operatingList = operatingVehiclesService.operationVehicleList(pd.getString("CORPINFO_ID")); List<PageData> operatingList = operatingVehiclesService.operationVehicleList(pd.getString("CORPINFO_ID"));
page.setPd(pd); page.setPd(pd);
List<PageData> insAnnually = inspectAnnuallyService.annuallyList(page); List<PageData> insAnnually = inspectAnnuallyService.annuallyList(page);
for (int i = 0; i < insAnnually.size(); i++) {
// 获取所有的营运车辆
List<PageData> operatings = insAnnually.stream().filter(data -> StringUtils.equals("1",data.getString("VEHICLE_MODEL")))
.collect(Collectors.toList());
// 过滤掉年检车辆中已经存在的营运车辆
List<PageData> 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++) { for (int j = 0; j < operatingList.size(); j++) {
if(operatingList.get(j).get("OPERATING_ID").equals(insAnnually.get(i).get("VEHICLE"))) { if(operatingList.get(j).get("OPERATING_ID").equals(insAnnually.get(i).get("VEHICLE"))) {
operatingList.remove(j); operatingList.remove(j);
} }
} }
} }*/
if(pd.containsKey("ID")){ if(pd.containsKey("ID")){
pd.put("OPERATING_ID", pd.getString("ID")); pd.put("OPERATING_ID", pd.getString("ID"));
pd.put("FOREIGN_KEY", pd.getString("OPERATING_ID")); pd.put("FOREIGN_KEY", pd.getString("OPERATING_ID"));
@ -554,10 +569,10 @@ public class FreighttTrailerController extends BaseController {
List<PageData> drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片 List<PageData> drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片
map.put("drivingLicenseImgs", drivingLicenseImgs); map.put("drivingLicenseImgs", drivingLicenseImgs);
} }
operatingList.forEach(operating -> { varList.forEach(operating -> {
operating.put("ID", operating.getString("OPERATING_ID")); operating.put("ID", operating.getString("OPERATING_ID"));
}); });
map.put("list", operatingList); map.put("list", varList);
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }
@ -566,13 +581,28 @@ public class FreighttTrailerController extends BaseController {
List<PageData> freightList = freightTrailerService.trailerList(pd.getString("CORPINFO_ID")); List<PageData> freightList = freightTrailerService.trailerList(pd.getString("CORPINFO_ID"));
page.setPd(pd); page.setPd(pd);
List<PageData> insAnnually = inspectAnnuallyService.annuallyList(page); List<PageData> insAnnually = inspectAnnuallyService.annuallyList(page);
for (int i = 0; i < insAnnually.size(); i++) {
// 获取所有的货运挂车
List<PageData> freights = insAnnually.stream().filter(data -> "2".equals(data.getString("VEHICLE_MODEL")))
.collect(Collectors.toList());
// 过滤掉年检列表中的所有货运挂车信息
List<PageData> 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++) { for (int j = 0; j < freightList.size(); j++) {
if(freightList.get(j).get("FREIGHTTRAILER_ID").equals(insAnnually.get(i).get("VEHICLE"))) { if(freightList.get(j).get("FREIGHTTRAILER_ID").equals(insAnnually.get(i).get("VEHICLE"))) {
freightList.remove(j); freightList.remove(j);
} }
} }
} }*/
if(pd.containsKey("ID")){ if(pd.containsKey("ID")){
pd.put("FREIGHTTRAILER_ID", pd.getString("ID")); pd.put("FREIGHTTRAILER_ID", pd.getString("ID"));
pd.put("FOREIGN_KEY", pd.getString("FREIGHTTRAILER_ID")); pd.put("FOREIGN_KEY", pd.getString("FREIGHTTRAILER_ID"));
@ -580,10 +610,10 @@ public class FreighttTrailerController extends BaseController {
List<PageData> drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片 List<PageData> drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片
map.put("drivingLicenseImgs", drivingLicenseImgs); map.put("drivingLicenseImgs", drivingLicenseImgs);
} }
freightList.forEach(freight -> { varList.forEach(freight -> {
freight.put("ID", freight.getString("FREIGHTTRAILER_ID")); freight.put("ID", freight.getString("FREIGHTTRAILER_ID"));
}); });
map.put("list", freightList); map.put("list", varList);
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }

View File

@ -64,7 +64,7 @@ public class InspectAnnuallyController extends BaseController {
pd.put("ISDELETE", "0"); //是否删除(0:有效 1删除) pd.put("ISDELETE", "0"); //是否删除(0:有效 1删除)
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
pd.put("ARCHIVES_TYPE", "0"); //档案状态 pd.put("ARCHIVES_TYPE", "0"); //档案状态
pd.put("VEHICLE",pd.get("PLATE_NUMBER")); pd.put("VEHICLE", pd.get("PLATE_NUMBER"));
inspectAnnuallyService.save(pd); inspectAnnuallyService.save(pd);
map.put("pd", pd); map.put("pd", pd);
map.put("result", errInfo); map.put("result", errInfo);
@ -192,7 +192,7 @@ public class InspectAnnuallyController extends BaseController {
pd = this.getPageData(); pd = this.getPageData();
pd = inspectAnnuallyService.findById(pd); //根据ID读取 pd = inspectAnnuallyService.findById(pd); //根据ID读取
if("1".equals(pd.getString("VEHICLE_MODEL"))) { if ("1".equals(pd.getString("VEHICLE_MODEL"))) {
PageData opearting = new PageData(); PageData opearting = new PageData();
opearting.put("OPERATING_ID", pd.get("VEHICLE")); opearting.put("OPERATING_ID", pd.get("VEHICLE"));
opearting.put("CORPINFO_ID", pd.get("CORPINFO_ID")); 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_BRAND", pageData.get("VEHICLE_BRAND"));
pd.put("VEHICLE_TYPE", pageData.get("VEHICLE_MODEL")); pd.put("VEHICLE_TYPE", pageData.get("VEHICLE_MODEL"));
pd.put("PLATE_NUMBER", pageData.get("PLATE_NUMBER")); pd.put("PLATE_NUMBER", pageData.get("PLATE_NUMBER"));
}else{ } else {
PageData freight = new PageData(); PageData freight = new PageData();
freight.put("FREIGHTTRAILER_ID", pd.get("VEHICLE")); freight.put("FREIGHTTRAILER_ID", pd.get("VEHICLE"));
freight.put("CORPINFO_ID", pd.get("CORPINFO_ID")); 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("FOREIGN_KEY", pd.getString("INSPECTANNUALLY_ID"));
pd.put("TYPE",124); pd.put("TYPE", 124);
List<PageData> inspectinfoImgs = imgfilesService.listAll(pd);//年检资料图片 List<PageData> inspectinfoImgs = imgfilesService.listAll(pd);//年检资料图片
map.put("pd", pd); map.put("pd", pd);
@ -239,44 +239,46 @@ public class InspectAnnuallyController extends BaseController {
} }
/**excel /**
* excel
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@RequestMapping(value="/excel") @RequestMapping(value = "/excel")
// // @RequiresPermissions("toExcel") // // @RequiresPermissions("toExcel")
public ModelAndView exportExcel() throws Exception{ public ModelAndView exportExcel() throws Exception {
ModelAndView mv = new ModelAndView(); ModelAndView mv = new ModelAndView();
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
String DATA_IDS = pd.getString("DATA_IDS"); String DATA_IDS = pd.getString("DATA_IDS");
if(Tools.notEmpty(DATA_IDS)){ if (Tools.notEmpty(DATA_IDS)) {
String[] ArrayDATA_IDS = DATA_IDS.split(","); String[] ArrayDATA_IDS = DATA_IDS.split(",");
pd.put("ArrayDATA_IDS",ArrayDATA_IDS); pd.put("ArrayDATA_IDS", ArrayDATA_IDS);
} }
Map<String,Object> dataMap = new HashMap<String,Object>(); Map<String, Object> dataMap = new HashMap<String, Object>();
List<String> titles = new ArrayList<String>(); List<String> titles = new ArrayList<String>();
titles.add("自编号"); //1 titles.add("自编号"); //1
titles.add("年检车辆"); //2 titles.add("年检车辆"); //2
titles.add("车辆品牌"); //3 titles.add("车辆品牌"); //3
titles.add("年检车型"); //4 titles.add("年检车型"); //4
titles.add("车主业户"); //5 titles.add("车主业户"); //5
titles.add("联系电话"); //6 titles.add("联系电话"); //6
titles.add("登记人"); //7 titles.add("登记人"); //7
titles.add("办理日期"); //8 titles.add("办理日期"); //8
titles.add("年检周期"); //9 titles.add("年检周期"); //9
titles.add("到期日期"); //10 titles.add("到期日期"); //10
titles.add("年检费用"); //11 titles.add("年检费用"); //11
titles.add("实收费用"); //12 titles.add("实收费用"); //12
titles.add("年检地址"); //13 titles.add("年检地址"); //13
titles.add("提醒天数"); //14 titles.add("提醒天数"); //14
titles.add("提醒日期"); //15 titles.add("提醒日期"); //15
titles.add("年检资料"); //16 titles.add("年检资料"); //16
titles.add("备注"); //17 titles.add("备注"); //17
dataMap.put("titles", titles); dataMap.put("titles", titles);
List<PageData> varOList = inspectAnnuallyService.listOut(pd); List<PageData> varOList = inspectAnnuallyService.listOut(pd);
List<PageData> varList = new ArrayList<PageData>(); List<PageData> varList = new ArrayList<PageData>();
for(int i=0;i<varOList.size();i++){ for (int i = 0; i < varOList.size(); i++) {
PageData vpd = new PageData(); PageData vpd = new PageData();
vpd.put("var1", varOList.get(i).getString("NUM"));//1 vpd.put("var1", varOList.get(i).getString("NUM"));//1
vpd.put("var2", varOList.get(i).getString("VEHICLE"));//2 vpd.put("var2", varOList.get(i).getString("VEHICLE"));//2
@ -299,10 +301,9 @@ public class InspectAnnuallyController extends BaseController {
} }
dataMap.put("varList", varList); dataMap.put("varList", varList);
ObjectExcelView erv = new ObjectExcelView(); ObjectExcelView erv = new ObjectExcelView();
mv = new ModelAndView(erv,dataMap); mv = new ModelAndView(erv, dataMap);
return mv; return mv;
} }
} }

View File

@ -12,15 +12,14 @@ import com.zcloud.service.system.ImgFilesService;
import com.zcloud.util.DateUtil; import com.zcloud.util.DateUtil;
import com.zcloud.util.Jurisdiction; import com.zcloud.util.Jurisdiction;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.shiro.util.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Date; import java.util.*;
import java.util.HashMap; import java.util.stream.Collectors;
import java.util.List;
import java.util.Map;
/** /**
* *
@ -178,13 +177,13 @@ public class InsureController extends BaseController {
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
pd = insureService.findById(pd); //根据ID读取 pd = insureService.findById(pd); //根据ID读取
if("1".equals(pd.getString("VEHICLE_MODEL"))) { if ("1".equals(pd.getString("VEHICLE_MODEL"))) {
PageData operation = new PageData(); PageData operation = new PageData();
operation.put("OPERATING_ID", pd.getString("VEHICLE")); operation.put("OPERATING_ID", pd.getString("VEHICLE"));
operation.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); operation.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
PageData operationInfo = operatingVehiclesService.findById(operation); PageData operationInfo = operatingVehiclesService.findById(operation);
pd.put("PLATE_NUMBER", operationInfo.getString("PLATE_NUMBER")); pd.put("PLATE_NUMBER", operationInfo.getString("PLATE_NUMBER"));
}else { } else {
PageData trailer = new PageData(); PageData trailer = new PageData();
trailer.put("FREIGHTTRAILER_ID", pd.getString("VEHICLE")); trailer.put("FREIGHTTRAILER_ID", pd.getString("VEHICLE"));
trailer.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); trailer.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
@ -192,9 +191,9 @@ public class InsureController extends BaseController {
pd.put("PLATE_NUMBER", operationInfo.getString("PLATE_NUMBER")); pd.put("PLATE_NUMBER", operationInfo.getString("PLATE_NUMBER"));
} }
pd.put("FOREIGN_KEY", pd.getString("INSURE_ID")); pd.put("FOREIGN_KEY", pd.getString("INSURE_ID"));
pd.put("TYPE",125); pd.put("TYPE", 125);
List<PageData> insureinfoImgs = imgfilesService.listAll(pd);//保险资料图片 List<PageData> insureinfoImgs = imgfilesService.listAll(pd);//保险资料图片
pd.put("TYPE",129); pd.put("TYPE", 129);
List<PageData> attachmentUploadImgs = imgfilesService.listAll(pd);//保险附件上传 List<PageData> attachmentUploadImgs = imgfilesService.listAll(pd);//保险附件上传
map.put("pd", pd); map.put("pd", pd);
@ -211,64 +210,83 @@ public class InsureController extends BaseController {
String errInfo = "success"; String errInfo = "success";
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
pd.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID()); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
if(!StringUtils.isEmpty(pd.getString("TRAFFIC_TYPE")) && pd.getString("TRAFFIC_TYPE").equals("1")) { if (!StringUtils.isEmpty(pd.getString("TRAFFIC_TYPE")) && pd.getString("TRAFFIC_TYPE").equals("1")) {
// 营运车辆 // 营运车辆
List<PageData> operatingList = operatingVehiclesService.operationVehicleList(pd.getString("CORPINFO_ID")); List<PageData> operatingList = operatingVehiclesService.operationVehicleList(pd.getString("CORPINFO_ID"));
page.setPd(pd); page.setPd(pd);
List<PageData> insAnnually = insureService.list(page); List<PageData> 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"))) { List<PageData> insures = insAnnually.stream()
operatingList.remove(j); .filter(data -> StringUtils.equals(data.getString("VEHICLE_MODEL"), "1"))
} .collect(Collectors.toList());
}
// 过滤掉保险列表中所有的营运车辆
List<PageData> 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("OPERATING_ID", pd.getString("ID"));
pd.put("FOREIGN_KEY", pd.getString("OPERATING_ID")); pd.put("FOREIGN_KEY", pd.getString("OPERATING_ID"));
pd.put("TYPE",121); pd.put("TYPE", 121);
List<PageData> drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片 List<PageData> drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片
map.put("drivingLicenseImgs", drivingLicenseImgs); map.put("drivingLicenseImgs", drivingLicenseImgs);
} }
operatingList.forEach(operating -> { varList.forEach(operating -> {
operating.put("ID", operating.getString("OPERATING_ID")); operating.put("ID", operating.getString("OPERATING_ID"));
}); });
map.put("list", operatingList); map.put("list", varList);
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }
if("2".equals(pd.getString("TRAFFIC_TYPE"))) { if ("2".equals(pd.getString("TRAFFIC_TYPE"))) {
// 货运挂车 // 货运挂车
List<PageData> freightList = freightTrailerService.trailerList(pd.getString("CORPINFO_ID")); List<PageData> freightList = freightTrailerService.trailerList(pd.getString("CORPINFO_ID"));
page.setPd(pd); page.setPd(pd);
List<PageData> insAnnually = insureService.list(page); List<PageData> insureList = 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"))) { List<PageData> insures = insureList.stream().filter(data -> StringUtils.equals(data.getString("VEHICLE_MODEL"), "2"))
freightList.remove(j); .collect(Collectors.toList());
}
} // 过滤掉保险列表中所有已存在的挂车
List<PageData> 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("FREIGHTTRAILER_ID", pd.getString("ID"));
pd.put("FOREIGN_KEY", pd.getString("FREIGHTTRAILER_ID")); pd.put("FOREIGN_KEY", pd.getString("FREIGHTTRAILER_ID"));
pd.put("TYPE",121); pd.put("TYPE", 121);
List<PageData> drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片 List<PageData> drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片
map.put("drivingLicenseImgs", drivingLicenseImgs); map.put("drivingLicenseImgs", drivingLicenseImgs);
} }
freightList.forEach(freight -> { varList.forEach(freight -> {
freight.put("ID", freight.getString("FREIGHTTRAILER_ID")); freight.put("ID", freight.getString("FREIGHTTRAILER_ID"));
}); });
map.put("list", freightList); map.put("list", varList);
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }
List<PageData> resData = freightTrailerService.vehicleList(pd); List<PageData> resData = freightTrailerService.vehicleList(pd);
if(pd.containsKey("ID")){ if (pd.containsKey("ID")) {
pd.put("FOREIGN_KEY", pd.getString("ID")); pd.put("FOREIGN_KEY", pd.getString("ID"));
pd.put("TYPE",121); pd.put("TYPE", 121);
List<PageData> drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片 List<PageData> drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片
map.put("drivingLicenseImgs", drivingLicenseImgs); map.put("drivingLicenseImgs", drivingLicenseImgs);
} }

View File

@ -11,15 +11,14 @@ import com.zcloud.service.system.ImgFilesService;
import com.zcloud.util.DateUtil; import com.zcloud.util.DateUtil;
import com.zcloud.util.Jurisdiction; import com.zcloud.util.Jurisdiction;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.shiro.util.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Date; import java.util.*;
import java.util.HashMap; import java.util.stream.Collectors;
import java.util.List;
import java.util.Map;
/** /**
* *
@ -158,11 +157,11 @@ public class MaintenanceController extends BaseController {
page.setPd(pd); page.setPd(pd);
List<PageData> varList = maintenanceService.list(page); //列出Question列表 List<PageData> varList = maintenanceService.list(page); //列出Question列表
for (PageData operation : varList) { 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"); 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"); operation.put("ARCHIVES_TYPE", "1");
}else{ } else {
operation.put("ARCHIVES_TYPE", "0"); operation.put("ARCHIVES_TYPE", "0");
} }
} }
@ -190,7 +189,7 @@ public class MaintenanceController extends BaseController {
pd = maintenanceService.findById(pd); //根据ID读取 pd = maintenanceService.findById(pd); //根据ID读取
pd.put("FOREIGN_KEY", pd.getString("MAINTENANCE_ID")); pd.put("FOREIGN_KEY", pd.getString("MAINTENANCE_ID"));
pd.put("TYPE",127); pd.put("TYPE", 127);
List<PageData> maintenanceinfoImgs = imgfilesService.listAll(pd);//维保资料图片 List<PageData> maintenanceinfoImgs = imgfilesService.listAll(pd);//维保资料图片
map.put("pd", pd); map.put("pd", pd);
map.put("maintenanceinfoImgs", maintenanceinfoImgs); map.put("maintenanceinfoImgs", maintenanceinfoImgs);
@ -205,68 +204,32 @@ public class MaintenanceController extends BaseController {
String errInfo = "success"; String errInfo = "success";
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
pd.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID()); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
if(!StringUtils.isEmpty(pd.getString("TRAFFIC_TYPE")) && pd.getString("TRAFFIC_TYPE").equals("1")) { // 营运车辆
// 营运车辆 List<PageData> operatingList = operatingVehiclesService.operationVehicleList(pd.getString("CORPINFO_ID"));
List<PageData> operatingList = operatingVehiclesService.operationVehicleList(pd.getString("CORPINFO_ID")); page.setPd(pd);
page.setPd(pd); List<PageData> maintenanceList = maintenanceService.list(page);
List<PageData> 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<PageData> 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<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); List<PageData> varList = new ArrayList<>();
if(pd.containsKey("ID")){ if (!CollectionUtils.isEmpty(maintenanceList)) {
pd.put("FOREIGN_KEY", pd.getString("ID")); varList = operatingList.stream().parallel()
pd.put("TYPE",121); .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);//行驶证照片 List<PageData> drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片
map.put("drivingLicenseImgs", drivingLicenseImgs); 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); map.put("result", errInfo);
return map; return map;
} }

View File

@ -61,7 +61,7 @@ public class OperatingVehiclesController extends BaseController {
pd.put("OPERATING_ID", this.get32UUID()); //运营车辆主键 pd.put("OPERATING_ID", this.get32UUID()); //运营车辆主键
pd.put("ISDELETE", "0"); //是否删除(0:有效 1删除) pd.put("ISDELETE", "0"); //是否删除(0:有效 1删除)
pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id 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("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
pd.put("NETWORK_STATUS", "未入网"); pd.put("NETWORK_STATUS", "未入网");

View File

@ -11,15 +11,14 @@ import com.zcloud.service.system.ImgFilesService;
import com.zcloud.util.DateUtil; import com.zcloud.util.DateUtil;
import com.zcloud.util.Jurisdiction; import com.zcloud.util.Jurisdiction;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.shiro.util.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Date; import java.util.*;
import java.util.HashMap; import java.util.stream.Collectors;
import java.util.List;
import java.util.Map;
/** /**
* *
@ -217,14 +216,23 @@ public class OperationsController extends BaseController {
// 营运车辆 // 营运车辆
List<PageData> operatingList = operatingVehiclesService.operationVehicleList(pd.getString("CORPINFO_ID")); List<PageData> operatingList = operatingVehiclesService.operationVehicleList(pd.getString("CORPINFO_ID"));
page.setPd(pd); page.setPd(pd);
List<PageData> insAnnually = operationsService.list(page); List<PageData> operationsList = 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"))) { List<PageData> operations = operationsList.stream().filter(data -> StringUtils.equals(data.getString("VEHICLE_MODEL"), "1"))
operatingList.remove(j); .collect(Collectors.toList());
}
} // 过滤掉营运管理列表中所有营运车辆信息
List<PageData> 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")){ if(pd.containsKey("ID")){
pd.put("OPERATING_ID", pd.getString("ID")); pd.put("OPERATING_ID", pd.getString("ID"));
pd.put("FOREIGN_KEY", pd.getString("OPERATING_ID")); pd.put("FOREIGN_KEY", pd.getString("OPERATING_ID"));
@ -232,10 +240,10 @@ public class OperationsController extends BaseController {
List<PageData> drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片 List<PageData> drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片
map.put("drivingLicenseImgs", drivingLicenseImgs); map.put("drivingLicenseImgs", drivingLicenseImgs);
} }
operatingList.forEach(operating -> { varList.forEach(operating -> {
operating.put("ID", operating.getString("OPERATING_ID")); operating.put("ID", operating.getString("OPERATING_ID"));
}); });
map.put("list", operatingList); map.put("list", varList);
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }
@ -243,14 +251,23 @@ public class OperationsController extends BaseController {
// 货运挂车 // 货运挂车
List<PageData> freightList = freightTrailerService.trailerList(pd.getString("CORPINFO_ID")); List<PageData> freightList = freightTrailerService.trailerList(pd.getString("CORPINFO_ID"));
page.setPd(pd); page.setPd(pd);
List<PageData> insAnnually = operationsService.list(page); List<PageData> operationsList = 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"))) { List<PageData> operations = operationsList.stream()
freightList.remove(j); .filter(data -> StringUtils.equals(data.getString("VEHICLE_MODEL"), "2"))
} .collect(Collectors.toList());
}
List<PageData> 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")){ if(pd.containsKey("ID")){
pd.put("FREIGHTTRAILER_ID", pd.getString("ID")); pd.put("FREIGHTTRAILER_ID", pd.getString("ID"));
pd.put("FOREIGN_KEY", pd.getString("FREIGHTTRAILER_ID")); pd.put("FOREIGN_KEY", pd.getString("FREIGHTTRAILER_ID"));
@ -258,10 +275,10 @@ public class OperationsController extends BaseController {
List<PageData> drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片 List<PageData> drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片
map.put("drivingLicenseImgs", drivingLicenseImgs); map.put("drivingLicenseImgs", drivingLicenseImgs);
} }
freightList.forEach(freight -> { varList.forEach(freight -> {
freight.put("ID", freight.getString("FREIGHTTRAILER_ID")); freight.put("ID", freight.getString("FREIGHTTRAILER_ID"));
}); });
map.put("list", freightList); map.put("list", varList);
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }

View File

@ -212,11 +212,20 @@ public class ScrapManageController extends BaseController {
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
List<PageData> operationList = operatingVehiclesService.getScrapPulldownVehicleList(pd); //列出Question列表 List<PageData> operationList = operatingVehiclesService.getScrapPulldownVehicleList(pd); //列出Question列表
List<PageData> scrapList = scrapManageService.scrapListAll(corpId); List<PageData> scrapList = scrapManageService.scrapListAll(corpId);
List<PageData> varList = new ArrayList<>(); List<PageData> varList = new ArrayList<>();
if(!CollectionUtils.isEmpty(scrapList)) { 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 -> { varList = operationList.stream().filter(operation -> {
for (PageData scrap : scrapList) { 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; return true;
} }
} }
@ -224,7 +233,7 @@ public class ScrapManageController extends BaseController {
}).collect(Collectors.toList()); }).collect(Collectors.toList());
}else { }else {
varList = operationList; varList = operationList;
} }*/
map.put("varList", varList); map.put("varList", varList);
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
@ -238,16 +247,13 @@ public class ScrapManageController extends BaseController {
String corpId = Jurisdiction.getCORPINFO_ID(); String corpId = Jurisdiction.getCORPINFO_ID();
List<PageData> freightList = freightTrailerService.getScrapPulldownVehicleList(corpId); List<PageData> freightList = freightTrailerService.getScrapPulldownVehicleList(corpId);
List<PageData> scrapList = scrapManageService.scrapListAll(corpId); List<PageData> scrapList = scrapManageService.scrapListAll(corpId);
List<PageData> varList = new ArrayList<>(); List<PageData> varList = new ArrayList<>();
if(!CollectionUtils.isEmpty(scrapList)) { if(!CollectionUtils.isEmpty(scrapList)) {
varList = freightList.stream().filter(freight -> { varList = freightList.stream().parallel()
for (PageData scrap : scrapList) { .filter(freight -> scrapList.stream()
if(StringUtils.equals(freight.getString("PLATE_NUMBER"),scrap.getString("PLATE_NUMBER"))){ .noneMatch(scrap -> StringUtils.equals(freight.getString("PLATE_NUMBER"), scrap.getString("PLATE_NUMBER"))))
return true; .collect(Collectors.toList());
}
}
return false;
}).collect(Collectors.toList());
}else{ }else{
varList = freightList; varList = freightList;
} }

View File

@ -41,31 +41,33 @@ public class TaxationManageController extends BaseController {
@Autowired @Autowired
private FreightTrailerService freightTrailerService; private FreightTrailerService freightTrailerService;
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@RequestMapping(value="/add") @RequestMapping(value = "/add")
@ResponseBody @ResponseBody
public Object add() throws Exception{ public Object add() throws Exception {
Map<String,Object> map = new HashMap<String,Object>(); Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success"; String errInfo = "success";
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
pd.put("TAXATION_ID", this.get32UUID()); //车船税主键 pd.put("TAXATION_ID", this.get32UUID()); //车船税主键
pd.put("ISDELETE", "0"); //是否删除(0:有效 1删除) pd.put("ISDELETE", "0"); //是否删除(0:有效 1删除)
pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id
pd.put("CREATORNAME", Jurisdiction.getName()); //添加人名字 pd.put("CREATORNAME", Jurisdiction.getName()); //添加人名字
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
pd.put("ARCHIVES_TYPE", "0"); //档案状态 pd.put("ARCHIVES_TYPE", "0"); //档案状态
if("".equals(pd.getString("EXPIRE_STATUS"))) { if ("".equals(pd.getString("EXPIRE_STATUS"))) {
String expireDate = pd.getString("EXPIRE_DATE"); String expireDate = pd.getString("EXPIRE_DATE");
String day = DateUtil.getDay(); String day = DateUtil.getDay();
boolean flag = DateUtil.compareDate(expireDate, day); boolean flag = DateUtil.compareDate(expireDate, day);
if(flag) { if (flag) {
pd.put("EXPIRE_STATUS","1"); pd.put("EXPIRE_STATUS", "1");
}else{ } else {
pd.put("EXPIRE_STATUS","0"); pd.put("EXPIRE_STATUS", "0");
} }
} }
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
@ -75,14 +77,16 @@ public class TaxationManageController extends BaseController {
return map; return map;
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@RequestMapping(value="/delete") @RequestMapping(value = "/delete")
@ResponseBody @ResponseBody
public Object delete() throws Exception{ public Object delete() throws Exception {
Map<String,String> map = new HashMap<String,String>(); Map<String, String> map = new HashMap<String, String>();
String errInfo = "success"; String errInfo = "success";
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
@ -90,46 +94,51 @@ public class TaxationManageController extends BaseController {
pd.put("DELETORNAME", Jurisdiction.getName()); pd.put("DELETORNAME", Jurisdiction.getName());
pd.put("DELETTIME", DateUtil.date2Str(new Date())); pd.put("DELETTIME", DateUtil.date2Str(new Date()));
taxationManageService.delete(pd); taxationManageService.delete(pd);
map.put("result", errInfo); //返回结果 map.put("result", errInfo); //返回结果
return map; return map;
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@RequestMapping(value="/edit") @RequestMapping(value = "/edit")
@ResponseBody @ResponseBody
public Object edit() throws Exception{ public Object edit() throws Exception {
Map<String,Object> map = new HashMap<String,Object>(); Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success"; String errInfo = "success";
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
pd.put("ISDELETE", "0"); //是否删除(0:有效 1删除) pd.put("ISDELETE", "0"); //是否删除(0:有效 1删除)
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id
pd.put("OPERATORNAME", Jurisdiction.getName()); // 修改人名字 pd.put("OPERATORNAME", Jurisdiction.getName()); // 修改人名字
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间
String expireDate = pd.getString("EXPIRE_DATE"); String expireDate = pd.getString("EXPIRE_DATE");
String day = DateUtil.getDay(); String day = DateUtil.getDay();
boolean flag = DateUtil.compareDate(expireDate, day); boolean flag = DateUtil.compareDate(expireDate, day);
if(flag) { if (flag) {
pd.put("EXPIRE_STATUS","1"); pd.put("EXPIRE_STATUS", "1");
}else{ } else {
pd.put("EXPIRE_STATUS","0"); pd.put("EXPIRE_STATUS", "0");
} }
taxationManageService.edit(pd); taxationManageService.edit(pd);
map.put("pd", pd); map.put("pd", pd);
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }
/**
/**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@RequestMapping(value="/goEdit") @RequestMapping(value = "/goEdit")
@ResponseBody @ResponseBody
public Object goEdit() throws Exception{ public Object goEdit() throws Exception {
Map<String,Object> map = new HashMap<String,Object>(); Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success"; String errInfo = "success";
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
@ -139,20 +148,20 @@ public class TaxationManageController extends BaseController {
return map; return map;
} }
@RequestMapping(value="/list") @RequestMapping(value = "/list")
@ResponseBody @ResponseBody
public Object list(Page page) throws Exception{ public Object list(Page page) throws Exception {
Map<String,Object> map = new HashMap<String,Object>(); Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success"; String errInfo = "success";
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
page.setPd(pd); page.setPd(pd);
List<PageData> taxationList = taxationManageService.list(page); //列出MajorDangerSource列表 List<PageData> taxationList = taxationManageService.list(page); //列出MajorDangerSource列表
taxationList.forEach(taxation -> { taxationList.forEach(taxation -> {
if("1".equals(taxation.get("ISSCRAP"))) { if ("1".equals(taxation.get("ISSCRAP"))) {
taxation.put("ARCHIVES_TYPE", "1"); taxation.put("ARCHIVES_TYPE", "1");
} else if ("1".equals(taxation.get("ISASSIGNED"))) { } else if ("1".equals(taxation.get("ISASSIGNED"))) {
taxation.put("ARCHIVES_TYPE", "2"); taxation.put("ARCHIVES_TYPE", "2");
@ -185,23 +194,19 @@ public class TaxationManageController extends BaseController {
pd = this.getPageData(); pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
page.setPd(pd); page.setPd(pd);
List<PageData> varList = freightTrailerService.list(page); // 列出所有挂车列表 List<PageData> freightTrailerList = freightTrailerService.list(page); // 列出所有挂车列表
List<PageData> taxationList = taxationManageService.taxationList(pd.getString("CORPINFO_ID")); // 列出车船税列表 List<PageData> taxationList = taxationManageService.taxationList(pd.getString("CORPINFO_ID")); // 列出车船税列表
List<PageData> pageDataStream = new ArrayList<>();
if(!CollectionUtils.isEmpty(taxationList)) { List<PageData> varList = new ArrayList<>();
pageDataStream = varList.stream().filter(trailer -> { // 去除车船税类表中已有的车辆 if (!CollectionUtils.isEmpty(taxationList)) {
for (PageData taxation : taxationList) { varList = freightTrailerList.stream().parallel()
if (!StringUtils.equals(taxation.getString("PLATE_NUMBER"), trailer.getString("PLATE_NUMBER"))) { .filter(freight -> taxationList.stream()
return true; .noneMatch(taxation -> StringUtils.equals(freight.getString("PLATE_NUMBER"), taxation.getString("PLATE_NUMBER"))))
} .collect(Collectors.toList());
}
return false;
}).collect(Collectors.toList());
}else{
pageDataStream = varList;
} }
// 过滤掉车船税下拉列表中已报废的车辆信息 // 过滤掉车船税下拉列表中已报废的车辆信息
List<PageData> choiceTrailerList = pageDataStream.stream().filter(data -> !"1".equals(data.get("ISSCRAP"))).collect(Collectors.toList()); List<PageData> choiceTrailerList = varList.stream().filter(data -> !"1".equals(data.get("ISSCRAP"))).collect(Collectors.toList());
map.put("varList", choiceTrailerList); map.put("varList", choiceTrailerList);
map.put("page", page); map.put("page", page);
map.put("result", errInfo); map.put("result", errInfo);