From a3f8ef130d998973a5d36bb196e1607827de81e8 Mon Sep 17 00:00:00 2001
From: CZT <czt18638530771@163.com>
Date: 星期三, 30 八月 2023 16:06:13 +0800
Subject: [PATCH] 增加Modbus协议:温控控制
---
igds-inout/src/main/java/com/ld/igds/inout/manager/InoutCommonManager.java | 64 ++++++++++++++++---------------
1 files changed, 33 insertions(+), 31 deletions(-)
diff --git a/igds-inout/src/main/java/com/ld/igds/inout/manager/InoutCommonManager.java b/igds-inout/src/main/java/com/ld/igds/inout/manager/InoutCommonManager.java
index 7f9ade9..eae9542 100644
--- a/igds-inout/src/main/java/com/ld/igds/inout/manager/InoutCommonManager.java
+++ b/igds-inout/src/main/java/com/ld/igds/inout/manager/InoutCommonManager.java
@@ -1,15 +1,14 @@
package com.ld.igds.inout.manager;
+import com.ld.igds.constant.Constant;
import com.ld.igds.inout.InoutConstant;
import com.ld.igds.inout.dto.InoutData;
import com.ld.igds.inout.service.InoutService;
-import com.ld.igds.io.dto.WeightDto;
import com.ld.igds.m.service.InoutCommonService;
import com.ld.igds.models.DicTrigger;
import com.ld.igds.models.InoutConf;
import com.ld.igds.models.InoutSysConf;
import com.ld.igds.sys.service.DicTriggerService;
-import com.ld.igds.util.ContextUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
@@ -31,6 +30,8 @@
private DicTriggerService dicTriggerService;
@Resource
private InoutService inoutService;
+ @Resource
+ private InoutEventControlManager inoutEventControl;
/**
* 鑾峰彇鍑哄叆搴撶殑鏁翠釜娴佺▼淇℃伅
@@ -94,6 +95,29 @@
return result;
}
+ public List<InoutConf> getInoutConf(List<InoutConf> listInoutConf, String type) {
+ List<InoutConf> result = new ArrayList<>();
+ if (null == listInoutConf) return result;
+ for (InoutConf conf : listInoutConf) {
+ if (type.equals(conf.getType())) {
+ result.add(conf);
+ }
+ }
+ return result;
+ }
+
+ public InoutConf getInoutConf(List<InoutConf> listInoutConf, String sort, String type) {
+ if (null == listInoutConf) return new InoutConf(sort);
+ if (StringUtils.isEmpty(sort)) sort = "1";
+
+ for (InoutConf conf : listInoutConf) {
+ if (sort.equals(conf.getSort()) && type.equals(conf.getType())) {
+ return conf;
+ }
+ }
+ return new InoutConf(sort);
+ }
+
/**
* 鏍规嵁绫诲瀷鑾峰彇瀛楀吀琛ㄤ笅鎷夋
@@ -116,34 +140,13 @@
public String getWeightEditTag(String companyId, String deptId) {
// 浠庣紦瀛樹腑鑾峰彇鍑哄叆搴撶郴缁熼厤缃俊鎭�
InoutSysConf inoutSysConf = inoutCommonService.getCacheInoutSysConf(companyId, deptId);
- String weightEditTag = null;
+ String weightEditTag = Constant.YN_N;
if (inoutSysConf != null) {
weightEditTag = inoutSysConf.getWeightEditTag();
}
+ if (null == weightEditTag) weightEditTag = Constant.YN_N;
+
return weightEditTag;
- }
-
- public List<WeightDto> getInoutWeightAll(List<InoutConf> listInoutConf, String type) {
- List<WeightDto> result = new ArrayList<>();
- if (null == listInoutConf) return result;
-
- for (InoutConf conf : listInoutConf) {
- if (type.equals(conf.getType())) {
- result.add(new WeightDto(conf));
- }
- }
- return result;
- }
-
- public WeightDto getInoutCurWeight(List<WeightDto> listWeight, String sort) {
- if (null == listWeight || listWeight.isEmpty()) return new WeightDto();
-
- if (listWeight.size() == 1) return listWeight.get(0);
-
- for (WeightDto weight : listWeight) {
- if (weight.getSort().equals(sort)) return weight;
- }
- return new WeightDto();
}
@@ -152,15 +155,14 @@
*
* @param deptId
*/
- public void initInoutScreen(String deptId) {
- if (StringUtils.isEmpty(deptId))
- deptId = ContextUtil.subDeptId(null);
- inoutService.initInoutScreen(deptId);
+ public void initInoutScreen(String companyId, String deptId) {
+ if (StringUtils.isEmpty(companyId)) return;
+ if (StringUtils.isEmpty(deptId)) return;
+ inoutEventControl.initInoutScreen(companyId, deptId, null);
}
public List<InoutData> getListInoutCache(String deptId) {
return inoutService.getListInoutCache(deptId);
-
}
public List<InoutData> getCompleteListInoutCache(String deptId) {
--
Gitblit v1.9.3