|
@@ -79,7 +79,9 @@ public class TFurnancePressureController extends BaseController
|
|
|
public AjaxResult scan(@RequestParam("file") MultipartFile file,
|
|
|
@RequestParam("furnanceName") String furnanceName,
|
|
|
@RequestParam("pass") int pass,
|
|
|
- @RequestParam("isInlet") boolean isInlet) throws IOException {
|
|
|
+ @RequestParam("isInlet") boolean isInlet,
|
|
|
+ @RequestParam("pType") String pType,
|
|
|
+ @RequestParam("pId") String pId) throws IOException {
|
|
|
// 判断图片中的压力仪表数量
|
|
|
int num = 0;
|
|
|
switch (furnanceName) {
|
|
@@ -225,9 +227,28 @@ public class TFurnancePressureController extends BaseController
|
|
|
case "H130":
|
|
|
break;
|
|
|
}
|
|
|
+
|
|
|
+ // 上传图片
|
|
|
+ if (file.isEmpty())
|
|
|
+ {
|
|
|
+ return AjaxResult.error("上传失败,文件为空!");
|
|
|
+ }
|
|
|
+ String url = FileUploadUtils.upload(RuoYiConfig.getFilePath("/"+ pType), file);
|
|
|
+ long size = file.getSize()/1024;
|
|
|
+ TCommonfile tCommonfile = new TCommonfile();
|
|
|
+ tCommonfile.setFileUrl(url);
|
|
|
+ tCommonfile.setFileName(file.getOriginalFilename());
|
|
|
+ tCommonfile.setCreaterCode(String.valueOf(getUserId()));
|
|
|
+ tCommonfile.setpId(Long.parseLong(pId));
|
|
|
+ tCommonfile.setpType(pType);
|
|
|
+ tCommonfile.setFileSize(String.valueOf(size));
|
|
|
+ tCommonfileService.insertTCommonfile(tCommonfile);
|
|
|
+
|
|
|
//组装返回
|
|
|
JSONObject returnObj = new JSONObject();
|
|
|
returnObj.put("readings", newArray);
|
|
|
+ returnObj.put("fileName", tCommonfile.getFileName());
|
|
|
+ returnObj.put("url", tCommonfile.getFileUrl());
|
|
|
return AjaxResult.success(returnObj);
|
|
|
}
|
|
|
|