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

master
lujian 6 years ago
commit efea8fc17a

@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.analysis.core;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
@ -12,4 +13,6 @@ public interface ChannelsAnalysisService {
List<JSONObject> getChannelMount(JSONObject params);
List<JSONObject> getChannelDate(JSONObject params);
void exportData(JSONObject params, HttpServletResponse resp);
}

@ -3,9 +3,21 @@ package au.com.royalpay.payment.manage.analysis.core.impls;
import au.com.royalpay.payment.manage.analysis.core.ChannelsAnalysisService;
import au.com.royalpay.payment.manage.analysis.mappers.CustomerAndOrdersStatisticsMapper;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
@ -66,6 +78,42 @@ public class ChannelsAnalysisServiceImpl implements ChannelsAnalysisService {
return list;
}
@Override
public void exportData(JSONObject params, HttpServletResponse resp) {
params.put("channels", new String []{"Alipay", "AlipayOnline"});
String[] title = {"Channel", "Total Amount(AUD)", "Total orders", "Transaction Partners", "Enable Partners"};
JSONObject count = customerAndOrdersStatisticsMapper.countChannel(params);
int enablePartners = customerAndOrdersStatisticsMapper.countEnableAlipay(params);
String begin = params.getString("begin") == null ? "":DateFormatUtils.format(params.getDate("begin"),"yyyy-MM-dd");
String end = params.getString("end") == null ? "":DateFormatUtils.format(params.getDate("end"),"yyyy-MM-dd");
OutputStream ous = null;
try {
resp.setContentType("application/octet-stream;");
resp.addHeader("Content-Disposition",
"attachment; filename=" + "Alipay_Data_" + begin + "_" + end + ".xlsx");
ous = resp.getOutputStream();
Workbook wb = new XSSFWorkbook();
Sheet sheet = wb.createSheet();
int rowNum = 0;
Row row = sheet.createRow(rowNum);
for (int i = 0; i < title.length; i++) {
row.createCell(i, Cell.CELL_TYPE_STRING).setCellValue(title[i]);
}
row = sheet.createRow(++rowNum);
row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue("Alipay+AlipayOnline");
row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(count.getIntValue("total"));
row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(count.getIntValue("orders"));
row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(count.getIntValue("transaction_partners"));
row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(enablePartners);
wb.write(ous);
ous.flush();
} catch (IOException e) {
e.printStackTrace();
} finally {
IOUtils.closeQuietly(ous);
}
}
private void analysisChannelCustomers(JSONObject params, Map<Date, JSONObject> analysisMap, String channel) {
params.put("channel", channel);
List<JSONObject> customerAnalysis = customerAndOrdersStatisticsMapper.getSumChannelAnalysis(params);

@ -63,4 +63,6 @@ public interface CustomerAndOrdersStatisticsMapper {
int countTotalOldCustomers(JSONObject params);
int countEnableChannel(JSONObject params);
int countEnableAlipay(JSONObject params);
}

@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
@ -52,4 +53,19 @@ public class ChannelsAnalysisController {
}
return channelsAnalysisService.getChannelDate(params);
}
@ManagerMapping(value = "/alipay/data/export")
public void exportAlipayData(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse reps) {
JSONObject params = analysis.toParams(null);
if (manager.getInteger("org_id") != null) {
params.put("org_id", manager.getIntValue("org_id"));
}
if (analysis.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) {
params.put("bd_group", manager.getString("manager_id"));
if (analysis.getGroup_bd()>0){
params.put("bd_group_bd",analysis.getGroup_bd());
}
}
channelsAnalysisService.exportData(params, reps);
}
}

