|
@@ -127,6 +127,49 @@ public class OTMSController {
|
|
return result;
|
|
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> oldPhoto = otmsFeign.getArrivalPhotoPlus(orderNumber);
|
|
|
|
+ if(oldPhoto == null){
|
|
|
|
+ oldPhoto = new HashMap<>();
|
|
|
|
+ }
|
|
|
|
+ //上传图片,拼接在一个url里
|
|
|
|
+ Map<String,Object> mapValue=new HashMap<>();
|
|
|
|
+ String url="";
|
|
|
|
+ Boolean isUpload = false;
|
|
|
|
+ for(int i = 0;i < 5; i++){
|
|
|
|
+ String oldPhotosArr[] = new String[5];
|
|
|
|
+ if(oldPhoto.get("photo"+i)!=null && !oldPhoto.get("photo"+i).equals("")){
|
|
|
|
+ oldPhotosArr = oldPhoto.get("photo"+i).toString().split(";");
|
|
|
|
+ }
|
|
|
|
+ String photo="";
|
|
|
|
+ //上传图片,为空则查询旧图片的对应下标图片
|
|
|
|
+ for(int j = 0;j < 5; j++){
|
|
|
|
+ MultipartFile file = request.getFile("photo"+i+"_"+j);
|
|
|
|
+ if(file!=null){
|
|
|
|
+ isUpload = true;
|
|
|
|
+ String fileName = imageFileUtils.updateFile(file,j)+';';
|
|
|
|
+ photo += fileName ;
|
|
|
|
+ url += fileName;
|
|
|
|
+ }else if(oldPhotosArr[j] !=null && !oldPhotosArr[j].equals("") && oldPhotosArr[j].length()>5){
|
|
|
|
+ String fileName = oldPhotosArr[j]+';';
|
|
|
|
+ photo += fileName;
|
|
|
|
+ url += fileName;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ 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 = "新增签收")
|
|
@ApiOperation(value = "新增签收")
|
|
@PostMapping(value = "/addTmstruckReceiptResult")
|
|
@PostMapping(value = "/addTmstruckReceiptResult")
|
|
public synchronized RESTfulResult addTmstruckReceiptResult(MultipartRequest request, Integer num, String orderNumber, String resultArrivalAddress, Integer imgcount3, Integer imgcount4) throws Exception {
|
|
public synchronized RESTfulResult addTmstruckReceiptResult(MultipartRequest request, Integer num, String orderNumber, String resultArrivalAddress, Integer imgcount3, Integer imgcount4) throws Exception {
|
|
@@ -254,6 +297,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("厂外抵达作业")
|
|
@ApiOperation("厂外抵达作业")
|
|
@PostMapping("/getReceiptResult")
|
|
@PostMapping("/getReceiptResult")
|
|
public Map<String,Object> getReceiptResult(@RequestBody(required = false) Map<String,Object> mapValue,
|
|
public Map<String,Object> getReceiptResult(@RequestBody(required = false) Map<String,Object> mapValue,
|
|
@@ -280,10 +357,12 @@ public class OTMSController {
|
|
//切割字符串,下载图片并返回
|
|
//切割字符串,下载图片并返回
|
|
private List<String> getPhotoByUrl(String urls) throws Exception {
|
|
private List<String> getPhotoByUrl(String urls) throws Exception {
|
|
List<String> results=new ArrayList<>();
|
|
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;
|
|
return results;
|
|
}
|
|
}
|
|
|
|
|