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

master
liuxinxin 5 years ago
parent 6c684c0799
commit 4ba5ca0fe3

@ -35,6 +35,11 @@ public class AppClientBean {
@JSONField(name = "contact_job")
private String contactJob;
private String registered_address;
private String registered_suburb;
private String registered_state;
private String registered_postcode;
public JSONObject updateObject() {
JSONObject res = new JSONObject();
if (contactPerson != null) {
@ -84,6 +89,18 @@ public class AppClientBean {
if (legalJobTitle != null) {
res.put("job_title", legalJobTitle);
}
if (registered_address != null) {
res.put("registered_address", registered_address);
}
if (registered_suburb != null) {
res.put("registered_suburb", registered_suburb);
}
if (registered_state != null) {
res.put("registered_state", registered_state);
}
if (registered_postcode != null) {
res.put("registered_postcode", registered_postcode);
}
return res;
}
@ -205,4 +222,36 @@ public class AppClientBean {
public void setLegalPhone(String legalPhone) {
this.legalPhone = legalPhone;
}
public String getRegistered_address() {
return registered_address;
}
public void setRegistered_address(String registered_address) {
this.registered_address = registered_address;
}
public String getRegistered_suburb() {
return registered_suburb;
}
public void setRegistered_suburb(String registered_suburb) {
this.registered_suburb = registered_suburb;
}
public String getRegistered_state() {
return registered_state;
}
public void setRegistered_state(String registered_state) {
this.registered_state = registered_state;
}
public String getRegistered_postcode() {
return registered_postcode;
}
public void setRegistered_postcode(String registered_postcode) {
this.registered_postcode = registered_postcode;
}
}

@ -67,6 +67,7 @@ import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.RandomUtils;
@ -87,8 +88,10 @@ import org.thymeleaf.context.Context;
import org.thymeleaf.spring5.SpringTemplateEngine;
import javax.annotation.Resource;
import javax.imageio.ImageIO;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage;
import java.io.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
@ -668,6 +671,8 @@ public class RetailAppServiceImp implements RetailAppService {
if (clientType.equals("iphone")) {
res.put("skip_clearing", !res.getBoolean("skip_clearing"));
}
sysClientLegalPersonMapper.findRepresentativeInfo(device.getIntValue("client_id"));
res.put("representative_info",sysClientLegalPersonMapper.findRepresentativeInfo(device.getIntValue("client_id")));
return res;
}

@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.application.beans;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import org.apache.commons.lang3.StringUtils;
import javax.validation.constraints.NotEmpty;
@ -56,6 +57,50 @@ public class ClientPreApplyBean {
private String client_pay_type = "2";
private String client_pay_desc = "201";
@NotEmpty(message = "contact_job can't be null")
private String contact_job;
@NotEmpty(message = "representative_person can't be null")
private String representative_person;
@NotEmpty(message = "representative_phone can't be null")
private String representative_phone;
@NotEmpty(message = "representative_email can't be null")
private String representative_email;
@NotEmpty(message = "representative_job_title can't be null")
private String representative_job_title;
@NotEmpty(message = "registered_address can't be null")
private String registered_address;
@NotEmpty(message = "registered_suburb can't be null")
private String registered_suburb;
@NotEmpty(message = "registered_state can't be null")
private String registered_state;
@NotEmpty(message = "registered_postcode can't be null")
private String registered_postcode;
@NotEmpty(message = "logo_url can't be null")
private String logo_url;
@NotEmpty(message = "company_website can't be null")
private String company_website;
@NotEmpty(message = "company_photo can't be null")
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 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() {
JSONObject res = (JSONObject) JSON.toJSON(this);
@ -253,4 +298,116 @@ public class ClientPreApplyBean {
public String getClient_pay_desc() {
return client_pay_desc;
}
public String getContact_job() {
return contact_job;
}
public void setContact_job(String contact_job) {
this.contact_job = contact_job;
}
public String getRepresentative_person() {
return representative_person;
}
public void setRepresentative_person(String representative_person) {
this.representative_person = representative_person;
}
public String getRepresentative_phone() {
return representative_phone;
}
public void setRepresentative_phone(String representative_phone) {
this.representative_phone = representative_phone;
}
public String getRepresentative_email() {
return representative_email;
}
public void setRepresentative_email(String representative_email) {
this.representative_email = representative_email;
}
public String getRepresentative_job_title() {
return representative_job_title;
}
public void setRepresentative_job_title(String representative_job_title) {
this.representative_job_title = representative_job_title;
}
public String getRegistered_address() {
return registered_address;
}
public void setRegistered_address(String registered_address) {
this.registered_address = registered_address;
}
public String getRegistered_suburb() {
return registered_suburb;
}
public void setRegistered_suburb(String registered_suburb) {
this.registered_suburb = registered_suburb;
}
public String getRegistered_state() {
return registered_state;
}
public void setRegistered_state(String registered_state) {
this.registered_state = registered_state;
}
public String getRegistered_postcode() {
return registered_postcode;
}
public void setRegistered_postcode(String registered_postcode) {
this.registered_postcode = registered_postcode;
}
public String getLogo_url() {
return logo_url;
}
public void setLogo_url(String logo_url) {
this.logo_url = logo_url;
}
public String getCompany_website() {
return company_website;
}
public void setCompany_website(String company_website) {
this.company_website = company_website;
}
public String getCompany_photo() {
return company_photo;
}
public void setCompany_photo(String company_photo) {
this.company_photo = company_photo;
}
public String getRoyalpayindustry() {
return royalpayindustry;
}
public void setRoyalpayindustry(String royalpayindustry) {
this.royalpayindustry = royalpayindustry;
}
public String getAlipayindustry() {
return alipayindustry;
}
public void setAlipayindustry(String alipayindustry) {
this.alipayindustry = alipayindustry;
}
}

@ -3,8 +3,10 @@ package au.com.royalpay.payment.manage.application.core;
import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
public interface SimpleClientApplyService {
void verifyRegisterSMSCode(String codeKey, String phoneNumber);
@ -15,6 +17,8 @@ public interface SimpleClientApplyService {
String getAndSendSmsCode(String phoneNumber, String nationCode, HttpServletRequest request);
String sendOpenSms(String phoneNumber, String nationCode);
String checkOrGenerateRegisterProcessKey(String accountName, String codeKey);
void deleteRegisterProcessKey(String codeKey);
@ -29,6 +33,8 @@ public interface SimpleClientApplyService {
void saveOrUpdateApplyInfo(JSONObject companyBean, String username);
JSONObject getClientAggregateFile(String username, MultipartFile file,String clean_days) throws IOException;
JSONObject getBankInfo(String bsb_no);
void checkAccountName(String contact_phone,String nation_code);

@ -15,6 +15,7 @@ import au.com.royalpay.payment.manage.signin.beans.LoginInfo;
import au.com.royalpay.payment.manage.signin.core.SignInAccountService;
import au.com.royalpay.payment.manage.support.sms.SmsSender;
import au.com.royalpay.payment.manage.system.core.MailGunService;
import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient;
import au.com.royalpay.payment.tools.env.PlatformEnvironment;
import au.com.royalpay.payment.tools.env.SysConfigManager;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
@ -24,20 +25,29 @@ import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
import au.com.royalpay.payment.tools.locale.LocaleSupport;
import au.com.royalpay.payment.tools.utils.PasswordUtils;
import au.com.royalpay.payment.tools.utils.PdfUtils;
import au.com.royalpay.payment.tools.utils.TimeZoneUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.multipart.MultipartFile;
import org.thymeleaf.context.Context;
import java.io.IOException;
import java.awt.image.BufferedImage;
import java.io.*;
import java.math.BigDecimal;
import java.net.URISyntaxException;
import java.util.*;
import java.util.concurrent.LinkedBlockingQueue;
@ -47,6 +57,7 @@ import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletRequest;
import cn.yixblog.platform.http.HttpRequestGenerator;
@ -65,14 +76,21 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
@Resource
private MailService mailService;
@Resource
private AttachmentClient attachmentClient;
@Resource
private PermissionPartnerManager permissionPartnerManager;
@Resource
private SpringTemplateEngine thymeleaf;
@Resource
private SysClientLegalPersonMapper sysClientLegalPersonMapper;
@Resource
private ClientManager clientManager;
@Resource
private SignInAccountService signInAccountService;
@Resource
private SimpleClientApplyService simpleClientApplyService;
private Logger logger = LoggerFactory.getLogger(getClass());
@Resource
private ClientAccountMapper clientAccountMapper;
@Resource
private SysClientPreMapperMapper sysClientPreMapperMapper;
@ -95,6 +113,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
private ClientBDMapper clientBDMapper;
private ThreadPoolExecutor pool = new ThreadPoolExecutor(1, 10, 5, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());
private final String IMG_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2019/09/06/1567741055646_qeWC7kwqEwsJjRHisJSyAjqnB9nnnh.pdf";
@Resource
private SmsSender smsSender;
@Resource
@ -158,6 +177,29 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
return registerClientCode;
}
@Override
public String sendOpenSms(String phoneNumber, String nationCode) {
String reidsCheckCodeKey = getRegisterClientRedisKey(phoneNumber);
String value = stringRedisTemplate.boundValueOps(reidsCheckCodeKey).get();
if (StringUtils.isNotEmpty(value)) {
throw new BadRequestException("SMS has been sentPlease check your messages or try again in 3 minutes.");
}
ArrayList<String> param = new ArrayList<>();
String registerClientCode = RandomStringUtils.random(6, false, true);
param.add("RoyalPay");
param.add(registerClientCode);
String expireMin = "3";
param.add(expireMin);
try {
smsSender.getSender().sendWithParam(nationCode.trim(), phoneNumber, REGISTER_CLIENT_TEMPLID, param, "RoyalPay", "", "");
} catch (Exception e) {
e.printStackTrace();
throw new ServerErrorException("Phone number is wrong Please try again");
}
stringRedisTemplate.boundValueOps(getRegisterClientRedisKey(phoneNumber)).set(registerClientCode, Long.parseLong(expireMin), TimeUnit.MINUTES);
return registerClientCode;
}
@Override
public void sendVerifyEmail(String address, int client_id, String username) {
JSONObject client = clientManager.getClientInfo(client_id);
@ -301,6 +343,87 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
}
}
public JSONObject getPreApplyInfoForAggree(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 apply;
}
@Override
public JSONObject getClientAggregateFile(String username, MultipartFile file ,String clean_days) throws IOException{
JSONObject apply = getPreApplyInfoForAggree(username ,clean_days);
apply.put("full_name", file.getOriginalFilename());
BufferedImage img = ImageIO.read(file.getInputStream());
ByteArrayOutputStream out = new ByteArrayOutputStream();
ImageIO.write(img, "png", out);
apply.put("img","data:image/png;base64," + Base64.encodeBase64String(out.toByteArray()));
return exportImgAggregateFile(username, apply);
}
private JSONObject exportImgAggregateFile(String username, JSONObject apply) throws IOException{
InputStream stream = null;
JSONObject contractInfo = new JSONObject();
try {
PdfUtils pdu = new PdfUtils();
pdu.setTemplatePdfPath(IMG_AGGREGATE_FILE);
pdu.setPdfTemplate(apply);
File file = new File(username + "_agreement.pdf");
ByteArrayOutputStream bos = pdu.templetPdfBos(file,"STSong-Light","UniGB-UCS2-H");
stream = new ByteArrayInputStream(bos.toByteArray());
JSONObject fileInfo = attachmentClient.uploadFile(stream, username + "_" + System.currentTimeMillis() + "_agreement.pdf", false);
contractInfo.put("contract_url",fileInfo.getString("url"));
} catch (Exception e) {
logger.error("合同制作出现问题:", e);
throw new BadRequestException("合同制作出现问题:" + e.getMessage());
} finally {
stream.close();
}
return contractInfo;
}
//todo
private void applyerToClient(String username) {
JSONObject sysConfig = sysConfigManager.getSysConfig();
@ -343,8 +466,14 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
sysClient.put("suburb", apply.getString("suburb"));
sysClient.put("state", apply.getString("state"));
sysClient.put("postcode", apply.getString("postcode"));
sysClient.put("royalpayindustry", apply.getString("industry"));
sysClient.put("royalpayindustry", apply.getString("royalpayindustry"));//修改industry成royalpay
sysClient.put("alipayindustry", apply.getString("alipayindustry"));
sysClient.put("industry", apply.getString("industry"));//微信支付行业
sysClient.put("contact_person", apply.getString("contact_person"));
sysClient.put("contact_job", apply.getString("contact_job"));
sysClient.put("logo_url", apply.getString("logo_url"));
sysClient.put("company_website", apply.getString("company_website"));
sysClient.put("company_photo", apply.getString("company_photo"));
sysClient.put("contact_email", apply.getString("contact_email"));
sysClient.put("contact_phone", "+61"+apply.getString("contact_phone"));
sysClient.put("company_phone", apply.getString("company_phone"));
@ -356,7 +485,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
sysClient.put("approve_time", new Date());
sysClient.put("creator", 0);
sysClient.put("business_name", apply.getString("short_name"));
sysClient.put("industry", 331);
/*sysClient.put("industry", 331);*/
sysClient.put("merchant_id", subMerchant.getString("merchant_id"));
sysClient.put("sub_merchant_id", subMerchant.getString("sub_merchant_id"));
sysClient.put("common_sub_merchant_id", 1);
@ -367,6 +496,18 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
sysClient.put("ali_sub_merchant_id", clientMoniker);
clientMapper.save(sysClient);
JSONObject representativeInfo = new JSONObject();
representativeInfo.put("client_id", sysClient.getIntValue("client_id"));
representativeInfo.put("representative_person", apply.getString("representative_person"));
representativeInfo.put("job_title", apply.getString("representative_job_title"));
representativeInfo.put("phone", apply.getString("representative_phone"));
representativeInfo.put("email", apply.getString("representative_email"));
representativeInfo.put("address", apply.getString("registered_address"));
representativeInfo.put("suburb", apply.getString("registered_suburb"));
representativeInfo.put("state", apply.getString("registered_state"));
representativeInfo.put("postcode", apply.getString("registered_postcode"));
sysClientLegalPersonMapper.save(representativeInfo);
JSONObject clientBd = new JSONObject();
clientBd.put("client_id", sysClient.getIntValue("client_id"));
clientBd.put("bd_id", followBd.getString("manager_id"));
@ -461,6 +602,9 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
};
pool.execute(task2);
//发送开通短信和邮件
//simpleClientApplyService.sendOpenSms(apply.getString("contact_phone"),"61");
//clientManager.sendOpenEmail(sysClient,apply.getString("username"),apply.getString("password"));
}
private String generateClientMoniker() {

@ -3,15 +3,19 @@ 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.ClientPreApplyStep1Bean;
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.env.SysConfigManager;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.io.IOException;
@RestController
@RequestMapping("/register")
@ -70,6 +74,15 @@ public class SimpleClientApplyController {
simpleClientApplyService.saveOrUpdateApplyInfo(applyBean.insertObject(), username);
}
@PostMapping(value = "/clientCompliance/{clientMoniker}/commit_aggregate_file")
@ResponseBody
public JSONObject getClientArregateFile(@RequestParam MultipartFile file, @RequestHeader("User-Agent") String userAgent, HttpServletRequest request) throws IOException {
//这个是上传合同的接口现在为了测试方便返回一个带上传url的JSONObject需要传入usernameclean_days签名图片
String username = "111";
String clean_days = "11";
return simpleClientApplyService.getClientAggregateFile(username, file,clean_days);
}
@GetMapping("/info/bank/{bsb_no}")
public JSONObject getBankInfo(@PathVariable String bsb_no, @RequestParam String username, @RequestParam String codeKey) {
simpleClientApplyService.checkOrGenerateRegisterProcessKey(username, codeKey);

@ -82,6 +82,8 @@ public interface ClientManager {
void checkAndSendInitEmail(JSONObject manager, String clientMoniker);
void sendOpenEmail(final JSONObject client, String username, String pwd);
// void sendInitEmail(JSONObject account,JSONObject client, String username, String pwd);
void markApproveEmailSendStatus(String clientMoniker, JSONObject manager);

@ -1185,6 +1185,72 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
}
@Override
public void sendOpenEmail(final JSONObject client, String username, String pwd) {
JSONObject model = new JSONObject();
model.put("username", username);
model.put("password", pwd);
model.put("client_moniker", client.getString("client_moniker"));
model.put("contact_person", client.getString("contact_person"));
model.put("credential_code", client.getString("credential_code"));
List<JSONObject> bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date());
// todo Velocity
Context ctx = new Context();
ctx.setVariable("bds", bds);
ctx.setVariable("password", pwd);
ctx.setVariable("username", username);
ctx.setVariable("client_moniker", client.getString("client_moniker"));
ctx.setVariable("contact_person", client.getString("contact_person"));
ctx.setVariable("credential_code", client.getString("credential_code"));
final String content = thymeleaf.process("mail/new_client_notice", ctx);
// final String content = VelocityEngineUtils.mergeTemplateIntoString(null, "mail/new_client_notice.vm",
// "utf-8", model);
ctx.setVariable("password", "*****");
final String contentBd = thymeleaf.process("mail/new_client_notice", ctx);
final List<String> mailTos = new ArrayList<>();
String mailTo = client.getString("contact_email");
if (StringUtils.isEmpty(mailTo)) {
throw new EmailException("Client Contact Email is invalid");
}
mailTos.add(mailTo);
JSONObject clientLegal = sysClientLegalPersonMapper.findRepresentativeInfo(client.getIntValue("client_id"));
if (clientLegal != null && StringUtils.isNotBlank(clientLegal.getString("email"))) {
mailTos.add(clientLegal.getString("email"));
}
final List<String> emails = new ArrayList<>();
for (JSONObject bd : bds) {
String email = bd.getString("email");
if (StringUtils.isNotEmpty(email)) {
emails.add(email);
}
}
new Thread() {
@Override
public void run() {
try {
String emailId = mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", StringUtils.join(mailTos,","), "", content);
mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", emails.isEmpty() ? "" : StringUtils.join(emails, ","),
"", contentBd);
JSONObject clientUpdate = new JSONObject();
clientUpdate.put("client_id", client.getIntValue("client_id"));
clientUpdate.put("approve_email_send", 3);
clientUpdate.put("approve_email_id", emailId);
clientMapper.update(clientUpdate);
} catch (Exception e) {
JSONObject clientUpdate = new JSONObject();
clientUpdate.put("client_id", client.getIntValue("client_id"));
clientUpdate.put("approve_email_send", 0);
clientUpdate.put("approve_email_id", null);
clientMapper.update(clientUpdate);
throw new EmailException("Email Sending Failed", e);
}
}
}.start();
}
public void sendInitEmail(final JSONObject client, String username, String pwd) {
logger.debug("sending email after comply");
JSONObject model = new JSONObject();

@ -33,6 +33,7 @@
<script type="text/javascript" src="/static/lib/angularjs/angular-messages.js"></script>
<script type="text/javascript" src="/static/lib/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/static/lib/blocs.min.js"></script>
<script type="text/javascript" src="/static/lib/ngfileupload/ng-file-upload.min.js"></script>
<script type="text/javascript" src="/static/merchantapplication/merchant_application.js"></script>
<style type="text/css">
.register-box-bg {
@ -350,6 +351,22 @@
</div>
</div>
<div class="form-group">
<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/*">
<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="row">
<div class="col-xs-12 margin-bottom">
<button type="button" class="btn btn-success btn-block btn-flat"
@ -408,6 +425,77 @@
<input class="form-control" ng-model="partner.postcode" placeholder="Postcode" required
maxlength="10" name="postcode">
</div>
<div class="form-group has-feedback"
ng-class="{'has-error':accountForm.contact_job.$invalid && accountForm.contact_job.$dirty}">
<input class="form-control" ng-model="partner.contact_job" placeholder="Your Job Title"
required maxlength="50" name="contact_job">
</div>
<div class="form-group has-feedback"
ng-class="{'has-error':accountForm.representative_person.$invalid && accountForm.representative_person.$dirty}">
<input class="form-control" ng-model="partner.representative_person" placeholder="Representative Person Name"
required maxlength="50" name="contact_person">
</div>
<div class="form-group col-xs-12"
ng-class="{'has-error':accountForm.representative_phone.$invalid && accountForm.representative_phone.$dirty}">
<div class="input-group">
<span class="input-group-addon">{{partner.nation_code}}</span>
<input type="text" name="representative_phone" required ng-model="partner.representative_phone"
class="form-control" style="display: inline" onkeyup="value=value.replace(/[^\d]/g,'')"
placeholder="Representative Person Phone" maxlength="11">
</div>
</div>
<div class="form-group has-feedback"
ng-class="{'has-error':accountForm.representative_email.$invalid && accountForm.representative_email.$dirty}">
<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">
<div style="text-align: left" ng-if="trueEmail">
<p style="text-align: left;font-size: 12px;color: red">The mailbox is incorrect</p>
</div>
</div>
<div class="form-group has-feedback"
ng-class="{'has-error':accountForm.representative_job_title.$invalid && accountForm.representative_job_title.$dirty}">
<input class="form-control" ng-model="partner.representative_job_title" placeholder="Representative Person Job Title"
required maxlength="50" name="representative_job_title">
</div>
<div class="form-group has-feedback"
ng-class="{'has-error':companyForm.registered_address.$invalid && companyForm.registered_address.$dirty}">
<textarea class="form-control" ng-model="partner.registered_address" placeholder="Registered Address"
name="registered_address" required maxlength="200"></textarea>
</div>
<div class="form-group has-feedback"
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
maxlength="50" name="registered_suburb">
</div>
<div class="form-group has-feedback"
ng-class="{'has-error':companyForm.registered_state.$invalid && companyForm.registered_state.$dirty}">
<select class="form-control" name="registered_state"
ng-model="partner.registered_state" maxlength="20"
id="registered_state-input" required
ng-options="state.value as state.label for state in states">
<option value="">Registered State</option>
</select>
</div>
<div class="form-group has-feedback"
ng-class="{'has-error':companyForm.registered_postcode.$invalid && companyForm.registered_postcode.$dirty}">
<input class="form-control" ng-model="partner.registered_postcode" placeholder="Registered Postcode" required
maxlength="10" name="registered_postcode">
</div>
<div class="row">
<div class="col-xs-12 margin-bottom">
<div class="form-group has-feedback" ng-class="{'has-error':companyForm.royalpayindustry.$invalid && companyForm.royalpayindustry.$dirty}">
@ -686,6 +774,9 @@
<div class="form-group has-feedback">
<p class="form-control-static">&nbsp; <small>JD Rate Value: &nbsp;{{rate.jd_rate_value}}%</small></p>
</div>
<div class="form-group has-feedback">
<p class="form-control-static">&nbsp; <small>CB Bankpay Rate Value: &nbsp;{{rate.cb_bankpay_rate_value}}%</small></p>
</div>
</div>
<div class="form-group has-feedback">

@ -1,4 +1,4 @@
angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl', ['$scope', '$http','$interval', function ($scope, $http,$interval) {
angular.module('applyPartnerApp', ['ngMessages','ngFileUpload']).controller('applyPartnerCtrl', ['$scope', '$http','$interval','Upload', function ($scope, $http,$interval,Upload) {
var countryMap = [{
"label": "AUS",
"value": "AUS"
@ -226,6 +226,7 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl',
$scope.rate.alipayonline_rate_value = parseFloat($scope.sysRateConfig.t1.AlipayOnline);
$scope.rate.bestpay_rate_value = parseFloat($scope.sysRateConfig.t1.Bestpay);
$scope.rate.jd_rate_value = parseFloat($scope.sysRateConfig.t1.JDpay);
$scope.rate.cb_bankpay_rate_value = parseFloat($scope.sysRateConfig.t1.CB_Bankpay);
$scope.showCleanDay = true;
break;
}
@ -235,6 +236,7 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl',
$scope.rate.bestpay_rate_value = parseFloat($scope.sysRateConfig.t2.Bestpay);
$scope.rate.alipayonline_rate_value = parseFloat($scope.sysRateConfig.t2.AlipayOnline);
$scope.rate.jd_rate_value = parseFloat($scope.sysRateConfig.t2.JDpay);
$scope.rate.cb_bankpay_rate_value = parseFloat($scope.sysRateConfig.t2.CB_Bankpay);
$scope.showCleanDay = true;
break;
}
@ -244,6 +246,7 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl',
$scope.rate.bestpay_rate_value = parseFloat($scope.sysRateConfig.t3.Bestpay);
$scope.rate.alipayonline_rate_value = parseFloat($scope.sysRateConfig.t3.AlipayOnline);
$scope.rate.jd_rate_value = parseFloat($scope.sysRateConfig.t3.JDpay);
$scope.rate.cb_bankpay_rate_value = parseFloat($scope.sysRateConfig.t3.CB_Bankpay);
$scope.showCleanDay = true;
break;
}
@ -444,11 +447,69 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl',
if(!$scope.partner.abn){
$scope.partner.abn = ' ';
}
if(!$scope.partner.contact_job){
$scope.partner.contact_job = ' ';
}
if(!$scope.partner.representative_person){
$scope.partner.representative_person = ' ';
}
if(!$scope.partner.representative_phone){
$scope.partner.representative_phone = ' ';
}
if(!$scope.partner.representative_email){
$scope.partner.representative_email = ' ';
}
if(!$scope.partner.representative_job_title){
$scope.partner.representative_job_title = ' ';
}
if(!$scope.partner.registered_address){
$scope.partner.registered_address = ' ';
}
if(!$scope.partner.registered_suburb){
$scope.partner.registered_suburb = ' ';
}
if(!$scope.partner.registered_state){
$scope.partner.registered_state = ' ';
}
if(!$scope.partner.registered_postcode){
$scope.partner.registered_postcode = ' ';
}
if(!$scope.partner.logo_url){
$scope.partner.logo_url = ' ';
}
if(!$scope.partner.company_website){
$scope.partner.company_website = ' ';
}
if(!$scope.partner.company_photo){
$scope.partner.company_photo = ' ';
}
}
$scope.initErrorMsg = function () {
$scope.resError = '';
}
$scope.uploadLogo = function (file) {
if (file != null) {
if (file.size > 1 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过1MB请压缩后重试', type: 'error'})
} else {
$scope.logoProgress = {value: 0};
Upload.upload({
url: '/risk/business/upload/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);
})
}
}
};
}]);

@ -85,7 +85,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo
$scope.partner.sameAsAddress = false;
$scope.partner.partner_type = $scope.partner.company_website ? 'website' : 'photo';
if ($scope.partner.representativeInfo.phone) {
if ($scope.partner.representativeInfo && $scope.partner.representativeInfo.phone) {
$scope.partner.representativeInfo.phone = $scope.partner.representativeInfo.phone.substring(1, $scope.partner.contact_phone.length);
}
$scope.getMerchantLocation = function () {

Loading…
Cancel
Save