@ -291,6 +291,12 @@
and s.client_id=#{client_id}
</if>
<if test="channel!=null">and s.channel = #{channel}</if>
<if test="channels!=null">
and s.channel IN
<foreach collection="channels" open="(" close=")" separator="," item="channel">
#{channel}
</foreach>
</if>
<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 c.org_id = #{org_id}</if>
@ -614,4 +620,43 @@
)
</if>
</select>
<select id="countEnableAlipay" resultType="java.lang.Integer">
<![CDATA[
SELECT
IFNULL(
COUNT(DISTINCT c.client_id),
0
) count
FROM
sys_clients c
INNER JOIN sys_client_config cc ON cc.client_id = c.client_id
INNER JOIN sys_org o ON o.org_id = c.org_id
WHERE
c.open_status = 5
AND c.approve_result = 1
AND c.approve_time IS NOT NULL
AND (cc.gateway_alipay_online = 1 or cc.enable_alipay = 1)
]]>
<if test="client_ids!=null">
AND c.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 c.client_id=#{client_id}
</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>
<if test="bd_group!=null">and c.client_id in
(SELECT b.client_id FROM sys_client_bd b
INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id
where b.is_valid=1 and b.start_date&lt;=now() and (b.end_date is null or b.end_date &gt;= now())
AND (c.bd_group=#{bd_group} or c.manager_id=#{bd_group})
<if test="bd_group_bd">and c.manager_id=#{bd_group_bd}</if>
)
</if>
</select>
</mapper>

@ -112,6 +112,21 @@ define(['angular', 'static/commons/commons', 'static/commons/angular-ueditor', '
$scope.channel_single_amount_chart = chartParser.parse(channels_single_amount_chart, resp.data);
});
};
$scope.exportAlipayData = function() {
var params = angular.copy($scope.params);
var url = '/analysis/channels/alipay/data/export';
var connectSymbol = '?';
if (params.begin) {
params.begin = $filter('date')(params.begin, 'yyyyMMdd');
url += connectSymbol + 'begin=' + params.begin;
connectSymbol = '&';
}
if (params.end) {
params.end = $filter('date')(params.end, 'yyyyMMdd');
url += connectSymbol + 'end=' + params.end;
}
return url;
};
var tradePartnersInTypeConfig = function (legend) {
return {
chart: {

@ -67,6 +67,9 @@
<button class="btn btn-success" type="button" ng-click="loadTradePartnersInTypes()">
<i class="fa fa-search"></i>
</button>
<a role="button" class="btn btn-primary" ng-href="{{exportAlipayData()}}">
<i class="fa fa-download"></i>Alipay数据导出
</a>
</div>
</div>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

@ -370,11 +370,13 @@
<select class="form-control" ng-change="changePaymentPage()" ng-model="paymentInfo.paypad_version" title="Payment Page">
<option value="v1">v1</option>
<option value="v2">v2</option>
<option value="v3">v3</option>
</select>
</div>
<div class="col-sm-6">
<img style="width: 200px" ng-if="paymentInfo.paypad_version=='v1'" src="/static/images/payment_page_v1.jpg">
<img style="width: 200px" ng-if="paymentInfo.paypad_version=='v2'" src="/static/images/payment_page_v2.jpg">
<img style="width: 200px" ng-if="paymentInfo.paypad_version=='v3'" src="/static/images/payment_page_v3.jpg">
</div>
</div>
</div>

@ -514,6 +514,7 @@
<select class="form-control" ng-change="changePaymentPage()" ng-model="paymentInfo.paypad_version" title="Payment Page">
<option value="v1">v1</option>
<option value="v2">v2</option>
<option value="v3">v3</option>
</select>
</div>
<div class="col-sm-12">
@ -521,6 +522,7 @@
<div class="col-sm-8" style="margin-top: 10px;">
<img style="width: 200px" ng-if="paymentInfo.paypad_version=='v1'" src="/static/images/payment_page_v1.jpg">
<img style="width: 200px" ng-if="paymentInfo.paypad_version=='v2'" src="/static/images/payment_page_v2.jpg">
<img style="width: 200px" ng-if="paymentInfo.paypad_version=='v3'" src="/static/images/payment_page_v3.jpg">
</div>
</div>
</div>

@ -380,33 +380,61 @@ $(function () {
config.initialize(dialog);
}
var ft = $('<div class="weui_dialog_ft"></div>').appendTo(dialogBox);
if ($.isFunction(config.confirm)) {
var yes = $('<a></a>', {
class: 'weui_btn_dialog primary',
text: 'OK',
style: 'background: #108ee9;color: #fff;'
}).appendTo(ft);
yes.click(function () {
config.confirm(dialog, true);
dialog.remove();
});
var no = $('<a></a>', {class: 'weui_btn_dialog default', text: 'Cancel'}).appendTo(ft);
no.click(function () {
config.confirm(dialog, false);
dialog.remove();
})
} else {
var ok = $('<a></a>', {
class: 'weui_btn_dialog primary',
text: 'OK',
style: 'background: #108ee9;color: #fff;'
}).appendTo(ft);
ok.click(function () {
dialog.remove();
})
if(window.paypad_version !== 'v3'){
if ($.isFunction(config.confirm)) {
var yes = $('<a></a>', {
class: 'weui_btn_dialog primary',
text: 'OK',
style: 'background: #108ee9;color: #fff;'
}).appendTo(ft);
yes.click(function () {
config.confirm(dialog, true);
dialog.remove();
});
var no = $('<a></a>', {class: 'weui_btn_dialog default', text: 'Cancel'}).appendTo(ft);
no.click(function () {
config.confirm(dialog, false);
dialog.remove();
})
} else {
var ok = $('<a></a>', {
class: 'weui_btn_dialog primary',
text: 'OK',
style: 'background: #108ee9;color: #fff;'
}).appendTo(ft);
ok.click(function () {
dialog.remove();
})
}
}else{
if ($.isFunction(config.confirm)) {
var yes = $('<a></a>', {
class: 'weui_btn_dialog primary',
text: 'OK',
style: 'background: #FF9705;color: #fff;'
}).appendTo(ft);
yes.click(function () {
config.confirm(dialog, true);
dialog.remove();
});
var no = $('<a></a>', {class: 'weui_btn_dialog default', text: 'Cancel'}).appendTo(ft);
no.click(function () {
config.confirm(dialog, false);
dialog.remove();
})
} else {
var ok = $('<a></a>', {
class: 'weui_btn_dialog primary',
text: 'OK',
style: 'background: #FF9705;color: #fff;'
}).appendTo(ft);
ok.click(function () {
dialog.remove();
})
}
}
dialog.appendTo($('body'));
}
}
});
});

