From ad570266dfbc212cfec7b664caee0152e13fbe44 Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Mon, 11 Jun 2018 17:04:06 +0800 Subject: [PATCH] optimum --- src/db/modify.sql | 14 +++++++- .../impls/SimpleClientApplyServiceImpl.java | 36 +++++++++---------- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/db/modify.sql b/src/db/modify.sql index 61a23de4a..2b8dc8a1f 100644 --- a/src/db/modify.sql +++ b/src/db/modify.sql @@ -543,4 +543,16 @@ alter table sys_client_pre_apply add COLUMN `client_moniker` varchar(20) DEFAULT alter table sys_client_pre_apply modify COLUMN `agree` tinyint(1) DEFAULT 0; -insert into `royalpay_production`.`sys_configs` ( `config_key`, `config_value`) values ( 'royalpayindustry.json', '[{"children":[{"children":[],"label":"机票","mccCode":"10001"},{"children":[],"label":"旅游行业","mccCode":"10002"},{"children":[],"label":"私人定制旅游","mccCode":"10003"},{"children":[],"label":"租车","mccCode":"10004"},{"children":[],"label":"巴士","mccCode":"10005"}],"label":"旅游出行","mccCode":"1"},{"children":[{"children":[],"label":"饭店","mccCode":"20001"},{"children":[],"label":"奶茶店","mccCode":"20002"},{"children":[],"label":"烧烤","mccCode":"20003"},{"children":[],"label":"火锅","mccCode":"20004"},{"children":[],"label":"Coffee","mccCode":"20005"},{"children":[],"label":"酒吧","mccCode":"20006"}],"label":"餐饮","mccCode":"2"},{"children":[{"children":[],"label":"培训类","mccCode":"30001"},{"children":[],"label":"移民留学","mccCode":"30002"},{"children":[],"label":"私人幼儿园","mccCode":"30003"}],"label":"教育","mccCode":"3"},{"children":[{"children":[],"label":"换汇","mccCode":"40001"},{"children":[],"label":"房产","mccCode":"40002"}],"label":"商务咨询","mccCode":"4"},{"children":[{"children":[],"label":"公众号服务商","mccCode":"50001"},{"children":[],"label":"各种媒体类宣传","mccCode":"50002"}],"label":"传媒","mccCode":"5","value":"{\"category\":\"SERVICE\",\"code\":\"7542\",\"description\":\"Car Washes\",\"parentCode\":\"S10\"}"},{"children":[{"children":[],"label":"美容院","mccCode":"60001"},{"children":[],"label":"医疗美容","mccCode":"60002"}],"label":"医美","mccCode":"6"},{"children":[{"label":"超市","mccCode":"70001"},{"children":[],"label":"服装店","mccCode":"70002"},{"children":[],"label":"鞋店","mccCode":"70003"},{"children":[],"label":"珠宝店","mccCode":"70004"},{"children":[],"label":"箱包","mccCode":"70005"}],"label":"零售","mccCode":"7"},{"children":[{"children":[],"label":"桌游吧","mccCode":"80001"},{"children":[],"label":"演唱会","mccCode":"80002"},{"children":[],"label":"马术训练","mccCode":"80003"},{"children":[],"label":"瑜伽","mccCode":"80004"},{"children":[],"label":"健身","mccCode":"80005"},{"children":[],"label":"社团","mccCode":"80006"},{"children":[],"label":"网吧","mccCode":"80007"},{"children":[],"label":"KTV","mccCode":"80008"},{"children":[],"label":"电影","mccCode":"80009"}],"label":"休闲娱乐","mccCode":"8"},{"children":[{"children":[],"label":"摄影","mccCode":"90001"},{"children":[],"label":"massage","mccCode":"90002"},{"children":[],"label":"通讯运营商","mccCode":"90003"},{"children":[],"label":"车行","mccCode":"90004"},{"children:":[],"label":"软件服务","mccCode":"90005"}],"label":"其他服务类","mccCode":"9"},{"children":[{"children":[],"label":"Hotel","mccCode":"100001"},{"children":[],"label":"Motel","mccCode":"100002"}],"label":"酒店","mccCode":"10"},{"children":[{"children":[],"label":"代购","mccCode":"110001"},{"children":[],"label":"物流(大宗出口贸易)","mccCode":"110002"},{"children":[],"label":"红酒出口","mccCode":"110003"},{"children":[],"label":"综合电商","mccCode":"110004"}],"label":"出口贸易","mccCode":"11"},{"children":[{"children":[],"label":"建材","mccCode":"120001"},{"children":[],"label":"家居","mccCode":"120002"}],"label":"家居建材","mccCode":"12"}]'); \ No newline at end of file +insert into `royalpay_production`.`sys_configs` ( `config_key`, `config_value`) values ( 'royalpayindustry.json', '[{"children":[{"children":[],"label":"机票","mccCode":"10001"},{"children":[],"label":"旅游行业","mccCode":"10002"},{"children":[],"label":"私人定制旅游","mccCode":"10003"},{"children":[],"label":"租车","mccCode":"10004"},{"children":[],"label":"巴士","mccCode":"10005"}],"label":"旅游出行","mccCode":"1"},{"children":[{"children":[],"label":"饭店","mccCode":"20001"},{"children":[],"label":"奶茶店","mccCode":"20002"},{"children":[],"label":"烧烤","mccCode":"20003"},{"children":[],"label":"火锅","mccCode":"20004"},{"children":[],"label":"Coffee","mccCode":"20005"},{"children":[],"label":"酒吧","mccCode":"20006"}],"label":"餐饮","mccCode":"2"},{"children":[{"children":[],"label":"培训类","mccCode":"30001"},{"children":[],"label":"移民留学","mccCode":"30002"},{"children":[],"label":"私人幼儿园","mccCode":"30003"}],"label":"教育","mccCode":"3"},{"children":[{"children":[],"label":"换汇","mccCode":"40001"},{"children":[],"label":"房产","mccCode":"40002"}],"label":"商务咨询","mccCode":"4"},{"children":[{"children":[],"label":"公众号服务商","mccCode":"50001"},{"children":[],"label":"各种媒体类宣传","mccCode":"50002"}],"label":"传媒","mccCode":"5","value":"{\"category\":\"SERVICE\",\"code\":\"7542\",\"description\":\"Car Washes\",\"parentCode\":\"S10\"}"},{"children":[{"children":[],"label":"美容院","mccCode":"60001"},{"children":[],"label":"医疗美容","mccCode":"60002"}],"label":"医美","mccCode":"6"},{"children":[{"label":"超市","mccCode":"70001"},{"children":[],"label":"服装店","mccCode":"70002"},{"children":[],"label":"鞋店","mccCode":"70003"},{"children":[],"label":"珠宝店","mccCode":"70004"},{"children":[],"label":"箱包","mccCode":"70005"}],"label":"零售","mccCode":"7"},{"children":[{"children":[],"label":"桌游吧","mccCode":"80001"},{"children":[],"label":"演唱会","mccCode":"80002"},{"children":[],"label":"马术训练","mccCode":"80003"},{"children":[],"label":"瑜伽","mccCode":"80004"},{"children":[],"label":"健身","mccCode":"80005"},{"children":[],"label":"社团","mccCode":"80006"},{"children":[],"label":"网吧","mccCode":"80007"},{"children":[],"label":"KTV","mccCode":"80008"},{"children":[],"label":"电影","mccCode":"80009"}],"label":"休闲娱乐","mccCode":"8"},{"children":[{"children":[],"label":"摄影","mccCode":"90001"},{"children":[],"label":"massage","mccCode":"90002"},{"children":[],"label":"通讯运营商","mccCode":"90003"},{"children":[],"label":"车行","mccCode":"90004"},{"children:":[],"label":"软件服务","mccCode":"90005"}],"label":"其他服务类","mccCode":"9"},{"children":[{"children":[],"label":"Hotel","mccCode":"100001"},{"children":[],"label":"Motel","mccCode":"100002"}],"label":"酒店","mccCode":"10"},{"children":[{"children":[],"label":"代购","mccCode":"110001"},{"children":[],"label":"物流(大宗出口贸易)","mccCode":"110002"},{"children":[],"label":"红酒出口","mccCode":"110003"},{"children":[],"label":"综合电商","mccCode":"110004"}],"label":"出口贸易","mccCode":"11"},{"children":[{"children":[],"label":"建材","mccCode":"120001"},{"children":[],"label":"家居","mccCode":"120002"}],"label":"家居建材","mccCode":"12"}]'); + + +ALTER TABLE `sys_client_config` +ADD COLUMN `gateway_alipay_online` tinyint(1) NULL DEFAULT 1 COMMENT '支付宝线上网关使用线上渠道' AFTER `require_remark`; +ALTER TABLE `sys_clients` +ADD COLUMN `gateway_alipay_online` tinyint(1) NULL DEFAULT 1 COMMENT '支付宝线上网关使用线上渠道' AFTER `require_remark`; + +alter table pmt_refunds add column remark varchar(200); + +alter table sys_client_pre_apply add column `salt` varchar(30) NOT NULL COMMENT '每次修改密码时随机更改'; +alter table sys_client_pre_apply add column `password_hash` varchar(150) NOT NULL COMMENT '登录账户密码 base64(sha256(salt+password))'; +alter table sys_client_pre_apply add column `password_aes` varchar(50) NOT NULL COMMENT '登录账户密码 AES加密'; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java index 6e28c5f25..36f7075ee 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java @@ -91,7 +91,6 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { private ClientConfigMapper clientConfigMapper; private ThreadPoolExecutor pool = new ThreadPoolExecutor(1, 10, 5, TimeUnit.SECONDS, new LinkedBlockingQueue()); - @Resource private StringRedisTemplate stringRedisTemplate; private SmsSingleSender sender = null; @@ -163,22 +162,23 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { Context ctx = new Context(); ctx.setVariable("url", PlatformEnvironment.getEnv().concatUrl("/register/account/mail/" + address + "/verify/" + key + "/jump?username=" + username)); final String content = thymeleaf.process("mail/register_application", ctx); -// SendMail sendMail = new SendMail(); -// Set to = new HashSet<>(); -// to.add(address); -// sendMail.setMailTos(to); -// sendMail.setFrom("info@mail.royalpay.com.au"); -// sendMail.setTitle("Royalpay"); -// sendMail.setContent(content); -// sendMail.setTags(tags); -// mailGunService.sendMail(sendMail); + // SendMail sendMail = new SendMail(); + // Set to = new HashSet<>(); + // to.add(address); + // sendMail.setMailTos(to); + // sendMail.setFrom("info@mail.royalpay.com.au"); + // sendMail.setTitle("Royalpay"); + // sendMail.setContent(content); + // sendMail.setTags(tags); + // mailGunService.sendMail(sendMail); - try { - String emailId = mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", address, - "", content); - } catch (Exception e) { - throw new EmailException("Email Sending Failed", e); - } + Runnable task2 = () -> { + try { + String emailId = mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", address, "", content); + } catch (Exception ignore) { + } + }; + pool.execute(task2); } @@ -346,7 +346,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { clientConfig.put("common_sub_merchant_id", 1); clientConfigMapper.save(clientConfig); - apply.put("client_moniker",clientMoniker); + apply.put("client_moniker", clientMoniker); sysClientPreMapperMapper.update(apply); JSONObject sysRate = new JSONObject(); @@ -358,7 +358,6 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { sysRate.put("active_time", DateFormatUtils.format(new Date(), "yyyy-MM-dd")); sysRate.put("expiry_time", DateFormatUtils.format(DateUtils.addYears(new Date(), 1), "yyyy-MM-dd")); - JSONObject rateConfig = JSONObject.parseObject(sysConfig.getString("sys_apply_rates")); JSONObject chooseRate = new JSONObject(); if (apply.getIntValue("clean_days") == 1) { @@ -385,7 +384,6 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { }; pool.execute(task2); - } private String generateClientMoniker() {