46229 PCN:客退品电子化检验,排序线需要支持扫描客户条码和工单号

dev_temp_xw_202504100000_46256
xiangwei.zhang 3 months ago
parent ad4c284b58
commit 8b4febd729

@ -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);
}
}

Loading…
Cancel
Save