From 3ce7ad9b293ac1285b2e4dcb157fbf04f9d91e31 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@63.com> Date: 星期六, 07 八月 2021 14:31:06 +0800 Subject: [PATCH] # --- src/main/java/zy/cloud/wms/common/service/erp/ErpService.java | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/zy/cloud/wms/common/service/erp/ErpService.java b/src/main/java/zy/cloud/wms/common/service/erp/ErpService.java index 90364c3..6a537e9 100644 --- a/src/main/java/zy/cloud/wms/common/service/erp/ErpService.java +++ b/src/main/java/zy/cloud/wms/common/service/erp/ErpService.java @@ -37,14 +37,14 @@ /** * 鍗曟嵁涓婃姤 */ - public Boolean uploadBill(List<BillDto> dtos, Integer docId, String docNumber){ + public ErpR uploadBill(List<BillDto> dtos, Integer docId, String docNumber){ try { if (Cools.isEmpty(dtos)) { - return false; + return new ErpR(false, null); } DocType docType = docTypeService.selectById(docId); if (Cools.isEmpty(docType)) { - return false; + return new ErpR(false, null); } UploadBill uploadBill = new UploadBill(); @@ -70,7 +70,7 @@ detl.setUnit(mat==null?"鏆傛棤":mat.getUnit()); detail.add(detl); } - System.out.println(JSON.toJSONString(uploadBill)); + log.warn(JSON.toJSONString(uploadBill)); String response = new HttpHandler.Builder() .setUri(ErpScheduler.URI) .setPath(ErpScheduler.UPLOAD_BILL) @@ -81,7 +81,7 @@ try { // 鏃ュ織璁板綍 RequestLog logInfo = new RequestLog(); - logInfo.setName("鍗曟嵁涓婁紶锛屽崟鎹被鍨�" + docId.toString()); + logInfo.setName("鍗曟嵁涓婁紶锛屽崟鎹被鍨�" + docId); logInfo.setRequest(JSON.toJSONString(uploadBill)); // 鍏ュ弬 logInfo.setResponse(response); // 鍑哄弬 logInfo.setCreateTime(new Date()); @@ -95,14 +95,14 @@ log.warn(response); Result result = JSON.parseObject(response, Result.class); if (result.getCode() != 1) { - return false; + return new ErpR(false, result.getMsg()); } } } catch (Exception e) { e.printStackTrace(); - return false; + return new ErpR(false, e.getMessage()); } - return Boolean.TRUE; + return new ErpR(true, null); } -- Gitblit v1.9.1