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
private FreightTrailerService freightTrailerService;
/**
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value="/add")
@RequestMapping(value = "/add")
@ResponseBody
public Object add() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
public Object add() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
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<String,String> map = new HashMap<String,String>();
public Object delete() throws Exception {
Map<String, String> map = new HashMap<String, String>();
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<String,Object> map = new HashMap<String,Object>();
public Object edit() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
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<String,Object> map = new HashMap<String,Object>();
public Object goEdit() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
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> 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<PageData> nowVehicleOperationCertificateImgs = imgfilesService.listAll(pd);//车头照片
pd.put("TYPE",121);
pd.put("TYPE", 121);
List<PageData> 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<String,Object> map = new HashMap<String,Object>();
public Object list(Page page) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
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<PageData> varList = assignedManageService.list(page); //列出MajorDangerSource列表
List<PageData> 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<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")
@ResponseBody
public Object getAssignedVehicleList() throws Exception {
@ -260,17 +249,14 @@ public class AssignedManageController extends BaseController {
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
List<PageData> allOperatingVehicleList = operatingVehiclesService.getPulldownVehicleList(pd); // 查询出所有不包括 删除、报废的营运车辆
List<PageData> allAssignedList = assignedManageService.assignedList(corpId); // 所有过户的车辆
List<PageData> 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<PageData> freightList = freightTrailerService.getPulldownVehicleList(corpId);
List<PageData> assignedList = assignedManageService.assignedList(corpId);
List<PageData> 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;

View File

@ -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);

View File

@ -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<PageData> operatingList = operatingVehiclesService.operationVehicleList(pd.getString("CORPINFO_ID"));
page.setPd(pd);
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++) {
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<PageData> drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片
map.put("drivingLicenseImgs", drivingLicenseImgs);
}
operatingList.forEach(operating -> {
varList.forEach(operating -> {
operating.put("ID", operating.getString("OPERATING_ID"));
});
map.put("list", operatingList);
map.put("list", varList);
map.put("result", errInfo);
return map;
}
@ -566,13 +581,28 @@ public class FreighttTrailerController extends BaseController {
List<PageData> freightList = freightTrailerService.trailerList(pd.getString("CORPINFO_ID"));
page.setPd(pd);
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++) {
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<PageData> 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;
}

View File

@ -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<PageData> 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<String,Object> dataMap = new HashMap<String,Object>();
Map<String, Object> dataMap = new HashMap<String, Object>();
List<String> titles = new ArrayList<String>();
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<PageData> varOList = inspectAnnuallyService.listOut(pd);
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();
vpd.put("var1", varOList.get(i).getString("NUM"));//1
vpd.put("var2", varOList.get(i).getString("VEHICLE"));//2
@ -299,10 +301,9 @@ public class InspectAnnuallyController extends BaseController {
}
dataMap.put("varList", varList);
ObjectExcelView erv = new ObjectExcelView();
mv = new ModelAndView(erv,dataMap);
mv = new ModelAndView(erv, dataMap);
return mv;
}
}

View File

@ -12,15 +12,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;
/**
*
@ -178,13 +177,13 @@ public class InsureController extends BaseController {
PageData pd = new PageData();
pd = this.getPageData();
pd = insureService.findById(pd); //根据ID读取
if("1".equals(pd.getString("VEHICLE_MODEL"))) {
if ("1".equals(pd.getString("VEHICLE_MODEL"))) {
PageData operation = new PageData();
operation.put("OPERATING_ID", pd.getString("VEHICLE"));
operation.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
PageData operationInfo = operatingVehiclesService.findById(operation);
pd.put("PLATE_NUMBER", operationInfo.getString("PLATE_NUMBER"));
}else {
} else {
PageData trailer = new PageData();
trailer.put("FREIGHTTRAILER_ID", pd.getString("VEHICLE"));
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("FOREIGN_KEY", pd.getString("INSURE_ID"));
pd.put("TYPE",125);
pd.put("TYPE", 125);
List<PageData> insureinfoImgs = imgfilesService.listAll(pd);//保险资料图片
pd.put("TYPE",129);
pd.put("TYPE", 129);
List<PageData> 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<PageData> operatingList = operatingVehiclesService.operationVehicleList(pd.getString("CORPINFO_ID"));
page.setPd(pd);
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"))) {
operatingList.remove(j);
}
}
// 获取保险列表中所有的营运车辆
List<PageData> insures = insAnnually.stream()
.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("FOREIGN_KEY", pd.getString("OPERATING_ID"));
pd.put("TYPE",121);
pd.put("TYPE", 121);
List<PageData> drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片
map.put("drivingLicenseImgs", drivingLicenseImgs);
}
operatingList.forEach(operating -> {
varList.forEach(operating -> {
operating.put("ID", operating.getString("OPERATING_ID"));
});
map.put("list", operatingList);
map.put("list", varList);
map.put("result", errInfo);
return map;
}
if("2".equals(pd.getString("TRAFFIC_TYPE"))) {
if ("2".equals(pd.getString("TRAFFIC_TYPE"))) {
// 货运挂车
List<PageData> freightList = freightTrailerService.trailerList(pd.getString("CORPINFO_ID"));
page.setPd(pd);
List<PageData> 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<PageData> insureList = insureService.list(page);
// 获取保险列表中所有挂车信息
List<PageData> insures = insureList.stream().filter(data -> StringUtils.equals(data.getString("VEHICLE_MODEL"), "2"))
.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("FOREIGN_KEY", pd.getString("FREIGHTTRAILER_ID"));
pd.put("TYPE",121);
pd.put("TYPE", 121);
List<PageData> 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<PageData> 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<PageData> drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片
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.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<PageData> 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<PageData> 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<PageData> operatingList = operatingVehiclesService.operationVehicleList(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 < 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;
}
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
// 营运车辆
List<PageData> operatingList = operatingVehiclesService.operationVehicleList(pd.getString("CORPINFO_ID"));
page.setPd(pd);
List<PageData> maintenanceList = maintenanceService.list(page);
List<PageData> resData = freightTrailerService.vehicleList(pd);
if(pd.containsKey("ID")){
pd.put("FOREIGN_KEY", pd.getString("ID"));
pd.put("TYPE",121);
List<PageData> varList = new ArrayList<>();
if (!CollectionUtils.isEmpty(maintenanceList)) {
varList = operatingList.stream().parallel()
.filter(operating -> maintenanceList.stream()
.noneMatch(maintenance -> StringUtils.equals(operating.getString("OPERATING_ID"), maintenance.getString("VEHICLE"))))
.collect(Collectors.toList());
} else {
varList = operatingList;
}
if (pd.containsKey("ID")) {
pd.put("OPERATING_ID", pd.getString("ID"));
pd.put("FOREIGN_KEY", pd.getString("OPERATING_ID"));
pd.put("TYPE", 121);
List<PageData> drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片
map.put("drivingLicenseImgs", drivingLicenseImgs);
}
map.put("list", resData);
varList.forEach(operating -> {
operating.put("ID", operating.getString("OPERATING_ID"));
});
map.put("list", varList);
map.put("result", errInfo);
return map;
}

View File

@ -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", "未入网");

View File

@ -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<PageData> operatingList = operatingVehiclesService.operationVehicleList(pd.getString("CORPINFO_ID"));
page.setPd(pd);
List<PageData> 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<PageData> operationsList = operationsService.list(page);
// 获取营运车辆列表中所有的运营车辆
List<PageData> operations = operationsList.stream().filter(data -> StringUtils.equals(data.getString("VEHICLE_MODEL"), "1"))
.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")){
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<PageData> drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片
map.put("drivingLicenseImgs", drivingLicenseImgs);
}
operatingList.forEach(operating -> {
varList.forEach(operating -> {
operating.put("ID", operating.getString("OPERATING_ID"));
});
map.put("list", operatingList);
map.put("list", varList);
map.put("result", errInfo);
return map;
}
@ -243,14 +251,23 @@ public class OperationsController extends BaseController {
// 货运挂车
List<PageData> freightList = freightTrailerService.trailerList(pd.getString("CORPINFO_ID"));
page.setPd(pd);
List<PageData> 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<PageData> operationsList = operationsService.list(page);
// 获取营运管理列表中所有的货运挂车
List<PageData> operations = operationsList.stream()
.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")){
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<PageData> 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;
}

View File

@ -212,11 +212,20 @@ public class ScrapManageController extends BaseController {
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
List<PageData> operationList = operatingVehiclesService.getScrapPulldownVehicleList(pd); //列出Question列表
List<PageData> scrapList = scrapManageService.scrapListAll(corpId);
List<PageData> 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<PageData> freightList = freightTrailerService.getScrapPulldownVehicleList(corpId);
List<PageData> scrapList = scrapManageService.scrapListAll(corpId);
List<PageData> 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;
}

View File

@ -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<String,Object> map = new HashMap<String,Object>();
public Object add() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
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<String,String> map = new HashMap<String,String>();
public Object delete() throws Exception {
Map<String, String> map = new HashMap<String, String>();
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<String,Object> map = new HashMap<String,Object>();
public Object edit() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
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<String,Object> map = new HashMap<String,Object>();
public Object goEdit() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
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<String,Object> map = new HashMap<String,Object>();
public Object list(Page page) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
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<PageData> taxationList = taxationManageService.list(page); //列出MajorDangerSource列表
List<PageData> 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<PageData> varList = freightTrailerService.list(page); // 列出所有挂车列表
List<PageData> freightTrailerList = freightTrailerService.list(page); // 列出所有挂车列表
List<PageData> taxationList = taxationManageService.taxationList(pd.getString("CORPINFO_ID")); // 列出车船税列表
List<PageData> 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<PageData> 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<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("page", page);
map.put("result", errInfo);