feat(config): 合并

This commit is contained in:
2025-10-30 11:28:36 +08:00
5 changed files with 27 additions and 20 deletions

View File

@@ -10,7 +10,9 @@ import com.kangaroohy.milo.service.MiloService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@@ -22,8 +24,9 @@ import java.util.Map;
import static com.fizz.business.service.manager.OpcMessageIdsManager.*;
@Slf4j
//@Component
@Component
@AllArgsConstructor
@ConditionalOnProperty(prefix = "kangaroohy.milo", name = "enabled", havingValue = "true")
public class MessageReceiveSchedule extends BaseSchedule {
@Resource
@@ -31,7 +34,7 @@ public class MessageReceiveSchedule extends BaseSchedule {
@Resource
private OpcReceiverHandler opcReceiverHandler;
// @Scheduled(fixedDelay = 1000)
@Scheduled(fixedDelay = 1000)
public void L1L2LineMeasure() {
try {

View File

@@ -13,6 +13,7 @@ import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.compress.utils.Lists;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@@ -26,8 +27,9 @@ import java.util.concurrent.atomic.AtomicBoolean;
import static com.fizz.business.service.manager.OpcMessageIdsManager.*;
//@Component
@Component
@Slf4j
@ConditionalOnProperty(prefix = "kangaroohy.milo", name = "enabled", havingValue = "true")
public class MessageSubscriptionRunner implements ApplicationRunner {
@Resource
@@ -87,7 +89,7 @@ public class MessageSubscriptionRunner implements ApplicationRunner {
writeMessage( msg,entryMoveIds);
log.info("接收入口移动信号:从 {} 移动到 {} ", msg.getMaterialPlaceSource(), msg.getMaterialPlaceDestination());
logDataService.logInfo("TRACK","接收入口移动信号:从 {} 移动到 {} ", msg.getMaterialPlaceSource(), msg.getMaterialPlaceDestination());
//opcReceiverHandler.onMessageReceived(OpcMessageType.ENTRY_MOVEMENT,msg);
opcReceiverHandler.onMessageReceived(OpcMessageType.ENTRY_MOVEMENT,msg);
} catch (Exception e) {
}
}
@@ -99,7 +101,7 @@ public class MessageSubscriptionRunner implements ApplicationRunner {
writeMessage( msg,exitCutIds);
log.info("接收到出口剪切信号:剪切类型 {},剪切长度{} ", msg.getCutType().toString(), msg.getCutLength());
logDataService.logInfo("TRACK","接收到出口剪切信号:剪切类型 {},剪切长度{} ", msg.getCutType().toString(), msg.getCutLength());
// opcReceiverHandler.onMessageReceived(OpcMessageType.EXIT_CUT,msg);
opcReceiverHandler.onMessageReceived(OpcMessageType.EXIT_CUT,msg);
} catch (Exception e) {
}
}
@@ -111,7 +113,7 @@ public class MessageSubscriptionRunner implements ApplicationRunner {
writeMessage( msg,exitMoveIds);
log.info("接收出口移动信号:从 {} 移动到 {} ", msg.getExSrc(), msg.getExDesc());
logDataService.logInfo("TRACK","接收出口移动信号:从 {} 移动到 {} ", msg.getExSrc(), msg.getExDesc());
// opcReceiverHandler.onMessageReceived(OpcMessageType.EXIT_MOVEMENT,msg);
opcReceiverHandler.onMessageReceived(OpcMessageType.EXIT_MOVEMENT,msg);
} catch (Exception e) {
}
}
@@ -123,7 +125,7 @@ public class MessageSubscriptionRunner implements ApplicationRunner {
writeMessage(msg,exitMoveIds);
log.info("接收出口称重信号:重量 {} ", msg.getWeight());
logDataService.logInfo("TRACK","接收出口称重信号:重量 {} ", msg.getWeight());
// opcReceiverHandler.onMessageReceived(OpcMessageType.EXIT_MEASURE,msg);
opcReceiverHandler.onMessageReceived(OpcMessageType.EXIT_MEASURE,msg);
} catch (Exception e) {
}
}

View File

@@ -8,6 +8,7 @@ import com.kangaroohy.milo.service.MiloService;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.compress.utils.Lists;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -18,8 +19,9 @@ import java.util.Map;
import static com.fizz.business.service.manager.OpcMessageIdsManager.pdiSetupIds;
//@Service
@Service
@Log4j2
@ConditionalOnProperty(prefix = "kangaroohy.milo", name = "enabled", havingValue = "true")
public class OpcMessageSend {
@Resource

View File

@@ -25,7 +25,7 @@ public class ProStoppageServiceImpl extends ServiceImpl<ProStoppageMapper, ProSt
queryWrapper.ge("end_date", form.getStartDate() + " 00:00:00")
.le("end_date", form.getEndDate() + " 23:59:59")
// .ge("duration", 300)
.ge("duration", 300)
.orderByDesc("end_date");
List<ProStoppage> list = baseMapper.selectList(queryWrapper);