diff --git a/src/document/tpl/img/RoyalPay_Gateway_choose_cn.jpg b/src/document/tpl/img/RoyalPay_Gateway_choose_cn.jpg index 6fa99bc0e..5d335dd1e 100644 Binary files a/src/document/tpl/img/RoyalPay_Gateway_choose_cn.jpg and b/src/document/tpl/img/RoyalPay_Gateway_choose_cn.jpg differ diff --git a/src/document/tpl/img/RoyalPay_Gateway_choose_en.jpg b/src/document/tpl/img/RoyalPay_Gateway_choose_en.jpg index 4bf893e86..ab64eed40 100644 Binary files a/src/document/tpl/img/RoyalPay_Gateway_choose_en.jpg and b/src/document/tpl/img/RoyalPay_Gateway_choose_en.jpg differ diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java index 6bce737ff..05b3c61cb 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java @@ -190,6 +190,7 @@ public class RetailAppServiceImp implements RetailAppService { // 微信小程序不查询汇率 if (!StringUtils.equals(device.getString("client_type"), "wxapp")) { res.put("rate", paymentApi.channelApi("Wechat").queryExchangeRateDecimal(client_id)); + res.put("alipay_rate", paymentApi.channelApi("Alipay").queryExchangeRateDecimal(client_id)); } return res; } @@ -1451,7 +1452,7 @@ public class RetailAppServiceImp implements RetailAppService { @Override public void changeManualSettle(JSONObject device, boolean manual_settle) { - clientManager.changeManualSettle(device.getIntValue("client_id"), manual_settle, device.getString("account_id"), 1, "商户修改手动清算配置"); + clientManager.changeManualSettle(device.getIntValue("client_id"), manual_settle, device.getString("account_id"), 1, "商户"+(manual_settle?"打开":"关闭")+"手动清算"); } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java index 711b267b1..039a68912 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java @@ -121,7 +121,7 @@ public interface ClientManager { void changeRole(JSONObject manager, String clientMoniker, String accountId, int role); @Transactional - void toggleAuditRefund(String clientMoniker, boolean enable); + void toggleAuditRefund(String clientMoniker, boolean enable, JSONObject account); List listPaymentNoticeAccounts(int clientId); diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientModifySupport.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientModifySupport.java new file mode 100644 index 000000000..1fc7260a1 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientModifySupport.java @@ -0,0 +1,11 @@ +package au.com.royalpay.payment.manage.merchants.core; + +import au.com.royalpay.payment.manage.merchants.entity.ClientModify; + +/** + * Create by yixian at 2018-04-12 16:24 + */ +public interface ClientModifySupport { + + void processClientModify(ClientModify clientModify); +} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java index 457bd444d..d36f6675a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java @@ -42,6 +42,8 @@ import au.com.royalpay.payment.manage.merchants.core.ClientComplyValidator; import au.com.royalpay.payment.manage.merchants.core.ClientConfigService; import au.com.royalpay.payment.manage.merchants.core.ClientInfoCacheSupport; import au.com.royalpay.payment.manage.merchants.core.ClientManager; +import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport; +import au.com.royalpay.payment.manage.merchants.entity.impls.RefundAuditModify; import au.com.royalpay.payment.manage.notice.core.MailService; import au.com.royalpay.payment.manage.signin.beans.TodoNotice; import au.com.royalpay.payment.manage.signin.core.ManagerTodoNoticeProvider; @@ -179,6 +181,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid // todo 作用 @Resource private ClientComplyValidator[] validators; + @Resource + private ClientModifySupport clientModifySupport; + @Resource private PaymentChannelApi[] channels; @Resource @@ -1088,12 +1093,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } @Override - public void toggleAuditRefund(String clientMoniker, boolean enable) { - JSONObject partner = getClientInfoByMoniker(clientMoniker); - Assert.notNull(partner, "Merchant is null"); - partner.put("enable_refund_auth", enable); - clientMapper.update(partner); - clientInfoCacheSupport.clearClientCache(partner.getIntValue("client_id")); + public void toggleAuditRefund(String clientMoniker, boolean enable, JSONObject account) { + clientModifySupport.processClientModify(new RefundAuditModify(account, clientMoniker, enable)); } @Override @@ -2150,7 +2151,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid file.put("last_update_by", manager.getString("display_name")); } JSONObject contract = clientsContractMapper.findByClientId(client.getIntValue("client_id")); - if (contract == null || now.compareTo(contract.getDate("expiry_date")) > 0 ||!contract.getBoolean("has_sign")|| existFile == null || existFile.isEmpty()) { + if (contract == null || now.compareTo(contract.getDate("expiry_date")) > 0 || !contract.getBoolean("has_sign") || existFile == null || existFile.isEmpty()) { clientFilesMapper.save(file); } else { file.put("file_id", existFile.getString("file_id")); @@ -3009,7 +3010,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } private TemplateMessage initSendToComplianceGreenChannelTemplate(String loginUrl, String wxopenid, String templateId2, String bd_user_name, - JSONObject client) { + JSONObject client) { TemplateMessage msg = new TemplateMessage(wxopenid, templateId2, loginUrl); msg.put("first", bd_user_name + " 提交了新商户绿色通道申请,请审核", "#ff0000"); msg.put("keyword1", client.getString("client_moniker") + "申请绿色通道", "#0000ff"); @@ -3250,12 +3251,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid @Override public JSONObject getCheckClientInfo(int client_id, String account_id, String channel) { JSONObject result = null; - JSONObject expireInfo = clientContractService.getClientContractExpire(client_id,channel); + JSONObject expireInfo = clientContractService.getClientContractExpire(client_id, channel); JSONObject account = clientAccountMapper.findById(account_id); if (PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) { - return result; + return result; } else { - if(expireInfo.getBoolean("alert")){ + if (expireInfo.getBoolean("alert")) { result = new JSONObject(); // result.put("content","Dear Valued Merchants,\n" + // "\n" + @@ -3303,8 +3304,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid // "\n" + // "(注:GST只针对手续费部分,与商品价格无关)\n" + // "\n"); - result.put("content","

Dear Valued Merchants,


We would like to extend our warm gratitude to your business for your continued support of RoyalPay. Without our merchants we wouldn't be where we are today. 


RoyalPay has and always will be committed to complying with all Australian laws, rules and regulations. With our deep roots in China, we also work with all Chinese regulations simultaneously with Australia. Since our humble beginnings in 2016 we have worked with the ATO (Australian Tax Office) to make sure that we are in alignment with all tax requirements. 


During FY18 we entered negotiations with the ATO to file for GST exemptions for the part of surcharge fees. The ATO has recently advised that we have been unsuccessful in this bid. To ensure we comply with the ATO, we will need to adjust our current service agreements to be exclusionary of GST. 


This will result in contractual changes to your agreement. However, your business may be eligible to claim this amount back depending on the tax relationship of your business. Please consult with your accounting team in relation to these changes. 


If you have any questions related to this change please direct them to our Sales Management Team or your relevant BD officer.


(note: GST is for the surcharge fee only, not related to the price of the goods.)


尊敬的商户,


感谢您选择RoyalPay。作为澳洲移动支付的先行者和领导者,RoyalPay自2016年起就开始针对交易手续费这一澳洲目前空白的税务问题对接澳大利亚相关监管机构。作为市场上全新的支付模式,这两年来我们不断地与相关机构探讨最为合适的监管法令应用,同时澳洲的相应法律法规也在不断地完善来提供更全面的监管,来营造更加稳定、健康、健全的金融市场。


RoyalPay于近期正式收到澳洲监管机构的通知,针对手续费Tax Free的申请和特殊税务条款考量做出了相应的回复:目前澳洲市场上的移动支付(扫码)解决方案所产生的手续费部分的GST并不能享受Tax Free及部分减免的政策条款。我们已经替2018年前交易的商户补足了手续费部分的税金,并应澳大利亚税务局ATO的要求进行了合同上手续费GST部分的相应调整。您也可咨询专业的会计师来申请您额外的手续费GST Return。感谢您的支持和理解,愿我们一起共同努力,塑造一个良好而有序的澳洲移动支付市场。


有任何疑问,请随时联络我们的客服与公众号。

(注:GST只针对手续费部分,与商品价格无关)


"); - result.put("title","【Important!重要!!】GST Modification Notice | 澳洲监管机构关于手续费GST调整问题通知\n"); + result.put("content", "

Dear Valued Merchants,


We would like to extend our warm gratitude to your business for your continued support of RoyalPay. Without our merchants we wouldn't be where we are today. 


RoyalPay has and always will be committed to complying with all Australian laws, rules and regulations. With our deep roots in China, we also work with all Chinese regulations simultaneously with Australia. Since our humble beginnings in 2016 we have worked with the ATO (Australian Tax Office) to make sure that we are in alignment with all tax requirements. 


During FY18 we entered negotiations with the ATO to file for GST exemptions for the part of surcharge fees. The ATO has recently advised that we have been unsuccessful in this bid. To ensure we comply with the ATO, we will need to adjust our current service agreements to be exclusionary of GST. 


This will result in contractual changes to your agreement. However, your business may be eligible to claim this amount back depending on the tax relationship of your business. Please consult with your accounting team in relation to these changes. 


If you have any questions related to this change please direct them to our Sales Management Team or your relevant BD officer.


(note: GST is for the surcharge fee only, not related to the price of the goods.)


尊敬的商户,


感谢您选择RoyalPay。作为澳洲移动支付的先行者和领导者,RoyalPay自2016年起就开始针对交易手续费这一澳洲目前空白的税务问题对接澳大利亚相关监管机构。作为市场上全新的支付模式,这两年来我们不断地与相关机构探讨最为合适的监管法令应用,同时澳洲的相应法律法规也在不断地完善来提供更全面的监管,来营造更加稳定、健康、健全的金融市场。


RoyalPay于近期正式收到澳洲监管机构的通知,针对手续费Tax Free的申请和特殊税务条款考量做出了相应的回复:目前澳洲市场上的移动支付(扫码)解决方案所产生的手续费部分的GST并不能享受Tax Free及部分减免的政策条款。我们已经替2018年前交易的商户补足了手续费部分的税金,并应澳大利亚税务局ATO的要求进行了合同上手续费GST部分的相应调整。您也可咨询专业的会计师来申请您额外的手续费GST Return。感谢您的支持和理解,愿我们一起共同努力,塑造一个良好而有序的澳洲移动支付市场。


有任何疑问,请随时联络我们的客服与公众号。

(注:GST只针对手续费部分,与商品价格无关)


"); + result.put("title", "【Important!重要!!】GST Modification Notice | 澳洲监管机构关于手续费GST调整问题通知\n"); } } return result; diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientModifySupportImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientModifySupportImpl.java new file mode 100644 index 000000000..a996be459 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientModifySupportImpl.java @@ -0,0 +1,30 @@ +package au.com.royalpay.payment.manage.merchants.core.impls; + +import au.com.royalpay.payment.manage.mappers.system.ClientMapper; +import au.com.royalpay.payment.manage.merchants.core.ClientInfoCacheSupport; +import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport; +import au.com.royalpay.payment.manage.merchants.entity.ClientModify; +import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * Create by yixian at 2018-04-12 16:25 + */ +@Service +public class ClientModifySupportImpl implements ClientModifySupport { + @Resource + private MerchantInfoProvider merchantInfoProvider; + @Resource + private ClientInfoCacheSupport clientInfoCacheSupport; + @Resource + private ClientMapper clientMapper; + + + @Override + public void processClientModify(ClientModify modify) { + int clientId = modify.doModify(merchantInfoProvider, mapper, clientMapper); + clientInfoCacheSupport.clearClientCache(clientId); + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/ClientModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/ClientModify.java new file mode 100644 index 000000000..9341e27f2 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/ClientModify.java @@ -0,0 +1,53 @@ +package au.com.royalpay.payment.manage.merchants.entity; + +import au.com.royalpay.payment.manage.mappers.system.ClientMapper; +import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; + +import java.util.Map; +import java.util.stream.Collectors; + +/** + * Create by yixian at 2018-04-12 16:19 + */ +public abstract class ClientModify { + + private JSONObject manager; + private JSONObject account; + + private String clientMoniker; + + public ClientModify(JSONObject manager, JSONObject account, String clientMoniker) { + this.manager = manager; + this.account = account; + this.clientMoniker = clientMoniker; + } + + protected abstract String business(); + + protected abstract JSONObject getModifyResult(); + + public int doModify(MerchantInfoProvider merchantInfoProvider, ModifyHistoryMapper modifyHistoryMapper, ClientMapper clientMapper) { + JSONObject client = merchantInfoProvider.getClientInfoByMoniker(clientMoniker); + JSONObject modifyResult = getModifyResult(); + saveModifyHistory(modifyHistoryMapper, client, modifyResult); + int clientId = client.getIntValue("client_id"); + modifyResult.put("client_id", clientId); + clientMapper.update(modifyResult); + return clientId; + } + + private void saveModifyHistory(ModifyHistoryMapper modifyHistoryMapper, JSONObject client, JSONObject modifyResult) { + Map beforeModify = modifyResult.keySet().stream().collect(Collectors.toMap(key -> key, client::get)); + JSONObject modifyHistory = new JSONObject(); + modifyHistory.put("client_id", client.getIntValue("client_id")); + modifyHistory.put("business", business()); + modifyHistory.put("user_type", manager == null ? "Merchant" : "Manager"); + modifyHistory.put("user_id", manager == null ? account.getString("account_id") : manager.getString("manager_id")); + modifyHistory.put("username", manager == null ? account.getString("display_name") : manager.getString("display_name")); + modifyHistory.put("origin_data", JSON.toJSONString(beforeModify)); + modifyHistory.put("new_data", modifyResult.toJSONString()); + modifyHistoryMapper.saveModifyHistory(modifyHistory); + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/RefundAuditModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/RefundAuditModify.java new file mode 100644 index 000000000..2da1fc16b --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/RefundAuditModify.java @@ -0,0 +1,28 @@ +package au.com.royalpay.payment.manage.merchants.entity.impls; + +import au.com.royalpay.payment.manage.merchants.entity.ClientModify; +import com.alibaba.fastjson.JSONObject; + +/** + * Create by yixian at 2018-04-12 16:43 + */ +public class RefundAuditModify extends ClientModify { + private boolean enable; + + public RefundAuditModify(JSONObject account, String clientMoniker, boolean enable) { + super(null, account, clientMoniker); + this.enable = enable; + } + + @Override + protected String business() { + return "refund_audit"; + } + + @Override + protected JSONObject getModifyResult() { + JSONObject modify = new JSONObject(); + modify.put("enable_refund_auth", enable) + return modify; + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java index 783be78d9..0f7a2a89f 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java @@ -225,7 +225,7 @@ public class PartnerViewController { @PartnerMapping(value = "/audit_refund", method = RequestMethod.PUT, roles = PartnerRole.ADMIN) @ResponseBody public void toggleAuditRefund(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject enable) { - clientManager.toggleAuditRefund(account.getString("client_moniker"), enable.getBooleanValue("enable")); + clientManager.toggleAuditRefund(account.getString("client_moniker"), enable.getBooleanValue("enable"), account); } @PartnerMapping(value = "/refund_pwd", method = RequestMethod.PUT, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) @@ -292,7 +292,7 @@ public class PartnerViewController { public JSONObject listClientDevices(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestParam(required = false) String remark, @RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int limit, @RequestParam(required = false) String client_type, @RequestParam(required = false) String[] client_ids) { - return clientManager.listClientDevices(null, account.getString("client_moniker"), remark, page, limit,client_type,client_ids); + return clientManager.listClientDevices(null, account.getString("client_moniker"), remark, page, limit, client_type, client_ids); } @PartnerMapping(value = "/devices/{devId}", method = RequestMethod.PUT, roles = PartnerRole.ADMIN) @@ -366,18 +366,18 @@ public class PartnerViewController { @PartnerMapping(value = "/manual_settle", method = RequestMethod.PUT, roles = PartnerRole.ADMIN) @ResponseBody public void manualSettle(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestParam boolean manual_settle) { - clientManager.changeManualSettle(account.getIntValue("client_id"),manual_settle,account.getString("account_id"),1,"商户"+(manual_settle?"打开":"关闭")+"手动清算"); + clientManager.changeManualSettle(account.getIntValue("client_id"), manual_settle, account.getString("account_id"), 1, "商户" + (manual_settle ? "打开" : "关闭") + "手动清算"); } @PartnerMapping(value = "/checkContract", method = RequestMethod.GET) @ResponseBody public JSONObject getCheckClientInfov2(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - return clientManager.getCheckClientInfo(account.getIntValue("client_id"),account.getString("account_id"),"PC"); + return clientManager.getCheckClientInfo(account.getIntValue("client_id"), account.getString("account_id"), "PC"); } - @PartnerMapping(value = "/agree/confirm", method = RequestMethod.POST,roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) + @PartnerMapping(value = "/agree/confirm", method = RequestMethod.POST, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) @ResponseBody public void confirmSourceAgreeFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - clientContractService.confirmSourceAgreement(account.getIntValue("client_id"),account.getString("account_id"),"PC"); + clientContractService.confirmSourceAgreement(account.getIntValue("client_id"), account.getString("account_id"), "PC"); } } diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java index 3862de24a..fa01df57d 100644 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java @@ -542,6 +542,10 @@ public class TradeLogServiceImpl implements TradeLogService { .filter(log -> log.getBigDecimal("settle_amount") != null) .map(log -> getSymbol(log).multiply(log.getBigDecimal("total_surcharge").add(log.getBigDecimal("tax_amount")))) .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); + analysis.put("tax_amount", logs.parallelStream() + .filter(log -> log.getBigDecimal("settle_amount") != null) + .map(log -> getSymbol(log).multiply(log.getBigDecimal("tax_amount"))) + .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); analysis.put("wechat_fee", logs.parallelStream() .filter(log -> log.getBigDecimal("settle_amount") != null) .filter(log -> "WechatSettlement".contains(log.getString("channel"))) @@ -604,11 +608,8 @@ public class TradeLogServiceImpl implements TradeLogService { parmerters.put("wechat_fee", takeDecimalOrDefault(analysis, "wechat_fee", BigDecimal.ZERO)); parmerters.put("bestpay_fee", takeDecimalOrDefault(analysis, "bestpay_fee", BigDecimal.ZERO)); parmerters.put("jd_fee", takeDecimalOrDefault(analysis, "jd_fee", BigDecimal.ZERO)); - parmerters.put("alipay_online_fee", takeDecimalOrDefault(analysis, "alipay_online_fee", BigDecimal.ZERO)); // parmerters.put("gst", analysis.containsKey("clearing_fee") ? - // analysis.getBigDecimal("clearing_fee").multiply(new BigDecimal(0.11)).setScale(2, - // BigDecimal.ROUND_DOWN) : 0); -// parmerters.put("gst", -// analysis.containsKey("total_royal_surcharge") ? analysis.getBigDecimal("total_royal_surcharge").divide(new BigDecimal(11), 2, BigDecimal.ROUND_DOWN) : 0); + parmerters.put("alipay_online_fee", takeDecimalOrDefault(analysis, "alipay_online_fee", BigDecimal.ZERO)); + parmerters.put("gst", takeDecimalOrDefault(analysis, "tax_amount", BigDecimal.ZERO)); dataList.parallelStream().forEach(item -> { scaleDecimalVal(item, "display_amount", item.getString("currency")); String platformCurrency = PlatformEnvironment.getEnv().getForeignCurrency(); diff --git a/src/main/resources/jasper/partner_invoice_gst.jasper b/src/main/resources/jasper/partner_invoice_gst.jasper index 9c01d8c81..9f8703f18 100644 Binary files a/src/main/resources/jasper/partner_invoice_gst.jasper and b/src/main/resources/jasper/partner_invoice_gst.jasper differ diff --git a/src/main/resources/jasper/partner_invoice_gst20180412.jasper b/src/main/resources/jasper/partner_invoice_gst20180412.jasper new file mode 100644 index 000000000..9c01d8c81 Binary files /dev/null and b/src/main/resources/jasper/partner_invoice_gst20180412.jasper differ diff --git a/src/main/resources/jasper/trans_excel.jasper b/src/main/resources/jasper/trans_excel.jasper index 70a836128..714241425 100644 Binary files a/src/main/resources/jasper/trans_excel.jasper and b/src/main/resources/jasper/trans_excel.jasper differ diff --git a/src/main/resources/jasper/trans_excel20180412.jasper b/src/main/resources/jasper/trans_excel20180412.jasper new file mode 100644 index 000000000..70a836128 Binary files /dev/null and b/src/main/resources/jasper/trans_excel20180412.jasper differ diff --git a/src/main/ui/static/payment/tradelog/templates/partner_settlement_dialog.html b/src/main/ui/static/payment/tradelog/templates/partner_settlement_dialog.html index 39f8fa82b..a69c2c8d1 100644 --- a/src/main/ui/static/payment/tradelog/templates/partner_settlement_dialog.html +++ b/src/main/ui/static/payment/tradelog/templates/partner_settlement_dialog.html @@ -176,6 +176,7 @@ Currency Total Amount Clearing Amount + Remark @@ -185,6 +186,7 @@ + diff --git a/src/test/java/au/com/royalpay/payment/manage/apps/core/impls/CustomerImpressionImplTest.java b/src/test/java/au/com/royalpay/payment/manage/apps/core/impls/CustomerImpressionImplTest.java index d40bbe97c..bcdf954c7 100644 --- a/src/test/java/au/com/royalpay/payment/manage/apps/core/impls/CustomerImpressionImplTest.java +++ b/src/test/java/au/com/royalpay/payment/manage/apps/core/impls/CustomerImpressionImplTest.java @@ -1,24 +1,39 @@ package au.com.royalpay.payment.manage.apps.core.impls; -import javax.annotation.Resource; +import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; +import au.com.royalpay.payment.manage.mappers.system.ClientMapper; + +import com.alibaba.fastjson.JSONObject; +import org.apache.poi.hssf.usermodel.HSSFCell; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.xssf.usermodel.XSSFSheet; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.data.redis.core.BoundListOperations; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; -import com.alibaba.fastjson.JSONObject; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; -import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; +import javax.annotation.Resource; /** * Created by wangning on 05/01/2018. */ @SpringBootTest -@ActiveProfiles({ "local", "alipay", "wechat", "jd", "bestpay" }) +@ActiveProfiles({ "proxy", "alipay", "wechat", "jd", "bestpay" }) @RunWith(SpringRunner.class) public class CustomerImpressionImplTest { @Resource @@ -26,14 +41,89 @@ public class CustomerImpressionImplTest { @Resource private StringRedisTemplate stringRedisTemplate; + @Resource + private ClientMapper clientMapper; + + + // @Test + // public void redisQueue() { + // BoundListOperations ops = stringRedisTemplate.boundListOps("customer_impression"); + // JSONObject order = orderMapper.find("00009201711300930013961422"); + // for (int i = 0; i < 10000; i++) { + // ops.rightPush(order.toJSONString()); + // + // } + // } @Test - public void redisQueue() { - BoundListOperations ops = stringRedisTemplate.boundListOps("customer_impression"); - JSONObject order = orderMapper.find("00009201711300930013961422"); - for (int i = 0; i < 10000; i++) { - ops.rightPush(order.toJSONString()); + public void excel() { + try { + + List asd =null; + Map map = new HashMap<>(); + asd.forEach(p->{ + map.put(p.getString("sub_merchant_id"),p); + }); + + XSSFWorkbook workbook = new XSSFWorkbook(new FileInputStream(new File("/Users/wangning/Desktop/qwe.xlsx"))); + XSSFSheet sheet = workbook.getSheetAt(0); + Iterator rowIterator = sheet.rowIterator(); + Row row = null; + Cell cell = null; + while (rowIterator.hasNext()) { + row = rowIterator.next(); + cell = row.getCell(1); + if(cell==null){ + continue; + } + cell.setCellType(HSSFCell.CELL_TYPE_STRING); + JSONObject tmpOBJ = map.get(cell.getStringCellValue()); + if(tmpOBJ==null){ + continue; + } + row.createCell(4).setCellValue(tmpOBJ.getString("cc")); + row.createCell(5).setCellValue(tmpOBJ.getString("maxct")); + } +// +// +// if (!"Australia".equals(row.getCell(1).getStringCellValue())) { +// continue; +// } +// cell = row.getCell(0); +// cell.setCellType(HSSFCell.CELL_TYPE_STRING); +// +// JSONObject client = clientMapper.clientInfoBySubMerchantId(cell.getStringCellValue()); +// if(client==null){ +// continue; +// } +// row.createCell(4).setCellValue(client.getString("bd_user_name")); +// row.createCell(5).setCellValue(client.getString("client_moniker")); +// row.createCell(6).setCellValue(client.getString("short_name")); +// } +// +// XSSFSheet sheet3 = workbook.getSheetAt(3); +// Iterator rowIterator3 = sheet3.rowIterator(); +// while (rowIterator3.hasNext()) { +// row = rowIterator3.next(); +// if (!"Australia".equals(row.getCell(1).getStringCellValue())) { +// continue; +// } +// cell = row.getCell(0); +// cell.setCellType(HSSFCell.CELL_TYPE_STRING); +// JSONObject client = clientMapper.clientInfoBySubMerchantId(cell.getStringCellValue()); +// if(client==null){ +// continue; +// } +// row.createCell(4).setCellValue(client.getString("bd_user_name")); +// row.createCell(5).setCellValue(client.getString("client_moniker")); +// row.createCell(6).setCellValue(client.getString("short_name")); +// } + OutputStream out = new FileOutputStream("/Users/wangning/Desktop/订单fin.xlsx"); + workbook.write(out); + workbook.close(); + } catch (IOException e) { + e.printStackTrace(); } } } \ No newline at end of file