|
@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.jeecg.common.exception.JeecgBootException;
|
|
|
import org.jeecg.common.util.DateUtils;
|
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
@@ -24,6 +23,7 @@ import org.jeecg.modules.actualControl.billetActual.billetAssemblyNumber.entity.
|
|
|
import org.jeecg.modules.actualControl.billetActual.billetAssemblyNumber.mapper.BilletAssemblyNumberMapper;
|
|
|
import org.jeecg.modules.actualControl.heatsActuals.entity.HeatsActuals;
|
|
|
import org.jeecg.modules.actualControl.heatsActuals.service.IHeatsActualsService;
|
|
|
+import org.jeecg.modules.billet.billetHotsend.dto.CcmNoSizeDTO;
|
|
|
import org.jeecg.modules.billet.billetHotsend.dto.StrandNoSizeDTO;
|
|
|
import org.jeecg.modules.billet.billetHotsend.entity.*;
|
|
|
import org.jeecg.modules.billet.billetHotsend.mapper.BilletHotsendBaseMapper;
|
|
@@ -73,13 +73,10 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
|
|
|
|
-import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.time.ZoneId;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
|
-import java.util.concurrent.ThreadLocalRandom;
|
|
|
-import java.util.concurrent.atomic.AtomicInteger;
|
|
|
import java.util.concurrent.atomic.AtomicLong;
|
|
|
import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -822,6 +819,34 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
// }
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void pushCcmNoSize(CcmNoSizeDTO dto) {
|
|
|
+
|
|
|
+ // 参数校验
|
|
|
+ if (oConvertUtils.isEmpty(dto.getCcmNo()) || oConvertUtils.isEmpty(dto.getLength())) {
|
|
|
+ throw new IllegalArgumentException("参数异常:铸机号和短尺不能为空!");
|
|
|
+ }
|
|
|
+
|
|
|
+ sendCcmNoSizeToMqtt(dto);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public void sendCcmNoSizeToMqtt(CcmNoSizeDTO ccmNoSizeDTO) {
|
|
|
+
|
|
|
+ try {
|
|
|
+ Map<String, Object> mapSendInfo = new HashMap<>();
|
|
|
+ mapSendInfo.put("ccmNo", ccmNoSizeDTO.getCcmNo());
|
|
|
+ mapSendInfo.put("length", ccmNoSizeDTO.getLength());
|
|
|
+
|
|
|
+ // 执行MQTT推送,设置合理的超时时间
|
|
|
+ MqttClientUtil mqttClientUtilBe = new MqttClientUtil();
|
|
|
+ mqttClientUtilBe.pushCData(configMqttMapper, mapSendInfo, TopicType.SYN_BILLET_PUSHCCMNOLENGTH.getTopicValue());
|
|
|
+ log.info("B端传递铸机号短尺参数,发送MQTT成功: {}", mapSendInfo);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("B端传递铸机号短尺参数,发送MQTT异常!", e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// public void sendStrandNoSizeToMqtt(StrandNoSizeDTO.StrandNoSize strandNoSize) {
|
|
|
//
|
|
|
// try {
|