This commit is contained in:
2025-07-24 14:42:45 +08:00
parent 38f0996185
commit 42df4fd084
2 changed files with 16 additions and 17 deletions

1
gatedge/.idea/.gitignore generated vendored
View File

@@ -3,4 +3,3 @@
/workspace.xml /workspace.xml
# 依赖于环境的 Maven 主目录路径 # 依赖于环境的 Maven 主目录路径
/mavenHomeManager.xml /mavenHomeManager.xml
../gatedge/target/

View File

@@ -35,7 +35,7 @@ public class SealedQuotationController {
private SealedQuotationService sealedQuotationService; private SealedQuotationService sealedQuotationService;
private ResponseBodyMessage responseBodyMessage; private ResponseBodyMessage responseBodyMessage;
//记录单据编号,用于上传到单据附件管理 // 记录单据编号,用于上传到单据附件管理
private String UploadFbillNo; private String UploadFbillNo;
@GetMapping("login") @GetMapping("login")
@@ -50,7 +50,7 @@ public class SealedQuotationController {
UploadFbillNo = map.get("UploadFbillNo"); UploadFbillNo = map.get("UploadFbillNo");
List<Entity> data = null; List<Entity> data = null;
if (sealedQuotationService.loginChack(map)) { if (sealedQuotationService.loginChack(map)) {
data= sealedQuotationService.queryData(FBILLNO); data = sealedQuotationService.queryData(FBILLNO);
} }
return ResultBuilder.buildEntitySuccess(data); return ResultBuilder.buildEntitySuccess(data);
} }
@@ -61,7 +61,7 @@ public class SealedQuotationController {
UploadFbillNo = map.get("UploadFbillNo"); UploadFbillNo = map.get("UploadFbillNo");
List<EntityItem> data = null; List<EntityItem> data = null;
if (sealedQuotationService.loginChack(map)) { if (sealedQuotationService.loginChack(map)) {
data= sealedQuotationService.queryDataItem(FBILLNO); data = sealedQuotationService.queryDataItem(FBILLNO);
} }
return ResultBuilder.buildEntitySuccess(data); return ResultBuilder.buildEntitySuccess(data);
} }
@@ -74,17 +74,17 @@ public class SealedQuotationController {
@PostMapping("/upload") @PostMapping("/upload")
public ResponseBodyMessage upload(@RequestParam("file") MultipartFile file) throws IOException { public ResponseBodyMessage upload(@RequestParam("file") MultipartFile file) throws IOException {
if (!file.isEmpty()) { if (file.isEmpty()) {
//获取上传文件文件名 return new ResponseBodyMessage(0, "未选择文件,附近上传失败");
}
// 获取上传文件文件名
String fileName = file.getOriginalFilename(); String fileName = file.getOriginalFilename();
//获取上传文件的Base64 // 获取上传文件的Base64
BASE64Encoder base64Encoder =new BASE64Encoder(); BASE64Encoder base64Encoder = new BASE64Encoder();
String fileBase64 = base64Encoder.encode(file.getBytes()); String fileBase64 = base64Encoder.encode(file.getBytes());
String FIDrestful = sealedQuotationService.InterId(UploadFbillNo); String FIDrestful = sealedQuotationService.InterId(UploadFbillNo);
responseBodyMessage = sealedQuotationService.uploadFile(FIDrestful,fileName,fileBase64,UploadFbillNo); responseBodyMessage = sealedQuotationService.uploadFile(FIDrestful, fileName, fileBase64, UploadFbillNo);
System.out.println("解析JSON数据"+ responseBodyMessage.getMessage()); System.out.println("解析JSON数据" + responseBodyMessage.getMessage());
return responseBodyMessage; return responseBodyMessage;
} }
return new ResponseBodyMessage(0,"未选择文件,附近上传失败");
}
} }