From 2fdcc017fead5383ad7299630231f0e986c07fd7 Mon Sep 17 00:00:00 2001 From: xiepeng Date: Tue, 26 Mar 2024 18:06:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BD=A6=E7=89=8C=E5=8F=B7?= =?UTF-8?q?=E3=80=81=E8=BD=A6=E6=9E=B6=E5=8F=B7=E3=80=81=E5=8F=91=E5=8A=A8?= =?UTF-8?q?=E6=9C=BA=E5=8F=B7=E6=A0=A1=E9=AA=8C=20=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/beidou/BeidouController.java | 37 +++++++++- .../FreighttTrailerController.java | 10 +++ .../OperatingVehiclesController.java | 68 ++++++++----------- .../OperatingVehiclesMapper.xml | 1 + 4 files changed, 74 insertions(+), 42 deletions(-) diff --git a/src/main/java/com/zcloud/controller/beidou/BeidouController.java b/src/main/java/com/zcloud/controller/beidou/BeidouController.java index 4350e08..e99ca14 100644 --- a/src/main/java/com/zcloud/controller/beidou/BeidouController.java +++ b/src/main/java/com/zcloud/controller/beidou/BeidouController.java @@ -6,11 +6,16 @@ import com.zcloud.entity.PageData; import com.zcloud.logs.LogAnno; import com.zcloud.service.beidou.BeidouService; import com.zcloud.service.maintenance.MaintenanceService; +import com.zcloud.service.operatingvehicles.OperatingVehiclesService; +import com.zcloud.service.operations.OperationsService; import com.zcloud.service.system.ImgFilesService; import com.zcloud.util.DateUtil; import com.zcloud.util.Jurisdiction; +import org.bytedeco.javacpp.presets.opencv_core; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; +import org.springframework.util.ObjectUtils; +import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -31,6 +36,9 @@ public class BeidouController extends BaseController { @Autowired private ImgFilesService imgfilesService; + @Autowired + private OperatingVehiclesService operatingVehiclesService; + /** * 新增 * @@ -53,7 +61,22 @@ public class BeidouController extends BaseController { pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID pd.put("ARCHIVES_TYPE", "正常"); //档案状态 - + PageData operationData = new PageData(); + operationData.put("OPERATING_ID", pd.get("VEHICLE")); + operationData.put("CORPINFO_ID", pd.get("CORPINFO_ID")); + PageData resData = operatingVehiclesService.findById(operationData); + if(!ObjectUtils.isEmpty(resData)) { + if(StringUtils.hasText(pd.getString("DUE_DATE"))) { + String expireDate = pd.getString("DUE_DATE"); + String day = DateUtil.getDay(); + if(DateUtil.compareDate(expireDate, day)) { + resData.put("NETWORK_STATUS","已入网"); + }else{ + resData.put("NETWORK_STATUS","超时入网"); + } + } + operatingVehiclesService.edit(resData); + } beidouService.save(pd); map.put("pd", pd); map.put("result", errInfo); @@ -101,6 +124,18 @@ public class BeidouController extends BaseController { pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人id pd.put("OPERATORNAME", Jurisdiction.getUsername()); //修改人 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + PageData operationData = new PageData(); + operationData.put("OPERATING_ID", pd.get("VEHICLE")); + operationData.put("CORPINFO_ID", pd.get("CORPINFO_ID")); + PageData resData = operatingVehiclesService.findById(operationData); + String dueDate = pd.getString("DUE_DATE"); + String day = DateUtil.getDay(); + if(DateUtil.compareDate(dueDate, day)) { + resData.put("NETWORK_STATUS","已入网"); + }else{ + resData.put("NETWORK_STATUS","超时入网"); + } + operatingVehiclesService.edit(resData); beidouService.edit(pd); map.put("pd", pd); map.put("result", errInfo); diff --git a/src/main/java/com/zcloud/controller/freighttrailer/FreighttTrailerController.java b/src/main/java/com/zcloud/controller/freighttrailer/FreighttTrailerController.java index f6c1a78..eb4d120 100644 --- a/src/main/java/com/zcloud/controller/freighttrailer/FreighttTrailerController.java +++ b/src/main/java/com/zcloud/controller/freighttrailer/FreighttTrailerController.java @@ -205,6 +205,16 @@ public class FreighttTrailerController extends BaseController { pd.put("TYPE",123); List trailerInfoImgs = imgfilesService.listAll(pd);//挂车资料图片 + PageData pd2 = new PageData(); + pd2.put("TRAFFIC_TYPE",2); + pd2.put("ID", pd.getString("FREIGHTTRAILER_ID")); + pd2.put("CORPINFO_ID", pd.get("CORPINFO_ID")); + List pdData = freightTrailerService.vehicleList(pd2); + PageData resData = pdData.get(0); + String[] companyAreas = resData.getString("COMPANY_AREA").split("/"); + pd.put("PROVINCE",companyAreas[0]); + pd.put("CITY",companyAreas[1]); + pd.put("COUNTY",companyAreas[2]); map.put("pd", pd); map.put("trailerImgs", trailerImgs); map.put("drivingLicenseImgs", drivingLicenseImgs); diff --git a/src/main/java/com/zcloud/controller/operatingvehicles/OperatingVehiclesController.java b/src/main/java/com/zcloud/controller/operatingvehicles/OperatingVehiclesController.java index 95a9589..8bc2a07 100644 --- a/src/main/java/com/zcloud/controller/operatingvehicles/OperatingVehiclesController.java +++ b/src/main/java/com/zcloud/controller/operatingvehicles/OperatingVehiclesController.java @@ -7,8 +7,10 @@ import com.zcloud.logs.LogAnno; import com.zcloud.service.assignedManage.AssignedManageService; import com.zcloud.service.operatingvehicles.OperatingVehiclesService; import com.zcloud.service.scrapManage.ScrapManageService; +import com.zcloud.service.system.DepartmentService; import com.zcloud.service.system.ImgFilesService; import com.zcloud.util.*; +import net.sf.json.JSONArray; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.util.ObjectUtils; @@ -17,10 +19,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; @Controller @RequestMapping("/operatingvehicles") @@ -41,17 +40,16 @@ public class OperatingVehiclesController extends BaseController { @Autowired private AssignedManageService assignedManageService; + @Autowired + private DepartmentService departmentService; + /**新增 * @param * @throws Exception */ @RequestMapping(value="/add") @ResponseBody - public Object add( - /*@RequestParam(value="headstockphoto",required=false) MultipartFile headstockphoto, - @RequestParam(value="drivinglicensephoto",required=false) MultipartFile drivinglicensephoto, - @RequestParam(value="operatingcertificatephoto",required=false) MultipartFile operatingcertificatephoto*/ - ) throws Exception{ + public Object add() throws Exception{ Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); @@ -65,36 +63,7 @@ public class OperatingVehiclesController extends BaseController { pd.put("OPERATORNAME", Jurisdiction.getUsername()); // 修改人名字 pd.put("OPERATTIME", DateUtil.date2Str(new Date())); // 修改时间 pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); - /*if (null != headstockphoto && !headstockphoto.isEmpty()) { - String ffile = DateUtil.getDays(); - //本地 -// String filePath = PathUtil.getProjectpath() + Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile; //文件上传路径 -// String fileName = FileUpload.fileUp(file, filePath, this.get32UUID()); //执行上传 - //服务器 - String fileName = this.get32UUID()+headstockphoto.getOriginalFilename().substring(headstockphoto.getOriginalFilename().lastIndexOf(".")); - smb.sshSftp(headstockphoto, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile); - pd.put("HEADSTOCK_PHOTO", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); - } - if (null != drivinglicensephoto && !drivinglicensephoto.isEmpty()) { - String ffile = DateUtil.getDays(); - //本地 -// String filePath = PathUtil.getProjectpath() + Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile; //文件上传路径 -// String fileName = FileUpload.fileUp(file, filePath, this.get32UUID()); //执行上传 - //服务器 - String fileName = this.get32UUID()+drivinglicensephoto.getOriginalFilename().substring(drivinglicensephoto.getOriginalFilename().lastIndexOf(".")); - smb.sshSftp(drivinglicensephoto, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile); - pd.put("DRIVINGLICENSE_PHOTO", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); - } - if (null != operatingcertificatephoto && !operatingcertificatephoto.isEmpty()) { - String ffile = DateUtil.getDays(); - //本地 -// String filePath = PathUtil.getProjectpath() + Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile; //文件上传路径 -// String fileName = FileUpload.fileUp(file, filePath, this.get32UUID()); //执行上传 - //服务器 - String fileName = this.get32UUID()+operatingcertificatephoto.getOriginalFilename().substring(operatingcertificatephoto.getOriginalFilename().lastIndexOf(".")); - smb.sshSftp(operatingcertificatephoto, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile); - pd.put("OPERATING_CERTIFICATE_PHOTO", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName); - }*/ + pd.put("NETWORK_STATUS", "未入网"); operatingVehiclesService.save(pd); map.put("pd", pd); map.put("result", errInfo); @@ -194,6 +163,23 @@ public class OperatingVehiclesController extends BaseController { List drivinglicensephoto = imgfilesService.listAll(pd);//行驶证照片 pd.put("TYPE",132); List operatingcertificatephoto = imgfilesService.listAll(pd);//运营证照片 + + List zdepartmentPdList = new ArrayList(); + PageData dept = new PageData(); + dept.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + dept = this.departmentService.findByCorpId(dept); + String ZDEPARTMENT_ID = dept.getString("DEPARTMENT_ID"); + + PageData node = new PageData(); + node.put("id", dept.get("DEPARTMENT_ID")); + node.put("parentId", dept.get("PARENT_ID")); + node.put("name", dept.get("NAME")); + node.put("icon", "../../../assets/images/user.gif"); + zdepartmentPdList.add(node); + JSONArray arr = JSONArray + .fromObject(departmentService.listAllDepartmentToSelect(ZDEPARTMENT_ID, zdepartmentPdList)); + map.put("zTreeNodes", (null == arr ? "" : "{\"treeNodes\":" + arr.toString() + "}")); + map.put("pd", pd); map.put("headstockphoto", headstockphoto); map.put("drivinglicensephoto", drivinglicensephoto); @@ -279,8 +265,8 @@ public class OperatingVehiclesController extends BaseController { pd = this.getPageData(); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); pd.put("PLATE_NUMBER", pd.getString("vehicleNumber")); - pd = operatingVehiclesService.findByfindByPlateNumber(pd); - map.put("pd", pd); + PageData resData = operatingVehiclesService.findByfindByPlateNumber(pd); + map.put("pd", resData); map.put("result", errInfo); return map; } diff --git a/src/main/resources/mybatis/datasource/operatingvehicles/OperatingVehiclesMapper.xml b/src/main/resources/mybatis/datasource/operatingvehicles/OperatingVehiclesMapper.xml index afeb211..3860941 100644 --- a/src/main/resources/mybatis/datasource/operatingvehicles/OperatingVehiclesMapper.xml +++ b/src/main/resources/mybatis/datasource/operatingvehicles/OperatingVehiclesMapper.xml @@ -504,6 +504,7 @@ and f.DRIVINGPREMIT_STATUS = #{pd.DRIVINGPREMIT_STATUS} + order by f.OPERATTIME DESC