|
|
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.google.common.collect.Lists;
|
|
|
import com.sckw.contract.api.RemoteContractService;
|
|
|
import com.sckw.core.common.enums.enums.ErrorCodeEnum;
|
|
|
import com.sckw.core.exception.BusinessPlatfromException;
|
|
|
@@ -23,6 +24,7 @@ import com.sckw.system.api.RemoteSystemService;
|
|
|
import com.sckw.transport.model.*;
|
|
|
import com.sckw.transport.model.enuma.WeighbridgeTypeEnum;
|
|
|
import com.sckw.transport.model.param.forklift.reponse.GatekeeperOrderResp;
|
|
|
+import com.sckw.transport.model.param.forklift.request.GatekeeperOrderIsPassParam;
|
|
|
import com.sckw.transport.model.param.forklift.request.GatekeeperOrderPassParam;
|
|
|
import com.sckw.transport.model.param.forklift.request.GatekeeperOrderQueryParam;
|
|
|
import com.sckw.transport.model.vo.StatisticsWaybillResp;
|
|
|
@@ -751,5 +753,39 @@ public class GatekeeperOrderService {
|
|
|
log.info("[门卫放行]记录节点轨迹成功,节点ID:{}", node.getId());
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 校验是否可放行
|
|
|
+ * @param gatekeeper
|
|
|
+ */
|
|
|
+ public Boolean checkIsPass(GatekeeperOrderIsPassParam gatekeeper) {
|
|
|
+ log.info("校验是否可放行:{}", JSON.toJSONString(gatekeeper));
|
|
|
+ if (StringUtils.isBlank(gatekeeper.getTruckNo())) {
|
|
|
+ throw new BusinessPlatfromException(ErrorCodeEnum.PARAM_ERROR, "车牌号不能为空!");
|
|
|
+ }
|
|
|
+
|
|
|
+ List<KwtWaybillOrder> wbOrderByTruckNo = waybillOrderRepository.findWbOrderByTruckNo(gatekeeper.getTruckNo());
|
|
|
+ if (CollectionUtils.isEmpty(wbOrderByTruckNo)) {
|
|
|
+ return Boolean.FALSE;
|
|
|
+ }
|
|
|
+ // 获取最新的一条数据
|
|
|
+ KwtWaybillOrder waybillOrder = wbOrderByTruckNo.get(0);
|
|
|
+
|
|
|
+ List<KwtGatekeeperWaybillOrder> gatekeeperWaybillOrders = gatekeeperWaybillOrderRepository
|
|
|
+ .queryGatekeeperWaybillOrderByWOrderIds(Lists.newArrayList(waybillOrder.getId()));
|
|
|
+ if (CollectionUtils.isEmpty(gatekeeperWaybillOrders)) {
|
|
|
+ return Boolean.FALSE;
|
|
|
+ }
|
|
|
+ KwtGatekeeperWaybillOrder gatekeeperWaybillOrder = gatekeeperWaybillOrders.get(0);
|
|
|
+
|
|
|
+
|
|
|
+ // 定义运单可以可放行的状态集合
|
|
|
+ List<Integer> PASS_STATUSES = Arrays.asList(
|
|
|
+ GatekeeperStatusEnum.PENDING_ENTRY.getCode(),
|
|
|
+ GatekeeperStatusEnum.READY_RELEASE.getCode()
|
|
|
+ );
|
|
|
+
|
|
|
+ return PASS_STATUSES.contains(gatekeeperWaybillOrder.getStatus()) ? Boolean.TRUE : Boolean.FALSE;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|