From a84eadb43f793d74d39cc838b75a1aafd2885be4 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期六, 02 三月 2024 09:34:28 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/thread/SiemensCrnThread.java | 98 ++++++++++++++++
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 169 +++++++++++++++++++++++++--
src/main/java/com/zy/asrs/entity/BasCrnp.java | 11 +
src/main/java/com/zy/core/MainProcess.java | 2
src/main/resources/mapper/BasCrnpMapper.xml | 1
src/main/java/com/zy/core/model/protocol/CrnProtocol.java | 35 +++++
6 files changed, 302 insertions(+), 14 deletions(-)
diff --git a/src/main/java/com/zy/asrs/entity/BasCrnp.java b/src/main/java/com/zy/asrs/entity/BasCrnp.java
index 2ce3c36..1013128 100644
--- a/src/main/java/com/zy/asrs/entity/BasCrnp.java
+++ b/src/main/java/com/zy/asrs/entity/BasCrnp.java
@@ -58,6 +58,13 @@
private Integer wrkNo;
/**
+ * 宸ヤ綔鍙�
+ */
+ @ApiModelProperty(value= "宸ヤ綔鍙�")
+ @TableField("wrk_no_two")
+ private Integer wrkNoTwo;
+
+ /**
* 寮傚父鐮�
*/
@ApiModelProperty(value= "寮傚父鐮�")
@@ -236,6 +243,10 @@
this.wrkNo = wrkNo;
}
+ public void setWrkNoTwo(Integer wrkNoTwo) {
+ this.wrkNoTwo = wrkNoTwo;
+ }
+
public Long getCrnErr() {
return crnErr;
}
diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
index a2485cb..a286863 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -1395,8 +1395,12 @@
case 2:
this.crnStnToLoc1Single(crn, crnProtocol); // 鍏ュ簱
break;
+ case 3:
+ case 4:
+ case 5:
+ break;
default:
- this.crnStnToLoc1(crn, crnProtocol); // 鍏ュ簱
+ this.crnStnToLoc1(crn, crnProtocol,1); // 鍏ュ簱
}
crnProtocol.setLastIo("O");
} else if (basCrnp.getOutEnable().equals("Y")) {
@@ -1405,8 +1409,12 @@
case 2:
this.locToCrnStn1Single(crn, crnProtocol); // 鍑哄簱
break;
+ case 3:
+ case 4:
+ case 5:
+ break;
default:
- this.locToCrnStn1(crn, crnProtocol); // 鍑哄簱
+ this.locToCrnStn1(crn, crnProtocol,1); // 鍑哄簱
}
crnProtocol.setLastIo("I");
}
@@ -1419,8 +1427,12 @@
case 2:
this.locToCrnStn1Single(crn, crnProtocol); // 鍑哄簱
break;
+ case 3:
+ case 4:
+ case 5:
+ break;
default:
- this.locToCrnStn1(crn, crnProtocol); // 鍑哄簱
+ this.locToCrnStn1(crn, crnProtocol,1); // 鍑哄簱
}
crnProtocol.setLastIo("I");
} else if (basCrnp.getInEnable().equals("Y")) {
@@ -1429,13 +1441,120 @@
case 2:
this.crnStnToLoc1Single(crn, crnProtocol); // 鍏ュ簱
break;
+ case 3:
+ case 4:
+ case 5:
+ break;
default:
- this.crnStnToLoc1(crn, crnProtocol); // 鍏ュ簱
+ this.crnStnToLoc1(crn, crnProtocol,1); // 鍏ュ簱
}
crnProtocol.setLastIo("O");
}
}
}
+ // 搴撲綅绉昏浆
+ this.locToLoc(crn, crnProtocol);
+// this.crnRebackHp(crnProtocol, crnThread);
+
+ }
+ }catch (Exception e){
+ log.error("鍫嗗灈鏈哄嚭鍏ュ簱涓嬪彂鎶ラ敊"+e);
+ }
+ }
+
+ /**
+ * 鍏ュ嚭搴� ===>> 鍫嗗灈鏈哄叆鍑哄簱浣滀笟涓嬪彂
+ */
+ public synchronized void crnIoExecuteTwo() {
+ try{
+ for (CrnSlave crn : slaveProperties.getCrn()) {
+ // 鑾峰彇鍫嗗灈鏈轰俊鎭�
+ CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId());
+ CrnProtocol crnProtocol = crnThread.getCrnProtocol();
+ if (crnProtocol == null) {
+ continue;
+ }
+ BasCrnp basCrnp = basCrnpService.selectById(crn.getId());
+ if (basCrnp == null) {
+ log.error("{}鍙峰爢鍨涙満灏氭湭鍦ㄦ暟鎹簱杩涜缁存姢锛�", crn.getId());
+ continue;
+ }
+
+
+ int[] sign = new int[]{0,0};
+ // 鍙湁褰撳爢鍨涙満绌洪棽 骞朵笖 鏃犱换鍔℃椂鎵嶇户缁墽琛�
+ if (crnProtocol.getModeType() == CrnModeType.AUTO) {
+ // 鍙湁褰撳爢鍨涙満宸ヤ綅绌洪棽 骞朵笖 鏃犱换鍔℃椂鎵嶇户缁墽琛�
+ if (crnProtocol.getStatusType() == CrnStatusType.IDLE
+ && crnProtocol.getTaskNo() == 0
+ && crnProtocol.getLoaded() == 0
+ && crnProtocol.getForkPos() == 0) {
+ sign[0] = 1;
+ sign[1] = 1;
+ }else if (crnProtocol.getStatusTypeTwo() == CrnStatusType.IDLE
+ && crnProtocol.getTaskNoTwo() == 0
+ && crnProtocol.getLoadedTwo() == 0
+ && crnProtocol.getForkPosTwo() == 0){
+ sign[0] = 1;
+ sign[1] = 2;
+ }
+ }
+
+ if (sign[0]==1){
+ // 濡傛灉鏈�杩戜竴娆℃槸鍏ュ簱妯″紡
+ if (crnProtocol.getLastIo().equals("I")) {
+ if (basCrnp.getInEnable().equals("Y")) {
+ switch (crn.getId()){
+ case 3:
+ case 4:
+ case 5:
+ this.crnStnToLoc1(crn, crnProtocol, sign[1]); // 鍏ュ簱
+ break;
+ default:
+ break;
+ }
+ crnProtocol.setLastIo("O");
+ } else if (basCrnp.getOutEnable().equals("Y")) {
+ switch (crn.getId()){
+ case 3:
+ case 4:
+ case 5:
+ this.locToCrnStn1(crn, crnProtocol, sign[1]); // 鍑哄簱
+ break;
+ default:
+ break;
+ }
+ crnProtocol.setLastIo("I");
+ }
+ }
+ // 濡傛灉鏈�杩戜竴娆℃槸鍑哄簱妯″紡
+ else if (crnProtocol.getLastIo().equals("O")) {
+ if (basCrnp.getOutEnable().equals("Y")) {
+ switch (crn.getId()){
+ case 3:
+ case 4:
+ case 5:
+ this.locToCrnStn1(crn, crnProtocol, sign[1]); // 鍑哄簱
+ break;
+ default:
+ break;
+ }
+ crnProtocol.setLastIo("I");
+ } else if (basCrnp.getInEnable().equals("Y")) {
+ switch (crn.getId()){
+ case 3:
+ case 4:
+ case 5:
+ this.crnStnToLoc1(crn, crnProtocol, sign[1]); // 鍏ュ簱
+ break;
+ default:
+ break;
+ }
+ crnProtocol.setLastIo("O");
+ }
+ }
+ }
+
// 搴撲綅绉昏浆
this.locToLoc(crn, crnProtocol);
// this.crnRebackHp(crnProtocol, crnThread);
@@ -1703,7 +1822,7 @@
* 鍏ュ簱 ===>> 鍫嗗灈鏈虹珯鍒板簱浣�
* 2022-12-03 TQS淇敼锛屽厛閬嶅巻鏌ヨ鍚屽彴鍫嗗灈鏈哄伐浣滄。鎵�鏈夌珯鐐瑰叆搴撲换鍔IST锛屾牴鎹伐浣滄。浠诲姟鎺掑簭浼樺厛绾ч珮浜� 鏍规嵁鍫嗗灈鏈哄叆搴撶珯鐐规帓搴�
*/
- public synchronized void crnStnToLoc1(CrnSlave slave, CrnProtocol crnProtocol) {
+ public synchronized void crnStnToLoc1(CrnSlave slave, CrnProtocol crnProtocol, Integer crnStation) {
List<WrkMast> wrkMasts = wrkMastMapper.selectPakInStep12(slave.getId());
for(WrkMast wrkMast : wrkMasts){
if (wrkMast == null) {
@@ -1755,10 +1874,21 @@
continue;
}
- // 鍫嗗灈鏈烘帶鍒惰繃婊�
- if (!crnProtocol.getStatusType().equals(CrnStatusType.IDLE) || crnProtocol.getTaskNo() != 0) {
- continue;
+ //宸ヤ綅
+ if (crnStation == 1){
+ // 鍫嗗灈鏈烘帶鍒惰繃婊�
+ if (!crnProtocol.getStatusType().equals(CrnStatusType.IDLE) || crnProtocol.getTaskNo() != 0) {
+ break;
+ }
+ }else if(crnStation == 2){
+ // 鍫嗗灈鏈烘帶鍒惰繃婊�
+ if (!crnProtocol.getStatusTypeTwo().equals(CrnStatusType.IDLE) || crnProtocol.getTaskNoTwo() != 0) {
+ break;
+ }
+ }else {
+ break;
}
+
// 宸茬粡瀛樺湪鍚婅溅鎵ц浠诲姟鏃讹紝鍒欒繃婊�
if (wrkMastMapper.selectWorking(slave.getId()) != null) {
@@ -1815,7 +1945,7 @@
crnCommand.setDestinationPosX(locMast.getRow1().shortValue()); // 鐩爣搴撲綅鎺�
crnCommand.setDestinationPosY(locMast.getBay1().shortValue()); // 鐩爣搴撲綅鍒�
crnCommand.setDestinationPosZ(locMast.getLev1().shortValue()); // 鐩爣搴撲綅灞�
- if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) {
+ if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(crnStation==1? 2:5, crnCommand))) {
log.error("鍫嗗灈鏈哄懡浠や笅鍙戝け璐ワ紝鍫嗗灈鏈哄彿={}锛屼换鍔℃暟鎹�={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand));
} else {
// 淇敼宸ヤ綔妗g姸鎬� 2.璁惧涓婅蛋 => 3.鍚婅溅鍏ュ簱涓�
@@ -1828,7 +1958,6 @@
}
}
}
-
}
/**
@@ -2107,7 +2236,7 @@
* 鍑哄簱 ===>> 搴撲綅鍒板爢鍨涙満绔�
* 2022-12-03 TQS淇敼锛屽厛閬嶅巻鏌ヨ宸ヤ綔妗f墍鏈夌珯鐐瑰嚭搴撲换鍔IST锛屾牴鎹伐浣滄。浠诲姟鎺掑簭浼樺厛绾ч珮浜� 鏍规嵁鍫嗗灈鏈哄叆搴撶珯鐐规帓搴�
*/
- public synchronized void locToCrnStn1(CrnSlave slave, CrnProtocol crnProtocol) {
+ public synchronized void locToCrnStn1(CrnSlave slave, CrnProtocol crnProtocol, Integer crnStation) {
List<WrkMast> wrkMasts = wrkMastMapper.selectPakOutStep12(slave.getId());
for (WrkMast wrkMast : wrkMasts) {
if (wrkMast == null) {
@@ -2171,9 +2300,21 @@
&& staProtocol.getWorkNo() == 0 && staProtocol.isOutEnable()) {
// 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
- // 鍫嗗灈鏈烘帶鍒惰繃婊�
- if (!crnProtocol.getStatusType().equals(CrnStatusType.IDLE) || crnProtocol.getTaskNo() != 0) {
+
+ //宸ヤ綅
+ if (crnStation == 1){
+ // 鍫嗗灈鏈烘帶鍒惰繃婊�
+ if (!crnProtocol.getStatusType().equals(CrnStatusType.IDLE) || crnProtocol.getTaskNo() != 0) {
// continue;
+ break;
+ }
+ }else if(crnStation == 2){
+ // 鍫嗗灈鏈烘帶鍒惰繃婊�
+ if (!crnProtocol.getStatusTypeTwo().equals(CrnStatusType.IDLE) || crnProtocol.getTaskNoTwo() != 0) {
+// continue;
+ break;
+ }
+ }else {
break;
}
@@ -2239,7 +2380,7 @@
crnCommand.setDestinationPosX(crnStn.getRow().shortValue()); // 鐩爣搴撲綅鎺�
crnCommand.setDestinationPosY(crnStn.getBay().shortValue()); // 鐩爣搴撲綅鍒�
crnCommand.setDestinationPosZ(crnStn.getLev().shortValue()); // 鐩爣搴撲綅灞�
- if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) {
+ if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(crnStation==1? 2:5, crnCommand))) {
log.error("鍫嗗灈鏈哄懡浠や笅鍙戝け璐ワ紝鍫嗗灈鏈哄彿={}锛屼换鍔℃暟鎹�={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand));
} else {
// 淇敼宸ヤ綔妗g姸鎬� 11.鐢熸垚鍑哄簱ID => 12.鍚婅溅鍑哄簱涓�
diff --git a/src/main/java/com/zy/core/MainProcess.java b/src/main/java/com/zy/core/MainProcess.java
index eefaa78..d8046a1 100644
--- a/src/main/java/com/zy/core/MainProcess.java
+++ b/src/main/java/com/zy/core/MainProcess.java
@@ -70,6 +70,8 @@
mainService.crnStnToOutStn();
// 鍏ュ嚭搴� ===>> 鍫嗗灈鏈哄叆鍑哄簱浣滀笟涓嬪彂
mainService.crnIoExecute();
+ // 鍏ュ嚭搴� ===>> 鍫嗗灈鏈哄叆鍑哄簱浣滀笟涓嬪彂 鍙屽伐浣嶅爢鍨涙満
+ mainService.crnIoExecuteTwo();
// 鍏ュ嚭搴撳寮� ===>> 鍫嗗灈鏈哄懡浠や笅鍙戝悗锛屽紓姝ヤ慨鏀瑰伐浣滄。鐘舵��
// mainService.crnIoWrkMast();
// 鍏ュ簱 ===>> 鎵ц瀵瑰伐浣滄。鐨勫畬鎴愭搷浣�
diff --git a/src/main/java/com/zy/core/model/protocol/CrnProtocol.java b/src/main/java/com/zy/core/model/protocol/CrnProtocol.java
index a63b90b..30c7d1e 100644
--- a/src/main/java/com/zy/core/model/protocol/CrnProtocol.java
+++ b/src/main/java/com/zy/core/model/protocol/CrnProtocol.java
@@ -33,11 +33,13 @@
* 寮傚父鐮�
*/
public Short alarm;
+ public Short alarmTwo;
/**
* 浠诲姟鍙�
*/
public Short taskNo = 0;
+ public Short taskNoTwo = 0;
/**
* 鍫嗗灈鏈哄綋鍓嶇姸鎬�
@@ -53,11 +55,13 @@
* 99锛氭姤璀�
*/
public Short status;
+ public Short statusTwo;
/**
* 鐘舵�佹灇涓�
*/
public CrnStatusType statusType;
+ public CrnStatusType statusTypeTwo;
/**
* 鍫嗗灈鏈哄綋鍓嶅垪鍙�
@@ -76,8 +80,10 @@
* 2 = 璐у弶鍦ㄥ彸渚�
*/
public Short forkPos;
+ public Short forkPosTwo;
public CrnForkPosType forkPosType;
+ public CrnForkPosType forkPosTypeTwo;
/**
* 褰撳墠杞借揣鍙颁綅缃�
@@ -85,8 +91,10 @@
* 1 = 涓婂畾浣�
*/
public Short liftPos;
+ public Short liftPosTwo;
public CrnLiftPosType liftPosType;
+ public CrnLiftPosType liftPosTypeTwo;
/**
* 璧拌鍦ㄥ畾浣�
@@ -99,6 +107,7 @@
* 杞借揣鍙版湁鐗�
*/
public Short loaded;
+ public Short loadedTwo;
private Short temp1;
@@ -207,6 +216,16 @@
this.forkPos = CrnForkPosType.get(type).id.shortValue();
}
+ public void setForkPosTwo(Short forkPosTwo) {
+ this.forkPosTwo = forkPosTwo;
+ this.forkPosTypeTwo = CrnForkPosType.get(forkPosTwo);
+ }
+
+ public void setForkPosTwo(CrnForkPosType typeTwo) {
+ this.forkPosTypeTwo = typeTwo;
+ this.forkPosTwo = CrnForkPosType.get(typeTwo).id.shortValue();
+ }
+
public void setLiftPos(Short liftPos) {
this.liftPos = liftPos;
this.liftPosType = CrnLiftPosType.get(liftPos);
@@ -217,9 +236,24 @@
this.liftPos = CrnLiftPosType.get(type).id.shortValue();
}
+ public void setLiftPosTwo(Short liftPosTwo) {
+ this.liftPosTwo = liftPosTwo;
+ this.liftPosTypeTwo = CrnLiftPosType.get(liftPosTwo);
+ }
+
+ public void setLiftPosTwo(CrnLiftPosType typeTwo) {
+ this.liftPosTypeTwo = typeTwo;
+ this.liftPosTwo = CrnLiftPosType.get(typeTwo).id.shortValue();
+ }
+
public void setStatus(Short status){
this.status = status;
this.statusType = CrnStatusType.get(status);
+ }
+
+ public void setStatusTwo(Short statusTwo){
+ this.statusTwo = statusTwo;
+ this.statusTypeTwo = CrnStatusType.get(statusTwo);
}
public void setStatus(CrnStatusType type){
@@ -248,6 +282,7 @@
basCrnp.setCrnErr(alarm.longValue());
}
basCrnp.setWrkNo(taskNo.intValue());
+ basCrnp.setWrkNoTwo(taskNoTwo.intValue());
return basCrnp;
}
diff --git a/src/main/java/com/zy/core/thread/SiemensCrnThread.java b/src/main/java/com/zy/core/thread/SiemensCrnThread.java
index 3da01f5..3990184 100644
--- a/src/main/java/com/zy/core/thread/SiemensCrnThread.java
+++ b/src/main/java/com/zy/core/thread/SiemensCrnThread.java
@@ -90,6 +90,28 @@
command.setDestinationPosZ((short)0); // 鐩爣搴撲綅灞�
write(command);
break;
+ // 鍐欏叆鏁版嵁
+ case 5:
+ write5((CrnCommand) task.getData());
+ break;
+ // 澶嶄綅
+ case 6:
+ CrnCommand command2 = (CrnCommand) task.getData();
+ if (null == command2) {
+ command2 = new CrnCommand();
+ }
+ command2.setCrnNo(slave.getId()); // 鍫嗗灈鏈虹紪鍙�
+ command2.setTaskNo((short) 0); // 宸ヤ綔鍙�
+ command2.setAckFinish((short) 1); // 浠诲姟瀹屾垚纭浣�
+ command2.setTaskMode(CrnTaskModeType.NONE); // 浠诲姟妯″紡
+ command2.setSourcePosX((short)0); // 婧愬簱浣嶆帓
+ command2.setSourcePosY((short)0); // 婧愬簱浣嶅垪
+ command2.setSourcePosZ((short)0); // 婧愬簱浣嶅眰
+ command2.setDestinationPosX((short)0); // 鐩爣搴撲綅鎺�
+ command2.setDestinationPosY((short)0); // 鐩爣搴撲綅鍒�
+ command2.setDestinationPosZ((short)0); // 鐩爣搴撲綅灞�
+ write5(command2);
+ break;
default:
break;
}
@@ -181,6 +203,14 @@
crnProtocol.setxDuration(siemensNet.getByteTransform().TransInt16(result.Content, 48));
crnProtocol.setyDuration(siemensNet.getByteTransform().TransInt16(result.Content, 52));
+
+ //宸ヤ綅2鏁版嵁 鏃犲垯鏃犻渶渚嬩細
+ crnProtocol.setTaskNoTwo(siemensNet.getByteTransform().TransInt16(result.Content, 56));
+ crnProtocol.setStatusTwo(siemensNet.getByteTransform().TransInt16(result.Content, 56));
+ crnProtocol.setForkPosTwo(siemensNet.getByteTransform().TransInt16(result.Content, 58));
+ crnProtocol.setLiftPosTwo(siemensNet.getByteTransform().TransInt16(result.Content, 60));
+ crnProtocol.setLoadedTwo(siemensNet.getByteTransform().TransInt16(result.Content, 64));
+
OutputQueue.CRN.offer(MessageFormat.format("銆恵0}銆慬id:{1}] <<<<< 瀹炴椂鏁版嵁鏇存柊鎴愬姛",DateUtils.convert(new Date()), slave.getId()));
// 澶嶄綅淇″彿
@@ -299,6 +329,74 @@
}
}
+ /**
+ * 鍐欏叆鏁版嵁 宸ヤ綅2
+ */
+ private boolean write5(CrnCommand command) throws InterruptedException {
+ if (null == command) {
+ log.error("鍫嗗灈鏈哄啓鍏ュ懡浠や负绌�");
+ return false;
+ }
+// convertRow(command);
+ command.setCrnNo(slave.getId());
+ short[] array = new short[9];
+// array[0] = command.getAckFinish();
+ array[0] = command.getTaskNo();
+ array[1] = command.getTaskMode();
+ array[2] = command.getSourcePosX();
+ array[3] = command.getSourcePosY();
+ array[4] = command.getSourcePosZ();
+ array[5] = command.getDestinationPosX();
+ array[6] = command.getDestinationPosY();
+ array[7] = command.getDestinationPosZ();
+// array[9] = command.getSourceStaNo();
+// array[10] = command.getDestinationStaNo();
+ array[9] = command.getCommand();
+ OperateResult result = siemensNet.Write("DB100.0", command.getAckFinish());
+ OperateResult result2 = siemensNet.Write("DB100.20", array);
+
+ if (command.getAckFinish() == 0) {
+ short commandFinish = 1;
+ Thread.sleep(100L);
+ result = siemensNet.Write("DB100.38", commandFinish);
+ }
+
+ try {
+ // 鏃ュ織璁板綍
+ BasCrnOptService bean = SpringUtils.getBean(BasCrnOptService.class);
+ BasCrnOpt basCrnOpt = new BasCrnOpt(
+ command.getTaskNo().intValue(), // 浠诲姟鍙�
+ command.getCrnNo(), // 鍫嗗灈鏈篬闈炵┖]
+ new Date(), // 涓嬪彂鏃堕棿
+ command.getTaskModeType().toString(), // 妯″紡
+ command.getSourcePosX().intValue(), // 婧愭帓
+ command.getSourcePosY().intValue(), // 婧愬垪
+ command.getSourcePosZ().intValue(), // 婧愬眰
+ null, // 婧愮珯
+ command.getDestinationPosX().intValue(), // 鐩爣鎺�
+ command.getDestinationPosY().intValue(), // 鐩爣鍒�
+ command.getDestinationPosZ().intValue(), // 鐩爣灞�
+ null, // 鐩爣绔�
+ null, // 鍝嶅簲缁撴灉
+ null, // 淇敼鏃堕棿
+ null // 淇敼浜哄憳
+ );
+ bean.insert(basCrnOpt);
+ } catch (Exception ignore) {}
+
+ if (result != null && result.IsSuccess) {
+ Thread.sleep(200);
+ this.readStatus();
+ log.info("鍫嗗灈鏈哄懡浠や笅鍙慬id:{}] >>>>> {}", slave.getId(), JSON.toJSON(command));
+ OutputQueue.CRN.offer(MessageFormat.format("銆恵0}銆慬id:{1}] >>>>> 鍛戒护涓嬪彂锛� {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(command)));
+ return true;
+ } else {
+ OutputQueue.CRN.offer(MessageFormat.format("銆恵0}銆戝啓鍏ュ爢鍨涙満plc鏁版嵁澶辫触 ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort()));
+ log.error("鍐欏叆鍫嗗灈鏈簆lc鏁版嵁澶辫触 ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort());
+ return false;
+ }
+ }
+
@Override
public void close() {
diff --git a/src/main/resources/mapper/BasCrnpMapper.xml b/src/main/resources/mapper/BasCrnpMapper.xml
index b9a10bc..8cf886b 100644
--- a/src/main/resources/mapper/BasCrnpMapper.xml
+++ b/src/main/resources/mapper/BasCrnpMapper.xml
@@ -9,6 +9,7 @@
<result column="out_enable" property="outEnable" />
<result column="crn_sts" property="crnSts" />
<result column="wrk_no" property="wrkNo" />
+ <result column="wrk_no_two" property="wrkNoTwo" />
<result column="crn_err" property="crnErr" />
<result column="frm_locno" property="frmLocno" />
<result column="frm_sta" property="frmSta" />
--
Gitblit v1.9.1