|
@@ -8,6 +8,7 @@ import com.platform.api.request.CanLiftGateRequest;
|
|
|
import com.platform.api.request.LicensePlateValidateRequest;
|
|
import com.platform.api.request.LicensePlateValidateRequest;
|
|
|
import com.platform.api.request.WeighbridgePushRequest;
|
|
import com.platform.api.request.WeighbridgePushRequest;
|
|
|
import com.platform.api.request.WeighbridgeRecordPageReqVo;
|
|
import com.platform.api.request.WeighbridgeRecordPageReqVo;
|
|
|
|
|
+import com.platform.api.response.CanLiftGateResponse;
|
|
|
import com.platform.api.response.WeighbridgeRecordExcel;
|
|
import com.platform.api.response.WeighbridgeRecordExcel;
|
|
|
import com.platform.api.response.WeighbridgeRecordResVo;
|
|
import com.platform.api.response.WeighbridgeRecordResVo;
|
|
|
import com.platform.entity.KwsWeighbridge;
|
|
import com.platform.entity.KwsWeighbridge;
|
|
@@ -345,15 +346,6 @@ public class WeighbridgeRecordManage {
|
|
|
log.info("车牌验证, 车牌:{}", request.getLicensePlate());
|
|
log.info("车牌验证, 车牌:{}", request.getLicensePlate());
|
|
|
LicensePlateValidateResponse response = new LicensePlateValidateResponse();
|
|
LicensePlateValidateResponse response = new LicensePlateValidateResponse();
|
|
|
ValidateLicensePlate validateLicensePlate;
|
|
ValidateLicensePlate validateLicensePlate;
|
|
|
- //是否抬杆
|
|
|
|
|
- CanLiftGateRequest canLiftGateRequest = new CanLiftGateRequest();
|
|
|
|
|
- boolean canLiftGate = externalWeighbridgePushService.queryCanLiftGate(canLiftGateRequest);
|
|
|
|
|
- log.info("是否抬杆: {}", canLiftGate);
|
|
|
|
|
- if (!canLiftGate){
|
|
|
|
|
- log.info("状态查询结果:{},不能抬杆", canLiftGate);
|
|
|
|
|
- return getValidateLicensePlateError(response);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
//查询车牌是不存在
|
|
//查询车牌是不存在
|
|
|
try {
|
|
try {
|
|
|
validateLicensePlate = validateLicensePlateService.queryByLicensePlate(request.getLicensePlate(), request.getUuid());
|
|
validateLicensePlate = validateLicensePlateService.queryByLicensePlate(request.getLicensePlate(), request.getUuid());
|
|
@@ -651,11 +643,47 @@ public class WeighbridgeRecordManage {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查询车辆是否允许抬杆。
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param req 抬杆校验请求参数
|
|
|
|
|
+ * @return 抬杆校验响应结果
|
|
|
|
|
+ */
|
|
|
|
|
+ public CanLiftGateResponse canLiftGate(CanLiftGateRequest req) {
|
|
|
|
|
+ log.info("开始处理车辆抬杆校验请求:{}", JSON.toJSONString(req));
|
|
|
|
|
+ if (Objects.isNull(req) || StringUtils.isBlank(req.getTruckNo())) {
|
|
|
|
|
+ log.warn("车辆抬杆校验参数不合法,请求参数:{}", JSON.toJSONString(req));
|
|
|
|
|
+ return buildCanLiftGateResponse(false, 400, "车牌号不能为空", false);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ boolean canLiftGate = externalWeighbridgePushService.queryCanLiftGate(req);
|
|
|
|
|
+ log.info("车辆抬杆校验完成,车牌号:{},是否允许抬杆:{}", req.getTruckNo(), canLiftGate);
|
|
|
|
|
+ return buildCanLiftGateResponse(true, 200, "抬杆校验成功", canLiftGate);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("查询车辆是否允许抬杆异常,车牌号:{}", req.getTruckNo(), e);
|
|
|
|
|
+ return buildCanLiftGateResponse(false, 400, "抬杆校验失败", false);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 构建抬杆校验统一返回对象。
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param status 接口处理状态
|
|
|
|
|
+ * @param code 接口处理状态码
|
|
|
|
|
+ * @param message 接口处理描述
|
|
|
|
|
+ * @param canLiftGate 是否允许抬杆
|
|
|
|
|
+ * @return 抬杆校验响应结果
|
|
|
|
|
+ */
|
|
|
|
|
+ private CanLiftGateResponse buildCanLiftGateResponse(Boolean status, Integer code, String message, Boolean canLiftGate) {
|
|
|
|
|
+ CanLiftGateResponse response = new CanLiftGateResponse();
|
|
|
|
|
+ response.setStatus(status);
|
|
|
|
|
+ response.setCode(code);
|
|
|
|
|
+ response.setMessage(message);
|
|
|
|
|
+
|
|
|
|
|
+ CanLiftGateResponse.Data data = new CanLiftGateResponse.Data();
|
|
|
|
|
+ data.setCanLiftGate(canLiftGate);
|
|
|
|
|
+ response.setData(data);
|
|
|
|
|
+ return response;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|