1.订阅邮件

2.留言
3.自主申请
master
yangkai 5 years ago
parent 21ced08f55
commit e403fd54d6

@ -31,4 +31,7 @@ public interface SimpleClientApplyService {
JSONObject getBankInfo(String bsb_no);
void checkAccountName(String contact_phone,String nation_code);
void subscribeNewsletter(String mail, String lang);
}

@ -16,7 +16,6 @@ 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.env.PlatformEnvironment;
import au.com.royalpay.payment.tools.env.RequestEnvironment;
import au.com.royalpay.payment.tools.env.SysConfigManager;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
@ -26,14 +25,12 @@ import au.com.royalpay.payment.tools.locale.LocaleSupport;
import au.com.royalpay.payment.tools.utils.PasswordUtils;
import com.alibaba.fastjson.JSONObject;
import com.github.qcloudsms.SmsSingleSender;
import org.apache.catalina.servlet4preview.http.HttpServletRequest;
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.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -91,6 +88,8 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
private PmtSubMerchantIdMapper pmtSubMerchantIdMapper;
@Resource
private ManagerMapper managerMapper;
@Resource
private SysCustomerSubscribeMapper subscribeMapper;
@Resource
private ClientBDMapper clientBDMapper;
@ -247,6 +246,41 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
}
}
@Override
public void subscribeNewsletter(String mail, String lang) {
JSONObject subscribeInfo = subscribeMapper.findByEmail(mail);
Date newDate = new Date();
if (subscribeInfo != null && subscribeInfo.getBoolean("is_valid")) {
throw new BadRequestException("您已订阅成功,请勿重新提交");
}
String imageUrl = lang == null || "zh".equals(lang) ? "royalpay_newsletter_thank_you.png" : "royalpay_newsletter_thank_you_en.png";
Context ctx = new Context();
ctx.setVariable("imageUrl", PlatformEnvironment.getEnv().concatUrl("/static/images/" + imageUrl));
final String content = thymeleaf.process("mail/subscribe_mail.html", ctx);
try {
String emailId = mailService.sendEmail("You have successfully subscribed to Newsletter", mail, "", content);
if (subscribeInfo == null) {
subscribeInfo = new JSONObject();
subscribeInfo.put("approve_email_id", emailId);
subscribeInfo.put("subscribe_email", mail);
subscribeInfo.put("create_time", newDate);
subscribeInfo.put("update_time", newDate);
subscribeMapper.save(subscribeInfo);
return;
}
if (!subscribeInfo.getBoolean("is_valid")) {
subscribeInfo.put("approve_email_id", emailId);
subscribeInfo.put("is_valid", 1);
subscribeInfo.put("update_time", newDate);
subscribeMapper.update(subscribeInfo);
}
} catch (URISyntaxException | IOException e) {
e.printStackTrace();
}
}
@Override
@Transactional
public void saveOrUpdateApplyInfo(JSONObject applyInfo, String username) {

@ -3,6 +3,7 @@ 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.notice.core.MailService;
import au.com.royalpay.payment.tools.env.SysConfigManager;
import com.alibaba.fastjson.JSONObject;
@ -17,9 +18,13 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.io.IOException;
import java.net.URISyntaxException;
@RestController
@RequestMapping("/register")
@ -90,5 +95,10 @@ public class SimpleClientApplyController {
return JSONObject.parseObject(sysConfig.getString("sys_apply_rates"));
}
@RequestMapping(value = "/send/mail/subscribe", method = RequestMethod.GET)
public void sendSubscribeMail(@RequestParam(value = "mail", required = true) String mail, @RequestParam("lang") String lang) {
simpleClientApplyService.subscribeNewsletter(mail, lang);
}
}