@ -390,33 +390,61 @@ $(function () {
config.initialize(dialog);
}
var ft = $('<div class="weui_dialog_ft"></div>').appendTo(dialogBox);
if ($.isFunction(config.confirm)) {
var yes = $('<a></a>', {
class: 'weui_btn_dialog primary',
text: 'OK',
style: 'background: #0bb20c;color: #fff;'
}).appendTo(ft);
yes.click(function () {
config.confirm(dialog, true);
dialog.remove();
});
var no = $('<a></a>', {class: 'weui_btn_dialog default', text: 'Cancel'}).appendTo(ft);
no.click(function () {
config.confirm(dialog, false);
dialog.remove();
})
if(window.paypad_version !== 'v3'){
if ($.isFunction(config.confirm)) {
var yes = $('<a></a>', {
class: 'weui_btn_dialog primary',
text: 'OK',
style: 'background: #0bb20c;color: #fff;'
}).appendTo(ft);
yes.click(function () {
config.confirm(dialog, true);
dialog.remove();
});
var no = $('<a></a>', {class: 'weui_btn_dialog default', text: 'Cancel'}).appendTo(ft);
no.click(function () {
config.confirm(dialog, false);
dialog.remove();
})
} else {
var ok = $('<a></a>', {
class: 'weui_btn_dialog primary',
text: 'OK',
style: 'background: #0bb20c;color: #fff;'
}).appendTo(ft);
ok.click(function () {
dialog.remove();
})
}
} else {
var ok = $('<a></a>', {
class: 'weui_btn_dialog primary',
text: 'OK',
style: 'background: #0bb20c;color: #fff;'
}).appendTo(ft);
ok.click(function () {
dialog.remove();
})
if ($.isFunction(config.confirm)) {
var yes = $('<a></a>', {
class: 'weui_btn_dialog primary',
text: 'OK',
style: 'background: #FF9705;color: #fff;'
}).appendTo(ft);
yes.click(function () {
config.confirm(dialog, true);
dialog.remove();
});
var no = $('<a></a>', {class: 'weui_btn_dialog default', text: 'Cancel'}).appendTo(ft);
no.click(function () {
config.confirm(dialog, false);
dialog.remove();
})
} else {
var ok = $('<a></a>', {
class: 'weui_btn_dialog primary',
text: 'OK',
style: 'background: #FF9705;color: #fff;'
}).appendTo(ft);
ok.click(function () {
dialog.remove();
})
}
}
dialog.appendTo($('body'));
}
}
});
});

