|
@@ -623,6 +623,44 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
sendBilletNoToMqtt(ccmNo, billetBasicInfoList);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void stackQueryLocation(JSONObject jsonObject) {
|
|
|
+ String ccmNo = jsonObject.getString("ccmNo");// 铸机号
|
|
|
+ String billetHotsendTypeConfigId = jsonObject.getString("billetHotsendTypeConfigId");// 基础类型堆垛ID
|
|
|
+ String layer = jsonObject.getString("layer");// 层数
|
|
|
+ if (oConvertUtils.isEmpty(layer) || oConvertUtils.isEmpty(billetHotsendTypeConfigId)){
|
|
|
+ log.info("{}{}", "layer和所属堆垛ID为空,C端自动化堆垛层占用获取失败!", jsonObject);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 根据以上三个参数,坯号不为空,查询堆垛容器信息
|
|
|
+ LambdaQueryWrapper<StackingAndLoadingVehicles> queryWrapper = new LambdaQueryWrapper();
|
|
|
+ queryWrapper.eq(StackingAndLoadingVehicles::getCcmNo, ccmNo)
|
|
|
+ .eq(StackingAndLoadingVehicles::getLayer, layer)
|
|
|
+ .eq(StackingAndLoadingVehicles::getTypeConfigId, billetHotsendTypeConfigId)
|
|
|
+ .isNotNull(StackingAndLoadingVehicles::getBilletNos);
|
|
|
+ List<StackingAndLoadingVehicles> stackingAndLoadingVehiclesList = baseMapper.selectList(queryWrapper);
|
|
|
+ int locationSum = stackingAndLoadingVehiclesList.size();
|
|
|
+ // 发送mqtt消息
|
|
|
+ sendLocationSumToMqtt(ccmNo, layer, billetHotsendTypeConfigId, locationSum);
|
|
|
+ }
|
|
|
+
|
|
|
+ public void sendLocationSumToMqtt(String ccmNo, String layer, String billetHotsendTypeConfigId, int locationSum) {
|
|
|
+ try {
|
|
|
+ Map<String, Object> mapSendInfo = new HashMap<>();
|
|
|
+ mapSendInfo.put("ccmNo", ccmNo);
|
|
|
+ mapSendInfo.put("layer", layer);
|
|
|
+ mapSendInfo.put("billetHotsendTypeConfigId", billetHotsendTypeConfigId);
|
|
|
+ mapSendInfo.put("locationSum", locationSum);
|
|
|
+ mapSendInfo.put("queryTime", DateUtils.date2Str(new Date(), DateUtils.datetimeFormat.get()));
|
|
|
+ // 执行MQTT推送,设置合理的超时时间
|
|
|
+ MqttClientUtil mqttClientUtilBe = new MqttClientUtil();
|
|
|
+ mqttClientUtilBe.pushCData(configMqttMapper, mapSendInfo, TopicType.SYN_PLACEHOLDER_PASSBACK.getTopicValue());
|
|
|
+ log.info("C端自动化查询堆垛位置被占总数回传,发送MQTT成功: {}", mapSendInfo);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("C端自动化查询堆垛位置被占总数回传,发送MQTT异常!", e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 堆垛保存、堆垛发车公共处理
|