From b1c04352b694e28d52bf14779201337ad5299297 Mon Sep 17 00:00:00 2001 From: Yixian Date: Fri, 12 Nov 2021 13:47:43 +0800 Subject: [PATCH 01/28] =?UTF-8?q?hotfix:=20=E4=BC=98=E5=8C=96=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=95=B0=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mappers/TransactionAnalysisMapper.xml | 33 +++++-------------- uidocker/conf.d/default.conf | 26 ++++++++------- 2 files changed, 23 insertions(+), 36 deletions(-) diff --git a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml index afd6e95a0..a01539533 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml @@ -414,11 +414,9 @@ From 400084bbaa2286f364ab9c1032fd5783a48a8c44 Mon Sep 17 00:00:00 2001 From: Yixian Date: Fri, 12 Nov 2021 18:13:14 +0800 Subject: [PATCH 03/28] =?UTF-8?q?hotfix:=20=E4=BC=98=E5=8C=96=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=95=B0=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/analysis/core/impls/DashboardServiceImpl.java | 1 - src/main/ui/static/dashboard/dashboard.js | 2 -- src/main/ui/static/dashboard/templates/dashboard.html | 6 ++---- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java index bfeed2463..9d7dc7f86 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java @@ -114,7 +114,6 @@ public class DashboardServiceImpl implements DashboardService, DashboardAnalysis if (params.getDate("end").after(new Date())) { if (params.getDate("begin").compareTo(DateUtils.addDays(params.getDate("end"), -1)) == 0) { res.put("total_customers", transactionAnalysisMapper.countCustomers(params)); - res.put("old_customers", transactionAnalysisMapper.countOldCustomers(params)); res.put("traded_partners", clientAnalysisMapper.countTradedPartners(params)); } else { res = getYesOrLasMonth(params); diff --git a/src/main/ui/static/dashboard/dashboard.js b/src/main/ui/static/dashboard/dashboard.js index 5eb574c10..215b47411 100644 --- a/src/main/ui/static/dashboard/dashboard.js +++ b/src/main/ui/static/dashboard/dashboard.js @@ -139,8 +139,6 @@ define(['angular', 'uiRouter', 'jstz', 'uiBootstrap', 'angularEcharts'], functio $scope.analysis.traded_partners = resp.data.traded_partners; $scope.analysis.total_customers = resp.data.total_customers; - $scope.analysis.new_customers = resp.data.total_customers - resp.data.old_customers; - $scope.analysis.old_customers = resp.data.old_customers; }); $http.get('/dashboard/system/common_analysis_4', {params: $scope.currentScale.params()}).then(function (resp) { diff --git a/src/main/ui/static/dashboard/templates/dashboard.html b/src/main/ui/static/dashboard/templates/dashboard.html index a548a0776..a1044dcf3 100644 --- a/src/main/ui/static/dashboard/templates/dashboard.html +++ b/src/main/ui/static/dashboard/templates/dashboard.html @@ -233,11 +233,9 @@

- / - / - +

-

总消费人数/新客户/老客户

+

总消费人数

From d928de507e22322f7149cba6062d5a54c0e60b9e Mon Sep 17 00:00:00 2001 From: Yixian Date: Sat, 13 Nov 2021 08:58:16 +0800 Subject: [PATCH 04/28] add logger --- .../manage/analysis/core/impls/DashboardServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java index 9d7dc7f86..c2dafa563 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java @@ -557,6 +557,9 @@ public class DashboardServiceImpl implements DashboardService, DashboardAnalysis } private void generateData(DateFormat format, String date, JSONObject client) { + if (client.getIntValue("client_id") == 0) { + logger.info("analysising platform customers data", new RuntimeException("debug exception")); + } JSONObject params = new JSONObject(); String timezone = client.getString("timezone"); if (timezone != null) { From 239db017696c83db866eb3c222403cf3218e256b Mon Sep 17 00:00:00 2001 From: Yixian Date: Sat, 13 Nov 2021 10:00:04 +0800 Subject: [PATCH 05/28] add locker for --- .../manage/dev/web/TestController.java | 288 +++++++++--------- 1 file changed, 149 insertions(+), 139 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java index 27d1a9919..bf0964a66 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java @@ -37,6 +37,7 @@ import au.com.royalpay.payment.tools.exceptions.ServerErrorException; import au.com.royalpay.payment.tools.http.HttpUtils; import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; import au.com.royalpay.payment.tools.permission.enums.ManagerRole; +import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; import au.com.royalpay.payment.tools.utils.PdfUtils; import au.com.royalpay.payment.tools.utils.TimeZoneUtils; import com.alibaba.fastjson.JSON; @@ -77,6 +78,8 @@ import java.util.Optional; public class TestController { private final Logger logger = LoggerFactory.getLogger(getClass()); @Resource + private SynchronizedScheduler synchronizedScheduler; + @Resource private OrderMapper orderMapper; @Resource private RefundMapper refundMapper; @@ -178,7 +181,8 @@ public class TestController { } /** - * 第二个版本的合同 + * 第二个版本的合同 + * * @param clientMoniker * @param manager * @param httpResponse @@ -186,95 +190,95 @@ public class TestController { */ @ManagerMapping(value = "/{clientMoniker}/export/aggregate/agreepdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR}) public void exportAggregateAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) { - logger.info("===>exportAggregateAgreeFile:path:"+aggragatePdfPath); + logger.info("===>exportAggregateAgreeFile:path:" + aggragatePdfPath); httpResponse.setContentType("application/pdf"); httpResponse.setHeader("content-disposition", "attachment;filename=" + clientMoniker + "_AGREEMENT_" + new Date() + ".pdf"); try { - ServletOutputStream sos = httpResponse.getOutputStream(); + ServletOutputStream sos = httpResponse.getOutputStream(); - JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - String address = client.getString("address").trim(); - if (address.contains(",")) { - client.put("address", address.substring(0, address.lastIndexOf(",")).trim()); - client.put("address_sub", address.substring(address.lastIndexOf(",") + 1).trim()); - } - if (client.getString("acn") != null && !client.getString("acn").equals("")) { - client.put("acn_type", "ACN: (" + client.getString("acn") + ")"); - client.put("company_name_acn", client.getString("company_name") + " (ACN " + client.getString("acn") + ")"); - } else { - client.put("acn_type", "ABN: (" + client.getString("abn") + ")"); - client.put("company_name_acn", client.getString("company_name") + " (ABN " + client.getString("abn") + ")"); - } + JSONObject client = clientMapper.findClientByMoniker(clientMoniker); + if (client == null) { + throw new InvalidShortIdException(); + } + String address = client.getString("address").trim(); + if (address.contains(",")) { + client.put("address", address.substring(0, address.lastIndexOf(",")).trim()); + client.put("address_sub", address.substring(address.lastIndexOf(",") + 1).trim()); + } + if (client.getString("acn") != null && !client.getString("acn").equals("")) { + client.put("acn_type", "ACN: (" + client.getString("acn") + ")"); + client.put("company_name_acn", client.getString("company_name") + " (ACN " + client.getString("acn") + ")"); + } else { + client.put("acn_type", "ABN: (" + client.getString("abn") + ")"); + client.put("company_name_acn", client.getString("company_name") + " (ABN " + client.getString("abn") + ")"); + } - JSONObject weChatRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat"); - if (weChatRate == null) { - throw new BadRequestException("The Partner's Rate is not config!"); - } - client.put("wechat_rate", weChatRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); - client.put("clean", "T+"+weChatRate.getString("clean_days")); - client.put("clean_days", weChatRate.getString("clean_days")); - client.put("located_country", "Australia"); - if("1".equalsIgnoreCase(weChatRate.getString("clean_days"))){ + JSONObject weChatRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat"); + if (weChatRate == null) { + throw new BadRequestException("The Partner's Rate is not config!"); + } + client.put("wechat_rate", weChatRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); + client.put("clean", "T+" + weChatRate.getString("clean_days")); + client.put("clean_days", weChatRate.getString("clean_days")); + client.put("located_country", "Australia"); + if ("1".equalsIgnoreCase(weChatRate.getString("clean_days"))) { // clean_1 clean_1_friday clean_1_saturday - // second, third or fourth - client.put("clean_1", weChatRate.getString("clean_days")); - client.put("clean_1_friday", "first"); - client.put("clean_1_saturday", "second"); - }else if("2".equalsIgnoreCase(weChatRate.getString("clean_days"))){ - client.put("clean_1", weChatRate.getString("clean_days")); - client.put("clean_1_friday", "second"); - client.put("clean_1_saturday", "third"); - - }else if("3".equalsIgnoreCase(weChatRate.getString("clean_days"))){ - client.put("clean_1", weChatRate.getString("clean_days")); - client.put("clean_1_friday", "third"); - client.put("clean_1_saturday", "fourth"); - } - - try { - JSONObject alipayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Alipay"); - if (alipayRate != null) { - client.put("alipay_rate", alipayRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); + // second, third or fourth + client.put("clean_1", weChatRate.getString("clean_days")); + client.put("clean_1_friday", "first"); + client.put("clean_1_saturday", "second"); + } else if ("2".equalsIgnoreCase(weChatRate.getString("clean_days"))) { + client.put("clean_1", weChatRate.getString("clean_days")); + client.put("clean_1_friday", "second"); + client.put("clean_1_saturday", "third"); + + } else if ("3".equalsIgnoreCase(weChatRate.getString("clean_days"))) { + client.put("clean_1", weChatRate.getString("clean_days")); + client.put("clean_1_friday", "third"); + client.put("clean_1_saturday", "fourth"); } - JSONObject alipayOnlineRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "AlipayOnline"); - if (alipayOnlineRate != null) { - client.put("alipay_online_rate", alipayOnlineRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); + + try { + JSONObject alipayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Alipay"); + if (alipayRate != null) { + client.put("alipay_rate", alipayRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); + } + JSONObject alipayOnlineRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "AlipayOnline"); + if (alipayOnlineRate != null) { + client.put("alipay_online_rate", alipayOnlineRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); + } + } catch (Exception ignored) { + //do nothing } - } catch (Exception ignored) { - //do nothing - } - JSONObject account = getBankAccountByClientId(client.getIntValue("client_id")); - if (account == null || account.size() <= 0) { - throw new BadRequestException("The Partner's Account is not config!"); - } + JSONObject account = getBankAccountByClientId(client.getIntValue("client_id")); + if (account == null || account.size() <= 0) { + throw new BadRequestException("The Partner's Account is not config!"); + } - client.put("bank", account.getString("bank")); - client.put("bsb_no", account.getString("bsb_no")); - client.put("account_no", account.getString("account_no")); - client.put("account_name", account.getString("account_name")); - String start_date = DateFormatUtils.format(new Date(), "dd/MM/yyyy"); - client.put("start_date", start_date); - Date endDate = TimeZoneUtils.nextYearByCurrDay(); - String end_date = DateFormatUtils.format(endDate, "dd/MM/yyyy"); - client.put("end_date", end_date); - JSONObject clientLegal = sysClientLegalPersonMapper.findRepresentativeInfo(client.getIntValue("client_id")); - if (clientLegal != null) { - client.put("legal_person", clientLegal.getString("representative_person")); - client.put("legal_job_title", clientLegal.getString("job_title")); - client.put("legal_phone", clientLegal.getString("phone")); - client.put("legal_email", clientLegal.getString("email")); - client.put("client_contract_manager", clientLegal.getString("representative_person"));//client contract manager - } + client.put("bank", account.getString("bank")); + client.put("bsb_no", account.getString("bsb_no")); + client.put("account_no", account.getString("account_no")); + client.put("account_name", account.getString("account_name")); + String start_date = DateFormatUtils.format(new Date(), "dd/MM/yyyy"); + client.put("start_date", start_date); + Date endDate = TimeZoneUtils.nextYearByCurrDay(); + String end_date = DateFormatUtils.format(endDate, "dd/MM/yyyy"); + client.put("end_date", end_date); + JSONObject clientLegal = sysClientLegalPersonMapper.findRepresentativeInfo(client.getIntValue("client_id")); + if (clientLegal != null) { + client.put("legal_person", clientLegal.getString("representative_person")); + client.put("legal_job_title", clientLegal.getString("job_title")); + client.put("legal_phone", clientLegal.getString("phone")); + client.put("legal_email", clientLegal.getString("email")); + client.put("client_contract_manager", clientLegal.getString("representative_person"));//client contract manager + } - PdfUtils pdu = new PdfUtils(); - pdu.setTemplatePdfPath(aggragatePdfPath); - pdu.setPdfTemplate(client); - File file = new File(clientMoniker + "_agreement.pdf"); + PdfUtils pdu = new PdfUtils(); + pdu.setTemplatePdfPath(aggragatePdfPath); + pdu.setPdfTemplate(client); + File file = new File(clientMoniker + "_agreement.pdf"); ByteArrayOutputStream bos = pdu.templetPdfBos(file); @@ -285,6 +289,7 @@ public class TestController { e.printStackTrace(); } } + /** * 制作卡支付合同 * @@ -464,8 +469,15 @@ public class TestController { } @GetMapping(value = "/task/analysisDashboard") - public void analysisDashboard(@RequestParam("date") String date) throws ParseException { - dashboardService.generateCustomersAndOrdersStatistics(DateUtils.parseDate(date, "yyyyMMdd")); + public void analysisDashboard(@RequestParam("date") String date) { + synchronizedScheduler.executeProcess("manage_task:dashboardTask", 120_000, + () -> { + try { + dashboardService.generateCustomersAndOrdersStatistics(DateUtils.parseDate(date, "yyyyMMdd")); + } catch (ParseException e) { + logger.error("invalid input date:{}", date); + } + }); } @@ -567,70 +579,69 @@ public class TestController { /** * 批量更新微信子商户号 */ - @ManagerMapping(value = "/batch_update_wxsubmerchantId", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR, ManagerRole.DEVELOPER}) + @ManagerMapping(value = "/batch_update_wxsubmerchantId", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR, ManagerRole.DEVELOPER}) public void batchUpdateWxSubmerchantId() { - List findSubMerchantIdHistorys=sysWxMerchantApplyMapper.findSubMerchantIdHistorys(); - if(findSubMerchantIdHistorys==null)return; - logger.info("=========>batchUpdateWxSubmerchantId:"+findSubMerchantIdHistorys.size()); + List findSubMerchantIdHistorys = sysWxMerchantApplyMapper.findSubMerchantIdHistorys(); + if (findSubMerchantIdHistorys == null) return; + logger.info("=========>batchUpdateWxSubmerchantId:" + findSubMerchantIdHistorys.size()); findSubMerchantIdHistorys.parallelStream().forEach(jsonObject -> { JSONObject clientJson = clientMapper.findClient(jsonObject.getInteger("client_id")); JSONObject wechatMcc = paymentChannelMccGoodMapper.findWechatPayMccByClientId(jsonObject.getIntValue("client_id")); JSONObject clientConfig = clientConfigMapper.find(jsonObject.getIntValue("client_id")); - if(clientJson==null){ - logger.info("=========>没有查询到client:"+jsonObject.getInteger("client_id")); + if (clientJson == null) { + logger.info("=========>没有查询到client:" + jsonObject.getInteger("client_id")); return; } - if(wechatMcc==null){ - logger.info("=========>没有查询到mcc:"+jsonObject.getInteger("client_id")); + if (wechatMcc == null) { + logger.info("=========>没有查询到mcc:" + jsonObject.getInteger("client_id")); return; } // company_name short_name industry company_phone contact_person contact_phone contact_email 这些字段不能为空 - if(TextUtils.isEmpty(clientJson.getString("short_name"))|| - TextUtils.isEmpty(clientJson.getString("industry"))|| - TextUtils.isEmpty(clientJson.getString("company_phone"))|| - TextUtils.isEmpty(clientJson.getString("contact_phone"))|| - TextUtils.isEmpty(clientJson.getString("contact_person"))|| - TextUtils.isEmpty(clientJson.getString("contact_email"))|| - TextUtils.isEmpty(wechatMcc.getString("mc_code"))){ - logger.error("=======>数据不完整:clientid:"+jsonObject.getInteger("client_id")+""); + if (TextUtils.isEmpty(clientJson.getString("short_name")) || + TextUtils.isEmpty(clientJson.getString("industry")) || + TextUtils.isEmpty(clientJson.getString("company_phone")) || + TextUtils.isEmpty(clientJson.getString("contact_phone")) || + TextUtils.isEmpty(clientJson.getString("contact_person")) || + TextUtils.isEmpty(clientJson.getString("contact_email")) || + TextUtils.isEmpty(wechatMcc.getString("mc_code"))) { + logger.error("=======>数据不完整:clientid:" + jsonObject.getInteger("client_id") + ""); return; } - NewSubMerchantIdApply newSubMerchantIdApply=new NewSubMerchantIdApply(); + NewSubMerchantIdApply newSubMerchantIdApply = new NewSubMerchantIdApply(); newSubMerchantIdApply.setMerchant_id(jsonObject.getString("merchant_id")); newSubMerchantIdApply.setSub_mch_id(jsonObject.getString("sub_merchant_id")); newSubMerchantIdApply.setMerchantRemark(jsonObject.getString("merchant_remark")); - newSubMerchantIdApply.setMerchant_name(cutLength(jsonObject.getString("merchant_name"),50)); - newSubMerchantIdApply.setAddress(cutLength(clientJson.getString("address"),128)); - newSubMerchantIdApply.setMerchant_shortname(cutLength(clientJson.getString("short_name"),64)); + newSubMerchantIdApply.setMerchant_name(cutLength(jsonObject.getString("merchant_name"), 50)); + newSubMerchantIdApply.setAddress(cutLength(clientJson.getString("address"), 128)); + newSubMerchantIdApply.setMerchant_shortname(cutLength(clientJson.getString("short_name"), 64)); newSubMerchantIdApply.setBusiness_category(clientJson.getString("industry")); - newSubMerchantIdApply.setWebsite(cutLength(clientJson.getString("company_website"),100)); - newSubMerchantIdApply.setOffice_phone(cutLength(clientJson.getString("company_phone"),20)); - newSubMerchantIdApply.setContact_phone(cutLength(clientJson.getString("contact_phone"),16)); - newSubMerchantIdApply.setContact_name(cutLength(clientJson.getString("contact_person"),32)); - newSubMerchantIdApply.setContact_email(cutLength(clientJson.getString("contact_email"),50)); - newSubMerchantIdApply.setMcc_code(cutLength(wechatMcc.getString("mc_code"),10)); - - if(!TextUtils.isEmpty(clientConfig.getString("client_pay_type"))){ - if(clientConfig.getString("client_pay_type").indexOf("1")>=0 - &&clientConfig.getString("client_pay_type").indexOf("2")>=0){ + newSubMerchantIdApply.setWebsite(cutLength(clientJson.getString("company_website"), 100)); + newSubMerchantIdApply.setOffice_phone(cutLength(clientJson.getString("company_phone"), 20)); + newSubMerchantIdApply.setContact_phone(cutLength(clientJson.getString("contact_phone"), 16)); + newSubMerchantIdApply.setContact_name(cutLength(clientJson.getString("contact_person"), 32)); + newSubMerchantIdApply.setContact_email(cutLength(clientJson.getString("contact_email"), 50)); + newSubMerchantIdApply.setMcc_code(cutLength(wechatMcc.getString("mc_code"), 10)); + + if (!TextUtils.isEmpty(clientConfig.getString("client_pay_type"))) { + if (clientConfig.getString("client_pay_type").indexOf("1") >= 0 + && clientConfig.getString("client_pay_type").indexOf("2") >= 0) { newSubMerchantIdApply.setBusiness_type("BOTH"); - }else if(clientConfig.getString("client_pay_type").indexOf("1")>=0){ + } else if (clientConfig.getString("client_pay_type").indexOf("1") >= 0) { newSubMerchantIdApply.setBusiness_type("ONLINE"); - } - else if(clientConfig.getString("client_pay_type").indexOf("2")>=0){ + } else if (clientConfig.getString("client_pay_type").indexOf("2") >= 0) { newSubMerchantIdApply.setBusiness_type("OFFLINE"); } - }else{ + } else { newSubMerchantIdApply.setBusiness_type("BOTH"); } if (!TextUtils.isEmpty(clientJson.getString("business_structure"))) { - newSubMerchantIdApply.setMerchant_type(clientJson.getString("business_structure").equals("Registered body(Sole Trader)")?"INDIVIDUAL":"ENTERPRISE") ; - }else{ - newSubMerchantIdApply.setMerchant_type("INDIVIDUAL") ; + newSubMerchantIdApply.setMerchant_type(clientJson.getString("business_structure").equals("Registered body(Sole Trader)") ? "INDIVIDUAL" : "ENTERPRISE"); + } else { + newSubMerchantIdApply.setMerchant_type("INDIVIDUAL"); } - newSubMerchantIdApply.setCompany_register_no(cutLength(TextUtils.isEmpty(clientJson.getString("acn"))?clientJson.getString("abn"):clientJson.getString("acn"),50)); + newSubMerchantIdApply.setCompany_register_no(cutLength(TextUtils.isEmpty(clientJson.getString("acn")) ? clientJson.getString("abn") : clientJson.getString("acn"), 50)); if (!TextUtils.isEmpty(clientJson.getString("certificat_expire_date"))) { newSubMerchantIdApply.setCertificat_expire_date(clientJson.getString("certificat_expire_date")); } else { @@ -638,34 +649,32 @@ public class TestController { } - if("ENTERPRISE".equalsIgnoreCase(newSubMerchantIdApply.getMerchant_type())&&TextUtils.isEmpty(newSubMerchantIdApply.getCompany_register_no())){ - logger.error("=======>公司注册号为空:clientid:"+clientJson.getInteger("client_id")+":"+clientJson.getString("client_moniker")); + if ("ENTERPRISE".equalsIgnoreCase(newSubMerchantIdApply.getMerchant_type()) && TextUtils.isEmpty(newSubMerchantIdApply.getCompany_register_no())) { + logger.error("=======>公司注册号为空:clientid:" + clientJson.getInteger("client_id") + ":" + clientJson.getString("client_moniker")); return; } - if("BOTH".equalsIgnoreCase(newSubMerchantIdApply.getBusiness_type())&&(TextUtils.isEmpty(newSubMerchantIdApply.getAddress())|| - TextUtils.isEmpty(newSubMerchantIdApply.getWebsite()))){ - logger.error("=======>公司类型为BOTH:网址或地址为空:clientid:"+clientJson.getInteger("client_id")+":"+clientJson.getString("client_moniker")); + if ("BOTH".equalsIgnoreCase(newSubMerchantIdApply.getBusiness_type()) && (TextUtils.isEmpty(newSubMerchantIdApply.getAddress()) || + TextUtils.isEmpty(newSubMerchantIdApply.getWebsite()))) { + logger.error("=======>公司类型为BOTH:网址或地址为空:clientid:" + clientJson.getInteger("client_id") + ":" + clientJson.getString("client_moniker")); return; - } - else if("OFFLINE".equalsIgnoreCase(newSubMerchantIdApply.getBusiness_type())&&(TextUtils.isEmpty(newSubMerchantIdApply.getAddress()))){ - logger.error("=======>公司类型为OFFLINE:地址为空:clientid:"+clientJson.getInteger("client_id")+":"+clientJson.getString("client_moniker")); + } else if ("OFFLINE".equalsIgnoreCase(newSubMerchantIdApply.getBusiness_type()) && (TextUtils.isEmpty(newSubMerchantIdApply.getAddress()))) { + logger.error("=======>公司类型为OFFLINE:地址为空:clientid:" + clientJson.getInteger("client_id") + ":" + clientJson.getString("client_moniker")); return; - } - else if("ONLINE".equalsIgnoreCase(newSubMerchantIdApply.getBusiness_type())&& - TextUtils.isEmpty(newSubMerchantIdApply.getWebsite())){ - logger.error("=======>公司类型为ONLINE:网址为空:clientid:"+clientJson.getInteger("client_id")+":"+clientJson.getString("client_moniker")); + } else if ("ONLINE".equalsIgnoreCase(newSubMerchantIdApply.getBusiness_type()) && + TextUtils.isEmpty(newSubMerchantIdApply.getWebsite())) { + logger.error("=======>公司类型为ONLINE:网址为空:clientid:" + clientJson.getInteger("client_id") + ":" + clientJson.getString("client_moniker")); return; } JSONObject params = newSubMerchantIdApply.insertObject(clientJson); params.put("merchant_app_id", jsonObject.getString("merchant_app_id")); SubMerchantInfoInheritance subMerchantInfo = JSON.toJavaObject(params, SubMerchantInfoInheritance.class); - params.put("operator","System"); + params.put("operator", "System"); WxPayMerchantRegister register = Optional.ofNullable(merchantChannelApplicationManager.getRegister(WxPayMerchantRegister.class)) .orElseThrow(() -> new ServerErrorException("No Register found for wechat")); - JSONObject manager=new JSONObject(); - manager.put("display_name","System"); + JSONObject manager = new JSONObject(); + manager.put("display_name", "System"); register.modifyForBatch(jsonObject.getString("merchant_app_id"), clientJson, subMerchantInfo, manager); try { Thread.sleep(500); @@ -677,6 +686,7 @@ public class TestController { } + /** * 批量更新微信子商户号 */ @@ -784,12 +794,12 @@ public class TestController { // // // } - public String cutLength(String str,int maxlen){ - if(TextUtils.isEmpty(str))return ""; - if(str.length()>maxlen){ - return str.substring(0,maxlen); - }else{ - return str; + public String cutLength(String str, int maxlen) { + if (TextUtils.isEmpty(str)) return ""; + if (str.length() > maxlen) { + return str.substring(0, maxlen); + } else { + return str; } } From 3e691e214f329b0435561ed979e3f5b281a855db Mon Sep 17 00:00:00 2001 From: dalong306 <304592994@qq.com> Date: Mon, 15 Nov 2021 18:22:59 +0800 Subject: [PATCH 06/28] =?UTF-8?q?Wechat=20HTML=E6=94=B9=E4=B8=BA=20In-APP?= =?UTF-8?q?=20H5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../analysis/core/impls/DashboardServiceImpl.java | 6 +++--- .../analysis/mappers/TransactionAnalysisMapper.xml | 10 +++++----- .../payment/manage/mappers/payment/OrderMapper.xml | 2 +- .../manage/mappers/payment/TransactionMapper.xml | 4 ++-- src/main/ui/static/analysis/channels_analysis.js | 2 +- src/main/ui/static/analysis/org-tranaction-analysis.js | 2 +- src/main/ui/static/analysis/partners-analysis.js | 2 +- .../analysis/transaction/analysis-transaction.js | 2 +- src/main/ui/static/boot/indexMainApp.js | 2 +- src/main/ui/static/boot/managerMainApp.js | 2 +- src/main/ui/static/boot/managerMainAppv2.js | 2 +- src/main/ui/static/dashboard/dashboard.js | 2 +- src/main/ui/static/dashboard/partner-dashboard.js | 6 +++--- .../payment/partner/templates/partner_pay_logs.html | 2 +- .../payment/tradelog/templates/partner_trade_logs.html | 2 +- .../static/payment/tradelog/templates/trade_logs.html | 2 +- 16 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java index c2dafa563..ebb485bf3 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java @@ -240,7 +240,7 @@ public class DashboardServiceImpl implements DashboardService, DashboardAnalysis @Override public List getTradeAnalysisInTime(JSONObject params) { - //"Online API", "QR Code", "Retail API", "Retail In-Store", "WeChat HTML5" + //"Online API", "QR Code", "Retail API", "Retail In-Store", "In-APP H5" List analysis = new ArrayList<>(); params.put("trade_type", "Online API"); List onlineApi_ordedrs = transactionAnalysisMapper.getOrdersByGateway(params); @@ -268,10 +268,10 @@ public class DashboardServiceImpl implements DashboardService, DashboardAnalysis if (!retailInStore_orders.isEmpty()) { analysis.add(retailInStore); } - params.put("trade_type", "WeChat HTML5"); + params.put("trade_type", "In-APP H5"); List wechatHtml5_orders = transactionAnalysisMapper.getOrdersByGateway(params); JSONObject wechatHtml5 = new JSONObject(); - wechatHtml5.put("name", "WeChat HTML5"); + wechatHtml5.put("name", "In-APP H5"); wechatHtml5.put("data", wechatHtml5_orders); analysis.add(wechatHtml5); return analysis; diff --git a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml index 87932a9c2..2d3a0aa89 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml @@ -245,7 +245,7 @@ WHEN 3 THEN 'Online API' WHEN 4 - THEN 'WeChat HTML5' + THEN 'In-APP H5' WHEN 5 THEN 'Retail API' WHEN 6 @@ -488,7 +488,7 @@ WHEN 3 THEN 'Online API' WHEN 4 - THEN 'WeChat HTML5' + THEN 'In-APP H5' WHEN 5 THEN 'Retail API' WHEN 6 @@ -557,7 +557,7 @@ and o.gateway=3 - + and o.gateway=4 @@ -627,7 +627,7 @@ - + @@ -659,7 +659,7 @@ and po.gateway=3 - + and po.gateway=4 diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml index e0f911fc8..2dc02ae76 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml @@ -78,7 +78,7 @@ WHEN 3 THEN 'Online API' WHEN 4 - THEN 'WeChat HTML5' + THEN 'In-APP H5' WHEN 5 THEN 'Retail API' WHEN 6 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 5d679c115..a3ad97ee1 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 @@ -48,7 +48,7 @@ WHEN 3 THEN 'Online API' WHEN 4 - THEN 'WeChat HTML5' + THEN 'In-APP H5' WHEN 5 THEN 'Retail API' WHEN 6 @@ -202,7 +202,7 @@ WHEN 3 THEN 'Online API' WHEN 4 - THEN 'WeChat HTML5' + THEN 'In-APP H5' WHEN 5 THEN 'Retail API' WHEN 6 diff --git a/src/main/ui/static/analysis/channels_analysis.js b/src/main/ui/static/analysis/channels_analysis.js index 3a14cdab3..a3b922519 100644 --- a/src/main/ui/static/analysis/channels_analysis.js +++ b/src/main/ui/static/analysis/channels_analysis.js @@ -139,7 +139,7 @@ define(['angular', 'static/commons/commons', 'static/commons/angular-ueditor', ' orient: 'vertical', y: '450px', left: 'right', - //data: ["Online API", "QR Code", "Retail API", "Retail In-Store", "WeChat HTML5"] + //data: ["Online API", "QR Code", "Retail API", "Retail In-Store", "In-APP H5"] data: legend } }, diff --git a/src/main/ui/static/analysis/org-tranaction-analysis.js b/src/main/ui/static/analysis/org-tranaction-analysis.js index e15d190dd..bbc2641bd 100644 --- a/src/main/ui/static/analysis/org-tranaction-analysis.js +++ b/src/main/ui/static/analysis/org-tranaction-analysis.js @@ -122,7 +122,7 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts','./org/analysis-o orient: 'vertical', y: '450px', left: 'right', - //data: ["Online API", "QR Code", "Retail API", "Retail In-Store", "WeChat HTML5"] + //data: ["Online API", "QR Code", "Retail API", "Retail In-Store", "In-APP H5"] data: legend } }, diff --git a/src/main/ui/static/analysis/partners-analysis.js b/src/main/ui/static/analysis/partners-analysis.js index 32a1fdadd..103632702 100644 --- a/src/main/ui/static/analysis/partners-analysis.js +++ b/src/main/ui/static/analysis/partners-analysis.js @@ -255,7 +255,7 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts','./transaction/an orient: 'vertical', y: '450px', left: 'right', - //data: ["Online API", "QR Code", "Retail API", "Retail In-Store", "WeChat HTML5"] + //data: ["Online API", "QR Code", "Retail API", "Retail In-Store", "In-APP H5"] data: legend } }, diff --git a/src/main/ui/static/analysis/transaction/analysis-transaction.js b/src/main/ui/static/analysis/transaction/analysis-transaction.js index c813a898d..90c1d74ac 100644 --- a/src/main/ui/static/analysis/transaction/analysis-transaction.js +++ b/src/main/ui/static/analysis/transaction/analysis-transaction.js @@ -310,7 +310,7 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts','echarts'], funct orient: 'vertical', y: '450px', left: 'right', - //data: ["Online API", "QR Code", "Retail API", "Retail In-Store", "WeChat HTML5"] + //data: ["Online API", "QR Code", "Retail API", "Retail In-Store", "In-APP H5"] data: legend } }, diff --git a/src/main/ui/static/boot/indexMainApp.js b/src/main/ui/static/boot/indexMainApp.js index 0b2d2c982..122700531 100644 --- a/src/main/ui/static/boot/indexMainApp.js +++ b/src/main/ui/static/boot/indexMainApp.js @@ -564,7 +564,7 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo case '3': return 'Online API'; case '4': - return 'WeChat HTML5'; + return 'In-APP H5'; case '5': return 'Retail API'; case '6': diff --git a/src/main/ui/static/boot/managerMainApp.js b/src/main/ui/static/boot/managerMainApp.js index 6d7bb0f81..6b540588d 100644 --- a/src/main/ui/static/boot/managerMainApp.js +++ b/src/main/ui/static/boot/managerMainApp.js @@ -447,7 +447,7 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo case '3': return '线上网关'; case '4': - return 'WeChat HTML5'; + return 'In-APP H5'; case '5': return '线下网关(C端付款码)'; case '6': diff --git a/src/main/ui/static/boot/managerMainAppv2.js b/src/main/ui/static/boot/managerMainAppv2.js index 6aab58f0c..7a2e4bf60 100644 --- a/src/main/ui/static/boot/managerMainAppv2.js +++ b/src/main/ui/static/boot/managerMainAppv2.js @@ -468,7 +468,7 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo case '3': return '线上网关'; case '4': - return 'WeChat HTML5'; + return 'In-APP H5'; case '5': return '线下网关(C端付款码)'; case '6': diff --git a/src/main/ui/static/dashboard/dashboard.js b/src/main/ui/static/dashboard/dashboard.js index 215b47411..c02f711a4 100644 --- a/src/main/ui/static/dashboard/dashboard.js +++ b/src/main/ui/static/dashboard/dashboard.js @@ -608,7 +608,7 @@ define(['angular', 'uiRouter', 'jstz', 'uiBootstrap', 'angularEcharts'], functio orient: 'vertical', y: '450px', left: 'right', - //data: ["Online API", "QR Code", "Retail API", "Retail In-Store", "WeChat HTML5"] + //data: ["Online API", "QR Code", "Retail API", "Retail In-Store", "In-APP H5"] data: legend } }, diff --git a/src/main/ui/static/dashboard/partner-dashboard.js b/src/main/ui/static/dashboard/partner-dashboard.js index e415d096f..2ae8b98dc 100644 --- a/src/main/ui/static/dashboard/partner-dashboard.js +++ b/src/main/ui/static/dashboard/partner-dashboard.js @@ -175,7 +175,7 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct legend: { data: ['Total Amount', 'Total Count', 'Retail In-Store Amount', 'Retail In-Store Count', 'Retail API Amount', 'Retail API Count', 'QR Code Amount', 'QR Code Count', - 'Online API Amount', 'Online API Count', 'WeChat HTML5 Amount', 'WeChat HTML5 Count'], + 'Online API Amount', 'Online API Count', 'In-APP H5 Amount', 'In-APP H5 Count'], bottom: 0, height: '15%', width: '80%', @@ -295,7 +295,7 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct }, { basic: { - name: 'WeChat HTML5 Amount', + name: 'In-APP H5 Amount', type: 'line', symbol: 'triangle', areaStyle: {normal: {}}, @@ -305,7 +305,7 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct }, { basic: { - name: 'WeChat HTML5 Count', + name: 'In-APP H5 Count', type: 'line', yAxisIndex: 1 }, diff --git a/src/main/ui/static/payment/partner/templates/partner_pay_logs.html b/src/main/ui/static/payment/partner/templates/partner_pay_logs.html index 8928a2b20..1ae92bef0 100644 --- a/src/main/ui/static/payment/partner/templates/partner_pay_logs.html +++ b/src/main/ui/static/payment/partner/templates/partner_pay_logs.html @@ -92,7 +92,7 @@ Online API | WeChat HTML5 | + ng-click="params.gateway=[4];loadTradeLogs(1)">In-APP H5 | Mobile H5 | Online API | WeChat HTML5 | + ng-click="params.gateway=[4];loadTradeLogs(1)">In-APP H5 | Mobile H5 | Online API | WeChat HTML5 | + ng-click="params.gateway=[4];loadTradeLogs(1)">In-APP H5 | Mobile H5 | Date: Tue, 16 Nov 2021 13:36:40 +0800 Subject: [PATCH 07/28] nginx update --- uidocker/conf.d/default.conf | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/uidocker/conf.d/default.conf b/uidocker/conf.d/default.conf index f5ee4fe3c..753e43a93 100644 --- a/uidocker/conf.d/default.conf +++ b/uidocker/conf.d/default.conf @@ -70,8 +70,23 @@ server { proxy_read_timeout 300s; } + location ~ ^/api/v1.0/org_gateway { + proxy_pass http://rpmanage; + + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_set_header Host $host; + proxy_set_header Real-IP $remote_addr; + + proxy_read_timeout 300s; + } + - location ~ ^/api/v1.0/((alipay\w*)|(customs)|(rpay)|(yeepay)|(card_payment_view)|(lakala_pay)|(cb_bankpay)|(bestpay)|(hf)|(\w*gateway)|(micropay)|(retail_qrcode)|(share_code)|(payment)|(h5_payment))/ { + location ~ ^/api/v1.0/((alipay\w*)|(customs)|(rpay)|(card_payment_view)|(\w*gateway)|(micropay)|(retail_qrcode)|(share_code)|(payment)|(h5_payment))/ { proxy_pass http://rppaycenter; proxy_http_version 1.1; From d21ce3ba9145407cd0f9104350d219d41b139af1 Mon Sep 17 00:00:00 2001 From: Yixian Date: Tue, 16 Nov 2021 13:36:54 +0800 Subject: [PATCH 08/28] nginx update --- uidocker/conf.d/default.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uidocker/conf.d/default.conf b/uidocker/conf.d/default.conf index 753e43a93..9a319671b 100644 --- a/uidocker/conf.d/default.conf +++ b/uidocker/conf.d/default.conf @@ -70,7 +70,7 @@ server { proxy_read_timeout 300s; } - location ~ ^/api/v1.0/org_gateway { + location ~ ^/api/v1.0/org_gateway { proxy_pass http://rpmanage; proxy_http_version 1.1; From 968c9b39c3a3b993f8c2e9499a06beb2678458ce Mon Sep 17 00:00:00 2001 From: dalong306 <304592994@qq.com> Date: Tue, 16 Nov 2021 13:46:24 +0800 Subject: [PATCH 09/28] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../manage/analysis/core/impls/DashboardServiceImpl.java | 7 +++---- .../royalpay/payment/manage/task/DashboardTaskManager.java | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 0ad19d395..2934cc261 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 2.3.88 + 2.3.88-SNAPSHOT UTF-8 2.4.0 diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java index ebb485bf3..688811793 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java @@ -591,10 +591,9 @@ public class DashboardServiceImpl implements DashboardService, DashboardAnalysis } params.put("channel", record.getString("channel")); int newCustomers = 0; - int oldCustomers = transactionAnalysisMapper.countOldCustomers(params); - if (client.getIntValue("client_id") == 0) { - newCustomers = record.getIntValue("customers") - oldCustomers; - } else { + int oldCustomers=0; + if (client.getIntValue("client_id") != 0) { + oldCustomers = transactionAnalysisMapper.countOldCustomers(params); newCustomers = transactionAnalysisMapper.countNewCustomers(params); } record.put("new_customers", newCustomers); diff --git a/src/main/java/au/com/royalpay/payment/manage/task/DashboardTaskManager.java b/src/main/java/au/com/royalpay/payment/manage/task/DashboardTaskManager.java index 9003942f1..a89e3e032 100644 --- a/src/main/java/au/com/royalpay/payment/manage/task/DashboardTaskManager.java +++ b/src/main/java/au/com/royalpay/payment/manage/task/DashboardTaskManager.java @@ -23,7 +23,7 @@ public class DashboardTaskManager { @Resource private SynchronizedScheduler synchronizedScheduler; - @Scheduled(cron = "0 0 2 * * ?") + @Scheduled(cron = "0 30 1 * * ?") public void analysisDashboard() { synchronizedScheduler.executeProcess("manage_task:dashboardTask", 120_000, () -> dashboardService.generateCustomersAndOrdersStatistics(DateUtils.addDays(new Date(), -1))); From 77e24633175adba84ca067fd3514f2e4589c8f10 Mon Sep 17 00:00:00 2001 From: dalong306 <304592994@qq.com> Date: Tue, 16 Nov 2021 15:14:52 +0800 Subject: [PATCH 10/28] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2934cc261..0ad19d395 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 2.3.88-SNAPSHOT + 2.3.88 UTF-8 2.4.0 From fef5801a2cd8267cf79ae1b7b0d9f5d853ac99a0 Mon Sep 17 00:00:00 2001 From: Yixian Date: Wed, 17 Nov 2021 12:11:53 +0800 Subject: [PATCH 11/28] list settlement log only query log_clear_detail --- .../mappers/payment/TransactionMapper.java | 2 ++ .../mappers/payment/TransactionMapper.xml | 35 +++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java index 4278ea9bc..711f7fc44 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java @@ -60,6 +60,8 @@ public interface TransactionMapper { PageList listSettlementLog(JSONObject params, PageBounds pagination); + PageList listSettlementLogOrigin(JSONObject params, PageBounds pagination); + PageList listSettlementLogForDashbord(JSONObject params, PageBounds pagination); @CountRef(".countSettlementLogInClients") 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 a3ad97ee1..946df2cc5 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 @@ -559,6 +559,41 @@ + + + - AND t.client_id IN + AND cd.client_id IN #{client_id} @@ -698,14 +700,15 @@ and (c.client_id=#{client_id} or c.parent_client_id=#{client_id}) - and t.transaction_time >= #{from} - and t.transaction_time < #{to} + and cd.report_date >= #{from} + and cd.report_date < #{to} and c.org_id = #{org_id} and c.org_id in #{org_id} - GROUP BY DATE(t.transaction_time) - order by t.clearing_time desc + GROUP BY cd.report_date + order by cd.clearing_id desc + - INNER JOIN (select system_transaction_id,clearing_amount,client_id - from pmt_transactions - where channel='Settlement' - and transaction_time >= #{from} - and transaction_time < #{to} - ) t ON t.client_id = c.client_id + INNER JOIN log_clearing_detail cd on c.client_id=cd.client_id + and cd.report_date >= #{from} + and cd.report_date < #{to} and c.client_moniker=#{client_moniker} and c.org_id = #{org_id} @@ -735,8 +732,9 @@ select cd.client_id, cd.report_date clearing_time, cd.report_date, + lc.editable, lc.balance_group, SUM(cd.tax_amount) as tax_amount, SUM(cd.total_charge) as total_charge, @@ -569,6 +570,7 @@ cd.tax_amount, cd.total_charge, + cd.clear_detail_id, sum(cd.gross_amount) total, sum(cd.clearing_amount) income, @@ -578,6 +580,8 @@ AND r.active_time <= cd.report_date) rate from log_clearing_detail cd inner join sys_clients sc on sc.client_id=cd.client_id + inner join log_clearing lc on lc.clearing_id=cd.clearing_id + AND cd.client_id IN @@ -592,6 +596,7 @@ GROUP BY report_date GROUP BY clear_detail_id order by clearing_id desc + From 28b6004baf37219c62e0173ef519675b90b7e631 Mon Sep 17 00:00:00 2001 From: Yixian Date: Fri, 19 Nov 2021 09:49:20 +0800 Subject: [PATCH 19/28] fix sql error --- .../payment/manage/mappers/payment/TransactionMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 cede896cc..167b9a9f1 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 @@ -595,7 +595,7 @@ and cd.report_date < #{to} GROUP BY cd.report_date GROUP BY cd.clear_detail_id - order by c.clearing_id desc + order by lc.clearing_id desc From 299489886b2e767b86606773fe2054530e5893cb Mon Sep 17 00:00:00 2001 From: Yixian Date: Fri, 19 Nov 2021 10:56:28 +0800 Subject: [PATCH 20/28] fix sql error --- .../payment/manage/mappers/payment/TransactionMapper.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 167b9a9f1..02ac6e24a 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 @@ -6,7 +6,8 @@ INNER JOIN ( select d.clear_detail_id,count(p.task_id) pre_settle_flag from log_clearing_detail d left join log_presettle_task p on p.clear_detail_id = d.clear_detail_id - where d.clearing_id=#{clearing_id}) dd + where d.clearing_id=#{clearing_id} + group by d.clear_detail_id) dd ON dd.clear_detail_id = t.clearing_order SET clearing_status = if(pre_settle_flag > 0, 4, 0), clearing_order = NULL, From d507de3ea2f14ad858a536cca689170e6a21951e Mon Sep 17 00:00:00 2001 From: Yixian Date: Mon, 22 Nov 2021 19:12:41 +0800 Subject: [PATCH 21/28] parent version update --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 0ad19d395..f753f2a42 100644 --- a/pom.xml +++ b/pom.xml @@ -5,11 +5,11 @@ au.com.royalpay.payment payment-parent - 2.2.31 + 2.2.32 4.0.0 manage - 2.3.88 + 2.3.89 UTF-8 2.4.0 From c2c7026a345a26d4dff69c0848bb794569ad1dd6 Mon Sep 17 00:00:00 2001 From: Yixian Date: Mon, 22 Nov 2021 20:59:00 +0800 Subject: [PATCH 22/28] hotfix: skip customer count of out/analysis --- .../manage/dataAnalysis/core/DataAnalysisServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/dataAnalysis/core/DataAnalysisServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dataAnalysis/core/DataAnalysisServiceImpl.java index 23cc25d9c..27c0c2c20 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dataAnalysis/core/DataAnalysisServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/dataAnalysis/core/DataAnalysisServiceImpl.java @@ -58,9 +58,9 @@ public class DataAnalysisServiceImpl implements DataAnalysisService { response.put("max_order", 0); } //总消费人数 - response.put("total_customers", transactionAnalysisMapper.countCustomers(params)); + response.put("total_customers", 0); //老客户人数 - response.put("old_customers", transactionAnalysisMapper.countOldCustomers(params)); + response.put("old_customers", 0); return response; } From 87e70a5fb4283eabc3dceb592aafab2a6bb6972a Mon Sep 17 00:00:00 2001 From: Todking Date: Tue, 23 Nov 2021 14:57:44 +0800 Subject: [PATCH 23/28] add Merchant Category Code --- .../merchants/beans/ClientRegisterInfo.java | 10 + src/main/ui/static/commons/commons.js | 1 + .../ui/static/commons/services/upayMcc.js | 1285 +++++++++++++++++ .../ui/static/payment/partner/add-partner.js | 8 +- .../static/payment/partner/partner-manage.js | 4 +- .../partner/templates/add_partner.html | 18 + .../partner/templates/partner_detail.html | 14 + .../partner/templates/partner_edit.html | 18 + 8 files changed, 1354 insertions(+), 4 deletions(-) create mode 100644 src/main/ui/static/commons/services/upayMcc.js diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientRegisterInfo.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientRegisterInfo.java index a2db2971f..9ae5a416d 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientRegisterInfo.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientRegisterInfo.java @@ -123,6 +123,8 @@ public class ClientRegisterInfo { private String averageCardTransaction; @JSONField(name = "mw_industry") private String mwIndustry; + @JSONField(name = "mc_industry") + private String mcIndustry; @JSONField(name = "enable_international_card") private boolean enableInternaltionCard; @JSONField(name = "enable_cross_payment") @@ -611,6 +613,10 @@ public class ClientRegisterInfo { return mwIndustry; } + public String getMcIndustry() { + return mcIndustry; + } + public void setAverageCardTransaction(String averageCardTransaction) { this.averageCardTransaction = averageCardTransaction; } @@ -627,6 +633,10 @@ public class ClientRegisterInfo { this.mwIndustry = mwIndustry; } + public void setMcIndustry(String mcIndustry) { + this.mcIndustry = mcIndustry; + } + public boolean isEnableCardPayment() { return enableCardPayment; } diff --git a/src/main/ui/static/commons/commons.js b/src/main/ui/static/commons/commons.js index fa5c8bdee..cd7f3f82b 100644 --- a/src/main/ui/static/commons/commons.js +++ b/src/main/ui/static/commons/commons.js @@ -15,6 +15,7 @@ define(['./app', './services/stateMap', './services/industryMap', './services/upayIndustryMap', + './services/upayMcc', './services/wechatGoodMcc', './services/sectorMap', './services/countryMap', diff --git a/src/main/ui/static/commons/services/upayMcc.js b/src/main/ui/static/commons/services/upayMcc.js new file mode 100644 index 000000000..de899bfb8 --- /dev/null +++ b/src/main/ui/static/commons/services/upayMcc.js @@ -0,0 +1,1285 @@ +define(['../app'], function (app) { + 'use strict'; + + var upayCode = [ + { + "label": "Veterinary Services", + "value": "0742" + }, + { + "label": "Agricultural Cooperatives", + "value": "0763" + }, + { + "label": "Landscaping and Horticultural Services", + "value": "0780" + }, + { + "label": "General Contractor/Residential Building", + "value": "1520" + }, + { + "label": "Heating, Plumbing, Air Conditioning Contractors", + "value": "1711" + }, + { + "label": "Electrical Contractors", + "value": "1731" + }, + { + "label": "Masonry, Stonework, Tile Setting, Plastering, Insulation Contractors", + "value": "1740" + }, + { + "label": "Carpentry", + "value": "1750" + }, + { + "label": "Roof, Siding, and Sheet Metal Work Contractors", + "value": "1761" + }, + { + "label": "Contractors, Concrete", + "value": "1771" + }, + { + "label": "Special Trade Contractor - Not Elsewhere Classified", + "value": "1799" + }, + { + "label": "Miscellaneous Publishing and Printing Services", + "value": "2741" + }, + { + "label": "Typesetting, Plate Making and Related Services (Business to Business MCC)", + "value": "2791" + }, + { + "label": "Specialty Cleaning, Polishing and Sanitation Preparations (Business to Business MCC)", + "value": "2842" + }, + { + "label": "Railroads", + "value": "4011" + }, + { + "label": "Local and Suburban Commuter Passenger Transportation, including Ferries", + "value": "4111" + }, + { + "label": "Passenger Rail (train)", + "value": "4112" + }, + { + "label": "Ambulance Services", + "value": "4119" + }, + { + "label": "Taxicabs and Limousines", + "value": "4121" + }, + { + "label": "Bus Lines, includes Charters/Tour Buses", + "value": "4131" + }, + { + "label": "Motor Freight Carriers and Trucking-Local and Long Distance, Moving & Storage Companies, and Local Delivery", + "value": "4214" + }, + { + "label": "Courier Services-Air and Ground, and Freight Forwarders", + "value": "4215" + }, + { + "label": "Public Warehousing-Farm products, Refrigerated Goods, Household Goods, and Storage", + "value": "4225" + }, + { + "label": "Steamship and Cruise Lines", + "value": "4411" + }, + { + "label": "Boat Rentals and Leasing", + "value": "4457" + }, + { + "label": "Marinas, Marine Service, and Supplies", + "value": "4468" + }, + { + "label": "Airlines and Air Carriers", + "value": "4511" + }, + { + "label": "Airports, Flying Fields, and Airport Terminals", + "value": "4582" + }, + { + "label": "Travel Agencies", + "value": "4722" + }, + { + "label": "Package Tour Operators (Germany Only)", + "value": "4723" + }, + { + "label": "Telemarketing of Travel Related Services and Vitamins", + "value": "4761" + }, + { + "label": "Bridge and Road Fees, Tolls", + "value": "4784" + }, + { + "label": "Transportation Services-not elsewhere classified", + "value": "4789" + }, + { + "label": "Telecommunication Equipment and Telephone Sales", + "value": "4812" + }, + { + "label": "Special Telecom Merchant", + "value": "4813" + }, + { + "label": "Telecommunication Services, Including Local and Long Distance Calls, Credit Card Calls, Call Through Use of Magnetic-Strip-Reading Telephones, and Fax Services", + "value": "4814" + }, + { + "label": "Monthly Summary Telephone Charges", + "value": "4815" + }, + { + "label": "Computer Network/Information Services and other Online Services such as electronic bulletin board, e-mail, web site hosting services, or Internet access", + "value": "4816" + }, + { + "label": "Telegraph Services", + "value": "4821" + }, + { + "label": "Quasi Cash - Money Transfer", + "value": "4829" + }, + { + "label": "Cable, Satellite, and Other Pay Television and Radio Services", + "value": "4899" + }, + { + "label": "Utilities-Electric, Gas, Water, and Sanitary", + "value": "4900" + }, + { + "label": "Motor Vehicle Supplies and New Parts (Business to Business MCC)", + "value": "5013" + }, + { + "label": "Office Furniture (Business to Business MCC)", + "value": "5021" + }, + { + "label": "Construction Materials Not Elsewhere Classified (Business to Business MCC)", + "value": "5039" + }, + { + "label": "Photographic, Photocopy, Microfilm Equipment and Supplies (Business to Business MCC)", + "value": "5044" + }, + { + "label": "Computers, Computer Peripheral Equipment, and Software", + "value": "5045" + }, + { + "label": "Commercial Equipment Not Elsewhere Classified (Business to Business MCC)", + "value": "5046" + }, + { + "label": "Dental/Laboratory/Medical/Ophthalmic Hospital Equipment and Supplies", + "value": "5047" + }, + { + "label": "Metal Service Centers and Offices (Business to Business MCC)", + "value": "5051" + }, + { + "label": "Electrical Parts and Equipment (Business to Business MCC)", + "value": "5065" + }, + { + "label": "Hardware, Plumbing, Heat Equipment and Supplies (Business to Business MCC)", + "value": "5072" + }, + { + "label": "Plumbing and Heating Equipment and Supplies (Business to Business MCC)", + "value": "5074" + }, + { + "label": "Industrial Supplies Not Elsewhere Classified (Business to Business MCC)", + "value": "5085" + }, + { + "label": "Precious Stones, Metals, Watches and Jewelry (Business to Business MCC)", + "value": "5094" + }, + { + "label": "Durable Goods Not Elsewhere Classified (Business to Business MCC)", + "value": "5099" + }, + { + "label": "Stationery, Office Supplies, and Printing and Writing Paper", + "value": "5111" + }, + { + "label": "Drugs, Drug Proprietary's, and Druggists' Sundries", + "value": "5122" + }, + { + "label": "Piece Goods, Notions and Other Dry Goods (Business to Business MCC)", + "value": "5131" + }, + { + "label": "Men's, Women's and Children's Uniforms (Business to Business MCC)", + "value": "5137" + }, + { + "label": "Commercial Footwear (Business to Business MCC)", + "value": "5139" + }, + { + "label": "Chemicals and Allied Products Not Elsewhere Classified (Business to Business MCC)", + "value": "5169" + }, + { + "label": "Petroleum and Products (Business to Business MCC)", + "value": "5172" + }, + { + "label": "Books, Periodicals and Newspapers (Business to Business MCC)", + "value": "5192" + }, + { + "label": "Florist Suppliers, Nursery Stock & Flowers (Business to Business MCC)", + "value": "5193" + }, + { + "label": "Paints, Varnishes and Supplies (Business to Business MCC)", + "value": "5198" + }, + { + "label": "Non-durable Goods Not Elsewhere Classified (Business to Business MCC)", + "value": "5199" + }, + { + "label": "Home Supply Warehouse", + "value": "5200" + }, + { + "label": "Lumber & Building Materials Stores", + "value": "5211" + }, + { + "label": "Glass, Paint, and Wallpaper Stores", + "value": "5231" + }, + { + "label": "Hardware Stores, Equipment Utilities Regulated", + "value": "5251" + }, + { + "label": "Nurseries and Lawn and Garden Supply Stores", + "value": "5261" + }, + { + "label": "Mobile Home Dealer", + "value": "5271" + }, + { + "label": "Wholesale Club with or without membership fee", + "value": "5300" + }, + { + "label": "Duty Free Stores", + "value": "5309" + }, + { + "label": "Discount Store", + "value": "5310" + }, + { + "label": "Department Stores", + "value": "5311" + }, + { + "label": "Variety Stores", + "value": "5331" + }, + { + "label": "Miscellaneous General Merchandise", + "value": "5399" + }, + { + "label": "Grocery Stores and Supermarkets", + "value": "5411" + }, + { + "label": "Freezer & Locker Meat Provisions", + "value": "5422" + }, + { + "label": "Candy, Nut, and Confectionary Stores", + "value": "5441" + }, + { + "label": "Dairy Product Stores", + "value": "5451" + }, + { + "label": "Bakeries", + "value": "5462" + }, + { + "label": "Miscellaneous Food Stores-Convenience Stores and Specialty Markets", + "value": "5499" + }, + { + "label": "Car and Truck Dealers (New and Used)- Sales, Service, Repairs, Parts, and Leasing", + "value": "5511" + }, + { + "label": "Car and Truck Dealers (Used)- Sales, Service, Repairs, Parts, and Leasing", + "value": "5521" + }, + { + "label": "Automotive Tire Stores", + "value": "5532" + }, + { + "label": "Auto and Home Supply Stores", + "value": "5531" + }, + { + "label": "Automotive Parts and Accessories Stores", + "value": "5533" + }, + { + "label": "Service Stations (with or without Ancillary Services)", + "value": "5541" + }, + { + "label": "Automated Fuel Dispensers", + "value": "5542" + }, + { + "label": "Boat Dealers", + "value": "5551" + }, + { + "label": "Camper, Recreational and Utility Trailer Dealers", + "value": "5561" + }, + { + "label": "Motorcycle Dealers", + "value": "5571" + }, + { + "label": "Motor Home Dealers", + "value": "5592" + }, + { + "label": "Snowmobile Dealers", + "value": "5598" + }, + { + "label": "Miscellaneous Automotive, Aircraft, and Farm Equipment Dealers --Not Elsewhere Classified", + "value": "5599" + }, + { + "label": "Men's & Boys' Clothing and Accessory Stores", + "value": "5611" + }, + { + "label": "Women's Ready-to-Wear Stores", + "value": "5621" + }, + { + "label": "Women's Accessory and Specialty Stores", + "value": "5631" + }, + { + "label": "Children's and Infants' Wear Stores", + "value": "5641" + }, + { + "label": "Family Clothing Stores", + "value": "5651" + }, + { + "label": "Sports and Riding Apparel Stores", + "value": "5655" + }, + { + "label": "Shoe Stores", + "value": "5661" + }, + { + "label": "Furriers & Fur Shops", + "value": "5681" + }, + { + "label": "Men's and Women's Clothing Stores", + "value": "5691" + }, + { + "label": "Tailors, Seamstresses, Mending, Alterations", + "value": "5697" + }, + { + "label": "Wig & Toupee Shops", + "value": "5698" + }, + { + "label": "Miscellaneous Apparel and Accessory Stores", + "value": "5699" + }, + { + "label": "Furniture, Home Furnishings, and Equipment Stores, except Appliances", + "value": "5712" + }, + { + "label": "Floor coverings, Rugs", + "value": "5713" + }, + { + "label": "Drapery, Window Covering, and Upholstery Stores", + "value": "5714" + }, + { + "label": "Fireplaces, Fireplace Screens and Accessories Stores", + "value": "5718" + }, + { + "label": "Miscellaneous Home Furnishing Specialty Stores", + "value": "5719" + }, + { + "label": "Household Appliance Stores", + "value": "5722" + }, + { + "label": "Electronics Stores", + "value": "5732" + }, + { + "label": "Music Stores-Musical Instruments, Pianos, and Sheet Music", + "value": "5733" + }, + { + "label": "Computer Software Stores", + "value": "5734" + }, + { + "label": "Record Stores", + "value": "5735" + }, + { + "label": "Caterers - Prepare & Delivery", + "value": "5811" + }, + { + "label": "Eating Places and Restaurants", + "value": "5812" + }, + { + "label": "Drinking Places (Alcoholic Beverages) - Bars, Taverns, Nightclubs, Cocktail Lounges, and Discotheques", + "value": "5813" + }, + { + "label": "Quick Payment Service-Fast Food Restaurants", + "value": "5814" + }, + { + "label": "Digital Goods – Media, Books, Movies, Music ", + "value": "5815" + }, + { + "label": "Digital Goods – Games ", + "value": "5816" + }, + { + "label": "Digital Goods – Applications (Excludes Games) ", + "value": "5817" + }, + { + "label": "Large Digital Goods Merchant ", + "value": "5818" + }, + { + "label": "Drug Stores and Pharmacies", + "value": "5912" + }, + { + "label": "Package Stores--Beer, Wine, and Liquor", + "value": "5921" + }, + { + "label": "Used Merchandise and Secondhand Stores", + "value": "5931" + }, + { + "label": "Antique Shop", + "value": "5932" + }, + { + "label": "Pawn Shop", + "value": "5933" + }, + { + "label": "Wrecking and Salvage Yards", + "value": "5935" + }, + { + "label": "Antique Reproduction Stores", + "value": "5937" + }, + { + "label": "Bicycle Shop-Sales and Services", + "value": "5940" + }, + { + "label": "Sporting Goods Stores", + "value": "5941" + }, + { + "label": "Book Stores", + "value": "5942" + }, + { + "label": "Stationery, Office and School Supply Stores", + "value": "5943" + }, + { + "label": "Jewelry, Watch, Clock, and Silverware Stores", + "value": "5944" + }, + { + "label": "Hobby, Toy and Game Stores", + "value": "5945" + }, + { + "label": "Camera and Photographic Supply Stores", + "value": "5946" + }, + { + "label": "Gift, Card, Novelty, and Souvenir Stores", + "value": "5947" + }, + { + "label": "Luggage and Leather Goods Stores", + "value": "5948" + }, + { + "label": "Sewing, Needlework, Fabric, and Piece Good Stores", + "value": "5949" + }, + { + "label": "Glassware and Crystal Stores", + "value": "5950" + }, + { + "label": "Direct Marketing Insurance Services", + "value": "5960" + }, + { + "label": "Mail Order", + "value": "5961" + }, + { + "label": "Direct Marketing -- Travel Related Arrangement Services", + "value": "5962" + }, + { + "label": "Direct Selling Establishments/Door to Door Sales", + "value": "5963" + }, + { + "label": "Catalog Merchant", + "value": "5964" + }, + { + "label": "Combined Catalog and Retail Merchant", + "value": "5965" + }, + { + "label": "Outbound Telemarketing Merchant", + "value": "5966" + }, + { + "label": "Direct Marketing -- Inbound Telemarketing Merchants", + "value": "5967" + }, + { + "label": "Continuity/Subscription Merchants", + "value": "5968" + }, + { + "label": "Direct Marketing/Direct Marketers--Not Elsewhere Classified", + "value": "5969" + }, + { + "label": "Artist Supply and Craft Stores", + "value": "5970" + }, + { + "label": "Art Dealers and Galleries", + "value": "5971" + }, + { + "label": "Stamp and Coin Stores", + "value": "5972" + }, + { + "label": "Religious Goods Stores", + "value": "5973" + }, + { + "label": "Hearing Aids--Sales, Service, and Supplies", + "value": "5975" + }, + { + "label": "Orthopedic Goods and Prosthetic Devices", + "value": "5976" + }, + { + "label": "Cosmetic Stores", + "value": "5977" + }, + { + "label": "Typewriter Stores--Sales, Service, and Rentals", + "value": "5978" + }, + { + "label": "Fuel Dealers--Fuel Oil, Wood, Coal, and Liquefied Petroleum", + "value": "5983" + }, + { + "label": "Florists", + "value": "5992" + }, + { + "label": "Cigar Stores & Stands", + "value": "5993" + }, + { + "label": "News Dealers & Newsstands", + "value": "5994" + }, + { + "label": "Pet Shops, Pet Food, and Supplies", + "value": "5995" + }, + { + "label": "Swimming Pools--Sales, Supplies, and Services", + "value": "5996" + }, + { + "label": "Electric Razor Stores Sales & Services", + "value": "5997" + }, + { + "label": "Tent and Awning Stores", + "value": "5998" + }, + { + "label": "Miscellaneous & Specialty Retail Stores", + "value": "5999" + }, + { + "label": "Financial Institutions--Manual Cash Disbursements", + "value": "6010" + }, + { + "label": "Financial Institutions--Automated Cash Disbursements", + "value": "6011" + }, + { + "label": "Quasi Cash - Financial Institution - Merchandise and Services", + "value": "6012" + }, + { + "label": "Quasi Cash - Member Financial Institution", + "value": "6050" + }, + { + "label": "MasterCard - Quasi Cash-Merchant", + "value": "6051" + }, + { + "label": "Visa - Non-Financial Institutions - Foreign Currency, Money Orders(not wire Transfer), & Travelers Cheques", + "value": "" + }, + { + "label": "Securities - Brokers and Dealers", + "value": "6211" + }, + { + "label": "Insurance Sales and Underwriting", + "value": "6300" + }, + { + "label": "Insurance - Premiums", + "value": "6381" + }, + { + "label": "Insurance - Not Elsewhere Classified", + "value": "6399" + }, + { + "label": "Real Estate Agents and Managers - Rentals; Property Management", + "value": "6513" + }, + { + "label": "Remote Stored Value Load - Member Financial Institution", + "value": "6529" + }, + { + "label": "Remote Stored Value Load - Merchant", + "value": "6530" + }, + { + "label": "Payment Service Provider", + "value": "6531" + }, + { + "label": "Payment Transaction - Member", + "value": "6532" + }, + { + "label": "Payment Transaction - Merchant", + "value": "6533" + }, + { + "label": "Money Transfer - Member Financial Institution", + "value": "6534" + }, + { + "label": "Value Purchase - Member Financial Institution", + "value": "6535" + }, + { + "label": "MoneySend Intracountry", + "value": "6536" + }, + { + "label": "MoneySend Intercountry", + "value": "6537" + }, + { + "label": "MoneySend Funding ", + "value": "6538" + }, + { + "label": "POI Funding Transactions (Excluding MoneySend)", + "value": "6540" + }, + { + "label": "Lodging - Hotels, Motels, and Resorts", + "value": "7011" + }, + { + "label": "Timeshares", + "value": "7012" + }, + { + "label": "Sporting and Recreational Camps", + "value": "7032" + }, + { + "label": "Trailer Parks and Campgrounds", + "value": "7033" + }, + { + "label": "Laundry, Cleaning, and Garment Services", + "value": "7210" + }, + { + "label": "Laundry Services - Family and Commercial", + "value": "7211" + }, + { + "label": "Dry Cleaners", + "value": "7216" + }, + { + "label": "Carpet and Upholstery Cleaning", + "value": "7217" + }, + { + "label": "Photographic Studios", + "value": "7221" + }, + { + "label": "Beauty and Barber Shops", + "value": "7230" + }, + { + "label": "Shoe Repair Shops, Shoe Shine Parlors, and Hat Cleaning Shops", + "value": "7251" + }, + { + "label": "Funeral Services and Crematories", + "value": "7261" + }, + { + "label": "Dating Services", + "value": "7273" + }, + { + "label": "Tax Preparation Services", + "value": "7276" + }, + { + "label": "Counseling Services - Debt, Marriage, and Personal", + "value": "7277" + }, + { + "label": "Buying and Shopping Services and Clubs", + "value": "7278" + }, + { + "label": "Clothing Rental - Costumes, Uniforms and Formal Wear", + "value": "7296" + }, + { + "label": "Massage Parlors", + "value": "7297" + }, + { + "label": "Health and Beauty Spas", + "value": "7298" + }, + { + "label": "Miscellaneous Personal Services - Not Elsewhere Classified", + "value": "7299" + }, + { + "label": "Advertising Services", + "value": "7311" + }, + { + "label": "Consumer Credit Reporting Agencies", + "value": "7321" + }, + { + "label": "Blueprinting and Photocopying Services", + "value": "7332" + }, + { + "label": "Commercial Photography, Art, and Graphics", + "value": "7333" + }, + { + "label": "Quick Copy, Reproduction Service", + "value": "7338" + }, + { + "label": "Stenographic Service", + "value": "7339" + }, + { + "label": "Exterminating and Disinfecting Services", + "value": "7342" + }, + { + "label": "Cleaning, Maintenance & Janitorial Services", + "value": "7349" + }, + { + "label": "Employment Agencies and Temporary Help Services", + "value": "7361" + }, + { + "label": "Computer Programming, Data Processing, and Integrated Systems Design Services", + "value": "7372" + }, + { + "label": "Information Retrieval Services (Business to Business MCC)", + "value": "7375" + }, + { + "label": "Computer Maintenance, Repair and Services (Business to Business MCC)", + "value": "7379" + }, + { + "label": "Management, Consulting, and Public Relations Services", + "value": "7392" + }, + { + "label": "Detective Agencies, Protective Agencies, and Security Services, including Armored Cars and Guard Dogs", + "value": "7393" + }, + { + "label": "Equipment, Tool, Furniture, and Appliance Rental and Leasing", + "value": "7394" + }, + { + "label": "Photofinishing Laboratories and Photo Developing", + "value": "7395" + }, + { + "label": "Business Services", + "value": "7399" + }, + { + "label": "Truck Stops", + "value": "7511" + }, + { + "label": "Automobile Rental Agency", + "value": "7512" + }, + { + "label": "Truck and Utility Trailer Rentals", + "value": "7513" + }, + { + "label": "Motor Home and Recreational Vehicle Rentals", + "value": "7519" + }, + { + "label": "Parking Lots and Garages", + "value": "7523" + }, + { + "label": "Express Payment Service Mechants - Parking Lots and Garages", + "value": "7524" + }, + { + "label": "Automotive Top & Body Shops", + "value": "7531" + }, + { + "label": "Tire Retreading & Repair", + "value": "7534" + }, + { + "label": "Automotive Paint Shops", + "value": "7535" + }, + { + "label": "Automotive Service Shops (Non-Dealer)", + "value": "7538" + }, + { + "label": "Car Washes", + "value": "7542" + }, + { + "label": "Towing Services", + "value": "7549" + }, + { + "label": "Electronic Repair Shops", + "value": "7622" + }, + { + "label": "Air Conditioning and Refrigeration Repair Shops", + "value": "7623" + }, + { + "label": "Electrical and Small Appliance Repair Shops", + "value": "7629" + }, + { + "label": "Watch, Clock, and Jewelry Repair Shops", + "value": "7631" + }, + { + "label": "Furniture - Reupholster, Repair, and Refinishing", + "value": "7641" + }, + { + "label": "Welding Services", + "value": "7692" + }, + { + "label": "Miscellaneous Repair Shops and Related Services", + "value": "7699" + }, + { + "label": "Citishare Cash Advance", + "value": "7778" + }, + { + "label": "Government-Owned Lotteries ", + "value": "7800" + }, + { + "label": "Government-Licensed Casinos (Online Gambling) ", + "value": "7801" + }, + { + "label": "Government-Licensed Horse/Dog Racing ", + "value": "7802" + }, + { + "label": "Motion Picture & Video Tape Production and Distribution (Business to Business MCC)", + "value": "7829" + }, + { + "label": "Motion Picture Theater", + "value": "7832" + }, + { + "label": "DVD/Video Tape Rental Stores", + "value": "7841" + }, + { + "label": "Dance Halls, Studios & Schools", + "value": "7911" + }, + { + "label": "Theatrical Producers (except Motion Pictures) and Ticket Agencies", + "value": "7922" + }, + { + "label": "Bands, Orchestras & Misc Entertainment", + "value": "7929" + }, + { + "label": "Billiards & Pool Establishments", + "value": "7932" + }, + { + "label": "Bowling Alleys", + "value": "7933" + }, + { + "label": "Commercial Sports, Professional Sports Clubs, Athletic Fields, and Sports Promoters", + "value": "7941" + }, + { + "label": "Tourist Attractions and Exhibits", + "value": "7991" + }, + { + "label": "Public Golf Courses", + "value": "7992" + }, + { + "label": "Video Amusement Game Supply", + "value": "7993" + }, + { + "label": "Video Game Arcades and Establishments", + "value": "7994" + }, + { + "label": "Betting, including Lottery Tickets, Casino Gaming Chips, Off- Track Betting, and Wagers at Race Track", + "value": "7995" + }, + { + "label": "Amusement Parks, Circuses, Carnivals, and Fortune Tellers", + "value": "7996" + }, + { + "label": "Membership Clubs (Sports, Recreation, Athletic), Country Clubs, and Private Golf Courses", + "value": "7997" + }, + { + "label": "Aquarium, Seaquarium, Dolphinariums", + "value": "7998" + }, + { + "label": "Recreation Services - Not Elsewhere Classified", + "value": "7999" + }, + { + "label": "Doctors and Physicians - Not Elsewhere Classified", + "value": "8011" + }, + { + "label": "Dentists and Orthodontists", + "value": "8021" + }, + { + "label": "Osteopathic Physicians", + "value": "8031" + }, + { + "label": "Chiropractors", + "value": "8041" + }, + { + "label": "Optometrists and Ophthalmologists", + "value": "8042" + }, + { + "label": "Opticians, Optical Goods and Eyeglasses", + "value": "8043" + }, + { + "label": "Podiatrists and Chiropodists", + "value": "8049" + }, + { + "label": "Nursing and Personal Care Facilities", + "value": "8050" + }, + { + "label": "Hospitals", + "value": "8062" + }, + { + "label": "Medical and Dental Laboratories", + "value": "8071" + }, + { + "label": "Medical Services Health Practitioners - No Elsewhere Classified", + "value": "8099" + }, + { + "label": "Legal Services and Attorneys", + "value": "8111" + }, + { + "label": "Elementary and Secondary Schools", + "value": "8211" + }, + { + "label": "Colleges, Universities, Professional Schools, and Junior Colleges", + "value": "8220" + }, + { + "label": "Correspondence Schools", + "value": "8241" + }, + { + "label": "Business and Secretarial Schools", + "value": "8244" + }, + { + "label": "Trade and Vocational Schools", + "value": "8249" + }, + { + "label": "Schools and Educational Services - Not Elsewhere Classified", + "value": "8299" + }, + { + "label": "Child Care Services", + "value": "8351" + }, + { + "label": "Charitable and Social Service Organizations", + "value": "8398" + }, + { + "label": "Civic, Social, and Fraternal Associations", + "value": "8641" + }, + { + "label": "Political Organizations", + "value": "8651" + }, + { + "label": "Religious Organizations", + "value": "8661" + }, + { + "label": "Automobile Associations", + "value": "8675" + }, + { + "label": "Membership Organizations - Not Elsewhere Classified", + "value": "8699" + }, + { + "label": "Testing Laboratories (Not Medical) - (Business to Business MCC)", + "value": "8734" + }, + { + "label": "Architectural, Engineering, and Surveying Services", + "value": "8911" + }, + { + "label": "Accounting, Auditing, and Bookkeeping Services", + "value": "8931" + }, + { + "label": "Professional Services - Not Elsewhere Classified", + "value": "8999" + }, + { + "label": "Court Costs, including Alimony and Child Support", + "value": "9211" + }, + { + "label": "Fines", + "value": "9222" + }, + { + "label": "Bail & Bond Payments", + "value": "9223" + }, + { + "label": "Tax Payments", + "value": "9311" + }, + { + "label": "Government Services - Not Elsewhere Classified", + "value": "9399" + }, + { + "label": "i-Purchasing", + "value": "9401" + }, + { + "label": "Postal Services", + "value": "9402" + }, + { + "label": "U.S. Fed Government Agencies", + "value": "9405" + }, + { + "label": "Automated Referral Service", + "value": "9700" + }, + { + "label": "Visa Credential Server", + "value": "9701" + }, + { + "label": "GCAS Emergency Services", + "value": "9702" + }, + { + "label": "U.K. Supermarkets, Electronic Hot File", + "value": "9751" + }, + { + "label": "U.K. Petrol Stations, Electronic Hot File", + "value": "9752" + }, + { + "label": "Consumer Electronics/Furniture Store", + "value": "9753" + }, + { + "label": "Quasi Cash - Gambling-Horse Racing, Dog Racing, State Lotteries", + "value": "9754" + }, + { + "label": "Intra-Company Purchases", + "value": "9950" + } + ]; + app.factory('upayMcc', function () { + return { + configs: function () { + return upayCode; + } + } + }); +}); diff --git a/src/main/ui/static/payment/partner/add-partner.js b/src/main/ui/static/payment/partner/add-partner.js index 18d2c8318..7e036a768 100644 --- a/src/main/ui/static/payment/partner/add-partner.js +++ b/src/main/ui/static/payment/partner/add-partner.js @@ -32,7 +32,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } }) }]); - app.controller('addPartnerCtrl', ['$rootScope', '$scope', '$http', '$state', 'Upload', 'commonDialog', 'timezone', 'businessStructuresMap', 'upayIndustryMap', 'industryMap', 'stateMap', 'sectorMap', 'countryMap','wechatGoodMcc','$filter', function ($rootScope, $scope, $http, $state, Upload, commonDialog, timezone, businessStructuresMap, upayIndustryMap, industryMap, stateMap, sectorMap, countryMap,wechatGoodMcc,$filter) { + app.controller('addPartnerCtrl', ['$rootScope', '$scope', '$http', '$state', 'Upload', 'commonDialog', 'timezone', 'businessStructuresMap', 'upayIndustryMap','upayMcc', 'industryMap', 'stateMap', 'sectorMap', 'countryMap','wechatGoodMcc','$filter', function ($rootScope, $scope, $http, $state, Upload, commonDialog, timezone, businessStructuresMap, upayIndustryMap, upayMcc, industryMap, stateMap, sectorMap, countryMap,wechatGoodMcc,$filter) { if ($scope.partner_application) { $scope.partner = angular.copy($scope.partner_application); delete $rootScope.partner_application; @@ -172,6 +172,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.industries = industryMap.configs(); $scope.wechatMccIndustries = wechatGoodMcc.configs(); $scope.upayIndustrys = upayIndustryMap.configs(); + $scope.upayMccs = upayMcc.configs(); $scope.states = stateMap.configs(); $scope.countries = countryMap.configs(); $scope.sectors = sectorMap.configs(); @@ -472,10 +473,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } } }]); - app.controller('partnerEditCtrl2', ['$scope', '$http', '$state', 'Upload', 'commonDialog', 'timezone', 'partner','upayIndustryMap','wechatGoodMcc','$filter', - function ($scope, $http, $state, Upload, commonDialog, timezone, partner,upayIndustryMap,wechatGoodMcc,$filter) { + app.controller('partnerEditCtrl2', ['$scope', '$http', '$state', 'Upload', 'commonDialog', 'timezone', 'partner','upayIndustryMap','upayMcc','wechatGoodMcc','$filter', + function ($scope, $http, $state, Upload, commonDialog, timezone, partner,upayIndustryMap,upayMcc,wechatGoodMcc,$filter) { $scope.upayIndustrys = upayIndustryMap.configs(); + $scope.upayMccs = upayMcc.configs(); $scope.timezones = timezone.configs(); $scope.wechatMccIndustries = wechatGoodMcc.configs(); $scope.partner = partner.data; diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 2475ecc50..ab097f6bc 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -1177,7 +1177,9 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter 'commonDialog', 'partner', '$sce', - function ($scope, $http, $state, $uibModal, $rootScope, Upload, commonDialog, partner, $sce) { + 'upayMcc', + function ($scope, $http, $state, $uibModal, $rootScope, Upload, commonDialog, partner, $sce,upayMcc) { + $scope.upayMccs = upayMcc.configs(); $scope.init = { wechat_compliance: false, local_merchant: false } $scope.partner = partner.data $scope.isComplianceOfCompanyName = false diff --git a/src/main/ui/static/payment/partner/templates/add_partner.html b/src/main/ui/static/payment/partner/templates/add_partner.html index 95308a108..97e3f3fe2 100644 --- a/src/main/ui/static/payment/partner/templates/add_partner.html +++ b/src/main/ui/static/payment/partner/templates/add_partner.html @@ -1363,6 +1363,24 @@
+
+ +
+ +
+

Required + Field

+
+
+
diff --git a/src/main/ui/static/payment/partner/templates/partner_detail.html b/src/main/ui/static/payment/partner/templates/partner_detail.html index d6aa58510..e4f182e93 100644 --- a/src/main/ui/static/payment/partner/templates/partner_detail.html +++ b/src/main/ui/static/payment/partner/templates/partner_detail.html @@ -1362,6 +1362,20 @@ ng-if="$root.complianceCheck.clientInfo">
+
+ +
+ + +
+
diff --git a/src/main/ui/static/payment/partner/templates/partner_edit.html b/src/main/ui/static/payment/partner/templates/partner_edit.html index 6804d3cf0..dba54ca35 100644 --- a/src/main/ui/static/payment/partner/templates/partner_edit.html +++ b/src/main/ui/static/payment/partner/templates/partner_edit.html @@ -1320,6 +1320,24 @@
+
+ +
+ +
+

Required + Field

+
+
+
From 80d6ea50769e71d543cded6b8f2b50219faadb3b Mon Sep 17 00:00:00 2001 From: Todking Date: Fri, 26 Nov 2021 18:13:17 +0800 Subject: [PATCH 24/28] =?UTF-8?q?fix=20Merchant=20Category=20Code=E5=B1=95?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/ui/static/payment/partner/templates/add_partner.html | 4 ++-- .../ui/static/payment/partner/templates/partner_detail.html | 4 ++-- .../ui/static/payment/partner/templates/partner_edit.html | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/ui/static/payment/partner/templates/add_partner.html b/src/main/ui/static/payment/partner/templates/add_partner.html index 97e3f3fe2..52a4dad50 100644 --- a/src/main/ui/static/payment/partner/templates/add_partner.html +++ b/src/main/ui/static/payment/partner/templates/add_partner.html @@ -1366,12 +1366,12 @@
+ *Merchant Warrior Merchant Category Code
- +
diff --git a/src/main/ui/static/payment/partner/templates/partner_edit.html b/src/main/ui/static/payment/partner/templates/partner_edit.html index dba54ca35..2d985b40c 100644 --- a/src/main/ui/static/payment/partner/templates/partner_edit.html +++ b/src/main/ui/static/payment/partner/templates/partner_edit.html @@ -1323,12 +1323,12 @@
+ *Merchant Warrior Merchant Category Code
Date: Thu, 2 Dec 2021 13:58:45 +0800 Subject: [PATCH 25/28] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=90=88=E4=BC=99?= =?UTF-8?q?=E4=BA=BA=E6=8F=90=E6=88=90sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impls/CityPartnerPrizeServiceImpl.java | 43 ++++++++++--------- .../mappers/payment/TransactionMapper.java | 8 ++-- .../mappers/payment/TransactionMapper.xml | 12 +++--- 3 files changed, 32 insertions(+), 31 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImpl.java index ebbd06d7c..e7bcf5b8c 100644 --- a/src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImpl.java @@ -22,6 +22,7 @@ import org.apache.poi.hssf.usermodel.HSSFFont; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.util.HSSFColor; import org.apache.poi.ss.usermodel.*; +import org.joda.time.DateTime; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -259,10 +260,10 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService { @Transactional public void generateold(String monthStr) { Date mon = checkMonth(monthStr); - Calendar monthCal = Calendar.getInstance(); - monthCal.setTime(mon); - int year = monthCal.get(Calendar.YEAR); - int month = monthCal.get(Calendar.MONTH) + 1; + DateTime begin = new DateTime(mon); + DateTime end = begin.plusMonths(1); + int year = begin.getYear(); + int month = begin.getMonthOfYear(); JSONObject sysConfig = sysConfigManager.getSysConfig(); BigDecimal alipayChargeRate = new BigDecimal("0.6"); @@ -286,7 +287,7 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService { channelMap.put("Wechat", "Wechat"); channelMap.put("AlipayOnline", "AlipayOnline"); Set orgIds = new HashSet<>(); - List transactionAnalysis = transactionMapper.listTransactionsForCityPartnerCommission(year, month); + List transactionAnalysis = transactionMapper.listTransactionsForCityPartnerCommission(begin.toDate(), end.toDate()); Map results = new HashMap<>(); for (JSONObject analysisDay : transactionAnalysis) { int orgId = analysisDay.getIntValue("org_id"); @@ -339,10 +340,10 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService { @Transactional public void generate(String monthStr) { Date mon = checkMonth(monthStr); - Calendar monthCal = Calendar.getInstance(); - monthCal.setTime(mon); - int year = monthCal.get(Calendar.YEAR); - int month = monthCal.get(Calendar.MONTH) + 1; + DateTime begin = new DateTime(mon); + DateTime end = begin.plusMonths(1); + int year = begin.getYear(); + int month = begin.getMonthOfYear(); // List list = financialPartnerCommissionMapper.list(year, month); // if (list != null && !list.isEmpty()) { @@ -374,8 +375,7 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService { channelCharge.put("wechatChargeRate", wechatChargeRate); channelCharge.put("jdChargeRate", jdChargeRate); channelCharge.put("alipayonlineChargeRate", alipayonlineChargeRate); - - List transactionDetail = transactionMapper.listTransactionForCityPartnerCommissionByDate(year, month); + List transactionDetail = transactionMapper.listTransactionForCityPartnerCommissionByDate(begin.toDate(), end.toDate()); transactionDetail.forEach(item -> { if (StringUtils.equalsIgnoreCase("AlipayPlus", item.getString("channel"))) { item.put("channel", item.getString("pay_type")); @@ -763,15 +763,15 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService { @Transactional public void generateReferrer(String monthStr) { Date mon = checkMonth(monthStr); - Calendar monthCal = Calendar.getInstance(); - monthCal.setTime(mon); - int year = monthCal.get(Calendar.YEAR); - int month = monthCal.get(Calendar.MONTH) + 1; + DateTime begin = new DateTime(mon); + DateTime end = begin.plusMonths(1); + int year = begin.getYear(); + int month = begin.getMonthOfYear(); financialReferrerCommissionDetailMapper.clearData(year, month); financialReferrerCommissionMapper.clearData(year, month); - List transactionAnalysis = transactionMapper.listTransactionsForReferrerCommission(year, month); + List transactionAnalysis = transactionMapper.listTransactionsForReferrerCommission(begin.toDate(), end.toDate()); Map results = new HashMap<>(); for (JSONObject analysisDay : transactionAnalysis) { Integer orgId = analysisDay.getInteger("org_id"); @@ -850,14 +850,15 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService { public void generateAgent(String monthStr, JSONObject channelCharge) { Date mon = checkMonth(monthStr); - Calendar monthCal = Calendar.getInstance(); - monthCal.setTime(mon); - int year = monthCal.get(Calendar.YEAR); - int month = monthCal.get(Calendar.MONTH) + 1; + DateTime begin = new DateTime(mon); + DateTime end = begin.plusMonths(1); + int year = begin.getYear(); + int month = begin.getMonthOfYear(); financialAgentCommissionMapper.clearData(year, month); financialAgentCommissionDetailMapper.clearData(year, month); - List transactionDetail = transactionMapper.listTransactionForCityPartnerAgentCommissionByDate(year, month); + + List transactionDetail = transactionMapper.listTransactionForCityPartnerAgentCommissionByDate(begin.toDate(), end.toDate()); transactionDetail.forEach(item -> { if (StringUtils.equalsIgnoreCase("AlipayPlus", item.getString("channel"))) { item.put("channel", item.getString("pay_type")); diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java index bf78fb493..a3e393e9a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java @@ -95,13 +95,13 @@ public interface TransactionMapper { BigDecimal totalAmountForSydneyGMPrize(@Param("year") int year, @Param("month") int month); - List listTransactionForCityPartnerCommissionByDate(@Param("year") int year, @Param("month") int month); + List listTransactionForCityPartnerCommissionByDate(@Param("begin") Date begin, @Param("end") Date end); - List listTransactionForCityPartnerAgentCommissionByDate(@Param("year") int year, @Param("month") int month); + List listTransactionForCityPartnerAgentCommissionByDate(@Param("begin") Date begin, @Param("end") Date end); - List listTransactionsForCityPartnerCommission(@Param("year") int year, @Param("month") int month); + List listTransactionsForCityPartnerCommission(@Param("begin") Date begin, @Param("end") Date end); - List listTransactionsForReferrerCommission(@Param("year") int year, @Param("month") int month); + List listTransactionsForReferrerCommission(@Param("begin") Date begin, @Param("end") Date end); List listTransactionsForAgentCommission(@Param("year") int year, @Param("month") int month, @Param("parent_org_id") int parent_org_id); 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 02ac6e24a..478df93b9 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 @@ -1006,8 +1006,8 @@ INNER JOIN sys_org so ON m.org_id = so.org_id AND so.is_valid = 1 AND so.type = 0 AND so.citypartner = 1 AND so.commission = 1 - WHERE year(t.transaction_time) = #{year} - AND month(t.transaction_time) = #{month} + WHERE t.transaction_time >= #{begin} + AND t.transaction_time < #{end} AND t.channel != 'Settlement' GROUP BY t.client_id, trade_date, channel ORDER BY c.org_id ASC, t.client_id ASC, trade_date ASC @@ -1036,7 +1036,7 @@ INNER JOIN sys_org so ON t.org_id = so.org_id AND so.is_valid = 1 AND so.type = 0 AND so.citypartner = 1 AND so.commission = 1 - AND year(t.create_time) = #{year} AND month(t.create_time) = #{month} + AND t.create_time >= #{begin} AND t.create_time < #{end} AND t.channel != 'Settlement' AND t.channel != 'System' AND t.system_generate = 0 ORDER BY t.client_id asc ]]> @@ -1066,7 +1066,7 @@ AND so.type = 0 AND so.parent_org_id != '' AND so.citypartner = 1 AND so.commission = 1 - AND year(t.transaction_time) = #{year} AND month(t.transaction_time) = #{month} + AND t.transaction_time >= #{begin} AND t.transaction_time < #{end} AND t.channel != 'Settlement' AND t.channel != 'System' ORDER BY t.client_id asc ]]> @@ -1084,8 +1084,8 @@ inner join sys_client_config cc on cc.client_id = c.client_id INNER JOIN sys_org so ON c.referrer_id = so.org_id AND so.is_valid = 1 AND so.type = 1 AND so.commission = 1 - WHERE year(t.transaction_time) = #{year} - AND month(t.transaction_time) = #{month} + WHERE t.transaction_time >= #{begin} + AND t.transaction_time < #{end} AND t.channel != 'Settlement' GROUP BY so.org_id, trade_date, t.client_id ORDER BY c.org_id ASC, t.client_id ASC, trade_date ASC From 3231b1ab3215b165de6f31cf02dc9ca6c3e45c63 Mon Sep 17 00:00:00 2001 From: dalong306 <304592994@qq.com> Date: Thu, 2 Dec 2021 14:58:30 +0800 Subject: [PATCH 26/28] =?UTF-8?q?=E5=90=88=E4=BC=99=E4=BA=BA=E6=8F=90?= =?UTF-8?q?=E6=88=90=E4=BC=98=E5=8C=96=EF=BC=88=E6=97=B6=E9=97=B4=E6=AE=B5?= =?UTF-8?q?=E6=8B=86=E5=88=86=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impls/CityPartnerPrizeServiceImpl.java | 35 +++++- .../manage/dev/web/TestController.java | 102 +++++++++++++++++- 2 files changed, 128 insertions(+), 9 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImpl.java index e7bcf5b8c..9682afcf3 100644 --- a/src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImpl.java @@ -341,6 +341,8 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService { public void generate(String monthStr) { Date mon = checkMonth(monthStr); DateTime begin = new DateTime(mon); + DateTime timeinterval1=begin.plusDays(10); + DateTime timeinterval2=begin.plusDays(20); DateTime end = begin.plusMonths(1); int year = begin.getYear(); int month = begin.getMonthOfYear(); @@ -375,7 +377,16 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService { channelCharge.put("wechatChargeRate", wechatChargeRate); channelCharge.put("jdChargeRate", jdChargeRate); channelCharge.put("alipayonlineChargeRate", alipayonlineChargeRate); - List transactionDetail = transactionMapper.listTransactionForCityPartnerCommissionByDate(begin.toDate(), end.toDate()); + List transactionDetail=new ArrayList<>(); + long time1=System.currentTimeMillis(); + List transactionDetail1 = transactionMapper.listTransactionForCityPartnerCommissionByDate(begin.toDate(), timeinterval1.toDate()); + List transactionDetail2 = transactionMapper.listTransactionForCityPartnerCommissionByDate(timeinterval1.toDate(), timeinterval2.toDate()); + List transactionDetail3 = transactionMapper.listTransactionForCityPartnerCommissionByDate(timeinterval2.toDate(), end.toDate()); + long time2=System.currentTimeMillis(); + System.out.println("=====>time:"+(time2-time1)); + transactionDetail.addAll(transactionDetail1); + transactionDetail.addAll(transactionDetail2); + transactionDetail.addAll(transactionDetail3); transactionDetail.forEach(item -> { if (StringUtils.equalsIgnoreCase("AlipayPlus", item.getString("channel"))) { item.put("channel", item.getString("pay_type")); @@ -764,14 +775,21 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService { public void generateReferrer(String monthStr) { Date mon = checkMonth(monthStr); DateTime begin = new DateTime(mon); + DateTime timeinterval1=begin.plusDays(10); + DateTime timeinterval2=begin.plusDays(20); DateTime end = begin.plusMonths(1); int year = begin.getYear(); int month = begin.getMonthOfYear(); financialReferrerCommissionDetailMapper.clearData(year, month); financialReferrerCommissionMapper.clearData(year, month); - - List transactionAnalysis = transactionMapper.listTransactionsForReferrerCommission(begin.toDate(), end.toDate()); + List transactionAnalysis=new ArrayList<>(); + List transactionAnalysis1 = transactionMapper.listTransactionsForReferrerCommission(begin.toDate(), timeinterval1.toDate()); + List transactionAnalysis2 = transactionMapper.listTransactionsForReferrerCommission(timeinterval1.toDate(), timeinterval2.toDate()); + List transactionAnalysis3 = transactionMapper.listTransactionsForReferrerCommission(timeinterval2.toDate(), end.toDate()); + transactionAnalysis.addAll(transactionAnalysis1); + transactionAnalysis.addAll(transactionAnalysis2); + transactionAnalysis.addAll(transactionAnalysis3); Map results = new HashMap<>(); for (JSONObject analysisDay : transactionAnalysis) { Integer orgId = analysisDay.getInteger("org_id"); @@ -851,14 +869,21 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService { Date mon = checkMonth(monthStr); DateTime begin = new DateTime(mon); + DateTime timeinterval1=begin.plusDays(10); + DateTime timeinterval2=begin.plusDays(20); DateTime end = begin.plusMonths(1); int year = begin.getYear(); int month = begin.getMonthOfYear(); financialAgentCommissionMapper.clearData(year, month); financialAgentCommissionDetailMapper.clearData(year, month); - - List transactionDetail = transactionMapper.listTransactionForCityPartnerAgentCommissionByDate(begin.toDate(), end.toDate()); + List transactionDetail=new ArrayList<>(); + List transactionDetail1 = transactionMapper.listTransactionForCityPartnerAgentCommissionByDate(begin.toDate(), timeinterval1.toDate()); + List transactionDetail2 = transactionMapper.listTransactionForCityPartnerAgentCommissionByDate(timeinterval1.toDate(), timeinterval2.toDate()); + List transactionDetail3 = transactionMapper.listTransactionForCityPartnerAgentCommissionByDate(timeinterval2.toDate(), end.toDate()); + transactionDetail.addAll(transactionDetail1); + transactionDetail.addAll(transactionDetail2); + transactionDetail.addAll(transactionDetail3); transactionDetail.forEach(item -> { if (StringUtils.equalsIgnoreCase("AlipayPlus", item.getString("channel"))) { item.put("channel", item.getString("pay_type")); diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java index bf0964a66..ab7d7db56 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java @@ -1,10 +1,15 @@ package au.com.royalpay.payment.manage.dev.web; +import au.com.royalpay.payment.channels.alipay.config.AlipayConfig; +import au.com.royalpay.payment.channels.alipay.config.AlipayEnvironment; +import au.com.royalpay.payment.channels.alipay.runtime.AlipayOnlineApi; +import au.com.royalpay.payment.channels.alipay.runtime.AlipayRetailApi; import au.com.royalpay.payment.channels.wechat.runtime.beans.SubMerchantInfoInheritance; import au.com.royalpay.payment.channels.wechat.runtime.impls.WxPayMerchantRegister; import au.com.royalpay.payment.channels.wechat.runtime.mappers.PaymentChannelMccGoodMapper; import au.com.royalpay.payment.core.PaymentApi; import au.com.royalpay.payment.core.PaymentDevHelper; +import au.com.royalpay.payment.core.beans.EmptyMerchantApplication; import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; import au.com.royalpay.payment.core.impls.MerchantChannelApplicationManager; import au.com.royalpay.payment.core.mappers.PmtCustomReportMapper; @@ -63,12 +68,10 @@ import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.math.RoundingMode; +import java.security.InvalidParameterException; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.List; -import java.util.Optional; +import java.util.*; /** * Created by yixian on 2016-07-06. @@ -803,4 +806,95 @@ public class TestController { } } + + /** + * 批量更新支付宝子商户号报备 + */ + @GetMapping(value = "/batch_update_alipayapply") + public void batchUpdateAlipayApply() { + logger.info("=======>batchUpdateAlipayApply=开始批量更新支付宝"); + String[] alipayonlines = new String[]{}; + StringBuilder sb=new StringBuilder(); + Arrays.stream(alipayonlines).forEach( + clientMoniker -> { + JSONObject client = clientMapper.findClientByMoniker(clientMoniker); + if (client == null) { + logger.info("======>alipayonline:" + clientMoniker + ":client为空"); + return; + } + if(TextUtils.isEmpty(client.getString("acn"))){ + client.put("acn",null); + } + logger.info("======>alipayonline:" + clientMoniker); + if (!client.containsKey("company_website")) { + client.put("company_website", "https://www.royalpay.com.au/"); + } + if (StringUtils.isBlank(client.getString("business_structure"))) { + client.put("business_structure", "Registered body(Sole Trader)"); + } + if (StringUtils.isBlank(client.getString("alipayindustry"))) { + logger.info("======>alipayonline:" + clientMoniker + ":alipayindustry为空,给默认值5311"); + client.put("alipayindustry", "5311"); + } + logger.info("======>alipayindustry:register:" + clientMoniker); + sb.append(clientMoniker+","); +// try { +// merchantChannelApplicationManager.getRegister(AlipayOnlineApi.class).apply(client, new EmptyMerchantApplication(), null); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// try { +// Thread.sleep(100); +// } catch (InterruptedException e) { +// e.printStackTrace(); +// } + } + + + ); + + String[] alipayRetails = new String[]{ }; + Arrays.stream(alipayRetails).forEach( + clientMoniker -> { + JSONObject client = clientMapper.findClientByMoniker(clientMoniker); + if (client == null) { + logger.info("======>alipayRetail:" + clientMoniker + ":client为空"); + } + if(TextUtils.isEmpty(client.getString("acn"))){ + client.put("acn",null); + } + logger.info("======>alipayRetail:" + clientMoniker); + if (!client.containsKey("store_photo") || !client.containsKey("company_photo")) { + return; + } + + if (StringUtils.isBlank(client.getString("business_structure"))) { + client.put("business_structure", "Registered body(Sole Trader)"); + } + if (StringUtils.isBlank(client.getString("alipayindustry"))) { + logger.info("======>alipayRetail:" + clientMoniker + ":alipayindustry为空,给默认值5311"); + client.put("alipayindustry", "5311"); + } + if(TextUtils.isEmpty(client.getString("acn")) && !TextUtils.isEmpty(client.getString("abn"))) + + logger.info("======>alipayRetail:register:" + clientMoniker); + sb.append(clientMoniker+","); + +// try { +// merchantChannelApplicationManager.getRegister(AlipayRetailApi.class).apply(client, new EmptyMerchantApplication(), null); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// try { +// Thread.sleep(100); +// } catch (InterruptedException e) { +// e.printStackTrace(); +// } + } + + ); + logger.info("======>as:" + sb.toString()); + + + } } From c18d26aaa086a70e15dfc58d85c014b821e1e1e1 Mon Sep 17 00:00:00 2001 From: Yixian Date: Fri, 3 Dec 2021 15:12:42 +0800 Subject: [PATCH 27/28] add manual task log --- .../clearing/core/impl/SettleTaskServiceImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/SettleTaskServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/SettleTaskServiceImpl.java index 6541bdbcd..4c391876b 100644 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/SettleTaskServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/SettleTaskServiceImpl.java @@ -15,6 +15,8 @@ import com.alibaba.fastjson.JSONObject; import org.apache.commons.lang3.StringUtils; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.data.redis.core.StringRedisTemplate; @@ -38,6 +40,7 @@ import java.util.stream.Collectors; @Service public class SettleTaskServiceImpl implements SettleTasksService { + private final Logger logger = LoggerFactory.getLogger(getClass()); private final SysSettlePlanMapper planMapper; private final StringRedisTemplate redisTemplate; private final MerchantInfoProvider mchInfoProvider; @@ -105,8 +108,10 @@ public class SettleTaskServiceImpl implements SettleTasksService { URI uri = UriComponentsBuilder.fromHttpUrl(transactionHost).replacePath(SETTLE_TASK_URI) .build().toUri(); try { + String taskStr = JSON.toJSONString(tasks); + logger.info("submitting settlement task:{}--------->{}", uri, taskStr); restTemplate.exchange(RequestEntity.post(uri).contentType(MediaType.APPLICATION_JSON) - .body(JSON.toJSONString(tasks).getBytes(StandardCharsets.UTF_8)), String.class); + .body(taskStr.getBytes(StandardCharsets.UTF_8)), String.class); } catch (RestClientResponseException e) { String resp = e.getResponseBodyAsString(); try { From 08c9111f93e5abd7f4c59671597a691906052826 Mon Sep 17 00:00:00 2001 From: Yixian Date: Tue, 7 Dec 2021 13:50:01 +0800 Subject: [PATCH 28/28] =?UTF-8?q?=E6=89=8B=E5=8A=A8=E6=B8=85=E7=AE=97?= =?UTF-8?q?=E5=AE=B9=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/ui/static/analysis/settle_tasks.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/ui/static/analysis/settle_tasks.js b/src/main/ui/static/analysis/settle_tasks.js index 7ba893bc5..b8604ed57 100644 --- a/src/main/ui/static/analysis/settle_tasks.js +++ b/src/main/ui/static/analysis/settle_tasks.js @@ -95,6 +95,14 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { size: 'lg' }).result.then(function (merchants) { let arr = $scope.editingTask.whitelist_clients || []; + if(!merchants){ + commonDialog.alert({ + type: 'error', + title: '未选择有效商户', + content: '未选择有效商户' + }); + return; + } for (let mch of merchants) { if (arr.filter(wMch => wMch.client_moniker === mch.client_moniker).length < 1) { arr.push(mch); @@ -161,6 +169,14 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { submitTask.last_settle_date = task.last_settle_date; submitTask.disabled_clean_days = task.disabled_clean_days; submitTask.follow_sub_partner = task.follow_sub_partner; + if (task.whitelist_clients == null) { + commonDialog.alert({ + type: 'error', + title: '批次配置出错', + content: '批次[' + task.remark + ']未选择商户' + }) + return false + } submitTask.whitelist_clients = task.whitelist_clients.map(cli => cli.client_moniker) } tasks.push(submitTask)