add mail status

master
wangning 6 years ago
parent 047ba2b7d7
commit ed6d43b18a

@ -488,9 +488,9 @@ CREATE TABLE `pmt_directed_bill_code` (
PRIMARY KEY (`bill_code_id`), PRIMARY KEY (`bill_code_id`),
KEY `client_id` (`client_id`), KEY `client_id` (`client_id`),
KEY `order_id` (`order_id`) KEY `order_id` (`order_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
ALTER TABLE `act_red_packets_customer` ADD COLUMN `rule_max_num_limit` tinyint(1) DEFAULT 1 COMMENT '0:Whole Activity,1day' ALTER TABLE `act_red_packets_customer` ADD COLUMN `rule_max_num_limit` tinyint(1) DEFAULT 1 COMMENT '0:Whole Activity,1day';
@ -505,4 +505,7 @@ CREATE TABLE `sys_mail_send` (
PRIMARY KEY (`id`,`mail_address`), PRIMARY KEY (`id`,`mail_address`),
KEY `mail_address` (`mail_address`), KEY `mail_address` (`mail_address`),
KEY `id` (`id`) KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
alter table sys_clients add column mail_confirm tinyint(1) default '0' COMMENT '0: 未验证1已验证';

@ -27,6 +27,7 @@ public class ClientPreApplyBean {
private String bsb_no; private String bsb_no;
private String clean_days; private String clean_days;
private String codeKey;
private boolean agree; private boolean agree;
@ -185,4 +186,12 @@ public class ClientPreApplyBean {
public void setCompany_phone(String company_phone) { public void setCompany_phone(String company_phone) {
this.company_phone = company_phone; this.company_phone = company_phone;
} }
public String getCodeKey() {
return codeKey;
}
public void setCodeKey(String codeKey) {
this.codeKey = codeKey;
}
} }

@ -25,7 +25,7 @@ public interface SimpleClientApplyService {
void verifyMail(String address, JSONObject loginAccount); void verifyMail(String address, JSONObject loginAccount);
void updateApplyInfo(ClientPreApplyBean companyBean,String client_moniker); void saveOrUpdateApplyInfo(ClientPreApplyBean companyBean, String client_moniker);
JSONObject getBankInfo(String bsb_no); JSONObject getBankInfo(String bsb_no);

@ -2,8 +2,12 @@ package au.com.royalpay.payment.manage.application.core.impls;
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.core.SimpleClientApplyService; import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService;
import au.com.royalpay.payment.manage.mappers.system.*;
import au.com.royalpay.payment.manage.mappers.preapply.SysClientPreMapperMapper; import au.com.royalpay.payment.manage.mappers.preapply.SysClientPreMapperMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientBankAccountMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientConfigMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper;
import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean;
import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.signin.beans.LoginInfo; import au.com.royalpay.payment.manage.signin.beans.LoginInfo;
@ -16,10 +20,9 @@ import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
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.mail.SendMail; import au.com.royalpay.payment.tools.mail.SendMail;
import au.com.royalpay.payment.tools.utils.PasswordUtils; import au.com.royalpay.payment.tools.utils.PasswordUtils;
import cn.yixblog.platform.http.HttpRequestGenerator; import au.com.royalpay.payment.tools.utils.id.IdUtil;
import cn.yixblog.platform.http.HttpRequestResult;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.qcloudsms.SmsSingleSender; import com.github.qcloudsms.SmsSingleSender;
@ -36,17 +39,21 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.thymeleaf.context.Context; import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine; import org.thymeleaf.spring4.SpringTemplateEngine;
import javax.annotation.PostConstruct; import java.io.IOException;
import javax.annotation.Resource; import java.net.URISyntaxException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import cn.yixblog.platform.http.HttpRequestGenerator;
import cn.yixblog.platform.http.HttpRequestResult;
@Service @Service
public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
@ -217,21 +224,22 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
@Override @Override
@Transactional @Transactional
public void updateApplyInfo(ClientPreApplyBean companyBean, String username) { public void saveOrUpdateApplyInfo(ClientPreApplyBean companyBean, String username) {
JSONObject apply = sysClientPreMapperMapper.findByUserName(username); JSONObject apply = sysClientPreMapperMapper.findByUserName(username);
if (apply == null ){
throw new BadRequestException();
}
JSONObject applyInfo = companyBean.insertObject(); JSONObject applyInfo = companyBean.insertObject();
applyInfo.put("client_pre_apply_id",apply.getIntValue("client_pre_apply_id")); if (apply == null ){
applyInfo.put("update_time",new Date()); applyInfo.put("client_pre_apply_id", IdUtil.getId());
sysClientPreMapperMapper.save(applyInfo);
}else {
applyInfo.put("client_pre_apply_id", apply.getIntValue("client_pre_apply_id"));
applyInfo.put("update_time", new Date());
sysClientPreMapperMapper.update(applyInfo); sysClientPreMapperMapper.update(applyInfo);
if(applyInfo.getBoolean("agree")){ if(applyInfo.getBoolean("agree")){
applyerToClient(username); applyerToClient(username);
} }
} }
}
@Transactional
private void applyerToClient(String username){ private void applyerToClient(String username){
JSONObject apply = sysClientPreMapperMapper.findByUserName(username); JSONObject apply = sysClientPreMapperMapper.findByUserName(username);
@ -374,7 +382,10 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
if (!address.equals(client.getString("contact_email"))) { if (!address.equals(client.getString("contact_email"))) {
throw new BadRequestException(LocaleSupport.localeMessage("error.login.password")); throw new BadRequestException(LocaleSupport.localeMessage("error.login.password"));
} }
JSONObject record = new JSONObject();
record.put("client_id",client.getIntValue("client_id"));
record.put("mail_confirm",true);
clientMapper.update(record);
} }
private String getRegisterClientRedisKey(String phoneNumber){ private String getRegisterClientRedisKey(String phoneNumber){

@ -8,6 +8,7 @@ import au.com.royalpay.payment.tools.http.HttpUtils;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.validation.Errors; import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -57,8 +58,12 @@ 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 JSONObject registerCompanyInfo(@PathVariable String username, @RequestBody @Valid ClientPreApplyBean applyBean) {
simpleClientApplyService.updateApplyInfo(applyBean,username); JSONObject result = new JSONObject();
String codeKey = simpleClientApplyService.checkOrGenerateRegisterProcessKey(username, StringUtils.isEmpty(applyBean.getCodeKey())?null:applyBean.getCodeKey());
simpleClientApplyService.saveOrUpdateApplyInfo(applyBean,username);
result.put("codeKey",codeKey);
return result;
} }
@RequestMapping(value = "/info/bank/{bsb_no}", method = RequestMethod.GET) @RequestMapping(value = "/info/bank/{bsb_no}", method = RequestMethod.GET)

Loading…
Cancel
Save