修改车牌号、车架号、发动机号校验

图片显示
dev
xiepeng 2024-03-26 18:06:10 +08:00
parent 3d1f7acc6d
commit 2fdcc017fe
4 changed files with 74 additions and 42 deletions

View File

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

View File

@ -205,6 +205,16 @@ public class FreighttTrailerController extends BaseController {
pd.put("TYPE",123);
List<PageData> 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<PageData> 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);

View File

@ -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<String,Object> map = new HashMap<String,Object>();
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<PageData> drivinglicensephoto = imgfilesService.listAll(pd);//行驶证照片
pd.put("TYPE",132);
List<PageData> operatingcertificatephoto = imgfilesService.listAll(pd);//运营证照片
List<PageData> zdepartmentPdList = new ArrayList<PageData>();
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;
}

View File

@ -504,6 +504,7 @@
<if test="pd.DRIVINGPREMIT_STATUS != null and pd.DRIVINGPREMIT_STATUS != ''"><!-- 关键词检索 -->
and f.DRIVINGPREMIT_STATUS = #{pd.DRIVINGPREMIT_STATUS}
</if>
order by f.OPERATTIME DESC
</select>
<select id="listAll" parameterType="pd" resultType="pd">