diff --git a/src/db/modify.sql b/src/db/modify.sql index 61a23de4a..29607b206 100644 --- a/src/db/modify.sql +++ b/src/db/modify.sql @@ -543,4 +543,10 @@ 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`; \ No newline at end of file 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 47941ad78..f6e07eeba 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 @@ -152,14 +152,6 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT return res; } - private JSONObject getSevenOrMonth(JSONObject params, JSONObject today){ - JSONObject res = new JSONObject(); - res.put("traded_partners", clientCustomersMapper.countTradedClients(params) + clientAnalysisMapper.countNewClients(today)); - res.put("total_customers", clientCustomersMapper.countTotalCustomers(params) + clientAnalysisMapper.countClients(today)); - res.put("old_customers", clientCustomersMapper.countTotalOldCustomers(params) + clientAnalysisMapper.countTradedPartners(params)); - return res; - } - @Override public List getTradeInTypes(JSONObject params) { return transactionAnalysisMapper.getTradeAmountInTypes(params); @@ -540,7 +532,7 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT }*/ @Override public JSONObject getPlatformAmount(JSONObject params) { - String jsonStr = stringRedisTemplate.boundValueOps("org_ChannelAnalysis" + params.getString("begin")).get(); + String jsonStr = stringRedisTemplate.boundValueOps("org_ChannelAnalysis" + params.getString("org_id")+params.getString("begin")).get(); JSONObject channelAnalysis = JSONObject.parseObject(jsonStr); if(channelAnalysis != null){ return channelAnalysis; @@ -555,7 +547,7 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT }else { resp = customerAndOrdersStatisticsMapper.getChannelCommonCount(params); } - stringRedisTemplate.boundValueOps("org_ChannelAnalysis"+ params.getString("begin")).set(resp.toJSONString(), 5, TimeUnit.MINUTES); + stringRedisTemplate.boundValueOps("org_ChannelAnalysis"+ params.getString("org_id")+params.getString("begin")).set(resp.toJSONString(), 5, TimeUnit.MINUTES); return resp; } } diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PartnersAnalysisServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PartnersAnalysisServiceImpl.java index f4c75d4dc..5d5ab581a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PartnersAnalysisServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PartnersAnalysisServiceImpl.java @@ -5,6 +5,7 @@ import java.util.List; import javax.annotation.Resource; +import au.com.royalpay.payment.manage.analysis.mappers.CustomerAndOrdersStatisticsMapper; import org.springframework.stereotype.Service; import org.springframework.util.StringUtils; @@ -23,6 +24,9 @@ public class PartnersAnalysisServiceImpl implements PartnersAnalysisService { @Resource private ClientAnalysisMapper clientAnalysisMapper; + @Resource + private CustomerAndOrdersStatisticsMapper customerAndOrdersStatisticsMapper; + @Override public List getNewPartnersAnalysis(JSONObject params) { return clientAnalysisMapper.countNewClientsHistory(params); @@ -30,7 +34,7 @@ public class PartnersAnalysisServiceImpl implements PartnersAnalysisService { @Override public List getTradePartnersAnalysis(JSONObject params){ - return clientAnalysisMapper.countTradePartnersHistory(params); + return customerAndOrdersStatisticsMapper.countTradedClientsByDate(params); } @Override diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.java b/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.java index fb62cd83a..c8e14fa42 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.java @@ -51,4 +51,6 @@ public interface CustomerAndOrdersStatisticsMapper { JSONObject getCommonCount(JSONObject params); PageList getAreaMerchantTradeAnalysis(JSONObject params, PageBounds pageBounds); + + List countTradedClientsByDate(JSONObject parasm); } diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppClientBean.java b/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppClientBean.java index 2c90fd3a9..5e33057b7 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppClientBean.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppClientBean.java @@ -19,7 +19,11 @@ public class AppClientBean { private String timezone; @JSONField(name = "customer_surcharge_rate") private Double customerSurchargeRate; - + private String company_phone; + private String address; + private String suburb; + private String postcode; + private String state; public JSONObject updateObject() { @@ -36,6 +40,22 @@ public class AppClientBean { if (timezone != null) { res.put("timezone", timezone); } + if (company_phone != null) { + res.put("company_phone", company_phone); + } + if (address != null) { + res.put("address", address); + } + if (suburb != null) { + res.put("suburb", suburb); + } + if (postcode != null) { + res.put("postcode", postcode); + } + if (state != null) { + res.put("state", state); + } + return res; } @@ -77,4 +97,44 @@ public class AppClientBean { public Double getCustomerSurchargeRate(){ return customerSurchargeRate; } + + public String getCompany_phone() { + return company_phone; + } + + public void setCompany_phone(String company_phone) { + this.company_phone = company_phone; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getSuburb() { + return suburb; + } + + public void setSuburb(String suburb) { + this.suburb = suburb; + } + + public String getPostcode() { + return postcode; + } + + public void setPostcode(String postcode) { + this.postcode = postcode; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java index 3c1ff0fa5..56f625d5f 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java @@ -168,8 +168,7 @@ public class RetailAppServiceImp implements RetailAppService { private ClientModifySupport clientModifySupport; private Map senderMap = new HashMap<>(); - private final String fileName[] = { "source_agree_file", "client_bank_file", "client_id_file", "client_agree_file", "client_company_file", - "client_apply_file" }; + private final String fileName[] = { "client_bank_file", "client_id_file", "client_company_file"}; @Resource public void setAppMsgSenders(AppMsgSender[] senders) { @@ -351,9 +350,9 @@ public class RetailAppServiceImp implements RetailAppService { public void uploadAuthFiles(JSONObject device, ClientAuthFilesInfo clientAuthFilesInfo) { JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); JSONObject account = clientAccountMapper.findById(device.getString("account_id")); - clientAuthFilesInfo.setFile_id_info(null); clientAuthFilesInfo.setAuthStatus(0); clientAuthFilesInfo.setFile_agreement_info(null); + clientAuthFilesInfo.setFile_apply_info(null); clientManager.uploadAuthFiles(account, client.getString("client_moniker"), clientAuthFilesInfo); } @@ -442,6 +441,8 @@ public class RetailAppServiceImp implements RetailAppService { @Override public JSONObject getClientInfoMe(JSONObject device) { JSONObject result = new JSONObject(); + result.put("base_info_lack", false); + result.put("compliance_info_lack", false); JSONObject client = clientMapper.findClient(device.getIntValue("client_id")); if(StringUtils.isEmpty(client.getString("business_structure"))|| StringUtils.isEmpty(client.getString("logo_url"))|| 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 51068c008..affcac0e7 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 @@ -20,6 +20,7 @@ import au.com.royalpay.payment.tools.env.PlatformEnvironment; import au.com.royalpay.payment.tools.env.SysConfigManager; import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.ForbiddenException; +import au.com.royalpay.payment.tools.exceptions.NotFoundException; import au.com.royalpay.payment.tools.exceptions.ServerErrorException; import au.com.royalpay.payment.tools.locale.LocaleSupport; import au.com.royalpay.payment.tools.utils.PasswordUtils; @@ -254,6 +255,22 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { } private void applyerToClient(String username) { + JSONObject sysConfig = sysConfigManager.getSysConfig(); + String arr[] = sysConfig.getString("temp_sub_mch_id").split(","); + String tempSubMerchantId =null; + WeChatPayConfig.Merchant availableMerchant = null; + int errorReCounts = 6; + for (int i = 0; i < errorReCounts; i++) { + try{ + tempSubMerchantId =arr[new Random().nextInt(arr.length)]; + availableMerchant = mpPaymentApi.determineMerchant(tempSubMerchantId); + i=errorReCounts; + }catch (Exception e){ + } + } + if(availableMerchant==null){ + throw new BadRequestException("System is busy Please try again"); + } Date now = new Date(); JSONObject param = new JSONObject(); param.put("begin_time", DateFormatUtils.format(now, "YYYYMMdd")); @@ -265,11 +282,10 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { } JSONObject apply = sysClientPreMapperMapper.findByUserName(username); - JSONObject sysConfig = sysConfigManager.getSysConfig(); - - String arr[] = sysConfig.getString("temp_sub_mch_id").split(","); - String tempSubMerchantId = arr[new Random().nextInt(arr.length)]; - WeChatPayConfig.Merchant availableMerchant = mpPaymentApi.determineMerchant(tempSubMerchantId); + JSONObject account = clientAccountMapper.findByPhone(apply.getString("contact_phone"), "+61"); + if (account != null) { + throw new ForbiddenException("The user name has been registered"); + } String clientMoniker = generateClientMoniker(); JSONObject sysClient = new JSONObject(); sysClient.put("company_name", apply.getString("company_name")); @@ -306,7 +322,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { JSONObject sysAccount = new JSONObject(); sysAccount.put("username", apply.getString("username")); - sysAccount.put("display_name", apply.getString("username")); + sysAccount.put("display_name", apply.getString("contact_person")); String salt = PasswordUtils.newSalt(); sysAccount.put("salt", salt); sysAccount.put("role", 1); @@ -421,8 +437,12 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { HttpRequestResult result = new HttpRequestGenerator(url, RequestMethod.GET).execute(); if (result.isSuccess()) { banInfo = result.getResponseContentJSONObj(); + if (!banInfo.getBoolean("valid")){ + throw new NotFoundException("BSB Number Not Found"); + } } } catch (URISyntaxException | IOException e) { + throw new ServerErrorException(); } return banInfo; } diff --git a/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java b/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java index a64092c93..339c1fd20 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java @@ -7,6 +7,7 @@ import au.com.royalpay.payment.tools.env.SysConfigManager; import com.alibaba.fastjson.JSONObject; +import org.apache.commons.lang3.StringUtils; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -70,6 +71,9 @@ public class SimpleClientApplyController { @RequestMapping(value = "/info/update/{username}", method = RequestMethod.POST) public void registerCompanyInfo(@PathVariable String username, @RequestBody @Valid ClientPreApplyBean applyBean) { simpleClientApplyService.checkOrGenerateRegisterProcessKey(username,applyBean.getCodeKey()); + if(StringUtils.isNotEmpty(applyBean.getBsb_no().trim())){ + simpleClientApplyService.getBankInfo(applyBean.getBsb_no()); + } simpleClientApplyService.saveOrUpdateApplyInfo(applyBean.insertObject(), username); } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java index 093aa108c..939d22ef6 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java @@ -242,6 +242,10 @@ public interface ClientManager { void changeRetailPaySurcharge(JSONObject account, boolean paySurcharge); + void changeRequireCustinfo(JSONObject account, boolean requireCustinfo); + + void changeRequireRemark(JSONObject account, boolean requireRemark); + void changeSurcharge(JSONObject account,JSONObject device, UpdateSurchargeDTO updateSurchargeDTO); void refusePartner(String clientMoniker, JSONObject manager, String refuse_remark); diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java index 253a8ea90..512addbba 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java @@ -2933,6 +2933,30 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid .processClientConfigModify(new SwitchPermissionModify(account, client.getString("client_moniker"), "retail_surcharge", paySurcharge)); } + @Override + public void changeRequireCustinfo(JSONObject account, boolean requireCustinfo) { + int clientId = account.getIntValue("client_id"); + JSONObject client = getClientInfo(clientId); + if (client == null) { + throw new InvalidShortIdException(); + } + clientModifySupport + .processClientConfigModify(new SwitchPermissionModify(account, client.getString("client_moniker"), "require_custinfo", requireCustinfo)); + + } + + @Override + public void changeRequireRemark(JSONObject account, boolean requireRemark) { + int clientId = account.getIntValue("client_id"); + JSONObject client = getClientInfo(clientId); + if (client == null) { + throw new InvalidShortIdException(); + } + clientModifySupport + .processClientConfigModify(new SwitchPermissionModify(account, client.getString("client_moniker"), "require_remark", requireRemark)); + + } + @Override public void changeSurcharge(JSONObject account, JSONObject device, UpdateSurchargeDTO updateSurchargeDTO) { JSONObject client = clientMapper.findClient(device.getIntValue("client_id")); @@ -3015,6 +3039,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid BigDecimal customerSurchargeRate = new BigDecimal(appClientBean.getCustomerSurchargeRate()).setScale(2, BigDecimal.ROUND_HALF_DOWN); setCustomerSurchargeRate(account, client.getString("client_moniker"), customerSurchargeRate); } + clientInfoCacheSupport.clearClientCache(client_id); } @Override @@ -3530,6 +3555,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (client == null) { throw new InvalidShortIdException(); } + if(client.getIntValue("approve_result")==1){ + throw new BadRequestException("The merchant has been passed"); + } client.putAll(clientConfigService.find(client.getIntValue("client_id"))); // 提交合规启用银行、费率验证 add by Tayl0r 2017/06/13 diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/AuditModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/AuditModify.java index 2e84e79d2..ec3e02f5a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/AuditModify.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/AuditModify.java @@ -62,4 +62,8 @@ public class AuditModify extends ClientModify { public void setApprove_result(Integer approve_result) { this.approve_result = approve_result; } + + public Integer getOpen_status() { + return open_status; + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SettleHourModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SettleHourModify.java index 9112d116b..ba474a4eb 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SettleHourModify.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SettleHourModify.java @@ -10,7 +10,7 @@ import com.alibaba.fastjson.JSONObject; public class SettleHourModify extends ClientConfigModify { private int settle_hour; - public SettleHourModify(JSONObject account, String clientMoniker, int settle_hour) { + public SettleHourModify(JSONObject account, String clientMoniker, Integer settle_hour) { super(account, clientMoniker); this.settle_hour = settle_hour; } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java index e1eb68b66..ce2466929 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java @@ -342,6 +342,18 @@ public class PartnerViewController { clientManager.changeRetailPaySurcharge(account, pass.getBooleanValue("retail_surcharge")); } + @PartnerMapping(value = "/require_custinfo", method = RequestMethod.PUT) + @ResponseBody + public void changeRequireCustinfo(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { + clientManager.changeRequireCustinfo(account, pass.getBooleanValue("require_custinfo")); + } + + @PartnerMapping(value = "/require_remark", method = RequestMethod.PUT) + @ResponseBody + public void changeRequireRemark(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { + clientManager.changeRequireRemark(account, pass.getBooleanValue("require_remark")); + } + @PartnerMapping(value = "/sign_events", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) @ResponseBody @@ -404,11 +416,12 @@ public class PartnerViewController { clientManager.sendVerifyEmail(account.getJSONObject("client"),account.getString("account_id")); } - @PartnerMapping(value = "/update/partnerInfo", method = RequestMethod.PUT) + @PartnerMapping(value = "/update/partnerInfo", method = RequestMethod.PUT,roles = PartnerRole.ADMIN) @ResponseBody public void updatePartnerInfo(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account,@RequestBody ClientRegisterInfo info) { JSONObject client = account.getJSONObject("client"); - if (client.getIntValue("approve_result") != 1 && client.getIntValue("source") == 4){ + + if (client.getIntValue("approve_result") != 1){ clientManager.updateClientRegisterInfo(null,account.getString("client_moniker"),info); }else { throw new BadRequestException("已通过审核,暂不能提交和修改"); diff --git a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.xml index e930ab947..8213b5ba3 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.xml @@ -316,6 +316,7 @@ ifnull(sum(CASE WHEN s.channel = 'AlipayOnline' THEN s.total ELSE 0 END),0) alipayonlineamount, ifnull(sum(CASE WHEN s.channel = 'AlipayOnline' THEN s.orders ELSE 0 END),0) alipayonline_order_count FROM statistics_customer_order s + LEFT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1 ]]> s.client_id != 0 @@ -358,12 +359,12 @@ + + + \ No newline at end of file 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 f065eda02..022866156 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 @@ -797,19 +797,19 @@ - select COUNT(DISTINCT client_id) traded_clients - FROM sys_clients_customers + select COUNT(DISTINCT s.client_id) traded_clients + FROM sys_clients_customers s + LEFT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1 - and last_payment_time >= #{begin} - and last_payment_time <= #{end} + and s.last_payment_time >= #{begin} + and s.last_payment_time <= #{end} + and c.org_id=#{org_id} + and c.org_id in + #{org_id} \ No newline at end of file diff --git a/src/main/ui/citypartner_register.html b/src/main/ui/citypartner_register.html index f64859661..ba9a34360 100644 --- a/src/main/ui/citypartner_register.html +++ b/src/main/ui/citypartner_register.html @@ -194,7 +194,7 @@
- +

联系人: Locky Ge

Phone: +61 03 9448 8865

Email: info@royalpay.com.au

diff --git a/src/main/ui/data/rp_industry_apply.json b/src/main/ui/data/rp_industry_apply.json new file mode 100644 index 000000000..78d4b9f5d --- /dev/null +++ b/src/main/ui/data/rp_industry_apply.json @@ -0,0 +1,188 @@ +[ + { + "children": [ + { + "children": [], + "label": "机票 Plane ticket", + "mccCode": "10001" + }, + { + "children": [], + "label": "旅游行业 tourist industry", + "mccCode": "10002" + }, + { + "children": [], + "label": "私人定制旅游 Customized travel", + "mccCode": "10003" + }, + { + "children": [], + "label": "租车 Car Rental", + "mccCode": "10004" + }, + { + "children": [], + "label": "巴士 Bus", + "mccCode": "10005" + } + ], + "label": "旅游出行 Tourism trips", + "mccCode": "1" + }, + { + "children": [ + { + "children": [], + "label": "饭店 Restaurant", + "mccCode": "20001" + }, + { + "children": [], + "label": "奶茶店 Milk tea shop", + "mccCode": "20002" + }, + { + "children": [], + "label": "烧烤 BBQ", + "mccCode": "20003" + }, + { + "children": [], + "label": "火锅 Chafing dish", + "mccCode": "20004" + }, + { + "children": [], + "label": "咖啡 Coffee", + "mccCode": "20005" + }, + { + "children": [], + "label": "酒吧 Bar", + "mccCode": "20006" + } + ], + "label": "餐饮 Food and beverage industry", + "mccCode": "2" + }, + { + "children": [ + { + "children": [], + "label": "公众号服务商 Office Account Provider", + "mccCode": "50001" + }, + { + "children": [], + "label": "各种媒体类宣传 Media", + "mccCode": "50002" + } + ], + "label": "传媒 media industry", + "mccCode": "5" + }, + { + "children": [ + { + "label": "超市 Supermarket", + "mccCode": "70001" + }, + { + "children": [], + "label": "服装店 Clothes shop", + "mccCode": "70002" + }, + { + "children": [], + "label": "鞋店 Shoe shop", + "mccCode": "70003" + },{ + "children": [], + "label": "箱包 Bags", + "mccCode": "70005" + } + ], + "label": "零售 Retail", + "mccCode": "7" + }, + { + "children": [ + { + "children": [], + "label": "桌游吧 Board Game", + "mccCode": "80001" + }, + { + "children": [], + "label": "网吧 Net Bar", + "mccCode": "80007" + } + ], + "label": "休闲娱乐 Leisure entertainment", + "mccCode": "8" + }, + { + "children": [ + { + "children": [], + "label": "摄影 Photography", + "mccCode": "90001" + }, + { + "children": [], + "label": "通讯运营商 Communication operators", + "mccCode": "90003" + }, + { + "children:":[], + "label":"软件服务 Software maintenance", + "mccCode":"90005" + } + ], + "label": "其他服务类 Other Services", + "mccCode": "9" + }, + { + "children": [ + { + "children": [], + "label": "酒店 Hotel", + "mccCode": "100001" + }, + { + "children": [], + "label": "汽车旅馆 Motel", + "mccCode": "100002" + } + ], + "label": "酒店 Hotel", + "mccCode": "10" + }, + { + "children": [ + { + "children": [], + "label": "代购 Daigou", + "mccCode": "110001" + }, + { + "children": [], + "label": "物流(大宗出口贸易) Logistics", + "mccCode": "110002" + }, + { + "children": [], + "label": "红酒出口 Red wine exports", + "mccCode": "110003" + }, + { + "children": [], + "label": "综合电商 e-Commerce", + "mccCode": "110004" + } + ], + "label": "出口贸易 Export Business", + "mccCode": "11" + } +] \ No newline at end of file diff --git a/src/main/ui/static/payment/partner/partner.js b/src/main/ui/static/payment/partner/partner.js index e4fe52ed7..b35da3b96 100644 --- a/src/main/ui/static/payment/partner/partner.js +++ b/src/main/ui/static/payment/partner/partner.js @@ -15,6 +15,15 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct return $http.get('/client/partner_info'); }] } + }).state('edit', { + url: '/edit', + templateUrl: '/static/payment/partner/templates/client_partner_edit.html', + controller: 'clientPartnerEditCtrl', + resolve: { + partner: ['$http', function ($http) { + return $http.get('/client/partner_info'); + }] + } }).state('basic.payment_info', { url: '/payment', templateUrl: '/static/payment/partner/templates/client_payment_info.html', @@ -207,6 +216,112 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct }); } }]); + app.controller('clientPartnerEditCtrl', ['$scope', '$http', 'commonDialog','stateMap','countryMap','partner','$state','Upload',function ($scope, $http, commonDialog,stateMap,countryMap,partner,$state,Upload) { + $scope.partner = partner.data; + $scope.states = stateMap.configs(); + $scope.countries = countryMap.configs(); + + $scope.uploadLogo = function (file) { + if (file != null) { + $scope.logoProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.logoProgress; + $scope.partner.logo_id = resp.data.fileid; + $scope.partner.logo_url = resp.data.url; + }, function (resp) { + delete $scope.logoProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + }; + + $scope.uploadShopPhoto = function (file) { + if (file != null) { + $scope.shopPhotoProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.shopPhotoProgress; + $scope.partner.company_photo = resp.data.url; + }, function (resp) { + delete $scope.shopPhotoProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + }; + + $scope.uploadStorePhoto = function (file) { + if (file != null) { + $scope.storePhotoProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.storePhotoProgress; + $scope.partner.store_photo = resp.data.url; + }, function (resp) { + delete $scope.storePhotoProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + }; + + $scope.updatePartner = function (form) { + if (form.$invalid) { + angular.forEach(form, function (item, key) { + if (key.indexOf('$') < 0) { + item.$dirty = true; + } + }); + return; + } + if (!$scope.partner.logo_url) { + alert("Logo is necessary!"); + return; + } + if($scope.partner.partner_type == 'photo'){ + if (!$scope.partner.company_photo) { + alert('Shop Photo1 is necessary'); + return; + } + if (!$scope.partner.store_photo) { + alert('Shop Photo2 is necessary'); + return; + } + } + + var content = ''; + $http.put('/client/partner_info/update/partnerInfo', $scope.partner).then(function () { + if (content != '') { + commonDialog.alert({ + title: 'Warning', + content: content, + type: 'error' + }); + } else { + commonDialog.alert({ + title: 'Success', + content: 'Update partner information successfully', + type: 'success' + }); + } + $state.go('basic', {reload: true}); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) + }); + }; + + }]); app.controller('clientComplianceFilesCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file', function ($scope, $http, $rootScope, commonDialog, $state, Upload, file) { $scope.file = file.data || {}; @@ -512,6 +627,42 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct }) }) } + $scope.toggleRequireCustInfo = function () { + if (!$scope.paymentInfo) { + return; + } + if (!$scope.ctrl.require_custinfo) { + $scope.ctrl.require_custinfo = true; + return; + } + $http.put('/client/partner_info/require_custinfo', {require_custinfo: $scope.paymentInfo.require_custinfo}).then(function () { + + }, function (resp) { + commonDialog.alert({ + title: 'failed to change require customer Info permission status', + content: resp.data.message, + type: 'error' + }) + }) + }; + $scope.toggleRequireRemark = function () { + if (!$scope.paymentInfo) { + return; + } + if (!$scope.ctrl.require_remark) { + $scope.ctrl.require_remark = true; + return; + } + $http.put('/client/partner_info/require_remark', {require_remark: $scope.paymentInfo.require_remark}).then(function () { + + }, function (resp) { + commonDialog.alert({ + title: 'failed to change require remark permission status', + content: resp.data.message, + type: 'error' + }) + }) + }; }]); app.controller('clientPaymentMaterialCtrl', ['$scope', '$http', 'partner', function ($scope, $http, partner) { $scope.paymentInfo = partner.data; diff --git a/src/main/ui/static/payment/partner/templates/client_partner_detail.html b/src/main/ui/static/payment/partner/templates/client_partner_detail.html index 9eb3a8814..ef00c50bd 100644 --- a/src/main/ui/static/payment/partner/templates/client_partner_detail.html +++ b/src/main/ui/static/payment/partner/templates/client_partner_detail.html @@ -48,6 +48,9 @@
Partner Basic Information + + Edit +
@@ -173,6 +176,41 @@
+
+
Alipay Information   (Optional)
+
+
+
+ +
+

+
+
+
+ +
+

+
+
+
+ +
+

+
+
+
+ +
+

+
+
+
+
+
Partner Contact Information
diff --git a/src/main/ui/static/payment/partner/templates/client_partner_edit.html b/src/main/ui/static/payment/partner/templates/client_partner_edit.html new file mode 100644 index 000000000..aa1c5e37e --- /dev/null +++ b/src/main/ui/static/payment/partner/templates/client_partner_edit.html @@ -0,0 +1,355 @@ + +
+

+ +
+ +
+
+
+
+
+
Partner Basic Information
+
+
+
+ +
+

+
+
+
+ +
+

+
+
+
+ +
+

+
+
+
+ +
+

+
+
+
+ +
+

+
+
+
+ +
+
+ +
+ + +
+
+
+ +
+

+
+
+
+ +
+

+
+
+
+ +
+ +

If the partner is a offline shop then a photo of shop is + required while an online store shall choose company website

+

+ 只要有可能产生线下交易(商户静态码、POS),就必须上传照片,否则支付宝会禁止交易

+
+

Required Field

+
+
+
+
+ +
+
1:  + +
+ + +
+
+
2:  + +
+ + +
+
+
+ +
+ +
+

Required Field

+

Less Than 200 + Characters(including symbols and spaces)

+
+
+
+
+ +
+ +
+

Required Field

+

Less Than 20 Characters

+
+
+
+
+ +
+ +
+

Less Than 200 + Characters(including symbols and spaces)

+
+
+
+ +
+ +
+ +
+

Less Than 200 + Characters(including symbols and spaces)

+
+
+
+
+
+
+ +
+
Alipay Information   (Optional)
+
+
+
+ +
+ +

+ eg:Monday-Friday 09:00-20:00,Saturday-Sunday 10:00-22:00

+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +

eg:https://www.baidu.com

+
+
+
+
+
+ +
+
Contact Information
+
+
+
+ +
+ +
+

Required Field

+

Less Than 50 + Characters(including symbols and spaces)

+
+
+
+
+ +
+ +
+
+

Required Field

+

Less Than 20 + Characters(including symbols and spaces)

+
+
+
+ +
+ +
+
+

Required Field

+

Less Than 50 + Characters(including symbols and spaces)

+
+
+
+
+
+ + +
+
Address Information
+
+
+
+ +
+ +
+

Less Than 200 + Characters(including symbols and spaces)

+
+
+
+
+ +
+ +
+

Less Than 50 + Characters(including symbols and spaces)

+
+
+
+
+ +
+ +
+

Less Than 10 + Characters(including symbols and spaces)

+
+
+
+
+ +
+ +
+

Required Field

+
+
+
+
+ +
+ +
+

Less Than 20 + Characters(including symbols and spaces)

+

Required Field

+
+
+
+
+
+
+ +
+ + Back +
+
+
+
+
\ No newline at end of file diff --git a/src/main/ui/static/payment/partner/templates/client_payment_info.html b/src/main/ui/static/payment/partner/templates/client_payment_info.html index 674369685..a9b00fb40 100644 --- a/src/main/ui/static/payment/partner/templates/client_payment_info.html +++ b/src/main/ui/static/payment/partner/templates/client_payment_info.html @@ -145,6 +145,28 @@
+
+
Order Config
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
Payment Page