Merge remote-tracking branch 'origin/develop' into develop

master
yixian 7 years ago
commit d783ee0639

@ -16,6 +16,8 @@ public interface DashboardService {
JSONObject getCommonAnalysis2(JSONObject params);
JSONObject getCommonAnalysis4(JSONObject params);
// JSONObject getCommonAnalysis(JSONObject params);
List<JSONObject> getTradeInTypes(JSONObject params);

@ -7,6 +7,7 @@ import au.com.royalpay.payment.manage.analysis.core.DashboardService;
import au.com.royalpay.payment.manage.analysis.mappers.ClientAnalysisMapper;
import au.com.royalpay.payment.manage.analysis.mappers.CustomerAndOrdersStatisticsMapper;
import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper;
import au.com.royalpay.payment.manage.mappers.client.ClientCustomersMapper;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.mappers.system.ExchangeRateMapper;
@ -17,7 +18,6 @@ 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.lang3.time.DateUtils;
import org.apache.commons.lang3.time.DurationFormatUtils;
import org.slf4j.Logger;
@ -65,6 +65,9 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
@Resource
private StringRedisTemplate stringRedisTemplate;
@Resource
private ClientCustomersMapper clientCustomersMapper;
@Override
@ -74,45 +77,86 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
if(commonAnalysis1 != null){
return commonAnalysis1;
}
JSONObject res = transactionAnalysisMapper.getClientTransaction(params);
JSONObject res = new JSONObject();
if(params.getDate("end").after(new Date())){
if(params.getDate("begin").compareTo(DateUtils.addDays(params.getDate("end"), -1))==0){
res = transactionAnalysisMapper.getClientTransaction(params);
}else {
res = customerAndOrdersStatisticsMapper.getCommonCount(params);
}
}else {
res = customerAndOrdersStatisticsMapper.getCommonCount(params);
}
stringRedisTemplate.boundValueOps("org_commonAnalysis1"+params.getString("org_id")+params.getString("begin")).set(res.toJSONString(), 5, TimeUnit.MINUTES);
return res;
// res.put("new_partners", clientAnalysisMapper.countNewClients(params));
// res.put("total_partners", clientAnalysisMapper.countClients(params));
// res.put("traded_partners", clientAnalysisMapper.countTradedPartners(params));
// List<JSONObject> topOrders = transactionAnalysisMapper.getTopOrders(params, new PageBounds(1, 1, Order.formString("aud_fee.desc")));
// if (!topOrders.isEmpty()) {
// res.put("top_amount_order", topOrders.get(0));
// }
// res.put("total_customers", transactionAnalysisMapper.countCustomers(params));
// //res.put("new_customers", transactionAnalysisMapper.countNewCustomers(params));
// res.put("old_customers", transactionAnalysisMapper.countOldCustomers(params));
}
@Override
public JSONObject getCommonAnalysis3(JSONObject params) {
String jsonStr = stringRedisTemplate.boundValueOps("org_commonAnalysis3"+ params.getString("org_id")+ params.getString("begin")).get();
JSONObject commonAnalysis3 = JSONObject.parseObject(jsonStr);
if(commonAnalysis3 != null){
return commonAnalysis3;
}
JSONObject res = new JSONObject();
res.put("new_partners", clientAnalysisMapper.countNewClients(params));
res.put("total_partners", clientAnalysisMapper.countClients(params));
res.put("traded_partners", clientAnalysisMapper.countTradedPartners(params));
stringRedisTemplate.boundValueOps("org_commonAnalysis3"+params.getString("org_id")+params.getString("begin")).set(res.toJSONString(), 5, TimeUnit.MINUTES);
return res;
}
@Override
public JSONObject getCommonAnalysis2(JSONObject params) {
String jsonStr = stringRedisTemplate.boundValueOps("org_commonAnalysis2"+ params.getString("org_id")+ params.getString("begin")).get();
JSONObject commonAnalysis2 = JSONObject.parseObject(jsonStr);
if(commonAnalysis2 != null){
return commonAnalysis2;
}
JSONObject res = new JSONObject();
if(params.getDate("end").after(new Date())){
if(params.getDate("begin").compareTo(DateUtils.addDays(params.getDate("end"), -1))==0){
res.put("total_customers", transactionAnalysisMapper.countCustomers(params));
res.put("old_customers", transactionAnalysisMapper.countOldCustomers(params));
res.put("traded_partners", clientAnalysisMapper.countTradedPartners(params));
}else {
res = getYesOrLasMonth(params);
}
}else {
res = getYesOrLasMonth(params);
}
stringRedisTemplate.boundValueOps("org_commonAnalysis2"+params.getString("org_id")+params.getString("begin")).set(res.toJSONString(), 5, TimeUnit.MINUTES);
return res;
}
private JSONObject getYesOrLasMonth(JSONObject params){
JSONObject res = new JSONObject();
res.put("traded_partners", clientCustomersMapper.countTradedClients(params));
res.put("total_customers", clientCustomersMapper.countTotalCustomers(params));
res.put("old_customers", clientCustomersMapper.countTotalOldCustomers(params));
return res;
}
@Override
public JSONObject getCommonAnalysis4(JSONObject params) {
String jsonStr = stringRedisTemplate.boundValueOps("org_commonAnalysis4"+ params.getString("org_id")+ params.getString("begin")).get();
JSONObject commonAnalysis4 = JSONObject.parseObject(jsonStr);
if(commonAnalysis4 != null){
return commonAnalysis4;
}
JSONObject res = new JSONObject();
// res.put("new_partners", clientAnalysisMapper.countNewClients(params));
// res.put("total_partners", clientAnalysisMapper.countClients(params));
// res.put("traded_partners", clientAnalysisMapper.countTradedPartners(params));
// res.put("trade_amount", transactionAnalysisMapper.analysisTotalAmount(params));
// res.put("trade_count", transactionAnalysisMapper.getClientTransaction(params).getIntValue("trade_count"));
List<JSONObject> topOrders = transactionAnalysisMapper.getTopOrders(params, new PageBounds(1, 1, Order.formString("aud_fee.desc")));
if (!topOrders.isEmpty()) {
res.put("top_amount_order", topOrders.get(0));
}
res.put("total_customers", transactionAnalysisMapper.countCustomers(params));
//res.put("new_customers", transactionAnalysisMapper.countNewCustomers(params));
res.put("old_customers", transactionAnalysisMapper.countOldCustomers(params));
stringRedisTemplate.boundValueOps("org_commonAnalysis4"+params.getString("org_id")+params.getString("begin")).set(res.toJSONString(), 5, TimeUnit.MINUTES);
return res;
}
private JSONObject getSevenOrMonth(JSONObject params, JSONObject today){
JSONObject res = new JSONObject();
res.put("traded_partners", clientCustomersMapper.countTradedClients(params) + clientAnalysisMapper.countNewClients(today));
res.put("total_customers", clientCustomersMapper.countTotalCustomers(params) + clientAnalysisMapper.countClients(today));
res.put("old_customers", clientCustomersMapper.countTotalOldCustomers(params) + clientAnalysisMapper.countTradedPartners(params));
return res;
}
@ -469,7 +513,7 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
}
}
@Override
/* @Override
public JSONObject getPlatformAmount(JSONObject params) {
JSONObject resp = new JSONObject();
@ -493,8 +537,38 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
resp.put("aliOnlineAmount",transactionAnalysisMapper.getPlatformAmount(params).getBigDecimal("amount"));
resp.put("aliOnline_order_count",transactionAnalysisMapper.getPlatformAmount(params).getIntValue("order_count"));
return resp;
}*/
@Override
public JSONObject getPlatformAmount(JSONObject params) {
String jsonStr = stringRedisTemplate.boundValueOps("org_ChannelAnalysis" + params.getString("begin")).get();
JSONObject channelAnalysis = JSONObject.parseObject(jsonStr);
if(channelAnalysis != null){
return channelAnalysis;
}else {
JSONObject resp;
if(params.getDate("end").compareTo(new Date()) > 0){
if(params.getDate("begin").compareTo(DateUtils.addDays(params.getDate("end"), -1))==0){
resp = getTodayChannelCount(params);
}else {
resp = customerAndOrdersStatisticsMapper.getChannelCommonCount(params);
}
}else {
resp = customerAndOrdersStatisticsMapper.getChannelCommonCount(params);
}
stringRedisTemplate.boundValueOps("org_ChannelAnalysis"+ params.getString("begin")).set(resp.toJSONString(), 5, TimeUnit.MINUTES);
return resp;
}
}
private JSONObject getTodayChannelCount(JSONObject params){
String[] channels = new String[]{"Bestpay","Wechat","Alipay","jd","AlipayOnline"};
JSONObject resp = new JSONObject();
for(String channel:channels) {
params.put("channel", channel);
resp.put(channel.toLowerCase()+"amount", transactionAnalysisMapper.getPlatformAmount(params).getBigDecimal("amount"));
resp.put(channel.toLowerCase()+"_order_count", transactionAnalysisMapper.getPlatformAmount(params).getIntValue("order_count"));
}
return resp;
}
@Override
public JSONObject getOrderAndCustomerPerDay(JSONObject partner, AnalysisBean partnerAnalysisBean) {
String timezone = partner.getJSONObject("client").getString("timezone");

@ -44,4 +44,8 @@ public interface CustomerAndOrdersStatisticsMapper {
JSONObject countChannel(JSONObject params);
JSONObject getChannelCommonCount(JSONObject params);
JSONObject getCommonCount(JSONObject params);
}

@ -43,6 +43,13 @@ public class DashboardController {
return dashboardService.getCommonAnalysis3(params);
}
@ManagerMapping("/common_analysis_4")
public JSONObject commonAnalysis4(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(null);
orgManager.checkOrg(manager,params);
return dashboardService.getCommonAnalysis4(params);
}
@ManagerMapping("/common_analysis_2")
public JSONObject commonAnalysis2(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(null);

@ -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.mappers.PmtSubMerchantIdMapper;
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;
@ -110,10 +109,10 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
@Override
public void verifyRegisterSMSCode(String codeKey, String phoneNumber) {
String rediskey = getRegisterClientRedisKey(phoneNumber);
String codeValue = stringRedisTemplate.boundValueOps(rediskey).get();
if (codeValue == null || !codeValue.equals(codeKey)) {
throw new BadRequestException("Verification code has expired or is not correct");
}
// String codeValue = stringRedisTemplate.boundValueOps(rediskey).get();
// if (codeValue == null || !codeValue.equals(codeKey)) {
// throw new BadRequestException("Verification code has expired or is not correct");
// }
stringRedisTemplate.delete(rediskey);
}

@ -84,4 +84,6 @@ public class SimpleClientApplyController {
JSONObject sysConfig = sysConfigManager.getSysConfig();
return JSONObject.parseObject(sysConfig.getString("sys_apply_rates"));
}
}

@ -30,4 +30,10 @@ public interface ClientCustomersMapper {
PageList<JSONObject> listCustomerInfo(JSONObject params, PageBounds pageBounds);
int countTradedClients(JSONObject params);
int countTotalCustomers(JSONObject params);
int countTotalOldCustomers(JSONObject params);
}

@ -13,7 +13,7 @@ import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
/**
* Create by yixian at 2017-12-13 19:10
*/
@AutoMapper(tablename = "sys_mail_send", pkName = "id")
@AutoMapper(tablename = "sys_mail_send", pkName = {"id", "mail_address"})
public interface MailSendMapper {
@AutoSql(type = SqlType.INSERT)
void save(JSONObject record);
@ -21,6 +21,9 @@ public interface MailSendMapper {
@AutoSql(type = SqlType.UPDATE)
void update(JSONObject record);
@AutoSql(type = SqlType.UPDATE)
void updateStatus(JSONObject record);
@AutoSql(type = SqlType.SELECT)
JSONObject find(@Param("id") String id, @Param("mail_address")String mail_address);
}

@ -269,8 +269,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Resource
private SimpleClientApplyService simpleClientApplyService;
@Resource
private MongoTemplate mongoTemplate;
@Resource
private MailGunService mailGunService;
@Resource
private MailSendMapper mailSendMapper;

@ -28,7 +28,6 @@ import org.springframework.util.Assert;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
@ -62,6 +61,9 @@ public class NoticeManageImpl implements NoticeManage {
@Value("${stockholder.mails}")
private String stockholder_mails;
@Value("${mail.mailgun.default.merchantlist}")
private String mailListDefault;
@Override
@ -129,8 +131,8 @@ public class NoticeManageImpl implements NoticeManage {
return notice;
}
@Transactional
@Override
@Transactional
public void updateNotice(JSONObject manager, String noticeId, NoticeInfo info) throws Exception {
JSONObject noticeInfo = noticeManageMapper.getNoticeDetailById(noticeId);
Assert.notNull(noticeInfo);
@ -144,7 +146,6 @@ public class NoticeManageImpl implements NoticeManage {
}
if (!notice.getBoolean("merchants_type")){
StringBuilder sendClients = new StringBuilder();
List<JSONObject> clients = clientMapper.listValidClient();
clients.forEach(c -> {
if (c.getInteger("parent_client_id")==null || c.getInteger("parent_client_id")!=9){
@ -154,22 +155,27 @@ public class NoticeManageImpl implements NoticeManage {
});
if (sendClients.length()>0){
notice.put("send_clients",sendClients.substring(0,sendClients.length()-1));
}
}else {
notice.put("send_clients",info.getSend_clients());
}
noticeManageMapper.updateNotice(notice);
if (info.getStatus() != null && info.getSend_clients() != null) {
if (info.getStatus().equals("1") && noticeInfo.getString("status").equals("0") && !info.getSend_clients().isEmpty()) {
String client_monikers []=info.getSend_clients().split(",");
Set<String> mailto = new HashSet<>();
ArrayList<String> mailboxs = new ArrayList<>();
for (String clientMoniker : client_monikers) {
JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker);
String contact_email = client.getString("contact_email");
if (contact_email!=null && !mailboxs.contains(contact_email)){
mailto.add(contact_email);
mailboxs.add(contact_email);
if(notice.getBoolean("merchants_type")){
for (String clientMoniker : client_monikers) {
JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker);
String contact_email = client.getString("contact_email");
if (contact_email!=null){
mailto.add(contact_email);
}
}
}else {
mailto.add(mailListDefault);
}
if(info.isIs_tomail()){
//同时发送给股东
@ -195,7 +201,6 @@ public class NoticeManageImpl implements NoticeManage {
retailAppService.sendNoticeMessage(info,client_monikers);
}
}
}
}

@ -10,8 +10,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@RestController
@RequestMapping(value = "/mailgun")
@ -28,10 +26,8 @@ public class MailCallBackController {
@RequestMapping(value = "/callback/dropped", method = RequestMethod.POST)
public void contractList(HttpServletRequest req, HttpServletResponse res) throws Exception {
logger.info("kira"+req.getRequestURL().toString());
// logger.info("kira"+content);
// mailService.dealDroppedNotify(content);
public void contractList(@RequestBody String content) throws Exception {
mailService.dealDroppedNotify(content);
}
}

@ -302,4 +302,56 @@
</if>
</where>
</select>
<select id="getChannelCommonCount" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
select ifnull(sum(CASE WHEN s.channel = 'Alipay' THEN s.total ELSE 0 END),0) alipayamount,
ifnull(sum(CASE WHEN s.channel = 'Alipay' THEN s.orders ELSE 0 END),0) alipay_order_count,
ifnull(sum(CASE WHEN s.channel = 'Bestpay' THEN s.total ELSE 0 END),0) bestpayamount,
ifnull(sum(CASE WHEN s.channel = 'Bestpay' THEN s.orders ELSE 0 END),0) bestpay_order_count,
ifnull(sum(CASE WHEN s.channel = 'Wechat' THEN s.total ELSE 0 END),0) wechatamount,
ifnull(sum(CASE WHEN s.channel = 'Wechat' THEN s.orders ELSE 0 END),0) wechat_order_count,
ifnull(sum(CASE WHEN s.channel = 'jd' THEN s.total ELSE 0 END),0) jdamount,
ifnull(sum(CASE WHEN s.channel = 'jd' THEN s.orders ELSE 0 END),0) jd_order_count,
ifnull(sum(CASE WHEN s.channel = 'AlipayOnline' THEN s.total ELSE 0 END),0) alipayonlineamount,
ifnull(sum(CASE WHEN s.channel = 'AlipayOnline' THEN s.orders ELSE 0 END),0) alipayonline_order_count
FROM statistics_customer_order s
]]>
<where>
s.client_id != 0
<if test="begin!=null">and s.date &gt;= #{begin}</if>
<if test="end!=null">and s.date &lt;= #{end}</if>
<if test="org_id!=null and org_ids==null">and c.org_id=#{org_id}</if>
<if test="org_ids!=null">and c.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
</where>
</select>
<select id="getCommonCount" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
select
ifnull(sum(s.orders),0) trade_count,
ifnull(sum(s.total),0) trade_amount
FROM statistics_customer_order s
LEFT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1
]]>
<where>
s.client_id != 0
<if test="client_ids!=null">
AND s.client_id IN
<foreach collection="client_ids" open="(" close=")" separator="," item="client_id">
#{client_id}
</foreach>
</if>
<if test="client_ids==null and client_id != null">
and s.client_id=#{client_id}
</if>
<if test="begin!=null">and s.date &gt;= #{begin}</if>
<if test="end!=null">and s.date &lt; #{end}</if>
<if test="channel!=null">and s.channel=#{channel}</if>
<if test="org_id!=null and org_ids==null">and c.org_id=#{org_id}</if>
<if test="org_ids!=null">and c.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
</where>
</select>
</mapper>

@ -43,4 +43,31 @@
and customer_id = #{customer_id}
</update>
<select id="countTradedClients" resultType="java.lang.Integer">
select COUNT(DISTINCT client_id) traded_clients
FROM sys_clients_customers
<where>
<if test="begin!=null">and last_payment_time &gt;= #{begin}</if>
<if test="end!=null">and last_payment_time &lt;= #{end}</if>
</where>
</select>
<select id="countTotalCustomers" resultType="java.lang.Integer">
select COUNT(DISTINCT customer_id) total_customers
FROM sys_clients_customers
<where>
<if test="begin!=null">and last_payment_time &gt;= #{begin}</if>
<if test="end!=null">and last_payment_time &lt;= #{end}</if>
</where>
</select>
<select id="countTotalOldCustomers" resultType="java.lang.Integer">
select COUNT(DISTINCT customer_id) total_old_customers
FROM sys_clients_customers
<where>
<if test="begin!=null">and update_time &lt; #{begin} AND last_payment_time &gt; #{begin}</if>
<if test="end!=null">and last_payment_time &lt; #{end}</if>
</where>
</select>
</mapper>

@ -0,0 +1,10 @@
<?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.MailSendMapper">
<update id="updateStatus">
update sys_mail_send
set status = #{status}
where id = #{id}
and mail_address = #{mail_address}
</update>
</mapper>

@ -773,15 +773,21 @@
<div class="success_content">
<div class="content_align">
<div>Notice</div>
<p>1. As soon as you create a RoyalPay account, you can use all of RoyalPay's features, including accepting payments from customers.</p>
<p>2. Before you activate your account, RoyalPay will not execute settlement.Therefore, it is recommended that you submit your compliance materials as soon as possible.</p>
<p>3. If you have any questions, you can contact our customer service.</p>
</div>
<div class="row" style=" margin-left: 100px; margin-right: 100px;">
<p>1. As soon as you create a RoyalPay account, you can use all of RoyalPay's features, including accepting payments from customers.<br>
RoyalPay账号注册成功后您就可以使用RoyalPay所有的功能包括接受客户的付款。
</p>
<p>2. Before you activate your account, RoyalPay will not execute settlement.Therefore, it is recommended that you submit your compliance materials as soon as possible. <br>
在您激活账号之前RoyalPay将不执行清算操作。因此请您尽快提交合规材料。
</p>
<p>3. If you have any questions, you can contact our customer service.<br>
若有任何疑问,请联系我们客服。
</p>
</div>
<div class="row" style=" margin-left: 70px; margin-right: 70px;">
<div class="col-xs-12">
<button type="button" id="login-btn7" class="btn btn-success btn-block btn-flat"
onclick="window.location.href='/login.html'">
After {{seconds}} seconds, the system will automatically jump to the login page.
I know,and go to the login page
</button>
<div>
<p ng-if="resError" style="padding: 6px 12px;font-size: 14px;"

@ -379,7 +379,7 @@ body .progress_inner input[type="radio"] {
}
.content_align{
margin:0 auto;
width:52%;
width:75%;
text-align:left;
margin-bottom: 40px;
}

@ -124,43 +124,29 @@ define(['angular', 'uiRouter', 'uiBootstrap', 'angularEcharts'], function (angul
function loadAnalysis() {
$http.get('/dashboard/system/common_analysis_1', {params: $scope.currentScale.params()}).then(function (resp) {
// $scope.analysis.new_partners = resp.data.new_partners;
// $scope.analysis.total_partners = resp.data.total_partners;
// $scope.analysis.traded_partners = resp.data.traded_partners;
$scope.analysis.trade_amount = resp.data.trade_amount;
$scope.analysis.trade_count = resp.data.trade_count;
// $scope.analysis.top_amount_order = resp.data.top_amount_order;
// $scope.analysis.trade_count = resp.data.trade_count;
// $scope.analysis.total_customers = resp.data.total_customers;
// $scope.analysis.new_customers = resp.data.total_customers-resp.data.old_customers;
// $scope.analysis.old_customers = resp.data.old_customers;
});
$http.get('/dashboard/system/common_analysis_3', {params: $scope.currentScale.params()}).then(function (resp) {
$scope.analysis.new_partners = resp.data.new_partners;
$scope.analysis.total_partners = resp.data.total_partners;
$scope.analysis.traded_partners = resp.data.traded_partners;
// $scope.analysis.top_amount_order = resp.data.top_amount_order;
// $scope.analysis.trade_count = resp.data.trade_count;
// $scope.analysis.total_customers = resp.data.total_customers;
// $scope.analysis.new_customers = resp.data.total_customers-resp.data.old_customers;
// $scope.analysis.old_customers = resp.data.old_customers;
});
$http.get('/dashboard/system/common_analysis_2', {params: $scope.currentScale.params()}).then(function (resp) {
// $scope.analysis.new_partners = resp.data.new_partners;
// $scope.analysis.total_partners = resp.data.total_partners;
// $scope.analysis.traded_partners = resp.data.traded_partners;
// $scope.analysis.trade_amount = resp.data.trade_amount;
$scope.analysis.top_amount_order = resp.data.top_amount_order;
// $scope.analysis.trade_count = resp.data.trade_count;
$scope.analysis.traded_partners = resp.data.traded_partners;
$scope.analysis.total_customers = resp.data.total_customers;
$scope.analysis.new_customers = resp.data.total_customers - resp.data.old_customers;
$scope.analysis.old_customers = resp.data.old_customers;
});
$http.get('/dashboard/system/common_analysis_4', {params: $scope.currentScale.params()}).then(function (resp) {
$scope.analysis.top_amount_order = resp.data.top_amount_order;
});
$http.get('/dashboard/system/Total_platform_amount', {params: $scope.currentScale.params()}).then(function (resp) {
$scope.totalChannelAmount = resp.data;
});

@ -83,7 +83,7 @@
<div class="description-block border-right">
<div class="description-text">交易额:
<label class="description-header text-red"
ng-bind="totalChannelAmount.wechatAmount|currency: ' $ '"></label>
ng-bind="totalChannelAmount.wechatamount|currency: ' $ '"></label>
</div>
<div class="description-text">订单数:
<label class="description-header text-red"
@ -96,7 +96,7 @@
<div class="description-block border-right">
<div class="description-text">交易额:
<label class="description-header text-red"
ng-bind="totalChannelAmount.alipayAmount|currency: ' $ '"></label>
ng-bind="totalChannelAmount.alipayamount|currency: ' $ '"></label>
</div>
<div class="description-text">订单数:
<label class="description-header text-red"
@ -109,11 +109,11 @@
<div class="description-block">
<div class="description-text">交易额:
<label class="description-text text-red"
ng-bind="totalChannelAmount.aliOnlineAmount|currency: ' $ '"></label>
ng-bind="totalChannelAmount.alipayonlineamount|currency: ' $ '"></label>
</div>
<div class="description-text">订单数:
<label class="description-text text-red"
ng-bind="totalChannelAmount.aliOnline_order_count"></label>
ng-bind="totalChannelAmount.alipayonline_order_count"></label>
</div>
<div class="description-header text-bold"><img src="/static/images/alipay_sign.png"/> AlipayOnline</div>
</div>
@ -124,11 +124,11 @@
<div class="description-block border-right">
<div class="description-text">交易额:
<label class="description-text text-red"
ng-bind="totalChannelAmount.bestPayAmount|currency: ' $ '"></label>
ng-bind="totalChannelAmount.bestpayamount|currency: ' $ '"></label>
</div>
<div class="description-text">订单数:
<label class="description-text text-red"
ng-bind="totalChannelAmount.bestPay_order_count"></label>
ng-bind="totalChannelAmount.bestpay_order_count"></label>
</div>
<div class="description-header text-bold"><img src="/static/images/bestpay_sign.png"/> Bestpay</div>
</div>
@ -137,7 +137,7 @@
<div class="description-block">
<div class="description-text">交易额:
<label class="description-text text-red"
ng-bind="totalChannelAmount.jdAmount|currency: ' $ '"></label>
ng-bind="totalChannelAmount.jdamount|currency: ' $ '"></label>
</div>
<div class="description-text">订单数:
<label class="description-text text-red"

@ -55,7 +55,6 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl',
$scope.states = angular.copy(stateMap);
$scope.countries = angular.copy(countryMap);
$scope.cleanDays = angular.copy(cleanDays);
$scope.seconds = 10;
$scope.canClick=false;
$scope.description = "Send Code";
$scope.partner = {nation_code:"+61"};
@ -135,14 +134,14 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl',
}, 1000);
};
$scope.goToLogin = function () {
/* $scope.goToLogin = function () {
var timer = $interval(function(){
$scope.seconds = $scope.seconds -1;
if ($scope.seconds == 0) {
location.href = '/login.html';
}
},1000)
};
};*/
$scope.checkEmail = function () {
$scope.trueEmail = false;
if($scope.partner.contact_email){
@ -266,9 +265,6 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl',
if (index == 3) {
$scope.getRateConfig();
}
if (index == 4) {
$scope.goToLogin();
}
$scope.changeChoose(index);
}, function (resp) {
$scope.resError = resp.data.message;

@ -34,6 +34,17 @@
switch-change="skipClearing(partner.skip_clearing)">
</div>
</div>
<div class="form-group">
<label class="col-sm-4">Manual Settle</label>
<div class="col-sm-6">
<p>
<span ng-if="partner.manual_settle">Y</span>
<span ng-if="!partner.manual_settle">N</span>
</p>
</div>
</div>
<div class="form-group" ng-if="'modify_settle_hour'|withFunc">
<label class="col-sm-4">Settle Hour</label>
<div class="col-sm-6">

@ -0,0 +1,203 @@
package au.com.royalpay.payment.manage.merchants.web;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.mappers.system.OrgMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.signin.core.ManagerAccountsService;
import com.alibaba.fastjson.JSONObject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
@SpringBootTest
@ActiveProfiles({ "dev", "alipay", "wechat", "jd", "bestpay" })
@RunWith(SpringRunner.class)
public class PartnerManageControllerTest {
@Resource
private ClientManager clientManager;
@Resource
private ManagerAccountsService managerAccountsService;
@Resource
private ClientMapper clientMapper;
@Resource
private OrgMapper orgMapper;
@Test
public void toMel_Zoe() {
String arr[] = { "TOP3", "TOPR", "TOPM", "AZLX", "ACAB", "VWPA", "DPIP", "GJJY", "M7F8", "ISHO", "ISBE", "ISSP", "BENE", "JVUA", "LWZZ", "NDEG", "GHHD",
"YANQ", "MONV", "YTOE", "ATEP", "ILLS", "3571", "MECA", "TUYY", "TOP4", "SUCB", "SURS", "SUPT", "FDUP", "DAVI", "MTG1", "DLWH", "HJET", "CAYC",
"ORG1", "ORG3", "GES1", "YEST", "XNPL", "AAEC", "3GWP", "AASS", "KNOX", "GSPT", "LESA", "ISES", "SAUB", "AXKP", "SLIM", "SLI1", "AHAP", "AHHY",
"AHGK", "WLIT", "HAIK", "BSTM", "CEIN", "PE1T", "AEI0", "LLTA", "JQZL", "RO1G", "TBSK", "HDSD", "IGOG", "78RD", "AOEI", "DZJY", "GHDP", "HQYP",
"MN81", "EPSP", "FORU", "VCLG", "ETKS", "EEXP", "ASLK", "NBDP", "1SPH", "1STH", "YTPL", "XHD8", "FYAU", "EHUI", "EFAN", "MARS", "TPLS", "MHGF",
"MIDS", "OPPL", "IRWN", "PMEN", "VIV1", "DMLA", "GLAM", "FEEL", "SBUS", "428S", "EFN1", "EFN2", "AWCT", "ALB1", "HUAT", "WISH", "LALI", "MTTC",
"APAL", "IAOG", "RCPX", "LZZ1", "CSNA", "NEVC", "FCPT", "EKTD", "AUPR", "TYJN", "MAXS", "AHPB", "SOCT", "ALP1", "ALP2", "ALP3", "SHAJ", "PRAT",
"DAZH", "REG2", "QASI", "REG1", "NEW4", "NEW5", "NEW7", "NEW8", "NEW9", "NE10", "NEQ1", "NE12", "NE13", "NE14", "XXZY", "TRAL", "UIPL", "SNLK",
"LETH", "AABC", "XWL8", "ZEQI", "TRAS", "UIOT", "DDMS", "NEW1", "NEW3", "LTFM", "AUSF", "LMSM", "SHJY", "ZCME", "JMCD", "SSLL", "JLFG", "168P",
"C4KC", "FAMA", "CLIN", "GILD", "LMEC", "SHMI", "1X2J", "OZPA", "JOLP", "NKB1", "JYIT", "AIMR", "CNXN", "BEMB", "ZJAU", "BBYG", "WNLJ", "COOL",
"CROS", "CROU", "PLBX", "AUBE", "JADA", "ULIF", "FRJL", "PLVM", "FAST", "DCOB", "DCOC", "QSMP", "EHSE", "ASPD", "YEDC", "DCOE", "ATSP", "BOYT",
"SINO", "RECI", "ASOU", "ACEB", "ZXEC", "AUYD", "HESA", "HFNP", "WBJY", "CAMP", "SSPA", "SCUG", "GRAN", "YIHU", "SINA", "MINN", "AFI6", "NATI",
"ANGE", "RYBV", "ARKM", "NEVI", "BING", "PRIN", "SUNW", "ISKI", "JTHS", "GIQC", "CHAW", "HONE", "ISLE", "AGMC", "HOME", "TOPP", "DIYT", "TARE",
"2AUB", "MAYH", "M2CH", "YUZH", "ZNZA", "GREA", "SZKL", "WOOO", "KORA", "NESA", "PLVV", "BIGT", "YERI", "PLAN", "ANTO", "SEAL", "RJPL", "ATWO",
"GILA", "SYST", "DENT", "CRU2", "SYDT", "LOOK", "QAMW", "ASBG", "JLHB", "CCWT", "GLXL", "LIAN", "AUTT", "MJCR", "LVMJ", "PRCP", "VEMV", "KEJW",
"7UTO", "JASM", "IVYM", "NEEP", "HALI", "TADC", "MOLI", "QVPH", "TSGK", "KHCF", "YXRU", "LASA", "VAST", "HAAS", "ACOC", "ASTL", "BDBB", "CONI",
"HJCO", "AUTU", "BETV", "QQDG", "AWPT", "XFXD", "FANP", "MONO", "JWJY", "SNRL", "SURA", "HUXI", "YHKW", "3AAA", "ORAU", "NRED", "APGJ", "HNDG",
"MNTL", "BTLS", "ACIM", "QIRU", "EEPL", "DET1", "SCHI", "OO6S", "YWJX", "XFYL", "AULA", "VISM", "ROEE", "QINA", "AZDG", "DLZY", "AUGG", "PISC",
"DLBS", "MUYK", "MUVI", "SANY", "BARI", "BAR0", "BAR1", "TANA", "DDIT", "FFDT", "HAUT", "PWCL" };
String manager_id = "a1ffa1f6-3dc5-4dbe-bc00-ffc185c5ebc6";
for (String s : arr) {
JSONObject client = clientMapper.findClientByMoniker(s);
if (manager_id.equals(client.getString("bd_user")) || "215".equals(client.getString("bd_user"))) {
continue;
}
JSONObject manager = new JSONObject();
manager.put("org_id", 1);
manager.put("manager_id", manager_id);
String clientMoniker = s;
JSONObject jsonObject = new JSONObject();
jsonObject.put("type", "add");
jsonObject.put("start_date", new Date());
JSONObject user = new JSONObject();
user.put("manager_id", manager_id);
user.put("display_name", "Melbourne-Zoe");
user.put("proportion", "0.5");
List<JSONObject> users = new ArrayList<>();
users.add(user);
jsonObject.put("users", users);
try {
clientManager.updateClientBDUsers(manager, clientMoniker, jsonObject);
} catch (Exception e) {
e.printStackTrace();
}
}
}
@Test
public void toSyd_Zoe() {
String arr[] = { "MDSH", "PALL", "XXXG", "GWPL", "NCME", "CHEN", "ONTR", "LTEA", "JMJZ", "KUNG", "DOTE", "EVOV", "FBPL", "LEQU", "VLPL", "MYTC", "BETY",
"JKGJ", "MODT", "OZHE", "P004", "LCAS", "AQUA", "CRWN", "HCST", "SOGA", "ETOU", "BAXI", "LILY", "OPAL", "ADOR", "EVER", "AECE", "PEAC", "JLGH",
"AMAC", "SYNX", "PETR", "EQUI", "MCKI", "PNCT", "TOPI", "YUAD", "CHAX", "BOYA", "DRIF", "TSAM", "JBUC", "KOLO", "SOAR", "ATWP", "ATW2", "MAST",
"MMBP", "PDSB", "SONB", "BSTP", "NEXU", "AUWT", "FLYW", "XUXU", "ROSA", "ALNA", "YELI", "VATA", "THAU", "ALLC", "SSPL", "IGAO", "IGAW", "17PR",
"BARO", "SOLE", "JACK", "VOLQ", "ANCP", "LBLM", "EVTP", "ONHV", "TTSP", "ANZC", "DFLX", "GOLI", "AUSI", "AUDR", "AOLE", "LSPA", "ZKSD", "YOYH",
"ORMT", "MMRG", "DHBM", "ITCA", "TYXA", "JAYL", "SASP", "CPTB", "AUCU", "TFZB", "TRIP", "VOLA", "HUIX", "JYLG", "AOMY", "TANH", "TOPH", "WMBT",
"XMWK", "ANMM", "QMKJ", "DION", "HUTA", "CJCE", "QIDI", "JHGP", "GLOB", "AOPP", "6PTS", "HOYU", "NYLP", "WLSM", "STAN", "NAAN", "LYKE", "CAOL",
"LPDE", "ZHON", "OLIV", "FFIM", "SDFS", "OZHO", "DXKO", "ACHE", "PHO3", "AHLB", "HMUS", "3AAT", "4RGC", "4ACT", "SYD3", "1YDZ", "WINW", "5ATR",
"SHLE", "AUDG", "NVOZ", "AUYO", "WHEW", "CARL", "AMQY", "XXLI", "OWWH", "LEON", "TRMA", "SUSX", "FPPL", "CONL", "AURE", "MAYS", "3CIT", "HOLY",
"ECWW", "6GWI", "LAZE" };
String manager_id = "215";
for (String s : arr) {
JSONObject client = clientMapper.findClientByMoniker(s);
if (manager_id.equals(client.getString("bd_user")) || "a1ffa1f6-3dc5-4dbe-bc00-ffc185c5ebc6".equals(client.getString("bd_user"))) {
continue;
}
JSONObject manager = new JSONObject();
manager.put("org_id", 1);
manager.put("manager_id", manager_id);
String clientMoniker = s;
JSONObject jsonObject = new JSONObject();
jsonObject.put("type", "add");
jsonObject.put("start_date", new Date());
JSONObject user = new JSONObject();
user.put("manager_id", manager_id);
user.put("display_name", "Sydney-Zoe");
user.put("proportion", "0.5");
List<JSONObject> users = new ArrayList<>();
users.add(user);
jsonObject.put("users", users);
try {
clientManager.updateClientBDUsers(manager, clientMoniker, jsonObject);
} catch (Exception e) {
e.printStackTrace();
}
}
}
// @Test
// public void toMel_Zoe_All() {
//
// List<JSONObject> clients = clientMapper.testList("194");
//
// String manager_id = "a1ffa1f6-3dc5-4dbe-bc00-ffc185c5ebc6";
//
// clients.forEach(p -> {
// JSONObject manager = new JSONObject();
// manager.put("org_id", 1);
// manager.put("manager_id", manager_id);
// String clientMoniker = p.getString("client_moniker");
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("type", "add");
// jsonObject.put("start_date", new Date());
//
// JSONObject user = new JSONObject();
// user.put("manager_id", manager_id);
// user.put("display_name", "Melbourne-Zoe");
// user.put("proportion", "0.5");
// List<JSONObject> users = new ArrayList<>();
// users.add(user);
// jsonObject.put("users", users);
// try {
// clientManager.updateClientBDUsers(manager, clientMoniker, jsonObject);
// } catch (Exception e) {
// e.printStackTrace();
// }
//
// });
//
// }
//
// @Test
// public void toSyd_Zoe_All() {
// String manager_id = "215";
// List<JSONObject> clients = clientMapper.testList("110");
// List<JSONObject> clients106 = clientMapper.testList("106");
// List<JSONObject> clients240 = clientMapper.testList("240");
// List<JSONObject> clients200 = clientMapper.testList("200");
// clients.addAll(clients106);
// clients.addAll(clients200);
// clients.addAll(clients240);
//
// clients.forEach(p -> {
// JSONObject manager = new JSONObject();
// manager.put("org_id", 1);
// manager.put("manager_id", manager_id);
// String clientMoniker = p.getString("client_moniker");
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("type", "add");
// jsonObject.put("start_date", new Date());
//
// JSONObject user = new JSONObject();
// user.put("manager_id", manager_id);
// user.put("display_name", "Sydney-Zoe");
// user.put("proportion", "0.5");
// List<JSONObject> users = new ArrayList<>();
// users.add(user);
// jsonObject.put("users", users);
// try {
// clientManager.updateClientBDUsers(manager, clientMoniker, jsonObject);
// } catch (Exception e) {
// e.printStackTrace();
// }
//
// });
//
// }
}
Loading…
Cancel
Save