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;