diff --git a/pom.xml b/pom.xml index c7138d8ff..6552b8a56 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,6 @@ jpinyin 1.1.7 - au.com.royalpay.payment bestpay-core diff --git a/src/document/cn/apis.js b/src/document/cn/apis.js index ff0a01a93..5fbbf7c6e 100644 --- a/src/document/cn/apis.js +++ b/src/document/cn/apis.js @@ -878,7 +878,7 @@ * */ /** - * @api {PUT} /api/v1.0/customs/partners/{partner_code}/declare/query/{client_report_id} 创建报关单 + * @api {PUT} /api/v1.0/customs/partners/{partner_code}/declare/report/{client_report_id} 创建报关单 * @apiName declare_report * @apiDescription * 用于商户提交海关需要的订单附件信息。仅支持微信和支付宝,微信只支持一个月内的支付订单进行报关申请。 diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppMerchantBean.java b/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppMerchantBean.java new file mode 100644 index 000000000..6f7dda5d6 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppMerchantBean.java @@ -0,0 +1,480 @@ +package au.com.royalpay.payment.manage.appclient.beans; + +import au.com.royalpay.payment.core.exceptions.ParamInvalidException; +import com.alibaba.fastjson.JSONObject; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.time.DateUtils; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; + +public class AppMerchantBean { + private final DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + private String textType; + private String searchText; + private String client_moniker; + private String state; + private String suburb; + private String short_name; + private String sub_merchant_id; + private String org_id; + private String org_ids; + private String bd; + private String business_structure; + private String industry; + private Integer clean_day; + private String bd_city; + private String surcharge_start_rate; + private String surcharge_end_rate; + private String create_start_time; + private String approve_start_time; + private String create_end_time; + private String approve_end_time; + private String transaction_start_time; + private String transaction_end_time; + private boolean approving = false; + private int page = 1; + private int limit = 10; + private boolean onlyMe = false; + private boolean tempMchId = false; + private boolean quickPass = false; + private boolean greenChannel = false; + private boolean greenChannelBdTodo = false; + private boolean pass = false; + private boolean completed_contract = false; + private boolean apply_to_back = false; + private boolean bd_upload_material = false; + private boolean is_valid = false; + private String merchant_id; + private int status; + + public String getClient_moniker() { + return StringUtils.isEmpty(client_moniker) ? null : client_moniker; + } + + public void setClient_moniker(String client_moniker) { + this.client_moniker = client_moniker; + } + + public String getShort_name() { + return short_name; + } + + public void setShort_name(String short_name) { + this.short_name = short_name; + } + + public String getSub_merchant_id() { + return sub_merchant_id; + } + + public void setSub_merchant_id(String sub_merchant_id) { + this.sub_merchant_id = sub_merchant_id; + } + + public int getPage() { + return page; + } + + public void setPage(int page) { + this.page = page; + } + + public int getLimit() { + return limit; + } + + public void setLimit(int limit) { + this.limit = limit; + } + + public JSONObject toJsonParam() { + JSONObject param = new JSONObject(); + if (StringUtils.isNotBlank(client_moniker)) { + param.put("client_moniker", getClient_moniker()); + } + if (StringUtils.isNotBlank(short_name)) { + param.put("short_name", short_name); + } + if (StringUtils.isNotBlank(sub_merchant_id)) { + param.put("sub_merchant_id", sub_merchant_id); + } + if (StringUtils.isNotBlank(state)) { + param.put("state", state); + } + if (StringUtils.isNotBlank(suburb)) { + param.put("suburb", suburb); + } + if (StringUtils.isNotBlank(searchText)) { + param.put("search_text", searchText); + if (StringUtils.isNotBlank(textType)) { + param.put("text_type", textType); + } else { + param.put("text_type", "all"); + } + } + if (approving) { + param.put("approving", true); + } + if (org_id != null) { + param.put("org_id", org_id); + } + if (org_ids != null) { + param.put("org_ids", org_ids); + } + if (StringUtils.isNotBlank(bd)) { + param.put("bd_user", bd); + } + if (quickPass){ + param.put("quickPass",true); + } + if (greenChannel){ + param.put("greenChannel",true); + } + if (business_structure!=null && !business_structure.equals("")){ + param.put("business_structure",business_structure); + } + if (industry!=null && !industry.equals("")){ + param.put("industry",industry); + } + if (bd_city!=null && !bd_city.equals("")){ + param.put("bd_city",bd_city); + } + if (clean_day!=null){ + param.put("clean_day",clean_day); + } + if (surcharge_start_rate!=null) { + param.put("surcharge_start_rate",surcharge_start_rate); + } + if (surcharge_end_rate!=null){ + param.put("surcharge_end_rate",surcharge_end_rate); + } + if (transaction_start_time != null) { + try { + param.put("transaction_start_time", format.parse(transaction_start_time)); + } catch (ParseException e) { + throw new ParamInvalidException("transaction_start_time", "error.payment.valid.invalid_date_format"); + } + } + if (transaction_end_time != null) { + try { + param.put("transaction_end_time", DateUtils.addDays(format.parse(transaction_end_time), 1)); + } catch (ParseException e) { + throw new ParamInvalidException("transaction_end_time", "error.payment.valid.invalid_date_format"); + } + } + if (create_start_time != null) { + try { + param.put("create_start_time", format.parse(create_start_time)); + } catch (ParseException e) { + throw new ParamInvalidException("create_start_time", "error.payment.valid.invalid_date_format"); + } + } + if (create_end_time != null) { + try { + param.put("create_end_time", DateUtils.addDays(format.parse(create_end_time), 1)); + } catch (ParseException e) { + throw new ParamInvalidException("create_end_time", "error.payment.valid.invalid_date_format"); + } + } + if (approve_start_time != null) { + try { + param.put("approve_start_time", format.parse(approve_start_time)); + } catch (ParseException e) { + throw new ParamInvalidException("approve_start_time", "error.payment.valid.invalid_date_format"); + } + } + if (approve_end_time != null) { + try { + param.put("approve_end_time", DateUtils.addDays(format.parse(approve_end_time), 1)); + } catch (ParseException e) { + throw new ParamInvalidException("approve_end_time", "error.payment.valid.invalid_date_format"); + } + } + if (greenChannelBdTodo){ + param.put("greenChannelBdTodo",true); + } + if (is_valid){ + param.put("is_valid",true); + } + if (pass){ + param.put("pass",true); + } + if (completed_contract){ + param.put("completed_contract",true); + } + if (apply_to_back){ + param.put("apply_to_back",true); + } + if (bd_upload_material){ + param.put("bd_upload_material",true); + } + if (merchant_id != null){ + param.put("merchant_id",merchant_id); + } + return param; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getTextType() { + return textType; + } + + public void setTextType(String textType) { + this.textType = textType; + } + + public String getSearchText() { + return searchText; + } + + public void setSearchText(String searchText) { + this.searchText = searchText; + } + + public String getOrg_id() { + return org_id; + } + + public void setOrg_id(String org_id) { + this.org_id = org_id; + } + + public void setOnlyMe(boolean onlyMe) { + this.onlyMe = onlyMe; + } + + public boolean getOnlyMe() { + return onlyMe; + } + + public boolean isTempMchId() { + return tempMchId; + } + + public void setTempMchId(boolean tempMchId) { + this.tempMchId = tempMchId; + } + + public String getBusiness_structure() { + return business_structure; + } + + public void setBusiness_structure(String business_structure) { + this.business_structure = business_structure; + } + + public String getIndustry() { + return industry; + } + + public void setIndustry(String industry) { + this.industry = industry; + } + + public Integer getClean_day() { + return clean_day; + } + + public void setClean_day(Integer clean_day) { + this.clean_day = clean_day; + } + + public String getBd_city() { + return bd_city; + } + + public void setBd_city(String bd_city) { + this.bd_city = bd_city; + } + + public String getCreate_start_time() { + return create_start_time; + } + + public void setCreate_start_time(String create_start_time) { + this.create_start_time = create_start_time; + } + + public String getApprove_start_time() { + return approve_start_time; + } + + public void setApprove_start_time(String approve_start_time) { + this.approve_start_time = approve_start_time; + } + + public String getCreate_end_time() { + return create_end_time; + } + + public void setCreate_end_time(String create_end_time) { + this.create_end_time = create_end_time; + } + + public String getApprove_end_time() { + return approve_end_time; + } + + public void setApprove_end_time(String approve_end_time) { + this.approve_end_time = approve_end_time; + } + + public String getSurcharge_start_rate() { + return surcharge_start_rate; + } + + public void setSurcharge_start_rate(String surcharge_start_rate) { + this.surcharge_start_rate = surcharge_start_rate; + } + + public String getTransaction_start_time() { + return transaction_start_time; + } + + public void setTransaction_start_time(String transaction_start_time) { + this.transaction_start_time = transaction_start_time; + } + + public String getTransaction_end_time() { + return transaction_end_time; + } + + public void setTransaction_end_time(String transaction_end_time) { + this.transaction_end_time = transaction_end_time; + } + + public String getSurcharge_end_rate() { + return surcharge_end_rate; + } + + public void setSurcharge_end_rate(String surcharge_end_rate) { + this.surcharge_end_rate = surcharge_end_rate; + } + + public boolean isOnlyMe() { + return onlyMe; + } + + public boolean isApproving() { + return approving; + } + + public void setApproving(boolean approving) { + this.approving = approving; + } + + public boolean isQuickPass() { + return quickPass; + } + + public void setQuickPass(boolean quickPass) { + this.quickPass = quickPass; + } + + public boolean isGreenChannel() { + return greenChannel; + } + + public void setGreenChannel(boolean greenChannel) { + this.greenChannel = greenChannel; + } + public void setGreenChannelAndBDtodo(boolean bDTodo){ + this.greenChannelBdTodo = bDTodo; + } + public void setIs_valid(boolean is_valid){ + this.is_valid=is_valid; + } + + public DateFormat getFormat() { + return format; + } + + public boolean isGreenChannelBdTodo() { + return greenChannelBdTodo; + } + + public void setGreenChannelBdTodo(boolean greenChannelBdTodo) { + this.greenChannelBdTodo = greenChannelBdTodo; + } + + public boolean isPass() { + return pass; + } + + public void setPass(boolean pass) { + this.pass = pass; + } + + public boolean isCompleted_contract() { + return completed_contract; + } + + public void setCompleted_contract(boolean completed_contract) { + this.completed_contract = completed_contract; + } + + public boolean isApply_to_back() { + return apply_to_back; + } + + public void setApply_to_back(boolean apply_to_back) { + this.apply_to_back = apply_to_back; + } + + public boolean isBd_upload_material() { + return bd_upload_material; + } + + public void setBd_upload_material(boolean bd_upload_material) { + this.bd_upload_material = bd_upload_material; + } + + public boolean isIs_valid() { + return is_valid; + } + + public String getOrg_ids() { + return org_ids; + } + + public void setOrg_ids(String org_ids) { + this.org_ids = org_ids; + } + + public void setBd(String bd) { + this.bd = bd; + } + + public String getMerchant_id() { + return merchant_id; + } + + public void setMerchant_id(String merchant_id) { + this.merchant_id = merchant_id; + } + + public String getSuburb() { + return suburb; + } + + public void setSuburb(String suburb) { + this.suburb = suburb; + } + + public void setStatus(int status) { + this.status = status; + } + + public int getStatus() { + return status; + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java new file mode 100644 index 000000000..515113723 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java @@ -0,0 +1,79 @@ +package au.com.royalpay.payment.manage.appclient.core; + +import au.com.royalpay.payment.manage.appclient.beans.AppMerchantBean; +import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo; +import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo; +import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo; +import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; +import au.com.royalpay.payment.manage.product.beans.ProductBean; +import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean; +import com.alibaba.fastjson.JSONObject; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +public interface ManageAppService { + + void updateDevToken(JSONObject device, String devToken); + + void updateDevTokenStatus(String devId, int status); + + JSONObject getDevTokenByDevId(String dev_id); + + void sign_out(JSONObject device); + + void changeAccountPassword(JSONObject device, ChangePwdBean change, String manager_id); + + List getReferrerList(JSONObject device); + + JSONObject registerClient(JSONObject device, ClientRegisterInfo registery); + + void updateClientRegisterInfo(JSONObject device, String clientMoniker, ClientRegisterInfo info); + + void disableClientRegisterInfo(JSONObject device, String clientMoniker); + + JSONObject listPartners(JSONObject device, AppMerchantBean query); + + JSONObject clientDetail(JSONObject device, String clientMoniker); + + JSONObject clientBankAccount(JSONObject device, String clientMoniker); + + void saveBankAccount(JSONObject device, String clientMoniker, BankAccountInfo bankAccount); + + void newConfigRate(JSONObject device, String clientMoniker, JSONObject config); + + void commitToGreenChannel(JSONObject device, String clientMoniker); + + void commitToDoAgreeFile(JSONObject device, String clientMoniker); + + void commitToCompliance(JSONObject device, String clientMoniker); + + JSONObject getAuthFiles(JSONObject device, String clientMoniker); + + void uploadAuthFiles(JSONObject device, String clientMoniker, ClientAuthFilesInfo filesInfo); + + Map> getRates(JSONObject device, String clientMoniker); + + JSONObject getConfigRates(JSONObject device); + + JSONObject getNewVersion(JSONObject device); + + JSONObject getCommons(JSONObject device); + + List getOrgPrizeList(JSONObject device); + + JSONObject getBdConfigKpi(JSONObject device); + + List getBdPrizeList(JSONObject device); + + JSONObject getPrizeRulesUrl(JSONObject device); + + JSONObject listProduct(JSONObject device, ProductBean productBean); + + void saveProduct(JSONObject device, ProductBean productBean); + + void updateProduct(JSONObject device, ProductBean productBean); + + void deleteProduct(JSONObject device, String commodity_id); +} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java new file mode 100644 index 000000000..24b2f674f --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java @@ -0,0 +1,433 @@ +package au.com.royalpay.payment.manage.appclient.core.impls; + +import au.com.royalpay.payment.manage.appclient.beans.AppMerchantBean; +import au.com.royalpay.payment.manage.appclient.core.ManageAppService; +import au.com.royalpay.payment.manage.bdprize.core.BDPrizeService; +import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper; +import au.com.royalpay.payment.manage.mappers.financial.FinancialBDPrizeLogMapper; +import au.com.royalpay.payment.manage.mappers.financial.FinancialBDPrizeRecordMapper; +import au.com.royalpay.payment.manage.mappers.financial.FinancialPartnerCommissionMapper; +import au.com.royalpay.payment.manage.mappers.system.ClientMapper; +import au.com.royalpay.payment.manage.mappers.system.ManageDeviceTokenMapper; +import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; +import au.com.royalpay.payment.manage.mappers.system.OrgMapper; +import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo; +import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo; +import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo; +import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; +import au.com.royalpay.payment.manage.merchants.core.ClientManager; +import au.com.royalpay.payment.manage.product.beans.ProductBean; +import au.com.royalpay.payment.manage.product.core.ClientProduct; +import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean; +import au.com.royalpay.payment.manage.signin.core.ManagerAccountsService; +import au.com.royalpay.payment.manage.signin.core.SignInAccountService; +import au.com.royalpay.payment.tools.device.DeviceSupport; +import au.com.royalpay.payment.tools.device.ManageDeviceSupport; +import au.com.royalpay.payment.tools.device.support.DeviceRegister; +import au.com.royalpay.payment.tools.env.PlatformEnvironment; +import au.com.royalpay.payment.tools.exceptions.ForbiddenException; +import com.alibaba.fastjson.JSONObject; +import com.github.miemiedev.mybatis.paginator.domain.PageBounds; +import org.apache.commons.lang3.time.DateFormatUtils; +import org.apache.ibatis.annotations.Param; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +@Service +public class ManageAppServiceImp implements ManageAppService { + + @Resource + private ManageDeviceSupport manageDeviceSupport; + @Resource + private OrgMapper orgMapper; + @Resource + private ManagerMapper managerMapper; + @Resource + private ClientManager clientManager; + @Resource + private ClientMapper clientMapper; + @Resource + private SignInAccountService signInAccountService; + @Resource + private ManageDeviceTokenMapper manageDeviceTokenMapper; + @Resource + private FinancialBDPrizeRecordMapper financialBDPrizeRecordMapper; + @Resource + private FinancialBDPrizeLogMapper financialBDPrizeLogMapper; + @Resource + private FinancialPartnerCommissionMapper financialPartnerCommissionMapper; + @Resource + private BDPrizeService bdPrizeService; + @Resource + private FinancialBDConfigMapper financialBDConfigMapper; + @Resource + private ClientProduct clientProduct; + + + @Override + public void updateDevToken(JSONObject device, String devToken) { + manageDeviceSupport.updateDeviceMessageToken(device, devToken); + } + + @Override + public void sign_out(JSONObject device) { + String clientType = device.getString("client_type"); + DeviceRegister register = manageDeviceSupport.findRegister(clientType); + register.manageSignout(device); + } + + @Override + public void changeAccountPassword(JSONObject device, ChangePwdBean change, String manager_id) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + // JSONObject client = signInAccountService.getClient(account_id); + if (!manager_id.equals(device.getString("manager_id"))) { + throw new ForbiddenException("You have no permission"); + } + signInAccountService.changeManagerPassword(device, change); + updateDevTokenStatus(device.getString("dev_id"), 0); + } + + @Override + public List getReferrerList(JSONObject device) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + return orgMapper.listOrgs(1,new PageBounds()); + } + + @Override + public JSONObject registerClient(JSONObject device, ClientRegisterInfo registery) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + return clientManager.registerClient(null, registery, manager); + } + + @Override + public void updateClientRegisterInfo(JSONObject device, String clientMoniker, ClientRegisterInfo info) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + clientManager.updateClientRegisterInfo(manager, clientMoniker, info); + } + + @Override + public void disableClientRegisterInfo(JSONObject device, String clientMoniker) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + clientManager.disableClient(clientMoniker,manager); + } + + @Override + public JSONObject listPartners(JSONObject device, AppMerchantBean query) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + switch (query.getStatus()) { + case 0: + query.setIs_valid(true); + break; + case 1: + query.setPass(true); + break; + case 2: + query.setApproving(true); + break; + case 3: + query.setCompleted_contract(true); + query.setBd_upload_material(true); + break; + case 4: + break; + case 5: + query.setApply_to_back(true); + break; + case 6: + query.setGreenChannel(true); + break; + case 7: + query.setQuickPass(true); + break; + } + query.setOnlyMe(true); + return clientManager.listClientsByApp(manager, query); + } + + @Override + public JSONObject clientDetail(JSONObject device, String clientMoniker) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + return clientManager.clientDetail(manager, clientMoniker); + } + + @Override + public JSONObject clientBankAccount(JSONObject device, String clientMoniker) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + return clientManager.listClientBankAccounts(manager, clientMoniker); + } + + @Override + public void saveBankAccount(JSONObject device, String clientMoniker, BankAccountInfo bankAccount) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + clientManager.saveBankAccount(manager, clientMoniker, bankAccount); + } + + @Override + public Map> getRates(JSONObject device, String clientMoniker) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + List rates = clientManager.clientRates(clientMoniker, true); + return rates.stream().collect(Collectors.groupingBy(e -> e.getString("rate_name"),HashMap::new,Collectors.toList())); + } + + @Override + public JSONObject getConfigRates(JSONObject device) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + return clientManager.getSysRateConfig(); + } + + @Override + public void newConfigRate(JSONObject device, String clientMoniker, JSONObject config) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + clientManager.newConfigRate(manager, clientMoniker, config); + } + + @Override + public void commitToGreenChannel(JSONObject device, String clientMoniker) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + clientManager.commitToGreenChannel(clientMoniker, manager); + } + + @Override + public void commitToDoAgreeFile(JSONObject device, String clientMoniker) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + clientManager.commitToDoAgreeFile(clientMoniker, manager); + } + + @Override + public void commitToCompliance(JSONObject device, String clientMoniker) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + clientManager.commitToCompliance(clientMoniker, manager); + } + + @Override + public JSONObject getAuthFiles(JSONObject device, String clientMoniker) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + return clientManager.getAuthFiles(manager, clientMoniker); + } + + @Override + public void uploadAuthFiles(JSONObject device, String clientMoniker, ClientAuthFilesInfo filesInfo) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + clientManager.uploadAuthFiles(manager, clientMoniker,filesInfo); + } + + @Override + public void updateDevTokenStatus(String devId, int status) { + JSONObject devTokenObj = getDevTokenByDevId(devId); + if (devTokenObj != null) { + devTokenObj.put("is_valid", status); + manageDeviceTokenMapper.update(devTokenObj); + } + } + + @Override + @Cacheable(value = ":manage_dev_message_token:", key = "#dev_id") + public JSONObject getDevTokenByDevId(String dev_id) { + return manageDeviceTokenMapper.findByDevId(dev_id); + } + + @Override + public JSONObject getNewVersion(JSONObject device) { + String version = device.getString("version"); + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + String newAppVersion = PlatformEnvironment.getEnv().getNewVersion(clientType); + Boolean isUpdate = PlatformEnvironment.getEnv().isAppUpdate(clientType); + String updateContent = PlatformEnvironment.getEnv().getAppUpdateContent(clientType); + int update_type = 0;// 0:不更新 1:更新 2:强制更新 + String[] oldVersion = version.split("\\."); + String[] newVersion = newAppVersion.split("\\."); + JSONObject res = new JSONObject(); + res.put("update_content", updateContent); + for (int i = 0; i < newVersion.length; i++) { + if (Integer.valueOf(newVersion[i]) > Integer.valueOf(oldVersion[i])) { + update_type = 1; + if (isUpdate) { + update_type = 2; + } + res.put("update_type", update_type); + return res; + } else if (Integer.valueOf(newVersion[i]) < Integer.valueOf(oldVersion[i])) { + res.put("update_type", update_type); + return res; + } + } + res.put("update_type", update_type); + return res; + } + + @Override + public JSONObject getCommons(JSONObject device) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + JSONObject countBdClients = clientMapper.countBdApproveClients(manager.getString("manager_id")); + + if (countBdClients == null) { + countBdClients = new JSONObject(); + countBdClients.put("approving", 0); + countBdClients.put("pass", 0); + countBdClients.put("this_months_pass", 0); + } + JSONObject result; + + switch (manager.getIntValue("org_id")) { + case 1: + result = bdCommons(manager); + break; + default: + result = orgCommons(manager); + break; + } + result.putAll(countBdClients); + return result; + } + + private JSONObject bdCommons(JSONObject manager) { + Calendar monthCal = Calendar.getInstance(); + monthCal.setTime(new Date()); + monthCal.set(Calendar.MONTH, (monthCal.get(Calendar.MONTH) - 1)); + Date date = monthCal.getTime(); + JSONObject totalDetail = new JSONObject(); + totalDetail.put("date", DateFormatUtils.format(date, "yyyy-MM")); + totalDetail.put("total_amount", BigDecimal.ZERO); + totalDetail.put("total_prize", BigDecimal.ZERO); + totalDetail.put("total_donation", BigDecimal.ZERO); + totalDetail.put("send_prize", BigDecimal.ZERO); + totalDetail.put("hold_prize", BigDecimal.ZERO); + totalDetail.put("last_punish", BigDecimal.ZERO); + + JSONObject report = financialBDPrizeRecordMapper.getReport(DateFormatUtils.format(date, "yyyy-MM")); + if (report != null) { + totalDetail.putAll(financialBDPrizeLogMapper.findByReportAndBDTotal(report.getString("record_id"), manager.getString("manager_id"))); + } + return totalDetail; + } + + private JSONObject orgCommons(JSONObject manager) { + Calendar monthCal = Calendar.getInstance(); + monthCal.setTime(new Date()); + monthCal.set(Calendar.MONTH, (monthCal.get(Calendar.MONTH) - 1)); + JSONObject total = financialPartnerCommissionMapper.findTotalByOrg(monthCal.get(Calendar.YEAR), monthCal.get(Calendar.MONTH)+1, manager.getString("org_id")); + if (total == null) { + total = new JSONObject(); + total.put("total_amount", BigDecimal.ZERO); + total.put("total_prize", BigDecimal.ZERO); + } + total.put("date", DateFormatUtils.format(monthCal.getTime(), "yyyy-MM")); + return total; + } + + @Override + public List getOrgPrizeList(JSONObject device) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + List orgPrizeList = financialPartnerCommissionMapper.getOrgPrizeList(manager.getString("org_id")); + for (JSONObject params : orgPrizeList) { + params.put("data", financialPartnerCommissionMapper.find(params.getIntValue("year"), params.getIntValue("month"), manager.getString("org_id"))); + } + return orgPrizeList; + } + + @Override + public JSONObject getBdConfigKpi(JSONObject device) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + return financialBDConfigMapper.getBDConfigById(manager.getString("manager_id")); + } + + @Override + public List getBdPrizeList(JSONObject device) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + List listBdPrizeLogByOne = financialBDPrizeLogMapper.listBdPrizeLogByOne(manager.getString("manager_id")); + for (JSONObject log : listBdPrizeLogByOne) { + log.put("data", financialBDPrizeLogMapper.findReportByOne(log.getString("record_id"), manager.getString("manager_id"))); + } + return listBdPrizeLogByOne; + } + + @Override + public JSONObject getPrizeRulesUrl(JSONObject device) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + JSONObject result = new JSONObject(); + if (manager.getIntValue("org_id") == 1) { + result.put("url", "http://192.168.0.49:9002/app/rules/bd"); + } else { + result.put("url", "http://192.168.0.49:9002/app/rules/org"); + } + return result; + } + + @Override + public JSONObject listProduct(JSONObject device, ProductBean productBean) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + return clientProduct.listAllProduct(manager, productBean); + } + + @Override + public void saveProduct(JSONObject device, ProductBean productBean) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + clientProduct.saveProduct(manager, productBean); + } + + @Override + public void updateProduct(JSONObject device, ProductBean productBean) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + clientProduct.updateProduct(manager, productBean); + } + + @Override + public void deleteProduct(JSONObject device, String commodity_id) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + clientProduct.deleteProduct(manager, commodity_id); + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java new file mode 100644 index 000000000..6ceb58eac --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java @@ -0,0 +1,203 @@ +package au.com.royalpay.payment.manage.appclient.web; + +import au.com.royalpay.payment.manage.appclient.beans.AppMerchantBean; +import au.com.royalpay.payment.manage.appclient.core.ManageAppService; +import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo; +import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo; +import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo; +import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; +import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; +import au.com.royalpay.payment.manage.product.beans.ProductBean; +import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean; +import au.com.royalpay.payment.tools.CommonConsts; +import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient; +import au.com.royalpay.payment.tools.device.manageadvise.AppClientController; +import au.com.royalpay.payment.tools.exceptions.BadRequestException; +import au.com.royalpay.payment.tools.http.HttpUtils; +import au.com.royalpay.payment.tools.permission.enums.ManagerRole; +import com.alibaba.fastjson.JSONObject; +import org.apache.commons.lang3.time.DateUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.validation.Errors; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.validation.Valid; +import java.text.ParseException; +import java.util.Date; +import java.util.List; +import java.util.Map; + + +@AppClientController +@RequestMapping("/api/v1.0/manage/app") +public class ManageAppController { + + @Resource + private ManageAppService manageAppService; + @Resource + private AttachmentClient attachmentClient; + + @RequestMapping(value = "/token", method = RequestMethod.PUT) + public void updateDevToken(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, @RequestBody JSONObject token) { + manageAppService.updateDevToken(device, token.getString("devToken")); + } + + @RequestMapping(value = "/sign_out", method = RequestMethod.PUT) + public void signOut(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + manageAppService.sign_out(device); + } + + @RequestMapping(value = "/manager_password/{manager_id}", method = RequestMethod.PUT) + public void changePassword(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, @PathVariable String manager_id, + @RequestBody @Valid ChangePwdBean change, Errors errors) { + HttpUtils.handleValidErrors(errors); + manageAppService.changeAccountPassword(device, change, manager_id); + } + + @RequestMapping(value = "/referrer", method = RequestMethod.GET) + public List getReferrerList(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + return manageAppService.getReferrerList(device); + } + + @RequestMapping(value = "/attachment/files", method = RequestMethod.POST) + public JSONObject uploadImage(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, @RequestParam MultipartFile file) throws Exception { + return attachmentClient.uploadFile(file, false); + } + + @RequestMapping(value = "/merchant/register", method = RequestMethod.POST) + public JSONObject registerPartner(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, @RequestBody @Valid ClientRegisterInfo registery, + Errors errors) { + HttpUtils.handleValidErrors(errors); + return manageAppService.registerClient(device, registery); + } + + @RequestMapping(value = "/merchant/{clientMoniker}/update", method = RequestMethod.PUT) + public void updatePartnerInfo(@PathVariable String clientMoniker, @RequestBody ClientRegisterInfo info, + @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + manageAppService.updateClientRegisterInfo(device, clientMoniker, info); + } + + @RequestMapping(value = "/merchant/{clientMoniker}/delete", method = RequestMethod.PUT) + public void disablePartnerInfo(@PathVariable String clientMoniker, + @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + manageAppService.disableClientRegisterInfo(device, clientMoniker); + } + + @RequestMapping(value = "/merchants", method = RequestMethod.GET) + public JSONObject listPartners(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, AppMerchantBean query) { + return manageAppService.listPartners(device, query); + } + + @RequestMapping(value = "/merchant/{clientMoniker}/detail", method = RequestMethod.GET) + public JSONObject getClientByMoniker(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + return manageAppService.clientDetail(device, clientMoniker); + } + + @RequestMapping(value = "/merchant/{clientMoniker}/bank_account", method = RequestMethod.GET) + public JSONObject getBankAccount(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + return manageAppService.clientBankAccount(device, clientMoniker); + } + + @RequestMapping(value = "/merchant/{clientMoniker}/bank_account", method = RequestMethod.PUT) + public void saveBankAccount(@PathVariable String clientMoniker, @RequestBody @Valid BankAccountInfo bankAccount, Errors errors, + @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + HttpUtils.handleValidErrors(errors); + manageAppService.saveBankAccount(device, clientMoniker, bankAccount); + } + + @RequestMapping(value = "/merchant/{clientMoniker}/rates", method = RequestMethod.GET) + public Map> getRates(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + return manageAppService.getRates(device, clientMoniker); + } + + @RequestMapping(value = "/merchant/rate_config", method = RequestMethod.GET) + public JSONObject getConfigRates(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + return manageAppService.getConfigRates(device); + } + + @RequestMapping(value = "/merchant/{clientMoniker}/rates", method = RequestMethod.POST) + public void newRate(@PathVariable String clientMoniker, @RequestBody JSONObject config, Errors errors, + @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + HttpUtils.handleValidErrors(errors); + manageAppService.newConfigRate(device, clientMoniker, config); + } + + @RequestMapping(value = "/merchant/{clientMoniker}/compliance/green_channel", method = RequestMethod.PUT) + public void commitToGreenChannel(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + manageAppService.commitToGreenChannel(device, clientMoniker); + } + + @RequestMapping(value = "/merchant/{clientMoniker}/make_agree_file", method = RequestMethod.PUT) + public void commitToDoAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + manageAppService.commitToDoAgreeFile(device, clientMoniker); + } + + @RequestMapping(value = "/merchant/{clientMoniker}/to_compliance", method = RequestMethod.PUT) + public void commitToCompliance(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + manageAppService.commitToCompliance(device, clientMoniker); + } + + @RequestMapping(value = "/merchant/{clientMoniker}/file", method = RequestMethod.GET) + public JSONObject getAuthFiles(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + return manageAppService.getAuthFiles(device, clientMoniker); + } + + @RequestMapping(value = "/merchant/{clientMoniker}/file", method = RequestMethod.PUT) + public void uploadAuthFiles(@PathVariable String clientMoniker, @RequestBody ClientAuthFilesInfo filesInfo, @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + manageAppService.uploadAuthFiles(device, clientMoniker, filesInfo); + } + + @RequestMapping(value = "/version", method = RequestMethod.GET) + public JSONObject getAppVersion(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + return manageAppService.getNewVersion(device); + } + + @RequestMapping(value = "/commons", method = RequestMethod.GET) + public JSONObject getCommons(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + return manageAppService.getCommons(device); + } + + @RequestMapping(value = "/org_prize/list", method = RequestMethod.GET) + public List getOrgPrizeList(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + return manageAppService.getOrgPrizeList(device); + } + + @RequestMapping(value = "/bd/kpi", method = RequestMethod.GET) + public JSONObject getBdConfigKpi(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + return manageAppService.getBdConfigKpi(device); + } + + @RequestMapping(value = "/bd/list", method = RequestMethod.GET) + public List getBdPrizeList(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + return manageAppService.getBdPrizeList(device); + } + + @RequestMapping(value = "/prize/rules", method = RequestMethod.GET) + public JSONObject getPrizeRulesUrl(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + return manageAppService.getPrizeRulesUrl(device); + } + + @RequestMapping(value = "/product/list", method = RequestMethod.GET) + public JSONObject listProduct(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, ProductBean productBean) { + return manageAppService.listProduct(device, productBean); + } + + @RequestMapping(value = "/product/save", method = RequestMethod.POST) + public void saveProduct(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device,@RequestBody ProductBean productBean) { + manageAppService.saveProduct(device, productBean); + } + + @RequestMapping(value = "/product/update", method = RequestMethod.PUT) + public void updateProduct(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device,@RequestBody ProductBean productBean) { + manageAppService.updateProduct(device, productBean); + } + + @RequestMapping(value = "/product/delete/{commodity_id}", method = RequestMethod.PUT) + public void deleteProduct(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, @PathVariable String commodity_id) { + manageAppService.deleteProduct(device, commodity_id); + } + +} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java index 2c565e2cb..8366e5454 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java @@ -5,8 +5,11 @@ import au.com.royalpay.payment.manage.appclient.core.RetailAppService; import au.com.royalpay.payment.manage.signin.core.SignInStatusManager; import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.device.DeviceSupport; +import au.com.royalpay.payment.tools.device.ManageDeviceSupport; import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.http.HttpUtils; +import au.com.royalpay.payment.tools.locale.LocaleSupport; +import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.google.code.kaptcha.Producer; @@ -38,6 +41,8 @@ public class RetailValidationController { @Resource private DeviceSupport deviceSupport; @Resource + private ManageDeviceSupport manageDeviceSupport; + @Resource private RetailAppService retailAppService; @RequestMapping(value = "/devices/{devType}/register", method = RequestMethod.POST) @@ -45,6 +50,11 @@ public class RetailValidationController { return deviceSupport.register(devType, registeration); } + @RequestMapping(value = "/devices/{devType}/manage/register", method = RequestMethod.POST) + public JSONObject manageRegister(@RequestBody String registeration, @PathVariable String devType) { + return manageDeviceSupport.register(devType, registeration); + } + @RequestMapping(value = "/sign_in_check", method = RequestMethod.POST) public JSONObject signIn(@RequestBody @Valid RetailLoginInfo loginInfo, Errors errors) { HttpUtils.handleValidErrors(errors); @@ -68,6 +78,35 @@ public class RetailValidationController { return client; } + @RequestMapping(value = "/manage/sign_in_check", method = RequestMethod.POST) + public JSONObject manageSignIn(@RequestBody @Valid RetailLoginInfo loginInfo, Errors errors) { + HttpUtils.handleValidErrors(errors); + String codeValue = signInStatusManager.getVerifyCode(loginInfo.getCaptchaKey()); + if (codeValue == null) { + throw new BadRequestException("Verification code has expired"); + } + if (!codeValue.equals(loginInfo.getVerifyCode())) { + throw new BadRequestException("Verification code is not correct"); + } else { + signInStatusManager.deleteVerifyCodeKey(loginInfo.getCaptchaKey()); + } + String signKey = signInStatusManager.managerSignIn(loginInfo.toLoginInfo()); + JSONObject manager = signInStatusManager.getCurrentManager(signKey); + manager = JSON.parseObject(manager.toJSONString()); + if (!ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { + throw new BadRequestException(LocaleSupport.localeMessage("error.login.password")); + } +// if (loginInfo.getDevId() != null) { +// deviceSupport.validDeviceWithClient(manager, loginInfo.getDevId()); +// } + manager.put("sign_key", signKey); + manager.remove("available_func_ids"); + manager.remove("available_func_names"); + manager.remove("modules"); + manager.remove("module_names"); + return manager; + } + @RequestMapping(value = "/wechat_app_signin", method = RequestMethod.POST) public JSONObject partnerWechatAppSignIn(@RequestBody JSONObject data) { JSONObject res = signInStatusManager.partnerWechatAppSignIn(data.getString("code")); diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/MangerAppRulesController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/MangerAppRulesController.java new file mode 100644 index 000000000..81a1ca326 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/dev/web/MangerAppRulesController.java @@ -0,0 +1,37 @@ +package au.com.royalpay.payment.manage.dev.web; + +import au.com.royalpay.payment.manage.bdprize.core.BDPrizeService; +import com.alibaba.fastjson.JSONObject; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.ModelAndView; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; + +@RestController +@RequestMapping("/app/rules") +public class MangerAppRulesController { + + @Resource + private BDPrizeService bdPrizeService; + + @RequestMapping(value = "/org", method = RequestMethod.GET) + public ModelAndView hrefOrgRules() { + ModelAndView view = new ModelAndView("app/org_prize_rules"); + return view; + } + + @RequestMapping(value = "/bd", method = RequestMethod.GET) + public ModelAndView hrefBdRules() { + ModelAndView view = new ModelAndView("app/bd_prize_rules"); + return view; + } + + @RequestMapping(value = "/bd/config", method = RequestMethod.GET) + public List bdConfigRates() { + return bdPrizeService.getRateConfig(); + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.java index ff541b62a..8b4c76832 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.java @@ -26,6 +26,8 @@ public interface FinancialBDConfigMapper { List listBDConfig(); + JSONObject getBDConfigById(@Param("manager_id") String manager_id); + List listGroupBds(@Param("bd_group") String bd_group); BigDecimal getGroupAmount(@Param("bd_group") String bd_group, @Param("record_id") String record_id, @Param("channel") String channel); diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDPrizeLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDPrizeLogMapper.java index cbd0e1005..c49a8cedf 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDPrizeLogMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDPrizeLogMapper.java @@ -48,4 +48,16 @@ public interface FinancialBDPrizeLogMapper { @AutoSql(type = SqlType.DELETE) void clearLogsOfReport(@Param("record_id") String recordId); + + @Select("select bpl.record_id,bpl.manager_id,bpl.bd_name,sum(bpl.total_amount) total_amount,sum(bpl.total_prize) total_prize,sum(bpl.total_donation) total_donation,sum(bpl.send_prize) send_prize,sum(bpl.hold_prize) hold_prize," + + "bpl.kpi_amount,bpr.`month` " + + "from financial_bd_prize_log bpl INNER JOIN financial_bd_prize_records bpr on bpl.record_id = bpr.record_id " + + "where bpl.manager_id= #{manager_id} " + + "and bpl.channel!='ALL' " + + "group by bpr.month " + + "ORDER BY bpr.month desc") + List listBdPrizeLogByOne(@Param("manager_id") String manager_id); + + @AutoSql(type = SqlType.SELECT) + List findReportByOne(@Param("record_id") String recordId, @Param("manager_id") String managerId); } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionMapper.java index 2004bb911..3e2ce8b3d 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionMapper.java @@ -8,6 +8,7 @@ import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageList; import org.apache.ibatis.annotations.Param; +import java.util.Date; import java.util.List; /** @@ -24,6 +25,10 @@ public interface FinancialPartnerCommissionMapper { @AutoSql(type = SqlType.UPDATE) void update(JSONObject commission); + List getOrgPrizeList(@Param("org_id") String orgId); + + List getOrgPrizeDetail(@Param("org_id") String orgId,@Param("month") Date month); + List listAvailableMonths(@Param("year") int year); List listWithOrgInfo(@Param("year") int year, @Param("month") int month); @@ -44,4 +49,6 @@ public interface FinancialPartnerCommissionMapper { PageList getClientExtractRecord(@Param("org_id") int orgId, PageBounds pageBounds); + JSONObject findTotalByOrg(@Param("year") int year, @Param("month") int month, @Param("org_id") String orgId); + } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientDeviceMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientDeviceMapper.java index 401a3a36c..cc87aaed2 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientDeviceMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientDeviceMapper.java @@ -28,7 +28,11 @@ public interface ClientDeviceMapper { @AutoSql(type = SqlType.SELECT) @AdvanceSelect(addonWhereClause = "is_valid=1") - JSONObject findByClientDevId(@Param("client_dev_id") String clientDevId, @Param("client_type") String clientType); + JSONObject findByClientDevIdAndClientType(@Param("client_dev_id") String clientDevId, @Param("client_type") String clientType); + + @AutoSql(type = SqlType.SELECT) + @AdvanceSelect(addonWhereClause = "is_valid=1") + JSONObject findDeviceInfoByDeviceNo(@Param("client_dev_id") String clientDevId,@Param("dev_type") String devType); PageList listClientDevices(JSONObject params, PageBounds pagination); diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java index 4e48045ce..4741f59f3 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java @@ -42,6 +42,8 @@ public interface ClientMapper { PageList listPartners(JSONObject params, PageBounds pagination); + PageList listLessInfoPartners(JSONObject params, PageBounds pagination); + PageList comListPartners(JSONObject params, PageBounds pagination); List listClientsIdAndMoniker(); @@ -110,4 +112,7 @@ public interface ClientMapper { List findByrpayNotNull(); + JSONObject countBdApproveClients(@Param("manager_id") String manager_id); + + } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ManageDeviceTokenMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ManageDeviceTokenMapper.java new file mode 100644 index 000000000..7a758ad85 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ManageDeviceTokenMapper.java @@ -0,0 +1,25 @@ +package au.com.royalpay.payment.manage.mappers.system; + +import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper; +import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; +import cn.yixblog.support.mybatis.autosql.annotations.SqlType; +import com.alibaba.fastjson.JSONObject; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * Created by yixian on 2016-09-12. + */ +@AutoMapper(tablename = "sys_manage_devices_token", pkName = "dev_token_id") +public interface ManageDeviceTokenMapper { + + JSONObject findByDevId(@Param("dev_id") String devDevId); + + @AutoSql(type = SqlType.UPDATE) + void update(JSONObject devInfo); + + @AutoSql(type = SqlType.INSERT) + void save(JSONObject devTokenInfo); + +} 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 9f9f4d25e..cb493a8a4 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 @@ -76,6 +76,10 @@ public class ClientRegisterInfo { private String merchant_video_url; @JSONField(name = "store_name") private String storeName; + @NotEmpty(message = "error.payment.valid.param_missing") + private String client_pay_type; + @NotEmpty(message = "error.payment.valid.param_missing") + private String client_pay_desc; public JSONObject insertObject() { JSONObject res = (JSONObject) JSON.toJSON(this); @@ -386,4 +390,20 @@ public class ClientRegisterInfo { public String getStoreName() { return storeName; } + + public void setClient_pay_type(String client_pay_type) { + this.client_pay_type = client_pay_type; + } + + public void setClient_pay_desc(String client_pay_desc) { + this.client_pay_desc = client_pay_desc; + } + + public String getClient_pay_type() { + return client_pay_type; + } + + public String getClient_pay_desc() { + return client_pay_desc; + } } 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 4e8151f6b..5b43ce2a6 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 @@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.merchants.core; import au.com.royalpay.payment.core.exceptions.EmailException; import au.com.royalpay.payment.manage.appclient.beans.AppClientBean; +import au.com.royalpay.payment.manage.appclient.beans.AppMerchantBean; import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo; import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo; import au.com.royalpay.payment.manage.merchants.beans.ClientRateConfig; @@ -16,6 +17,7 @@ import au.com.royalpay.payment.tools.merchants.beans.UpdateSurchargeDTO; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import org.apache.ibatis.annotations.Param; import org.springframework.transaction.annotation.Transactional; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; @@ -47,6 +49,8 @@ public interface ClientManager { JSONObject listClients(JSONObject manager, PartnerQuery query); + JSONObject listClientsByApp(JSONObject manager, AppMerchantBean query); + List listPartners(JSONObject manager, PartnerQuery query); @Transactional @@ -407,4 +411,5 @@ public interface ClientManager { void partnerCBChannelConfig(String clientMoniker, String channelKey, String channel_id); + void addDevice(JSONObject manager, String clientMoniker, JSONObject device); } 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 0cf9166d0..0dd67b4b3 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 @@ -20,6 +20,7 @@ import au.com.royalpay.payment.core.exceptions.ParamInvalidException; import au.com.royalpay.payment.core.utils.OrderExpiryRuleResolver; import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper; import au.com.royalpay.payment.manage.appclient.beans.AppClientBean; +import au.com.royalpay.payment.manage.appclient.beans.AppMerchantBean; import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; import au.com.royalpay.payment.manage.device.core.DeviceManager; import au.com.royalpay.payment.manage.management.sysconfig.core.impls.PermissionPartnerManagerImpl; @@ -545,6 +546,69 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid return PageListUtils.buildPageListResult(partners); } + @Override + public JSONObject listClientsByApp(JSONObject manager, AppMerchantBean query) { + JSONObject params = query.toJsonParam(); + if (params.getString("org_id") != null) { + if (params.getString("org_ids") == null) { + orgIds(params, Integer.parseInt(params.getString("org_id"))); + } else { + params.put("org_id", params.getString("org_ids")); + params.remove("org_ids"); + } + } + JSONObject org = null; + if (params.getString("org_id") != null) { + org = orgMapper.findOne(params.getIntValue("org_id")); + if (org.getIntValue("type") == 1) { + params.put("referrer_id", org.getString("org_id")); + params.remove("org_id"); + } + } + int orgId = manager.getIntValue("org_id"); + if (orgId > 0) { + if (params.getString("org_ids") == null) { + JSONObject org2 = orgMapper.findOne(orgId); + if (org2.getString("parent_org_id") != null) { + params.put("org_id", orgId); + } else { + params.put("org_id", orgId); + orgIds(params, orgId); + } + } else { + params.put("org_id", params.getIntValue("org_ids")); + params.remove("org_ids"); + } + } + if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { + JSONObject bdConfig = financialBDConfigMapper.getBdConfig(manager.getString("manager_id")); + if (bdConfig != null) { + params.put("bd_group", bdConfig.getString("bd_group")); + List listGroupBds = financialBDConfigMapper.listGroupBds(bdConfig.getString("bd_group")); + List bdUserId = listGroupBds.stream().map(groupBd -> groupBd.getString("manager_id")).collect(Collectors.toList()); + if (params.containsKey("bd_user")) { + if (!bdUserId.contains(params.getString("bd_user"))) { + params.remove("bd_user"); + } + } + if (params.containsKey("org_ids")) { + params.remove("org_ids"); + } + if (params.containsKey("org_id")) { + params.remove("org_id"); + } + } + + if (query.getOnlyMe()) { + params.put("bd_user", manager.getString("manager_id")); + } + } + PageList partners = clientMapper.listLessInfoPartners(params, + new PageBounds(query.getPage(), query.getLimit(), Order.formString("is_valid.desc,-approve_time.asc,create_time.desc"))); + int authDays = PlatformEnvironment.getEnv().authDays();// 快速自助开通申请有效期 + return PageListUtils.buildPageListResult(partners); + } + private void orgIds(JSONObject params, int orgId) { JSONObject param = new JSONObject(); param.put("parent_org_id", params.getString("org_id")); @@ -623,6 +687,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid JSONObject clientConfig = new JSONObject(); clientConfig.put("client_id", partner.getIntValue("client_id")); clientConfig.put("client_moniker", partner.getString("client_moniker")); + clientConfig.put("client_pay_type", partner.getString("client_pay_type")); + clientConfig.put("client_pay_desc", partner.get("client_pay_desc")); + clientConfigService.save(clientConfig); permissionPartnerManagerImpl.permissionClientModuleSave(partner.getIntValue("client_id"), partner.getString("client_moniker")); } catch (Exception e) { @@ -691,6 +758,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } clientMapper.update(updateInfo); saveOrUpdateMailList(updateInfo, client); + JSONObject clientConfig = new JSONObject(); + clientConfig.put("client_id", clientId); + clientConfig.put("client_moniker", client.getString("client_moniker")); + clientConfig.put("client_pay_type", updateInfo.getString("client_pay_type")); + clientConfig.put("client_pay_desc", updateInfo.get("client_pay_desc")); + clientConfigMapper.update(clientConfig); clientInfoCacheSupport.clearClientCache(clientId); } @@ -816,7 +889,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } JSONObject yeepayConfigValid =yeePayClientConfigMapper.findMerchantConfig(client.getIntValue("client_id")); yeePayClientConfigMapper.updateSubMerchantIdValid(yeepayConfigValid.getString("yeepay_config_id"),0); - JSONObject yeepayConfig = yeePayClientConfigMapper.findMerchantConfigBySub(client.getIntValue("client_id"),yeepaySubMerchantInfo.getString("yeepay_sub_merchant_id")); + JSONObject yeepayConfig = yeePayClientConfigMapper.findMerchantConfigBySub(client.getIntValue("client_id"), yeepaySubMerchantInfo.getString("yeepay_sub_merchant_id")); yeePayClientConfigMapper.updateSubMerchantIdValid(yeepayConfig.getString("yeepay_config_id"),1); client.put("yeepay_sub_merchant_id",yeepaySubMerchantInfo.getString("yeepay_sub_merchant_id")); clientMapper.update(client); @@ -2079,6 +2152,24 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid return PageListUtils.buildPageListResult(devices); } + @Override + @Transactional + public void addDevice(JSONObject manager, String clientMoniker, JSONObject newDevice) { + JSONObject client = getClientInfoByMoniker(clientMoniker); + if (client == null) { + throw new InvalidShortIdException(); + } + checkOrgPermission(manager, client); + String clientDevId = newDevice.getString("client_dev_id"); + JSONObject dev = clientDeviceMapper.findDeviceInfoByDeviceNo(clientDevId, InspiryPOSFinder.INSPIRY_DEVICE_TYPE); + if (dev != null) { + throw new ServerErrorException(clientDevId + "当前设备已被使用"); + } + newDevice.put("client_id", client.getString("client_id")); + newDevice.put("create_time", new Date()); + clientDeviceMapper.save(newDevice); + } + @Override public void updateDevie(JSONObject manager, String clientMoniker, String devId, String remark) { JSONObject client = getClientInfoByMoniker(clientMoniker); @@ -2101,12 +2192,18 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid throw new InvalidShortIdException(); } checkOrgPermission(manager, client); - JSONObject dev = clientDeviceMapper.find(devId); - if (dev.getIntValue("client_id") != client.getIntValue("client_id")) { + JSONObject deviceInfo = clientDeviceMapper.find(devId); + if (deviceInfo.getIntValue("client_id") != client.getIntValue("client_id")) { throw new NotFoundException("设备不存在"); } - dev.put("is_valid", enable); - clientDeviceMapper.update(dev); + if (StringUtils.equals(InspiryPOSFinder.INSPIRY_DEVICE_TYPE, deviceInfo.getString("client_type")) && enable) { + JSONObject inspiryDevice = clientDeviceMapper.findDeviceInfoByDeviceNo(deviceInfo.getString("client_dev_id"), InspiryPOSFinder.INSPIRY_DEVICE_TYPE); + if (inspiryDevice != null) { + throw new ServerErrorException("当前设备已被使用"); + } + } + deviceInfo.put("is_valid", enable); + clientDeviceMapper.update(deviceInfo); } @Override diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java index 14065bb90..5da10fe4e 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java @@ -446,6 +446,7 @@ public class PartnerManageController { clientManager.registerClient(clientMoniker, registery, manager); } + //商户设备管理 获取商户设备信息 @ManagerMapping(value = "/{clientMoniker}/devices", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.DIRECTOR}) public JSONObject listClientDevices(@PathVariable String clientMoniker, @RequestParam(required = false) String remark, @RequestParam(required = false) String client_type, @RequestParam(required = false) String[] client_ids, @@ -454,6 +455,13 @@ public class PartnerManageController { return clientManager.listClientDevices(manager, clientMoniker, remark, page, limit,client_type,client_ids); } + //给商户新增设备 + @ManagerMapping(value = "/{clientMoniker}/add_device", method = RequestMethod.POST, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER}) + public void addDevice(@PathVariable String clientMoniker, @RequestBody JSONObject device, + @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + clientManager.addDevice(manager, clientMoniker, device); + } + @ManagerMapping(value = "/{clientMoniker}/devices/{devId}", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER}) public void modifyDevice(@PathVariable String clientMoniker, @PathVariable String devId, @RequestBody JSONObject remark, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { 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 0b3af823a..3c232773b 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 @@ -201,7 +201,7 @@ public class PartnerViewController { @PartnerMapping(value = "/accounts/{accountId}", method = RequestMethod.DELETE, roles = PartnerRole.ADMIN) @ResponseBody public void disableAccount(@PathVariable String accountId, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - if (accountId == account.getString("account_id")) { + if (accountId.equals(account.getString("account_id"))) { throw new BadRequestException("You cannot disable yourself"); } clientManager.disableAccount(null, account.getString("client_moniker"), accountId); diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java index 49aae675f..1b7a12766 100644 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java @@ -788,6 +788,7 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo ctx.setVariable("description", event.getString("description")); ctx.setVariable("is_send_client",event.getIntValue("is_send_client")); ctx.setVariable("mail_template",event.get("mail_template")==null?0:event.getIntValue("mail_template")); + ctx.setVariable("send_clean_days",event.getIntValue("send_clean_days")); String realOrderIdsStr = event.getString("real_order_ids"); String[] realOrderIds = {}; if (StringUtils.isNotBlank(realOrderIdsStr)) { diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java index 5b790db1c..81159d1fd 100644 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java @@ -420,7 +420,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati "company_phone", "suburb", "postcode", "state", "contact_person", "contact_phone", "contact_email", "short_name", "logo_url", "enable_refund", "enable_refund_auth", "retail_surcharge", "require_custinfo", "require_remark", "logo_thumbnail", "creator", "create_time", "approver", "approve_result", "approve_time", "timezone", "has_children", "source", "customer_surcharge_rate", "enable_alipay", "enable_wechat", - "enable_bestpay", "manual_settle", "skip_clearing" ,"mail_confirm"}; + "enable_bestpay", "manual_settle", "skip_clearing" ,"mail_confirm","surcharge_mode"}; for (String col : columns) { simpleClient.put(col, client.get(col)); } diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java index 7639691e5..5683c4782 100644 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java @@ -1302,6 +1302,7 @@ public class TradeLogServiceImpl implements TradeLogService { JSONObject client = partner.getJSONObject("client"); String timezone = client.getString("timezone"); JSONObject params = query.toParams(timezone); + params.put("client_id",client.getString("client_id")); List clientOrderList = transactionMapper.getClientOrderByTransactionTime(params); List clientOrders = new ArrayList<>(clientOrderList.size()); clientOrderList.parallelStream().forEach(p->{ diff --git a/src/main/resources/apple_message_cert_dev.p12 b/src/main/resources/apple_message_cert_dev.p12 index 85d80de10..905e2cc1f 100644 Binary files a/src/main/resources/apple_message_cert_dev.p12 and b/src/main/resources/apple_message_cert_dev.p12 differ diff --git a/src/main/resources/apple_message_cert_product.p12 b/src/main/resources/apple_message_cert_product.p12 index 205da3527..905e2cc1f 100644 Binary files a/src/main/resources/apple_message_cert_product.p12 and b/src/main/resources/apple_message_cert_product.p12 differ diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index 277abb93f..d212f340d 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -1,6 +1,6 @@ spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.schema-name=royalpay_production -spring.datasource.host=192.168.0.111:3306 +spring.datasource.host=192.168.0.18:3306 spring.datasource.url=jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false spring.datasource.username=root spring.datasource.password=root diff --git a/src/main/resources/application-local.properties b/src/main/resources/application-local.properties index 91173a856..3455edb96 100644 --- a/src/main/resources/application-local.properties +++ b/src/main/resources/application-local.properties @@ -1,6 +1,6 @@ spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.schema-name=royalpay_production -spring.datasource.host=192.168.0.49:3306 +spring.datasource.host=127.0.0.1:3306 spring.datasource.url=jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false spring.datasource.username=root spring.datasource.password=root \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 0fed0e0e5..106d12b60 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,6 +1,6 @@ server.port=5000 -spring.profiles.active=dev,alipay,bestpay,jd,wechat,rpay,yeepay,lakala +spring.profiles.active=dev,alipay,bestpay,jd,wechat,rpay,yeepay env.company=RoyalPay @@ -22,11 +22,11 @@ spring.redis.host=127.0.0.1 spring.redis.port=6379 spring.redis.database=1 -spring.data.mongodb.host=10.30.0.8 -spring.data.mongodb.port=27017 -spring.data.mongodb.database=admin -spring.data.mongodb.username=mongouser -spring.data.mongodb.password=Royalpay123 +#spring.data.mongodb.host=192.168.0.111 +#spring.data.mongodb.port=27017 +#spring.data.mongodb.database=admin +#spring.data.mongodb.username=mongouser +#spring.data.mongodb.password=Royalpay123 mybatis.autosql.default-dialect=mysql @@ -57,17 +57,23 @@ app.agreetemplate.classic.path=https://file.royalpay.com.au/open/2017/07/10/1499 #app.agreetemplate.aggregate.path=https://file.royalpay.com.au/open/2017/11/17/1510890355946_hQt6yGc0NJ8TYeK7XCuuSAnTI31M7v.pdf app.agreetemplate.aggregate.path=https://file.royalpay.com.au/open/2019/02/12/1549950518019_vW4tU5t6D6yA0wMSDNBB9G195W3g99.pdf -app.host.main=http://192.168.0.9:9003/ -app.host.regions.cn=https://mpay-cn.royalpay.com.au/ -app.host.regions.au=https://mpay-au.royalpay.com.au/ +#app.host.main=https://mpay.royalpay.com.au/ +#app.host.regions.cn=https://mpay-cn.royalpay.com.au/ +#app.host.regions.au=https://mpay-au.royalpay.com.au/ +app.host.main=http://192.168.0.8:9009/ +app.host.regions.cn=http://192.168.0.8:9009/ +app.host.regions.au=http://192.168.0.8:9009/ app.debug=true app.name=RoyalPay -app.cms.host=https://www.royalpay.com.au/ +#app.cms.host=https://www.royalpay.com.au/ + +app.cms.host=http://127.0.0.1:9533 app.server.ip=127.0.0.1 + app.redpack_auth.enable=false hf.rsa-file=/opt/2000604000101.pfx ##积分商城 @@ -88,8 +94,9 @@ app.mail.appid=1 app.mail.host=https://mailsupport.royalpay.com.au mail.send.credentialCode=Fd1aRfdjc9 -apple.message.apns.password=F1b5*ChJPp73 -apple.message.apns.file=/opt/adn +app.sandbox=true +apple.message.apns.password=BSNMNkxPq0AT +apple.message.apns.file=D:\\globalpay\\9009_manage_develop\\royalpay.manage\\src\\main\\resources\\apple_message_cert_product.p12 android.message.secret=2b96d9bc6169c9554218aab1 android.message.appkey=3f33a10d0a7d4ac94d8f2431 @@ -141,4 +148,4 @@ app.hanyin-secure.pid=ROYALPAY app.hanyin-secure.sftp-host=180.168.61.86 app.hanyin-secure.sftp-port=28480 app.hanyin-secure.sftp-username=royalpay -app.hanyin-secure.sftp-pwd=royalpay +app.hanyin-secure.sftp-pwd=royalpay \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.xml index e2c675edd..637cd471f 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.xml @@ -19,6 +19,24 @@ ]]> + + + SELECT record_id,org_id,`year`,`month`,SUM(gross_amount) gross_amount,SUM(total_charge) total_charge, + SUM(royalpay_charge) royalpay_charge,SUM(org_charge) org_charge,SUM(net_charge) net_charge,SUM(share_charge) share_charge + FROM financial_partner_commission + WHERE org_id = #{org_id} + GROUP BY `year`,`month` + ORDER BY `year` DESC,`month` DESC + + + + \ No newline at end of file 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 cf99392c3..9ad45c620 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 @@ -1116,10 +1116,15 @@ SELECT t.clearing_order FROM pmt_transactions t WHERE t.channel='Settlement' - AND t.client_id IN - - #{clientId} - + + AND t.client_id IN + + #{client_id} + + + + and t.client_id=#{client_id} + and t.transaction_time >= #{from} and t.transaction_time < #{to} diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml index f4e4a3aa8..e46b2703e 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml @@ -154,6 +154,85 @@ and c.is_valid=1 + + + select * FROM sys_clients WHERE rpay_enterprise_id != '' + + \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ManageDeviceTokenMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ManageDeviceTokenMapper.xml new file mode 100644 index 000000000..df785f3e7 --- /dev/null +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ManageDeviceTokenMapper.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/src/main/resources/jasper/partner_invoice_gst.jasper b/src/main/resources/jasper/partner_invoice_gst.jasper index a5111a4fa..5fc26485f 100644 Binary files a/src/main/resources/jasper/partner_invoice_gst.jasper and b/src/main/resources/jasper/partner_invoice_gst.jasper differ diff --git a/src/main/resources/jasper/partner_invoice_gst_bak.jasper b/src/main/resources/jasper/partner_invoice_gst_bak.jasper new file mode 100644 index 000000000..a5111a4fa Binary files /dev/null and b/src/main/resources/jasper/partner_invoice_gst_bak.jasper differ diff --git a/src/main/resources/jasper/royalpay_logo.png b/src/main/resources/jasper/royalpay_logo.png index b71a9e051..89fa0fe36 100644 Binary files a/src/main/resources/jasper/royalpay_logo.png and b/src/main/resources/jasper/royalpay_logo.png differ diff --git a/src/main/resources/jasper/royalpay_logo_bak.png b/src/main/resources/jasper/royalpay_logo_bak.png new file mode 100644 index 000000000..b71a9e051 Binary files /dev/null and b/src/main/resources/jasper/royalpay_logo_bak.png differ diff --git a/src/main/resources/templates/app/bd_prize_rules.html b/src/main/resources/templates/app/bd_prize_rules.html new file mode 100755 index 000000000..8510450c8 --- /dev/null +++ b/src/main/resources/templates/app/bd_prize_rules.html @@ -0,0 +1,97 @@ + + + + + + Title + + + + + + +
+
+

BD分级提成费率速查表

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
BD LevelKPI完成度Junior BDIntermediate BDSenior BD
费率0.6-0.790.8-2.00.6-0.790.8-2.00.6-0.790.8-2.0
+
+

补充说明

+
    +
  • 按月度发放
  • +
  • 每月发放总提成额度的60%,剩余40%按照“年度考评分数比例”于每年年底即12 月25 日圣诞前发放
  • +
  • 提前离职者,40%提成不予发放
  • +
  • 年度考评(根据销管中心每月考评表打分制进行统计)按照考评分数对应比例发放40%的占比部分,扣下部分如果第二年考评超出一定评分110%可以补发;同样,如果年度考评分数超过100 分按照同比例发放
  • +
  • 商户开通后连续 1 个月未产生流水的,上交主管,由主管重新分配
  • +
  • 连续 2 个月不产生流水的商户,由销管部统一收回,重新分配
  • +
  • 分配后的商户流水客户专员只能占一半
  • +
  • 离职及调岗人员商户统一上交销管中心,由销管中心 leader 及跨境事业部总监相互协商及相互监督,按照公平公正的原则, 做出分配方案,并由总监确认后统一分配。调岗人员移交的商户,在移交后 1 个月内移交人员和接收人员平分该商家产生的提成,移交人员需配合接收人员做好商户对接和短期内的商户维护; + 离职人员交接的商户提成,接收人员享受一半的提成,另一半作为跨境客服专员福利会基金
  • +
  • 被客户投诉情况严重者,此商户由销管中心无条件收回重新分配
  • +
  • 活动执行未传达到位且出现舞弊、徇私、懒惰等行为的,商户上交由销管中心统一分配
  • +
  • 后期维护不及时,连续一个月不跟踪者,此商户上交销管中心,统一重新分配
  • +
  • 以上分配,销管中心 leader 和跨境支付事业部商量好之后需做好方案后经 COO 审批方可执行
  • +
+
+
+ + \ No newline at end of file diff --git a/src/main/resources/templates/app/org_prize_rules.html b/src/main/resources/templates/app/org_prize_rules.html new file mode 100755 index 000000000..cbd015139 --- /dev/null +++ b/src/main/resources/templates/app/org_prize_rules.html @@ -0,0 +1,65 @@ + + + + + + Title + + + + +
+
+
+
+
+
合伙人提成计算说明
+

2018-11-30更新

+
+
+
+ 合伙人提成算法:按照合伙人签约的商户下每笔订单计算合伙人提成,提成规则明细如下:    + (取整规则为:四舍五入保留2位小数) +
+
    +
  • 单笔订单 :  (单笔订单交易金额 * 商家签约费率)取整     - +   (单笔订单交易金额 * 组织成本费率)取整     + =    单笔订单合伙人提成 +
  • +
  • 总交易额 :  合伙人签约的商户累计交易额
  • +
  • 平台手续费:合伙人签约的商户(单笔订单交易金额 * 组织成本费率)取整 累加
  • +
  • 合伙人提成: 每笔订单合伙人提成累加
  • +
+
+
如合伙人存在二级代理,可从二级代理的交易额中得到分润,分润规则如下:
+
    +
  • 二级代理合伙人提成计算规则如同一级代理,分润从平台手续费中扣除。
  • +
  • 如A合伙人与平台签约组织成本费率为1.5%,A合伙人的二级代理B的签约组织成本费率为1.8%,B的商户签约费率为3%
  • +
  • 假设B当月只有一笔交易且交易额为1000,总手续费为30,平台手续费为18,B合伙人提成为12。
  • +
  • 计算A的分润时,会将B的交易额1000 * A的组织成本费率 1.5% = 15,A的分润就是 18-15=3,而B合伙人平台手续费为15,其中扣除3是A的分润
  • +
+
补充说明
+
    +
  • 退款成功的订单不计入合伙人提成内
  • +
  • 当本月有合伙人手续费存在欠款时,无法下载汇款文件
  • +
+
+
+
+
+ + \ No newline at end of file diff --git a/src/main/resources/templates/mail/risk_upload_mail.html b/src/main/resources/templates/mail/risk_upload_mail.html index 9fb8b01fa..7fb29931e 100644 --- a/src/main/resources/templates/mail/risk_upload_mail.html +++ b/src/main/resources/templates/mail/risk_upload_mail.html @@ -79,8 +79,8 @@

拒绝理由:

-

近期由于我们的风控系统检测到您的交易异常,已暂时将您的清算周期调整为T+,还请您提供以下材料,还原附件中列明的交易的真实背景:
- RoyalPay's risk management system recently has identified abnormal transactions from your records, clean days has been adjusted to T+.so please provide us with following materials to assist in verifying the real scenario of the transactions attached:

+

近期由于我们的风控系统检测到您的交易异常,已暂时将您的清算周期调整为T+,还请您提供以下材料,还原附件中列明的交易的真实背景:
+ RoyalPay's risk management system recently has identified abnormal transactions from your records, clean days has been adjusted to T+.so please provide us with following materials to assist in verifying the real scenario of the transactions attached:

1.请解释相应的消费场景/业务模式,例如网站商城,扫码支付, 消费者到店支付等;
  Please explain the relative payment scenario/business activities, for example, online store, QR code payment, payment at the store, etc;

2.提供相应购物清单,订单小票(请提供与被查交易订单号相匹配的交易时间及金额的发票);
  diff --git a/src/main/ui/index.html b/src/main/ui/index.html index 8ba265962..57d546216 100644 --- a/src/main/ui/index.html +++ b/src/main/ui/index.html @@ -899,7 +899,7 @@ margin-bottom: 10%;"/> -

  • +
  • diff --git a/src/main/ui/static/analysis/risk_business.js b/src/main/ui/static/analysis/risk_business.js index bbdc94ff7..60bb3991d 100644 --- a/src/main/ui/static/analysis/risk_business.js +++ b/src/main/ui/static/analysis/risk_business.js @@ -137,7 +137,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], }]); - app.controller('riskBusinessCtrl', ['$scope', '$state', '$http', '$uibModal', '$filter', 'commonDialog', 'industryMap', 'chartParser', + app.controller('riskBusinessCtrl', ['$scope', '$state', '$http', '$uibModal', '$filter', 'commonDialog', 'industryMap','chartParser', function ($scope, $state, $http, $uibModal, $filter, commonDialog, industryMap, chartParser) { $scope.orderTypes = orderTypesMap; $scope.orderTypesForBD = orderTypesMapForBD; @@ -328,11 +328,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], }).then(function () { $http.delete('/risk/business/ban/' + $scope.riskEvent.risk_id).then(function () { $state.go('analysis_monitoring.risk_business'); - commonDialog.alert({ - title: 'Delete', - content: 'Risk Event Already Disabled', - type: 'error' - }); + commonDialog.alert({title: 'Delete', content: 'Risk Event Already Disabled', type: 'error'}); }, function (resp) { commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); }) @@ -721,7 +717,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], window.open(url, '_blank'); }; - $scope.increase = function($index) { + $scope.increase = function ($index) { $scope.materials.splice($index + 1, 0, {key: new Date().getTime(), value: ""}); // 用时间戳作为每个item的key // 增加新的input后允许删除 @@ -759,7 +755,11 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], $scope.changeIsSendClient = function(flag) { $scope.is_send_client = flag }; - $scope.save = function(form) { + $scope.send_clean_days = false; + $scope.changeIsSendClient = function (flag) { + $scope.send_clean_days = flag + }; + $scope.save = function (form) { if (form.$invalid) { angular.forEach(form, function (item, key) { if (key.indexOf('$') < 0) { @@ -785,6 +785,8 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], $scope.riskEvent.is_send_client = $scope.is_send_client; + $scope.riskEvent.send_clean_days = $scope.send_clean_days; + var saveRiskBtn = document.getElementById('save-risk-btn'); var saveRiskBtnInnerHtmlBak = saveRiskBtn.innerHTML; saveRiskBtn.disabled = true; @@ -856,8 +858,8 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], } }); - app.filter('royalPayOrderType', function() { - return function(type) { + app.filter('royalPayOrderType', function () { + return function (type) { return royalpayOrderTypesMap[type]; } }); diff --git a/src/main/ui/static/analysis/templates/new_riskEvent.html b/src/main/ui/static/analysis/templates/new_riskEvent.html index f0a64110f..629c2ed5c 100644 --- a/src/main/ui/static/analysis/templates/new_riskEvent.html +++ b/src/main/ui/static/analysis/templates/new_riskEvent.html @@ -1,3 +1,4 @@ +

    New RiskEvent

    @@ -55,6 +56,15 @@ +
    + +
    + +
    +
    diff --git a/src/main/ui/static/analysis/templates/riskEvent_detail.html b/src/main/ui/static/analysis/templates/riskEvent_detail.html index b87da2879..7dfd94f46 100644 --- a/src/main/ui/static/analysis/templates/riskEvent_detail.html +++ b/src/main/ui/static/analysis/templates/riskEvent_detail.html @@ -175,6 +175,16 @@
    +
    + +
    + +
    +
    +
    @@ -569,6 +579,15 @@
    +
    + +
    + +
    +
    +
      -
    • 完成当月指标低于 51%,提成按照 0.005%提取
    • -
    • 完成当月指标高于 80%,提成按照 0.008%提取
    • -
    • 完成当月指标 100%,提成按照 0.01%
    • + + + +
    • 享受墨尔本和悉尼两地部门流水总和提成
    • +
    • 完成当月指标,提成按照0.005%提取
    • +
    • 未完成当月指标,提成按照0.001%提取
    • +
    • 连续四个月未完成指标,撤职处理或回归原有职位
    • +
    • 销售总监任职后需将自己手头客户按照公司规定公平分配给客户专员,本人可挂靠50%,每个商户享受50%的流水提成
    @@ -78,8 +83,8 @@
      -
    • 完成月度指标,当月部门提成为该部门总流水的 0.01%
    • -
    • 未完成月度指标,当月部门提成为该部门总流水的 0.005%;
    • +
    • 完成月度指标,当月部门提成为该部门总流水的0.005%
    • +
    • 未完成月度指标,当月部门提成为该部门总流水的0.001%
    +
    -
    Alipay Information  (Optional)
    +
    Merchant Payment Scenario
    -
    - -
    - -

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

    -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - +
    +
    - -

    eg:https://www.baidu.com

    + +
    +

    Required + Field

    +
    -
    -
    -
    - -
    -
    Contact Information
    -
    -
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    - + ng-class="{'has-error':partnerForm.client_pay_desc.$invalid && partnerForm.client_pay_desc.$dirty}"> +
    - -
    + +

    + 例如:线下场景:门店(立牌、POS)、收银系统(选择品牌名称【ipos、银豹、aupos、其他】)、无门店

    +

    Required Field

    Less - Than 50 + Than 200 Characters(including symbols and spaces)

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

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

    - -
    -

    Required - Field

    -

    Less - Than 20 Characters

    +
    +
    + +
    +
    -
    - -
    -

    Less - Than 2 Characters

    +
    + +
    +
    -
    - -
    -

    Required - Field

    -

    Less - Than 11 Characters

    +
    + +
    + +

    eg:https://www.baidu.com

    -
    - -
    - +
    +
    + +
    +
    Contact Information
    +
    +
    +
    + +
    + +
    +

    Required + Field

    +

    Less + Than 50 + Characters(including symbols and spaces)

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

    Required + Field

    +

    Less + Than 20 Characters

    +
    +
    +
    + +
    +

    Less + Than 2 Characters

    +
    +
    +
    + +
    +

    Required + Field

    +

    Less + Than 11 Characters

    +
    +
    -
    -

    Required - Field

    -

    Less Than 50 - Characters(including symbols and spaces)

    +
    + +
    + +
    +
    +

    Required + Field

    +

    Less Than 50 + Characters(including symbols and spaces)

    +
    -
    - -
    -
    Address Information
    -
    -
    -
    - -
    + +
    +
    Address Information
    +
    +
    +
    + +
    -
    -

    Less - Than 200 - Characters(including symbols and spaces)

    -

    Required - Field

    +
    +

    Less + Than 200 + Characters(including symbols and spaces)

    +

    Required + Field

    +
    -
    -
    - -
    - -
    -

    Less - Than 50 - Characters(including symbols and spaces)

    -

    Required - Field

    +
    + +
    + +
    +

    Less + Than 50 + Characters(including symbols and spaces)

    +

    Required + Field

    +
    + + + + + + + + +
    - - - - - - - - -
    -
    -
    - -
    - -
    -

    Less - Than 10 - Characters(including symbols and spaces)

    -

    Required - Field

    +
    + +
    + +
    +

    Less + Than 10 + Characters(including symbols and spaces)

    +

    Required + Field

    +
    -
    -
    - -
    - - - - - - - -
    -

    Required - Field

    -
    +
    + +
    + + + + + + + +
    +

    Required + Field

    +
    +
    -
    -
    - -
    - -
    -

    Less - Than 20 - Characters(including symbols and spaces)

    -

    Required - Field

    +
    + +
    + +
    +

    Less + Than 20 + Characters(including symbols and spaces)

    +

    Required + Field

    +
    + + + + + + + + +
    - - - - - - - - -
    -
    -
    - -
    - +
    + +
    + +
    -
    -
    -
    Location - - -
    -
    -
    - +
    +
    Location + + +
    +
    +
    + +
    -
    - +
    --> -
    -
    Industry
    -
    -
    - -
    - -
    -

    Required - Field

    +
    +
    + Industry +
    +
    +
    + +
    + +
    +

    Required + Field

    +
    -
    -
    - -
    - -
    -

    Required - Field

    +
    + +
    + +
    +

    Required + Field

    +
    -
    -
    - -
    - -
    -

    Required - Field

    +
    + +
    + +
    +

    Required + Field

    +
    -
    -
    - -
    - -
    -

    Required - Field

    +
    + +
    + +
    +

    Required + Field

    +
    -
    -
    +
    -
    - -
    - +
    + +
    + +
    -
    -
    +
    +
    +
    Merchant Payment Scenario
    +
    +
    +
    + +
    +

    +

    +
    +
    + +
    +

    +
    +
    +
    +
    +
    Alipay Information   (Optional)
    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 ca13b7bad..fa8e2f279 100644 --- a/src/main/ui/static/payment/partner/templates/partner_detail.html +++ b/src/main/ui/static/payment/partner/templates/partner_detail.html @@ -28,7 +28,8 @@ width: 95%; float: left; } - .img-size{ + + .img-size { height: 100px; margin-left: 20px; } @@ -39,7 +40,8 @@ (已禁用) + class="fa fa-share">(已禁用)
    @@ -130,16 +134,22 @@
    - - + +
    -
    - 制作临时合同 +
    - - + +
    @@ -235,7 +251,8 @@
  • Partner Accounts
  • -
  • +
  • Subpartners
  • @@ -257,7 +274,8 @@ Settlement
  • -
  • +
  • Surcharge Account
  • @@ -298,7 +316,8 @@ ) - (已禁用) + (已禁用)

    @@ -307,7 +326,8 @@

    -

    注意:(微信渠道可能不合规)

    @@ -318,7 +338,8 @@

    -

    注意:(微信渠道可能不合规)

    @@ -333,13 +354,14 @@
    -
    -

    -

    - 注意:(微信渠道可能不合规) -

    -
    +
    +

    +

    + 注意:(微信渠道可能不合规) +

    +
    @@ -348,7 +370,8 @@

    -

    注意:(微信渠道可能不合规)

    @@ -399,7 +422,7 @@
    2:  @@ -470,7 +493,8 @@ End Date BD Name Proportion - Operation + + Operation @@ -501,9 +525,568 @@
    +
    +
    Merchant Payment Scenario
    +
    +
    +
    + +
    +

    +

    +
    +
    + +
    +

    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    +
    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

    +
    +
    +
    + +
    +

    Less + Than 2 Characters

    +
    +
    +
    + +
    +

    Required + Field

    +

    Less + Than 11 Characters

    +
    +
    +
    +
    + +
    + +
    +
    +

    Required + Field

    +

    Less Than 50 + Characters(including symbols and spaces)

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

    Less + Than 200 + Characters(including symbols and spaces)

    +

    Required + Field

    +
    +
    +
    +
    + +
    + +
    +

    Less + Than 50 + Characters(including symbols and spaces)

    +

    Required + Field

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

    Less + Than 10 + Characters(including symbols and spaces)

    +

    Required + Field

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

    Required + Field

    +
    + +
    +
    +
    + +
    + +
    +

    Less + Than 20 + Characters(including symbols and spaces)

    +

    Required + Field

    +
    + + + + + + + + + +
    +
    +
    + +
    + +
    +
    +
    +
    +
    +
    +
    Location + + +
    +
    +
    + +
    +
    +
    + + + +
    +
    + Industry +
    +
    +
    + +
    + +
    +

    Required + Field

    +
    +
    +
    + +
    + +
    + +
    +

    Required + Field

    +
    +
    +
    + + +
    + +
    + +
    +

    Required + Field

    +
    +
    +
    + +
    + +
    + +
    +

    Required + Field

    +
    +
    + +
    + +
    + +
    + +
    +
    +
    +
    +
    +
    -
    Alipay Information  (Optional)
    +
    Alipay Information  (Optional) +
    @@ -561,13 +1144,16 @@

    - Resend Email - - + +

    @@ -751,7 +1337,7 @@
    -

    +

    {{partner.alipayindustry|partner_alipay_industry}}    ({{partner.alipayindustry}})

    @@ -763,7 +1349,7 @@
    -

    +

    {{partner.hfindustry| partner_hf_industry}}    ({{partner.hfindustry}})

    diff --git a/src/main/ui/static/payment/partner/templates/partner_devices.html b/src/main/ui/static/payment/partner/templates/partner_devices.html index 5f9a774a9..e61a489b7 100644 --- a/src/main/ui/static/payment/partner/templates/partner_devices.html +++ b/src/main/ui/static/payment/partner/templates/partner_devices.html @@ -3,11 +3,14 @@
    - +
    +
    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 c9dd152d5..f5525f892 100644 --- a/src/main/ui/static/payment/partner/templates/partner_edit.html +++ b/src/main/ui/static/payment/partner/templates/partner_edit.html @@ -362,6 +362,596 @@
    +
    +
    Merchant Payment Scenario
    +
    +
    +
    + +
    + +
    +

    Required + Field

    +
    +
    +
    +
    + +
    + +

    + 例如:线下场景:门店(立牌、POS)、收银系统(选择品牌名称【ipos、银豹、aupos、其他】)、无门店

    +
    +

    Required + Field

    +

    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

    +
    +
    +
    + +
    +

    Less + Than 2 Characters

    +
    +
    +
    + +
    +

    Required + Field

    +

    Less + Than 11 Characters

    +
    +
    +
    +
    + +
    + +
    +
    +

    Required + Field

    +

    Less Than 50 + Characters(including symbols and spaces)

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

    Less + Than 200 + Characters(including symbols and spaces)

    +

    Required + Field

    +
    +
    +
    +
    + +
    + +
    +

    Less + Than 50 + Characters(including symbols and spaces)

    +

    Required + Field

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

    Less + Than 10 + Characters(including symbols and spaces)

    +

    Required + Field

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

    Required + Field

    +
    + +
    +
    +
    + +
    + +
    +

    Less + Than 20 + Characters(including symbols and spaces)

    +

    Required + Field

    +
    + + + + + + + + + +
    +
    +
    + +
    + +
    +
    +
    +
    +
    +
    +
    Location + + +
    +
    +
    + +
    +
    +
    + + + +
    +
    + Industry +
    +
    +
    + +
    + +
    +

    Required + Field

    +
    +
    +
    + +
    + +
    + +
    +

    Required + Field

    +
    +
    +
    + + +
    + +
    + +
    +

    Required + Field

    +
    +
    +
    + +
    + +
    + +
    +

    Required + Field

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