Merge branch 'develop'

master
eason 7 years ago
commit 7b8dbd50fd

@ -544,3 +544,9 @@ alter table sys_client_pre_apply modify COLUMN `agree` tinyint(1) DEFAULT 0;
insert into `royalpay_production`.`sys_configs` ( `config_key`, `config_value`) values ( 'royalpayindustry.json', '[{"children":[{"children":[],"label":"机票","mccCode":"10001"},{"children":[],"label":"旅游行业","mccCode":"10002"},{"children":[],"label":"私人定制旅游","mccCode":"10003"},{"children":[],"label":"租车","mccCode":"10004"},{"children":[],"label":"巴士","mccCode":"10005"}],"label":"旅游出行","mccCode":"1"},{"children":[{"children":[],"label":"饭店","mccCode":"20001"},{"children":[],"label":"奶茶店","mccCode":"20002"},{"children":[],"label":"烧烤","mccCode":"20003"},{"children":[],"label":"火锅","mccCode":"20004"},{"children":[],"label":"Coffee","mccCode":"20005"},{"children":[],"label":"酒吧","mccCode":"20006"}],"label":"餐饮","mccCode":"2"},{"children":[{"children":[],"label":"培训类","mccCode":"30001"},{"children":[],"label":"移民留学","mccCode":"30002"},{"children":[],"label":"私人幼儿园","mccCode":"30003"}],"label":"教育","mccCode":"3"},{"children":[{"children":[],"label":"换汇","mccCode":"40001"},{"children":[],"label":"房产","mccCode":"40002"}],"label":"商务咨询","mccCode":"4"},{"children":[{"children":[],"label":"公众号服务商","mccCode":"50001"},{"children":[],"label":"各种媒体类宣传","mccCode":"50002"}],"label":"传媒","mccCode":"5","value":"{\"category\":\"SERVICE\",\"code\":\"7542\",\"description\":\"Car Washes\",\"parentCode\":\"S10\"}"},{"children":[{"children":[],"label":"美容院","mccCode":"60001"},{"children":[],"label":"医疗美容","mccCode":"60002"}],"label":"医美","mccCode":"6"},{"children":[{"label":"超市","mccCode":"70001"},{"children":[],"label":"服装店","mccCode":"70002"},{"children":[],"label":"鞋店","mccCode":"70003"},{"children":[],"label":"珠宝店","mccCode":"70004"},{"children":[],"label":"箱包","mccCode":"70005"}],"label":"零售","mccCode":"7"},{"children":[{"children":[],"label":"桌游吧","mccCode":"80001"},{"children":[],"label":"演唱会","mccCode":"80002"},{"children":[],"label":"马术训练","mccCode":"80003"},{"children":[],"label":"瑜伽","mccCode":"80004"},{"children":[],"label":"健身","mccCode":"80005"},{"children":[],"label":"社团","mccCode":"80006"},{"children":[],"label":"网吧","mccCode":"80007"},{"children":[],"label":"KTV","mccCode":"80008"},{"children":[],"label":"电影","mccCode":"80009"}],"label":"休闲娱乐","mccCode":"8"},{"children":[{"children":[],"label":"摄影","mccCode":"90001"},{"children":[],"label":"massage","mccCode":"90002"},{"children":[],"label":"通讯运营商","mccCode":"90003"},{"children":[],"label":"车行","mccCode":"90004"},{"children:":[],"label":"软件服务","mccCode":"90005"}],"label":"其他服务类","mccCode":"9"},{"children":[{"children":[],"label":"Hotel","mccCode":"100001"},{"children":[],"label":"Motel","mccCode":"100002"}],"label":"酒店","mccCode":"10"},{"children":[{"children":[],"label":"代购","mccCode":"110001"},{"children":[],"label":"物流(大宗出口贸易)","mccCode":"110002"},{"children":[],"label":"红酒出口","mccCode":"110003"},{"children":[],"label":"综合电商","mccCode":"110004"}],"label":"出口贸易","mccCode":"11"},{"children":[{"children":[],"label":"建材","mccCode":"120001"},{"children":[],"label":"家居","mccCode":"120002"}],"label":"家居建材","mccCode":"12"}]'); insert into `royalpay_production`.`sys_configs` ( `config_key`, `config_value`) values ( 'royalpayindustry.json', '[{"children":[{"children":[],"label":"机票","mccCode":"10001"},{"children":[],"label":"旅游行业","mccCode":"10002"},{"children":[],"label":"私人定制旅游","mccCode":"10003"},{"children":[],"label":"租车","mccCode":"10004"},{"children":[],"label":"巴士","mccCode":"10005"}],"label":"旅游出行","mccCode":"1"},{"children":[{"children":[],"label":"饭店","mccCode":"20001"},{"children":[],"label":"奶茶店","mccCode":"20002"},{"children":[],"label":"烧烤","mccCode":"20003"},{"children":[],"label":"火锅","mccCode":"20004"},{"children":[],"label":"Coffee","mccCode":"20005"},{"children":[],"label":"酒吧","mccCode":"20006"}],"label":"餐饮","mccCode":"2"},{"children":[{"children":[],"label":"培训类","mccCode":"30001"},{"children":[],"label":"移民留学","mccCode":"30002"},{"children":[],"label":"私人幼儿园","mccCode":"30003"}],"label":"教育","mccCode":"3"},{"children":[{"children":[],"label":"换汇","mccCode":"40001"},{"children":[],"label":"房产","mccCode":"40002"}],"label":"商务咨询","mccCode":"4"},{"children":[{"children":[],"label":"公众号服务商","mccCode":"50001"},{"children":[],"label":"各种媒体类宣传","mccCode":"50002"}],"label":"传媒","mccCode":"5","value":"{\"category\":\"SERVICE\",\"code\":\"7542\",\"description\":\"Car Washes\",\"parentCode\":\"S10\"}"},{"children":[{"children":[],"label":"美容院","mccCode":"60001"},{"children":[],"label":"医疗美容","mccCode":"60002"}],"label":"医美","mccCode":"6"},{"children":[{"label":"超市","mccCode":"70001"},{"children":[],"label":"服装店","mccCode":"70002"},{"children":[],"label":"鞋店","mccCode":"70003"},{"children":[],"label":"珠宝店","mccCode":"70004"},{"children":[],"label":"箱包","mccCode":"70005"}],"label":"零售","mccCode":"7"},{"children":[{"children":[],"label":"桌游吧","mccCode":"80001"},{"children":[],"label":"演唱会","mccCode":"80002"},{"children":[],"label":"马术训练","mccCode":"80003"},{"children":[],"label":"瑜伽","mccCode":"80004"},{"children":[],"label":"健身","mccCode":"80005"},{"children":[],"label":"社团","mccCode":"80006"},{"children":[],"label":"网吧","mccCode":"80007"},{"children":[],"label":"KTV","mccCode":"80008"},{"children":[],"label":"电影","mccCode":"80009"}],"label":"休闲娱乐","mccCode":"8"},{"children":[{"children":[],"label":"摄影","mccCode":"90001"},{"children":[],"label":"massage","mccCode":"90002"},{"children":[],"label":"通讯运营商","mccCode":"90003"},{"children":[],"label":"车行","mccCode":"90004"},{"children:":[],"label":"软件服务","mccCode":"90005"}],"label":"其他服务类","mccCode":"9"},{"children":[{"children":[],"label":"Hotel","mccCode":"100001"},{"children":[],"label":"Motel","mccCode":"100002"}],"label":"酒店","mccCode":"10"},{"children":[{"children":[],"label":"代购","mccCode":"110001"},{"children":[],"label":"物流(大宗出口贸易)","mccCode":"110002"},{"children":[],"label":"红酒出口","mccCode":"110003"},{"children":[],"label":"综合电商","mccCode":"110004"}],"label":"出口贸易","mccCode":"11"},{"children":[{"children":[],"label":"建材","mccCode":"120001"},{"children":[],"label":"家居","mccCode":"120002"}],"label":"家居建材","mccCode":"12"}]');
ALTER TABLE `sys_client_config`
ADD COLUMN `gateway_alipay_online` tinyint(1) NULL DEFAULT 1 COMMENT '支付宝线上网关使用线上渠道' AFTER `require_remark`;
ALTER TABLE `sys_clients`
ADD COLUMN `gateway_alipay_online` tinyint(1) NULL DEFAULT 1 COMMENT '支付宝线上网关使用线上渠道' AFTER `require_remark`;

