소스 검색

修改“

liyg 2 년 전
부모
커밋
da2092fa65

+ 2 - 1
src/main/java/com/steerinfo/dil/controller/OffSiteTransportationController.java

@@ -346,10 +346,11 @@ public class OffSiteTransportationController extends BaseRESTfulController {
             }
         }else{
             System.out.println("没有抵达实绩");
+            return failed("没有抵达实绩!请先抵达作业!");
         }
 
 
-        return success(resTfulResult);
+        return success("签收成功");
     }
 
     //如果内容丢失重新获得

+ 8 - 72
src/main/java/com/steerinfo/dil/controller/TmstruckReceiptResultController.java

@@ -109,43 +109,15 @@ public class TmstruckReceiptResultController extends BaseRESTfulController {
             //获取运输订单号和收货点地址
             String orderNumber = (String) map.get("orderNumber");
             String resultArrivalAddress = (String) map.get("resultArrivalAddress");
-            //获取空货箱照片、已签字的送货单照片
-            String resultEmptyContainerPhoto = (String) map.get("url1");
-            String resultSignedNotePhoto = (String) map.get("url2");
+            //获取所有的图片
+            String resultEmptyContainerPhoto = (String) map.get("url");
             tmstruckReceiptResult.setResultArrivalAddress(resultArrivalAddress);
             tmstruckReceiptResult.setResultEmptyContainerPhoto(resultEmptyContainerPhoto);
-            tmstruckReceiptResult.setResultSignedNotePhoto(resultSignedNotePhoto);
-            if(map.containsKey("url3")){
-                //如果有,获取客户签收单照片
-                String resultReceiveNotePhoto = (String) map.get("url3");
-                tmstruckReceiptResult.setResultReceiveNotePhoto(resultReceiveNotePhoto);
-            }
             //新增收货实绩主表
             BigDecimal receiptResultId = tmstruckReceiptResultService.addTmstruckReceiptResult(orderNumber, tmstruckReceiptResult);
-            //初始化收货实绩子表信息
-            TmstruckReceiptResultChild tmstruckReceiptResultChild = new TmstruckReceiptResultChild();
-            //关联收货实绩主表
-            tmstruckReceiptResultChild.setReceiptResultId(receiptResultId);
-            //如果有,获取最多三张其他照片
-            if(map.containsKey("fourFiles")){
-                List<String> fourFiles = (List<String>) map.get("fourFiles");
-                if(fourFiles.size()==0){}
-                else if(fourFiles.size()==1){
-                    tmstruckReceiptResultChild.setOtherPhoto1(fourFiles.get(0));
-                }else if(fourFiles.size()==2){
-                    tmstruckReceiptResultChild.setOtherPhoto1(fourFiles.get(0));
-                    tmstruckReceiptResultChild.setOtherPhoto2(fourFiles.get(1));
-                }else {
-                    tmstruckReceiptResultChild.setOtherPhoto1(fourFiles.get(0));
-                    tmstruckReceiptResultChild.setOtherPhoto2(fourFiles.get(1));
-                    tmstruckReceiptResultChild.setOtherPhoto3(fourFiles.get(2));
-                }
-            }
-            //新增收货实绩子表
-            int i = tmstruckReceiptResultChildService.addTmstruckReceiptResultChild(tmstruckReceiptResultChild);
-            return success(i);
+            return success("签收成功!");
         }else{
-            return success(4);
+            return failed("没有收货实绩!");
         }
 
     }
