| | |
| | | /** |
| | | * 单据上报 |
| | | */ |
| | | 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(); |
| | |
| | | try { |
| | | // 日志记录 |
| | | RequestLog logInfo = new RequestLog(); |
| | | logInfo.setName("单据上传,单据类型" + docId.toString()); |
| | | logInfo.setName("单据上传,单据类型" + docId); |
| | | logInfo.setRequest(JSON.toJSONString(uploadBill)); // 入参 |
| | | logInfo.setResponse(response); // 出参 |
| | | logInfo.setCreateTime(new Date()); |
| | |
| | | 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); |
| | | } |
| | | |
| | | |