fix 后清算手续费Invoice模板 选择回滚清算

master
luoyang 6 years ago
parent 16d2138bae
commit 552cc0e404

@ -13,7 +13,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.1.2</jib-maven-plugin.version>
<docker-image.version>1.0.7</docker-image.version>
<docker-image.version>1.0.8</docker-image.version>
</properties>
<dependencies>

@ -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<JSONObject> findByClearingId(@Param("client_id") int clientId, @Param("clearing_detail_id") String clearingDetailId);
List<JSONObject> getMonthDetailByClientId(@Param("datefrom") Date datefrom, @Param("dateto") Date dateto);

@ -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<JSONObject> 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;

Loading…
Cancel
Save