Merge remote-tracking branch 'origin/master'

master
eason 7 years ago
commit 78ab90501b

@ -556,3 +556,21 @@ alter table pmt_refunds add column remark varchar(200);
alter table sys_client_pre_apply add column `salt` varchar(30) NOT NULL COMMENT '每次修改密码时随机更改';
alter table sys_client_pre_apply add column `password_hash` varchar(150) NOT NULL COMMENT '登录账户密码 base64(sha256(salt+password))';
alter table sys_client_pre_apply add column `password_aes` varchar(50) NOT NULL COMMENT '登录账户密码 AES加密';
alter table sys_client_pre_apply add column apply_source varchar(10) default null COMMENT '申请渠道';
CREATE TABLE `sys_mail_unsub` (
`id` bigint(20) NOT NULL,
`address` varchar(50) NOT NULL,
`client_id` int(11) NOT NULL,
`client_moniker` varchar(20) NOT NULL,
`create_time` timestamp NOT NULL DEFAULT now(),
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='邮箱取消订阅';
alter table sys_clients add column ali_sub_merchant_id varchar(20) DEFAULT NULL;
update sys_clients set ali_sub_merchant_id = client_moniker;

@ -168,7 +168,7 @@ public class RetailAppServiceImp implements RetailAppService {
private ClientModifySupport clientModifySupport;
private Map<String, AppMsgSender> senderMap = new HashMap<>();
private final String fileName[] = { "client_bank_file", "client_id_file", "client_company_file"};
private final String fileName[] = { "client_bank_file", "client_id_file", "client_company_file" };
@Resource
public void setAppMsgSenders(AppMsgSender[] senders) {
@ -428,16 +428,16 @@ public class RetailAppServiceImp implements RetailAppService {
if (clientType.equals("iphone")) {
res.put("skip_clearing", !res.getBoolean("skip_clearing"));
}
if("4".equals(clientWithConfig.getString("source"))) {
if ("4".equals(clientWithConfig.getString("source"))) {
res.put("refuse_remark", clientWithConfig.getString("refuse_remark"));
res.put("base_info_lack", false);
res.put("compliance_info_lack", false);
if (StringUtils.isEmpty(clientWithConfig.getString("business_structure")) ||
StringUtils.isEmpty(clientWithConfig.getString("logo_url")) ||
StringUtils.isEmpty(clientWithConfig.getString("description")) ||
("Company".equals(clientWithConfig.getString("business_structure")) && StringUtils.isEmpty(clientWithConfig.getString("acn"))) ||
(!"Company".equals(clientWithConfig.getString("business_structure")) && StringUtils.isEmpty(clientWithConfig.getString("abn"))) ||
(StringUtils.isEmpty(clientWithConfig.getString("company_website")) && StringUtils.isEmpty(clientWithConfig.getString("company_photo")) && StringUtils.isEmpty(clientWithConfig.getString("store_photo")))) {
if (StringUtils.isEmpty(clientWithConfig.getString("business_structure")) || StringUtils.isEmpty(clientWithConfig.getString("logo_url"))
|| StringUtils.isEmpty(clientWithConfig.getString("description"))
|| ("Company".equals(clientWithConfig.getString("business_structure")) && StringUtils.isEmpty(clientWithConfig.getString("acn")))
|| (!"Company".equals(clientWithConfig.getString("business_structure")) && StringUtils.isEmpty(clientWithConfig.getString("abn")))
|| (StringUtils.isEmpty(clientWithConfig.getString("company_website")) && StringUtils.isEmpty(clientWithConfig.getString("company_photo"))
&& StringUtils.isEmpty(clientWithConfig.getString("store_photo")))) {
res.put("base_info_lack", true);
}
@ -464,12 +464,12 @@ public class RetailAppServiceImp implements RetailAppService {
result.put("base_info_lack", false);
result.put("compliance_info_lack", false);
JSONObject client = clientMapper.findClient(device.getIntValue("client_id"));
if(StringUtils.isEmpty(client.getString("business_structure"))||
StringUtils.isEmpty(client.getString("logo_url"))||
StringUtils.isEmpty(client.getString("description")) ||
("Company".equals(client.getString("business_structure")) && StringUtils.isEmpty(client.getString("acn")))||
(!"Company".equals(client.getString("business_structure")) && StringUtils.isEmpty(client.getString("abn")))||
(StringUtils.isEmpty(client.getString("company_website")) && StringUtils.isEmpty(client.getString("company_photo")) &&StringUtils.isEmpty(client.getString("store_photo")))) {
if (StringUtils.isEmpty(client.getString("business_structure")) || StringUtils.isEmpty(client.getString("logo_url"))
|| StringUtils.isEmpty(client.getString("description"))
|| ("Company".equals(client.getString("business_structure")) && StringUtils.isEmpty(client.getString("acn")))
|| (!"Company".equals(client.getString("business_structure")) && StringUtils.isEmpty(client.getString("abn")))
|| (StringUtils.isEmpty(client.getString("company_website")) && StringUtils.isEmpty(client.getString("company_photo"))
&& StringUtils.isEmpty(client.getString("store_photo")))) {
result.put("base_info_lack", true);
}
@ -480,8 +480,8 @@ public class RetailAppServiceImp implements RetailAppService {
}
}
result.putAll(file);
result.put("approve_result",client.getString("approve_result"));
result.put("mail_confirm",client.getBoolean("mail_confirm"));
result.put("approve_result", client.getString("approve_result"));
result.put("mail_confirm", client.getBoolean("mail_confirm"));
return result;
}
@ -1200,7 +1200,9 @@ public class RetailAppServiceImp implements RetailAppService {
public JSONObject bankAccountInfo(JSONObject device) {
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
return clientManager.getBankAccountByClientId(device.getIntValue("client_id"));
JSONObject bankInfo = clientManager.getBankAccountByClientId(device.getIntValue("client_id"));
bankInfo.put("account_no","***"+ StringUtils.substring(bankInfo.getString("account_no"), -4));
return bankInfo;
}
@Override
@ -1290,6 +1292,10 @@ public class RetailAppServiceImp implements RetailAppService {
public JSONObject listDailyTransactions(String dateStr, String timezone, boolean thisDevOnly, JSONObject device, String app_client_ids) {
try {
JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id"));
if(client==null){
return null;
}
timezone = client.getString("timezone");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
dateFormat.setTimeZone(TimeZone.getTimeZone(client.getString("timezone")));
Date date = dateFormat.parse(dateStr);

@ -2,7 +2,6 @@ package au.com.royalpay.payment.manage.application.core.impls;
import au.com.royalpay.payment.channels.wechat.config.WeChatPayConfig;
import au.com.royalpay.payment.channels.wechat.runtime.MpPaymentApi;
import au.com.royalpay.payment.core.exceptions.EmailException;
import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService;
import au.com.royalpay.payment.manage.mappers.preapply.SysClientPreMapperMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
@ -175,7 +174,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
Runnable task2 = () -> {
try {
String emailId = mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", address, "", content);
String emailId = mailService.sendEmail("This is a verification email", address, "", content);
} catch (Exception ignore) {
}
};
@ -320,6 +319,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
sysClient.put("clean_days", apply.getIntValue("clean_days"));
sysClient.put("country", "AUS");
sysClient.put("credential_code", RandomStringUtils.random(32, true, true));
sysClient.put("ali_sub_merchant_id", clientMoniker);
clientMapper.save(sysClient);
int clientId = sysClient.getIntValue("client_id");

@ -0,0 +1,35 @@
package au.com.royalpay.payment.manage.mappers.system;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
/**
* Created by davep on 2016-08-03.
*/
@AutoMapper(tablename = "sys_mail_unsub", pkName = "id")
public interface MailUnsubMapper {
@AutoSql(type = SqlType.INSERT)
void save(JSONObject record);
@AutoSql(type = SqlType.DELETE)
void delete(@Param("id") Long id);
@AutoSql(type = SqlType.SELECT)
JSONObject getOne(@Param("id") Long id,@Param("address") String address);
PageList<JSONObject> queryPageable(JSONObject params, PageBounds pagination);
List<JSONObject> query(JSONObject params);
List<String> getAllAddress();
}

@ -1,5 +1,7 @@
package au.com.royalpay.payment.manage.merchants.beans.mongo;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.data.mongodb.core.mapping.Document;
import java.util.Date;
@ -15,6 +17,7 @@ public class ClientConfigLog {
private String userName;
private String originData;
private String newData;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+10")
private Date createTime;
public long getId() {

@ -213,6 +213,7 @@ public class ClientApplyImpl implements ClientApply, ApplicationEventPublisherAw
}
partner.put("source",2);//自主申请
partner.put("country","AUS");//自主申请
partner.put("ali_sub_merchant_id",info.getClientMoniker());
clientMapper.save(partner);
JSONObject clientConfig = new JSONObject();

@ -536,6 +536,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
}
partner.put("create_time", new Date());
partner.put("ali_sub_merchant_id", registery.getClientMoniker());
partner.put("credential_code", RandomStringUtils.random(32, true, true));
partner.put("creator", manager.getString("manager_id"));
// if (manager.getIntValue("org_id") == 0) {

@ -25,6 +25,7 @@ import au.com.royalpay.payment.tools.permission.wechat.WechatMapping;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.Errors;
@ -267,7 +268,9 @@ public class PartnerViewController {
@PartnerMapping(value = "/bank_account", method = RequestMethod.GET)
@ResponseBody
public JSONObject getClientBankAccount(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
return clientManager.listClientBankAccounts(null, account.getString("client_moniker"));
JSONObject bankInfo = clientManager.listClientBankAccounts(null, account.getString("client_moniker"));
bankInfo.put("account_no","***"+ StringUtils.substring(bankInfo.getString("account_no"), -4));
return bankInfo;
}
@PartnerMapping(value = "/rates", method = RequestMethod.GET)

@ -11,11 +11,17 @@ import java.util.List;
*/
public interface MailService {
String sendEmail(String notice_id, String title, List<JSONObject> mailTo, String content) throws URISyntaxException, IOException;
String sendEmailNotice(String notice_id, String title, List<JSONObject> mailTo, String content) throws URISyntaxException, IOException;
String sendEmail(String title, String mailTos, String mailCcs, String content) throws URISyntaxException, IOException;
String sendEmail(String title, String mailTos, String mailCcs, String content, List<JSONObject> attachFiles) throws URISyntaxException, IOException;
List<JSONObject> checkEmailStatus(String emailId);
void removeUnsub(Long id);
JSONObject queryUnsubPageable(JSONObject params, int limit, int page);
void addUnsub(String ClientMoniker);
}

@ -1,12 +1,19 @@
package au.com.royalpay.payment.manage.notice.core.impls;
import au.com.royalpay.payment.manage.mappers.system.MailUnsubMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.notice.beans.NoticeBean;
import au.com.royalpay.payment.manage.notice.core.MailService;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.NotFoundException;
import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import au.com.royalpay.payment.tools.utils.id.IdUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.RandomStringUtils;
@ -25,6 +32,8 @@ import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import cn.yixblog.platform.http.HttpRequestGenerator;
import cn.yixblog.platform.http.HttpRequestResult;
@ -40,6 +49,10 @@ public class MailServiceImp implements MailService {
private String mailHost;
@Value("${mail.send.credentialCode}")
private String credentialCode;
@Resource
private MailUnsubMapper mailUnsubMapper;
@Resource
private ClientManager clientManager;
/* @Override
public void sendEmail(NoticeBean noticeBean) {
@ -62,8 +75,14 @@ public class MailServiceImp implements MailService {
@Override
public String sendEmail(String notice_id, String title, List<JSONObject> mailTo, String content) throws URISyntaxException, IOException {
public String sendEmailNotice(String notice_id, String title, List<JSONObject> mailTo, String content) throws URISyntaxException, IOException {
List<String> unsubAddress = mailUnsubMapper.getAllAddress();
List<JSONObject> mailToWithoutUnsub = new ArrayList<>();
mailTo.parallelStream().forEach(p->{
if(!unsubAddress.contains(p.getString("mailto"))){
mailToWithoutUnsub.add(p);
}
});
Document doc = Jsoup.parse(content);
Elements links = doc.select("a[href]");
List<JSONObject> files = new ArrayList<JSONObject>();
@ -90,7 +109,7 @@ public class MailServiceImp implements MailService {
NoticeBean noticeBean = new NoticeBean();
noticeBean.setTitle(title);
noticeBean.setNotice_id(notice_id);
noticeBean.setMailClients(mailTo);
noticeBean.setMailClients(mailToWithoutUnsub);
noticeBean.setContent(doc.outerHtml());
if (files.size() > 0) {
noticeBean.setFiles(files.toString());
@ -174,6 +193,35 @@ public class MailServiceImp implements MailService {
}
@Override
public void removeUnsub(Long id) {
mailUnsubMapper.delete(id);
}
@Override
public JSONObject queryUnsubPageable(JSONObject params, int limit, int page) {
return PageListUtils.buildPageListResult(mailUnsubMapper.queryPageable(params,new PageBounds(page, limit)));
}
@Override
public void addUnsub(String ClientMoniker) {
JSONObject client = clientManager.getClientInfoByMoniker(ClientMoniker);
if(client==null){
throw new NotFoundException("Merchant not Found");
}
JSONObject existRecord = mailUnsubMapper.getOne(null,client.getString("contact_email"));
if(existRecord!=null){
throw new BadRequestException("address has been added");
}
JSONObject record= new JSONObject();
record.put("id", IdUtil.getId());
record.put("address",client.getString("contact_email"));
record.put("client_id",client.getIntValue("client_id"));
record.put("client_moniker",client.getString("client_moniker"));
mailUnsubMapper.save(record);
}
@Override
public String sendEmail(String title, String mailTos, String mailCcs, String content, List<JSONObject> attachFiles) throws URISyntaxException, IOException {
NoticeBean noticeBean = new NoticeBean();

@ -192,7 +192,7 @@ public class NoticeManageImpl implements NoticeManage {
try {
logger.info(noticeId+"|"+info.getTitle()+"|"+mailto);
String mail_id = mailService.sendEmail(noticeId,info.getTitle(),mailto,info.getContent());
String mail_id = mailService.sendEmailNotice(noticeId,info.getTitle(),mailto,info.getContent());
notice.put("mail_id",mail_id);
noticeManageMapper.updateNotice(notice);
} catch (URISyntaxException | IOException e) {

@ -386,7 +386,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
"company_phone", "suburb", "postcode", "state", "contact_person", "contact_phone", "contact_email", "short_name", "logo_url", "enable_refund",
"enable_refund_auth", "retail_surcharge", "require_custinfo", "require_remark", "logo_thumbnail", "creator", "create_time", "approver",
"approve_result", "approve_time", "timezone", "has_children", "source", "customer_surcharge_rate", "enable_alipay", "enable_wechat",
"enable_bestpay", "manual_settle", "skip_clearing" };
"enable_bestpay", "manual_settle", "skip_clearing" ,"mail_confirm"};
for (String col : columns) {
simpleClient.put(col, client.get(col));
}

@ -0,0 +1,46 @@
package au.com.royalpay.payment.manage.system.web;
import au.com.royalpay.payment.manage.notice.core.MailService;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author kira
* @date 2018/6/12
*/
@RestController
@RequestMapping("/sys/mail")
public class MailController {
@Resource
private MailService mailService;
@RequestMapping(value = "/unsub/{id}",method = RequestMethod.DELETE)
// @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT})
public void removeSub(@PathVariable Long id) {
mailService.removeUnsub(id);
}
@RequestMapping(value = "/unsub",method = RequestMethod.POST)
// @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT})
public void removeSub(@RequestParam String client_moniker) {
mailService.addUnsub(client_moniker);
}
@RequestMapping(value = "/unsub/query",method = RequestMethod.GET)
// @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT})
public JSONObject list(@RequestParam(required = false) String client_moniker,@RequestParam(required = false) String address,@RequestParam(required = false,defaultValue = "10") int limit ,@RequestParam(required = false,defaultValue = "1") int page) {
JSONObject params = new JSONObject();
params.put("client_moniker",client_moniker);
params.put("address",address);
return mailService.queryUnsubPageable(params,limit,page);
}
}

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="au.com.royalpay.payment.manage.mappers.system.MailUnsubMapper">
<select id="getOne" resultType="com.alibaba.fastjson.JSONObject">
select * from sys_mail_unsub
<where>
<if test="id!=null">
and id = #{id}
</if>
<if test="address != null">
and address = #{address}
</if>
</where>
</select>
<select id="queryPageable" resultType="com.alibaba.fastjson.JSONObject">
select * from sys_mail_unsub
<where>
<if test="client_moniker!=null">
and client_moniker = #{client_moniker}
</if>
<if test="client_id != null">
and client_id = #{client_id}
</if>
<if test="address != null">
and address = #{address}
</if>
</where>
</select>
<select id="query" resultType="com.alibaba.fastjson.JSONObject">
select * from sys_mail_unsub
<where>
<if test="client_moniker!=null">
and client_moniker = #{client_moniker}
</if>
<if test="client_id != null">
and client_id = #{client_id}
</if>
<if test="address != null">
and address = #{address}
</if>
</where>
</select>
<select id="getAllAddress" resultType="java.lang.String">
select address from sys_mail_unsub
</select>
</mapper>

@ -239,6 +239,7 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl',
}
$scope.initParam();
$scope.partner.username = $scope.partner.contact_phone;
$scope.partner.apply_source = 'pc';
$http.post('/register/info/update/' + $scope.partner.username +'/step1', $scope.partner).then(function (resp) {
$scope.changeChoose(index);
$scope.partner.codeKey = resp.data.codeKey;

@ -35,6 +35,7 @@
<th style="max-width: 20%">Company Name</th>
<th>Status</th>
<th>Create Time</th>
<th>Apply Source</th>
<th>Operation</th>
</tr>
</thead>
@ -53,6 +54,10 @@
</if>
</td>
<td ng-bind="apply.create_time"></td>
<td>
<span ng-if="!apply.apply_source">pc</span>
<span ng-if="apply.apply_source" ng-bind="apply.apply_source"></span>
</td>
<td>
<a class="text-primary" role="button" title="Detail"
ui-sref="apply_detail({client_pre_apply_id:apply.client_pre_apply_id})">

Loading…
Cancel
Save