【R】自助进件业务接口开发

master
liuxinxin 5 years ago
parent 79d207bbdd
commit 9cb5da5816

@ -57,50 +57,21 @@ public class ClientPreApplyBean {
private String client_pay_type = "2"; private String client_pay_type = "2";
private String client_pay_desc = "201"; private String client_pay_desc = "201";
@NotEmpty(message = "contact_job can't be null")
private String contact_job; private String contact_job;
@NotEmpty(message = "representative_person can't be null")
private String representative_person; private String representative_person;
@NotEmpty(message = "representative_phone can't be null")
private String representative_phone; private String representative_phone;
@NotEmpty(message = "representative_email can't be null")
private String representative_email; private String representative_email;
@NotEmpty(message = "representative_job_title can't be null")
private String representative_job_title; private String representative_job_title;
@NotEmpty(message = "registered_address can't be null")
private String registered_address; private String registered_address;
@NotEmpty(message = "registered_suburb can't be null")
private String registered_suburb; private String registered_suburb;
@NotEmpty(message = "registered_state can't be null")
private String registered_state; private String registered_state;
@NotEmpty(message = "registered_postcode can't be null")
private String registered_postcode; private String registered_postcode;
@NotEmpty(message = "logo_url can't be null")
private String logo_url; private String logo_url;
@NotEmpty(message = "company_website can't be null")
private String company_website; private String company_website;
@NotEmpty(message = "company_photo can't be null")
private String company_photo; private String company_photo;
@NotEmpty(message = "royalpayindustry can't be null")
private String royalpayindustry;
@NotEmpty(message = "alipayindustry can't be null")
private String alipayindustry; private String alipayindustry;
private String wechatindustry;
private String store_photo;
/* private String contact_job;
private String representative_person;
private String representative_phone;
private String representative_email;
private String representative_job_title;
private String registered_address;
private String registered_suburb;
private String registered_state;
private String registered_postcode;
private String logo_url;
private String company_website;
private String company_photo;
private String royalpayindustry;
private String alipayindustry;*/
public JSONObject insertObject() { public JSONObject insertObject() {
JSONObject res = (JSONObject) JSON.toJSON(this); JSONObject res = (JSONObject) JSON.toJSON(this);
@ -395,14 +366,6 @@ public class ClientPreApplyBean {
this.company_photo = company_photo; this.company_photo = company_photo;
} }
public String getRoyalpayindustry() {
return royalpayindustry;
}
public void setRoyalpayindustry(String royalpayindustry) {
this.royalpayindustry = royalpayindustry;
}
public String getAlipayindustry() { public String getAlipayindustry() {
return alipayindustry; return alipayindustry;
} }
@ -410,4 +373,20 @@ public class ClientPreApplyBean {
public void setAlipayindustry(String alipayindustry) { public void setAlipayindustry(String alipayindustry) {
this.alipayindustry = alipayindustry; this.alipayindustry = alipayindustry;
} }
public String getStore_photo() {
return store_photo;
}
public void setStore_photo(String store_photo) {
this.store_photo = store_photo;
}
public String getWechatindustry() {
return wechatindustry;
}
public void setWechatindustry(String wechatindustry) {
this.wechatindustry = wechatindustry;
}
} }

@ -7,6 +7,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.IOException; import java.io.IOException;
import java.util.List;
public interface SimpleClientApplyService { public interface SimpleClientApplyService {
void verifyRegisterSMSCode(String codeKey, String phoneNumber); void verifyRegisterSMSCode(String codeKey, String phoneNumber);
@ -33,6 +34,14 @@ public interface SimpleClientApplyService {
void saveOrUpdateApplyInfo(JSONObject companyBean, String username); void saveOrUpdateApplyInfo(JSONObject companyBean, String username);
JSONObject getPayType();
List<JSONObject> getSysRate(JSONObject sysConfig);
List<JSONObject> getIndustryMap();
JSONObject getSourceAggregateFile(String username ,String clean_days);
JSONObject getClientAggregateFile(String username, MultipartFile file,String clean_days) throws IOException; JSONObject getClientAggregateFile(String username, MultipartFile file,String clean_days) throws IOException;
JSONObject getPreApplyInfoForAggree(String username ,String clean_days); JSONObject getPreApplyInfoForAggree(String username ,String clean_days);

@ -97,6 +97,8 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
@Resource @Resource
private ClientBankAccountMapper clientBankAccountMapper; private ClientBankAccountMapper clientBankAccountMapper;
@Resource @Resource
private ClientFilesMapper clientFilesMapper;
@Resource
private ClientMapper clientMapper; private ClientMapper clientMapper;
@Resource @Resource
private ClientRateMapper clientRateMapper; private ClientRateMapper clientRateMapper;
@ -125,6 +127,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
private final String VERIFY_MAIL_PREFIX = "VERIFY_MAIL"; private final String VERIFY_MAIL_PREFIX = "VERIFY_MAIL";
private final String LOGIN_CLIENT_PREFIX = "LGOIN_CLIENT"; private final String LOGIN_CLIENT_PREFIX = "LGOIN_CLIENT";
private final String LOGIN_CLIENT_PROCESS_PREFIX = "LOGIN_CLIENT_PROCESS"; private final String LOGIN_CLIENT_PROCESS_PREFIX = "LOGIN_CLIENT_PROCESS";
private static final String CLIENT_AGREE_FILE = "client_agree_file";
private final List<String> tags = new ArrayList<>(); private final List<String> tags = new ArrayList<>();
@PostConstruct @PostConstruct
@ -325,6 +328,68 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
} }
} }
@Override
public JSONObject getSourceAggregateFile(String username ,String clean_days) {
JSONObject apply = sysClientPreMapperMapper.findByUserName(username);
String address = apply.getString("address").trim();
if (address.contains(",")) {
apply.put("address", address.substring(0, address.lastIndexOf(",")).trim());
apply.put("address_sub", address.substring(address.lastIndexOf(",") + 1).trim());
}
apply.put("acn_type", "ABN: (" + apply.getString("abn") + ")");
apply.put("company_name_acn", apply.getString("company_name") + " (ABN " + apply.getString("abn") + ")");
apply.put("clean", "T+" + clean_days.trim());
apply.put("clean_days", clean_days);
JSONObject sysConfig = sysConfigManager.getSysConfig();
JSONObject test = JSONObject.parseObject(sysConfig.getString("sys_apply_rates"));
JSONObject rate = test.getJSONObject("t"+clean_days.trim());
apply.put("wechat_rate",rate.getString("Wechat"));
apply.put("alipay_rate",rate.getString("Alipay"));
apply.put("alipay_online_rate",rate.getString("AlipayOnline"));
apply.put("cbbank_rate",rate.getString("CB_Bankpay"));
apply.put("bestpay_rate",rate.getString("Bestpay"));
apply.put("jd_rate",rate.getString("JDpay"));
JSONObject bankInfo = getBankInfo(apply.getString("bsb_no"));
apply.put("bank", bankInfo.getString("bank"));
apply.put("bsb_no", apply.getString("bsb_no"));
apply.put("account_no", apply.getString("bank_no"));
apply.put("account_name", apply.getString("bank_name"));
String start_date = DateFormatUtils.format(new Date(), "dd/MM/yyyy");
apply.put("start_date", start_date);
Date endDate = TimeZoneUtils.nextYearByCurrDay();
String end_date = DateFormatUtils.format(endDate, "dd/MM/yyyy");
apply.put("end_date", end_date);
apply.put("legal_person", apply.getString("representative_person"));
apply.put("legal_job_title", apply.getString("representative_job_title"));
apply.put("legal_phone", apply.getString("representative_phone"));
apply.put("legal_email", apply.getString("representative_email"));
return exportClientAggregateFile(apply);
}
private JSONObject exportClientAggregateFile(JSONObject apply) {
InputStream stream = null;
JSONObject result = new JSONObject();
try {
PdfUtils pdu = new PdfUtils();
pdu.setTemplatePdfPath(IMG_AGGREGATE_FILE);
pdu.setPdfTemplate(apply);
File file = new File(apply.getString("username") + "_agreement.pdf");
ByteArrayOutputStream bos = pdu.templetPdfBos(file);
stream = new ByteArrayInputStream(bos.toByteArray());
JSONObject fileInfo = attachmentClient.uploadFile(stream, apply.getString("username") + "_" + System.currentTimeMillis() + "_agreement_source.pdf", false);
result.put("file_value", fileInfo.getString("url"));
} catch (Exception e) {
throw new BadRequestException("获取合同文件失败");
}
return result;
}
@Override @Override
@Transactional @Transactional
public void saveOrUpdateApplyInfo(JSONObject applyInfo, String username) { public void saveOrUpdateApplyInfo(JSONObject applyInfo, String username) {
@ -340,11 +405,102 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
applyInfo.put("update_time", new Date()); applyInfo.put("update_time", new Date());
sysClientPreMapperMapper.update(applyInfo); sysClientPreMapperMapper.update(applyInfo);
if (applyInfo.getBooleanValue("agree")) { if (applyInfo.getBooleanValue("agree")) {
if(apply.getString("contract_url")==null|| !(StringUtils.equals(apply.getString("clean_days"),applyInfo.getString("clean_days"))) ) {
throw new BadRequestException("The date of liquidation has changed and the contract needs to be renewed");
}
applyerToClient(username); applyerToClient(username);
} }
} }
} }
@Override
public JSONObject getPayType() {
String[] online_desc = {"pc网站|PC Web","手机端网站|Mobile Web","APP ","微信内/支付宝内网站|Wechat/Alipay JSAPI","小程序|MiniProgram"};
String[] online_desc_value = {"101","102","103","104","105"};
String[] offline_desc = {"二维码立牌|QR Code","Royalpay POS","收银系统|POS","无人售货机|Vending machine"};
String[] offline_desc_value = {"201","202","203","204"};
String[] pos = {"ipos","pospal","Aus Post","Lotus","AoShangBao","Infinity","EasyCloud","AoMaiKe","其他|other"};
String[] pos_value = {"20301","20302","20303","20304","20305","20306","20307","20308","20399"};
JSONObject payType = new JSONObject();
List<JSONObject> online = new ArrayList<>();
List<JSONObject> offline = new ArrayList<>();
List<JSONObject> sub = new ArrayList<>();
for(int i =0 ; i< pos.length;i++) {
JSONObject temp = new JSONObject();
temp.put("label",pos[i]);
temp.put("value",pos_value[i]);
sub.add(temp);
}
for(int i =0 ; i< online_desc.length;i++) {
JSONObject temp = new JSONObject();
temp.put("label",online_desc[i]);
temp.put("value",online_desc_value[i]);
online.add(temp);
}
for(int i =0 ; i< offline_desc.length;i++) {
JSONObject temp = new JSONObject();
temp.put("label",offline_desc[i]);
temp.put("value",offline_desc_value[i]);
if("收银系统|POS".equals(offline_desc[i])) {
temp.put("sub",sub);
}
offline.add(temp);
}
payType.put("online",online);
payType.put("offline",offline);
return payType;
}
@Override
public List<JSONObject> getSysRate(JSONObject sysConfig){
JSONObject sysConfigs = JSONObject.parseObject(sysConfig.getString("sys_apply_rates"));
List<JSONObject> rates= new ArrayList<>();
JSONObject tName = new JSONObject();
tName.put("t1","T+1");
tName.put("t2","T+2");
tName.put("t3","T+3");
for(String strt:sysConfigs.keySet()){
JSONObject t = sysConfigs.getJSONObject(strt);
List<JSONObject> data = new ArrayList<>();
for(String str:t.keySet()){
JSONObject rate = new JSONObject();
rate.put("channel",str);
rate.put("rate",t.get(str));
data.add(rate);
}
JSONObject temp = new JSONObject();
temp.put(tName.getString(strt),data);
rates.add(temp);
}
return rates;
}
@Override
public List<JSONObject> getIndustryMap(){
List<JSONObject> industryMap = new ArrayList<>();
String[] industryLabel ={"鞋包服饰","机票行业","软件服务","旅游票务","国际租车","医疗服务(出国)","医疗服务(不出国)","留学教育(网络教育)","留学教育(一年及以下)","其它货物贸易行业","文具/办公用品","综合商城","酒店行业","教育行业","国际物流","数码电器","母婴","化妆品","食品","留学教育(一年以上)","其它服务行业"};
String[] industryValue ={"327","339","356","357","358","359","360","361","362","338","337","336","328","329","330","332","333","334","335","363","331"};
for(int i =0 ; i< industryLabel.length;i++) {
JSONObject temp = new JSONObject();
temp.put("label",industryLabel[i]);
temp.put("value",industryValue[i]);
industryMap.add(temp);
}
return industryMap;
}
@Override @Override
public JSONObject getPreApplyInfoForAggree(String username ,String clean_days) { public JSONObject getPreApplyInfoForAggree(String username ,String clean_days) {
@ -469,7 +625,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
sysClient.put("suburb", apply.getString("suburb")); sysClient.put("suburb", apply.getString("suburb"));
sysClient.put("state", apply.getString("state")); sysClient.put("state", apply.getString("state"));
sysClient.put("postcode", apply.getString("postcode")); sysClient.put("postcode", apply.getString("postcode"));
sysClient.put("royalpayindustry", apply.getString("royalpayindustry"));//修改industry成royalpay sysClient.put("royalpayindustry", apply.getString("royalpayindustry"));
sysClient.put("alipayindustry", apply.getString("alipayindustry")); sysClient.put("alipayindustry", apply.getString("alipayindustry"));
sysClient.put("industry", apply.getString("industry"));//微信支付行业 sysClient.put("industry", apply.getString("industry"));//微信支付行业
sysClient.put("contact_person", apply.getString("contact_person")); sysClient.put("contact_person", apply.getString("contact_person"));
@ -499,6 +655,17 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
sysClient.put("ali_sub_merchant_id", clientMoniker); sysClient.put("ali_sub_merchant_id", clientMoniker);
clientMapper.save(sysClient); clientMapper.save(sysClient);
JSONObject fileJson = new JSONObject();
fileJson.put("client_id", sysClient.getString("client_id"));
fileJson.put("last_update_date", new Date());
//fileJson.put("last_update_by", manager.getString("display_name"));
fileJson.put("file_name", CLIENT_AGREE_FILE);
fileJson.put("file_value", apply.getString("contract_url"));
fileJson.put("status", 0);
fileJson.put("is_valid", 1);
clientFilesMapper.save(fileJson);
JSONObject representativeInfo = new JSONObject(); JSONObject representativeInfo = new JSONObject();
representativeInfo.put("client_id", sysClient.getIntValue("client_id")); representativeInfo.put("client_id", sysClient.getIntValue("client_id"));
representativeInfo.put("representative_person", apply.getString("representative_person")); representativeInfo.put("representative_person", apply.getString("representative_person"));

@ -0,0 +1,101 @@
package au.com.royalpay.payment.manage.application.web;
import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
@Controller
public class ContentController {
@Resource
private SimpleClientApplyService simpleClientApplyService;
@GetMapping("/contract/source")
private String helloWorld(Model model,@RequestParam String username, @RequestParam String clean_days){
JSONObject contractInfo= simpleClientApplyService.getPreApplyInfoForAggree(username ,clean_days);
model.addAttribute("company_phone", contractInfo.getString("company_phone"));
model.addAttribute("legal_phone", contractInfo.getString("legal_phone"));
model.addAttribute("acn_type", contractInfo.getString("acn_type"));
model.addAttribute("account_no", contractInfo.getString("account_no"));
model.addAttribute("contact_email", contractInfo.getString("contact_email"));
model.addAttribute("bank", contractInfo.getString("bank"));
model.addAttribute("account_name", contractInfo.getString("account_name"));
model.addAttribute("legal_email", contractInfo.getString("legal_email"));
model.addAttribute("state", contractInfo.getString("state"));
model.addAttribute("start_date", contractInfo.getString("start_date"));
model.addAttribute("contact_person", contractInfo.getString("contact_person"));
model.addAttribute("postcode", contractInfo.getString("postcode"));
model.addAttribute("clean", contractInfo.getString("clean"));
model.addAttribute("clean_days", contractInfo.getString("clean_days"));
model.addAttribute("legal_job_title", contractInfo.getString("legal_job_title"));
model.addAttribute("bsb_no", contractInfo.getString("bsb_no"));
model.addAttribute("company_name", contractInfo.getString("company_name"));
model.addAttribute("address", contractInfo.getString("address"));
model.addAttribute("suburb", contractInfo.getString("suburb"));
model.addAttribute("wechat_rate", contractInfo.getString("wechat_rate"));
model.addAttribute("cbbank_rate", contractInfo.getString("cbbank_rate"));
model.addAttribute("alipay_online_rate", contractInfo.getString("alipay_online_rate"));
model.addAttribute("bestpay_rate", contractInfo.getString("bestpay_rate"));
model.addAttribute("alipay_rate", contractInfo.getString("alipay_rate"));
model.addAttribute("jd_rate", contractInfo.getString("jd_rate"));
/* 1
apply_source
end_date
1
1
1
contract_phone
industry
bank_no
1
1
client_pre_apply_id
1
password
update_time
1
client_moniker
1
bank_name
1
1
1
1
1
leagal_person
1
salt
create_time
1
1
1
agree
abn
1
1
company_name_acn
1
1
1
1
short_name
clean_days
username
status
* */
return "contract_for_compliance";
}
@GetMapping(value = "/aggregateFile/client_info")
@ResponseBody
public JSONObject getClientInfoByAggree(@RequestParam String username, @RequestParam String clean_days) {
return simpleClientApplyService.getPreApplyInfoForAggree(username ,clean_days);
}
}

@ -3,11 +3,13 @@ package au.com.royalpay.payment.manage.application.web;
import au.com.royalpay.payment.manage.application.beans.ClientPreApplyBean; import au.com.royalpay.payment.manage.application.beans.ClientPreApplyBean;
import au.com.royalpay.payment.manage.application.beans.ClientPreApplyStep1Bean; import au.com.royalpay.payment.manage.application.beans.ClientPreApplyStep1Bean;
import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService;
import au.com.royalpay.payment.manage.permission.manager.PartnerMapping;
import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient;
import au.com.royalpay.payment.tools.env.SysConfigManager; import au.com.royalpay.payment.tools.env.SysConfigManager;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -16,6 +18,8 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid; import javax.validation.Valid;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@RestController @RestController
@RequestMapping("/register") @RequestMapping("/register")
@ -24,19 +28,21 @@ public class SimpleClientApplyController {
private SimpleClientApplyService simpleClientApplyService; private SimpleClientApplyService simpleClientApplyService;
@Resource @Resource
private SysConfigManager sysConfigManager; private SysConfigManager sysConfigManager;
@Resource
private AttachmentClient attachmentClient;
@GetMapping("/account/check") @GetMapping("/account/check")
public void checkAccountName(@RequestParam String nation_code,@RequestParam String phone) { public void checkAccountName(@RequestParam String nation_code, @RequestParam String phone) {
simpleClientApplyService.checkAccountName(phone,nation_code); simpleClientApplyService.checkAccountName(phone, nation_code);
} }
@GetMapping("/account/mail/{address}/verify/{codeKey}/jump") @GetMapping("/account/mail/{address}/verify/{codeKey}/jump")
public ModelAndView jumpVerifyMail(@PathVariable String codeKey, @PathVariable String address,@RequestParam String username) { public ModelAndView jumpVerifyMail(@PathVariable String codeKey, @PathVariable String address, @RequestParam String username) {
simpleClientApplyService.checkOrGenerateVerifyMailKey(address, codeKey); simpleClientApplyService.checkOrGenerateVerifyMailKey(address, codeKey);
ModelAndView view = new ModelAndView("mail/verify_mail"); ModelAndView view = new ModelAndView("mail/verify_mail");
view.addObject("codeKey", codeKey); view.addObject("codeKey", codeKey);
view.addObject("address", address); view.addObject("address", address);
view.addObject("username",username); view.addObject("username", username);
return view; return view;
} }
@ -74,11 +80,27 @@ public class SimpleClientApplyController {
simpleClientApplyService.saveOrUpdateApplyInfo(applyBean.insertObject(), username); simpleClientApplyService.saveOrUpdateApplyInfo(applyBean.insertObject(), username);
} }
@PostMapping(value = "/clientCompliance/{username}/commit_aggregate_file{clean_days}") @PostMapping(value = "/clientCompliance/commit_aggregate_file")
@ResponseBody @ResponseBody
public JSONObject getClientArregateFile(@RequestParam MultipartFile file,@PathVariable String username,@PathVariable String clean_days) throws IOException { public JSONObject getClientArregateFile(@RequestParam MultipartFile file, @RequestParam String username, @RequestParam String clean_days) throws IOException {
//这个是上传合同的接口现在为了测试方便返回一个带合同url的JSONObject需要传入usernameclean_days签名图片 //这个是上传合同的接口现在为了测试方便返回一个带合同url的JSONObject需要传入usernameclean_days签名图片
return simpleClientApplyService.getClientAggregateFile(username, file,clean_days); return simpleClientApplyService.getClientAggregateFile(username, file, clean_days);
}
@GetMapping("/client/source_aggregate_file")
public JSONObject getSourceAggregateFile(@RequestParam String username, @RequestParam String clean_days) {
return simpleClientApplyService.getSourceAggregateFile(username, clean_days);
}
@PostMapping("/upload/files")
public JSONObject uploadImage(@RequestParam MultipartFile file) throws Exception {
return attachmentClient.uploadFile(file, false);
}
@GetMapping(value = "/aggregateFile/client_info")
@ResponseBody
public JSONObject getClientInfoByAggree(@RequestParam String username, @RequestParam String clean_days) {
return simpleClientApplyService.getPreApplyInfoForAggree(username, clean_days);
} }
@GetMapping("/info/bank/{bsb_no}") @GetMapping("/info/bank/{bsb_no}")
@ -93,6 +115,21 @@ public class SimpleClientApplyController {
return JSONObject.parseObject(sysConfig.getString("sys_apply_rates")); return JSONObject.parseObject(sysConfig.getString("sys_apply_rates"));
} }
@GetMapping("/config/sys_rates_register")
public List<JSONObject> getSysRateRegister() {
return simpleClientApplyService.getSysRate(sysConfigManager.getSysConfig());
}
@GetMapping("/config/pay_type")
public JSONObject getPayType() {
return simpleClientApplyService.getPayType();
}
@GetMapping("/config/getWechatIndustry")
public List<JSONObject> getWechatIndustry() {
return simpleClientApplyService.getIndustryMap();
}
@GetMapping("/send/mail/subscribe") @GetMapping("/send/mail/subscribe")
public void sendSubscribeMail(@RequestParam(value = "mail", required = true) String mail, @RequestParam("lang") String lang) { public void sendSubscribeMail(@RequestParam(value = "mail", required = true) String mail, @RequestParam("lang") String lang) {
simpleClientApplyService.subscribeNewsletter(mail, lang); simpleClientApplyService.subscribeNewsletter(mail, lang);

File diff suppressed because it is too large Load Diff

@ -427,24 +427,22 @@
maxlength="10" name="postcode"> maxlength="10" name="postcode">
</div> </div>
<div class="form-group has-feedback" <div class="form-group has-feedback"
ng-class="{'has-error':accountForm.contact_job.$invalid && accountForm.contact_job.$dirty}"> ng-class="{'has-error':companyForm.contact_job.$invalid && companyForm.contact_job.$dirty}">
<input class="form-control" ng-model="partner.contact_job" placeholder="Your Job Title" <input class="form-control" ng-model="partner.contact_job" placeholder="Your Job Title"
required maxlength="50" name="contact_job"> required maxlength="50" name="contact_job">
</div> </div>
<div class="panel panel-default">
<div class="panel-heading">Legal person information</div>
<div class="panel-body">
<div class="form-group has-feedback" <div class="form-group has-feedback"
ng-class="{'has-error':accountForm.representative_person.$invalid && accountForm.representative_person.$dirty}"> ng-class="{'has-error':companyForm.representative_person.$invalid && companyForm.representative_person.$dirty}">
<input class="form-control" ng-model="partner.representative_person" placeholder="Representative Person Name" <input class="form-control" ng-model="partner.representative_person" placeholder="Representative Person Name"
required maxlength="50" name="contact_person"> required maxlength="50" name="contact_person">
</div> </div>
<div class="form-group col-xs-12" <div class="form-group col-xs-12"
ng-class="{'has-error':accountForm.representative_phone.$invalid && accountForm.representative_phone.$dirty}"> ng-class="{'has-error':companyForm.representative_phone.$invalid && companyForm.representative_phone.$dirty}">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon">{{partner.nation_code}}</span> <span class="input-group-addon">{{partner.nation_code}}</span>
<input type="text" name="representative_phone" required ng-model="partner.representative_phone" <input type="text" name="representative_phone" required ng-model="partner.representative_phone"
@ -452,28 +450,31 @@
placeholder="Representative Person Phone" maxlength="11"> placeholder="Representative Person Phone" maxlength="11">
</div> </div>
</div> </div>
<div class="form-group has-feedback" <div class="form-group has-feedback"
ng-class="{'has-error':accountForm.representative_email.$invalid && accountForm.representative_email.$dirty}"> ng-class="{'has-error':companyForm.representative_email.$invalid && companyForm.representative_email.$dirty}">
<input type="email" class="form-control" ng-model="partner.representative_email" placeholder="Representative Email address" <input type="email" class="form-control" ng-model="partner.representative_email" placeholder="Representative Email address"
required maxlength="50" name="contact_email" ng-mouseleave="checkParams()" ng-mousedown="trueEmail =false"> required maxlength="50" name="contact_email" ng-mouseleave="checkParams()" ng-mousedown="trueEmail =false">
<div style="text-align: left" ng-if="trueEmail"> <div style="text-align: left" ng-if="trueEmail">
<p style="text-align: left;font-size: 12px;color: red">The mailbox is incorrect</p> <p style="text-align: left;font-size: 12px;color: red">The mailbox is incorrect</p>
</div> </div>
</div> </div>
<div class="form-group has-feedback" <div class="form-group has-feedback"
ng-class="{'has-error':accountForm.representative_job_title.$invalid && accountForm.representative_job_title.$dirty}"> ng-class="{'has-error':companyForm.representative_job_title.$invalid && companyForm.representative_job_title.$dirty}">
<input class="form-control" ng-model="partner.representative_job_title" placeholder="Representative Person Job Title" <input class="form-control" ng-model="partner.representative_job_title" placeholder="Representative Person Job Title"
required maxlength="50" name="representative_job_title"> required maxlength="50" name="representative_job_title">
</div> </div>
<label><input type="checkbox" ng-click="samePerson()">I'm the legal person.</label>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Registered Address</div>
<div class="panel-body">
<div class="form-group has-feedback" <div class="form-group has-feedback"
ng-class="{'has-error':companyForm.registered_address.$invalid && companyForm.registered_address.$dirty}"> ng-class="{'has-error':companyForm.registered_address.$invalid && companyForm.registered_address.$dirty}">
<textarea class="form-control" ng-model="partner.registered_address" placeholder="Registered Address" <textarea class="form-control" ng-model="partner.registered_address" placeholder="Registered Address"
name="registered_address" required maxlength="200"></textarea> name="registered_address" required maxlength="200"></textarea>
</div> </div>
<div class="form-group has-feedback" <div class="form-group has-feedback"
ng-class="{'has-error':companyForm.registered_suburb.$invalid && companyForm.registered_suburb.$dirty}"> ng-class="{'has-error':companyForm.registered_suburb.$invalid && companyForm.registered_suburb.$dirty}">
<input class="form-control" ng-model="partner.registered_suburb" placeholder="Registered Suburb" required <input class="form-control" ng-model="partner.registered_suburb" placeholder="Registered Suburb" required
@ -493,9 +494,9 @@
<input class="form-control" ng-model="partner.registered_postcode" placeholder="Registered Postcode" required <input class="form-control" ng-model="partner.registered_postcode" placeholder="Registered Postcode" required
maxlength="10" name="registered_postcode"> maxlength="10" name="registered_postcode">
</div> </div>
<label><input type="checkbox" ng-click="sameAddress()"> Registered Office Address Same As Trading Address.</label>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-xs-12 margin-bottom"> <div class="col-xs-12 margin-bottom">
@ -516,6 +517,28 @@
</div> </div>
</div> </div>
</div> </div>
<div class="form-group has-feedback">
<select class="form-control" ng-model="partner.wechatindustry" id="wechatindustry"
ng-change="changeDays(partner.clean_days)" name="wechatindustry" required
ng-options="wechatindustry.value as wechatindustry.label for wechatindustry in industries">
<option value="">WechatIndustry</option>
</select>
</div>
<!--<div class="form-group">
<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"
multi-level-select-popup="alipayMccCategory"
on-select="onAlipayMccSelect($selected)">
</div>
</div>-->
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">Merchant Payment Scenario</div> <div class="panel-heading">Merchant Payment Scenario</div>
<div class="panel-body"> <div class="panel-body">
@ -703,15 +726,6 @@
</div> </div>
</div> </div>
<!-- <div class="form-group has-feedback"
ng-class="{'has-error':companyForm.royalpayindustry.$invalid && companyForm.royalpayindustry.$dirty}">
<input class="form-control" id="royalpayindustry" required
name="royalpayindustry" readonly
ng-model="partner.royalpayindustry"
multi-level-select-popup="royalpayindustry"
on-select="onRoyalPayIndustrySelect($selected)">
</div>-->
<div class="row"> <div class="row">
<div class="col-xs-12 margin-bottom"> <div class="col-xs-12 margin-bottom">
<button type="button" class="btn btn-success btn-block btn-flat" <button type="button" class="btn btn-success btn-block btn-flat"
@ -835,6 +849,10 @@
<label><input type="checkbox" ng-model="partner.agree" value="1"><a href="https://file.royalpay.com.au/open/2018/03/07/merchant_service20180307.pdf" target="_blank">Agree to Terms & Conditions</a></label> <label><input type="checkbox" ng-model="partner.agree" value="1"><a href="https://file.royalpay.com.au/open/2018/03/07/merchant_service20180307.pdf" target="_blank">Agree to Terms & Conditions</a></label>
</div> </div>
</div> </div>
<!--测试中-->
<a target="_blank" ng-href="{{signContract(0451120326,1)}}">Sign Contract</a>
<div class="row"> <div class="row">
<div class="col-xs-12 margin-bottom"> <div class="col-xs-12 margin-bottom">
<button type="button" class="btn btn-success btn-block btn-flat" <button type="button" class="btn btn-success btn-block btn-flat"

@ -0,0 +1,43 @@
goBottom = function () {
window.scrollTo(0, document.documentElement.scrollHeight - document.documentElement.clientHeight);
document.getElementById("signPlace").style="";
};
cancel = function () {
document.getElementById("signPlace").style="display:none";
};
submitSign = function () {
var sign = $("#signature").jSignature('getData', 'image');
var signInfo = {};
var signSrc = 'data:' + sign[0] + ',' + sign[1];
debugger;
document.getElementById("img1").src='data:' + sign[0] + ',' + sign[1];
var full_name = document.getElementById("full_name").value
document.getElementById('fullName').value = full_name;
document.getElementById("signPlace").style="display:none";
};
uploadSign2 = function()
{
debugger;
var src = document.getElementById("img1").src;
var filename = document.getElementById('fullName').value;
var signFile = dataURLtoFile(src,filename);
/*未完成*/
}
function dataURLtoFile(dataurl, filename) {//将base64转换为文件
var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
}
return new File([u8arr], filename, {type: mime});
}

@ -51,6 +51,93 @@ angular.module('applyPartnerApp', ['ngMessages','ngFileUpload']).controller('app
"value": "WA" "value": "WA"
} }
]; ];
var industryMap = [
{
"label": "鞋包服饰",
"value": "327"
},
{
"label": "机票行业",
"value": "339"
},
{
"label": "软件服务",
"value": "356"
},
{
"label": "旅游票务",
"value": "357"
},
{
"label": "国际租车",
"value": "358"
},
{
"label": "医疗服务(出国)",
"value": "359"
},
{
"label": "医疗服务(不出国)",
"value": "360"
},
{
"label": "留学教育(网络教育)",
"value": "361"
},
{
"label": "留学教育(一年及以下)",
"value": "362"
},
{
"label": "其它货物贸易行业",
"value": "338"
},
{
"label": "文具/办公用品",
"value": "337"
},
{
"label": "综合商城",
"value": "336"
},
{
"label": "酒店行业",
"value": "328"
},
{
"label": "教育行业",
"value": "329"
},
{
"label": "国际物流",
"value": "330"
},
{
"label": "数码电器",
"value": "332"
},
{
"label": "母婴",
"value": "333"
},
{
"label": "化妆品",
"value": "334"
},
{
"label": "食品",
"value": "335"
},
{
"label": "留学教育(一年以上)",
"value": "363"
},
{
"label": "其它服务行业",
"value": "331"
}
];
var removeClientPayDesc = function (items, key) { var removeClientPayDesc = function (items, key) {
for (var i = 0; i < items.length; i++) { for (var i = 0; i < items.length; i++) {
var item = items[i]; var item = items[i];
@ -64,6 +151,7 @@ angular.module('applyPartnerApp', ['ngMessages','ngFileUpload']).controller('app
$scope.states = angular.copy(stateMap); $scope.states = angular.copy(stateMap);
$scope.countries = angular.copy(countryMap); $scope.countries = angular.copy(countryMap);
$scope.cleanDays = angular.copy(cleanDays); $scope.cleanDays = angular.copy(cleanDays);
$scope.industries = angular.copy(industryMap);
$scope.canClick=false; $scope.canClick=false;
$scope.description = "Send Code"; $scope.description = "Send Code";
$scope.partner = {nation_code:"+61"}; $scope.partner = {nation_code:"+61"};
@ -80,6 +168,24 @@ angular.module('applyPartnerApp', ['ngMessages','ngFileUpload']).controller('app
}; };
$scope.loadRoyalpayindustry(); $scope.loadRoyalpayindustry();
$scope.loadAlipayCategory = function () {
$http.get('/static/data/alipayMcc.json').then(function (resp) {
$scope.alipayMccCategory = resp.data;
debugger;
})
};
$scope.loadAlipayCategory();
$scope.onAlipayMccSelect = function (selectedItem) {
$scope.partner.alipay_category = selectedItem.label;
$scope.partner.alipayindustry = selectedItem.mccCode;
};
$scope.onAlipayMccSelect = function (selectedItem) {
$scope.partner.alipay_category = selectedItem.label;
$scope.partner.alipayindustry = selectedItem.mccCode;
};
$scope.loadCustomerChannel = function () { $scope.loadCustomerChannel = function () {
$http.get('/static/data/rp_customer_channel.json').then(function (resp) { $http.get('/static/data/rp_customer_channel.json').then(function (resp) {
$scope.customerchannel = resp.data; $scope.customerchannel = resp.data;
@ -160,6 +266,29 @@ angular.module('applyPartnerApp', ['ngMessages','ngFileUpload']).controller('app
} }
},1000) },1000)
};*/ };*/
$scope.partner.sameAsAddress=false;
$scope.sameAddress = function (){
$scope.partner.sameAsAddress = !($scope.partner.sameAsAddress);
if($scope.partner.sameAsAddress) {
$scope.partner.registered_address = $scope.partner.address;
$scope.partner.registered_suburb = $scope.partner.suburb;
$scope.partner.registered_postcode = $scope.partner.postcode;
$scope.partner.registered_state = $scope.partner.state;
}
}
$scope.partner.sameAsContactPerson = false;
$scope.samePerson = function (){
$scope.partner.sameAsContactPerson = !($scope.partner.sameAsContactPerson);
if($scope.partner.sameAsContactPerson) {
$scope.partner.representative_person = $scope.partner.contact_person;
$scope.partner.representative_phone = $scope.partner.contact_phone;
$scope.partner.representative_email = $scope.partner.contact_email;
$scope.partner.representative_job_title = $scope.partner.contact_job;
}
}
$scope.checkEmail = function () { $scope.checkEmail = function () {
$scope.trueEmail = false; $scope.trueEmail = false;
if($scope.partner.contact_email){ if($scope.partner.contact_email){
@ -171,6 +300,13 @@ angular.module('applyPartnerApp', ['ngMessages','ngFileUpload']).controller('app
} }
} }
}; };
$scope.signContract = function(username,clean_days)
{
var url='/contract/source?username='+username+'&clean_days='+clean_days;
return url;
}
$scope.sendVerificationCode = function () { $scope.sendVerificationCode = function () {
$scope.initErrorMsg(); $scope.initErrorMsg();
$scope.sendPhoneCodeTime(); $scope.sendPhoneCodeTime();
@ -181,7 +317,6 @@ angular.module('applyPartnerApp', ['ngMessages','ngFileUpload']).controller('app
$scope.description="Send Code"; $scope.description="Send Code";
$scope.canClick=false; $scope.canClick=false;
} }
$scope.resError = resp.data.message; $scope.resError = resp.data.message;
}); });
}; };
@ -496,7 +631,7 @@ angular.module('applyPartnerApp', ['ngMessages','ngFileUpload']).controller('app
} else { } else {
$scope.logoProgress = {value: 0}; $scope.logoProgress = {value: 0};
Upload.upload({ Upload.upload({
url: '/register/risk/business/upload/files', url: '/register/upload/files',
data: {file: file} data: {file: file}
}).then(function (resp) { }).then(function (resp) {
delete $scope.logoProgress; delete $scope.logoProgress;
@ -520,7 +655,7 @@ angular.module('applyPartnerApp', ['ngMessages','ngFileUpload']).controller('app
} else { } else {
$scope.shopPhotoProgress = {value: 0}; $scope.shopPhotoProgress = {value: 0};
Upload.upload({ Upload.upload({
url: '/register/risk/business/upload/files', url: '/register/upload/files',
data: {file: file} data: {file: file}
}).then(function (resp) { }).then(function (resp) {
delete $scope.shopPhotoProgress; delete $scope.shopPhotoProgress;
@ -543,7 +678,7 @@ angular.module('applyPartnerApp', ['ngMessages','ngFileUpload']).controller('app
} else { } else {
$scope.storePhotoProgress = {value: 0}; $scope.storePhotoProgress = {value: 0};
Upload.upload({ Upload.upload({
url: '/register/risk/business/upload/files', url: '/register/upload/files',
data: {file: file} data: {file: file}
}).then(function (resp) { }).then(function (resp) {
delete $scope.storePhotoProgress; delete $scope.storePhotoProgress;

Loading…
Cancel
Save