浏览代码

往来账款上传文件判断上传是否成功

dudm 4 年之前
父节点
当前提交
0756631e84
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      sc-service/src/main/java/com/huyi/service/bill/controller/OwnBillController.java

+ 6 - 0
sc-service/src/main/java/com/huyi/service/bill/controller/OwnBillController.java

@@ -716,6 +716,9 @@ public class OwnBillController extends BaseController {
         String token = SecurityUtils.getToken(ServletUtils.getRequest());
         //文件传输
         R<PubFileInf> fileResult = remoteFileService.uploadFile(file,"01","04","00", companyId, token);
+        if(fileResult.getData() == null){
+            return R.fail(500,"文件识别错误,上传失败!");
+        }
         zcInvoiceInf.setZiiFile(fileResult.getData().getPfiFileId());
         Map map = new HashMap();
         map.put("id",fileResult.getData().getPfiFileId());
@@ -872,6 +875,9 @@ public class OwnBillController extends BaseController {
         String token = SecurityUtils.getToken(ServletUtils.getRequest());
         //文件传输
         R<PubFileInf> fileResult = remoteFileService.uploadFile(file,"01","04","00", companyId, token);
+        if(fileResult.getData() == null){
+            return R.fail(500,"文件识别错误,上传失败!");
+        }
         Map map = new HashMap();
         map.put("id",fileResult.getData().getPfiFileId());
         map.put("name",fileResult.getData().getPfiFileName());