From 8b4febd729af9cdeb5e07b41bc988c017963faf0 Mon Sep 17 00:00:00 2001 From: "xiangwei.zhang" <752558143@qq.com> Date: Thu, 10 Apr 2025 15:40:07 +0800 Subject: [PATCH] =?UTF-8?q?46229=20PCN=EF=BC=9A=E5=AE=A2=E9=80=80=E5=93=81?= =?UTF-8?q?=E7=94=B5=E5=AD=90=E5=8C=96=E6=A3=80=E9=AA=8C=EF=BC=8C=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E7=BA=BF=E9=9C=80=E8=A6=81=E6=94=AF=E6=8C=81=E6=89=AB?= =?UTF-8?q?=E6=8F=8F=E5=AE=A2=E6=88=B7=E6=9D=A1=E7=A0=81=E5=92=8C=E5=B7=A5?= =?UTF-8?q?=E5=8D=95=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pcn/apiservice/controller/base/MesWhiteController.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/base/MesWhiteController.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/base/MesWhiteController.java index 1b0ae92..49442ae 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/base/MesWhiteController.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/base/MesWhiteController.java @@ -5,6 +5,7 @@ import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi.MesConfigService; import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi.MesProduceSnExtService; import cn.estsh.impp.framework.boot.util.ResultBean; import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSONObject; import io.swagger.annotations.Api; import jodd.util.Base64; import lombok.extern.slf4j.Slf4j; @@ -43,7 +44,7 @@ public class MesWhiteController { @PostMapping("/picture") public ResultBean savePicture(@RequestBody MesPictureModel model){ - log.info("castle-保存图片开始"); + log.info("castle-保存图片开始 model={}", JSONObject.toJSONString(model)); String localUrl = mesConfigService.getCfgValue(model.getOrganizeCode(), "LOCAL_PICTURE_ABS_URL"); String fileName = localUrl+model.getFileName(); File file = new File(fileName); @@ -60,10 +61,14 @@ public class MesWhiteController { if (!StringUtils.isBlank(model.getRemoteUserName()) && !StringUtils.isBlank(model.getRemoteNginxUrl()) ){ // 构建scp命令 log.info("castle-保存图片开始-scp命令"); - String scpCommand = String.format("scp -P %s %s %s@%s:%s", model.getRemotePort() ,fileName, model.getRemoteUserName(), model.getRemoteNginxUrl(), localUrl); + String scpCommand = String.format("scp %s %s@%s:%s" ,fileName, model.getRemoteUserName(), model.getRemoteNginxUrl(), localUrl); + log.info("castle-保存图片开始-scp命令开始={}",scpCommand); + try { Runtime.getRuntime().exec(scpCommand); - } catch (IOException e) { + log.info("castle-保存图片开始-scp命令结束={}",scpCommand); + + } catch (Exception e) { log.error("调用scp命令失败,请手动同步图片:{}",fileName); } }