@ -0,0 +1,525 @@
body {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
box-sizing: border-box;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
div, span, p, ul, li {
box-sizing: border-box;
}
.warning-sm{
color:red;
font-size:10px;
transform-origin: left;
transform: scale(0.8);
}
.weui_grid {
padding: 7px;
height: 53px;
}
.ff.key {
position: relative;
}
.ff {
font-size: 26px;
color: #FFFFFF;
}
.ff img {
margin: 10px auto;
display: block;
width: 34px;
}
div.wait {
top: 0;
margin-left: auto;
margin-right: auto;
left: 0;
right: 0;
position: absolute;
vertical-align: middle;
text-align: center;
bottom: 0;
opacity: .5;
background-color: gray;
z-index: 10000;
}
.bisnam {
font-size: 16px;
color: #aaaaaa;
text-align: center;
margin-top: 10px;
}
.rmbcurrency {
font-size: 18px;
color: #FFFFFF;
vertical-align: text-bottom;
line-height: 38px;
}
.static .rmbcurrency {
font-size: 14px;
line-height: 30px;
}
.rmbvalue {
font-size: 24px;
color: #FFFFFF;
vertical-align: text-bottom;
float: right;
}
.rmbvalue:before {
content: '≈¥';
font-size: 16px;
}
.paydetail {
float: right;
margin-top: 5px;
margin-left: 5px;
}
.static .rmbvalue {
font-size: 18px;
}
.currency {
font-size: 24px;
color: #FFFFFF;
/* line-height: 67px; */
vertical-align: text-bottom;
padding-left: 10px;
}
.static .currency {
color: #FFFFFF;
font-size: 25px;
}
.value {
font-size: 60px;
line-height: 66px;
color: #FFFFFF;
margin-left: -5px;
vertical-align: text-bottom;
padding-right: 10px;
}
.static .value {
color: #FFFFFF;
font-size: 24px;
}
input.value {
background: transparent;
border: none;
line-height: 50px;
}
input.value:active {
background: transparent;
}
input.value:focus {
border: none;
outline: none;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
}
.pp {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
overflow-x: hidden;
background-color: #fbf9fe;
}
.new_year {
width:100%;
height:100%;
position:absolute;
top:18%;
left:0;
z-index:-1;
border-radius: 0 0 25px 25px;
}
.bankpay {
text-align: center;
padding: 20px;
color: #FFFFFF;
}
@media screen and (max-height: 520px){
.bankpay {
text-align: center;
padding: 0;
color: #FFFFFF;
}
}
.row {
width: 100%;
padding: 0 20px;
}
.hidden {
display: none;
}
.hide-keyboard-btn {
width: 100%;
}
.hide-keyboard-btn:after {
content: '';
transform: rotate(45deg);
border-right: 2px solid #ccc;
border-bottom: 2px solid #ccc;
width: 30px;
height: 30px;
transform-origin: center;
display: block;
margin: auto;
}
.remark-box.visible {
display: block;
}
.remark-box.visible .remark-input {
font-size: 1.4em;
border: none;
background: #fff;
}
.white-box {
background: #fff;
width: 96%;
margin: 10px auto;
display: block;
position: relative;
padding: 0 10px;
box-sizing: border-box;
}
.white-box.full {
width: 100%;
}
.logo-box .banner {
width: 100%;
display: block;
}
.logo {
margin: auto;
display: block;
margin-top: 20px;
max-height: 60px;
max-width: 80%;
}
.logo-small {
max-height: 100px;
}
.currencyrow {
box-sizing: border-box;
margin-top: 80px;
text-align: center;
margin-bottom: 20px;
}
@media screen and (max-height:670px){
.currencyrow {
box-sizing: border-box;
margin-top: 50px;
text-align: center;
margin-bottom: 20px;
}
}
@media screen and (max-height: 520px){
.currencyrow {
box-sizing: border-box;
margin-top: 20px;
text-align: center;
margin-bottom: 20px;
}
}
.currencyrow:after {
content: '';
display: block;
clear: both;
}
.currencyrow > * {
display: inline-block;
vertical-align: bottom;
margin-bottom: 0;
box-sizing: border-box;
}
.remark-input {
width: 100%;
font-size: 26px;
border-radius: 0;
outline: none;
}
.remark-box {
display: none;
}
.remark-box .remark-mask {
text-align: center;
height: 50px;
font-size: 0.9em;
line-height: 35px;
color: #ccc;
}
.remark-label {
position: absolute;
top: 5px;
right: 5px;
font-size: 20px;
z-index: 1;
font-weight: bold;
color: #0d6aad;
}
.coupons {
width: 100%;
}
.coupons > li {
display: block;
width: 100%;
float: none;
color: #888888;
border-bottom: 1px dashed #aaa;
padding: 5px 0px;
}
.coupons > li:after {
content: '';
clear: both;
display: block
}
.coupons > li:last-child {
border: none;
}
.coupons .title, .coupons .desc, .coupons label {
display: block;
}
.coupons .coupon-content {
display: block;
float: left;
}
.coupons .title {
font-weight: bold;
font-size: 1em;
}
.coupons .use-check {
position: relative;
display: block;
width: 25px;
background-repeat: no-repeat;
height: 25px;
background-size: contain;
float: right;
margin-right: 5px;
margin-top: 10px;
}
.coupons .use-check.checked {
background-image: url(/static/images/checkbox-checked.png);
}
.coupons .use-check.unchecked {
background-image: url(/static/images/checkbox-unchecked.png);
}
.coupons .use-check.disabled {
background-image: url(/static/images/checkbox-disabled.png) !important;
}
.coupons .desc {
font-size: 1em;
}
.weui-wepay-logos {
background: transparent;
}
.row.weui_grids:before, .row.weui_grids .weui_grid:before, .row.weui_grids .weui_grid:after {
display: none;
}
.button_sp_area {
display: block;
position: relative;
margin-top: 10px;
}
.button_sp_area:after {
content: '';
clear: both;
display: block;
}
.button_sp_area a {
height: 50px;
line-height: 50px;
padding: 0px;
font-family: Helvetica;
font-size: 20px;
float: left;
text-align: center;
border-radius: 0;
color: #fff;
}
.button_sp_area .paynow {
width: 65%;
background: #FEB900;
}
.button_sp_area.alipay .paynow {
background-color: #FEB900;
}
.button_sp_area.rpay .paynow {
background-color: #FEB900;
}
.button_sp_area .remark-btn {
width: 35%;
background: #FF9705
}
.pay-brands {
text-align: center;
line-height: 20px;
font-size: 24px;
margin-top: 12px;
color: #dddddd;
}
.pay-brands img {
height: 18px;
}
.pay-brands img.wechat-logo {
height: 14px;
}
.weui_dialog_bd .final {
font-weight: bold;
}
#coupon-box-toggle {
padding: 0 20px;
margin-bottom: 10px;
text-align: right;
color: #30af69;
font-size: 12px;
cursor: pointer;
}
.coupons-container {
position: fixed;
z-index: 1;
top: 0;
left: 0;
right: 0;
bottom: 0;
overflow: auto;
display: none;
}
.coupons-container.show{
display: block;
}
.coupons-container > .coupons-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, .6);
z-index: 1;
}
.coupons-container > .coupon-box {
position: fixed;
z-index: 4;
left: 50%;
top: 50%;
width: 95%;
background: #fff;
padding: 10px;
transform: translate(-50%, -50%);
}
.coupons-container .coupon-box-title{
width: 100%;
display: block;
background: #fff;
padding: 0 10px 5px;
font-size: 14px;
border-bottom: 1px solid #d0d0d0;
}
.coupons-container .coupon-box-title:after{
content: '';
display: block;
clear: both;
}
.coupons-container .coupon-box-title>.title{
float: left;
display: block;
color: #0BB20C;
}
.coupons-container .coupon-box-title>#close-coupon-box{
color: #700;
float: right;
display: block;
cursor: pointer;
}
.actCharity-red{
color: #FB5252;
display: inline;
}
.actCharity{
display: inline;
}
Loading…
Cancel
Save