浏览代码

司机授权委托书

njs 1 年之前
父节点
当前提交
252dc9a470

+ 14 - 3
suishenbang-wxportal/suishenbang-wxportal-api/src/main/java/com/dgtly/wxportal/controller/EsignController.java

@@ -259,6 +259,14 @@ public class EsignController extends ApiBaseController {
                 orderFile.setFlowId(flowId);
                 orderFileService.insertOrderFile(orderFile);
                 logger.info("保存授权签署附件");
+                //协议书url
+                OrderFile orderFlag = orderFileService.selectOrderFileByFlowId(flowId);
+                signService.saveFileFalse(flowId, orderFlag);
+                OrderFile File = new OrderFile();
+                    File.setFlowId(orderFlag.getFlowId());
+                    File.setCode("200");
+                    File.setMessage("success");
+                    orderFileService.updateOrderFileByFlowId(File);
                 File f = new File(fileModal.getFilePath());
                 f.delete();
             //}
@@ -390,7 +398,13 @@ public class EsignController extends ApiBaseController {
         OrderFile orderFlag = orderFileService.selectOrderFileByFlowId(flowId);
 
         if ("2".equals(signResult)) {
+            if(businessScence!=null && ("司机授权").equals(businessScence)){
 
+                signService.saveFileFalse(flowId, orderFlag);
+            }else {
+                /*异步保存文件*/
+                signService.saveFile(flowId, orderFlag);
+            }
             /*异步调用回调接口*/
             if(businessScence!=null &&!("司机授权").equals(businessScence)){
                 signService.callbackNotice(orderFlag);
@@ -401,9 +415,6 @@ public class EsignController extends ApiBaseController {
                 orderFile.setMessage("success");
                 orderFileService.updateOrderFileByFlowId(orderFile);
             }
-                /*异步保存文件*/
-                signService.saveFile(flowId,orderFlag);
-
 
 //            String fileUrl = signService.processDocumentDownload(flowId);
             /*下载保存签署后的文件,返回文件存储地址*/

+ 2 - 0
suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/service/IEsignSignService.java

@@ -84,4 +84,6 @@ public interface IEsignSignService {
     void callbackNotice(OrderFile orderFlag);
 
     void saveFile(String flowId, OrderFile orderFlag);
+
+    void saveFileFalse(String flowId, OrderFile orderFlag);
 }

+ 21 - 0
suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/service/impl/EsignSignServiceImpl.java

@@ -252,6 +252,27 @@ public class EsignSignServiceImpl implements IEsignSignService {
         orderFileService.updateOrderFileByFlowId(orderFile);
     }
 
+    @Override
+    public void saveFileFalse(String flowId, OrderFile orderFlag) {
+        String fileUrl = processDocumentDownload(flowId);
+        /*下载保存签署后的文件,返回文件存储地址*/
+        OrderFile orderFile = new OrderFile();
+        orderFile.setFlowId(flowId);
+        if(orderFlag.getTypes()==1){
+            downloadFile(Global.getPdfPath(), orderFlag.getOrderId() + ".pdf", fileUrl);
+            orderFile.setFileUrl(Constants.RESOURCE_PREFIX+"/pdf/"+DateUtils.datePath()+"/"+orderFlag.getOrderId() + ".pdf");
+        }else if( orderFlag.getTypes()==2){
+            downloadFile(Global.getPdfPath(), orderFlag.getFlowId() + "_授权委托.pdf", fileUrl);
+            orderFile.setFileUrl(Constants.RESOURCE_PREFIX+"/pdf/"+DateUtils.datePath()+"/"+orderFlag.getFlowId() + "_授权委托.pdf");
+        }else{
+            downloadFile(Global.getPdfPath(), orderFlag.getOrderId() + "_签收订单.pdf", fileUrl);
+            orderFile.setFileUrl(Constants.RESOURCE_PREFIX+"/pdf/"+DateUtils.datePath()+"/"+orderFlag.getOrderId() + "_签收订单.pdf");
+
+        }
+//        orderFile.setFileUrl(refile);
+        orderFileService.updateOrderFileByFlowId(orderFile);
+    }
+
     /**
      * @description 模拟构建一步发起请求参数
      *              <p>