From 049e6705a3ddec1f4e66829d0165b698c5de3084 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 21 May 2019 16:59:32 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=90=8E=E6=B8=85=E7=AE=97=E6=89=8B?= =?UTF-8?q?=E7=BB=AD=E8=B4=B9Invoice=E6=A8=A1=E6=9D=BF=20=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=9B=9E=E6=BB=9A=E6=B8=85=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/ClearingDistributedSurchargeMapper.java | 2 +- .../core/impl/SurchargeAccountServiceImpl.java | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.java index 11f8b00e6..950877f1e 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.java @@ -23,7 +23,7 @@ public interface ClearingDistributedSurchargeMapper { void save(JSONObject transactions); @AutoSql(type = SqlType.SELECT) - JSONObject findByClearingId(@Param("client_id") int clientId, @Param("clearing_detail_id") String clearingDetailId); + List findByClearingId(@Param("client_id") int clientId, @Param("clearing_detail_id") String clearingDetailId); List getMonthDetailByClientId(@Param("datefrom") Date datefrom, @Param("dateto") Date dateto); diff --git a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java index df89a5844..f53d0f34c 100644 --- a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java @@ -148,8 +148,12 @@ public class SurchargeAccountServiceImpl implements SurchargeAccountService { if (client == null) { throw new InvalidShortIdException(); } - JSONObject distributedDetail = clearingDistributedSurchargeMapper.findByClearingId(clientId, clearingDetailId); - String date = DateFormatUtils.format(distributedDetail.getDate("settle_date"), "dd MMM yyyy", Locale.US); + List distributedDetail = clearingDistributedSurchargeMapper.findByClearingId(clientId, clearingDetailId); + if (distributedDetail.size() > 1) { + throw new BadRequestException("此次清算扣款已回滚"); + } + JSONObject detial = distributedDetail.get(0); + String date = DateFormatUtils.format(detial.getDate("settle_date"), "dd MMM yyyy", Locale.US); httpResponse.setContentType("application/pdf"); httpResponse.setHeader("content-disposition", "attachment;filename="+ client.getString("client_moniker") + "_Invoice_" + date + ".pdf"); ServletOutputStream sos = null;