From db4cba9b2b9bd17744dcb0d1306275eebdce167c Mon Sep 17 00:00:00 2001 From: xiepeng Date: Wed, 27 Mar 2024 18:10:54 +0800 Subject: [PATCH] =?UTF-8?q?BUG=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FreighttTrailerController.java | 69 ++++++++++++++++++- .../InspectAnnuallyController.java | 45 ++++++++++++ .../OperatingVehiclesController.java | 20 +++++- .../scrapManage/ScrapManageController.java | 2 +- .../InspectAnnuallyMapper.java | 1 + .../OperatingVehiclesMapper.java | 2 + .../InspectAnnuallyService.java | 1 + .../impl/InspectAnnuallyServiceImpl.java | 4 ++ .../OperatingVehiclesService.java | 2 + .../impl/OperatingVehiclesServiceImpl.java | 5 ++ ...ficSecurityAccidentInvestigationMapper.xml | 4 ++ .../inspectAnnually/InspectAnnuallyMapper.xml | 10 +++ .../OperatingVehiclesMapper.xml | 29 ++++++-- .../datasource/scrapManage/ScrapManage.xml | 9 ++- 14 files changed, 188 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/zcloud/controller/freighttrailer/FreighttTrailerController.java b/src/main/java/com/zcloud/controller/freighttrailer/FreighttTrailerController.java index e96c312..2fa8c88 100644 --- a/src/main/java/com/zcloud/controller/freighttrailer/FreighttTrailerController.java +++ b/src/main/java/com/zcloud/controller/freighttrailer/FreighttTrailerController.java @@ -6,10 +6,13 @@ import com.zcloud.entity.PageData; import com.zcloud.logs.LogAnno; import com.zcloud.service.assignedManage.AssignedManageService; import com.zcloud.service.freighttrailer.FreightTrailerService; +import com.zcloud.service.inspectAnnually.InspectAnnuallyService; +import com.zcloud.service.operatingvehicles.OperatingVehiclesService; import com.zcloud.service.scrapManage.ScrapManageService; import com.zcloud.service.system.ImgFilesService; import com.zcloud.service.taxationManage.TaxationManageService; import com.zcloud.util.*; +import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @@ -40,6 +43,12 @@ public class FreighttTrailerController extends BaseController { @Autowired private AssignedManageService assignedManageService; + @Autowired + private OperatingVehiclesService operatingVehiclesService; + + @Autowired + private InspectAnnuallyService inspectAnnuallyService; + /** * 新增 * @@ -105,6 +114,7 @@ public class FreighttTrailerController extends BaseController { scrapAddData.put("CORPINFO_ID", findPageData.get("CORPINFO_ID")); scrapAddData.put("SCRAP_VEHICLE", findPageData.get("PLATE_NUMBER")); scrapAddData.put("ISDELETE", "0"); + scrapAddData.put("SCRAPFLAG", "1"); scrapManageService.save(scrapAddData); } pd.put("DELETEOR", Jurisdiction.getUSER_ID()); //删除人id @@ -326,20 +336,73 @@ public class FreighttTrailerController extends BaseController { // @RequiresPermissions( value = {"question:list" , "courseware:list"}, logical = Logical.OR) @ResponseBody @LogAnno(menuType = "基础信息管理", menuServer = "营运车辆", instructionsOperate = "营运车辆", instructionsType = "列表") - public Object vehicleList() throws Exception { + public Object vehicleList(Page page) throws Exception { Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); pd.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID()); - List list = freightTrailerService.vehicleList(pd); //列出Question列表 + if(!StringUtils.isEmpty(pd.getString("TRAFFIC_TYPE")) && pd.getString("TRAFFIC_TYPE").equals("1")) { + // 营运车辆 + List operatingList = operatingVehiclesService.operationVehicleList(pd.getString("CORPINFO_ID")); + page.setPd(pd); + List insAnnually = inspectAnnuallyService.annuallyList(page); + for (int i = 0; i < insAnnually.size(); i++) { + for (int j = 0; j < operatingList.size(); j++) { + if(operatingList.get(j).get("OPERATING_ID").equals(insAnnually.get(i).get("VEHICLE"))) { + operatingList.remove(j); + } + } + } + if(pd.containsKey("ID")){ + pd.put("OPERATING_ID", pd.getString("ID")); + pd.put("FOREIGN_KEY", pd.getString("OPERATING_ID")); + pd.put("TYPE",121); + List drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片 + map.put("drivingLicenseImgs", drivingLicenseImgs); + } + operatingList.forEach(operating -> { + operating.put("ID", operating.getString("OPERATING_ID")); + }); + map.put("list", operatingList); + map.put("result", errInfo); + return map; + } + if("2".equals(pd.getString("TRAFFIC_TYPE"))) { + // 货运挂车 + List freightList = freightTrailerService.trailerList(pd.getString("CORPINFO_ID")); + page.setPd(pd); + List insAnnually = inspectAnnuallyService.annuallyList(page); + for (int i = 0; i < insAnnually.size(); i++) { + for (int j = 0; j < freightList.size(); j++) { + if(freightList.get(j).get("FREIGHTTRAILER_ID").equals(insAnnually.get(i).get("VEHICLE"))) { + freightList.remove(j); + } + } + } + if(pd.containsKey("ID")){ + pd.put("FREIGHTTRAILER_ID", pd.getString("ID")); + pd.put("FOREIGN_KEY", pd.getString("FREIGHTTRAILER_ID")); + pd.put("TYPE",121); + List drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片 + map.put("drivingLicenseImgs", drivingLicenseImgs); + } + freightList.forEach(freight -> { + freight.put("ID", freight.getString("FREIGHTTRAILER_ID")); + }); + map.put("list", freightList); + map.put("result", errInfo); + return map; + } + + List resData = freightTrailerService.vehicleList(pd); if(pd.containsKey("ID")){ pd.put("FOREIGN_KEY", pd.getString("ID")); pd.put("TYPE",121); List drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片 map.put("drivingLicenseImgs", drivingLicenseImgs); } - map.put("list", list); + map.put("list", resData); map.put("result", errInfo); return map; } diff --git a/src/main/java/com/zcloud/controller/inspectAnnually/InspectAnnuallyController.java b/src/main/java/com/zcloud/controller/inspectAnnually/InspectAnnuallyController.java index 6f0c0cf..b8d7ac9 100644 --- a/src/main/java/com/zcloud/controller/inspectAnnually/InspectAnnuallyController.java +++ b/src/main/java/com/zcloud/controller/inspectAnnually/InspectAnnuallyController.java @@ -4,7 +4,9 @@ import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import com.zcloud.logs.LogAnno; +import com.zcloud.service.freighttrailer.FreightTrailerService; import com.zcloud.service.inspectAnnually.InspectAnnuallyService; +import com.zcloud.service.operatingvehicles.OperatingVehiclesService; import com.zcloud.service.system.ImgFilesService; import com.zcloud.util.DateUtil; import com.zcloud.util.Jurisdiction; @@ -30,6 +32,13 @@ public class InspectAnnuallyController extends BaseController { @Autowired private ImgFilesService imgfilesService; + @Autowired + private OperatingVehiclesService operatingVehiclesService; + + @Autowired + private FreightTrailerService freightTrailerService; + + /** * 新增 * @@ -171,6 +180,23 @@ public class InspectAnnuallyController extends BaseController { pd = this.getPageData(); pd = inspectAnnuallyService.findById(pd); //根据ID读取 + 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")); + PageData pageData = operatingVehiclesService.findById(opearting); + 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{ + PageData freight = new PageData(); + freight.put("FREIGHTTRAILER_ID", pd.get("VEHICLE")); + freight.put("CORPINFO_ID", pd.get("CORPINFO_ID")); + PageData pageData = freightTrailerService.findById(freight); + pd.put("VEHICLE_BRAND", pageData.get("TRAILER_BRAND")); + pd.put("VEHICLE_TYPE", pageData.get("TRAILER_MODEL")); + } + pd.put("FOREIGN_KEY", pd.getString("INSPECTANNUALLY_ID")); pd.put("TYPE",124); List inspectinfoImgs = imgfilesService.listAll(pd);//年检资料图片 @@ -182,4 +208,23 @@ public class InspectAnnuallyController extends BaseController { } + @RequestMapping(value = "/annuallyList") + // @RequiresPermissions( value = {"question:list" , "courseware:list"}, logical = Logical.OR) + @ResponseBody + @LogAnno(menuType = "机务档案", menuServer = "年检管理", instructionsOperate = "年检管理", instructionsType = "列表") + public Object annuallyList(Page page) throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID + page.setPd(pd); + List varList = inspectAnnuallyService.annuallyList(page); //列出Question列表 + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + return map; + } + + } diff --git a/src/main/java/com/zcloud/controller/operatingvehicles/OperatingVehiclesController.java b/src/main/java/com/zcloud/controller/operatingvehicles/OperatingVehiclesController.java index 8bc2a07..6999445 100644 --- a/src/main/java/com/zcloud/controller/operatingvehicles/OperatingVehiclesController.java +++ b/src/main/java/com/zcloud/controller/operatingvehicles/OperatingVehiclesController.java @@ -159,8 +159,8 @@ public class OperatingVehiclesController extends BaseController { pd.put("FOREIGN_KEY", pd.getString("OPERATING_ID")); pd.put("TYPE",130); List headstockphoto = imgfilesService.listAll(pd);//车头照片 - pd.put("TYPE",131); - List drivinglicensephoto = imgfilesService.listAll(pd);//行驶证照片 + pd.put("TYPE",121); + List drivingLicenseImgs = imgfilesService.listAll(pd);//行驶证照片 pd.put("TYPE",132); List operatingcertificatephoto = imgfilesService.listAll(pd);//运营证照片 @@ -182,7 +182,7 @@ public class OperatingVehiclesController extends BaseController { map.put("pd", pd); map.put("headstockphoto", headstockphoto); - map.put("drivinglicensephoto", drivinglicensephoto); + map.put("drivinglicensephoto", drivingLicenseImgs); map.put("operatingcertificatephoto", operatingcertificatephoto); map.put("result", errInfo); return map; @@ -244,6 +244,20 @@ public class OperatingVehiclesController extends BaseController { return map; } + @RequestMapping(value = "/setOperationsScrapStatus") + @ResponseBody + public Object setOperationsScrapStatus() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID()); + pd = operatingVehiclesService.setScrapStatus(pd); + map.put("pd", pd); + map.put("result", errInfo); + return map; + } + @RequestMapping(value = "/corpList") @ResponseBody public Object corpList() throws Exception { diff --git a/src/main/java/com/zcloud/controller/scrapManage/ScrapManageController.java b/src/main/java/com/zcloud/controller/scrapManage/ScrapManageController.java index f813804..9b72069 100644 --- a/src/main/java/com/zcloud/controller/scrapManage/ScrapManageController.java +++ b/src/main/java/com/zcloud/controller/scrapManage/ScrapManageController.java @@ -49,7 +49,7 @@ public class ScrapManageController extends BaseController { String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); - pd.put("SCRAP_ID", this.get32UUID()); //车船税主键 + pd.put("SCRAP_ID", this.get32UUID()); //报废主键 pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人id diff --git a/src/main/java/com/zcloud/mapper/datasource/inspectAnnually/InspectAnnuallyMapper.java b/src/main/java/com/zcloud/mapper/datasource/inspectAnnually/InspectAnnuallyMapper.java index b6a690b..78f1a6c 100644 --- a/src/main/java/com/zcloud/mapper/datasource/inspectAnnually/InspectAnnuallyMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/inspectAnnually/InspectAnnuallyMapper.java @@ -60,5 +60,6 @@ public interface InspectAnnuallyMapper { PageData findById(PageData pd); + List annuallyList(Page page); } diff --git a/src/main/java/com/zcloud/mapper/datasource/operatingvehicles/OperatingVehiclesMapper.java b/src/main/java/com/zcloud/mapper/datasource/operatingvehicles/OperatingVehiclesMapper.java index ecfe2cf..8bc7314 100644 --- a/src/main/java/com/zcloud/mapper/datasource/operatingvehicles/OperatingVehiclesMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/operatingvehicles/OperatingVehiclesMapper.java @@ -39,4 +39,6 @@ public interface OperatingVehiclesMapper { List corpList(String corpId); PageData findByfindByPlateNumber(PageData pd); + + PageData setScrapStatus(PageData pd); } diff --git a/src/main/java/com/zcloud/service/inspectAnnually/InspectAnnuallyService.java b/src/main/java/com/zcloud/service/inspectAnnually/InspectAnnuallyService.java index fdce75b..27a5698 100644 --- a/src/main/java/com/zcloud/service/inspectAnnually/InspectAnnuallyService.java +++ b/src/main/java/com/zcloud/service/inspectAnnually/InspectAnnuallyService.java @@ -60,5 +60,6 @@ public interface InspectAnnuallyService { public PageData findById(PageData pd) throws Exception; + List annuallyList(Page page); } diff --git a/src/main/java/com/zcloud/service/inspectAnnually/impl/InspectAnnuallyServiceImpl.java b/src/main/java/com/zcloud/service/inspectAnnually/impl/InspectAnnuallyServiceImpl.java index 3ef2669..3664e3d 100644 --- a/src/main/java/com/zcloud/service/inspectAnnually/impl/InspectAnnuallyServiceImpl.java +++ b/src/main/java/com/zcloud/service/inspectAnnually/impl/InspectAnnuallyServiceImpl.java @@ -82,6 +82,10 @@ public class InspectAnnuallyServiceImpl implements InspectAnnuallyService { return inspectAnnuallyMapper.findById(pd); } + @Override + public List annuallyList(Page page) { + return inspectAnnuallyMapper.annuallyList(page); + } } diff --git a/src/main/java/com/zcloud/service/operatingvehicles/OperatingVehiclesService.java b/src/main/java/com/zcloud/service/operatingvehicles/OperatingVehiclesService.java index 78e7f32..01785b5 100644 --- a/src/main/java/com/zcloud/service/operatingvehicles/OperatingVehiclesService.java +++ b/src/main/java/com/zcloud/service/operatingvehicles/OperatingVehiclesService.java @@ -39,4 +39,6 @@ public interface OperatingVehiclesService { List corpList(String corpId); PageData findByfindByPlateNumber(PageData pd); + + PageData setScrapStatus(PageData pd); } diff --git a/src/main/java/com/zcloud/service/operatingvehicles/impl/OperatingVehiclesServiceImpl.java b/src/main/java/com/zcloud/service/operatingvehicles/impl/OperatingVehiclesServiceImpl.java index f34b914..f05eb48 100644 --- a/src/main/java/com/zcloud/service/operatingvehicles/impl/OperatingVehiclesServiceImpl.java +++ b/src/main/java/com/zcloud/service/operatingvehicles/impl/OperatingVehiclesServiceImpl.java @@ -56,4 +56,9 @@ public class OperatingVehiclesServiceImpl implements OperatingVehiclesService { public PageData findByfindByPlateNumber(PageData pd) { return operatingVehiclesMapper.findByfindByPlateNumber(pd); } + + @Override + public PageData setScrapStatus(PageData pd) { + return operatingVehiclesMapper.setScrapStatus(pd); + } } diff --git a/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityAccidentInvestigationMapper.xml b/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityAccidentInvestigationMapper.xml index f931e1f..1aa4a2b 100644 --- a/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityAccidentInvestigationMapper.xml +++ b/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityAccidentInvestigationMapper.xml @@ -346,6 +346,10 @@ and f.PENALTYTIME = #{pd.PENALTYTIME} + + and f.ACCIDENTDATE = #{pd.ACCIDENTDATE} + + ORDER BY OPERATTIME DESC + diff --git a/src/main/resources/mybatis/datasource/operatingvehicles/OperatingVehiclesMapper.xml b/src/main/resources/mybatis/datasource/operatingvehicles/OperatingVehiclesMapper.xml index 3860941..fbc3bfd 100644 --- a/src/main/resources/mybatis/datasource/operatingvehicles/OperatingVehiclesMapper.xml +++ b/src/main/resources/mybatis/datasource/operatingvehicles/OperatingVehiclesMapper.xml @@ -67,7 +67,9 @@ f.OPERATTIME, f.DELETOR, f.DELETORNAME, - f.DELETTIME + f.DELETTIME, + f.ISSCRAP, + f.ISASSIGNED @@ -125,7 +127,9 @@ OPERATTIME, DELETOR, DELETORNAME, - DELETTIME + DELETTIME, + ISSCRAP, + ISASSIGNED @@ -183,7 +187,9 @@ #{OPERATTIME}, #{DELETOR}, #{DELETORNAME}, - #{DELETTIME} + #{DELETTIME}, + #{ISSCRAP}, + #{ISASSIGNED}, @@ -202,7 +208,7 @@ update set - ISDELETE = '1' + ISDELETE = '1',ISSCRAP = '1' where OPERATING_ID = #{OPERATING_ID} @@ -265,7 +271,9 @@ DELETOR = #{DELETOR}, DELETORNAME = #{DELETORNAME}, DELETTIME = #{DELETTIME}, - CORPINFO_ID = #{CORPINFO_ID} + CORPINFO_ID = #{CORPINFO_ID}, + ISSCRAP = #{ISSCRAP}, + ISASSIGNED = #{ISASSIGNED} where OPERATING_ID = #{OPERATING_ID} @@ -282,6 +290,17 @@ f.CORPINFO_ID = #{CORPINFO_ID} + + update + + set + ISSCRAP = '1' + where + OPERATING_ID = #{OPERATING_ID} + and + CORPINFO_ID = #{CORPINFO_ID} + +