Browse Source

Merge remote-tracking branch 'origin/master'

zengyf 2 years ago
parent
commit
8a6d514f06

+ 42 - 2
src/main/java/com/steerinfo/dil/controller/OTMSController.java

@@ -142,6 +142,48 @@ public class OTMSController {
         return otmsFeign.addTmstruckReceiptResult(mapValue,num,orderNumber,resultArrivalAddress,imgcount3,imgcount4);
     }
 
+    @ApiOperation(value = "新增签收网页端")
+    @PostMapping(value = "/addTmstruckReceiptResultForWeb")
+    public synchronized RESTfulResult addTmstruckReceiptResultForWeb(MultipartRequest request, Integer num, String orderNumber, String resultArrivalAddress, Integer imgcount3, Integer imgcount4) throws Exception {
+        //添加到files数组
+        List<MultipartFile> files = new ArrayList<>();
+        int index=-1;
+        for(int i=0;i<11;i++){
+            MultipartFile file = request.getFile("file"+i);
+            if(file!=null){
+                files.add(file);
+                if(index<0){
+                    index=i;
+                }
+            }
+        }
+        //没有上传,当做重复上传
+        if(files.size() == 0){
+            return  new RESTfulResult("201","若要重复上传,必须两张都是新图片!","请勿重复上传!");
+        }
+        //上传图片,拼接在一个url里
+        Map<String,Object> mapValue=new HashMap<>();
+        String url="";
+        try{
+            //如果存在预览图片,查询,把那个位置的图片截取下来
+            if(index > 0){
+                String[] receivePhoto=otmsFeign.getReceivingPhotoByUrl(orderNumber).split(";");
+                for(int i=0;i<index;i++){
+                    url=url+receivePhoto[i]+";";
+                }
+            }
+        }catch (Exception e){
+
+        }
+        //上传图片
+        for (int i=0;i<files.size();i++){
+            MultipartFile file=files.get(i);
+            url += imageFileUtils.updateFile(file,i)+';';
+        }
+        mapValue.put("url",url);
+        return otmsFeign.addTmstruckReceiptResult(mapValue,num,orderNumber,resultArrivalAddress,imgcount3,imgcount4);
+    }
+
     @ApiOperation(value="查询当前报警类型")
     @PostMapping(value = "/selectWarnSwitch")
     public RESTfulResult selectWarnSwitch(){
@@ -195,7 +237,6 @@ public class OTMSController {
             String arrivalPhoto=otmsFeign.getArrivalPhoto(orderNumber);
             return getPhotoByUrl(arrivalPhoto);
         }catch (Exception e){
-            e.printStackTrace();
             return null;
         }
     }
@@ -219,7 +260,6 @@ public class OTMSController {
             String receivePhoto=otmsFeign.getReceivingPhotoByUrl(orderNumber);
             return getPhotoByUrl(receivePhoto);
         }catch (Exception e){
-            e.printStackTrace();
             return null;
         }
     }

+ 4 - 1
src/main/resources/application-prod.yml

@@ -48,4 +48,7 @@ piction:
   path: /shared
   # path: C:\Users\zx\Pictures\test
 server:
-  port: 8080
+  port: 8080
+  tomcat:
+    max-threads: 1000
+    accept-count: 800