From 9c32918e2d2db0dcc8b3a3af2be72831252019d9 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期六, 08 二月 2025 09:28:02 +0800
Subject: [PATCH] 涉嫌偷水功能完善代码
---
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeCtrl.java | 66 ++++++++++++++++++++++++++-------
1 files changed, 52 insertions(+), 14 deletions(-)
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeCtrl.java
index d5929d6..77eb655 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeCtrl.java
@@ -3,7 +3,6 @@
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.support.ExcelTypeEnum;
import com.dy.common.aop.SsoAop;
-import com.dy.common.softUpgrade.state.UpgradeRtu;
import com.dy.common.softUpgrade.state.UpgradeTaskVo;
import com.dy.common.springUtil.SpringContextUtil;
import com.dy.common.webUtil.BaseResponse;
@@ -12,9 +11,9 @@
import com.dy.common.webUtil.ResultCodeMsg;
import com.dy.pipIrrGlobal.pojoUg.UgRtuProgram;
import com.dy.pipIrrGlobal.pojoUg.UgRtuTask;
-import com.dy.pipIrrGlobal.rtuMw.ToRtuMwCom;
-import com.dy.pipIrrGlobal.voPr.VoDivide;
-import com.dy.pipIrrGlobal.voUg.VoUgRtuResult;
+import com.dy.pipIrrGlobal.rtuMw.Web2RtuMw;
+import com.dy.pipIrrGlobal.voUg.VoUgRtuResult4Failure;
+import com.dy.pipIrrGlobal.voUg.VoUgRtuResult4Success;
import com.dy.pipIrrGlobal.voUg.VoWatch;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
@@ -35,7 +34,6 @@
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
-import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
@@ -48,7 +46,7 @@
@Tag(name = "rtu杩滅▼鍗囩骇浠诲姟", description = "rtu杩滅▼鍗囩骇浠诲姟鐩稿叧鎿嶄綔")
@RestController
@RequestMapping(path = "rtuUpgrade")
-public class RtuUpgradeCtrl extends ToRtuMwCom {
+public class RtuUpgradeCtrl extends Web2RtuMw {
@Autowired
private RtuUpgradeSv sv ;
@@ -108,8 +106,8 @@
vo.rtuAddrList = taskRtuAddrs ;
vo.callbackWebUrl = ugCallbackUrl_rm ;
- String ugSendUrl = this.getToMwUgUrl(this.env) ;
- BaseResponse res = sendUpgradeTask2Mw(restTemplate, ugSendUrl, vo) ;
+ String rqUrl = this.get2MwRequestUrl(this.env, ContextUgTaskSend) ;
+ BaseResponse res = sendPostRequest2Mw(restTemplate, rqUrl, vo) ;
if(res != null){
if(res.isSuccess()){
this.sv.setUpgradeTaskExecuted(id);
@@ -119,14 +117,54 @@
if(msg == null){
msg = res.getMsg() ;
}
- log.error("閫氫俊涓棿浠舵墽琛屼笅鍙戝崌绾т换鍔″け璐�" + msg) ;
- return BaseResponseUtils.buildErrorMsg("閫氫俊涓棿浠舵墽琛屽け璐�" + msg) ;
+ log.error("閫氫俊涓棿浠舵墽琛屼笅鍙戝崌绾т换鍔″け璐ワ紝" + msg) ;
+ return BaseResponseUtils.buildErrorMsg("閫氫俊涓棿浠舵墽琛屽け璐ワ紝" + msg) ;
}
}else{
log.error("閫氫俊涓棿浠惰繑鍥炵粨鏋滀负null") ;
return BaseResponseUtils.buildErrorMsg("閫氫俊涓棿浠惰繑鍥炵粨鏋滀负null") ;
}
}
+ /**
+ * 涓嬪彂寮哄埗缁撴潫褰撳墠rtu杩滅▼鍗囩骇浠诲姟
+ * @return 鎿嶄綔缁撴灉
+ */
+ @Operation(summary = "涓嬪彂寮哄埗缁撴潫褰撳墠rtu杩滅▼鍗囩骇浠诲姟", description = "涓嬪彂寮哄埗缁撴潫褰撳墠rtu杩滅▼鍗囩骇浠诲姟")
+ @ApiResponses(value = {
+ @ApiResponse(
+ responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
+ description = "杩斿洖鎿嶄綔鎴愬姛涓庡惁鏁版嵁锛圔aseResponse.content:Boolean锛�",
+ content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
+ schema = @Schema(implementation = String.class))}
+ )
+ })
+ @GetMapping(path = "/forceOver")
+ @SsoAop()
+ public BaseResponse<String> forceOver() {
+ String rqUrl = this.get2MwRequestUrl(this.env, ContextUgForceOver) ;
+ BaseResponse res = sendGetRequest2Mw(restTemplate, rqUrl) ;
+ if(res != null){
+ if(res.isSuccess()){
+ RtuUpgradeStateReceiverCtrl.afterMwForceOverCurUgTask();
+ String msg = res.getContent()==null?null:(String)res.getContent() ;
+ if(msg == null){
+ msg = res.getMsg() ;
+ }
+ return BaseResponseUtils.buildResult(ResultCodeMsg.RsCode.SUCCESS_CODE, msg, msg) ;
+ }else{
+ String msg = res.getContent()==null?null:(String)res.getContent() ;
+ if(msg == null){
+ msg = res.getMsg() ;
+ }
+ log.error("閫氫俊涓棿浠舵墽琛屼笅鍙戝己鍒剁粨鏉熷綋鍓峳tu杩滅▼鍗囩骇浠诲姟澶辫触锛�" + msg) ;
+ return BaseResponseUtils.buildErrorMsg("閫氫俊涓棿浠舵墽琛屽己鍒剁粨鏉熷綋鍓峳tu杩滅▼鍗囩骇浠诲姟澶辫触锛�" + msg) ;
+ }
+ }else{
+ log.error("閫氫俊涓棿浠惰繑鍥炵粨鏋滀负null") ;
+ return BaseResponseUtils.buildErrorMsg("閫氫俊涓棿浠惰繑鍥炵粨鏋滀负null") ;
+ }
+ }
+
private void valueFromPo(UpgradeTaskVo vo, UgRtuTask tpo, UgRtuProgram ppo){
vo.id = "" + tpo.id ;
@@ -196,9 +234,9 @@
@RequestMapping(value = "/exportUgFail", method = RequestMethod.GET)
public void exportUgFail(HttpServletResponse response) throws Exception {
setExcelRespProp(response, "鍗囩骇澶辫触RTU鍒楄〃");
- List<VoUgRtuResult> rsList = resSv.exportUgFail();
+ List<VoUgRtuResult4Failure> rsList = resSv.exportUgFail();
EasyExcel.write(response.getOutputStream())
- .head(VoUgRtuResult.class)
+ .head(VoUgRtuResult4Failure.class)
.excelType(ExcelTypeEnum.XLSX)
.sheet("鍗囩骇澶辫触RTU鍒楄〃")
.doWrite(rsList);
@@ -212,9 +250,9 @@
@RequestMapping(value = "/exportUgSuccess", method = RequestMethod.GET)
public void exportUgSuccess(HttpServletResponse response) throws Exception {
setExcelRespProp(response, "鍗囩骇鎴愬姛RTU鍒楄〃");
- List<VoUgRtuResult> rsList = resSv.exportUgSuccess();
+ List<VoUgRtuResult4Success> rsList = resSv.exportUgSuccess();
EasyExcel.write(response.getOutputStream())
- .head(VoUgRtuResult.class)
+ .head(VoUgRtuResult4Success.class)
.excelType(ExcelTypeEnum.XLSX)
.sheet("鍗囩骇鎴愬姛RTU鍒楄〃")
.doWrite(rsList);
--
Gitblit v1.8.0