From 70cd3733e8d72a6bbcfcbfa78f8eecbdec7ee8f9 Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期四, 06 六月 2024 15:51:42 +0800
Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
---
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/valve/ValveCtrl.java | 114 +++++++++++++++++++++++++++++++++++++++------------------
1 files changed, 78 insertions(+), 36 deletions(-)
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/valve/ValveCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/valve/ValveCtrl.java
index b6036ba..ae3742c 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/valve/ValveCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/valve/ValveCtrl.java
@@ -23,8 +23,8 @@
import com.dy.pipIrrRemote.common.CommandSv;
import com.dy.pipIrrRemote.common.dto.ValveClose;
import com.dy.pipIrrRemote.common.dto.ValveOpen;
+import com.dy.pipIrrRemote.common.enums.LastOperateENUM;
import com.dy.pipIrrRemote.result.RemoteResultCode;
-import com.dy.pipIrrSell.virtualCard.enums.LastOperateENUM;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
@@ -58,7 +58,7 @@
private String rtuResultSendWebUrl = "http://127.0.0.1:8081/remote/comRes/receive" ;
/**
- * 灏忕▼搴忚繙绋嬪紑闃�
+ * 骞冲彴杩滅▼寮�闃�
* @param valve
* @param bindingResult
* @return
@@ -93,8 +93,6 @@
if(!setuped) {
setUp();
}
-// 鍙栨按鍙D鎹㈠彇姘村彛瀵硅薄
-// 濡傛灉鍙栨按鍙d负鎵撳紑鐘舵�侊紝鍒欎笉鍏佽琚紑闃�
// 铏氭嫙鍗D鎹㈣櫄鎷熷崱瀵硅薄
VoVirtualCard vc = commandSv.getVcById(vcId);
@@ -155,10 +153,10 @@
// 鍥炶皟澶辫触
if(!response_CallBack.getCode().equals("0001")) {
// 鍛戒护鏃ュ織鎵ц缁撴灉鏀逛负澶辫触
- rmCommandHistory = new RmCommandHistory();
- rmCommandHistory.setId(comId);
- rmCommandHistory.setResult((byte)0);
- commandSv.updateCommandResult(rmCommandHistory);
+ //rmCommandHistory = new RmCommandHistory();
+ //rmCommandHistory.setId(comId);
+ //rmCommandHistory.setResult((byte)0);
+ //commandSv.updateCommandResult(rmCommandHistory);
return BaseResponseUtils.buildFail(response_CallBack.getMsg());
//return BaseResponseUtils.buildFail(response_CallBack.getContent().toString());
}
@@ -177,16 +175,23 @@
* 鎵ц鎴愬姛
* 鏇存敼铏氭嫙鍗$姸鎬侊細鏄惁浣跨敤涓�佹渶鍚庢搷浣溿�佹渶鍚庢搷浣滄椂闂�
*/
- SeVirtualCard virtualCard = new SeVirtualCard();
- virtualCard.setId(vcId);
- virtualCard.setInUse((byte) 1);
- virtualCard.setLastOperate(LastOperateENUM.OPEN_VALVE.getCode());
- virtualCard.setLastOperateTime(new Date());
- seVirtualCardMapper.updateByPrimaryKeySelective(virtualCard);
+ //SeVirtualCard virtualCard = new SeVirtualCard();
+ //virtualCard.setId(vcId);
+ //virtualCard.setInUse((byte) 1);
+ //virtualCard.setLastOperate(LastOperateENUM.OPEN_VALVE.getCode());
+ //virtualCard.setLastOperateTime(new Date());
+ //seVirtualCardMapper.updateByPrimaryKeySelective(virtualCard);
// 鍥炶皟杩斿洖鐨勫唴瀹�
- Data myData = (Data)response_CallBack.getContent();
- return BaseResponseUtils.buildSuccess(myData) ;
+ //Data myData = (Data)response_CallBack.getContent();
+ //return BaseResponseUtils.buildSuccess(myData);
+
+ JSONObject job_response = new JSONObject();
+ job_response.put("rtuAddr", rtuAddr);
+ job_response.put("vcNum", vc.getVcNum());
+ job_response.put("orderNo", orderNo);
+ //job_response.put("operator", operator);
+ return BaseResponseUtils.buildSuccess(job_response);
} else {
// 璇锋眰澶辫触
JSONObject job_param = response_SendCom.getJSONObject("content").getJSONObject("param");
@@ -220,15 +225,29 @@
// 澶勭悊鍥炶皟
BaseResponse response_CallBack = dealWithCallBack(comId);
- //鍥炶皟澶辫触
+ //鍥炶皟寮傚父
if(!response_CallBack.getCode().equals("0001")) {
// 鍛戒护鏃ュ織鎵ц缁撴灉鏀逛负澶辫触
rmCommandHistory = new RmCommandHistory();
rmCommandHistory.setId(comId);
rmCommandHistory.setResult((byte)0);
commandSv.updateCommandResult(rmCommandHistory);
- return BaseResponseUtils.buildFail(response_CallBack.getMsg());
- //return BaseResponseUtils.buildFail(response_CallBack.getContent().toString());
+ return BaseResponseUtils.buildFail(response_CallBack.getContent().toString());
+ }
+
+ // 鍥炶皟瓒呮椂
+ if(response_CallBack.getContent().toString().equals(RemoteResultCode.GET_RESULT_IN_ONE_MINUTE.getMessage())) {
+ /**
+ * 绯婃帀瓒呮椂锛屾殏鏃惰涓烘墽琛屾垚鍔�
+ * 鏇存敼铏氭嫙鍗$姸鎬侊細鏄惁浣跨敤涓�佹渶鍚庢搷浣溿�佹渶鍚庢搷浣滄椂闂�
+ */
+ SeVirtualCard virtualCard = new SeVirtualCard();
+ virtualCard.setId(vcId);
+ virtualCard.setInUse((byte) 1);
+ virtualCard.setLastOperate(LastOperateENUM.OPEN_VALVE.getCode());
+ virtualCard.setLastOperateTime(new Date());
+ seVirtualCardMapper.updateByPrimaryKeySelective(virtualCard);
+ return BaseResponseUtils.buildSuccess(RemoteResultCode.GET_RESULT_IN_ONE_MINUTE.getMessage());
}
// 鍥炶皟鎴愬姛锛屽啀鍒ゆ柇鎵ц鏄惁鎴愬姛
@@ -253,8 +272,16 @@
seVirtualCardMapper.updateByPrimaryKeySelective(virtualCard);
// 鍥炶皟杩斿洖鐨勫唴瀹�
- Data myData = (Data)response_CallBack.getContent();
- return BaseResponseUtils.buildSuccess(myData) ;
+ //Data myData = (Data)response_CallBack.getContent();
+ //return BaseResponseUtils.buildSuccess(myData) ;
+
+ JSONObject job_response = new JSONObject();
+ job_response.put("rtuAddr", rtuAddr);
+ job_response.put("vcNum", vc.getVcNum());
+ job_response.put("orderNo", orderNo);
+ //job_response.put("operator", operator);
+ return BaseResponseUtils.buildSuccess(job_response);
+
} else {
// 璇锋眰澶辫触
JSONObject job_param = response_SendCom.getJSONObject("content").getJSONObject("param");
@@ -266,7 +293,7 @@
}
/**
- * 灏忕▼搴忚繙绋嬪叧闃�
+ * 骞冲彴杩滅▼鍏抽榾
* @param valve
* @param bindingResult
* @return
@@ -330,10 +357,10 @@
// 鍥炶皟澶辫触
if(!response_CallBack.getCode().equals("0001")) {
// 鍛戒护鏃ュ織鎵ц缁撴灉鏀逛负澶辫触
- rmCommandHistory = new RmCommandHistory();
- rmCommandHistory.setId(comId);
- rmCommandHistory.setResult((byte)0);
- commandSv.updateCommandResult(rmCommandHistory);
+ //rmCommandHistory = new RmCommandHistory();
+ //rmCommandHistory.setId(comId);
+ //rmCommandHistory.setResult((byte)0);
+ //commandSv.updateCommandResult(rmCommandHistory);
return BaseResponseUtils.buildFail(response_CallBack.getMsg());
//return BaseResponseUtils.buildError(WechatResultCode.GET_RESULT_ERROR.getMessage());
}
@@ -352,13 +379,13 @@
* 鎵ц鎴愬姛
* 鏇存敼铏氭嫙鍗$姸鎬侊細鏄惁浣跨敤涓�佹渶鍚庢搷浣溿�佹渶鍚庢搷浣滄椂闂�
*/
- Long vcId = seVirtualCardMapper.getVcIdByNum(vcNum);
- SeVirtualCard virtualCard = new SeVirtualCard();
- virtualCard.setId(vcId);
- virtualCard.setInUse((byte) 0);
- virtualCard.setLastOperate(LastOperateENUM.OPEN_VALVE.getCode());
- virtualCard.setLastOperateTime(new Date());
- seVirtualCardMapper.updateByPrimaryKeySelective(virtualCard);
+ //Long vcId = seVirtualCardMapper.getVcIdByNum(vcNum);
+ //SeVirtualCard virtualCard = new SeVirtualCard();
+ //virtualCard.setId(vcId);
+ //virtualCard.setInUse((byte) 0);
+ //virtualCard.setLastOperate(LastOperateENUM.OPEN_VALVE.getCode());
+ //virtualCard.setLastOperateTime(new Date());
+ //seVirtualCardMapper.updateByPrimaryKeySelective(virtualCard);
// 鍥炶皟杩斿洖鐨勫唴瀹�
Data myData = (Data)response_CallBack.getContent();
@@ -394,15 +421,30 @@
// 澶勭悊鍥炶皟
BaseResponse response_CallBack = dealWithCallBack(comId);
- // 鍥炶皟澶辫触
+ // 鍥炶皟寮傚父
if(!response_CallBack.getCode().equals("0001")) {
// 鍛戒护鏃ュ織鎵ц缁撴灉鏀逛负澶辫触
rmCommandHistory = new RmCommandHistory();
rmCommandHistory.setId(comId);
rmCommandHistory.setResult((byte)0);
commandSv.updateCommandResult(rmCommandHistory);
- return BaseResponseUtils.buildFail(response_CallBack.getMsg());
- //return BaseResponseUtils.buildError(WechatResultCode.GET_RESULT_ERROR.getMessage());
+ return BaseResponseUtils.buildFail(response_CallBack.getContent().toString());
+ }
+
+ // 鍥炶皟瓒呮椂
+ if(response_CallBack.getContent().toString().equals(RemoteResultCode.GET_RESULT_IN_ONE_MINUTE.getMessage())) {
+ /**
+ * 绯婃帀瓒呮椂锛屾殏鏃惰涓烘墽琛屾垚鍔�
+ * 鏇存敼铏氭嫙鍗$姸鎬侊細鏄惁浣跨敤涓�佹渶鍚庢搷浣溿�佹渶鍚庢搷浣滄椂闂�
+ */
+ Long vcId = seVirtualCardMapper.getVcIdByNum(vcNum);
+ SeVirtualCard virtualCard = new SeVirtualCard();
+ virtualCard.setId(vcId);
+ virtualCard.setInUse((byte) 0);
+ virtualCard.setLastOperate(LastOperateENUM.OPEN_VALVE.getCode());
+ virtualCard.setLastOperateTime(new Date());
+ seVirtualCardMapper.updateByPrimaryKeySelective(virtualCard);
+ return BaseResponseUtils.buildSuccess(RemoteResultCode.GET_RESULT_IN_ONE_MINUTE.getMessage());
}
// 鍥炶皟鎴愬姛锛屽啀鍒ゆ柇鎵ц鏄惁鎴愬姛
--
Gitblit v1.8.0