|
@@ -109,43 +109,15 @@ public class TmstruckReceiptResultController extends BaseRESTfulController {
|
|
//获取运输订单号和收货点地址
|
|
//获取运输订单号和收货点地址
|
|
String orderNumber = (String) map.get("orderNumber");
|
|
String orderNumber = (String) map.get("orderNumber");
|
|
String resultArrivalAddress = (String) map.get("resultArrivalAddress");
|
|
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.setResultArrivalAddress(resultArrivalAddress);
|
|
tmstruckReceiptResult.setResultEmptyContainerPhoto(resultEmptyContainerPhoto);
|
|
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);
|
|
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{
|
|
}else{
|
|
- return success(4);
|
|
|
|
|
|
+ return failed("没有收货实绩!");
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -211,49 +183,13 @@ public class TmstruckReceiptResultController extends BaseRESTfulController {
|
|
|
|
|
|
@ApiOperation(value = "获取收货作业照片")
|
|
@ApiOperation(value = "获取收货作业照片")
|
|
@PostMapping("/getReceivingPhoto")
|
|
@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 = "获取收货作业照片")
|
|
@ApiOperation(value = "获取收货作业照片")
|
|
@PostMapping("/getReceivingPhotoByUrl")
|
|
@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);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|