@@ -211,49 +183,13 @@ public class TmstruckReceiptResultController extends BaseRESTfulController {
 
     @ApiOperation(value = "获取收货作业照片")
     @PostMapping("/getReceivingPhoto")
-    public RESTfulResult getReceivingPhoto(@RequestParam String orderNumber) throws Exception {
-        List<Map<String,Object>> mapList = tmstruckReceiptResultService.getReceivingPhoto(orderNumber);
-        Map<String,Object> result=new HashMap<>();
-        for(Map<String,Object> map:mapList){
-            if(map.containsKey("resultEmptyContainerPhoto") && map.get("resultEmptyContainerPhoto")!=null){
-                String resultEmptyContainerPhoto = (String) imageFileUtils.downloadFile(map.get("resultEmptyContainerPhoto").toString());
-                result.put("resultEmptyContainerPhoto",resultEmptyContainerPhoto);
-            }
-            if(map.containsKey("resultSignedNotePhoto") && map.get("resultSignedNotePhoto")!=null){
-                String resultSignedNotePhoto = (String) imageFileUtils.downloadFile(map.get("resultSignedNotePhoto").toString());
-                result.put("resultSignedNotePhoto",resultSignedNotePhoto);
-            }
-            //追加的图片
-            if(map.containsKey("otherPhoto1") && map.get("otherPhoto1")!=null){
-                String resultSignedNotePhoto =(String) imageFileUtils.downloadFile(map.get("otherPhoto1").toString());
-                result.put("otherPhoto1",resultSignedNotePhoto);
-            }
-            if(map.containsKey("otherPhoto2") && map.get("otherPhoto2") !=null){
-                String resultSignedNotePhoto =(String) imageFileUtils.downloadFile(map.get("otherPhoto2").toString());
-                result.put("otherPhoto2",resultSignedNotePhoto);
-            }
-            if(map.containsKey("otherPhoto3") && map.get("otherPhoto3") !=null){
-                String resultSignedNotePhoto =(String) imageFileUtils.downloadFile(map.get("otherPhoto3").toString());
-                result.put("otherPhoto3",resultSignedNotePhoto);
-            }
-        }
-        return success(result);
+    public String getReceivingPhoto(@RequestParam String orderNumber) throws Exception {
+        return tmstruckReceiptResultService.getReceivingPhoto(orderNumber);
     }
     @ApiOperation(value = "获取收货作业照片")
     @PostMapping("/getReceivingPhotoByUrl")
-    public Map<String,Object> getReceivingPhotoByUrl(@RequestParam String orderNumber) throws Exception {
-        List<Map<String,Object>> mapList = tmstruckReceiptResultService.getReceivingPhoto(orderNumber);
-        Map<String,Object> mapvalue = null;
-        if (mapList!=null && mapList.size()>0){
-            //必选的图片
-            mapvalue=mapList.get(0);
-            //追加的三张图片
-            if(mapList.get(1)!=null){
-               mapvalue.putAll(mapList.get(1));
-            }
-        }
-        
-        return mapvalue;
+    public String getReceivingPhotoByUrl(@RequestParam String orderNumber) throws Exception {
+        return tmstruckReceiptResultService.getReceivingPhoto(orderNumber);
     }
 
 }

+ 1 - 1
src/main/java/com/steerinfo/dil/mapper/TmstruckReceiptResultMapper.java

@@ -37,7 +37,7 @@ public interface TmstruckReceiptResultMapper extends IBaseMapper<TmstruckReceipt
 
     List<Map<String, Object>> getReceivingResult(Map<String, Object> mapValue);
 
-    List<Map<String, Object>> getReceivingPhoto(String orderNumber);
+    String getReceivingPhoto(String orderNumber);
 
     List<Map<String,Object>> getChildPhoto(String orderNumber);
 }

+ 1 - 1
src/main/java/com/steerinfo/dil/service/ITmstruckReceiptResultService.java

@@ -38,5 +38,5 @@ public interface ITmstruckReceiptResultService{
 
     List<Map<String, Object>> getReceivingResult(Map<String, Object> mapValue);
 
-    List<Map<String, Object>> getReceivingPhoto(String orderNumber);
+    String getReceivingPhoto(String orderNumber);
 }

+ 3 - 32
src/main/java/com/steerinfo/dil/service/impl/OffSiteTransportationServiceImpl.java

@@ -244,46 +244,17 @@ public class OffSiteTransportationServiceImpl implements OffSiteTransportationSe
     public Integer addTmstruckReceiptResult(@RequestBody(required = false) Map<String,Object> map){
         BigDecimal alreadyExistsArrivalResult = tmstruckArrivalResultMapper.alreadyExistsArrivalResult((String) map.get("orderNumber"));
         if(alreadyExistsArrivalResult!=null){
-            //删除所有入库时机
             TmstruckReceiptResult tmstruckReceiptResult = new TmstruckReceiptResult();
             //获取运输订单号和收货点地址
             String orderNumber = (String) map.get("orderNumber");
             String resultArrivalAddress = (String) map.get("resultArrivalAddress");
-            //获取空货箱照片、已签字的送货单照片
-            String resultEmptyContainerPhoto = (String) map.get("url0");
-            String resultSignedNotePhoto = (String) map.get("url1");
+            //获取所有照片
+            String resultEmptyContainerPhoto = (String) map.get("url");
             tmstruckReceiptResult.setResultArrivalAddress(resultArrivalAddress);
             tmstruckReceiptResult.setResultEmptyContainerPhoto(resultEmptyContainerPhoto);
-            tmstruckReceiptResult.setResultSignedNotePhoto(resultSignedNotePhoto);
-            if(map.containsKey("url2")){
-                //如果有,获取客户签收单照片
-                String resultReceiveNotePhoto = (String) map.get("url2");
-                tmstruckReceiptResult.setResultReceiveNotePhoto(resultReceiveNotePhoto);
-            }
             //新增收货实绩主表
             BigDecimal receiptResultId = tmstruckReceiptResultService.addTmstruckReceiptResult(orderNumber, tmstruckReceiptResult);
-            //初始化收货实绩子表信息
-            TmstruckReceiptResultChild tmstruckReceiptResultChild = new TmstruckReceiptResultChild();
-            //关联收货实绩主表
-            tmstruckReceiptResultChild.setReceiptResultId(receiptResultId);
-            //如果有,获取最多三张其他照片
-            if(map.containsKey("fourFiles")){
-                List<String> fourFiles = (List<String>) map.get("fourFiles");
-                if(fourFiles.size()==0){}
-                else if(fourFiles.size()==1){
-                    tmstruckReceiptResultChild.setOtherPhoto1(fourFiles.get(0));
-                }else if(fourFiles.size()==2){
-                    tmstruckReceiptResultChild.setOtherPhoto1(fourFiles.get(0));
-                    tmstruckReceiptResultChild.setOtherPhoto2(fourFiles.get(1));
-                }else {
-                    tmstruckReceiptResultChild.setOtherPhoto1(fourFiles.get(0));
-                    tmstruckReceiptResultChild.setOtherPhoto2(fourFiles.get(1));
-                    tmstruckReceiptResultChild.setOtherPhoto3(fourFiles.get(2));
-                }
-            }
-            //新增收货实绩子表
-            int i = tmstruckReceiptResultChildService.addTmstruckReceiptResultChild(tmstruckReceiptResultChild);
-            return i;
+            return 0;
         }else{
             return 4;
         }

+ 2 - 5
src/main/java/com/steerinfo/dil/service/impl/TmstruckReceiptResultServiceImpl.java

@@ -85,11 +85,8 @@ public class TmstruckReceiptResultServiceImpl implements ITmstruckReceiptResultS
     }
 
     @Override
-    public List<Map<String, Object>> getReceivingPhoto(String orderNumber) {
-        List<Map<String,Object>> photos=new ArrayList<>();
-        photos.addAll(tmstruckReceiptResultMapper.getReceivingPhoto(orderNumber));//主表的图片
-        photos.addAll(tmstruckReceiptResultMapper.getChildPhoto(orderNumber));//子表三张追加的图片
-        return photos;
+    public String getReceivingPhoto(String orderNumber) {
+        return tmstruckReceiptResultMapper.getReceivingPhoto(orderNumber);
     }
 
     /**

+ 3 - 4
src/main/resources/com/steerinfo/dil/mapper/TmstruckReceiptResultMapper.xml

@@ -1207,16 +1207,15 @@
     <include refid="orderBy"></include>
   </select>
 
-  <select id="getReceivingPhoto" parameterType="java.lang.String" resultType="java.util.Map">
-    select trr.RESULT_EMPTY_CONTAINER_PHOTO "resultEmptyContainerPhoto",
-           trr.RESULT_SIGNED_NOTE_PHOTO "resultSignedNotePhoto",
-           trr.RESULT_RECEIVE_NOTE_PHOTO "resultReceiveNotePhoto"
+  <select id="getReceivingPhoto" parameterType="java.lang.String" resultType="java.lang.String">
+    select trr.RESULT_EMPTY_CONTAINER_PHOTO "resultEmptyContainerPhoto"
     from TMSTRUCK_RECEIPT_RESULT trr
     left join TMSTRUCK_TOTAL_RESULT ttr
     on ttr.RESULT_TOTAL_ID = trr.RESULT_TOTAL_ID
     left join OMSTRUCK_ORDER oo
     on oo.ORDER_ID = ttr.ORDER_ID
     where oo.ORDER_NUMBER = #{orderNumber}
+    fetch next 1 rows only
   </select>
 
   <select id="getChildPhoto" parameterType="java.lang.String" resultType="java.util.Map">