@ -0,0 +1,81 @@
package au.com.royalpay.payment.manage.customers.beans;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import org.hibernate.validator.constraints.NotEmpty;
import java.util.Date;
public class CustomerComment {
@NotEmpty(message = "error.payment.valid.param_missing")
@JSONField(name = "first_name")
private String firstName;
@NotEmpty(message = "error.payment.valid.param_missing")
@JSONField(name = "last_name")
private String lastName;
@NotEmpty(message = "error.payment.valid.param_missing")
private String email;
private String comment;
@JSONField(name = "create_time")
private Date createTime;
private int status;
public JSONObject insertObject() {
return (JSONObject) JSON.toJSON(this);
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
}

@ -0,0 +1,8 @@
package au.com.royalpay.payment.manage.customers.core;
import au.com.royalpay.payment.manage.customers.beans.CustomerComment;
public interface CustomerCommentService {
void save(CustomerComment customerComment);
}

@ -0,0 +1,22 @@
package au.com.royalpay.payment.manage.customers.core.impls;
import au.com.royalpay.payment.manage.customers.beans.CustomerComment;
import au.com.royalpay.payment.manage.customers.core.CustomerCommentService;
import au.com.royalpay.payment.manage.mappers.system.SysCustomerCommentMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
@Service
public class CustomerCommentServiceImpl implements CustomerCommentService {
@Resource
private SysCustomerCommentMapper customerCommentMapper;
@Override
public void save(CustomerComment customerComment) {
customerComment.setCreateTime(new Date());
customerCommentMapper.save(customerComment.insertObject());
}
}

@ -0,0 +1,26 @@
package au.com.royalpay.payment.manage.customers.web;
import au.com.royalpay.payment.manage.customers.beans.CustomerComment;
import au.com.royalpay.payment.manage.customers.core.CustomerCommentService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
/**
*
*/
@RequestMapping("/customer")
@RestController
public class CustomerCommentController {
@Resource
private CustomerCommentService customerCommentService;
@RequestMapping("/contact/comment")
public void saveCustomerComment(@RequestBody @Valid CustomerComment customerComment) {
customerCommentService.save(customerComment);
}
}

@ -0,0 +1,13 @@
package au.com.royalpay.payment.manage.mappers.system;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
@AutoMapper(tablename = "sys_customer_comment", pkName = "id")
public interface SysCustomerCommentMapper {
@AutoSql(type = SqlType.INSERT)
void save(JSONObject info);
}

@ -0,0 +1,20 @@
package au.com.royalpay.payment.manage.mappers.system;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;
@AutoMapper(tablename = "sys_customer_subscribe", pkName = "id")
public interface SysCustomerSubscribeMapper {
@AutoSql(type = SqlType.INSERT)
void save(JSONObject info);
@AutoSql(type = SqlType.SELECT)
JSONObject findByEmail(@Param("subscribe_email") String email);
@AutoSql(type = SqlType.UPDATE)
void update(JSONObject subscribeInfo);
}

@ -45,6 +45,8 @@ public class ClientApplyInfo {
private String industry;
private int source = 0;
private String remark;
@JSONField(name = "aus_mch_category")
private String ausMchCategory;
public JSONObject insertObject() {
@ -251,6 +253,14 @@ public class ClientApplyInfo {
this.industry = industry;
}
public String getAusMchCategory() {
return ausMchCategory;
}
public void setAusMchCategory(String ausMchCategory) {
this.ausMchCategory = ausMchCategory;
}
@Override
public String toString() {
return "ClientApplyInfo{" +

@ -81,7 +81,7 @@ public class ClientApplyImpl implements ClientApply, ApplicationEventPublisherAw
public void applyPartner(ClientApplyInfo apply) {
JSONObject clientApply = apply.insertObject();
clientApplyMapper.save(clientApply);
publisher.publishEvent(new ClientApplyEvent(this, clientApply));
// publisher.publishEvent(new ClientApplyEvent(this, clientApply));
}
@Override

@ -0,0 +1,7 @@
<html xmlns:th="http://www.thymeleaf.org" lang="zh">
<body>
<div style="text-align: center">
<img style="width: 50%" th:src="${imageUrl}" />
</div>
</body>
</html>

@ -71,6 +71,18 @@ define(['../app', 'jquery'], function (app, $) {
}
});
var ausMchCategory = [];
$.ajax({
url: '/static/data/aus_mch_category.json',
method: 'GET',
async: false,
dataType: 'json',
success: function (data) {
ausMchCategory = data;
}
});
app.filter('partner_state', ['stateMap', function (stateMap) {
return function (stateValue) {
var stateLabel = '';
@ -247,4 +259,21 @@ define(['../app', 'jquery'], function (app, $) {
return sectorLabel;
}
}]);
app.filter('aus_mch_category', ['$http', function ($http) {
return function (industryCode) {
var categoryLabel = '';
var industryLabel = '';
angular.forEach(ausMchCategory, function (category) {
angular.forEach(category.children, function (categoryChildren1) {
if (categoryChildren1.mccCode == industryCode) {
industryLabel = categoryChildren1.label;
categoryLabel = category.label;
}
});
});
return { categoryLabel:categoryLabel, industryLabel: industryLabel };
}
}]);
});

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 KiB

@ -175,6 +175,21 @@
<p class="form-control-static" ng-bind="partner.country"></p>
</div>
</div>
<div class="form-group col-sm-6">
<label class="control-label col-sm-4">Business category</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="(partner.aus_mch_category |aus_mch_category).categoryLabel"></p>
</div>
</div>
<div class="form-group col-sm-6">
<label class="control-label col-sm-4">Business industry</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="(partner.aus_mch_category |aus_mch_category).industryLabel"></p>
</div>
</div>
</div>
</div>
</div>
@ -238,4 +253,4 @@
</div>
</div>
</div>
</div>

Loading…
Cancel
Save