From 529be0e353a144fe0998fd327be574eaf5895a2c Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 1 Apr 2020 18:42:32 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix=20=E6=B8=85=E7=AE=97=E6=97=A5=E6=8A=A5?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E8=AF=AF=E5=B7=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../web/PartnerCardDashboardController.java | 13 +-------- .../web/CleanLogClientController.java | 29 ++----------------- 3 files changed, 5 insertions(+), 39 deletions(-) diff --git a/pom.xml b/pom.xml index 9ee3066b1..b0501cc09 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 1.4.23 + 1.4.24 UTF-8 1.8.0 diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/PartnerCardDashboardController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/PartnerCardDashboardController.java index 682949f6e..80cb363ed 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/PartnerCardDashboardController.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/web/PartnerCardDashboardController.java @@ -10,15 +10,11 @@ import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -import java.text.ParseException; -import java.util.Date; import java.util.List; import java.util.Map; @@ -96,14 +92,7 @@ public class PartnerCardDashboardController { @RequestMapping("/{client_id}/settlement_logs/report_date/{reportDate}") @ReadOnlyConnection public JSONObject listClearingTransactionsOfMergeSettle(@PathVariable int client_id, @PathVariable String reportDate,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - Date date = new Date(); - try { - date = DateUtils.parseDate(reportDate, "yyyy-MM-dd"); - } catch (ParseException e) { - logger.error("parse report date error:{}", e.getMessage()); - } - String realRDate = DateFormatUtils.format(DateUtils.addDays(date, 1), "yyyy-MM-dd"); - return cleanService.getCleanLogTransactionsOfMergeSettle(client_id,realRDate, manager); + return cleanService.getCleanLogTransactionsOfMergeSettle(client_id,reportDate, manager); } @RequestMapping("/settlement_logs/{detailId}/analysis/{channel}") diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/CleanLogClientController.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/CleanLogClientController.java index 73eb6d09b..59bb2dde9 100644 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/CleanLogClientController.java +++ b/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/CleanLogClientController.java @@ -5,7 +5,6 @@ import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.exceptions.BadRequestException; import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -14,7 +13,6 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.text.ParseException; -import java.util.Date; import java.util.List; import java.util.Map; @@ -46,14 +44,7 @@ public class CleanLogClientController { @RequestMapping("/{client_id}/settlement_logs/report_date/{reportDate}") public JSONObject listClearingTransactionsOfMergeSettle(@PathVariable int client_id, @PathVariable String reportDate, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) { - Date date = new Date(); - try { - date = DateUtils.parseDate(reportDate, "yyyy-MM-dd"); - } catch (ParseException e) { - logger.error("parse report date error:{}", e.getMessage()); - } - String realRDate = DateFormatUtils.format(DateUtils.addDays(date, 1), "yyyy-MM-dd"); - JSONObject data = cleanService.listClearingTransactionsByMergeSettle(partner.getIntValue("client_id"), realRDate, partner); + JSONObject data = cleanService.listClearingTransactionsByMergeSettle(partner.getIntValue("client_id"), reportDate, partner); data.put("report_date", reportDate); return data; } @@ -67,14 +58,7 @@ public class CleanLogClientController { @RequestMapping("/{client_id}/settlement_logs/report_date/{reportDate}/analysis/{channel}") public Map channelAndDayOfMergeSettleAnalysis(@PathVariable int client_id, @PathVariable String reportDate, @PathVariable String channel, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) { - Date date = new Date(); - try { - date = DateUtils.parseDate(reportDate, "yyyy-MM-dd"); - } catch (ParseException e) { - logger.error("parse report date error:{}", e.getMessage()); - } - String realRDate = DateFormatUtils.format(DateUtils.addDays(date, 1), "yyyy-MM-dd"); - return cleanService.channelAndDayOfMergeSettleAnalysis(client_id, realRDate,channel,partner); + return cleanService.channelAndDayOfMergeSettleAnalysis(client_id, reportDate,channel,partner); } @PartnerMapping("/{client_id}/settlement_logs/{clearingDetailId}/export") @@ -86,14 +70,7 @@ public class CleanLogClientController { @PartnerMapping("/{client_id}/settlement_logs/report_date/{reportDate}/export") public void exportTransactionsByReportDate(@PathVariable int client_id, @PathVariable String reportDate, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, HttpServletResponse resp) { - Date date = new Date(); - try { - date = DateUtils.parseDate(reportDate, "yyyy-MM-dd"); - } catch (ParseException e) { - logger.error("parse report date error:{}", e.getMessage()); - } - String realRDate = DateFormatUtils.format(DateUtils.addDays(date, 1), "yyyy-MM-dd"); - cleanService.exportTransactionsByReportDate(realRDate, partner, resp); + cleanService.exportTransactionsByReportDate(reportDate, partner, resp); } // @RequestMapping(value = "/{clearId}.json") From 08328d43703cae0db74a5945d74c64d74ee8fcc4 Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 1 Apr 2020 19:02:57 +0800 Subject: [PATCH 2/2] =?UTF-8?q?add=20ap=E6=B8=85=E7=AE=97=E6=96=87?= =?UTF-8?q?=E4=BB=B6=20=E6=8A=A5=E8=A1=A8=E5=A2=9E=E5=8A=A0=E5=95=86?= =?UTF-8?q?=E6=88=B7=E7=BC=96=E7=A0=81=E5=92=8C=E7=AE=80=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../clearing/core/impl/CleanServiceImpl.java | 42 +-- .../mappers/payment/TransactionMapper.xml | 4 +- .../commons/services/clearingDetailService.js | 2 +- ...artner_settlement_merge_settle_dialog.html | 239 ++++++++++++++++++ 5 files changed, 266 insertions(+), 23 deletions(-) create mode 100644 src/main/ui/static/payment/tradelog/templates/partner_settlement_merge_settle_dialog.html diff --git a/pom.xml b/pom.xml index b0501cc09..0a506a47f 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 1.4.24 + 1.4.25 UTF-8 1.8.0 diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java index 27925411a..7cd89a462 100644 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java @@ -1170,7 +1170,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider Sheet sheet = wb.createSheet("Merchant_Settlement_Info_" + reportDate); int rowNum = 0; Row row = sheet.createRow(rowNum); - String[] title = {"order Id", "Client Order Id", "Transaction Time", "Channel", "Gateway", "Exchange Rate", "Transaction Type", "Currency", + String[] title = {"Client Moniker","Short Name","order Id", "Client Order Id", "Transaction Time", "Channel", "Gateway", "Exchange Rate", "Transaction Type", "Currency", "Input Amount", "Total Amount", "Clearing Amount(AUD)", "Sruchange Rate", "Surcharge(AUD)", "GST(AUD)", "Settle Amount(AUD)", "Remark", "Dev No", "Dev Remark"}; String[] analysis = {"Total Credit(AUD)", "Total Debit(AUD)", "Gross Amount(AUD)", "Total GST(AUD)", "Total Charge(AUD)", "Net Amount(AUD)"}; for (int i = 0; i < title.length; i++) { @@ -1184,53 +1184,55 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider continue; } row = sheet.createRow(++rowNum); - row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("order_id")); - row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("client_order_id")); + row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("client_moniker")); + row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("short_name")); + row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("order_id")); + row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("client_order_id")); Calendar calendar = (Calendar) settle.get("transaction_time"); - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(DateFormatUtils.format(calendar, "yyyy-MM-dd HH:mm:ss", calendar.getTimeZone())); - row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("channel")); + row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(DateFormatUtils.format(calendar, "yyyy-MM-dd HH:mm:ss", calendar.getTimeZone())); + row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("channel")); if (settle.getInteger("gateway") != null) { - row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(TradeType.fromGatewayNumber(settle.getIntValue("gateway")).getTradeType()); + row.createCell(6, Cell.CELL_TYPE_STRING).setCellValue(TradeType.fromGatewayNumber(settle.getIntValue("gateway")).getTradeType()); } else { - row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue("-"); + row.createCell(6, Cell.CELL_TYPE_STRING).setCellValue("-"); } - row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("exchange_rate").setScale(5, BigDecimal.ROUND_DOWN).toPlainString()); - cell = row.createCell(6, Cell.CELL_TYPE_STRING); + row.createCell(7, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("exchange_rate").setScale(5, BigDecimal.ROUND_DOWN).toPlainString()); + cell = row.createCell(8, Cell.CELL_TYPE_STRING); cell.setCellValue(settle.getString("transaction_type")); cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null); - row.createCell(7, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("transaction_currency")); - cell = row.createCell(8, Cell.CELL_TYPE_STRING); + row.createCell(9, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("transaction_currency")); + cell = row.createCell(10, Cell.CELL_TYPE_STRING); cell.setCellValue(settle.getBigDecimal("display_amount") == null ? "" : "Credit".equals(settle.getString("transaction_type")) ? settle.getBigDecimal("display_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString() : "-" + settle.getBigDecimal("display_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString()); cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null); - cell = row.createCell(9, Cell.CELL_TYPE_STRING); + cell = row.createCell(11, Cell.CELL_TYPE_STRING); cell.setCellValue(settle.getBigDecimal("transaction_amount") == null ? "" : "Credit".equals(settle.getString("transaction_type")) ? settle.getBigDecimal("transaction_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString() : "-" + settle.getBigDecimal("transaction_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString()); cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null); - cell = row.createCell(10, Cell.CELL_TYPE_STRING); + cell = row.createCell(12, Cell.CELL_TYPE_STRING); cell.setCellValue(settle.getBigDecimal("clearing_amount") == null ? "" : "Credit".equals(settle.getString("transaction_type")) ? settle.getBigDecimal("clearing_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString() : "-" + settle.getBigDecimal("clearing_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString()); cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null); - row.createCell(11, Cell.CELL_TYPE_STRING).setCellValue(channels.getString(settle.getString("channel")) == null ? "" + row.createCell(13, Cell.CELL_TYPE_STRING).setCellValue(channels.getString(settle.getString("channel")) == null ? "" : channels.getJSONObject(settle.getString("channel")).getBigDecimal("rate").toPlainString() + "%"); //手续费 + gst - row.createCell(12, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("total_surcharge") == null ? "" + row.createCell(14, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("total_surcharge") == null ? "" : settle.getBigDecimal("total_surcharge").setScale(2, RoundingMode.DOWN).toPlainString()); - row.createCell(13, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("tax_amount") == null ? "" + row.createCell(15, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("tax_amount") == null ? "" : settle.getBigDecimal("tax_amount").setScale(2, RoundingMode.DOWN).toPlainString()); - cell = row.createCell(14, Cell.CELL_TYPE_STRING); + cell = row.createCell(16, Cell.CELL_TYPE_STRING); cell.setCellValue(settle.getBigDecimal("settle_amount") == null ? "" : "Credit".equals(settle.getString("transaction_type")) ? settle.getBigDecimal("settle_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString() : "-" + settle.getBigDecimal("settle_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString()); cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null); - row.createCell(15, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("order_detail")); + row.createCell(17, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("order_detail")); String clientDevId = StringUtils.defaultString(settle.getString("dev_id"), "-"); JSONObject device = clientDeviceMapper.find(settle.getString("dev_id")); String clientDevRemark = "-"; @@ -1238,8 +1240,8 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider clientDevId = device.getString("client_dev_id"); clientDevRemark = device.getString("remark"); } - row.createCell(16, Cell.CELL_TYPE_STRING).setCellValue(clientDevId); - row.createCell(17, Cell.CELL_TYPE_STRING).setCellValue(clientDevRemark); + row.createCell(18, Cell.CELL_TYPE_STRING).setCellValue(clientDevId); + row.createCell(19, Cell.CELL_TYPE_STRING).setCellValue(clientDevRemark); } row = sheet.createRow(++rowNum); for (int i = 0; i < analysis.length; i++) { diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml index e64ed299a..3c67c1566 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml @@ -1168,7 +1168,9 @@ r.client_refund_id, o.order_detail, o.dev_id, - o.source + o.source, + c.client_moniker, + c.short_name FROM pmt_transactions t LEFT JOIN pmt_orders o ON o.order_id = t.order_id LEFT JOIN pmt_refunds r ON r.refund_id = t.refund_id diff --git a/src/main/ui/static/commons/services/clearingDetailService.js b/src/main/ui/static/commons/services/clearingDetailService.js index 80a0c654c..7d347e1cf 100644 --- a/src/main/ui/static/commons/services/clearingDetailService.js +++ b/src/main/ui/static/commons/services/clearingDetailService.js @@ -21,7 +21,7 @@ define(['../app','decimal'], function (app,Decimal) { } function openDetailOfMergeSettle(url,client_id) { $uibModal.open({ - templateUrl: '/static/payment/tradelog/templates/partner_settlement_dialog.html', + templateUrl: '/static/payment/tradelog/templates/partner_settlement_merge_settle_dialog.html', controller: 'clearingDetailOfMergeSettleCtrl', resolve: { detail: ['$http', function ($http) { diff --git a/src/main/ui/static/payment/tradelog/templates/partner_settlement_merge_settle_dialog.html b/src/main/ui/static/payment/tradelog/templates/partner_settlement_merge_settle_dialog.html new file mode 100644 index 000000000..d3bb5a488 --- /dev/null +++ b/src/main/ui/static/payment/tradelog/templates/partner_settlement_merge_settle_dialog.html @@ -0,0 +1,239 @@ + +