Procházet zdrojové kódy

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

Redeem před 1 rokem
rodič
revize
835784fc8b

+ 85 - 7
src/main/java/com/steerinfo/dil/controller/OTMSController.java

@@ -85,7 +85,7 @@ public class OTMSController {
         //添加到files数组
         List<MultipartFile> files = new ArrayList<>();
         int index=-1;
-        for(int i = 0;i < 21; i++){
+        for(int i = 0;i < 99; i++){
             MultipartFile file = request.getFile("file"+i);
             if(file!=null){
                 files.add(file);
@@ -127,12 +127,54 @@ public class OTMSController {
         return result;
     }
 
+    @ApiOperation(value = "新增抵达-APP")
+    @PostMapping(value = "/addtmstruckArrivalResultApp")
+    public RESTfulResult addtmstruckArrivalResultApp(@RequestParam("orderNumber") String orderNumber, @RequestParam("resultArrivalAddress")String resultArrivalAddress, Long arrivalTime,String userName,  MultipartRequest request) throws Exception {
+        //查询旧图片
+        Map<String, Object> photoMap = otmsFeign.getArrivalPhotoPlus(orderNumber);
+        //上传图片,拼接在一个url里
+        Map<String,Object> mapValue=new HashMap<>();
+        String url="";
+        Boolean isUpload = false;
+        int workId = 1;
+        //四种图片
+        for(int i = 1;i < 5; i++){
+            String photo="";
+            //默认每种图片最多9张
+            for(int j = 0;j < 9; j++){
+                MultipartFile file = request.getFile("photo"+i+"_"+j);
+                if(file!=null){
+                    isUpload = true;
+                    String  fileName = imageFileUtils.updateFile(file,workId++)+';';
+                    photo += fileName ;
+                }
+            }
+            if(photo.equals("")){
+                //未上传,用已上传的字段
+                if(photoMap !=null && photoMap.get("photo"+i)!=null && !photoMap.get("photo"+i).equals("")){
+                    photo = photoMap.get("photo"+i).toString();
+                }else{
+                    throw new Exception("必填图片未上传!");
+                }
+            }
+            url += photo;
+            mapValue.put("photo"+i,photo);
+        }
+        //没有上传,当做重复上传
+        if(!isUpload){
+            return  new RESTfulResult("201","请勿重复上传!","请勿重复上传!");
+        }
+        mapValue.put("arrivalTime",arrivalTime);
+        RESTfulResult result = otmsFeign.addtmstruckArrivalResultApp(mapValue,orderNumber,resultArrivalAddress,url);
+        return result;
+    }
+
     @ApiOperation(value = "新增签收")
     @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<>();
-        for(int i=0;i<21;i++){
+        for(int i=0;i<99;i++){
             MultipartFile file = request.getFile("file"+i);
             if(file!=null){
                 files.add(file);
@@ -160,7 +202,7 @@ public class OTMSController {
         //添加到files数组
         List<MultipartFile> files = new ArrayList<>();
         int index=-1;
-        for(int i=0;i<21;i++){
+        for(int i=0;i<99;i++){
             MultipartFile file = request.getFile("file"+i);
             if(file!=null){
                 files.add(file);
@@ -254,6 +296,40 @@ public class OTMSController {
         }
     }
 
+
+    @ApiOperation("APP预览抵达/签收图片详情")
+    @PostMapping("/getTransPhotos")
+    public  Map<String, Object>  getTransPhotos(@RequestParam(name = "orderNumber") String orderNumber,
+                                                @RequestParam(name = "type") String type) throws Exception{
+        Map<String, Object> result = new HashMap<>();
+        try{
+            Map<String, Object> photoMap = new HashMap<>();
+            if(type.equals("抵达")){
+                photoMap = otmsFeign.getArrivalPhotoPlus(orderNumber);
+            }else if(type.equals("签收")){
+//                photoMap = otmsFeign.getReceivePhotoPlus(orderNumber);
+            }else{
+                throw new Exception("非法类型!");
+            }
+//            List<String> photos = getPhotoByUrl(""+photoMap.get("photos"));
+            List<String> photo1 = getPhotoByUrl(""+photoMap.get("photo1"));
+            List<String> photo2 = getPhotoByUrl(""+photoMap.get("photo2"));
+            List<String> photo3 = getPhotoByUrl(""+photoMap.get("photo3"));
+            List<String> photo4 = getPhotoByUrl(""+photoMap.get("photo4"));
+            List<String> photo5 = getPhotoByUrl(""+photoMap.get("photo5"));
+//            result.put("photos",photos);
+            result.put("photo1",photo1);
+            result.put("photo2",photo2);
+            result.put("photo3",photo3);
+            result.put("photo4",photo4);
+            result.put("photo5",photo5);
+            return result;
+        }catch (Exception e){
+            result.put("message",e.getMessage());
+            return null;
+        }
+    }
+
     @ApiOperation("厂外抵达作业")
     @PostMapping("/getReceiptResult")
     public Map<String,Object> getReceiptResult(@RequestBody(required = false) Map<String,Object> mapValue,
@@ -280,10 +356,12 @@ public class OTMSController {
     //切割字符串,下载图片并返回
     private List<String> getPhotoByUrl(String urls) throws Exception {
         List<String> results=new ArrayList<>();
-        String files[]=urls.split(";");
-        for(int i=0;i<files.length && files[i].length()>5;i++){
-            results.add((String)imageFileUtils.downloadFile(files[i]));
-        }
+        try{
+            String files[]=urls.split(";");
+            for(int i=0;i<files.length && files[i].length()>5;i++){
+                results.add((String)imageFileUtils.downloadFile(files[i]));
+            }
+        }catch (Exception e){}
         return results;
     }
 

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

@@ -2661,6 +2661,27 @@ public class TMSController extends BaseRESTfulController {
         return tmsTruckFeign.getSaleSteelReport(map,startTime,endTime,carrierSsoId,receiveName,materialName,specification,remark,capacityNo,carrierName,consigneeName,saler,easPrimaryId);
     }
 
+    @ApiOperation(value = "方大销售钢材统计报表")
+    @PostMapping("/getSaleSteelReportFD")
+    public Map<String,Object> getSaleSteelReportFD(@RequestBody(required = false)Map<String,Object>map,
+                                                 String startTime,
+                                                 String endTime,
+                                                 String carrierSsoId,
+                                                 String receiveName,
+                                                 String materialName,
+                                                 String specification,
+                                                 String remark,
+                                                 String capacityNo,
+                                                 String carrierName,
+                                                 String consigneeName,
+                                                 String saler,
+                                                 String easPrimaryId){
+        if(map==null){
+            map=new HashMap<>();
+        }
+        return tmsTruckFeign.getSaleSteelReportFD(map,startTime,endTime,carrierSsoId,receiveName,materialName,specification,remark,capacityNo,carrierName,consigneeName,saler,easPrimaryId);
+    }
+
     @ApiOperation(value = "销售钢材统计报表")
     @PostMapping("/getSaleSteelSpellingReport")
     public Map<String,Object> getSaleSteelSpellingReport(@RequestBody(required = false)Map<String,Object>map){

+ 15 - 1
src/main/java/com/steerinfo/dil/feign/OtmsFeign.java

@@ -73,10 +73,15 @@ public interface OtmsFeign {
     @PostMapping("/api/v1/otms/tmstruckreceiptresults/getReceivingPhotoByUrl")
     public String getReceivingPhotoByUrl(@RequestParam String orderNumber);
 
-    //获得抵达实集
+    //抵达
     @PostMapping(value = "/api/v1/otms/tmstruckarrivalresults/addtmstruckArrivalResult")
     public RESTfulResult addtmstruckArrivalResult(@RequestBody Map<String,Object>  map ,@RequestParam("orderNumber")String orderNumber, @RequestParam("resultArrivalAddress")String resultArrivalAddress,@RequestParam("file") String file);
 
+    //抵达-APP
+    @PostMapping(value = "/api/v1/otms/tmstruckarrivalresults/addtmstruckArrivalResultApp")
+    public RESTfulResult addtmstruckArrivalResultApp(@RequestBody Map<String,Object>  map ,@RequestParam("orderNumber")String orderNumber, @RequestParam("resultArrivalAddress")String resultArrivalAddress,@RequestParam("file") String file);
+
+
     //添加签收图片
     @PostMapping(value = "/api/v1/otms/pathDisplay/addTmstruckReceiptResult")
     public  RESTfulResult addTmstruckReceiptResult(@RequestBody Map<String,Object>  mapValaue  , @RequestParam("orderNumber")  String orderNumber, @RequestParam("resultArrivalAddress")String resultArrivalAddress);
@@ -102,6 +107,15 @@ public interface OtmsFeign {
     @PostMapping("/api/v1/otms/tmstruckreceiptresults/getArrivalPhoto")
     String getArrivalPhoto(@RequestParam String orderNumber);
 
+    //获得抵达图片-plus
+    @PostMapping("/api/v1/otms/tmstruckreceiptresults/getArrivalPhotoPlus")
+    Map<String, Object> getArrivalPhotoPlus(@RequestParam String orderNumber);
+
+
+    //获得签收图片-plus
+    @PostMapping("/api/v1/otms/tmstruckreceiptresults/getReceivePhotoPlus")
+    Map<String, Object> getReceivePhotoPlus(@RequestParam String orderNumber);
+
     //获得签收实绩
     @PostMapping("/api/v1/otms/pathDisplay/getReceiptResult")
     Map<String, Object> getReceiptResult(@RequestBody(required = false) Map<String, Object> mapValue,

+ 16 - 0
src/main/java/com/steerinfo/dil/feign/TmsTruckFeign.java

@@ -763,6 +763,22 @@ public interface TmsTruckFeign {
                                            @RequestParam("easPrimaryId") String easPrimaryId
                                            );
 
+    @PostMapping("/api/v1/truckTms/statisticalReport/getSaleSteelReportFD")
+    Map<String, Object> getSaleSteelReportFD(@RequestBody(required = false)Map<String, Object> map,
+                                           @RequestParam("startTime")String startTime,
+                                           @RequestParam("endTime")String endTime,
+                                           @RequestParam("carrierSsoId")String carrierSsoId,
+                                           @RequestParam("receiveName")String receiveName,
+                                           @RequestParam("materialName")String materialName,
+                                           @RequestParam("specification")String specification,
+                                           @RequestParam("remark")String remark,
+                                           @RequestParam("capacityNo") String capacityNo,
+                                           @RequestParam("carrierName") String carrierName,
+                                           @RequestParam("consigneeName") String consigneeName,
+                                           @RequestParam("saler") String saler,
+                                           @RequestParam("easPrimaryId") String easPrimaryId
+    );
+
     @PostMapping("/api/v1/truckTms/statisticalReport/getSaleSteelSpellingReport")
     Map<String, Object> getSaleSteelSpellingReport(@RequestBody(required = false)Map<String, Object> map);