Quellcode durchsuchen

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU/DAL-DAZHOU-API

txf vor 3 Jahren
Ursprung
Commit
92b59e410e

+ 21 - 0
src/main/java/com/steerinfo/dil/controller/OTMSController.java

@@ -17,6 +17,7 @@ import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartRequest;
 
 import java.awt.*;
+import java.io.File;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -82,18 +83,33 @@ public class OTMSController {
 
     @PostMapping(value = "/addTmstruckReceiptResult")
     public synchronized RESTfulResult addTmstruckReceiptResult(MultipartRequest request, Integer num, String orderNumber, String resultArrivalAddress, Integer imgcount3, Integer imgcount4) throws Exception {
+        //添加到files数组
         List<MultipartFile> files = new ArrayList<>();
+        //第一张和第二张必填
         files.add(request.getFile("file0"));
         files.add(request.getFile("file1"));
+        //第三张选填
         if (request.getFile("file2")!=null){
             files.add(request.getFile("file2"));
         }
+        //追加的三张,num=6则取到file3,4,5
+        for(int i=3;i<num;i++){
+            if(request.getFile("file"+i)!=null){
+                files.add(request.getFile("file"+i));
+            }
+        }
+        //上传图片,追加的三张图片放在fourFiles里
+        List<String> fourFiles=new ArrayList<>();
         Map<String,Object> mapValue=new HashMap<>();
         for (int i=0;i<files.size();i++){
             MultipartFile file=files.get(i);
             String url = imageFileUtils.updateFile(file);
             mapValue.put("url"+i,url);
+            if(i>=3) {
+                fourFiles.add(url);
+            }
         }
+        mapValue.put("fourFiles",fourFiles);
         return otmsFeign.addTmstruckReceiptResult(mapValue,num,orderNumber,resultArrivalAddress,imgcount3,imgcount4);
     }
 
@@ -180,4 +196,9 @@ public class OTMSController {
         return map;
     }
 
+    @GetMapping("/getCurrentLocation")
+    public RESTfulResult getCurrentLocation(@RequestParam("capcityNumber") String capcityNumber) throws Exception{
+        return otmsFeign.getCurrentLocation(capcityNumber);
+    }
+
 }

+ 3 - 4
src/main/java/com/steerinfo/dil/feign/OtmsFeign.java

@@ -4,10 +4,7 @@ import com.steerinfo.framework.controller.RESTfulResult;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.http.MediaType;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RequestPart;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.util.HashMap;
@@ -108,4 +105,6 @@ public interface OtmsFeign {
                                          @RequestParam String startTime,
                                          @RequestParam String endTime
     );
+    @GetMapping("/api/v1/otms/pathDisplay/getCurrentLocation")
+    public RESTfulResult getCurrentLocation(@RequestParam("capcityNumber") String capcityNumber) throws Exception;
 }

+ 1 - 1
src/main/resources/application-dev.yml

@@ -40,7 +40,7 @@ openfeign:
 piction:
   #path: /usr/share/nginx/html/image
   #path: /test/data/nginx/html/image
-  #path: C:\Users\24390\Desktop\work\a
+  #path: D:\Code\work\jpg
   path: /shared
 
 server: