|
@@ -104,6 +104,7 @@ public class ProgramServiceImpl extends SuperServiceImpl<ProgramMapper, Program>
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
//上传接口
|
|
//上传接口
|
|
Productionresource productionresource = productionresourceMapper.selectById(data.getResourceId());
|
|
Productionresource productionresource = productionresourceMapper.selectById(data.getResourceId());
|
|
|
|
+ Module resourceModule = moduleService.getById(productionresource.getModuleId());
|
|
List<Map<String, String>> fileList = new ArrayList<Map<String, String>>();
|
|
List<Map<String, String>> fileList = new ArrayList<Map<String, String>>();
|
|
Map<String, String> m = new HashMap<>();
|
|
Map<String, String> m = new HashMap<>();
|
|
// m.put("fileName", data.getSubmittedFileName());
|
|
// m.put("fileName", data.getSubmittedFileName());
|
|
@@ -123,7 +124,17 @@ public class ProgramServiceImpl extends SuperServiceImpl<ProgramMapper, Program>
|
|
HttpEntity<String> formEntity = new HttpEntity<String>(jsonParam, headers);
|
|
HttpEntity<String> formEntity = new HttpEntity<String>(jsonParam, headers);
|
|
//调用接口
|
|
//调用接口
|
|
// String returnData = restTemplate.postForObject(UrlConfConstant.plcURL, formEntity, String.class);
|
|
// String returnData = restTemplate.postForObject(UrlConfConstant.plcURL, formEntity, String.class);
|
|
|
|
+ String localFolder = uploadFolder + "0000/cncFile/" + productionresource.getId();
|
|
|
|
+ String fileName = data.getFilePath().substring(data.getFilePath().lastIndexOf("/") + 1);
|
|
|
|
+ String localFilePathName = localFolder + "/" + fileName;
|
|
|
|
+ // TODO 西门子程序scp上传
|
|
|
|
+ String ip = productionresource.getIp();
|
|
|
|
+ String port = "22";
|
|
|
|
+ String userName = "manufact";
|
|
|
|
+ String password = "SUNRISE";
|
|
|
|
+ Scpclient scpclient = new Scpclient(ip,Integer.valueOf(port),userName,password);
|
|
|
|
|
|
|
|
+ scpclient.uploadFileIO(localFilePathName,fileName,resourceModule.getCncFilePath());
|
|
Program program = BeanPlusUtil.toBean(data, Program.class);
|
|
Program program = BeanPlusUtil.toBean(data, Program.class);
|
|
//根据编码规则
|
|
//根据编码规则
|
|
save(program);
|
|
save(program);
|