@ -152,14 +152,6 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
return res; return res;
} }
private JSONObject getSevenOrMonth(JSONObject params, JSONObject today){
JSONObject res = new JSONObject();
res.put("traded_partners", clientCustomersMapper.countTradedClients(params) + clientAnalysisMapper.countNewClients(today));
res.put("total_customers", clientCustomersMapper.countTotalCustomers(params) + clientAnalysisMapper.countClients(today));
res.put("old_customers", clientCustomersMapper.countTotalOldCustomers(params) + clientAnalysisMapper.countTradedPartners(params));
return res;
}
@Override @Override
public List<JSONObject> getTradeInTypes(JSONObject params) { public List<JSONObject> getTradeInTypes(JSONObject params) {
return transactionAnalysisMapper.getTradeAmountInTypes(params); return transactionAnalysisMapper.getTradeAmountInTypes(params);
@ -540,7 +532,7 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
}*/ }*/
@Override @Override
public JSONObject getPlatformAmount(JSONObject params) { public JSONObject getPlatformAmount(JSONObject params) {
String jsonStr = stringRedisTemplate.boundValueOps("org_ChannelAnalysis" + params.getString("begin")).get(); String jsonStr = stringRedisTemplate.boundValueOps("org_ChannelAnalysis" + params.getString("org_id")+params.getString("begin")).get();
JSONObject channelAnalysis = JSONObject.parseObject(jsonStr); JSONObject channelAnalysis = JSONObject.parseObject(jsonStr);
if(channelAnalysis != null){ if(channelAnalysis != null){
return channelAnalysis; return channelAnalysis;
@ -555,7 +547,7 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
}else { }else {
resp = customerAndOrdersStatisticsMapper.getChannelCommonCount(params); resp = customerAndOrdersStatisticsMapper.getChannelCommonCount(params);
} }
stringRedisTemplate.boundValueOps("org_ChannelAnalysis"+ params.getString("begin")).set(resp.toJSONString(), 5, TimeUnit.MINUTES); stringRedisTemplate.boundValueOps("org_ChannelAnalysis"+ params.getString("org_id")+params.getString("begin")).set(resp.toJSONString(), 5, TimeUnit.MINUTES);
return resp; return resp;
} }
} }

