Prechádzať zdrojové kódy

Merge branch 'master' of http://123.57.213.14:3001/zgzt/dosb-java

qiangxuan 3 týždňov pred
rodič
commit
b23bcaa2f7

+ 5 - 1
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/actualControl/billetActual/billetActual/utils/TopicType.java

@@ -78,7 +78,11 @@ public enum TopicType {
     /**
      * 换炉传递参数
      */
-    SYN_PUSHBILLETHOTSEND_NEXTSEND("syn/pushbillethotsend/nexthosend");
+    SYN_PUSHBILLETHOTSEND_NEXTSEND("syn/pushbillethotsend/nexthosend"),
+    /**
+     * 流号定尺传递参数
+     */
+    SYN_BILLET_PUSHSTRANDNOLENGTH("syn/billet/pushstrandnolength");
 
     private String topicValue;
 

+ 9 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsend/controller/BilletHotsendBaseController.java

@@ -22,6 +22,7 @@ import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.actualControl.billetActual.billetActual.entity.BilletBasicInfo;
 import org.jeecg.modules.actualControl.billetActual.billetActual.service.IBilletBasicInfoService;
 import org.jeecg.modules.billet.billetHotsend.dto.BilletHotsendExportDTO;
+import org.jeecg.modules.billet.billetHotsend.dto.StrandNoSizeDTO;
 import org.jeecg.modules.billet.billetHotsend.entity.*;
 import org.jeecg.modules.billet.billetHotsend.service.IBilletHotsendBaseService;
 import org.jeecg.modules.billet.billetHotsendConfig.entity.BilletHotsendTypeConfig;
@@ -518,4 +519,12 @@ public class BilletHotsendBaseController extends JeecgController<BilletHotsend,
         return Result.OK("换炉推送消息成功!");
     }
 
+
+    @ApiOperation(value = "推送流号定尺", notes = "推送流号定尺")
+    @PostMapping(value = "/pushStrandNoSize")
+    public Result<?> pushStrandNoSize(@RequestBody StrandNoSizeDTO dto) {
+        billetHotsendBaseService.pushStrandNoSize(dto);
+        return Result.OK("流号定尺推送消息成功!");
+    }
+
 }

+ 19 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsend/dto/StrandNoSizeDTO.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.billet.billetHotsend.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class StrandNoSizeDTO {
+
+    private List<StrandNoSize> strandNoSizeList;
+
+    @Data
+    public static class StrandNoSize {
+
+        private Integer strandNo;
+
+        private Integer length;
+    }
+}

+ 3 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsend/service/IBilletHotsendBaseService.java

@@ -2,6 +2,7 @@ package org.jeecg.modules.billet.billetHotsend.service;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.billet.billetHotsend.dto.StrandNoSizeDTO;
 import org.jeecg.modules.billet.billetHotsend.entity.BilletBasicInfoDetails;
 import org.jeecg.modules.billet.billetHotsend.entity.BilletHotsend;
 import org.jeecg.modules.billet.billetHotsend.entity.BilletHotsendDetailsVo;
@@ -37,4 +38,6 @@ public interface IBilletHotsendBaseService extends IService<BilletHotsend> {
     FurnaceChangeData buildFurnaceChangeData(FurnaceChangeData data);
 
     void furnaceChange(FurnaceChangeData data);
+
+    void pushStrandNoSize(StrandNoSizeDTO dto);
 }

+ 31 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsend/service/impl/BilletHotsendBaseServiceImpl.java

@@ -16,6 +16,7 @@ import org.jeecg.modules.actualControl.billetActual.billetActual.utils.MqttClien
 import org.jeecg.modules.actualControl.billetActual.billetActual.utils.TopicType;
 import org.jeecg.modules.actualControl.heatsActuals.entity.HeatsActuals;
 import org.jeecg.modules.actualControl.heatsActuals.service.IHeatsActualsService;
+import org.jeecg.modules.billet.billetHotsend.dto.StrandNoSizeDTO;
 import org.jeecg.modules.billet.billetHotsend.entity.*;
 import org.jeecg.modules.billet.billetHotsend.mapper.BilletHotsendBaseMapper;
 import org.jeecg.modules.billet.billetHotsend.service.IBilletHotsendBaseService;
@@ -774,6 +775,36 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		sendFurnaceChangeToMqtt(finalData);
 	}
 
+
+	@Override
+	public void pushStrandNoSize(StrandNoSizeDTO dto) {
+
+		if (oConvertUtils.listIsEmpty(dto.getStrandNoSizeList())) {
+			throw new JeecgBootException("流号以及定尺集合不能为空!");
+		}
+
+		for (StrandNoSizeDTO.StrandNoSize strandNoSize : dto.getStrandNoSizeList()) {
+			sendStrandNoSizeToMqtt(strandNoSize);
+		}
+
+	}
+
+	public void sendStrandNoSizeToMqtt(StrandNoSizeDTO.StrandNoSize strandNoSize) {
+
+		try {
+			Map<String, Object> mapSendInfo = new HashMap<>();
+			mapSendInfo.put("strandNo", strandNoSize.getStrandNo());
+			mapSendInfo.put("length", strandNoSize.getLength());
+
+			// 执行MQTT推送,设置合理的超时时间
+			MqttClientUtil mqttClientUtilBe = new MqttClientUtil();
+			mqttClientUtilBe.pushCData(configMqttMapper, mapSendInfo, TopicType.SYN_BILLET_PUSHSTRANDNOLENGTH.getTopicValue());
+			log.info("B端传递流号定尺参数,发送MQTT成功: {}", mapSendInfo);
+		} catch (Exception e) {
+			log.error("B端传递流号定尺参数,发送MQTT异常!", e);
+		}
+	}
+
 	public void sendFurnaceChangeToMqtt(FurnaceChangeData data) {
 		try {
 			Map<String, Object> mapSendInfo = new HashMap<>();