|
|
@ -2589,8 +2589,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
params.remove("client_id");
|
|
|
|
params.remove("client_id");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
List<JSONObject> deviceIds = clientDeviceMapper.listClientDeviceIds(params);
|
|
|
|
List<JSONObject> deviceIds = clientDeviceMapper.listClientDeviceIds(params);
|
|
|
|
return new JSONObject(){{
|
|
|
|
return new JSONObject() {{
|
|
|
|
put("data",deviceIds);
|
|
|
|
put("data", deviceIds);
|
|
|
|
}};
|
|
|
|
}};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -3716,7 +3716,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void excelSettlementLog(JSONObject manager, String clientMoniker, TradeLogQuery query,HttpServletResponse response) {
|
|
|
|
public void excelSettlementLog(JSONObject manager, String clientMoniker, TradeLogQuery query, HttpServletResponse response) {
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
if (client == null) {
|
|
|
|
if (client == null) {
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
throw new InvalidShortIdException();
|
|
|
@ -3731,8 +3731,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
query.setDateto(DateFormatUtils.format(new Date(), "yyyyMMdd"));
|
|
|
|
query.setDateto(DateFormatUtils.format(new Date(), "yyyyMMdd"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(query.getClient_ids()!=null){
|
|
|
|
if (query.getClient_ids() != null) {
|
|
|
|
if(query.getClient_ids().length>1){
|
|
|
|
if (query.getClient_ids().length > 1) {
|
|
|
|
query.setClient_ids(null);
|
|
|
|
query.setClient_ids(null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3741,21 +3741,21 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
PageList<JSONObject> logs = transactionMapper.listSettlementLog(params, new PageBounds(query.getPage(), 10000, Order.formString("clearing_time.desc")));
|
|
|
|
PageList<JSONObject> logs = transactionMapper.listSettlementLog(params, new PageBounds(query.getPage(), 10000, Order.formString("clearing_time.desc")));
|
|
|
|
//Excel 多sheet导出
|
|
|
|
//Excel 多sheet导出
|
|
|
|
try (HSSFWorkbook workbook = new HSSFWorkbook()) {
|
|
|
|
try (HSSFWorkbook workbook = new HSSFWorkbook()) {
|
|
|
|
if(query.getClient_ids() ==null){
|
|
|
|
if (query.getClient_ids() == null) {
|
|
|
|
addSheet(0,workbook,client,logs);
|
|
|
|
addSheet(0, workbook, client, logs);
|
|
|
|
List<JSONObject> childs = clientMapper.listChildClients(client.getIntValue("client_id"));
|
|
|
|
List<JSONObject> childs = clientMapper.listChildClients(client.getIntValue("client_id"));
|
|
|
|
for (int i=0;i<childs.size();i++){
|
|
|
|
for (int i = 0; i < childs.size(); i++) {
|
|
|
|
params.put("client_id", childs.get(i).getInteger("client_id"));
|
|
|
|
params.put("client_id", childs.get(i).getInteger("client_id"));
|
|
|
|
PageList<JSONObject> childLogs = transactionMapper.listSettlementLog(params, new PageBounds(query.getPage(), 10000, Order.formString("clearing_time.desc")));
|
|
|
|
PageList<JSONObject> childLogs = transactionMapper.listSettlementLog(params, new PageBounds(query.getPage(), 10000, Order.formString("clearing_time.desc")));
|
|
|
|
if(childLogs.size()>0){
|
|
|
|
if (childLogs.size() > 0) {
|
|
|
|
addSheet(i+1,workbook, childs.get(i),childLogs);
|
|
|
|
addSheet(i + 1, workbook, childs.get(i), childLogs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
} else {
|
|
|
|
JSONObject chlidClient = clientMapper.findClient(Integer.parseInt(query.getClient_ids()[0]));
|
|
|
|
JSONObject chlidClient = clientMapper.findClient(Integer.parseInt(query.getClient_ids()[0]));
|
|
|
|
addSheet(0,workbook,chlidClient,logs);
|
|
|
|
addSheet(0, workbook, chlidClient, logs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String fileName = "Settlement Log - "+ (query.getDatefrom() + "~" + query.getDateto() );
|
|
|
|
String fileName = "Settlement Log - " + (query.getDatefrom() + "~" + query.getDateto());
|
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ".xls");
|
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ".xls");
|
|
|
|
OutputStream outputStream = response.getOutputStream();
|
|
|
|
OutputStream outputStream = response.getOutputStream();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -3770,9 +3770,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void addSheet(int sheetNum,HSSFWorkbook workbook,JSONObject client,List<JSONObject> logs){
|
|
|
|
private void addSheet(int sheetNum, HSSFWorkbook workbook, JSONObject client, List<JSONObject> logs) {
|
|
|
|
HSSFSheet sheet = workbook.createSheet();
|
|
|
|
HSSFSheet sheet = workbook.createSheet();
|
|
|
|
workbook.setSheetName(sheetNum,client.getString("client_moniker")+"_excel");
|
|
|
|
workbook.setSheetName(sheetNum, client.getString("client_moniker") + "_excel");
|
|
|
|
sheet.setDefaultColumnWidth((short) 40);
|
|
|
|
sheet.setDefaultColumnWidth((short) 40);
|
|
|
|
HSSFCellStyle style = workbook.createCellStyle();
|
|
|
|
HSSFCellStyle style = workbook.createCellStyle();
|
|
|
|
style.setFillForegroundColor(HSSFColor.LIGHT_ORANGE.index);
|
|
|
|
style.setFillForegroundColor(HSSFColor.LIGHT_ORANGE.index);
|
|
|
@ -3843,7 +3843,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
JSONObject dataItem = logs.get(i);
|
|
|
|
JSONObject dataItem = logs.get(i);
|
|
|
|
HSSFRichTextString text0 = new HSSFRichTextString(client.getString("short_name"));
|
|
|
|
HSSFRichTextString text0 = new HSSFRichTextString(client.getString("short_name"));
|
|
|
|
HSSFRichTextString text1 = new HSSFRichTextString(client.getString("client_moniker"));
|
|
|
|
HSSFRichTextString text1 = new HSSFRichTextString(client.getString("client_moniker"));
|
|
|
|
HSSFRichTextString text2 = new HSSFRichTextString(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format( dataItem.getDate("report_date")));
|
|
|
|
HSSFRichTextString text2 = new HSSFRichTextString(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dataItem.getDate("report_date")));
|
|
|
|
HSSFRichTextString text3 = new HSSFRichTextString(dataItem.getBigDecimal("total").setScale(2, BigDecimal.ROUND_HALF_DOWN).toString());
|
|
|
|
HSSFRichTextString text3 = new HSSFRichTextString(dataItem.getBigDecimal("total").setScale(2, BigDecimal.ROUND_HALF_DOWN).toString());
|
|
|
|
HSSFRichTextString text4 = new HSSFRichTextString(dataItem.getBigDecimal("income").setScale(2, BigDecimal.ROUND_HALF_DOWN).toString());
|
|
|
|
HSSFRichTextString text4 = new HSSFRichTextString(dataItem.getBigDecimal("income").setScale(2, BigDecimal.ROUND_HALF_DOWN).toString());
|
|
|
|
HSSFRichTextString text5 = new HSSFRichTextString(dataItem.getBigDecimal("fee").setScale(2, BigDecimal.ROUND_HALF_DOWN).toString());
|
|
|
|
HSSFRichTextString text5 = new HSSFRichTextString(dataItem.getBigDecimal("fee").setScale(2, BigDecimal.ROUND_HALF_DOWN).toString());
|
|
|
@ -6099,13 +6099,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public JSONObject partnerIncrementalServiceInfo(String clientMoniker,String channel){
|
|
|
|
public JSONObject partnerIncrementalServiceInfo(String clientMoniker, String channel) {
|
|
|
|
JSONObject client = clientMapper.findClientByMoniker(clientMoniker);
|
|
|
|
JSONObject client = clientMapper.findClientByMoniker(clientMoniker);
|
|
|
|
if (client == null) {
|
|
|
|
if (client == null) {
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
JSONObject incrementalInfo = clientIncrementalMapper.findByClinetIdAndChannel(client.getInteger("client_id"), channel);
|
|
|
|
JSONObject incrementalInfo = clientIncrementalMapper.findByClinetIdAndChannel(client.getInteger("client_id"), channel);
|
|
|
|
if(incrementalInfo==null){
|
|
|
|
if (incrementalInfo == null) {
|
|
|
|
throw new BadRequestException("Merchant service not opened");
|
|
|
|
throw new BadRequestException("Merchant service not opened");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return incrementalInfo;
|
|
|
|
return incrementalInfo;
|
|
|
@ -6187,6 +6187,17 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
svcMchBean.setLogo(mchInfo.getString("logo_url"));
|
|
|
|
svcMchBean.setLogo(mchInfo.getString("logo_url"));
|
|
|
|
svcMchBean.setIndustryCode(mchInfo.getString("industry"));
|
|
|
|
svcMchBean.setIndustryCode(mchInfo.getString("industry"));
|
|
|
|
svcMchBean.setIndustryName(findByLookupCode(mchInfo.getString("industry")).getString("lookup_value"));
|
|
|
|
svcMchBean.setIndustryName(findByLookupCode(mchInfo.getString("industry")).getString("lookup_value"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
svcMchBean.setAddress(mchInfo.getString("address"));
|
|
|
|
|
|
|
|
svcMchBean.setRegisteredAddress(mchInfo.getString("bank_address"));
|
|
|
|
|
|
|
|
svcMchBean.setContactPerson(mchInfo.getString("contact_person"));
|
|
|
|
|
|
|
|
svcMchBean.setContactPhone(mchInfo.getString("contact_phone"));
|
|
|
|
|
|
|
|
svcMchBean.setContactEmail(mchInfo.getString("contact_email"));
|
|
|
|
|
|
|
|
svcMchBean.setBsbNumber(mchInfo.getString("bsn_no"));
|
|
|
|
|
|
|
|
svcMchBean.setAccountNo(mchInfo.getString("account_no"));
|
|
|
|
|
|
|
|
svcMchBean.setAccountName(mchInfo.getString("account_name"));
|
|
|
|
|
|
|
|
svcMchBean.setTelNumber(mchInfo.getString("bank_phone"));
|
|
|
|
|
|
|
|
svcMchBean.setAbn(mchInfo.getString("abn"));
|
|
|
|
return svcMchBean;
|
|
|
|
return svcMchBean;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|