zishan-an 11 месяцев назад
Родитель
Сommit
d02f34a069
1 измененных файлов с 6 добавлено и 4 удалено
  1. 6 4
      src/main/java/com/kexun/controller/UploadController.java

+ 6 - 4
src/main/java/com/kexun/controller/UploadController.java

@@ -51,10 +51,11 @@ public class UploadController {
     private String jsonTargetPath;
 
     @PostMapping("/uploadUi")
-    public Result uploadUi(@RequestParam("files") MultipartFile[] files ) {
+    public Result uploadUi(@RequestParam("files") MultipartFile[] files ,@RequestParam("customerName") String customerName,
+                           @RequestParam("headInfId") String headInfId) {
         if(files.length>0) {
             for(MultipartFile file : files) {
-                String fileName = file.getOriginalFilename();
+                String fileName = customerName+"_"+headInfId+"_"+file.getOriginalFilename();
                 try{
                     String filePath = "";
                     if(fileName.endsWith("xml")){
@@ -95,10 +96,11 @@ public class UploadController {
     }
 
     @PostMapping("/uploadMod")
-    public Result uploadMod(@RequestParam("files") MultipartFile[] files ) {
+    public Result uploadMod(@RequestParam("files") MultipartFile[] files ,@RequestParam("customerName") String customerName,
+                            @RequestParam("headInfId") String headInfId) {
         if(files.length>0) {
             for(MultipartFile file : files) {
-                String fileName = file.getOriginalFilename();
+                String fileName = customerName+"_"+headInfId+"_"+file.getOriginalFilename();
                 try{
                     File mkdir = new File(modelPath);
                     if(!mkdir.exists()) {