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

master
luoyang 6 years ago
parent ac00e9052a
commit 049e6705a3

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