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

View File

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

View File

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

View File

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

View File

@@ -74,19 +74,19 @@ spring:
port: 6379 port: 6379
# 数据库索引 # 数据库索引
database: 0 database: 0
# 密码 abcd1234 fe2b3cef78b74d3692909bdcbdf46331 KeLunPu123! # 密码 abcd1234 fe2b3cef78b74d3692909bdcbdf46331 KeLunPu123!
# password: KeLunPu123!
password: password:
#password:
# 连接超时时间 # 连接超时时间
timeout: 20s timeout: 10s
lettuce: lettuce:
pool: pool:
# 连接池中的最小空闲连接 # 连接池中的最小空闲连接
min-idle: 2 min-idle: 0
# 连接池中的最大空闲连接 # 连接池中的最大空闲连接
max-idle: 10 max-idle: 8
# 连接池的最大数据库连接数 # 连接池的最大数据库连接数
max-active: 20 max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制) # #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms max-wait: -1ms
@@ -140,10 +140,10 @@ xss:
# 匹配链接 # 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/* urlPatterns: /system/*,/monitor/*,/tool/*
#rocketmq: #rocketmq:
#name-server: 127.0.0.1:9876 #name-server: 127.0.0.1:9876
#producer: #producer:
#group: test #group: test
springdoc: springdoc:
api-docs: api-docs:
@@ -173,7 +173,7 @@ kangaroohy:
primary: default primary: default
config: config:
default: default:
endpoint: opc.tcp://127.0.0.1:49320 endpoint: opc.tcp://192.168.0.196:49320
security-policy: none security-policy: none
pool: pool:
max-idle: 5 max-idle: 5