From 4e4bcc8e95fef11e695d476da4e761399d3c7247 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期二, 19 十一月 2024 09:49:52 +0800 Subject: [PATCH] json传输byte[]数组,转换为base64编码 --- pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeCtrl.java | 10 ++++++---- 1 files changed, 6 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 9e20f75..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); -- Gitblit v1.8.0