自动化立体仓库 - WMS系统
zwl
2 天以前 48d6b46ef23a321cc70e20d36a2b3bf721d05206
src/main/java/com/zy/integration/iot/biz/impl/IotInstructionServiceImpl.java
@@ -18,6 +18,7 @@
import com.zy.iot.entity.IotFeedbackMessage;
import com.zy.iot.entity.IotInstructionMessage;
import com.zy.iot.entity.IotPublishRecord;
import com.zy.iot.service.IotDbConfigService;
import com.zy.iot.service.IotPublishRecordService;
import com.zy.iot.util.IotInstructionIdGenerator;
import lombok.extern.slf4j.Slf4j;
@@ -45,6 +46,8 @@
    private IotPublishRecordService iotPublishRecordService;
    @Autowired
    private IotProperties iotProperties;
    @Autowired
    private IotDbConfigService iotDbConfigService;
    @Autowired
    private ExternalTaskFacadeService externalTaskFacadeService;
    @Autowired
@@ -120,7 +123,8 @@
        }
        String remoteDestination = extractFirstDestination(message.getDestinationLocationIds());
        Integer stationId = Cools.isEmpty(remoteDestination) ? null : iotProperties.getPickStationMappings().get(remoteDestination);
//        Integer stationId = Cools.isEmpty(remoteDestination) ? null : iotProperties.getPickStationMappings().get(remoteDestination);
        Integer stationId =602;
        if (stationId == null) {
            return updateAsFailure(record, IotConstants.ERROR_CODE_STATION_MAPPING, "未找到目标出库口映射");
        }
@@ -129,7 +133,8 @@
        param.setPalletId(message.getContainerId());
        param.setOrderId(resolveReferenceId(message));
        param.setStationId(String.valueOf(stationId));
        param.setSeq(1);
        param.setBatchSeq("amazon"+new Date().getTime());
        param.setSeq(0);
        R result = externalTaskFacadeService.createOutboundTask(param, true);
        if (result == null || !Objects.equals(result.get("code"), 200)) {
            return updateAsFailure(record, null, resolveResultMessage(result, "接收拣货指令失败"));
@@ -181,7 +186,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void queueWorkCompletion(WrkMast wrkMast) {
        if (!iotProperties.isEnabled() || wrkMast == null || wrkMast.getWrkNo() == null) {
        if (!iotDbConfigService.isMqttEnabled() || wrkMast == null || wrkMast.getWrkNo() == null) {
            return;
        }
        IotPublishRecord existed = iotPublishRecordService.selectOne(new EntityWrapper<IotPublishRecord>()
@@ -276,7 +281,7 @@
        feedbackMessage.setCreationTime(System.currentTimeMillis());
        record.setFeedbackStatus(status);
        record.setPublishTopic(iotProperties.getTopics().getIngressFeedback());
        record.setPublishTopic(iotDbConfigService.getEffectiveTopics().getIngressFeedback());
        record.setPublishPayload(JSON.toJSONString(feedbackMessage));
        record.setPublishStatus(IotConstants.PUBLISH_STATUS_PENDING);
        record.setUpdateTime(now);
@@ -340,7 +345,7 @@
            payload.setReferenceId(wrkMast.getUserNo());
        }
        payload.setCreationTime(System.currentTimeMillis());
        return initOutboundRecord(wrkMast, IotConstants.MESSAGE_TYPE_STOW, iotProperties.getTopics().getIngressStow(), payload);
        return initOutboundRecord(wrkMast, IotConstants.MESSAGE_TYPE_STOW, iotDbConfigService.getEffectiveTopics().getIngressStow(), payload);
    }
    private IotPublishRecord buildPickOutboundRecord(WrkMast wrkMast, String containerId) {
@@ -353,7 +358,7 @@
            payload.setReferenceId(wrkMast.getUserNo());
        }
        payload.setCreationTime(System.currentTimeMillis());
        return initOutboundRecord(wrkMast, IotConstants.MESSAGE_TYPE_PICK, iotProperties.getTopics().getIngressPick(), payload);
        return initOutboundRecord(wrkMast, IotConstants.MESSAGE_TYPE_PICK, iotDbConfigService.getEffectiveTopics().getIngressPick(), payload);
    }
    private IotPublishRecord initOutboundRecord(WrkMast wrkMast, String messageType, String publishTopic, IotInstructionMessage payload) {