feat:对接一级口门相关方、临时车辆
parent
b1a0c69d9a
commit
2d57f7fec2
|
|
@ -9,6 +9,7 @@ import com.zcloud.primeport.domain.gateway.VehicleAuditGateway;
|
||||||
import com.zcloud.primeport.domain.model.VehicleApplyE;
|
import com.zcloud.primeport.domain.model.VehicleApplyE;
|
||||||
import com.zcloud.primeport.domain.model.VehicleAuditE;
|
import com.zcloud.primeport.domain.model.VehicleAuditE;
|
||||||
import com.zcloud.primeport.dto.VehicleAuditUpdateCmd;
|
import com.zcloud.primeport.dto.VehicleAuditUpdateCmd;
|
||||||
|
import com.zcloud.primeport.plan.mjDevice.CarDockUtil;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
@ -28,7 +29,7 @@ import java.util.Date;
|
||||||
public class VehicleAuditUpdateExe {
|
public class VehicleAuditUpdateExe {
|
||||||
private final VehicleAuditGateway vehicleAuditGateway;
|
private final VehicleAuditGateway vehicleAuditGateway;
|
||||||
private final VehicleApplyGateway vehicleApplyGateway;
|
private final VehicleApplyGateway vehicleApplyGateway;
|
||||||
private final VehicleDockLogAddExe vehicleDockLogAddExe;
|
private final CarDockUtil carDockUtil;
|
||||||
private final TodoListEventPusherUtil todoListEventPusherUtil;
|
private final TodoListEventPusherUtil todoListEventPusherUtil;
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
|
@ -64,7 +65,7 @@ public class VehicleAuditUpdateExe {
|
||||||
if (vehicleApplyE.getMkmjPermission().equals(1)) {
|
if (vehicleApplyE.getMkmjPermission().equals(1)) {
|
||||||
// 审批通过 进行数据对接。
|
// 审批通过 进行数据对接。
|
||||||
VehicleApplyE byId = vehicleApplyGateway.getById(cmd.getVehicleApplyId());
|
VehicleApplyE byId = vehicleApplyGateway.getById(cmd.getVehicleApplyId());
|
||||||
vehicleDockLogAddExe.executeDockByApplyId(byId);
|
carDockUtil.executeInternalVehicle(byId);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,11 +38,6 @@ public class VehicleDockLogAddExe {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void executeDockByApplyId(VehicleApplyE byId) {
|
|
||||||
if ("5".equals(byId.getVehicleBelongType())) {
|
|
||||||
// 相关方单位车辆,单独计算下今天是否需要申请 入场与拉黑 有效期过期 expiredExpiration
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,17 @@
|
||||||
package com.zcloud.primeport.plan.mjDevice;
|
package com.zcloud.primeport.plan.mjDevice;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONArray;
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import com.zcloud.gbscommon.utils.DateUtil;
|
||||||
|
import com.zcloud.primeport.domain.model.VehicleApplyE;
|
||||||
import com.zcloud.primeport.persistence.repository.VehicleApplyRepository;
|
import com.zcloud.primeport.persistence.repository.VehicleApplyRepository;
|
||||||
import com.zcloud.primeport.plan.mjDevice.dto.CarEnum;
|
import com.zcloud.primeport.plan.mjDevice.dto.CarEnum;
|
||||||
|
import com.zcloud.primeport.plan.mjDevice.dto.OneLevelCarRemoveDto;
|
||||||
import com.zcloud.primeport.plan.mjDevice.dto.OneLevelCarSaveDto;
|
import com.zcloud.primeport.plan.mjDevice.dto.OneLevelCarSaveDto;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
|
|
@ -14,9 +20,9 @@ public class CarDockUtil {
|
||||||
private VehicleApplyRepository vehicleApplyRepository;
|
private VehicleApplyRepository vehicleApplyRepository;
|
||||||
@Resource
|
@Resource
|
||||||
private OneLevelCarUtil oneLevelCarUtil;
|
private OneLevelCarUtil oneLevelCarUtil;
|
||||||
// 同步封闭区域车、一级口门临时、相关方车
|
|
||||||
public void execute(String licenceNo) {
|
public void execute(String licenceNo) {
|
||||||
// 一级口门车辆
|
// 一级口门车辆临时、相关方车
|
||||||
List<OneLevelCarSaveDto> dataList = vehicleApplyRepository.listTodayHasPort(licenceNo);
|
List<OneLevelCarSaveDto> dataList = vehicleApplyRepository.listTodayHasPort(licenceNo);
|
||||||
dataList.forEach(item -> {
|
dataList.forEach(item -> {
|
||||||
item.setTruckCardColor(CarEnum.getMenuKeyByPath(item.getTruckCardColor()));
|
item.setTruckCardColor(CarEnum.getMenuKeyByPath(item.getTruckCardColor()));
|
||||||
|
|
@ -32,4 +38,48 @@ public class CarDockUtil {
|
||||||
oneLevelCarUtil.tmpVehicleSave(item);
|
oneLevelCarUtil.tmpVehicleSave(item);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 一级口门内部车
|
||||||
|
public void executeInternalVehicle(VehicleApplyE applyE) {
|
||||||
|
OneLevelCarSaveDto o = new OneLevelCarSaveDto();
|
||||||
|
o.setTruckNo(applyE.getLicenceNo());
|
||||||
|
o.setTruckCardColor(CarEnum.getMenuKeyByPath(applyE.getLicenceType()));
|
||||||
|
o.setTruckTypCod(CarEnum.getMenuKeyByPath(applyE.getVehicleType()));
|
||||||
|
o.setYqlCheckFlag("0");
|
||||||
|
o.setValidDte(applyE.getVisitEndTime());
|
||||||
|
o.setDriverNam(applyE.getEmployeeVehicleUserName());
|
||||||
|
o.setVin("无");
|
||||||
|
o.setTruckAppTypCod(CarEnum.getMenuKeyByPath(applyE.getVehicleBelongType()));
|
||||||
|
o.setRecNam(applyE.getCreateName());
|
||||||
|
o.setRecTim(DateUtil.date2Str(new Date()));
|
||||||
|
// o.setPortId();
|
||||||
|
|
||||||
|
JSONObject entries = new JSONObject(applyE.getGateLevelAuthArea());
|
||||||
|
JSONArray area = entries.getJSONArray("area");
|
||||||
|
if (area.size() > 1) {
|
||||||
|
o.setPortId("0");
|
||||||
|
}
|
||||||
|
JSONObject o1 = area.getJSONObject(0);
|
||||||
|
if ("QHD_GQ_DGQ".equals(o1.get("bianma",String.class))) {
|
||||||
|
o.setPortId("1");
|
||||||
|
}
|
||||||
|
if ("QHD_GQ_XGQ".equals(o1.get("bianma",String.class))) {
|
||||||
|
o.setPortId("2");
|
||||||
|
}
|
||||||
|
OneLevelCarRemoveDto r = new OneLevelCarRemoveDto();
|
||||||
|
r.setTruckNo(applyE.getLicenceNo());
|
||||||
|
r.setTruckCardColor(CarEnum.getMenuKeyByPath(applyE.getLicenceType()));
|
||||||
|
oneLevelCarUtil.internalVehicleRemove(r);
|
||||||
|
oneLevelCarUtil.internalVehicleSave(o);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String x = "{\"area\": [{\"value\": \"秦皇岛港区-全部\", \"bianma\": \"QHD_GQ_DXGQ\"}]}";
|
||||||
|
JSONObject entries = new JSONObject(x);
|
||||||
|
JSONArray area = entries.getJSONArray("area");
|
||||||
|
if (area.size() > 1) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,15 @@ public enum CarEnum {
|
||||||
CR("mbc", "CR"),
|
CR("mbc", "CR"),
|
||||||
CC("pk", "CC"),
|
CC("pk", "CC"),
|
||||||
WXP_BLUE("wxplp", "WXP_BLUE"),
|
WXP_BLUE("wxplp", "WXP_BLUE"),
|
||||||
Z7("sngc", "Z7");
|
// 1-股份员工车辆,2-股份单位车辆,3-分公司员工车辆,4-分公司单位车辆 ,7检查部门车辆8,驻港单位员工车辆,9驻港单位公车
|
||||||
|
GFDWC("2", "1"),
|
||||||
|
FGSDWC("4", "1"),
|
||||||
|
ZGDWC("9", "1"),
|
||||||
|
|
||||||
|
GFYGC("1", "4"),
|
||||||
|
FGSYGC("3", "4"),
|
||||||
|
ZGDWYGC("8", "4"),
|
||||||
|
INSPECTION_DEPARTMENT("7", "3");
|
||||||
// WXP 危险品(黄牌)
|
// WXP 危险品(黄牌)
|
||||||
// QH 轻型货车
|
// QH 轻型货车
|
||||||
// XK 小型客车
|
// XK 小型客车
|
||||||
|
|
@ -78,5 +86,8 @@ public enum CarEnum {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
System.out.println(getMenuKeyByPath("blue"));
|
System.out.println(getMenuKeyByPath("blue"));
|
||||||
|
System.out.println(getMenuKeyByPath("1"));
|
||||||
|
System.out.println(getMenuKeyByPath("2"));
|
||||||
|
System.out.println(getMenuKeyByPath("3"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue