Merge branch 'develop'

# Conflicts:
#	src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java
#	src/main/ui/static/analysis/risk_business.js
master
luoyang 6 years ago
commit 05af52917c

@ -53,7 +53,6 @@
<artifactId>jpinyin</artifactId> <artifactId>jpinyin</artifactId>
<version>1.1.7</version> <version>1.1.7</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>au.com.royalpay.payment</groupId> <groupId>au.com.royalpay.payment</groupId>
<artifactId>bestpay-core</artifactId> <artifactId>bestpay-core</artifactId>

@ -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 * @apiName declare_report
* @apiDescription * @apiDescription
* 用于商户提交海关需要的订单附件信息仅支持微信和支付宝微信只支持一个月内的支付订单进行报关申请 * 用于商户提交海关需要的订单附件信息仅支持微信和支付宝微信只支持一个月内的支付订单进行报关申请

@ -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;
}
}

@ -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<JSONObject> 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<String, List<JSONObject>> getRates(JSONObject device, String clientMoniker);
JSONObject getConfigRates(JSONObject device);
JSONObject getNewVersion(JSONObject device);
JSONObject getCommons(JSONObject device);
List<JSONObject> getOrgPrizeList(JSONObject device);
JSONObject getBdConfigKpi(JSONObject device);
List<JSONObject> 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);
}

@ -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<JSONObject> 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<String, List<JSONObject>> getRates(JSONObject device, String clientMoniker) {
String clientType = device.getString("client_type");
manageDeviceSupport.findRegister(clientType);
List<JSONObject> 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<JSONObject> getOrgPrizeList(JSONObject device) {
String clientType = device.getString("client_type");
manageDeviceSupport.findRegister(clientType);
JSONObject manager = managerMapper.findById(device.getString("manager_id"));
List<JSONObject> 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<JSONObject> getBdPrizeList(JSONObject device) {
String clientType = device.getString("client_type");
manageDeviceSupport.findRegister(clientType);
JSONObject manager = managerMapper.findById(device.getString("manager_id"));
List<JSONObject> 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);
}
}

@ -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<JSONObject> 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<String,List<JSONObject>> 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<JSONObject> 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<JSONObject> 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);
}
}

