From 37ad41fcac6e1e465db4f9bca397f1e26baa66ab Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期二, 19 十一月 2024 10:28:01 +0800
Subject: [PATCH] 修改设备升级任务实现算法,使其运行更安全
---
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeCtrl.java | 12 ++++++++----
1 files changed, 8 insertions(+), 4 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 1308504..da10742 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
@@ -29,6 +29,7 @@
import org.springframework.web.client.RestTemplate;
import java.util.ArrayList;
+import java.util.Base64;
import java.util.List;
/**
@@ -67,7 +68,7 @@
@GetMapping(path = "/issuedTask")
@SsoAop()
public BaseResponse<Boolean> issuedTask(String id){
- if(id == null || !id.trim().equals("")){
+ if(id == null || id.trim().equals("")){
return BaseResponseUtils.buildError("浠诲姟id涓嶈兘涓虹┖") ;
}
UgRtuTask tpo = this.sv.selectTaskById(id) ;
@@ -87,7 +88,7 @@
return BaseResponseUtils.buildError("浠诲姟鎵�娑夊強鐨勬帶鍒跺櫒杩樻湭璁剧疆") ;
}
- String ugCallbackUrl_rm = env.getProperty("mw." + DataSourceContext.get() + ".ugCallbackUrl_rm" );
+ String ugCallbackUrl_rm = env.getProperty("mw.ugCallbackUrl_rm" );
if(ugCallbackUrl_rm == null || ugCallbackUrl_rm.trim().equals("")){
return BaseResponseUtils.buildError("鏈厤缃崌绾т换鍔″洖璋冪綉鍧�") ;
}
@@ -118,7 +119,8 @@
vo.softFileName = ppo.hexFileName ;
vo.softStoreAddr = ppo.storeRamAddr ;
vo.softStartAddr = ppo.startRamAddr ;
- vo.softFileData = ppo.programBytes ;
+ vo.softFileData64 = Base64.getEncoder().encodeToString(ppo.programBytes) ;
+ //vo.softFileData = ppo.programBytes ;
vo.softBytesCalculate = ppo.programCalculateBytes ;
vo.softByteSrc16 = ppo.programCrc16 ;
}
@@ -130,7 +132,7 @@
@GetMapping(path = "/demoReset")
@SsoAop()
public BaseResponse<Boolean> demoReset(){
- if(RtuUpgradeStateReceiverCtrl.cache == null){
+ if(RtuUpgradeStateReceiverCtrl.cache != null){
//return BaseResponseUtils.buildError("褰撳墠娌℃湁鍗囩骇浠诲姟") ;
//姝e紡杩愯鏃讹紝涓嬮潰涓よ鍘绘帀锛屼笂闈竴琛屾墦寮�
RtuUpgradeStateReceiverCtrl ctrl = SpringContextUtil.getBean(RtuUpgradeStateReceiverCtrl.class);
@@ -159,6 +161,8 @@
public BaseResponse<QueryResultVo<VoWatch> > curUpgradeState(QueryVo qvo){
if(qvo == null){
qvo = new QueryVo();
+ qvo.pageCurr = 1 ;
+ qvo.pageSize = 50 ;
}
if(RtuUpgradeStateReceiverCtrl.cache == null){
//return BaseResponseUtils.buildError("褰撳墠娌℃湁鍗囩骇浠诲姟") ;
--
Gitblit v1.8.0