|
|
|
@ -238,8 +238,8 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject getCleanLogTransactions(int clientId, Date date) {
|
|
|
|
|
return settlementSupport.listSettlementTransactionsForClient(clientId, date);
|
|
|
|
|
public JSONObject getCleanLogTransactions(int clientId, String clearingDetailId) {
|
|
|
|
|
return settlementSupport.listSettlementTransactionsForClient(clientId, clearingDetailId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -596,17 +596,17 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject listClearingTransactions(int client_id, Date date, JSONObject partner) {
|
|
|
|
|
public JSONObject listClearingTransactions(int client_id, String clearingDetailId, JSONObject partner) {
|
|
|
|
|
|
|
|
|
|
JSONObject client = clientManager.getClientInfo(client_id);
|
|
|
|
|
Assert.notNull(client);
|
|
|
|
|
Assert.notNull(client, "Client not exists");
|
|
|
|
|
int parent_client_id = client.getIntValue("parent_client_id");
|
|
|
|
|
|
|
|
|
|
if (client_id != partner.getIntValue("client_id") && parent_client_id != partner.getIntValue("client_id")) {
|
|
|
|
|
throw new ForbiddenException("No Permission");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JSONObject clearClient = clearingDetailMapper.listReport(date, client_id);
|
|
|
|
|
JSONObject clearClient = clearingDetailMapper.listReport(clearingDetailId, client_id);
|
|
|
|
|
if (clearClient == null) {
|
|
|
|
|
throw new NotFoundException();
|
|
|
|
|
}
|
|
|
|
@ -624,12 +624,13 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void exportListClearingTransactions(int client_id, Date date, JSONObject partner, HttpServletResponse resp) {
|
|
|
|
|
public void exportListClearingTransactions(int client_id, String clearingDetailId, JSONObject partner, HttpServletResponse resp) {
|
|
|
|
|
OutputStream ous = null;
|
|
|
|
|
try {
|
|
|
|
|
JSONObject clearTransation = listClearingTransactions(client_id, date, partner);
|
|
|
|
|
JSONObject clearTransation = listClearingTransactions(client_id, clearingDetailId, partner);
|
|
|
|
|
resp.setContentType("application/octet-stream;");
|
|
|
|
|
resp.addHeader("Content-Disposition", "attachment; filename=" + "Merchant_Settlement_Info_" + DateFormatUtils.format(date, "yyyy-MM-dd") + ".xls");
|
|
|
|
|
Date reportDate = clearTransation.getDate("report_date");
|
|
|
|
|
resp.addHeader("Content-Disposition", "attachment; filename=" + "Merchant_Settlement_Info_" + DateFormatUtils.format(reportDate, "yyyy-MM-dd") + ".xls");
|
|
|
|
|
ous = resp.getOutputStream();
|
|
|
|
|
HSSFWorkbook wb = new HSSFWorkbook();
|
|
|
|
|
Cell cell = null;
|
|
|
|
@ -638,7 +639,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
|
|
|
|
|
font.setFontHeightInPoints((short) 10);
|
|
|
|
|
CellStyle analysisStyle = wb.createCellStyle();
|
|
|
|
|
analysisStyle.setFont(font);
|
|
|
|
|
Sheet sheet = wb.createSheet("Merchant_Settlement_Info_" + DateFormatUtils.format(date, "yyyyMMdd"));
|
|
|
|
|
Sheet sheet = wb.createSheet("Merchant_Settlement_Info_" + DateFormatUtils.format(reportDate, "yyyyMMdd"));
|
|
|
|
|
int rowNum = 0;
|
|
|
|
|
Row row = sheet.createRow(rowNum);
|
|
|
|
|
String[] title = {"order Id", "Client Order Id", "Transaction Time", "Channel", "Gateway", "Exchange Rate", "Transaction Type", "Currency",
|
|
|
|
|