@ -5,6 +5,7 @@ import java.util.List;
import javax.annotation.Resource; import javax.annotation.Resource;
import au.com.royalpay.payment.manage.analysis.mappers.CustomerAndOrdersStatisticsMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
@ -23,6 +24,9 @@ public class PartnersAnalysisServiceImpl implements PartnersAnalysisService {
@Resource @Resource
private ClientAnalysisMapper clientAnalysisMapper; private ClientAnalysisMapper clientAnalysisMapper;
@Resource
private CustomerAndOrdersStatisticsMapper customerAndOrdersStatisticsMapper;
@Override @Override
public List<JSONObject> getNewPartnersAnalysis(JSONObject params) { public List<JSONObject> getNewPartnersAnalysis(JSONObject params) {
return clientAnalysisMapper.countNewClientsHistory(params); return clientAnalysisMapper.countNewClientsHistory(params);
@ -30,7 +34,7 @@ public class PartnersAnalysisServiceImpl implements PartnersAnalysisService {
@Override @Override
public List<JSONObject> getTradePartnersAnalysis(JSONObject params){ public List<JSONObject> getTradePartnersAnalysis(JSONObject params){
return clientAnalysisMapper.countTradePartnersHistory(params); return customerAndOrdersStatisticsMapper.countTradedClientsByDate(params);
} }
@Override @Override

@ -51,4 +51,6 @@ public interface CustomerAndOrdersStatisticsMapper {
JSONObject getCommonCount(JSONObject params); JSONObject getCommonCount(JSONObject params);
PageList<JSONObject> getAreaMerchantTradeAnalysis(JSONObject params, PageBounds pageBounds); PageList<JSONObject> getAreaMerchantTradeAnalysis(JSONObject params, PageBounds pageBounds);
List<JSONObject> countTradedClientsByDate(JSONObject parasm);
} }

@ -19,7 +19,11 @@ public class AppClientBean {
private String timezone; private String timezone;
@JSONField(name = "customer_surcharge_rate") @JSONField(name = "customer_surcharge_rate")
private Double customerSurchargeRate; private Double customerSurchargeRate;
private String company_phone;
private String address;
private String suburb;
private String postcode;
private String state;
public JSONObject updateObject() { public JSONObject updateObject() {
@ -36,6 +40,22 @@ public class AppClientBean {
if (timezone != null) { if (timezone != null) {
res.put("timezone", timezone); res.put("timezone", timezone);
} }
if (company_phone != null) {
res.put("company_phone", company_phone);
}
if (address != null) {
res.put("address", address);
}
if (suburb != null) {
res.put("suburb", suburb);
}
if (postcode != null) {
res.put("postcode", postcode);
}
if (state != null) {
res.put("state", state);
}
return res; return res;
} }
@ -77,4 +97,44 @@ public class AppClientBean {
public Double getCustomerSurchargeRate(){ public Double getCustomerSurchargeRate(){
return customerSurchargeRate; return customerSurchargeRate;
} }
public String getCompany_phone() {
return company_phone;
}
public void setCompany_phone(String company_phone) {
this.company_phone = company_phone;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getSuburb() {
return suburb;
}
public void setSuburb(String suburb) {
this.suburb = suburb;
}
public String getPostcode() {
return postcode;
}
public void setPostcode(String postcode) {
this.postcode = postcode;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
} }

@ -168,8 +168,7 @@ public class RetailAppServiceImp implements RetailAppService {
private ClientModifySupport clientModifySupport; private ClientModifySupport clientModifySupport;
private Map<String, AppMsgSender> senderMap = new HashMap<>(); private Map<String, AppMsgSender> senderMap = new HashMap<>();
private final String fileName[] = { "source_agree_file", "client_bank_file", "client_id_file", "client_agree_file", "client_company_file", private final String fileName[] = { "client_bank_file", "client_id_file", "client_company_file"};
"client_apply_file" };
@Resource @Resource
public void setAppMsgSenders(AppMsgSender[] senders) { public void setAppMsgSenders(AppMsgSender[] senders) {
@ -351,9 +350,9 @@ public class RetailAppServiceImp implements RetailAppService {
public void uploadAuthFiles(JSONObject device, ClientAuthFilesInfo clientAuthFilesInfo) { public void uploadAuthFiles(JSONObject device, ClientAuthFilesInfo clientAuthFilesInfo) {
JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id"));
JSONObject account = clientAccountMapper.findById(device.getString("account_id")); JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
clientAuthFilesInfo.setFile_id_info(null);
clientAuthFilesInfo.setAuthStatus(0); clientAuthFilesInfo.setAuthStatus(0);
clientAuthFilesInfo.setFile_agreement_info(null); clientAuthFilesInfo.setFile_agreement_info(null);
clientAuthFilesInfo.setFile_apply_info(null);
clientManager.uploadAuthFiles(account, client.getString("client_moniker"), clientAuthFilesInfo); clientManager.uploadAuthFiles(account, client.getString("client_moniker"), clientAuthFilesInfo);
} }
@ -442,6 +441,8 @@ public class RetailAppServiceImp implements RetailAppService {
@Override @Override
public JSONObject getClientInfoMe(JSONObject device) { public JSONObject getClientInfoMe(JSONObject device) {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
result.put("base_info_lack", false);
result.put("compliance_info_lack", false);
JSONObject client = clientMapper.findClient(device.getIntValue("client_id")); JSONObject client = clientMapper.findClient(device.getIntValue("client_id"));
if(StringUtils.isEmpty(client.getString("business_structure"))|| if(StringUtils.isEmpty(client.getString("business_structure"))||
StringUtils.isEmpty(client.getString("logo_url"))|| StringUtils.isEmpty(client.getString("logo_url"))||

@ -20,6 +20,7 @@ import au.com.royalpay.payment.tools.env.PlatformEnvironment;
import au.com.royalpay.payment.tools.env.SysConfigManager; import au.com.royalpay.payment.tools.env.SysConfigManager;
import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException; import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.exceptions.NotFoundException;
import au.com.royalpay.payment.tools.exceptions.ServerErrorException; import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
import au.com.royalpay.payment.tools.locale.LocaleSupport; import au.com.royalpay.payment.tools.locale.LocaleSupport;
import au.com.royalpay.payment.tools.utils.PasswordUtils; import au.com.royalpay.payment.tools.utils.PasswordUtils;
@ -254,6 +255,22 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
} }
private void applyerToClient(String username) { private void applyerToClient(String username) {
JSONObject sysConfig = sysConfigManager.getSysConfig();
String arr[] = sysConfig.getString("temp_sub_mch_id").split(",");
String tempSubMerchantId =null;
WeChatPayConfig.Merchant availableMerchant = null;
int errorReCounts = 6;
for (int i = 0; i < errorReCounts; i++) {
try{
tempSubMerchantId =arr[new Random().nextInt(arr.length)];
availableMerchant = mpPaymentApi.determineMerchant(tempSubMerchantId);
i=errorReCounts;
}catch (Exception e){
}
}
if(availableMerchant==null){
throw new BadRequestException("System is busy Please try again");
}
Date now = new Date(); Date now = new Date();
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("begin_time", DateFormatUtils.format(now, "YYYYMMdd")); param.put("begin_time", DateFormatUtils.format(now, "YYYYMMdd"));
@ -265,11 +282,10 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
} }
JSONObject apply = sysClientPreMapperMapper.findByUserName(username); JSONObject apply = sysClientPreMapperMapper.findByUserName(username);
JSONObject sysConfig = sysConfigManager.getSysConfig(); JSONObject account = clientAccountMapper.findByPhone(apply.getString("contact_phone"), "+61");
if (account != null) {
String arr[] = sysConfig.getString("temp_sub_mch_id").split(","); throw new ForbiddenException("The user name has been registered");
String tempSubMerchantId = arr[new Random().nextInt(arr.length)]; }
WeChatPayConfig.Merchant availableMerchant = mpPaymentApi.determineMerchant(tempSubMerchantId);
String clientMoniker = generateClientMoniker(); String clientMoniker = generateClientMoniker();
JSONObject sysClient = new JSONObject(); JSONObject sysClient = new JSONObject();
sysClient.put("company_name", apply.getString("company_name")); sysClient.put("company_name", apply.getString("company_name"));
@ -306,7 +322,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
JSONObject sysAccount = new JSONObject(); JSONObject sysAccount = new JSONObject();
sysAccount.put("username", apply.getString("username")); sysAccount.put("username", apply.getString("username"));
sysAccount.put("display_name", apply.getString("username")); sysAccount.put("display_name", apply.getString("contact_person"));
String salt = PasswordUtils.newSalt(); String salt = PasswordUtils.newSalt();
sysAccount.put("salt", salt); sysAccount.put("salt", salt);
sysAccount.put("role", 1); sysAccount.put("role", 1);
@ -421,8 +437,12 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
HttpRequestResult result = new HttpRequestGenerator(url, RequestMethod.GET).execute(); HttpRequestResult result = new HttpRequestGenerator(url, RequestMethod.GET).execute();
if (result.isSuccess()) { if (result.isSuccess()) {
banInfo = result.getResponseContentJSONObj(); banInfo = result.getResponseContentJSONObj();
if (!banInfo.getBoolean("valid")){
throw new NotFoundException("BSB Number Not Found");
}
} }
} catch (URISyntaxException | IOException e) { } catch (URISyntaxException | IOException e) {
throw new ServerErrorException();
} }
return banInfo; return banInfo;
} }

@ -7,6 +7,7 @@ import au.com.royalpay.payment.tools.env.SysConfigManager;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -70,6 +71,9 @@ public class SimpleClientApplyController {
@RequestMapping(value = "/info/update/{username}", method = RequestMethod.POST) @RequestMapping(value = "/info/update/{username}", method = RequestMethod.POST)
public void registerCompanyInfo(@PathVariable String username, @RequestBody @Valid ClientPreApplyBean applyBean) { public void registerCompanyInfo(@PathVariable String username, @RequestBody @Valid ClientPreApplyBean applyBean) {
simpleClientApplyService.checkOrGenerateRegisterProcessKey(username,applyBean.getCodeKey()); simpleClientApplyService.checkOrGenerateRegisterProcessKey(username,applyBean.getCodeKey());
if(StringUtils.isNotEmpty(applyBean.getBsb_no().trim())){
simpleClientApplyService.getBankInfo(applyBean.getBsb_no());
}
simpleClientApplyService.saveOrUpdateApplyInfo(applyBean.insertObject(), username); simpleClientApplyService.saveOrUpdateApplyInfo(applyBean.insertObject(), username);
} }

@ -242,6 +242,10 @@ public interface ClientManager {
void changeRetailPaySurcharge(JSONObject account, boolean paySurcharge); void changeRetailPaySurcharge(JSONObject account, boolean paySurcharge);
void changeRequireCustinfo(JSONObject account, boolean requireCustinfo);
void changeRequireRemark(JSONObject account, boolean requireRemark);
void changeSurcharge(JSONObject account,JSONObject device, UpdateSurchargeDTO updateSurchargeDTO); void changeSurcharge(JSONObject account,JSONObject device, UpdateSurchargeDTO updateSurchargeDTO);
void refusePartner(String clientMoniker, JSONObject manager, String refuse_remark); void refusePartner(String clientMoniker, JSONObject manager, String refuse_remark);

@ -2933,6 +2933,30 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
.processClientConfigModify(new SwitchPermissionModify(account, client.getString("client_moniker"), "retail_surcharge", paySurcharge)); .processClientConfigModify(new SwitchPermissionModify(account, client.getString("client_moniker"), "retail_surcharge", paySurcharge));
} }
@Override
public void changeRequireCustinfo(JSONObject account, boolean requireCustinfo) {
int clientId = account.getIntValue("client_id");
JSONObject client = getClientInfo(clientId);
if (client == null) {
throw new InvalidShortIdException();
}
clientModifySupport
.processClientConfigModify(new SwitchPermissionModify(account, client.getString("client_moniker"), "require_custinfo", requireCustinfo));
}
@Override
public void changeRequireRemark(JSONObject account, boolean requireRemark) {
int clientId = account.getIntValue("client_id");
JSONObject client = getClientInfo(clientId);
if (client == null) {
throw new InvalidShortIdException();
}
clientModifySupport
.processClientConfigModify(new SwitchPermissionModify(account, client.getString("client_moniker"), "require_remark", requireRemark));
}
@Override @Override
public void changeSurcharge(JSONObject account, JSONObject device, UpdateSurchargeDTO updateSurchargeDTO) { public void changeSurcharge(JSONObject account, JSONObject device, UpdateSurchargeDTO updateSurchargeDTO) {
JSONObject client = clientMapper.findClient(device.getIntValue("client_id")); JSONObject client = clientMapper.findClient(device.getIntValue("client_id"));
@ -3015,6 +3039,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
BigDecimal customerSurchargeRate = new BigDecimal(appClientBean.getCustomerSurchargeRate()).setScale(2, BigDecimal.ROUND_HALF_DOWN); BigDecimal customerSurchargeRate = new BigDecimal(appClientBean.getCustomerSurchargeRate()).setScale(2, BigDecimal.ROUND_HALF_DOWN);
setCustomerSurchargeRate(account, client.getString("client_moniker"), customerSurchargeRate); setCustomerSurchargeRate(account, client.getString("client_moniker"), customerSurchargeRate);
} }
clientInfoCacheSupport.clearClientCache(client_id);
} }
@Override @Override
@ -3530,6 +3555,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (client == null) { if (client == null) {
throw new InvalidShortIdException(); throw new InvalidShortIdException();
} }
if(client.getIntValue("approve_result")==1){
throw new BadRequestException("The merchant has been passed");
}
client.putAll(clientConfigService.find(client.getIntValue("client_id"))); client.putAll(clientConfigService.find(client.getIntValue("client_id")));
// 提交合规启用银行、费率验证 add by Tayl0r 2017/06/13 // 提交合规启用银行、费率验证 add by Tayl0r 2017/06/13

@ -62,4 +62,8 @@ public class AuditModify extends ClientModify {
public void setApprove_result(Integer approve_result) { public void setApprove_result(Integer approve_result) {
this.approve_result = approve_result; this.approve_result = approve_result;
} }
public Integer getOpen_status() {
return open_status;
}
} }

@ -10,7 +10,7 @@ import com.alibaba.fastjson.JSONObject;
public class SettleHourModify extends ClientConfigModify { public class SettleHourModify extends ClientConfigModify {
private int settle_hour; private int settle_hour;
public SettleHourModify(JSONObject account, String clientMoniker, int settle_hour) { public SettleHourModify(JSONObject account, String clientMoniker, Integer settle_hour) {
super(account, clientMoniker); super(account, clientMoniker);
this.settle_hour = settle_hour; this.settle_hour = settle_hour;
} }

@ -342,6 +342,18 @@ public class PartnerViewController {
clientManager.changeRetailPaySurcharge(account, pass.getBooleanValue("retail_surcharge")); clientManager.changeRetailPaySurcharge(account, pass.getBooleanValue("retail_surcharge"));
} }
@PartnerMapping(value = "/require_custinfo", method = RequestMethod.PUT)
@ResponseBody
public void changeRequireCustinfo(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
clientManager.changeRequireCustinfo(account, pass.getBooleanValue("require_custinfo"));
}
@PartnerMapping(value = "/require_remark", method = RequestMethod.PUT)
@ResponseBody
public void changeRequireRemark(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
clientManager.changeRequireRemark(account, pass.getBooleanValue("require_remark"));
}
@PartnerMapping(value = "/sign_events", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) @PartnerMapping(value = "/sign_events", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER})
@ResponseBody @ResponseBody
@ -404,11 +416,12 @@ public class PartnerViewController {
clientManager.sendVerifyEmail(account.getJSONObject("client"),account.getString("account_id")); clientManager.sendVerifyEmail(account.getJSONObject("client"),account.getString("account_id"));
} }
@PartnerMapping(value = "/update/partnerInfo", method = RequestMethod.PUT) @PartnerMapping(value = "/update/partnerInfo", method = RequestMethod.PUT,roles = PartnerRole.ADMIN)
@ResponseBody @ResponseBody
public void updatePartnerInfo(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account,@RequestBody ClientRegisterInfo info) { public void updatePartnerInfo(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account,@RequestBody ClientRegisterInfo info) {
JSONObject client = account.getJSONObject("client"); JSONObject client = account.getJSONObject("client");
if (client.getIntValue("approve_result") != 1 && client.getIntValue("source") == 4){
if (client.getIntValue("approve_result") != 1){
clientManager.updateClientRegisterInfo(null,account.getString("client_moniker"),info); clientManager.updateClientRegisterInfo(null,account.getString("client_moniker"),info);
}else { }else {
throw new BadRequestException("已通过审核,暂不能提交和修改"); throw new BadRequestException("已通过审核,暂不能提交和修改");

@ -316,6 +316,7 @@
ifnull(sum(CASE WHEN s.channel = 'AlipayOnline' THEN s.total ELSE 0 END),0) alipayonlineamount, ifnull(sum(CASE WHEN s.channel = 'AlipayOnline' THEN s.total ELSE 0 END),0) alipayonlineamount,
ifnull(sum(CASE WHEN s.channel = 'AlipayOnline' THEN s.orders ELSE 0 END),0) alipayonline_order_count ifnull(sum(CASE WHEN s.channel = 'AlipayOnline' THEN s.orders ELSE 0 END),0) alipayonline_order_count
FROM statistics_customer_order s FROM statistics_customer_order s
LEFT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1
]]> ]]>
<where> <where>
s.client_id != 0 s.client_id != 0
@ -358,12 +359,12 @@
<select id="getAreaMerchantTradeAnalysis" resultType="com.alibaba.fastjson.JSONObject"> <select id="getAreaMerchantTradeAnalysis" resultType="com.alibaba.fastjson.JSONObject">
SELECT sum(s.total) total,sum(s.orders) orders,c.client_moniker,c.short_name,c.bd_user_name,c.suburb,c.state,c.royalpayindustry,sum(if(s.channel='Alipay',s.total,0)) alipay_total, SELECT sum(s.total) total,sum(s.orders) orders,c.client_moniker,c.short_name,c.bd_user_name,c.suburb,c.state,c.royalpayindustry,sum(if(s.channel='Alipay',s.total,0)) alipay_total,
sum(if(s.channel='Alipay',s.orders,0)) alipay_order,sum(if(s.channel='Wechat',s.total,0)) wechat_toatl,sum(if(s.channel='Wechat',s.orders,0)) wechat_order sum(if(s.channel='Alipay'OR s.channel='AlipayOnline',s.orders,0)) alipay_order,sum(if(s.channel='Wechat',s.total,0)) wechat_toatl,sum(if(s.channel='Wechat',s.orders,0)) wechat_order
FROM statistics_customer_order s FROM statistics_customer_order s
RIGHT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1 RIGHT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1
<if test="bd_user!=null"> <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 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 date(d.start_date)&lt;= #{begin} and (d.end_date is null or date(d.end_date)&gt;= #{end}) and
d.is_valid=1 d.is_valid=1
</if> </if>
<where> <where>
@ -383,4 +384,38 @@
</where> </where>
GROUP BY s.client_id ORDER BY total DESC GROUP BY s.client_id ORDER BY total DESC
</select> </select>
<select id="countTradedClientsByDate" resultType="com.alibaba.fastjson.JSONObject">
SELECT date_format(s.date,'%d-%m-%Y') datelist,COUNT(DISTINCT s.client_id) num
FROM statistics_customer_order s
LEFT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1
<where>
s.client_id != 0
<if test="begin!=null">and s.date &gt;= #{begin}</if>
<if test="end!=null">and s.date &lt; #{end}</if>
<if test="client_ids!=null">
AND s.client_id IN
<foreach collection="client_ids" open="(" close=")" separator="," item="client_id">
#{client_id}
</foreach>
</if>
<if test="client_ids==null and client_id != null">
and s.client_id=#{client_id}
</if>
<if test="channel!=null">and s.channel = #{channel}</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="bd_group!=null">and c.client_id in
(SELECT b.client_id FROM sys_client_bd b
INNER JOIN financial_bd_config c ON c.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 (c.bd_group=#{bd_group} or c.manager_id=#{bd_group})
<if test="bd_group_bd">and c.manager_id=#{bd_group_bd}</if>
)
</if>
</where>
GROUP BY datelist ORDER BY datelist
</select>
</mapper> </mapper>

@ -797,19 +797,19 @@
<select id="getAreaMerchantAmountAnalysis" resultType="com.alibaba.fastjson.JSONObject"> <select id="getAreaMerchantAmountAnalysis" resultType="com.alibaba.fastjson.JSONObject">
SELECT c.client_moniker,c.short_name,c.bd_user_name,sum(if(t.transaction_type='Credit',t.clearing_amount,0)) total, SELECT c.client_moniker,c.short_name,c.bd_user_name,sum(if(t.transaction_type='Credit',t.clearing_amount,0)) total,
sum(if(t.transaction_type='Credit',1,0)) orders, COUNT(DISTINCT t.order_id) orders,
c.suburb,c.state,c.royalpayindustry,sum(if(t.channel='Alipay'AND t.transaction_type='Credit',t.clearing_amount,0)) alipay_total, c.suburb,c.state,c.royalpayindustry,sum(if(t.channel='Alipay',t.clearing_amount,0)) alipay_total,
sum(if(t.channel='Alipay'AND t.transaction_type='Credit',1,0)) alipay_order,sum(if(t.channel='Wechat'AND t.transaction_type='Credit',t.clearing_amount,0)) wechat_toatl, sum(if(t.channel='Alipay'AND t.channel='AlipayOnline',1,0)) alipay_order,sum(if(t.channel='Wechat',t.clearing_amount,0)) wechat_toatl,
sum(if(t.channel='Wechat'AND t.transaction_type='Credit',1,0)) wechat_order sum(if(t.channel='Wechat',1,0)) wechat_order
FROM pmt_transactions t FROM pmt_transactions t
INNER JOIN pmt_orders ord on ord.order_id = t.order_id INNER JOIN pmt_orders ord on ord.order_id = t.order_id
RIGHT JOIN sys_clients c on t.client_id = c.client_id and c.is_valid = 1 RIGHT JOIN sys_clients c on t.client_id = c.client_id and c.is_valid = 1
<if test="bd_user!=null"> <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 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 date(d.start_date)&lt;= #{begin} and (d.end_date is null or date(d.end_date)&gt;= #{end}) and
d.is_valid=1 d.is_valid=1
</if> </if>
where (t.transaction_type = 'Credit' or t.refund_id is not null) where (t.transaction_type = 'Credit')
<if test="begin!=null">and t.transaction_time &gt;= #{begin}</if> <if test="begin!=null">and t.transaction_time &gt;= #{begin}</if>
<if test="end!=null">and t.transaction_time &lt;= #{end}</if> <if test="end!=null">and t.transaction_time &lt;= #{end}</if>
<if test="state!=null">and c.state &lt;= #{state}</if> <if test="state!=null">and c.state &lt;= #{state}</if>

@ -45,29 +45,41 @@
</update> </update>
<select id="countTradedClients" resultType="java.lang.Integer"> <select id="countTradedClients" resultType="java.lang.Integer">
select COUNT(DISTINCT client_id) traded_clients select COUNT(DISTINCT s.client_id) traded_clients
FROM sys_clients_customers FROM sys_clients_customers s
LEFT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1
<where> <where>
<if test="begin!=null">and last_payment_time &gt;= #{begin}</if> <if test="begin!=null">and s.last_payment_time &gt;= #{begin}</if>
<if test="end!=null">and last_payment_time &lt;= #{end}</if> <if test="end!=null">and s.last_payment_time &lt;= #{end}</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>
</where> </where>
</select> </select>
<select id="countTotalCustomers" resultType="java.lang.Integer"> <select id="countTotalCustomers" resultType="java.lang.Integer">
select COUNT(DISTINCT customer_id) total_customers select COUNT(DISTINCT s.customer_id) total_customers
FROM sys_clients_customers FROM sys_clients_customers s
LEFT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1
<where> <where>
<if test="begin!=null">and last_payment_time &gt;= #{begin}</if> <if test="begin!=null">and s.last_payment_time &gt;= #{begin}</if>
<if test="end!=null">and last_payment_time &lt;= #{end}</if> <if test="end!=null">and s.last_payment_time &lt;= #{end}</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>
</where> </where>
</select> </select>
<select id="countTotalOldCustomers" resultType="java.lang.Integer"> <select id="countTotalOldCustomers" resultType="java.lang.Integer">
select COUNT(DISTINCT customer_id) total_old_customers select COUNT(DISTINCT s.customer_id) total_old_customers
FROM sys_clients_customers FROM sys_clients_customers s
LEFT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1
<where> <where>
<if test="begin!=null">and update_time &lt; #{begin} AND last_payment_time &gt; #{begin}</if> <if test="begin!=null">and s.update_time &lt; #{begin} AND s.last_payment_time &gt; #{begin}</if>
<if test="end!=null">and last_payment_time &lt; #{end}</if> <if test="end!=null">and s.last_payment_time &lt; #{end}</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>
</where> </where>
</select> </select>
</mapper> </mapper>

@ -194,7 +194,7 @@
</div> </div>
<div class="row padding" style="position: relative"> <div class="row padding" style="position: relative">
<div class="col-xs-8 text-left"> <div class="col-xs-8 text-left">
<img src="static/images/royalpay_red.png" class="img-block logo"> <img src="static/images/logo_new.jpg" class="img-block logo">
<p>联系人: Locky Ge</p> <p>联系人: Locky Ge</p>
<p>Phone: +61 03 9448 8865</p> <p>Phone: +61 03 9448 8865</p>
<p>Email: info@royalpay.com.au</p> <p>Email: info@royalpay.com.au</p>

@ -0,0 +1,188 @@
[
{
"children": [
{
"children": [],
"label": "机票 Plane ticket",
"mccCode": "10001"
},
{
"children": [],
"label": "旅游行业 tourist industry",
"mccCode": "10002"
},
{
"children": [],
"label": "私人定制旅游 Customized travel",
"mccCode": "10003"
},
{
"children": [],
"label": "租车 Car Rental",
"mccCode": "10004"
},
{
"children": [],
"label": "巴士 Bus",
"mccCode": "10005"
}
],
"label": "旅游出行 Tourism trips",
"mccCode": "1"
},
{
"children": [
{
"children": [],
"label": "饭店 Restaurant",
"mccCode": "20001"
},
{
"children": [],
"label": "奶茶店 Milk tea shop",
"mccCode": "20002"
},
{
"children": [],
"label": "烧烤 BBQ",
"mccCode": "20003"
},
{
"children": [],
"label": "火锅 Chafing dish",
"mccCode": "20004"
},
{
"children": [],
"label": "咖啡 Coffee",
"mccCode": "20005"
},
{
"children": [],
"label": "酒吧 Bar",
"mccCode": "20006"
}
],
"label": "餐饮 Food and beverage industry",
"mccCode": "2"
},
{
"children": [
{
"children": [],
"label": "公众号服务商 Office Account Provider",
"mccCode": "50001"
},
{
"children": [],
"label": "各种媒体类宣传 Media",
"mccCode": "50002"
}
],
"label": "传媒 media industry",
"mccCode": "5"
},
{
"children": [
{
"label": "超市 Supermarket",
"mccCode": "70001"
},
{
"children": [],
"label": "服装店 Clothes shop",
"mccCode": "70002"
},
{
"children": [],
"label": "鞋店 Shoe shop",
"mccCode": "70003"
},{
"children": [],
"label": "箱包 Bags",
"mccCode": "70005"
}
],
"label": "零售 Retail",
"mccCode": "7"
},
{
"children": [
{
"children": [],
"label": "桌游吧 Board Game",
"mccCode": "80001"
},
{
"children": [],
"label": "网吧 Net Bar",
"mccCode": "80007"
}
],
"label": "休闲娱乐 Leisure entertainment",
"mccCode": "8"
},
{
"children": [
{
"children": [],
"label": "摄影 Photography",
"mccCode": "90001"
},
{
"children": [],
"label": "通讯运营商 Communication operators",
"mccCode": "90003"
},
{
"children:":[],
"label":"软件服务 Software maintenance",
"mccCode":"90005"
}
],
"label": "其他服务类 Other Services",
"mccCode": "9"
},
{
"children": [
{
"children": [],
"label": "酒店 Hotel",
"mccCode": "100001"
},
{
"children": [],
"label": "汽车旅馆 Motel",
"mccCode": "100002"
}
],
"label": "酒店 Hotel",
"mccCode": "10"
},
{
"children": [
{
"children": [],
"label": "代购 Daigou",
"mccCode": "110001"
},
{
"children": [],
"label": "物流(大宗出口贸易) Logistics",
"mccCode": "110002"
},
{
"children": [],
"label": "红酒出口 Red wine exports",
"mccCode": "110003"
},
{
"children": [],
"label": "综合电商 e-Commerce",
"mccCode": "110004"
}
],
"label": "出口贸易 Export Business",
"mccCode": "11"
}
]

@ -15,6 +15,15 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct
return $http.get('/client/partner_info'); return $http.get('/client/partner_info');
}] }]
} }
}).state('edit', {
url: '/edit',
templateUrl: '/static/payment/partner/templates/client_partner_edit.html',
controller: 'clientPartnerEditCtrl',
resolve: {
partner: ['$http', function ($http) {
return $http.get('/client/partner_info');
}]
}
}).state('basic.payment_info', { }).state('basic.payment_info', {
url: '/payment', url: '/payment',
templateUrl: '/static/payment/partner/templates/client_payment_info.html', templateUrl: '/static/payment/partner/templates/client_payment_info.html',
@ -207,6 +216,112 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct
}); });
} }
}]); }]);
app.controller('clientPartnerEditCtrl', ['$scope', '$http', 'commonDialog','stateMap','countryMap','partner','$state','Upload',function ($scope, $http, commonDialog,stateMap,countryMap,partner,$state,Upload) {
$scope.partner = partner.data;
$scope.states = stateMap.configs();
$scope.countries = countryMap.configs();
$scope.uploadLogo = function (file) {
if (file != null) {
$scope.logoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.logoProgress;
$scope.partner.logo_id = resp.data.fileid;
$scope.partner.logo_url = resp.data.url;
}, function (resp) {
delete $scope.logoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
};
$scope.uploadShopPhoto = function (file) {
if (file != null) {
$scope.shopPhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.shopPhotoProgress;
$scope.partner.company_photo = resp.data.url;
}, function (resp) {
delete $scope.shopPhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
};
$scope.uploadStorePhoto = function (file) {
if (file != null) {
$scope.storePhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.storePhotoProgress;
$scope.partner.store_photo = resp.data.url;
}, function (resp) {
delete $scope.storePhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
};
$scope.updatePartner = function (form) {
if (form.$invalid) {
angular.forEach(form, function (item, key) {
if (key.indexOf('$') < 0) {
item.$dirty = true;
}
});
return;
}
if (!$scope.partner.logo_url) {
alert("Logo is necessary!");
return;
}
if($scope.partner.partner_type == 'photo'){
if (!$scope.partner.company_photo) {
alert('Shop Photo1 is necessary');
return;
}
if (!$scope.partner.store_photo) {
alert('Shop Photo2 is necessary');
return;
}
}
var content = '';
$http.put('/client/partner_info/update/partnerInfo', $scope.partner).then(function () {
if (content != '') {
commonDialog.alert({
title: 'Warning',
content: content,
type: 'error'
});
} else {
commonDialog.alert({
title: 'Success',
content: 'Update partner information successfully',
type: 'success'
});
}
$state.go('basic', {reload: true});
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
};
}]);
app.controller('clientComplianceFilesCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file', function ($scope, $http, $rootScope, commonDialog, $state, Upload, file) { app.controller('clientComplianceFilesCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file', function ($scope, $http, $rootScope, commonDialog, $state, Upload, file) {
$scope.file = file.data || {}; $scope.file = file.data || {};
@ -512,6 +627,42 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct
}) })
}) })
} }
$scope.toggleRequireCustInfo = function () {
if (!$scope.paymentInfo) {
return;
}
if (!$scope.ctrl.require_custinfo) {
$scope.ctrl.require_custinfo = true;
return;
}
$http.put('/client/partner_info/require_custinfo', {require_custinfo: $scope.paymentInfo.require_custinfo}).then(function () {
}, function (resp) {
commonDialog.alert({
title: 'failed to change require customer Info permission status',
content: resp.data.message,
type: 'error'
})
})
};
$scope.toggleRequireRemark = function () {
if (!$scope.paymentInfo) {
return;
}
if (!$scope.ctrl.require_remark) {
$scope.ctrl.require_remark = true;
return;
}
$http.put('/client/partner_info/require_remark', {require_remark: $scope.paymentInfo.require_remark}).then(function () {
}, function (resp) {
commonDialog.alert({
title: 'failed to change require remark permission status',
content: resp.data.message,
type: 'error'
})
})
};
}]); }]);
app.controller('clientPaymentMaterialCtrl', ['$scope', '$http', 'partner', function ($scope, $http, partner) { app.controller('clientPaymentMaterialCtrl', ['$scope', '$http', 'partner', function ($scope, $http, partner) {
$scope.paymentInfo = partner.data; $scope.paymentInfo = partner.data;

@ -48,6 +48,9 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
Partner Basic Information Partner Basic Information
<a role="button" class="pull-right" ui-sref="edit" ng-if="[1]|withRole">
<i class="fa fa-edit"></i> Edit
</a>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div class="form-horizontal"> <div class="form-horizontal">
@ -173,6 +176,41 @@
</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">
<p class="form-control-static" ng-bind="partner.business_hours"></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">
<p class="form-control-static" ng-bind="partner.merchant_tag"></p>
</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">
<p class="form-control-static" ng-bind="partner.merchant_introduction"></p>
</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">
<p class="form-control-static" ng-bind="partner.merchant_video_url"></p>
</div>
</div>
</div>
</div>
</div>
<!--end 商户基本资料--> <!--end 商户基本资料-->
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">Partner Contact Information</div> <div class="panel-heading">Partner Contact Information</div>

@ -0,0 +1,355 @@
<style>
.img-size{
max-height: 100px;
margin-left: 20px;
}
</style>
<section class="content-header">
<h1 ng-bind="partner.short_name"></h1>
<ol class="breadcrumb">
<li>
<i class="fa fa-sitemap"></i> Payment
</li>
<li><a ui-sref="^" ui-sref-opts="{reload:true}">Client Detail</a></li>
<li class="active">Partner Edit</li>
</ol>
</section>
<div class="content">
<form novalidate name="partnerForm">
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">Partner Basic Information</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-2">* Partner Code</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.client_moniker"></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">* Company Name</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.company_name"></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">* Short Name</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.short_name"></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Business Name</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.business_name"></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Business Structure</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.business_structure"></p>
</div>
</div>
<div class="form-group" ng-if="!partner.parent_client_id || ('00110'|withRole)">
<label class="control-label col-sm-2">Logo</label>
<div class="col-sm-8">
<div class="form-control-static">
<button class="btn btn-success" type="button" ngf-select="uploadLogo($file)"
accept="image/*" ngf-max-size="1MB">
<i class="fa fa-upload"></i> Upload Logo
</button>
</div>
<uib-progressbar value="logoProgress.value" ng-if="logoProgress"></uib-progressbar>
<img ng-src="{{partner.logo_url}}" ng-if="partner.logo_url" style="height: 100px;">
</div>
</div>
<div class="form-group" ng-if="partner.business_structure != 'Company'">
<label class="control-label col-sm-2">ABN</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.abn"></p>
</div>
</div>
<div class="form-group" ng-if="partner.business_structure == 'Company'">
<label class="control-label col-sm-2">ACN</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.acn"></p>
</div>
</div>
<div class="form-group" ng-if="!partner.parent_client_id || ('00110'|withRole)"
ng-class="{'has-error':partnerForm.partner_type.$invalid && partnerForm.partner_type.$dirty}">
<label class="control-label col-sm-2" for="partner-type-select">* Photo/Website</label>
<div class="col-sm-8">
<select class="form-control" ng-model="partner.partner_type"
id="partner-type-select"
name="partner_type">
<option value="">Please Choose</option>
<option value="photo">Photo</option>
<option value="companyWebsite">Website</option>
</select>
<p class="small text-info">If the partner is a offline shop then a photo of shop is
required while an online store shall choose company website</p>
<p class="small text-info">
只要有可能产生线下交易商户静态码、POS就必须上传照片否则支付宝会禁止交易</p>
<div ng-messages="partnerForm.partner_type.$error"
ng-if="partnerForm.partner_type.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group"
ng-if="partner.partner_type == 'photo' && (!partner.parent_client_id || ('00110'|withRole))">
<label class="control-label col-sm-2">* Shop Photo</label>
<div class="col-sm-5">
<div class="form-control-static"><em>1:</em>&nbsp;
<button class="btn btn-primary" type="button"
ngf-select="uploadShopPhoto($file)" accept="image/*" ngf-max-size="2MB">
<i class="fa fa-upload"></i> Upload Shop Photo1
</button>
</div>
<uib-progressbar value="shopPhotoProgress.value"
ng-if="shopPhotoProgress"></uib-progressbar>
<img ng-src="{{partner.company_photo}}" ng-if="partner.company_photo" class="thumbnail img-size">
</div>
<div class="col-sm-5">
<div class="form-control-static"><em>2:</em>&nbsp;
<button class="btn btn-primary" type="button"
ngf-select="uploadStorePhoto($file)" accept="image/*"
ngf-max-size="2MB">
<i class="fa fa-upload"></i> Upload Shop Photo2
</button>
</div>
<uib-progressbar value="storePhotoProgress.value"
ng-if="storePhotoProgress"></uib-progressbar>
<img ng-src="{{partner.store_photo}}" ng-if="partner.store_photo" class="thumbnail img-size">
</div>
</div>
<div class="form-group"
ng-if="partner.partner_type == 'companyWebsite' && (!partner.parent_client_id || ('00110'|withRole))"
ng-class="{'has-error':partnerForm.company_website.$invalid && partnerForm.company_website.$dirty}">
<label class="control-label col-sm-2" for="company_website-input">* Website</label>
<div class="col-sm-8">
<input type="text" name="company_website" class="form-control"
ng-model="partner.company_website"
id="company_website-input" required maxlength="200">
<div ng-messages="partnerForm.company_website.$error"
ng-if="partnerForm.company_website.$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 class="form-group"
ng-class="{'has-error':partnerForm.company_phone.$invalid && partnerForm.company_phone.$dirty}">
<label class="control-label col-sm-2" for="service-phone-input">* Service Phone</label>
<div class="col-sm-8">
<input class="form-control" required type="text" ng-model="partner.company_phone"
name="company_phone" id="service-phone-input" maxlength="20">
<div ng-messages="partnerForm.company_phone.$error"
ng-if="partnerForm.company_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</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':partnerForm.description.$invalid && partnerForm.description.$dirty}">
<label class="control-label col-sm-2" for="desc-input">Description</label>
<div class="col-sm-8">
<textarea class="form-control" ng-model="partner.description"
name="description" id="desc-input" maxlength="200" required></textarea>
<div ng-messages="partnerForm.description.$error"
ng-if="partnerForm.description.$dirty">
<p class="small text-danger" ng-message="maxlength">Less Than 200
Characters(including symbols and spaces)</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':partnerForm.remark.$invalid && partnerForm.remark.$dirty}">
<label class="control-label col-sm-2" for="desc-input">Remark</label>
<div class="col-sm-8">
<textarea class="form-control" ng-model="partner.remark"
name="remark" id="remark-input" maxlength="200" required></textarea>
<div ng-messages="partnerForm.remark.$error"
ng-if="partnerForm.remark.$dirty">
<p class="small text-danger" ng-message="maxlength">Less Than 200
Characters(including symbols and spaces)</p>
</div>
</div>
</div>
</div>
</div>
</div>
<!--end 商户基本资料-->
<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 col-sm-6"
ng-class="{'has-error':partnerForm.contact_phone.$invalid && partnerForm.contact_phone.$dirty}">
<label class="control-label col-sm-4" for="contact-phone-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>
<div class="form-group col-sm-6"
ng-class="{'has-error':partnerForm.contact_email.$invalid && partnerForm.contact_email.$dirty}">
<label class="control-label col-sm-4" 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">
<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"></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>
</div>
</div>
</div>
<div class="form-group col-sm-6">
<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">
<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>
</div>
</div>
</div>
<div class="form-group col-sm-6">
<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">
<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>
</div>
</div>
</div>
<div class="form-group col-sm-6">
<label class="control-label col-sm-4" for="state-input">State</label>
<div class="col-sm-8">
<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>
</div>
</div>
</div>
</div>
</div>
<div class="btn-group margin-bottom margin-top">
<button class="btn btn-success" type="button" ng-click="updatePartner(partnerForm)">Save
</button>
<a class="btn btn-danger" role="button" ui-sref="basic" ui-sref-opts="{reload:true}">Back</a>
</div>
</div>
</div>
</form>
</div>

@ -145,6 +145,28 @@
</div> </div>
</div> </div>
<div class="panel panel-default">
<div class="panel-heading">Order Config</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group" ng-if="'111'|withRole">
<label class="col-sm-2 control-label">Require Customer Information</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.require_custinfo" bs-switch
switch-change="toggleRequireCustInfo()">
</div>
</div>
<div class="form-group" ng-if="'111'|withRole">
<label class="col-sm-2 control-label">Require Remark</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.require_remark" bs-switch
switch-change="toggleRequireRemark()">
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">Payment Page</div> <div class="panel-heading">Payment Page</div>
<div class="panel-body"> <div class="panel-body">

Loading…
Cancel
Save