@ -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.manage.signin.core.SignInStatusManager;
import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.device.DeviceSupport; 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.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.http.HttpUtils; 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.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.code.kaptcha.Producer; import com.google.code.kaptcha.Producer;
@ -38,6 +41,8 @@ public class RetailValidationController {
@Resource @Resource
private DeviceSupport deviceSupport; private DeviceSupport deviceSupport;
@Resource @Resource
private ManageDeviceSupport manageDeviceSupport;
@Resource
private RetailAppService retailAppService; private RetailAppService retailAppService;
@RequestMapping(value = "/devices/{devType}/register", method = RequestMethod.POST) @RequestMapping(value = "/devices/{devType}/register", method = RequestMethod.POST)
@ -45,6 +50,11 @@ public class RetailValidationController {
return deviceSupport.register(devType, registeration); 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) @RequestMapping(value = "/sign_in_check", method = RequestMethod.POST)
public JSONObject signIn(@RequestBody @Valid RetailLoginInfo loginInfo, Errors errors) { public JSONObject signIn(@RequestBody @Valid RetailLoginInfo loginInfo, Errors errors) {
HttpUtils.handleValidErrors(errors); HttpUtils.handleValidErrors(errors);
@ -68,6 +78,35 @@ public class RetailValidationController {
return client; 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) @RequestMapping(value = "/wechat_app_signin", method = RequestMethod.POST)
public JSONObject partnerWechatAppSignIn(@RequestBody JSONObject data) { public JSONObject partnerWechatAppSignIn(@RequestBody JSONObject data) {
JSONObject res = signInStatusManager.partnerWechatAppSignIn(data.getString("code")); JSONObject res = signInStatusManager.partnerWechatAppSignIn(data.getString("code"));

@ -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<JSONObject> bdConfigRates() {
return bdPrizeService.getRateConfig();
}
}

@ -26,6 +26,8 @@ public interface FinancialBDConfigMapper {
List<JSONObject> listBDConfig(); List<JSONObject> listBDConfig();
JSONObject getBDConfigById(@Param("manager_id") String manager_id);
List<JSONObject> listGroupBds(@Param("bd_group") String bd_group); List<JSONObject> 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); BigDecimal getGroupAmount(@Param("bd_group") String bd_group, @Param("record_id") String record_id, @Param("channel") String channel);

@ -48,4 +48,16 @@ public interface FinancialBDPrizeLogMapper {
@AutoSql(type = SqlType.DELETE) @AutoSql(type = SqlType.DELETE)
void clearLogsOfReport(@Param("record_id") String recordId); 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<JSONObject> listBdPrizeLogByOne(@Param("manager_id") String manager_id);
@AutoSql(type = SqlType.SELECT)
List<JSONObject> findReportByOne(@Param("record_id") String recordId, @Param("manager_id") String managerId);
} }

@ -8,6 +8,7 @@ import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList; import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -24,6 +25,10 @@ public interface FinancialPartnerCommissionMapper {
@AutoSql(type = SqlType.UPDATE) @AutoSql(type = SqlType.UPDATE)
void update(JSONObject commission); void update(JSONObject commission);
List<JSONObject> getOrgPrizeList(@Param("org_id") String orgId);
List<JSONObject> getOrgPrizeDetail(@Param("org_id") String orgId,@Param("month") Date month);
List<Integer> listAvailableMonths(@Param("year") int year); List<Integer> listAvailableMonths(@Param("year") int year);
List<JSONObject> listWithOrgInfo(@Param("year") int year, @Param("month") int month); List<JSONObject> listWithOrgInfo(@Param("year") int year, @Param("month") int month);
@ -44,4 +49,6 @@ public interface FinancialPartnerCommissionMapper {
PageList<JSONObject> getClientExtractRecord(@Param("org_id") int orgId, PageBounds pageBounds); PageList<JSONObject> getClientExtractRecord(@Param("org_id") int orgId, PageBounds pageBounds);
JSONObject findTotalByOrg(@Param("year") int year, @Param("month") int month, @Param("org_id") String orgId);
} }

@ -28,7 +28,11 @@ public interface ClientDeviceMapper {
@AutoSql(type = SqlType.SELECT) @AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid=1") @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<JSONObject> listClientDevices(JSONObject params, PageBounds pagination); PageList<JSONObject> listClientDevices(JSONObject params, PageBounds pagination);

@ -42,6 +42,8 @@ public interface ClientMapper {
PageList<JSONObject> listPartners(JSONObject params, PageBounds pagination); PageList<JSONObject> listPartners(JSONObject params, PageBounds pagination);
PageList<JSONObject> listLessInfoPartners(JSONObject params, PageBounds pagination);
PageList<JSONObject> comListPartners(JSONObject params, PageBounds pagination); PageList<JSONObject> comListPartners(JSONObject params, PageBounds pagination);
List<JSONObject> listClientsIdAndMoniker(); List<JSONObject> listClientsIdAndMoniker();
@ -110,4 +112,7 @@ public interface ClientMapper {
List<JSONObject> findByrpayNotNull(); List<JSONObject> findByrpayNotNull();
JSONObject countBdApproveClients(@Param("manager_id") String manager_id);
} }

@ -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);
}

@ -76,6 +76,10 @@ public class ClientRegisterInfo {
private String merchant_video_url; private String merchant_video_url;
@JSONField(name = "store_name") @JSONField(name = "store_name")
private String storeName; 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() { public JSONObject insertObject() {
JSONObject res = (JSONObject) JSON.toJSON(this); JSONObject res = (JSONObject) JSON.toJSON(this);
@ -386,4 +390,20 @@ public class ClientRegisterInfo {
public String getStoreName() { public String getStoreName() {
return storeName; 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;
}
} }

@ -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.core.exceptions.EmailException;
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean; 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.BankAccountInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo; import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientRateConfig; 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.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
@ -47,6 +49,8 @@ public interface ClientManager {
JSONObject listClients(JSONObject manager, PartnerQuery query); JSONObject listClients(JSONObject manager, PartnerQuery query);
JSONObject listClientsByApp(JSONObject manager, AppMerchantBean query);
List<JSONObject> listPartners(JSONObject manager, PartnerQuery query); List<JSONObject> listPartners(JSONObject manager, PartnerQuery query);
@Transactional @Transactional
@ -407,4 +411,5 @@ public interface ClientManager {
void partnerCBChannelConfig(String clientMoniker, String channelKey, String channel_id); void partnerCBChannelConfig(String clientMoniker, String channelKey, String channel_id);
void addDevice(JSONObject manager, String clientMoniker, JSONObject device);
} }

@ -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.core.utils.OrderExpiryRuleResolver;
import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper; 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.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.application.core.SimpleClientApplyService;
import au.com.royalpay.payment.manage.device.core.DeviceManager; import au.com.royalpay.payment.manage.device.core.DeviceManager;
import au.com.royalpay.payment.manage.management.sysconfig.core.impls.PermissionPartnerManagerImpl; 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); 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<JSONObject> listGroupBds = financialBDConfigMapper.listGroupBds(bdConfig.getString("bd_group"));
List<String> 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<JSONObject> 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) { private void orgIds(JSONObject params, int orgId) {
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("parent_org_id", params.getString("org_id")); param.put("parent_org_id", params.getString("org_id"));
@ -623,6 +687,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject clientConfig = new JSONObject(); JSONObject clientConfig = new JSONObject();
clientConfig.put("client_id", partner.getIntValue("client_id")); clientConfig.put("client_id", partner.getIntValue("client_id"));
clientConfig.put("client_moniker", partner.getString("client_moniker")); 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); clientConfigService.save(clientConfig);
permissionPartnerManagerImpl.permissionClientModuleSave(partner.getIntValue("client_id"), partner.getString("client_moniker")); permissionPartnerManagerImpl.permissionClientModuleSave(partner.getIntValue("client_id"), partner.getString("client_moniker"));
} catch (Exception e) { } catch (Exception e) {
@ -691,6 +758,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
clientMapper.update(updateInfo); clientMapper.update(updateInfo);
saveOrUpdateMailList(updateInfo, client); 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); clientInfoCacheSupport.clearClientCache(clientId);
} }
@ -816,7 +889,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
JSONObject yeepayConfigValid =yeePayClientConfigMapper.findMerchantConfig(client.getIntValue("client_id")); JSONObject yeepayConfigValid =yeePayClientConfigMapper.findMerchantConfig(client.getIntValue("client_id"));
yeePayClientConfigMapper.updateSubMerchantIdValid(yeepayConfigValid.getString("yeepay_config_id"),0); 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); yeePayClientConfigMapper.updateSubMerchantIdValid(yeepayConfig.getString("yeepay_config_id"),1);
client.put("yeepay_sub_merchant_id",yeepaySubMerchantInfo.getString("yeepay_sub_merchant_id")); client.put("yeepay_sub_merchant_id",yeepaySubMerchantInfo.getString("yeepay_sub_merchant_id"));
clientMapper.update(client); clientMapper.update(client);
@ -2079,6 +2152,24 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return PageListUtils.buildPageListResult(devices); 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 @Override
public void updateDevie(JSONObject manager, String clientMoniker, String devId, String remark) { public void updateDevie(JSONObject manager, String clientMoniker, String devId, String remark) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
@ -2101,12 +2192,18 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
throw new InvalidShortIdException(); throw new InvalidShortIdException();
} }
checkOrgPermission(manager, client); checkOrgPermission(manager, client);
JSONObject dev = clientDeviceMapper.find(devId); JSONObject deviceInfo = clientDeviceMapper.find(devId);
if (dev.getIntValue("client_id") != client.getIntValue("client_id")) { if (deviceInfo.getIntValue("client_id") != client.getIntValue("client_id")) {
throw new NotFoundException("设备不存在"); throw new NotFoundException("设备不存在");
} }
dev.put("is_valid", enable); if (StringUtils.equals(InspiryPOSFinder.INSPIRY_DEVICE_TYPE, deviceInfo.getString("client_type")) && enable) {
clientDeviceMapper.update(dev); 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 @Override

@ -446,6 +446,7 @@ public class PartnerManageController {
clientManager.registerClient(clientMoniker, registery, manager); clientManager.registerClient(clientMoniker, registery, manager);
} }
//商户设备管理 获取商户设备信息
@ManagerMapping(value = "/{clientMoniker}/devices", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.DIRECTOR}) @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, public JSONObject listClientDevices(@PathVariable String clientMoniker, @RequestParam(required = false) String remark, @RequestParam(required = false) String client_type,
@RequestParam(required = false) String[] client_ids, @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); 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}) @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, public void modifyDevice(@PathVariable String clientMoniker, @PathVariable String devId, @RequestBody JSONObject remark,
@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {

@ -201,7 +201,7 @@ public class PartnerViewController {
@PartnerMapping(value = "/accounts/{accountId}", method = RequestMethod.DELETE, roles = PartnerRole.ADMIN) @PartnerMapping(value = "/accounts/{accountId}", method = RequestMethod.DELETE, roles = PartnerRole.ADMIN)
@ResponseBody @ResponseBody
public void disableAccount(@PathVariable String accountId, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { 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"); throw new BadRequestException("You cannot disable yourself");
} }
clientManager.disableAccount(null, account.getString("client_moniker"), accountId); clientManager.disableAccount(null, account.getString("client_moniker"), accountId);

@ -788,6 +788,7 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
ctx.setVariable("description", event.getString("description")); ctx.setVariable("description", event.getString("description"));
ctx.setVariable("is_send_client",event.getIntValue("is_send_client")); 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("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 realOrderIdsStr = event.getString("real_order_ids");
String[] realOrderIds = {}; String[] realOrderIds = {};
if (StringUtils.isNotBlank(realOrderIdsStr)) { if (StringUtils.isNotBlank(realOrderIdsStr)) {

@ -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", "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", "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", "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) { for (String col : columns) {
simpleClient.put(col, client.get(col)); simpleClient.put(col, client.get(col));
} }

@ -1302,6 +1302,7 @@ public class TradeLogServiceImpl implements TradeLogService {
JSONObject client = partner.getJSONObject("client"); JSONObject client = partner.getJSONObject("client");
String timezone = client.getString("timezone"); String timezone = client.getString("timezone");
JSONObject params = query.toParams(timezone); JSONObject params = query.toParams(timezone);
params.put("client_id",client.getString("client_id"));
List<JSONObject> clientOrderList = transactionMapper.getClientOrderByTransactionTime(params); List<JSONObject> clientOrderList = transactionMapper.getClientOrderByTransactionTime(params);
List<Integer> clientOrders = new ArrayList<>(clientOrderList.size()); List<Integer> clientOrders = new ArrayList<>(clientOrderList.size());
clientOrderList.parallelStream().forEach(p->{ clientOrderList.parallelStream().forEach(p->{

@ -1,6 +1,6 @@
spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.schema-name=royalpay_production 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.url=jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=root spring.datasource.password=root

@ -1,6 +1,6 @@
spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.schema-name=royalpay_production 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.url=jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=root spring.datasource.password=root

@ -1,6 +1,6 @@
server.port=5000 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 env.company=RoyalPay
@ -22,11 +22,11 @@ spring.redis.host=127.0.0.1
spring.redis.port=6379 spring.redis.port=6379
spring.redis.database=1 spring.redis.database=1
spring.data.mongodb.host=10.30.0.8 #spring.data.mongodb.host=192.168.0.111
spring.data.mongodb.port=27017 #spring.data.mongodb.port=27017
spring.data.mongodb.database=admin #spring.data.mongodb.database=admin
spring.data.mongodb.username=mongouser #spring.data.mongodb.username=mongouser
spring.data.mongodb.password=Royalpay123 #spring.data.mongodb.password=Royalpay123
mybatis.autosql.default-dialect=mysql 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/2017/11/17/1510890355946_hQt6yGc0NJ8TYeK7XCuuSAnTI31M7v.pdf
app.agreetemplate.aggregate.path=https://file.royalpay.com.au/open/2019/02/12/1549950518019_vW4tU5t6D6yA0wMSDNBB9G195W3g99.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.main=https://mpay.royalpay.com.au/
app.host.regions.cn=https://mpay-cn.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.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.debug=true
app.name=RoyalPay 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.server.ip=127.0.0.1
app.redpack_auth.enable=false app.redpack_auth.enable=false
hf.rsa-file=/opt/2000604000101.pfx hf.rsa-file=/opt/2000604000101.pfx
##积分商城 ##积分商城
@ -88,8 +94,9 @@ app.mail.appid=1
app.mail.host=https://mailsupport.royalpay.com.au app.mail.host=https://mailsupport.royalpay.com.au
mail.send.credentialCode=Fd1aRfdjc9 mail.send.credentialCode=Fd1aRfdjc9
apple.message.apns.password=F1b5*ChJPp73 app.sandbox=true
apple.message.apns.file=/opt/adn 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.secret=2b96d9bc6169c9554218aab1
android.message.appkey=3f33a10d0a7d4ac94d8f2431 android.message.appkey=3f33a10d0a7d4ac94d8f2431

@ -19,6 +19,24 @@
]]> ]]>
</select> </select>
<select id="getBDConfigById" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT
m.manager_id,
m.display_name,
c.bd_level,
c.city,
c.get_prize,
c.bd_group,
c.kpi_amount,
m.is_valid
FROM sys_managers m
LEFT JOIN financial_bd_config c ON c.manager_id = m.manager_id
WHERE m.role & 4 > 0 AND (m.org_id = 1 OR m.org_id IS NULL)
AND m.manager_id=#{manager_id}
]]>
</select>
<select id="listGroupBds" resultType="com.alibaba.fastjson.JSONObject"> <select id="listGroupBds" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[ <![CDATA[
SELECT c.* SELECT c.*

@ -1,6 +1,22 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="au.com.royalpay.payment.manage.mappers.financial.FinancialPartnerCommissionMapper"> <mapper namespace="au.com.royalpay.payment.manage.mappers.financial.FinancialPartnerCommissionMapper">
<select id="getOrgPrizeList" resultType="com.alibaba.fastjson.JSONObject">
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
</select>
<select id="getOrgPrizeDetail" resultType="com.alibaba.fastjson.JSONObject">
SELECT *
FROM financial_partner_commission
WHERE org_id = #{org_id}
AND
`year` = year(month)
AND `month` = month(month)
</select>
<select id="listAvailableMonths" resultType="java.lang.Integer"> <select id="listAvailableMonths" resultType="java.lang.Integer">
SELECT DISTINCT `month` SELECT DISTINCT `month`
FROM financial_partner_commission FROM financial_partner_commission
@ -81,4 +97,12 @@
ORDER BY c.year DESC,c.month DESC ORDER BY c.year DESC,c.month DESC
</select> </select>
<select id="findTotalByOrg" resultType="com.alibaba.fastjson.JSONObject">
SELECT
SUM(gross_amount) total_amount,
SUM(org_charge) total_prize
FROM financial_partner_commission
WHERE org_id=#{org_id} AND year=#{year} AND month=#{month}
</select>
</mapper> </mapper>

@ -1116,10 +1116,15 @@
SELECT t.clearing_order SELECT t.clearing_order
FROM pmt_transactions t FROM pmt_transactions t
WHERE t.channel='Settlement' WHERE t.channel='Settlement'
AND t.client_id IN <if test="client_ids!=null">
<foreach collection="client_ids" open="(" close=")" separator="," item="clientId"> AND t.client_id IN
#{clientId} <foreach collection="client_ids" open="(" close=")" separator="," item="client_id">
</foreach> #{client_id}
</foreach>
</if>
<if test="client_ids==null">
and t.client_id=#{client_id}
</if>
<if test="from!=null">and t.transaction_time &gt;= #{from}</if> <if test="from!=null">and t.transaction_time &gt;= #{from}</if>
<if test="to!=null">and t.transaction_time &lt; #{to}</if> <if test="to!=null">and t.transaction_time &lt; #{to}</if>
</select> </select>

@ -154,6 +154,85 @@
<if test="is_valid">and c.is_valid=1</if> <if test="is_valid">and c.is_valid=1</if>
</where> </where>
</select> </select>
<select id="listLessInfoPartners" resultType="com.alibaba.fastjson.JSONObject">
SELECT DISTINCT c.client_moniker,c.source,c.approve_result,c.short_name,c.company_phone,c.approve_time,c.create_time,c.open_status,c.address,c.state,c.suburb,c.is_valid,c.postcode,c.country,o.name org_name
FROM sys_clients c
inner join sys_client_config cc on cc.client_id = c.client_id
inner join sys_org o
on o.org_id=c.org_id
<if test="bd_user!=null">
INNER JOIN sys_client_bd d ON c.client_id = d.client_id AND d.bd_id = #{bd_user} and
date(d.start_date)&lt;= date(now()) and (d.end_date is null or date(d.end_date)&gt;= date(now())) and
d.is_valid=1
</if>
<where>
<if test="bd_group!=null">and c.client_id in
(SELECT b.client_id FROM sys_client_bd b
INNER JOIN financial_bd_config fb ON fb.manager_id=b.bd_id
where b.is_valid=1 and b.start_date&lt;=now() and (b.end_date is null or b.end_date &gt;= now())
AND (fb.bd_group=#{bd_group} or fb.manager_id=#{bd_group})
)
</if>
<if test="approving">
and ((c.approve_result=4 and c.open_status is null) or (c.approve_result=3 and c.open_status is null) or
c.open_status=1 or c.open_status=2 or c.open_status=4)
</if>
<if test="quickPass">
and c.source=4
</if>
<if test="greenChannel">
and ((c.source=1 or c.source=2) and c.approve_result=2 or c.open_status=10)
</if>
<if test="greenChannelBdTodo">
and ((c.source=1 or c.source=2) and c.approve_result=2 and (c.open_status is null or c.open_status=3))
</if>
<if test="pass">
and c.open_status = 5 AND c.approve_result = 1 AND c.approve_time IS NOT NULL
</if>
<if test="completed_contract">
and c.open_status IS NULL AND c.approve_result IS NULL AND c.source != 4
</if>
<if test="apply_to_back">
AND c.approve_result = 5 AND c.approve_time is NOT NULL
</if>
<if test="bd_upload_material">
AND c.open_status = 3 AND c.approve_result != 5
</if>
<if test="search_text!=null">
<bind name="name_pattern" value="'%'+search_text+'%'"/>
<if test="text_type=='all'">
and (c.client_moniker=#{search_text} or c.short_name like #{name_pattern} or c.company_name like
#{name_pattern} or c.business_name like #{name_pattern} or c.remark like
#{name_pattern} or c.contact_email=#{search_text})
</if>
<if test="text_type=='client_moniker'">
and c.client_moniker=#{search_text}
</if>
<if test="text_type=='client_name'">
and c.short_name like #{name_pattern}
</if>
<if test="text_type=='company_name'">
and c.company_name like #{name_pattern}
</if>
<if test="text_type=='business_name'">
and c.business_name like #{name_pattern}
</if>
<if test="text_type=='contact_email'">
and c.contact_email = #{search_text}
</if>
<if test="text_type=='remark'">
and c.remark like #{name_pattern}
</if>
</if>
<if test="org_id!=null and org_ids==null">and c.org_id=#{org_id}</if>
<if test="org_ids!=null">and c.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
<if test="is_valid">and c.is_valid=0</if>
</where>
</select>
<select id="comListPartners" resultType="com.alibaba.fastjson.JSONObject"> <select id="comListPartners" resultType="com.alibaba.fastjson.JSONObject">
SELECT DISTINCT c.*,o.name org_name SELECT DISTINCT c.*,o.name org_name
FROM sys_clients c FROM sys_clients c
@ -444,4 +523,15 @@
<select id="findByrpayNotNull" resultType="com.alibaba.fastjson.JSONObject"> <select id="findByrpayNotNull" resultType="com.alibaba.fastjson.JSONObject">
select * FROM sys_clients WHERE rpay_enterprise_id != '' select * FROM sys_clients WHERE rpay_enterprise_id != ''
</select> </select>
<select id="countBdApproveClients" resultType="com.alibaba.fastjson.JSONObject">
SELECT SUM(IF(((approve_result=4 AND open_status IS NULL) OR (approve_result=3 AND open_status IS NULL) OR
open_status=1 OR open_status=2 OR open_status=4),1,0)) approving,
SUM(IF((open_status = 5 AND approve_result = 1 AND approve_time IS NOT NULL),1,0)) pass,
SUM(IF((YEAR(approve_time)=YEAR(now()) and MONTH(approve_time)=MONTH(now()) AND approve_result = 1 AND open_status = 5),1,0)) this_months_pass
FROM sys_clients
WHERE
<bind name="manager_id_pattern" value="'%'+manager_id+'%'"/>
bd_user LIKE #{manager_id_pattern} AND is_valid=1;
</select>
</mapper> </mapper>

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="au.com.royalpay.payment.manage.mappers.system.ManageDeviceTokenMapper">
<select id="findByDevId" resultType="com.alibaba.fastjson.JSONObject">
SELECT * FROM sys_manage_devices_token where dev_id=#{dev_id} limit 1
</select>
</mapper>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

@ -0,0 +1,97 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Title</title>
<link href="https://cdn.bootcss.com/twitter-bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" src="//cdn.bootcss.com/angular.js/1.4.8/angular.min.js"></script>
<script type="text/javascript">
angular.module('bdRulesApp', []).controller('bdRulesCtrl', ['$scope', '$http', function ($scope, $http) {
$scope.kpiRanges = [{value: 1, label: '0-50%'}, {value: 2, label: '50%~80%'}, {value: 3, label: '80%~100%'},
{value: 4, label: '100%-120%'}, {value: 5, label: '>=120%'}];
$http.get('/app/rules/bd/config').then(function (resp) {
$scope.bd_rate_configs = resp.data;
$scope.kpi_ranges = [];
var kpiStart = [];
angular.forEach($scope.bd_rate_configs, function (cfg) {
if (kpiStart.indexOf(cfg.kpi_range) < 0) {
kpiStart.push(cfg.kpi_range);
$scope.kpi_ranges.push(cfg);
}
})
})
}]);
</script>
</head>
<style>
.box-body ul {
margin: 0;
padding-left: 20px;
}
.box-body ul li {
margin-bottom: 15px;
}
.clear {
clear: both;
}
</style>
<body ng-app="bdRulesApp" ng-controller="bdRulesCtrl">
<div class="box box-info" style="margin: 25px">
<div class="box-body">
<h4>BD分级提成费率速查表</h4>
<div class="table-responsive">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>BD Level</th>
<th rowspan="2">KPI完成度</th>
<th colspan="2">Junior BD</th>
<th colspan="2">Intermediate BD</th>
<th colspan="2">Senior BD</th>
</tr>
<tr>
<th>费率</th>
<th>0.6-0.79</th>
<th>0.8-2.0</th>
<th>0.6-0.79</th>
<th>0.8-2.0</th>
<th>0.6-0.79</th>
<th>0.8-2.0</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="range in kpi_ranges">
<td ng-bind="'#'+($index+1)"></td>
<td ng-bind="(kpiRanges|filter:{value:range.kpi_range})[0].label"></td>
<td ng-repeat-start="level in [1,2,3] track by $index"
ng-bind="(bd_rate_configs|filter:{kpi_range:range.kpi_range,bd_level:level,rate_from:0.6})[0].prize_rate+'%'"></td>
<td ng-repeat-end
ng-bind="(bd_rate_configs|filter:{kpi_range:range.kpi_range,bd_level:level,rate_from:0.8})[0].prize_rate+'%'"></td>
</tr>
</tbody>
</table>
</div>
<h4>补充说明</h4>
<ul>
<li>按月度发放</li>
<li>每月发放总提成额度的60%剩余40%按照“年度考评分数比例”于每年年底即12 月25 日圣诞前发放</li>
<li>提前离职者40%提成不予发放</li>
<li>年度考评根据销管中心每月考评表打分制进行统计按照考评分数对应比例发放40%的占比部分扣下部分如果第二年考评超出一定评分110%可以补发同样如果年度考评分数超过100 分按照同比例发放</li>
<li>商户开通后连续 1 个月未产生流水的,上交主管,由主管重新分配</li>
<li>连续 2 个月不产生流水的商户,由销管部统一收回,重新分配</li>
<li>分配后的商户流水客户专员只能占一半</li>
<li>离职及调岗人员商户统一上交销管中心,由销管中心 leader 及跨境事业部总监相互协商及相互监督,按照公平公正的原则, 做出分配方案,并由总监确认后统一分配。调岗人员移交的商户,在移交后 1 个月内移交人员和接收人员平分该商家产生的提成,移交人员需配合接收人员做好商户对接和短期内的商户维护;
离职人员交接的商户提成,接收人员享受一半的提成,另一半作为跨境客服专员福利会基金</li>
<li>被客户投诉情况严重者,此商户由销管中心无条件收回重新分配</li>
<li>活动执行未传达到位且出现舞弊、徇私、懒惰等行为的,商户上交由销管中心统一分配</li>
<li>后期维护不及时,连续一个月不跟踪者,此商户上交销管中心,统一重新分配</li>
<li>以上分配,销管中心 leader 和跨境支付事业部商量好之后需做好方案后经 COO 审批方可执行</li>
</ul>
</div>
</div>
</body>
</html>

@ -0,0 +1,65 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Title</title>
<link href="https://cdn.bootcss.com/twitter-bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
</head>
<style>
.box-body ul {
margin: 0;
padding-left: 20px;
}
.box-body ul li {
margin-bottom: 15px;
}
.clear {
clear: both;
}
</style>
<body>
<div style="margin: 25px">
<section class="content">
<div class="box box-info">
<div class="box-body container">
<div style="margin-left: -5px" class="box-row">
<h5 style="float:left">合伙人提成计算说明</h5>
<p style="float: right;color:#cccccc">2018-11-30更新</p>
<div class="clear"></div>
</div>
<div style="padding-left: 20px;margin-bottom: 20px">
合伙人提成算法:按照合伙人签约的商户下每笔订单计算合伙人提成,提成规则明细如下: &nbsp&nbsp
<span style="color:orange">(取整规则为四舍五入保留2位小数)</span>
</div>
<ul>
<li>单笔订单 :&nbsp&nbsp(单笔订单交易金额 * 商家签约费率)<span style="color:orange">取整</span> &nbsp&nbsp&nbsp -
&nbsp&nbsp单笔订单交易金额 * 组织成本费率)<span style="color:orange">取整</span> &nbsp&nbsp&nbsp
= &nbsp&nbsp&nbsp单笔订单合伙人提成
</li>
<li>总交易额 : &nbsp合伙人签约的商户累计交易额</li>
<li>平台手续费:合伙人签约的商户(单笔订单交易金额 * 组织成本费率)<span style="color:orange">取整</span> 累加</li>
<li>合伙人提成: 每笔订单合伙人提成累加</li>
</ul>
<div style="width:100%;background:#cccccc;height:1px;margin-bottom: 20px"></div>
<div style="padding-left: 20px;margin-bottom: 20px">如合伙人存在二级代理,可从二级代理的交易额中得到分润,分润规则如下:</div>
<ul>
<li>二级代理合伙人提成计算规则如同一级代理,分润从平台手续费中扣除。</li>
<li>如A合伙人与平台签约组织成本费率为1.5%A合伙人的二级代理B的签约组织成本费率为1.8%B的商户签约费率为3%</li>
<li>假设B当月只有一笔交易且交易额为1000总手续费为30平台手续费为18B合伙人提成为12。</li>
<li>计算A的分润时会将B的交易额1000 * A的组织成本费率 1.5% = 15A的分润就是 18-15=3而B合伙人平台手续费为15其中扣除3是A的分润</li>
</ul>
<h5>补充说明</h5>
<ul style="color:orange;font-size: 13px">
<li style="margin-bottom: 10px">退款成功的订单不计入合伙人提成内</li>
<li>当本月有合伙人手续费存在欠款时,无法下载汇款文件</li>
</ul>
</div>
</div>
</section>
</div>
</body>
</html>

@ -79,8 +79,8 @@
<p th:if="${refuse_description != null}"> <p th:if="${refuse_description != null}">
拒绝理由:<span th:text="${refuse_description}" style="background-color: yellow"></span> 拒绝理由:<span th:text="${refuse_description}" style="background-color: yellow"></span>
</p> </p>
<p>近期由于我们的风控系统检测到您的交易异常<span th:if="${royalpay_order_type==1}">已暂时将您的清算周期调整为T+<span th:text="${client.clean_days}"></span></span>,还请您提供以下材料,还原附件中列明的交易的真实背景:<br> <p>近期由于我们的风控系统检测到您的交易异常<span th:if="${royalpay_order_type==1 and send_clean_days==1}">已暂时将您的清算周期调整为T+<span th:text="${client.clean_days}"></span></span>,还请您提供以下材料,还原附件中列明的交易的真实背景:<br>
RoyalPay's risk management system recently has identified abnormal transactions from your records<span th:if="${royalpay_order_type==1}">, clean days has been adjusted to T+<span th:text="${client.clean_days}"></span></span>.so please provide us with following materials to assist in verifying the real scenario of the transactions attached:</p> RoyalPay's risk management system recently has identified abnormal transactions from your records<span th:if="${royalpay_order_type==1 and send_clean_days==1}">, clean days has been adjusted to T+<span th:text="${client.clean_days}"></span></span>.so please provide us with following materials to assist in verifying the real scenario of the transactions attached:</p>
<p>1.请解释相应的消费场景/业务模式,例如网站商城,扫码支付, 消费者到店支付等;<br> <p>1.请解释相应的消费场景/业务模式,例如网站商城,扫码支付, 消费者到店支付等;<br>
&nbsp;&nbsp;Please explain the relative payment scenario/business activities, for example, online store, QR code payment, payment at the store, etc;</p> &nbsp;&nbsp;Please explain the relative payment scenario/business activities, for example, online store, QR code payment, payment at the store, etc;</p>
<p>2.提供相应购物清单,订单小票(请提供与被查交易订单号相匹配的交易时间及金额的发票);<br>  <p>2.提供相应购物清单,订单小票(请提供与被查交易订单号相匹配的交易时间及金额的发票);<br> 

@ -899,7 +899,7 @@ margin-bottom: 10%;"/>
</li> </li>
</ul> </ul>
</li> </li>
<li ng-if="([1,2]|withRole)"> <li ng-if="([1,2]|withRole) &&(currentUser.client.surcharge_mode=='distributed')">
<ul> <ul>
<li> <li>
<a ui-sref="surcharge_account"> <a ui-sref="surcharge_account">

@ -472,6 +472,11 @@ margin-bottom: 10%;"/>
<i class="fa fa-money"></i> <span>合同签约情况</span> <i class="fa fa-money"></i> <span>合同签约情况</span>
</a> </a>
</li> </li>
<li ui-sref-active="active">
<a ui-sref="surcharge_account_month">
<i class="fa fa-bell"></i> <span>后付费收款</span>
</a>
</li>
<li ui-sref-active="active"> <li ui-sref-active="active">
<a ui-sref="rate_warnings"> <a ui-sref="rate_warnings">
<i class="fa fa-bell"></i> <span>签约到期预警</span> <i class="fa fa-bell"></i> <span>签约到期预警</span>
@ -603,11 +608,6 @@ margin-bottom: 10%;"/>
<i class="fa fa-tv"></i> <span>商户欠款|Pre Refund</span> <i class="fa fa-tv"></i> <span>商户欠款|Pre Refund</span>
</a> </a>
</li> </li>
<li ui-sref-active="active">
<a ui-sref="surcharge_account_month">
<i class="fa fa-bell"></i> <span>手续费账户月度统计</span>
</a>
</li>
</ul> </ul>
</li> </li>

@ -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) { function ($scope, $state, $http, $uibModal, $filter, commonDialog, industryMap, chartParser) {
$scope.orderTypes = orderTypesMap; $scope.orderTypes = orderTypesMap;
$scope.orderTypesForBD = orderTypesMapForBD; $scope.orderTypesForBD = orderTypesMapForBD;
@ -328,11 +328,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
}).then(function () { }).then(function () {
$http.delete('/risk/business/ban/' + $scope.riskEvent.risk_id).then(function () { $http.delete('/risk/business/ban/' + $scope.riskEvent.risk_id).then(function () {
$state.go('analysis_monitoring.risk_business'); $state.go('analysis_monitoring.risk_business');
commonDialog.alert({ commonDialog.alert({title: 'Delete', content: 'Risk Event Already Disabled', type: 'error'});
title: 'Delete',
content: 'Risk Event Already Disabled',
type: 'error'
});
}, function (resp) { }, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); 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'); window.open(url, '_blank');
}; };
$scope.increase = function($index) { $scope.increase = function ($index) {
$scope.materials.splice($index + 1, 0, $scope.materials.splice($index + 1, 0,
{key: new Date().getTime(), value: ""}); // 用时间戳作为每个item的key {key: new Date().getTime(), value: ""}); // 用时间戳作为每个item的key
// 增加新的input后允许删除 // 增加新的input后允许删除
@ -759,7 +755,11 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
$scope.changeIsSendClient = function(flag) { $scope.changeIsSendClient = function(flag) {
$scope.is_send_client = 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) { if (form.$invalid) {
angular.forEach(form, function (item, key) { angular.forEach(form, function (item, key) {
if (key.indexOf('$') < 0) { 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.is_send_client = $scope.is_send_client;
$scope.riskEvent.send_clean_days = $scope.send_clean_days;
var saveRiskBtn = document.getElementById('save-risk-btn'); var saveRiskBtn = document.getElementById('save-risk-btn');
var saveRiskBtnInnerHtmlBak = saveRiskBtn.innerHTML; var saveRiskBtnInnerHtmlBak = saveRiskBtn.innerHTML;
saveRiskBtn.disabled = true; saveRiskBtn.disabled = true;
@ -856,8 +858,8 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
} }
}); });
app.filter('royalPayOrderType', function() { app.filter('royalPayOrderType', function () {
return function(type) { return function (type) {
return royalpayOrderTypesMap[type]; return royalpayOrderTypesMap[type];
} }
}); });

@ -1,3 +1,4 @@
<section class="content-header"> <section class="content-header">
<h1>New RiskEvent</h1> <h1>New RiskEvent</h1>
</section> </section>
@ -55,6 +56,15 @@
</div> </div>
</div> </div>
</div> </div>
<div class="form-group" ng-if="riskEvent.order_type ==3 && riskEvent.royalpay_order_type==1">
<label class="control-label col-sm-2">是否发送清算周期变更</label>
<div class="col-xs-6">
<input type="checkbox"
ng-model="send_clean_days"
ng-change="changeSendCleanDays(send_clean_days)"
bs-switch>
</div>
</div>
<div class="form-group" <div class="form-group"
ng-if="riskEvent.order_type == 4" ng-if="riskEvent.order_type == 4"
ng-class="{'has-error':riskEventForm.warning_order_type.$invalid && riskEventForm.warning_order_type.$dirty}"> ng-class="{'has-error':riskEventForm.warning_order_type.$invalid && riskEventForm.warning_order_type.$dirty}">

@ -175,6 +175,16 @@
</div> </div>
</div> </div>
<div class="form-group" ng-if="riskEvent.order_type ==3 && riskEvent.royalpay_order_type==1">
<label class="control-label col-sm-2">是否发送清算周期变更</label>
<div class="col-xs-6">
<input type="checkbox"
bs-switch
switch-readonly="true"
ng-model="riskEvent.send_clean_days">
</div>
</div>
<div ng-if="clientInfo != null"> <div ng-if="clientInfo != null">
<div class="form-group" ng-if="riskEvent.result_type <= 2"> <div class="form-group" ng-if="riskEvent.result_type <= 2">
<label class="control-label col-sm-2">Operaction</label> <label class="control-label col-sm-2">Operaction</label>
@ -569,6 +579,15 @@
</div> </div>
</div> </div>
<div class="form-group" ng-if="riskEvent.order_type ==3 && riskEvent.royalpay_order_type==1">
<label class="control-label col-sm-2">是否发送清算周期变更</label>
<div class="col-xs-6">
<input type="checkbox"
bs-switch
ng-model="riskEventEdit.send_clean_days">
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2" <label class="control-label col-sm-2"
for="channel-result-input">Channel Handle Result for="channel-result-input">Channel Handle Result

@ -45,6 +45,17 @@ define(['../app', 'jquery'], function (app, $) {
} }
}); });
var offlineDesc = [];
$.ajax({
url: '/static/data/client_offline_desc.json',
method: 'GET',
async: false,
dataType: 'json',
success: function (data) {
offlineDesc = data;
}
});
app.filter('partner_state', ['stateMap', function (stateMap) { app.filter('partner_state', ['stateMap', function (stateMap) {
return function (stateValue) { return function (stateValue) {
@ -163,6 +174,29 @@ define(['../app', 'jquery'], function (app, $) {
}]); }]);
app.filter('partner_offline_desc', ['$http', function ($http) {
return function (industryCode) {
var industryLabel = '';
angular.forEach(offlineDesc, function (category) {
if (category.value == industryCode) {
industryLabel = category.label;
}
angular.forEach(category.children, function (categoryChildren1) {
if (categoryChildren1.value == industryCode) {
industryLabel = categoryChildren1.label;
}
angular.forEach(categoryChildren1.children, function (categoryChildren2) {
if (categoryChildren2.value == industryCode) {
industryLabel = categoryChildren2.label;
}
});
});
});
return industryLabel;
}
}]);
app.filter('partner_sector', ['sectorMap', function (sectorMap) { app.filter('partner_sector', ['sectorMap', function (sectorMap) {
return function (sectorValue) { return function (sectorValue) {
var sectorLabel = ''; var sectorLabel = '';

@ -68,9 +68,14 @@
</div> </div>
<div class="box-body"> <div class="box-body">
<ul class="small"> <ul class="small">
<li>完成当月指标低于 51%,提成按照 0.005%提取</li> <!--<li>完成当月指标低于 51%,提成按照 0.005%提取</li>-->
<li>完成当月指标高于 80%,提成按照 0.008%提取</li> <!--<li>完成当月指标高于 80%,提成按照 0.008%提取</li>-->
<li>完成当月指标 100%,提成按照 0.01%</li> <!--<li>完成当月指标 100%,提成按照 0.01%</li>-->
<li>享受墨尔本和悉尼两地部门流水总和提成</li>
<li>完成当月指标提成按照0.005%提取</li>
<li>未完成当月指标提成按照0.001%提取</li>
<li>连续四个月未完成指标,撤职处理或回归原有职位</li>
<li>销售总监任职后需将自己手头客户按照公司规定公平分配给客户专员本人可挂靠50%,每个商户享受50%的流水提成</li>
</ul> </ul>
</div> </div>
<div class="box-header with-border"> <div class="box-header with-border">
@ -78,8 +83,8 @@
</div> </div>
<div class="box-body"> <div class="box-body">
<ul class="small"> <ul class="small">
<li>完成月度指标,当月部门提成为该部门总流水的 0.01%</li> <li>完成月度指标,当月部门提成为该部门总流水的0.005%</li>
<li>未完成月度指标,当月部门提成为该部门总流水的 0.005%</li> <li>未完成月度指标,当月部门提成为该部门总流水的0.001%</li>
</ul> </ul>
</div> </div>
<!--<div class="box-header with-border"> <!--<div class="box-header with-border">

@ -153,9 +153,9 @@
<h4>补充说明</h4> <h4>补充说明</h4>
<ul> <ul>
<li>按月度发放</li> <li>按月度发放</li>
<li>每月发放总提成额度的 80%,剩余 20%按照“年度考评分数比例”于每年年底即 12 月 25 日圣诞前发放</li> <li>每月发放总提成额度的60%剩余40%按照“年度考评分数比例”于每年年底即12 月25 日圣诞前发放</li>
<li>提前离职者,20%提成不予发放</li> <li>提前离职者,40%提成不予发放</li>
<li>年度考评(根据销管中心每月考评表打分制进行统计)按照考评分数对应比例发放 20%的占比部分,扣下部分如果第二年考评超出一定评分 110%可以补发;同样,如果年度考评分数超过 100 分按照同比例发放</li> <li>年度考评(根据销管中心每月考评表打分制进行统计)按照考评分数对应比例发放40%的占比部分扣下部分如果第二年考评超出一定评分110%可以补发同样如果年度考评分数超过100 分按照同比例发放</li>
<li>商户开通后连续 1 个月未产生流水的,上交主管,由主管重新分配</li> <li>商户开通后连续 1 个月未产生流水的,上交主管,由主管重新分配</li>
<li>连续 2 个月不产生流水的商户,由销管部统一收回,重新分配</li> <li>连续 2 个月不产生流水的商户,由销管部统一收回,重新分配</li>
<li>分配后的商户流水客户专员只能占一半</li> <li>分配后的商户流水客户专员只能占一半</li>

@ -2,12 +2,15 @@
<section class="content"> <section class="content">
<div class="box box-info"> <div class="box box-info">
<div class="box-body"> <div class="box-body">
<h4>合伙人提成计算说明</h4> <div class="row">
<p style="float: left;font-size: 17px">合伙人提成计算说明</p>
<p style="float: right">2018-11-30更新</p>
</div>
<div class="row">
合伙人提成算法:按照合伙人签约的商户下每笔订单计算合伙人提成,提成规则明细如下: &nbsp&nbsp
<span style="color:red">(取整规则为四舍五入保留2位小数)</span>
</div>
<ul> <ul>
<li>2018-11-30更新</li>
<li>合伙人提成算法:按照合伙人签约的商户下每笔订单计算合伙人提成,提成规则明细如下: &nbsp&nbsp
<span style="color:red">(取整规则为四舍五入保留2位小数)</span>
</li>
<li>单笔订单 :&nbsp&nbsp(单笔订单交易金额 * 商家签约费率)<span style="font-size: 1px;color:red">取整</span> &nbsp&nbsp&nbsp - &nbsp&nbsp单笔订单交易金额 * 组织成本费率)<span style="font-size: 1px;color:red">取整</span> &nbsp&nbsp&nbsp <li>单笔订单 :&nbsp&nbsp(单笔订单交易金额 * 商家签约费率)<span style="font-size: 1px;color:red">取整</span> &nbsp&nbsp&nbsp - &nbsp&nbsp单笔订单交易金额 * 组织成本费率)<span style="font-size: 1px;color:red">取整</span> &nbsp&nbsp&nbsp
= &nbsp&nbsp&nbsp单笔订单合伙人提成</li> = &nbsp&nbsp&nbsp单笔订单合伙人提成</li>
<li>总交易额 : &nbsp合伙人签约的商户累计交易额</li> <li>总交易额 : &nbsp合伙人签约的商户累计交易额</li>
@ -19,12 +22,9 @@
<li>如A合伙人与平台签约组织成本费率为1.5%A合伙人的二级代理B的签约组织成本费率为1.8%B的商户签约费率为3%</li> <li>如A合伙人与平台签约组织成本费率为1.5%A合伙人的二级代理B的签约组织成本费率为1.8%B的商户签约费率为3%</li>
<li>假设B当月只有一笔交易且交易额为1000总手续费为30平台手续费为18B合伙人提成为12。</li> <li>假设B当月只有一笔交易且交易额为1000总手续费为30平台手续费为18B合伙人提成为12。</li>
<li>计算A的分润时会将B的交易额1000 * A的组织成本费率 1.5% = 15A的分润就是 18-15=3而B合伙人平台手续费为15其中扣除3是A的分润</li> <li>计算A的分润时会将B的交易额1000 * A的组织成本费率 1.5% = 15A的分润就是 18-15=3而B合伙人平台手续费为15其中扣除3是A的分润</li>
</ul> </ul>
<h4>补充说明</h4> <h4>补充说明</h4>
<ul style="color:red"> <ul style="color:red">
<li >退款成功的订单不计入合伙人提成内</li>
<li>当本月有合伙人手续费存在欠款时,无法下载汇款文件</li> <li>当本月有合伙人手续费存在欠款时,无法下载汇款文件</li>
</ul> </ul>
</div> </div>

@ -0,0 +1,54 @@
[
{
"children": [
{
"children": [],
"label": "立牌",
"value": "qrcode"
},
{
"children": [],
"label": "POS",
"value": "pos"
}
],
"label": "门店",
"value": "1"
},
{
"children": [
{
"children": [],
"label": "ipos",
"value": "ipos"
},
{
"children": [],
"label": "银豹",
"value": "pospal"
},
{
"children": [],
"label": "aupos",
"value": "aupos"
},
{
"children": [],
"label": "其他",
"value": "other"
}
],
"label": "收银系统",
"value": "2"
},{
"children": [
{
"children": [],
"label": "无门店",
"value": "no-store"
}
],
"label": "其他",
"value": "3"
}
]

@ -334,6 +334,16 @@
</div> </div>
</div> </div>
<div class="col-sm-2 col-xs-6">
<a ui-sref="surcharge_account_month" ui-sref-opts="{reload:true}">
<div class="description-block">
<img src="/static/images/main_menu/compliance_warning.png"/>
<div class="description-text">
<span>后付费收款</span>
</div>
</div>
</a>
</div>
<div class="col-sm-2 col-xs-6"> <div class="col-sm-2 col-xs-6">
<a ui-sref="rate_warnings" ui-sref-opts="{reload:true}"> <a ui-sref="rate_warnings" ui-sref-opts="{reload:true}">
@ -811,16 +821,6 @@
</div> </div>
</a> </a>
</div> </div>
<div class="col-sm-2 col-xs-6">
<a ui-sref="surcharge_account_month" ui-sref-opts="{reload:true}">
<div class="description-block">
<img src="/static/images/main_menu/transaction_arrears_green.png"/>
<div class="description-text">
<span>手续费账户月度统计</span>
</div>
</div>
</a>
</div>
</div> </div>
</div> </div>
<div class="list-group" ng-if="role=='accountant' || role=='director' || ('1000000000'|withRole)"> <div class="list-group" ng-if="role=='accountant' || role=='director' || ('1000000000'|withRole)">

@ -361,7 +361,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}; };
}]); }]);
app.controller('addPartnerCtrl', ['$rootScope', '$scope', '$http', '$state', 'Upload', 'commonDialog', 'timezone','businessStructuresMap', 'industryMap', 'stateMap', 'sectorMap', 'countryMap', function ($rootScope, $scope, $http, $state, Upload, commonDialog, timezone, businessStructuresMap, industryMap, stateMap, sectorMap, countryMap) { app.controller('addPartnerCtrl', ['$rootScope', '$scope', '$http', '$state', 'Upload', 'commonDialog', 'timezone', 'businessStructuresMap', 'industryMap', 'stateMap', 'sectorMap', 'countryMap', function ($rootScope, $scope, $http, $state, Upload, commonDialog, timezone, businessStructuresMap, industryMap, stateMap, sectorMap, countryMap) {
if ($scope.partner_application) { if ($scope.partner_application) {
$scope.partner = angular.copy($scope.partner_application); $scope.partner = angular.copy($scope.partner_application);
delete $rootScope.partner_application; delete $rootScope.partner_application;
@ -382,6 +382,12 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.bd_citys = angular.copy(bd_city_map); $scope.bd_citys = angular.copy(bd_city_map);
$scope.params = {textType: 'all', org_name: 'ALL'}; $scope.params = {textType: 'all', org_name: 'ALL'};
$scope.onOfflineDescSelect = function (selectedItem) {
$scope.partner.offline_label = selectedItem.label;
$scope.partner.client_offline_desc = selectedItem.value;
};
function remove(arr, val) { function remove(arr, val) {
if (angular.isArray(arr)) { if (angular.isArray(arr)) {
for (var i = arr.length; i--;) { for (var i = arr.length; i--;) {
@ -393,6 +399,12 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
} }
return arr; return arr;
} }
$scope.loadOfflineDesc = function () {
$http.get('/static/data/client_offline_desc.json').then(function (resp) {
$scope.client_offline_select = resp.data;
})
};
$scope.loadOfflineDesc();
var industries = angular.copy($scope.industries); var industries = angular.copy($scope.industries);
$scope.industries = remove(industries, 331); $scope.industries = remove(industries, 331);
@ -523,10 +535,20 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
} }
}) })
} }
// if ($scope.partner.client_pay_type =='online' || $scope.partner.client_pay_type =='all') {
// if (!$scope.partner.online_website && !$scope.partner.online_public_account && !$scope.partner.online_mini_program && !$scope.partner.online_app) {
// alert('线上支付场景至少填写一种方式');
// return;
// }
// }
// if(!window.frames['merchant_detail'].merchant_location){ // if(!window.frames['merchant_detail'].merchant_location){
// alert("Please Locate Merchant's Location"); // alert("Please Locate Merchant's Location");
// return; // return;
// } // }
if ($scope.params.client_pay_type==''){
alert('请选择商户支付场景')
}
$http.post('/sys/partners', $scope.partner).then(function (resp) { $http.post('/sys/partners', $scope.partner).then(function (resp) {
commonDialog.alert({title: 'Success', content: 'Register new partner successfully', type: 'success'}); commonDialog.alert({title: 'Success', content: 'Register new partner successfully', type: 'success'});
$scope.updateMerchantLocation(); $scope.updateMerchantLocation();
@ -1096,6 +1118,18 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
var origin_referrer_id = angular.copy($scope.partner.referrer_id); var origin_referrer_id = angular.copy($scope.partner.referrer_id);
$scope.partner.partner_type = $scope.partner.website ? 'website' : 'photo'; $scope.partner.partner_type = $scope.partner.website ? 'website' : 'photo';
$scope.loadOfflineDesc = function () {
$http.get('/static/data/client_offline_desc.json').then(function (resp) {
$scope.client_offline_select = resp.data;
})
};
$scope.loadOfflineDesc();
$scope.onOfflineDescSelect = function (selectedItem) {
$scope.partner.offline_label = selectedItem.label;
$scope.partner.client_offline_desc = selectedItem.value;
};
$scope.listReferrers = function () { $scope.listReferrers = function () {
$http.get('/sys/orgs/referrer').then(function (resp) { $http.get('/sys/orgs/referrer').then(function (resp) {
$scope.referrers = resp.data; $scope.referrers = resp.data;
@ -1198,10 +1232,19 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
if (!origin_referrer_id && $scope.partner.referrer_id) { if (!origin_referrer_id && $scope.partner.referrer_id) {
content = 'Update partner info successfully,But You Had add new Referrer,Please Change the BD Commission Proportion!'; content = 'Update partner info successfully,But You Had add new Referrer,Please Change the BD Commission Proportion!';
} }
// if ($scope.partner.client_pay_type =='online' || $scope.partner.client_pay_type =='all') {
// if (!$scope.partner.online_website && !$scope.partner.online_public_account && !$scope.partner.online_mini_program && !$scope.partner.online_app) {
// alert('线上支付场景至少填写一种方式');
// return;
// }
// }
// if(!window.frames['merchant_detail'].merchant_location){ // if(!window.frames['merchant_detail'].merchant_location){
// alert("Please Locate Merchant Location!"); // alert("Please Locate Merchant Location!");
// return; // return;
// } // }
if ($scope.params.client_pay_type==''){
alert('请选择商户支付场景')
}
$http.put('/sys/partners/' + $scope.partner.client_moniker, $scope.partner).then(function () { $http.put('/sys/partners/' + $scope.partner.client_moniker, $scope.partner).then(function () {
if (content != '') { if (content != '') {
commonDialog.alert({ commonDialog.alert({
@ -2818,8 +2861,13 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}) })
} }
}]); }]);
app.controller('partnerDeviceCtrl', ['$scope', '$http', 'orderService', 'commonDialog', 'refunder', function ($scope, $http, orderService, commonDialog, refunder) { app.controller('partnerDeviceCtrl', ['$scope', '$http', 'orderService', 'commonDialog', 'refunder','$uibModal', function ($scope,$http, orderService, commonDialog, refunder,$uibModal) {
$scope.pagination = {};
$scope.pagination = {};
/**
* 查看设备
* @param page
*/
$scope.listDevices = function (page) { $scope.listDevices = function (page) {
var params = angular.copy($scope.devsearch) || {}; var params = angular.copy($scope.devsearch) || {};
params.page = page || $scope.pagination.page || 1; params.page = page || $scope.pagination.page || 1;
@ -2829,6 +2877,24 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}) })
}; };
$scope.listDevices(1); $scope.listDevices(1);
/**
* 添加设备
*/
$scope.addDevice = function () {
$uibModal.open({
templateUrl: '/static/payment/partner/templates/add_device.html',
controller: 'newDeviceDialogCtrl',
resolve: {
clientMoniker: function () {
return $scope.partner.client_moniker;
}
}
}).result.then(function () {
$scope.listDevices(1);
})
};
$scope.showDeviceOrders = function (dev) { $scope.showDeviceOrders = function (dev) {
$scope.params.dev_id = dev.dev_id; $scope.params.dev_id = dev.dev_id;
$scope.listOrders(1); $scope.listOrders(1);
@ -2964,6 +3030,28 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
} }
} }
}]); }]);
app.controller('newDeviceDialogCtrl', ['$scope', '$http', 'clientMoniker', function ($scope, $http,clientMoniker) {
$scope.save = function (form) {
$scope.errmsg = null;
if (form.$invalid) {
angular.forEach(form, function (item, key) {
if (key.indexOf('$') < 0) {
item.$dirty = true;
}
});
return;
}
$http.post('/sys/partners/' + clientMoniker + '/add_device', $scope.device).then(function () {
$scope.$close();
}, function (resp) {
$scope.errmsg = resp.data.message;
})
};
}]);
app.controller('partnerChooseBDUserDialogCtrl', ['$scope', '$http', '$filter', 'partner', 'bdUsers', 'type', function ($scope, $http, $filter, partner, bdUsers, type) { app.controller('partnerChooseBDUserDialogCtrl', ['$scope', '$http', '$filter', 'partner', 'bdUsers', 'type', function ($scope, $http, $filter, partner, bdUsers, type) {
$scope.bdUsers = bdUsers.data; $scope.bdUsers = bdUsers.data;
$scope.data = {}; $scope.data = {};
@ -4518,11 +4606,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}]); }]);
app.filter('bdOrg', function () { app.filter('bdOrg', function () {
return function (bdUsers, org_id) { return function (bdUsers, org_id) {
if (org_id) { if (org_id) {

@ -2,9 +2,9 @@
* partner info in partner client * partner info in partner client
* Created by yixian on 2016-07-03. * Created by yixian on 2016-07-03.
*/ */
define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], function (angular, Decimal) { define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBootstrap'], function (angular, Decimal) {
'use strict'; 'use strict';
var app = angular.module('partnerInfoApp', ['ui.router', 'frapontillo.bootstrap-switch', 'ngFileUpload']); var app = angular.module('partnerInfoApp', ['ui.router', 'frapontillo.bootstrap-switch', 'ngFileUpload','ui.bootstrap']);
app.config(['$stateProvider', function ($stateProvider) { app.config(['$stateProvider', function ($stateProvider) {
$stateProvider.state('basic', { $stateProvider.state('basic', {
url: '/basic', url: '/basic',
@ -37,15 +37,6 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct
return $http.get('/client/partner_info/compliance/files'); return $http.get('/client/partner_info/compliance/files');
}] }]
} }
}).state('payment_materials', {
url: '/payment_materials',
templateUrl: '/static/payment/partner/templates/client_payment_materials.html',
controller: 'clientPaymentMaterialCtrl',
resolve: {
partner: ['$http', function ($http) {
return $http.get('/client/partner_info');
}]
}
}).state('basic.clearing_config', { }).state('basic.clearing_config', {
url: '/clearing_config', url: '/clearing_config',
templateUrl: '/static/payment/partner/templates/client_bankaccounts.html', templateUrl: '/static/payment/partner/templates/client_bankaccounts.html',
@ -868,16 +859,6 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct
}; };
}]); }]);
app.controller('clientPaymentMaterialCtrl', ['$scope', '$http', 'partner', function ($scope, $http, partner) {
$scope.paymentInfo = partner.data;
$scope.qrConfig = {currency: 'AUD'};
$scope.reloadQRCode = function () {
$http.get('/client/partner_info/qrcode', {params: $scope.qrConfig}).then(function (resp) {
$scope.qrcode = resp.data;
});
};
$scope.reloadQRCode();
}]);
app.controller('clientParameterCtrl', ['$scope', '$http', 'commonDialog', 'timezone', function ($scope, $http, commonDialog, timezone) { app.controller('clientParameterCtrl', ['$scope', '$http', 'commonDialog', 'timezone', function ($scope, $http, commonDialog, timezone) {
$scope.getClientConfig = function () { $scope.getClientConfig = function () {
$http.get('/client/partner_info').then(function (resp) { $http.get('/client/partner_info').then(function (resp) {
@ -969,9 +950,13 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct
}; };
$scope.loadSubPartners(); $scope.loadSubPartners();
}]); }]);
app.controller('clientDeviceCtrl', ['$scope', '$http', 'orderService', 'commonDialog', 'refunder','$filter', function ($scope, $http, orderService, commonDialog, refunder,$filter) { app.controller('clientDeviceCtrl','newDive','newDeviceDialogCtrl', ['$scope', '$http', 'orderService', 'commonDialog', 'refunder','$filter', '$uibModal', function ($scope, $http, orderService, commonDialog, refunder,$filter,$uibModal) {
$scope.pagination = {}; $scope.pagination = {};
$scope.params = {}; $scope.params = {};
/**
* 查询设备
* @param page
*/
$scope.listDevices = function (page) { $scope.listDevices = function (page) {
var params = angular.copy($scope.devsearch) || {}; var params = angular.copy($scope.devsearch) || {};
params.page = page || $scope.pagination.page || 1; params.page = page || $scope.pagination.page || 1;
@ -981,6 +966,8 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct
}) })
}; };
$scope.listDevices(1); $scope.listDevices(1);
$scope.showDeviceOrders = function (dev) { $scope.showDeviceOrders = function (dev) {
$scope.params.dev_id = dev.dev_id; $scope.params.dev_id = dev.dev_id;
$scope.listOrders(1); $scope.listOrders(1);
@ -1067,6 +1054,10 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct
$scope.refundOrder = function (order) { $scope.refundOrder = function (order) {
refunder.refunded(order.order_id) refunder.refunded(order.order_id)
}; };
}]); }]);
return app; return app;
}); });

@ -0,0 +1,59 @@
<div class="modal-header">
<h4>New Manager Device</h4>
</div>
<div class="modal-body">
<form novalidate name="deviceForm">
<div class="form-group"
ng-class="{'has-error':deviceForm.client_dev_id.$invalid && deviceForm.client_dev_id.$dirty}">
<label class="control-label" for="client_dev_id-input">* Device No</label>
<input required class="form-control text-lowercase" id="client_dev_id-input" name="client_dev_id"
ng-model="device.client_dev_id" maxlength="25">
<div ng-messages="deviceForm.client_dev_id.$error" ng-if="deviceForm.client_dev_id.$dirty">
<p class="small text-danger" ng-message="required">Device No Cannot Be Empty</p>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':deviceForm.auth_code.$invalid && deviceForm.auth_code.$dirty}">
<label class="control-label" for="auth_code-input">* Device Key</label>
<input required class="form-control" id="auth_code-input" name="auth_code"
ng-model="device.auth_code" maxlength="50">
<div ng-messages="deviceForm.auth_code.$error" ng-if="deviceForm.auth_code.$dirty">
<p class="small text-danger" ng-message="required">Device Key Cannot Be Empty</p>
</div>
</div>
<div class="form-group">
<label class="control-label" for="client_type-input">Device Type</label>
<input class="form-control" id="client_type-input" name="client_type"
ng-init="device.client_type='inspiry'" placeholder="inspiry"
ng-model="device.client_type" readonly>
</div>
<div class="form-group"
ng-class="{'has-error':deviceForm.version.$invalid && deviceForm.version.$dirty}">
<label class="control-label" for="version-input">* version</label>
<input required class="form-control" id="version-input" name="version"
ng-model="device.version" maxlength="10">
<div ng-messages="deviceForm.version.$error" ng-if="deviceForm.version.$dirty">
<p class="small text-danger" ng-message="required">Version No Cannot Be Empty</p>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':deviceForm.remark.$invalid && deviceForm.remark.$dirty}">
<label class="control-label" for="remark-input">* Remark</label>
<input required class="form-control" id="remark-input" name="remark"
ng-model="device.remark" maxlength="50">
<div ng-messages="deviceForm.remark.$error" ng-if="deviceForm.remark.$dirty">
<p class="small text-danger" ng-message="required">Remark Cannot Be Empty</p>
</div>
</div>
<div class="alert alert-danger" ng-if="errmsg" ng-bind="errmsg"></div>
</form>
</div>
<div class="modal-footer">
<div class="btn-group">
<button class="btn btn-success" type="button" ng-click="save(deviceForm)">Submit</button>
</div>
<div class="btn-group">
<button class="btn btn-danger" type="button" ng-click="$dismiss()">Cancel</button>
</div>
</div>

@ -176,6 +176,27 @@
</div> </div>
</div> </div>
</div> </div>
<div class="panel panel-default">
<div class="panel-heading">Merchant Payment Scenario</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-2">
Merchant Payment Scenario Type</label>
<div class="col-sm-8">
<p class="form-control-static"
ng-bind="partner.client_pay_type">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Merchant Payment Scenario Description</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.client_pay_desc"></p>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">Alipay Information &nbsp; <em class="small"><b>(Optional)</b></em></div> <div class="panel-heading">Alipay Information &nbsp; <em class="small"><b>(Optional)</b></em></div>
<div class="panel-body"> <div class="panel-body">

@ -28,7 +28,8 @@
width: 95%; width: 95%;
float: left; float: left;
} }
.img-size{
.img-size {
height: 100px; height: 100px;
margin-left: 20px; margin-left: 20px;
} }
@ -39,7 +40,8 @@
<i ng-if="partner.parent_client_id" class="fa fa-sitemap" title="Sub Partner"></i> <i ng-if="partner.parent_client_id" class="fa fa-sitemap" title="Sub Partner"></i>
<a class="text-primary" ng-if="'00001'|withRole" title="Mock Login" <a class="text-primary" ng-if="'00001'|withRole" title="Mock Login"
ng-href="/global/userstatus/current_manager/clients/{{partner.client_moniker}}/auth" target="_blank"><i ng-href="/global/userstatus/current_manager/clients/{{partner.client_moniker}}/auth" target="_blank"><i
class="fa fa-share"></i></a><span ng-if="partner.is_valid==0" ng-class="{pass_timeout:partner.is_valid==0}">(已禁用)</span> class="fa fa-share"></i></a><span ng-if="partner.is_valid==0"
ng-class="{pass_timeout:partner.is_valid==0}">(已禁用)</span>
</h1> </h1>
<ol class="breadcrumb"> <ol class="breadcrumb">
<li> <li>
@ -61,24 +63,26 @@
style="color: green">(The Partner Using Green Channel Now!)</span> style="color: green">(The Partner Using Green Channel Now!)</span>
【目前状态】- 【目前状态】-
<b ng-if="partner.source==4"> <b ng-if="partner.source==4">
<span ng-if="!partner.approve_result">(自助申请)资料完善中</span> <span ng-if="!partner.approve_result">(自助申请)资料完善中</span>
<span ng-if="partner.approve_result==1">(自助申请)已开通</span> <span ng-if="partner.approve_result==1">(自助申请)已开通</span>
<span ng-if="partner.approve_result==2">(自助申请)快速开通等待提交合规材料</span> <span ng-if="partner.approve_result==2">(自助申请)快速开通等待提交合规材料</span>
<span ng-if="partner.approve_result==3">(自助申请)待审核(材料已提交)</span> <span ng-if="partner.approve_result==3">(自助申请)待审核(材料已提交)</span>
</b> </b>
<b ng-if="partner.source!=4"> <b ng-if="partner.source!=4">
<span ng-if="!partner.open_status">资料完善中</span> <span ng-if="!partner.open_status">资料完善中</span>
<span ng-if="partner.open_status==1">待审核(合同制作中)</span> <span ng-if="partner.open_status==1">待审核(合同制作中)</span>
<span ng-if="partner.open_status==2">合同制作完成</span> <span ng-if="partner.open_status==2">合同制作完成</span>
<span ng-if="partner.open_status==3">BD处理中</span> <span ng-if="partner.open_status==3">BD处理中</span>
<span ng-if="partner.open_status==4">待审核(合规文件已提交)</span> <span ng-if="partner.open_status==4">待审核(合规文件已提交)</span>
<span ng-if="partner.open_status==5">通过</span> <span ng-if="partner.open_status==5">通过</span>
<span ng-if="partner.open_status==0">不通过</span> <span ng-if="partner.open_status==0">不通过</span>
<span ng-if="partner.open_status==10">绿色通道申请中</span> <span ng-if="partner.open_status==10">绿色通道申请中</span>
</b> </b>
<span ng-if="partner.is_valid==0" ng-class="{pass_timeout:partner.is_valid==0}">(已禁用)</span> <span ng-if="partner.is_valid==0" ng-class="{pass_timeout:partner.is_valid==0}">(已禁用)</span>
</h3> </h3>
<button ng-if="!partner.is_valid" type="button" class="btn btn-success" style="float:right;" ng-click="revertClient()">Revert</button> <button ng-if="!partner.is_valid" type="button" class="btn btn-success" style="float:right;"
ng-click="revertClient()">Revert
</button>
</div> </div>
<div class="box-body" ng-if="partner.is_valid==1"> <div class="box-body" ng-if="partner.is_valid==1">
<div ng-if="partner.open_status != 5 && partner.open_status!=10"> <div ng-if="partner.open_status != 5 && partner.open_status!=10">
@ -130,16 +134,22 @@
<small ng-repeat="log in partner.audit_logs"> <small ng-repeat="log in partner.audit_logs">
<i class="fa fa-arrow-right" aria-hidden="true"></i> <i class="fa fa-arrow-right" aria-hidden="true"></i>
<div class="btn-group-vertical"> <div class="btn-group-vertical">
<button type="button" class="btn btn-xs btn-primary" ng-class="{'btn-danger':log.remark.indexOf('打回')>-1,'btn-success':log.open_status_to==5||(log.open_status_from==10 && log.open_status_to==1)}">{{log.remark}}</button> <button type="button" class="btn btn-xs btn-primary"
<button type="button" class="btn btn-xs btn-primary" ng-class="{'btn-danger':log.remark.indexOf('打回')>-1,'btn-success':log.open_status_to==5||(log.open_status_from==10 && log.open_status_to==1)}">{{log.operator}} | {{log.create_time}}</button> ng-class="{'btn-danger':log.remark.indexOf('打回')>-1,'btn-success':log.open_status_to==5||(log.open_status_from==10 && log.open_status_to==1)}">
{{log.remark}}
</button>
<button type="button" class="btn btn-xs btn-primary"
ng-class="{'btn-danger':log.remark.indexOf('打回')>-1,'btn-success':log.open_status_to==5||(log.open_status_from==10 && log.open_status_to==1)}">
{{log.operator}} | {{log.create_time}}
</button>
</div> </div>
</small> </small>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div> <a role="button" class="btn-group btn btn-warning" type="button" ng-href="{{Export()}}"> <div><a role="button" class="btn-group btn btn-warning" type="button" ng-href="{{Export()}}">
<i class="fa fa-download" ></i>制作临时合同</a> <i class="fa fa-download"></i>制作临时合同</a>
</div> </div>
<div class="box" ng-if="('100'|withRole) && partner.show_all_permission" <div class="box" ng-if="('100'|withRole) && partner.show_all_permission"
@ -200,8 +210,14 @@
<small ng-repeat="log in partner.audit_logs"> <small ng-repeat="log in partner.audit_logs">
<i class="fa fa-arrow-right" aria-hidden="true" style="margin-top: 5px"></i> <i class="fa fa-arrow-right" aria-hidden="true" style="margin-top: 5px"></i>
<div class="btn-group-vertical" style="margin-top: 5px"> <div class="btn-group-vertical" style="margin-top: 5px">
<button type="button" class="btn btn-xs btn-primary" ng-class="{'btn-danger':log.remark.indexOf('打回')>-1,'btn-success':log.open_status_to==5||(log.open_status_from==10 && log.open_status_to==1)}">{{log.remark}}</button> <button type="button" class="btn btn-xs btn-primary"
<button type="button" class="btn btn-xs btn-primary" ng-class="{'btn-danger':log.remark.indexOf('打回')>-1,'btn-success':log.open_status_to==5||(log.open_status_from==10 && log.open_status_to==1)}">{{log.operator}} | {{log.create_time}}</button> ng-class="{'btn-danger':log.remark.indexOf('打回')>-1,'btn-success':log.open_status_to==5||(log.open_status_from==10 && log.open_status_to==1)}">
{{log.remark}}
</button>
<button type="button" class="btn btn-xs btn-primary"
ng-class="{'btn-danger':log.remark.indexOf('打回')>-1,'btn-success':log.open_status_to==5||(log.open_status_from==10 && log.open_status_to==1)}">
{{log.operator}} | {{log.create_time}}
</button>
</div> </div>
</small> </small>
</div> </div>
@ -235,7 +251,8 @@
<li ui-sref-active="active" ng-if="partner.show_all_permission && partner.is_valid==1"> <li ui-sref-active="active" ng-if="partner.show_all_permission && partner.is_valid==1">
<a ui-sref=".accounts">Partner Accounts</a> <a ui-sref=".accounts">Partner Accounts</a>
</li> </li>
<li ui-sref-active="active" ng-if="partner.parent_client_id==null && partner.show_all_permission && partner.is_valid==1"> <li ui-sref-active="active"
ng-if="partner.parent_client_id==null && partner.show_all_permission && partner.is_valid==1">
<a ui-sref=".subpartners">Subpartners</a> <a ui-sref=".subpartners">Subpartners</a>
</li> </li>
<li ui-sref-active="active" ng-if="false && partner.is_valid==1"> <li ui-sref-active="active" ng-if="false && partner.is_valid==1">
@ -257,7 +274,8 @@
<a ui-sref=".settlement({clientMoniker:partner.client_moniker})">Settlement</a> <a ui-sref=".settlement({clientMoniker:partner.client_moniker})">Settlement</a>
</li> </li>
<li ui-sref-active="active" ng-if="partner.show_all_permission && partner.is_valid==1 && partner.surcharge_mode=='distributed'"> <li ui-sref-active="active"
ng-if="partner.show_all_permission && partner.is_valid==1 && partner.surcharge_mode=='distributed'">
<a ui-sref=".surcharge_account({clientMoniker:partner.client_moniker})">Surcharge Account</a> <a ui-sref=".surcharge_account({clientMoniker:partner.client_moniker})">Surcharge Account</a>
</li> </li>
@ -298,7 +316,8 @@
<a ui-sref="partners.detail({clientMoniker:partner.parent_client.client_moniker})" <a ui-sref="partners.detail({clientMoniker:partner.parent_client.client_moniker})"
ng-bind="partner.parent_client.client_moniker"></a>) ng-bind="partner.parent_client.client_moniker"></a>)
</span> </span>
<span ng-if="partner.is_valid==0" ng-class="{pass_timeout:partner.is_valid==0}">(已禁用)</span> <span ng-if="partner.is_valid==0"
ng-class="{pass_timeout:partner.is_valid==0}">(已禁用)</span>
</p> </p>
</div> </div>
</div> </div>
@ -307,7 +326,8 @@
<div class="col-sm-10"> <div class="col-sm-10">
<p class="form-control-static pull-left" ng-bind="partner.company_name"></p> <p class="form-control-static pull-left" ng-bind="partner.company_name"></p>
<p class="form-control-static pull-left" ng-if="isComplianceOfCompanyName && partner.open_status" <p class="form-control-static pull-left"
ng-if="isComplianceOfCompanyName && partner.open_status"
style="margin-left: 10px;font-weight: 700;color: red;"> style="margin-left: 10px;font-weight: 700;color: red;">
注意:(微信渠道可能不合规) 注意:(微信渠道可能不合规)
</p> </p>
@ -318,7 +338,8 @@
<div class="col-sm-10"> <div class="col-sm-10">
<p class="form-control-static pull-left" ng-bind="partner.short_name"></p> <p class="form-control-static pull-left" ng-bind="partner.short_name"></p>
<p class="form-control-static pull-left" ng-if="isComplianceOfShortName && partner.open_status" <p class="form-control-static pull-left"
ng-if="isComplianceOfShortName && partner.open_status"
style="margin-left: 10px;font-weight: 700;color: red;"> style="margin-left: 10px;font-weight: 700;color: red;">
注意:(微信渠道可能不合规) 注意:(微信渠道可能不合规)
</p> </p>
@ -333,13 +354,14 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2">Store Name</label> <label class="control-label col-sm-2">Store Name</label>
<div class="col-sm-10"> <div class="col-sm-10">
<p class="form-control-static pull-left" ng-bind="partner.store_name"></p> <p class="form-control-static pull-left" ng-bind="partner.store_name"></p>
<p class="form-control-static pull-left" ng-if="isComplianceOfShortName && partner.open_status" <p class="form-control-static pull-left"
style="margin-left: 10px;font-weight: 700;color: red;"> ng-if="isComplianceOfShortName && partner.open_status"
注意:(微信渠道可能不合规) style="margin-left: 10px;font-weight: 700;color: red;">
</p> 注意:(微信渠道可能不合规)
</div> </p>
</div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -348,7 +370,8 @@
<div class="col-sm-10"> <div class="col-sm-10">
<p class="form-control-static pull-left" <p class="form-control-static pull-left"
ng-bind="partner.business_structure|business_structure"></p> ng-bind="partner.business_structure|business_structure"></p>
<p class="form-control-static pull-left" ng-if="isComplianceOfBusinessStructure && partner.open_status" <p class="form-control-static pull-left"
ng-if="isComplianceOfBusinessStructure && partner.open_status"
style="margin-left: 10px;font-weight: 700;color: red;"> style="margin-left: 10px;font-weight: 700;color: red;">
注意:(微信渠道可能不合规) 注意:(微信渠道可能不合规)
</p> </p>
@ -399,7 +422,7 @@
<div class="col-sm-3 col-xs-5" ng-if="partner.store_photo"><em>2:</em>&nbsp; <div class="col-sm-3 col-xs-5" ng-if="partner.store_photo"><em>2:</em>&nbsp;
<div> <div>
<a class="thumbnail" target="_blank" ng-href="{{partner.store_photo}}" > <a class="thumbnail" target="_blank" ng-href="{{partner.store_photo}}">
<img ng-src="{{partner.store_photo}}" style="max-height: 100px"> <img ng-src="{{partner.store_photo}}" style="max-height: 100px">
</a> </a>
</div> </div>
@ -470,7 +493,8 @@
<th>End Date</th> <th>End Date</th>
<th>BD Name</th> <th>BD Name</th>
<th>Proportion</th> <th>Proportion</th>
<th ng-if="('00010'|withRole) || (('1000000000000'|withRole) && partner.show_all_permission)">Operation <th ng-if="('00010'|withRole) || (('1000000000000'|withRole) && partner.show_all_permission)">
Operation
</th> </th>
</tr> </tr>
</thead> </thead>
@ -501,9 +525,568 @@
</div> </div>
</div> </div>
<!--end 商户基本资料--> <!--end 商户基本资料-->
<div class="panel panel-default">
<div class="panel-heading">Merchant Payment Scenario</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-2">
Merchant Payment Scenario Type</label>
<div class="col-sm-8">
<p class="form-control-static"
ng-bind="partner.client_pay_type">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Merchant Payment Scenario Description</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.client_pay_desc"></p>
</div>
</div>
<!--<div ng-if="partner.client_pay_type=='online' || partner.client_pay_type=='all'">-->
<!--<div class="form-group">-->
<!--<label class="control-label col-sm-2">-->
<!--Website</label>-->
<!--<div class="col-sm-8">-->
<!--<p class="form-control-static"-->
<!--ng-bind="partner.online_website">-->
<!--</p>-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-sm-2">-->
<!--公众号名称</label>-->
<!--<div class="col-sm-8">-->
<!--<p class="form-control-static"-->
<!--ng-bind="partner.online_public_account">-->
<!--</p>-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-sm-2">-->
<!--Mini Program Name</label>-->
<!--<div class="col-sm-8">-->
<!--<p class="form-control-static"-->
<!--ng-bind="partner.online_mini_program">-->
<!--</p>-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-sm-2">-->
<!--APP Name</label>-->
<!--<div class="col-sm-8">-->
<!--<p class="form-control-static"-->
<!--ng-bind="partner.online_app">-->
<!--</p>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--<div ng-if="partner.client_pay_type=='offline' || partner.client_pay_type=='all'">-->
<!--<div class="form-group">-->
<!--<label class="control-label col-sm-2">Offline Scene Of Merchants</label>-->
<!--<div class="col-sm-8">-->
<!--<p class="form-control-static"-->
<!--ng-bind="partner.client_offline_desc | partner_offline_desc">-->
<!--</p>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Alipay Information &nbsp;<em class="small"><b>(Optional)</b></em>
</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-2">
Business Hours</label>
<div class="col-sm-8">
<input type="text" class="form-control" ng-model="partner.business_hours">
<p class="small text-info">
eg:Monday-Friday 09:00-20:00,Saturday-Sunday 10:00-22:00</p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">
Merchant Tag<em class="small">(Chinese)</em></label>
<div class="col-sm-8">
<input type="text" class="form-control" ng-model="partner.merchant_tag">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">
Merchant Introduction<em class="small">(Chinese)</em></label>
<div class="col-sm-8">
<textarea class="form-control"
ng-model="partner.merchant_introduction"></textarea>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">
Video Introduction<br><em class="small">(youtube link)</em></label>
<div class="col-sm-8">
<input type="text" class="form-control"
ng-model="partner.merchant_video_url">
<p class="small text-info">eg:https://www.baidu.com</p>
</div>
</div>
</div>
</div>
</div>
<!--支付宝资料-->
<div class="panel panel-default">
<div class="panel-heading">Contact Information</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group"
ng-class="{'has-error':partnerForm.contact_person.$invalid && partnerForm.contact_person.$dirty}">
<label class="control-label col-sm-2" for="contact_person-input">*
Contact Person
Name</label>
<div class="col-sm-8">
<input class="form-control" ng-model="partner.contact_person"
required
name="contact_person"
id="contact_person-input" maxlength="50">
<div ng-messages="partnerForm.contact_person.$error"
ng-if="partnerForm.contact_person.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
<p class="small text-danger" ng-message="maxlength">Less
Than 50
Characters(including symbols and spaces)</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':partnerForm.contact_phone_p.$invalid && partnerForm.contact_phone_p.$dirty}">
<label class="control-label col-sm-2" for="contact-phone-p-input">*
Phone</label>
<!-- <div class="col-sm-8">
<input type="text" class="form-control" ng-model="partner.contact_phone" required
name="contact_phone" id="contact-phone-input" maxlength="20">
</div>
<div ng-messages="partnerForm.contact_phone.$error"
ng-if="partnerForm.contact_phone.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Less Than 20
Characters(including symbols and spaces)</p>
</div>-->
<div class="col-sm-2">
<div class="input-group">
<div class="input-group-addon">+</div>
<input class="form-control" required type="text"
ng-model="partner.contact_phone_c"
name="contact_phone_c" id="contact-phone-c-input"
maxlength="3" minlength="1"
placeholder="country code">
</div>
<div ng-messages="partnerForm.contact_phone_c.$error"
ng-if="partnerForm.contact_phone_c.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
<p class="small text-danger" ng-message="maxlength">Less
Than 20 Characters</p>
</div>
</div>
<div class="col-sm-2">
<input class="form-control" type="text"
ng-model="partner.contact_phone_a"
title="eg:3,当为手机号、服务电话时,可以不填"
name="contact_phone_a" id="contact-phone-a-input"
maxlength="2" placeholder="area code">
<div ng-messages="partnerForm.contact_phone_a.$error"
ng-if="partnerForm.contact_phone_a.$dirty">
<p class="small text-danger" ng-message="maxlength">Less
Than 2 Characters</p>
</div>
</div>
<div class="col-sm-4">
<input class="form-control" required type="text"
ng-model="partner.contact_phone_p"
name="contact_phone_p" id="contact-phone-p-input"
maxlength="11" placeholder="phone number">
<div ng-messages="partnerForm.contact_phone_p.$error"
ng-if="partnerForm.contact_phone_p.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
<p class="small text-danger" ng-message="maxlength">Less
Than 11 Characters</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':partnerForm.contact_email.$invalid && partnerForm.contact_email.$dirty}">
<label class="control-label col-sm-2" for="contact-email-id">*
E-mail</label>
<div class="col-sm-8">
<input class="form-control" ng-model="partner.contact_email"
required
name="contact_email" id="contact-email-id"
maxlength="50">
</div>
<div ng-messages="partnerForm.contact_email.$error"
ng-if="partnerForm.contact_email.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
<p class="small text-danger" ng-message="maxlength">Less Than 50
Characters(including symbols and spaces)</p>
</div>
</div>
</div>
</div>
</div>
<!--end 商户联系资料-->
<div class="panel panel-default">
<div class="panel-heading">Address Information</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group col-sm-6"
ng-class="{'has-error':partnerForm.address.$invalid && partnerForm.address.$dirty}">
<label class="control-label col-sm-4" for="address-input">*
Address</label>
<div class="col-sm-8">
<textarea class="form-control" ng-model="partner.address"
name="address"
id="address-input" maxlength="200" required></textarea>
<div ng-messages="partnerForm.address.$error"
ng-if="partnerForm.address.$dirty">
<p class="small text-danger" ng-message="maxlength">Less
Than 200
Characters(including symbols and spaces)</p>
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
</div>
</div>
<div class="form-group col-sm-6"
ng-class="{'has-error':partnerForm.suburb.$invalid && partnerForm.suburb.$dirty}">
<label class="control-label col-sm-4" for="suburb-input">*
Suburb</label>
<div class="col-sm-8">
<input class="form-control" ng-model="partner.suburb"
name="suburb"
id="suburb-input" maxlength="50" required>
<div ng-messages="partnerForm.suburb.$error"
ng-if="partnerForm.suburb.$dirty">
<p class="small text-danger" ng-message="maxlength">Less
Than 50
Characters(including symbols and spaces)</p>
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
<!--</div>-->
<!--<select class="form-control" name="suburb" required ng-model="partner.suburb"-->
<!--id="suburb-input"-->
<!--ng-options="t2c.key as t2c.value for t2c in t2city_map">-->
<!--<option value="">Please Choose</option>-->
<!--</select>-->
<!--<div ng-messages="partnerForm.suburb.$error" ng-if="partnerForm.suburb.$dirty">-->
<!--<p class="small text-danger" ng-message="required">Required Field</p>-->
<!--</div>-->
</div>
</div>
<div class="form-group col-sm-6"
ng-class="{'has-error':partnerForm.postcode.$invalid && partnerForm.postcode.$dirty}">
<label class="control-label col-sm-4" for="postcode-input">*
PostCode</label>
<div class="col-sm-8">
<input class="form-control" ng-model="partner.postcode"
name="postcode"
id="postcode-input" maxlength="10" required>
<div ng-messages="partnerForm.postcode.$error"
ng-if="partnerForm.postcode.$dirty">
<p class="small text-danger" ng-message="maxlength">Less
Than 10
Characters(including symbols and spaces)</p>
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
</div>
</div>
<div class="form-group col-sm-6"
ng-class="{'has-error':partnerForm.state.$invalid && partnerForm.state.$dirty}">
<label class="control-label col-sm-4" for="state-input">*
State</label>
<div class="col-sm-8">
<!--<input class="form-control" ng-model="partner.state" name="state" id="state-input"-->
<!--maxlength="20">-->
<!--<div ng-messages="partnerForm.state.$error" ng-if="partnerForm.state.$dirty">-->
<!--<p class="small text-danger" ng-message="maxlength">Less Than 20-->
<!--Characters(including symbols and spaces)</p>-->
<!--</div>-->
<select class="form-control" name="state" required
ng-model="partner.state"
id="state-input"
ng-options="state.value as state.label for state in states">
<option value="">Please Choose</option>
</select>
<div ng-messages="partnerForm.state.$error"
ng-if="partnerForm.state.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
</div>
</div>
<div class="form-group col-sm-6"
ng-class="{'has-error':partnerForm.country.$invalid && partnerForm.country.$dirty}">
<label class="control-label col-sm-4" for="country-input">*
Country</label>
<div class="col-sm-8">
<input class="form-control"
ng-init="partner.country=partner.country||'AUS'"
ng-model="partner.country" name="country"
id="country-input" maxlength="20" required
placeholder="AUS" readonly="readonly">
<div ng-messages="partnerForm.country.$error"
ng-if="partnerForm.country.$dirty">
<p class="small text-danger" ng-message="maxlength">Less
Than 20
Characters(including symbols and spaces)</p>
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
<!--选择框-->
<!--<select class="form-control" name="country" required ng-model="partner.country"-->
<!--id="country-input"-->
<!--ng-options="country.value as country.label for country in countries">-->
<!--<option value="">Please Choose</option>-->
<!--</select>-->
<!--<div ng-messages="partnerForm.country.$error" ng-if="partnerForm.country.$dirty">-->
<!--<p class="small text-danger" ng-message="required">Required Field</p>-->
<!--</div>-->
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2"
for="tz-select">TimeZone</label>
<div class="col-sm-9">
<select class="form-control" name="timezone"
ng-model="partner.timezone"
id="tz-select"
ng-options="tz.key as tz.detail for tz in timezones">
</select>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" style="font-size: larger">Location
<span id="editmap" hidden>true</span>
<span id="add_view" hidden>true</span>
</div>
<div class="form-group">
<div class="embed-responsive" style="height: 300px;">
<iframe id="merchant_detail" name="merchant_detail" class="embed-responsive-item"
src="one_locations.html"></iframe>
</div>
</div>
</div>
<!--<div class="panel panel-info">
<div class="panel-heading">Alipay Parameters</div>
<div class="panel-body form-horizontal">
<div class="form-group col-sm-6"
ng-class="{'has-error':partnerForm.alipay_category.$invalid && partnerForm.alipay_category.$dirty}">
<label class="control-label col-sm-4"
for="alipay_category">*Category</label>
<div class="col-sm-8" >
<input class="form-control" id="alipay_category" required
name="alipay_category" readonly
ng-model="partner.alipay_category"
multi-level-select-popup="alipayMccCategory"
on-select="onAlipayMccSelect($selected)">
<div ng-messages="partnerForm.alipay_category.$error"
ng-if="partnerForm.alipay_category.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-info">
<div class="panel-heading" style="background:#62b900">wechat Parameters</div>
<div class="panel-body form-horizontal">
<div class="form-group"
ng-class="{'has-error':partnerForm.industry.$invalid && partnerForm.industry.$dirty}">
<label class="control-label col-sm-2" for="industry-input">
*Industry</label>
<div class="col-sm-8">
<select class="form-control" name="industry"
ng-model="partner.industry"
id="industry-input" required
ng-options="industry.value as industry.label for industry in industries">
<option value="">Please Choose</option>
</select>
<div ng-messages="partnerForm.industry.$error"
ng-if="partnerForm.industry.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-info">
<div class="panel-heading" style="background:#d82d2d">JD Parameters</div>
<div class="panel-body form-horizontal">
<div class="form-group"
ng-class="{'has-error':partnerForm.jdindustry.$invalid && partnerForm.jdindustry.$dirty}">
<label class="control-label col-sm-2" for="jdindustry-input">
*Industry</label>
<div class="col-sm-8">
<select class="form-control" name="jdindustry"
ng-model="partner.jdindustry"
id="jdindustry-input" required
ng-options="industry.value as industry.label for industry in jdindustry">
<option value="">Please Choose</option>
</select>
<div ng-messages="partnerForm.jdindustry.$error"
ng-if="partnerForm.jdindustry.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-info">
<div class="panel-heading" style="background:#f06010;color: #f6f6f6;">RoyalPay Parameters</div>
<div class="panel-body form-horizontal">
<div class="form-group"
ng-class="{'has-error':partnerForm.royalpayindustry.$invalid && partnerForm.royalpayindustry.$dirty}">
<label class="control-label col-sm-2" for="royalpayindustry-input">
*Industry</label>
<div class="col-sm-8">
<select class="form-control" name="royalpayindustry"
ng-model="partner.royalpayindustry"
id="royalpayindustry-input" required
ng-options="industry.value as industry.label for industry in royalpayindustry">
<option value="">Please Choose</option>
</select>
<div ng-messages="partnerForm.royalpayindustry.$error"
ng-if="partnerForm.royalpayindustry.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
</div>
</div>
</div>
</div>-->
<div class="panel panel-default">
<div class="panel-heading"
style="color: #333;background-color: #f5f5f5;border-color: #ddd;">
Industry
</div>
<div class="panel-body form-horizontal">
<div class="form-group"
ng-class="{'has-error':partnerForm.royalpay_label.$invalid && partnerForm.royalpay_label.$dirty}">
<label class="control-label col-sm-2"
for="royalpayindustry">*RoyalPay Industry</label>
<div class="col-sm-8">
<input class="form-control" id="royalpayindustry" required
name="royalpayindustry" readonly
ng-model="partner.royalpayindustry|partner_royalpay_industry"
multi-level-select-popup="royalpayindustry"
on-select="onRoyalPayIndustrySelect($selected)">
<div ng-messages="partnerForm.royalpay_label.$error"
ng-if="partnerForm.royalpay_label.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':partnerForm.jdindustry.$invalid && partnerForm.jdindustry.$dirty}">
<label class="control-label col-sm-2" for="jdindustry-input">
*JDPay Industry</label>
<div class="col-sm-8">
<select class="form-control" name="jdindustry"
ng-model="partner.jdindustry"
id="jdindustry-input" required
ng-options="industry.value as industry.label for industry in jdindustry">
<option value="">Please Choose</option>
</select>
<div ng-messages="partnerForm.jdindustryindustry.$error"
ng-if="partnerForm.jdindustryindustry.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':partnerForm.industry.$invalid && partnerForm.industry.$dirty}">
<label class="control-label col-sm-2" for="industry-input">
*Wechat Industry</label>
<div class="col-sm-8">
<select class="form-control" name="industry"
ng-model="partner.industry"
id="industry-input" required
ng-options="industry.value as industry.label for industry in industries">
<option value="">Please Choose</option>
</select>
<div ng-messages="partnerForm.industry.$error"
ng-if="partnerForm.industry.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':partnerForm.alipay_category.$invalid && partnerForm.alipay_category.$dirty}">
<label class="control-label col-sm-2"
for="alipay_category">*Alipay Category</label>
<div class="col-sm-8">
<input class="form-control" id="alipay_category" required
name="alipay_category" readonly
ng-model="partner.alipayindustry|partner_alipay_industry"
multi-level-select-popup="alipayMccCategory"
on-select="onAlipayMccSelect($selected)">
<div ng-messages="partnerForm.alipay_category.$error"
ng-if="partnerForm.alipay_category.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
</div>
</div>
<div class="form-group" ng-if="('10'|withRole) || ('1'|withRole)">
<label class="control-label col-sm-2"
for="hf_category">HF Industry</label>
<div class="col-sm-8">
<input class="form-control" id="hf_category" required
name="hf_label" readonly
ng-model="partner.hfindustry|partner_hf_industry"
multi-level-select-popup="hfindustry"
on-select="onHfIndustrySelect($selected)">
</div>
</div>
</div>
</div>
</div>
<!--支付宝资料--> <!--支付宝资料-->
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">Alipay Information &nbsp;<em class="small"><b>(Optional)</b></em></div> <div class="panel-heading">Alipay Information &nbsp;<em class="small"><b>(Optional)</b></em>
</div>
<div class="panel-body"> <div class="panel-body">
<div class="form-horizontal"> <div class="form-horizontal">
<div class="form-group"> <div class="form-group">
@ -561,13 +1144,16 @@
<div class="col-sm-8"> <div class="col-sm-8">
<p class="form-control-static"> <p class="form-control-static">
<span ng-bind="partner.contact_email"></span> <span ng-bind="partner.contact_email"></span>
<a ng-if="(partner.approve_result==1) || (partner.approve_result == 2 && (partner.source==1 || partner.source==2))" role="button" <a ng-if="(partner.approve_result==1) || (partner.approve_result == 2 && (partner.source==1 || partner.source==2))"
role="button"
ng-click="resendApproveEmail()"> ng-click="resendApproveEmail()">
<i class="fa fa-envelope"></i> Resend Email <i class="fa fa-envelope"></i> Resend Email
</a> </a>
<span ng-if="('10'|withRole)"> <span ng-if="('10'|withRole)">
<i style="cursor: pointer" ng-click="addSub()" ng-if="!partner.unsubscribe" class="fa fa-star text-yellow"></i> <i style="cursor: pointer" ng-click="addSub()" ng-if="!partner.unsubscribe"
<i style="cursor: pointer" ng-click="removeSub()" ng-if="partner.unsubscribe" class="fa fa-star-o text-yellow"></i> class="fa fa-star text-yellow"></i>
<i style="cursor: pointer" ng-click="removeSub()"
ng-if="partner.unsubscribe" class="fa fa-star-o text-yellow"></i>
</span> </span>
</p> </p>
</div> </div>
@ -751,7 +1337,7 @@
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2">Alipay Category</label> <label class="control-label col-sm-2">Alipay Category</label>
<div class="col-sm-10"> <div class="col-sm-10">
<p class="form-control-static industry-p"ng-if="partner.alipayindustry"> <p class="form-control-static industry-p" ng-if="partner.alipayindustry">
{{partner.alipayindustry|partner_alipay_industry}} {{partner.alipayindustry|partner_alipay_industry}}
&nbsp;&nbsp;&nbsp;({{partner.alipayindustry}}) &nbsp;&nbsp;&nbsp;({{partner.alipayindustry}})
</p> </p>
@ -763,7 +1349,7 @@
<div class="form-group" ng-if="partner.hfindustry&&(('10'|withRole) || ('1'|withRole))"> <div class="form-group" ng-if="partner.hfindustry&&(('10'|withRole) || ('1'|withRole))">
<label class="control-label col-sm-2">HF Industry</label> <label class="control-label col-sm-2">HF Industry</label>
<div class="col-sm-10"> <div class="col-sm-10">
<p class="form-control-static industry-p"ng-if="partner.hfindustry"> <p class="form-control-static industry-p" ng-if="partner.hfindustry">
{{partner.hfindustry| partner_hf_industry}} {{partner.hfindustry| partner_hf_industry}}
&nbsp;&nbsp;&nbsp;({{partner.hfindustry}}) &nbsp;&nbsp;&nbsp;({{partner.hfindustry}})
</p> </p>

@ -3,11 +3,14 @@
<div class="list-group"> <div class="list-group">
<div class="list-group-item"> <div class="list-group-item">
<div class="input-group"> <div class="input-group">
<input class="form-control" placeholder="Keywords" ng-model="devsearch.remark"> <input class="form-control" placeholder="Keywords" ng-model="devsearch.remark" >
<div class="input-group-btn"> <div class="input-group-btn">
<button class="btn btn-success" ng-click="listDevices()"> <button class="btn btn-success" ng-click="listDevices()">
<i class="fa fa-search"></i> <i class="fa fa-search"></i>
</button> </button>
<button class="btn btn-primary" ng-click="addDevice()">
<i class="fa fa-plus"></i> addDevice
</button>
</div> </div>
</div> </div>
</div> </div>

@ -362,6 +362,596 @@
</div> </div>
</div> </div>
<!--end 商户基本资料--> <!--end 商户基本资料-->
<div class="panel panel-default">
<div class="panel-heading">Merchant Payment Scenario</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group"
ng-class="{'has-error':partnerForm.client_pay_type.$invalid && partnerForm.client_pay_type.$dirty}">
<label class="control-label col-sm-2" for="client-pay-type-select">*
Merchant Payment Scenario Type</label>
<div class="col-sm-8">
<select class="form-control" ng-model="partner.client_pay_type"
id="client-pay-type-select"
name="client_pay_type">
<option value="">Please Choose</option>
<option value="all">All</option>
<option value="online">线上</option>
<option value="offline">线下</option>
</select>
<div ng-messages="partnerForm.client_pay_type.$error"
ng-if="partnerForm.client_pay_type.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':partnerForm.client_pay_desc.$invalid && partnerForm.client_pay_desc.$dirty}">
<label class="control-label col-sm-2" for="client-pay-desc-input">*
Merchant Payment Scenario Description</label>
<div class="col-sm-8">
<textarea class="form-control" required
ng-model="partner.client_pay_desc"
name="client_pay_desc" id="client-pay-desc-input"
maxlength="200"></textarea>
<p class="small text-info">
<i class="fa fa-info"></i> 例如线下场景门店立牌、POS、收银系统选择品牌名称【ipos、银豹、aupos、其他】、无门店</p>
<div ng-messages="partnerForm.client_pay_desc.$error"
ng-if="partnerForm.client_pay_desc.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
<p class="small text-danger" ng-message="maxlength">Less
Than 200
Characters(including symbols and spaces)</p>
</div>
</div>
</div>
<!--<div ng-if="partner.client_pay_type=='online' || partner.client_pay_type=='all'">-->
<!--<div class="form-group">-->
<!--<label class="control-label col-sm-2">-->
<!--Website</label>-->
<!--<div class="col-sm-8">-->
<!--<input type="text" class="form-control"-->
<!--ng-model="partner.online_website">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-sm-2">-->
<!--公众号名称</label>-->
<!--<div class="col-sm-8">-->
<!--<input type="text" class="form-control"-->
<!--ng-model="partner.online_public_account">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-sm-2">-->
<!--Mini Program Name</label>-->
<!--<div class="col-sm-8">-->
<!--<input type="text" class="form-control"-->
<!--ng-model="partner.online_mini_program">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-sm-2">-->
<!--APP Name</label>-->
<!--<div class="col-sm-8">-->
<!--<input type="text" class="form-control"-->
<!--ng-model="partner.online_app">-->
<!--<p class="small text-info">-->
<!--<i class="fa fa-info"></i> 线上支付场景至少选择填一项</p>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--<div ng-if="partner.client_pay_type=='offline' || partner.client_pay_type=='all'">-->
<!--<div class="form-group"-->
<!--ng-class="{'has-error':partnerForm.client_offline.$invalid && partnerForm.client_offline.$dirty}">-->
<!--<label class="control-label col-sm-2"-->
<!--for="client-offline-desc">*Offline Scene Of Merchants</label>-->
<!--<div class="col-sm-8">-->
<!--<input class="form-control" id="client-offline-desc" required-->
<!--name="client_offline" readonly-->
<!--ng-model="partner.client_offline_desc | partner_offline_desc"-->
<!--multi-level-select-popup="client_offline_select"-->
<!--on-select="onOfflineDescSelect($selected)">-->
<!--<div ng-messages="partnerForm.client_offline.$error"-->
<!--ng-if="partnerForm.client_offline.$dirty">-->
<!--<p class="small text-danger" ng-message="required">Required-->
<!--Field</p>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Alipay Information &nbsp;<em class="small"><b>(Optional)</b></em></div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-2">
Business Hours</label>
<div class="col-sm-8">
<input type="text" class="form-control" ng-model="partner.business_hours">
<p class="small text-info">
eg:Monday-Friday 09:00-20:00,Saturday-Sunday 10:00-22:00</p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">
Merchant Tag<em class="small">(Chinese)</em></label>
<div class="col-sm-8">
<input type="text" class="form-control" ng-model="partner.merchant_tag">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">
Merchant Introduction<em class="small">(Chinese)</em></label>
<div class="col-sm-8">
<textarea class="form-control" ng-model="partner.merchant_introduction"></textarea>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">
Video Introduction<br><em class="small">(youtube link)</em></label>
<div class="col-sm-8">
<input type="text" class="form-control" ng-model="partner.merchant_video_url">
<p class="small text-info">eg:https://www.baidu.com</p>
</div>
</div>
</div>
</div>
</div>
<!--支付宝资料-->
<div class="panel panel-default">
<div class="panel-heading">Contact Information</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group"
ng-class="{'has-error':partnerForm.contact_person.$invalid && partnerForm.contact_person.$dirty}">
<label class="control-label col-sm-2" for="contact_person-input">*
Contact Person
Name</label>
<div class="col-sm-8">
<input class="form-control" ng-model="partner.contact_person"
required
name="contact_person"
id="contact_person-input" maxlength="50">
<div ng-messages="partnerForm.contact_person.$error"
ng-if="partnerForm.contact_person.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
<p class="small text-danger" ng-message="maxlength">Less
Than 50
Characters(including symbols and spaces)</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':partnerForm.contact_phone_p.$invalid && partnerForm.contact_phone_p.$dirty}">
<label class="control-label col-sm-2" for="contact-phone-p-input">*
Phone</label>
<!-- <div class="col-sm-8">
<input type="text" class="form-control" ng-model="partner.contact_phone" required
name="contact_phone" id="contact-phone-input" maxlength="20">
</div>
<div ng-messages="partnerForm.contact_phone.$error"
ng-if="partnerForm.contact_phone.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Less Than 20
Characters(including symbols and spaces)</p>
</div>-->
<div class="col-sm-2">
<div class="input-group">
<div class="input-group-addon">+</div>
<input class="form-control" required type="text"
ng-model="partner.contact_phone_c"
name="contact_phone_c" id="contact-phone-c-input"
maxlength="3" minlength="1"
placeholder="country code">
</div>
<div ng-messages="partnerForm.contact_phone_c.$error"
ng-if="partnerForm.contact_phone_c.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
<p class="small text-danger" ng-message="maxlength">Less
Than 20 Characters</p>
</div>
</div>
<div class="col-sm-2">
<input class="form-control" type="text"
ng-model="partner.contact_phone_a"
title="eg:3,当为手机号、服务电话时,可以不填"
name="contact_phone_a" id="contact-phone-a-input"
maxlength="2" placeholder="area code">
<div ng-messages="partnerForm.contact_phone_a.$error"
ng-if="partnerForm.contact_phone_a.$dirty">
<p class="small text-danger" ng-message="maxlength">Less
Than 2 Characters</p>
</div>
</div>
<div class="col-sm-4">
<input class="form-control" required type="text"
ng-model="partner.contact_phone_p"
name="contact_phone_p" id="contact-phone-p-input"
maxlength="11" placeholder="phone number">
<div ng-messages="partnerForm.contact_phone_p.$error"
ng-if="partnerForm.contact_phone_p.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
<p class="small text-danger" ng-message="maxlength">Less
Than 11 Characters</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':partnerForm.contact_email.$invalid && partnerForm.contact_email.$dirty}">
<label class="control-label col-sm-2" for="contact-email-id">*
E-mail</label>
<div class="col-sm-8">
<input class="form-control" ng-model="partner.contact_email"
required
name="contact_email" id="contact-email-id"
maxlength="50">
</div>
<div ng-messages="partnerForm.contact_email.$error"
ng-if="partnerForm.contact_email.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
<p class="small text-danger" ng-message="maxlength">Less Than 50
Characters(including symbols and spaces)</p>
</div>
</div>
</div>
</div>
</div>
<!--end 商户联系资料-->
<div class="panel panel-default">
<div class="panel-heading">Address Information</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group col-sm-6"
ng-class="{'has-error':partnerForm.address.$invalid && partnerForm.address.$dirty}">
<label class="control-label col-sm-4" for="address-input">*
Address</label>
<div class="col-sm-8">
<textarea class="form-control" ng-model="partner.address"
name="address"
id="address-input" maxlength="200" required></textarea>
<div ng-messages="partnerForm.address.$error"
ng-if="partnerForm.address.$dirty">
<p class="small text-danger" ng-message="maxlength">Less
Than 200
Characters(including symbols and spaces)</p>
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
</div>
</div>
<div class="form-group col-sm-6"
ng-class="{'has-error':partnerForm.suburb.$invalid && partnerForm.suburb.$dirty}">
<label class="control-label col-sm-4" for="suburb-input">*
Suburb</label>
<div class="col-sm-8">
<input class="form-control" ng-model="partner.suburb"
name="suburb"
id="suburb-input" maxlength="50" required>
<div ng-messages="partnerForm.suburb.$error"
ng-if="partnerForm.suburb.$dirty">
<p class="small text-danger" ng-message="maxlength">Less
Than 50
Characters(including symbols and spaces)</p>
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
<!--</div>-->
<!--<select class="form-control" name="suburb" required ng-model="partner.suburb"-->
<!--id="suburb-input"-->
<!--ng-options="t2c.key as t2c.value for t2c in t2city_map">-->
<!--<option value="">Please Choose</option>-->
<!--</select>-->
<!--<div ng-messages="partnerForm.suburb.$error" ng-if="partnerForm.suburb.$dirty">-->
<!--<p class="small text-danger" ng-message="required">Required Field</p>-->
<!--</div>-->
</div>
</div>
<div class="form-group col-sm-6"
ng-class="{'has-error':partnerForm.postcode.$invalid && partnerForm.postcode.$dirty}">
<label class="control-label col-sm-4" for="postcode-input">*
PostCode</label>
<div class="col-sm-8">
<input class="form-control" ng-model="partner.postcode"
name="postcode"
id="postcode-input" maxlength="10" required>
<div ng-messages="partnerForm.postcode.$error"
ng-if="partnerForm.postcode.$dirty">
<p class="small text-danger" ng-message="maxlength">Less
Than 10
Characters(including symbols and spaces)</p>
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
</div>
</div>
<div class="form-group col-sm-6"
ng-class="{'has-error':partnerForm.state.$invalid && partnerForm.state.$dirty}">
<label class="control-label col-sm-4" for="state-input">*
State</label>
<div class="col-sm-8">
<!--<input class="form-control" ng-model="partner.state" name="state" id="state-input"-->
<!--maxlength="20">-->
<!--<div ng-messages="partnerForm.state.$error" ng-if="partnerForm.state.$dirty">-->
<!--<p class="small text-danger" ng-message="maxlength">Less Than 20-->
<!--Characters(including symbols and spaces)</p>-->
<!--</div>-->
<select class="form-control" name="state" required
ng-model="partner.state"
id="state-input"
ng-options="state.value as state.label for state in states">
<option value="">Please Choose</option>
</select>
<div ng-messages="partnerForm.state.$error"
ng-if="partnerForm.state.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
</div>
</div>
<div class="form-group col-sm-6"
ng-class="{'has-error':partnerForm.country.$invalid && partnerForm.country.$dirty}">
<label class="control-label col-sm-4" for="country-input">*
Country</label>
<div class="col-sm-8">
<input class="form-control"
ng-init="partner.country=partner.country||'AUS'"
ng-model="partner.country" name="country"
id="country-input" maxlength="20" required
placeholder="AUS" readonly="readonly">
<div ng-messages="partnerForm.country.$error"
ng-if="partnerForm.country.$dirty">
<p class="small text-danger" ng-message="maxlength">Less
Than 20
Characters(including symbols and spaces)</p>
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
<!--选择框-->
<!--<select class="form-control" name="country" required ng-model="partner.country"-->
<!--id="country-input"-->
<!--ng-options="country.value as country.label for country in countries">-->
<!--<option value="">Please Choose</option>-->
<!--</select>-->
<!--<div ng-messages="partnerForm.country.$error" ng-if="partnerForm.country.$dirty">-->
<!--<p class="small text-danger" ng-message="required">Required Field</p>-->
<!--</div>-->
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2"
for="tz-select">TimeZone</label>
<div class="col-sm-9">
<select class="form-control" name="timezone"
ng-model="partner.timezone"
id="tz-select"
ng-options="tz.key as tz.detail for tz in timezones">
</select>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" style="font-size: larger">Location
<span id="editmap" hidden>true</span>
<span id="add_view" hidden>true</span>
</div>
<div class="form-group">
<div class="embed-responsive" style="height: 300px;">
<iframe id="merchant_detail" name="merchant_detail" class="embed-responsive-item"
src="one_locations.html"></iframe>
</div>
</div>
</div>
<!--<div class="panel panel-info">
<div class="panel-heading">Alipay Parameters</div>
<div class="panel-body form-horizontal">
<div class="form-group col-sm-6"
ng-class="{'has-error':partnerForm.alipay_category.$invalid && partnerForm.alipay_category.$dirty}">
<label class="control-label col-sm-4"
for="alipay_category">*Category</label>
<div class="col-sm-8" >
<input class="form-control" id="alipay_category" required
name="alipay_category" readonly
ng-model="partner.alipay_category"
multi-level-select-popup="alipayMccCategory"
on-select="onAlipayMccSelect($selected)">
<div ng-messages="partnerForm.alipay_category.$error"
ng-if="partnerForm.alipay_category.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-info">
<div class="panel-heading" style="background:#62b900">wechat Parameters</div>
<div class="panel-body form-horizontal">
<div class="form-group"
ng-class="{'has-error':partnerForm.industry.$invalid && partnerForm.industry.$dirty}">
<label class="control-label col-sm-2" for="industry-input">
*Industry</label>
<div class="col-sm-8">
<select class="form-control" name="industry"
ng-model="partner.industry"
id="industry-input" required
ng-options="industry.value as industry.label for industry in industries">
<option value="">Please Choose</option>
</select>
<div ng-messages="partnerForm.industry.$error"
ng-if="partnerForm.industry.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-info">
<div class="panel-heading" style="background:#d82d2d">JD Parameters</div>
<div class="panel-body form-horizontal">
<div class="form-group"
ng-class="{'has-error':partnerForm.jdindustry.$invalid && partnerForm.jdindustry.$dirty}">
<label class="control-label col-sm-2" for="jdindustry-input">
*Industry</label>
<div class="col-sm-8">
<select class="form-control" name="jdindustry"
ng-model="partner.jdindustry"
id="jdindustry-input" required
ng-options="industry.value as industry.label for industry in jdindustry">
<option value="">Please Choose</option>
</select>
<div ng-messages="partnerForm.jdindustry.$error"
ng-if="partnerForm.jdindustry.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-info">
<div class="panel-heading" style="background:#f06010;color: #f6f6f6;">RoyalPay Parameters</div>
<div class="panel-body form-horizontal">
<div class="form-group"
ng-class="{'has-error':partnerForm.royalpayindustry.$invalid && partnerForm.royalpayindustry.$dirty}">
<label class="control-label col-sm-2" for="royalpayindustry-input">
*Industry</label>
<div class="col-sm-8">
<select class="form-control" name="royalpayindustry"
ng-model="partner.royalpayindustry"
id="royalpayindustry-input" required
ng-options="industry.value as industry.label for industry in royalpayindustry">
<option value="">Please Choose</option>
</select>
<div ng-messages="partnerForm.royalpayindustry.$error"
ng-if="partnerForm.royalpayindustry.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
</div>
</div>
</div>
</div>-->
<div class="panel panel-default">
<div class="panel-heading" style="color: #333;background-color: #f5f5f5;border-color: #ddd;">
Industry
</div>
<div class="panel-body form-horizontal">
<div class="form-group"
ng-class="{'has-error':partnerForm.royalpay_label.$invalid && partnerForm.royalpay_label.$dirty}">
<label class="control-label col-sm-2"
for="royalpayindustry">*RoyalPay Industry</label>
<div class="col-sm-8">
<input class="form-control" id="royalpayindustry" required
name="royalpayindustry" readonly
ng-model="partner.royalpayindustry|partner_royalpay_industry"
multi-level-select-popup="royalpayindustry"
on-select="onRoyalPayIndustrySelect($selected)">
<div ng-messages="partnerForm.royalpay_label.$error"
ng-if="partnerForm.royalpay_label.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':partnerForm.jdindustry.$invalid && partnerForm.jdindustry.$dirty}">
<label class="control-label col-sm-2" for="jdindustry-input">
*JDPay Industry</label>
<div class="col-sm-8">
<select class="form-control" name="jdindustry"
ng-model="partner.jdindustry"
id="jdindustry-input" required
ng-options="industry.value as industry.label for industry in jdindustry">
<option value="">Please Choose</option>
</select>
<div ng-messages="partnerForm.jdindustryindustry.$error"
ng-if="partnerForm.jdindustryindustry.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':partnerForm.industry.$invalid && partnerForm.industry.$dirty}">
<label class="control-label col-sm-2" for="industry-input">
*Wechat Industry</label>
<div class="col-sm-8">
<select class="form-control" name="industry"
ng-model="partner.industry"
id="industry-input" required
ng-options="industry.value as industry.label for industry in industries">
<option value="">Please Choose</option>
</select>
<div ng-messages="partnerForm.industry.$error"
ng-if="partnerForm.industry.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':partnerForm.alipay_category.$invalid && partnerForm.alipay_category.$dirty}">
<label class="control-label col-sm-2"
for="alipay_category">*Alipay Category</label>
<div class="col-sm-8">
<input class="form-control" id="alipay_category" required
name="alipay_category" readonly
ng-model="partner.alipayindustry|partner_alipay_industry"
multi-level-select-popup="alipayMccCategory"
on-select="onAlipayMccSelect($selected)">
<div ng-messages="partnerForm.alipay_category.$error"
ng-if="partnerForm.alipay_category.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
</div>
</div>
<div class="form-group" ng-if="('10'|withRole) || ('1'|withRole)">
<label class="control-label col-sm-2"
for="hf_category">HF Industry</label>
<div class="col-sm-8">
<input class="form-control" id="hf_category" required
name="hf_label" readonly
ng-model="partner.hfindustry|partner_hf_industry"
multi-level-select-popup="hfindustry"
on-select="onHfIndustrySelect($selected)">
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">Alipay Information &nbsp; <em class="small"><b>(Optional)</b></em></div> <div class="panel-heading">Alipay Information &nbsp; <em class="small"><b>(Optional)</b></em></div>
<div class="panel-body"> <div class="panel-body">

Loading…
Cancel
Save