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

master
eason.qian 7 years ago
commit b9c4d60607

@ -21,7 +21,7 @@ import java.util.List;
* Created by yishuqian on 20/02/2017.
*/
@RestController
@ManagerMapping(role = {ManagerRole.ADMIN,ManagerRole.OPERATOR, ManagerRole.BD_USER,ManagerRole.DIRECTOR,ManagerRole.FINANCIAL_STAFF},
@ManagerMapping(role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.DIRECTOR, ManagerRole.FINANCIAL_STAFF},
value = "/analysis/partner_card", method = RequestMethod.GET)
public class PartnerCardDashboardController {
@ -65,23 +65,18 @@ public class PartnerCardDashboardController {
@RequestMapping("{client_moniker}/settlement_logs")
public JSONObject getPartnerSettlementLog(@PathVariable String client_moniker, TradeLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return partnerCardDashboardService.getSettlementLog(client_moniker,query);
return partnerCardDashboardService.getSettlementLog(client_moniker, query);
}
@RequestMapping("{client_moniker}/login_logs")
public JSONObject getPartnerLoginLog(@PathVariable String client_moniker, ClientLoginLogQueryBean query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return clientLoginLogRepository.listClientLoginLogs(client_moniker,query.getPage(),query.getLimit());
return clientLoginLogRepository.listClientLoginLogs(client_moniker, query.getPage(), query.getLimit());
}
@RequestMapping("/{client_id}/{clearing_data}")
public JSONObject listClearingTransactions(@PathVariable int client_id, @PathVariable String clearing_data){
try {
return cleanService.getCleanLogTransactions(client_id, DateUtils.parseDate(clearing_data, new String[]{"yyyy-MM-dd"}));
}catch (ParseException e){
throw new BadRequestException("error.payment.valid.invalid_date_format");
}
@RequestMapping("/{client_id}/settlement_logs/{detailId}")
public JSONObject listClearingTransactions(@PathVariable int client_id, @PathVariable String detailId) {
return cleanService.getCleanLogTransactions(client_id, detailId);
}
}

@ -31,7 +31,7 @@ public interface CleanService {
JSONObject getCleanLogTransactions(int detailId, JSONObject manager);
JSONObject getCleanLogTransactions(int client_id, Date date);
JSONObject getCleanLogTransactions(int client_id, String detailId);
void settlementCsv(Date dt, HttpServletResponse resp) throws IOException;
@ -58,9 +58,9 @@ public interface CleanService {
List<String> listSettledDatesInMonth(Date mon);
JSONObject listClearingTransactions(int client_id, Date date, JSONObject partner);
JSONObject listClearingTransactions(int client_id, String clearingDetailId, JSONObject partner);
void exportListClearingTransactions(int client_id, Date date, JSONObject partner, HttpServletResponse resp);
void exportListClearingTransactions(int client_id, String clearingDetailId, JSONObject partner, HttpServletResponse resp);
List<JSONObject> getSettlementMonthReport(int year, int monthOfYear);

@ -238,8 +238,8 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
}
@Override
public JSONObject getCleanLogTransactions(int clientId, Date date) {
return settlementSupport.listSettlementTransactionsForClient(clientId, date);
public JSONObject getCleanLogTransactions(int clientId, String clearingDetailId) {
return settlementSupport.listSettlementTransactionsForClient(clientId, clearingDetailId);
}
@Override
@ -596,17 +596,17 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
}
@Override
public JSONObject listClearingTransactions(int client_id, Date date, JSONObject partner) {
public JSONObject listClearingTransactions(int client_id, String clearingDetailId, JSONObject partner) {
JSONObject client = clientManager.getClientInfo(client_id);
Assert.notNull(client);
Assert.notNull(client, "Client not exists");
int parent_client_id = client.getIntValue("parent_client_id");
if (client_id != partner.getIntValue("client_id") && parent_client_id != partner.getIntValue("client_id")) {
throw new ForbiddenException("No Permission");
}
JSONObject clearClient = clearingDetailMapper.listReport(date, client_id);
JSONObject clearClient = clearingDetailMapper.listReport(clearingDetailId, client_id);
if (clearClient == null) {
throw new NotFoundException();
}
@ -624,12 +624,13 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
}
@Override
public void exportListClearingTransactions(int client_id, Date date, JSONObject partner, HttpServletResponse resp) {
public void exportListClearingTransactions(int client_id, String clearingDetailId, JSONObject partner, HttpServletResponse resp) {
OutputStream ous = null;
try {
JSONObject clearTransation = listClearingTransactions(client_id, date, partner);
JSONObject clearTransation = listClearingTransactions(client_id, clearingDetailId, partner);
resp.setContentType("application/octet-stream;");
resp.addHeader("Content-Disposition", "attachment; filename=" + "Merchant_Settlement_Info_" + DateFormatUtils.format(date, "yyyy-MM-dd") + ".xls");
Date reportDate = clearTransation.getDate("report_date");
resp.addHeader("Content-Disposition", "attachment; filename=" + "Merchant_Settlement_Info_" + DateFormatUtils.format(reportDate, "yyyy-MM-dd") + ".xls");
ous = resp.getOutputStream();
HSSFWorkbook wb = new HSSFWorkbook();
Cell cell = null;
@ -638,7 +639,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
font.setFontHeightInPoints((short) 10);
CellStyle analysisStyle = wb.createCellStyle();
analysisStyle.setFont(font);
Sheet sheet = wb.createSheet("Merchant_Settlement_Info_" + DateFormatUtils.format(date, "yyyyMMdd"));
Sheet sheet = wb.createSheet("Merchant_Settlement_Info_" + DateFormatUtils.format(reportDate, "yyyyMMdd"));
int rowNum = 0;
Row row = sheet.createRow(rowNum);
String[] title = {"order Id", "Client Order Id", "Transaction Time", "Channel", "Gateway", "Exchange Rate", "Transaction Type", "Currency",

@ -226,7 +226,7 @@ public class SettleDelayConfigurerImpl implements SettleDelayConfigurer {
continue;
}
String clientMoniker = client.getString("client_moniker");
JSONObject clearing = clearingDetailMapper.listReport(date, clientId);
JSONObject clearing = clearingDetailMapper.listReportByDate(date, clientId);
if (clearing == null) {
continue;
}

@ -15,7 +15,6 @@ import java.text.ParseException;
import java.util.List;
/**
*
* Created by davep on 2016-08-29.
*/
@RestController
@ -27,30 +26,22 @@ public class CleanLogClientController {
@RequestMapping
public List<JSONObject> listMonthCleanLogs(@RequestParam String month, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject client) {
try {
return cleanService.listClientCleanLogsForMonth(DateUtils.parseDate(month, new String[] { "yyyyMM" }), client.getIntValue("client_id"));
return cleanService.listClientCleanLogsForMonth(DateUtils.parseDate(month, new String[]{"yyyyMM"}), client.getIntValue("client_id"));
} catch (ParseException e) {
throw new BadRequestException("error.payment.valid.invalid_date_format");
}
}
@RequestMapping("/{client_id}/{clearing_data}")
public JSONObject listClearingTransactions(@PathVariable int client_id, @PathVariable String clearing_data,
@RequestMapping("/{client_id}/settlement_logs/{clearingDetailId}")
public JSONObject listClearingTransactions(@PathVariable int client_id, @PathVariable String clearingDetailId,
@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) {
try {
return cleanService.listClearingTransactions(client_id, DateUtils.parseDate(clearing_data, new String[] { "yyyy-MM-dd" }), partner);
} catch (ParseException e) {
throw new BadRequestException("error.payment.valid.invalid_date_format");
}
return cleanService.listClearingTransactions(client_id, clearingDetailId, partner);
}
@PartnerMapping("/{client_id}/{clearing_data}/export")
public void exportListClearingTransactions(@PathVariable int client_id, @PathVariable String clearing_data,
@PartnerMapping("/{client_id}/settlement_logs/{clearingDetailId}/export")
public void exportListClearingTransactions(@PathVariable int client_id, @PathVariable String clearingDetailId,
@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, HttpServletResponse resp) {
try {
cleanService.exportListClearingTransactions(client_id,DateUtils.parseDate(clearing_data, new String[] { "yyyy-MM-dd dd:mm:ss","yyyy-MM-dd" }), partner,resp);
} catch (ParseException e) {
throw new BadRequestException("error.payment.valid.invalid_date_format");
}
cleanService.exportListClearingTransactions(client_id, clearingDetailId, partner, resp);
}
// @RequestMapping(value = "/{clearId}.json")

@ -34,7 +34,10 @@ public interface ClearingDetailMapper {
PageList<JSONObject> listReportsOfSettlementLogs(JSONObject params, PageBounds pagination);
@AutoSql(type = SqlType.SELECT)
JSONObject listReport(@Param("report_date") Date report_date, @Param("client_id") int client_id);
JSONObject listReport(@Param("clear_detail_id") String clearDetailId, @Param("client_id") int client_id);
@AutoSql(type = SqlType.SELECT)
JSONObject listReportByDate(@Param("report_date") Date date, @Param("client_id") int clientId);
PageList<JSONObject> listClientSettlementLog(JSONObject params, PageBounds pagination);
}

@ -237,7 +237,8 @@
sum(if(LOCATE('SURCHARGE',t.system_transaction_id),clearing_amount,0)) fee,
(SELECT min(r.rate_value) FROM sys_client_rates r WHERE r.client_id = t.client_id
AND date(r.expiry_time) >= DATE(t.clearing_time)
AND date(r.active_time) <= DATE(t.clearing_time)) rate
AND date(r.active_time) <= DATE(t.clearing_time)) rate,
t.clearing_order clear_detail_id
FROM pmt_transactions t
WHERE t.channel='Settlement'
]]>

@ -358,18 +358,18 @@ define(['angular', 'uiRouter', 'uiBootstrap', 'angularEcharts'], function (angul
// clearingDetailService.clientClearingDetail(client_id, clearData, false)
// };
$scope.getClearingTransactions = function (client_id,clear_date) {
$scope.getClearingTransactions = function (client_id,detail_id) {
$uibModal.open({
templateUrl: '/static/analysis/templates/settlement_transactions.html',
controller: 'managerClearingDetailCtrl',
resolve: {
detail: ['$http', '$stateParams', function ($http) {
return $http.get('/analysis/partner_card/' + client_id+'/'+clear_date);
return $http.get('/analysis/partner_card/' + client_id+'/settlement_logs/'+detail_id);
}]
},
size: 'lg'
});
}
};
$scope.loadLoginLogs = function (page) {
var params = angular.copy($scope.params) || {};

@ -4,7 +4,7 @@
define(['../app'], function (app) {
'use strict';
app.factory('clearingDetailService', ['$uibModal', function ($uibModal) {
function openDetail(url,is_partner) {
function openDetail(url, is_partner) {
$uibModal.open({
templateUrl: '/static/payment/tradelog/templates/partner_settlement_dialog.html',
controller: 'clearingDetailCtrl',
@ -12,19 +12,20 @@ define(['../app'], function (app) {
detail: ['$http', function ($http) {
return $http.get(url);
}],
is_partner:is_partner
is_partner: is_partner
},
size:'lg'
size: 'lg'
})
}
return {
clientClearingDetail: function (client_id,clearing_data,is_partner) {
openDetail('/client/clean_logs/' + client_id+'/'+clearing_data,is_partner);
clientClearingDetail: function (client_id, detailId, is_partner) {
openDetail('/client/clean_logs/' + client_id + '/settlement_logs/' + detailId, is_partner);
}
}
}]);
app.controller('clearingDetailCtrl', ['$scope','detail','is_partner', function ($scope,detail,is_partner) {
app.controller('clearingDetailCtrl', ['$scope', 'detail', 'is_partner', function ($scope, detail, is_partner) {
$scope.ctrl = {channel: null};
$scope.report = detail.data;
$scope.is_partner = is_partner;

@ -147,7 +147,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}]
}
}).state('partners.detail.settlement', {
url: '/settlement/{clientMoniker}',
url: '/settlement',
templateUrl: '/static/payment/partner/templates/partner_settlement.html',
controller: 'partnerSettlementCtrl',
resolve: {
@ -201,7 +201,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.locations = resp.data;
window.merchant_maps.initMap($scope.locations);
});
}
};
$scope.today = new Date();
$scope.listBDUsers = function () {
@ -2448,13 +2448,13 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.pagination = resp.data.pagination;
});
};
$scope.getClearingTransactions = function (client_id, clear_date) {
$scope.getClearingTransactions = function (client_id, detail_id) {
$uibModal.open({
templateUrl: '/static/analysis/templates/settlement_transactions.html',
controller: 'managerClearingDetailCtrl',
resolve: {
detail: ['$http', '$stateParams', function ($http) {
return $http.get('/analysis/partner_card/' + client_id + '/' + clear_date);
return $http.get('/analysis/partner_card/' + client_id + '/settlement_logs/' + detail_id);
}]
},
size: 'lg'

@ -84,7 +84,7 @@
<td>
<a role="button" class="text-bold"
ng-if="(log.clearing_time|limitTo:10) >= '2017-01-12'"
ng-click="getClearingTransactions(log.client_id,(log.clearing_time|limitTo:10))"
ng-click="getClearingTransactions(log.client_id,log.clear_detail_id)"
title="Detail">
<i class="fa fa-list-alt"></i>
</a>

@ -12,7 +12,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
controller: 'partnerSettlementLogCtrl'
})
}]);
app.controller('partnerSettlementLogCtrl', ['$scope','clearingDetailService','$http', '$filter','$sce', function ($scope,clearingDetailService, $http, $filter,$sce) {
app.controller('partnerSettlementLogCtrl', ['$scope', 'clearingDetailService', '$http', '$filter', '$sce', function ($scope, clearingDetailService, $http, $filter, $sce) {
$scope.params = {};
$scope.pagination = {};
$scope.htmlTooltip = $sce.trustAsHtml('<div style="text-align: left;width:350px">' +
@ -90,7 +90,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
});
};
$scope.loadSettlementLogs(1);
var getClientUnClearedAmount = function () {
$http.get('/client/trans_flow/settlement/unclear').then(function (resp) {
$scope.unclear = resp.data;
@ -111,8 +111,8 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.loadSettlementLogs();
};
$scope.getClearingTransactions = function (client_id,clearData) {
clearingDetailService.clientClearingDetail(client_id,clearData,true)
$scope.getClearingTransactions = function (client_id, detailId) {
clearingDetailService.clientClearingDetail(client_id, detailId, true)
}
}]);
return app;

@ -126,10 +126,10 @@
<td ng-bind="log.fee"></td>
<!--<td ng-bind="log.rate"></td>-->
<td>
<a role="button" class="text-bold" ng-if="(log.clearing_time|limitTo:10) >= '2017-01-12'" ng-click="getClearingTransactions(log.client_id,(log.clearing_time|limitTo:10))" title="Detail">
<a role="button" class="text-bold" ng-if="(log.clearing_time|limitTo:10) >= '2017-01-12'" ng-click="getClearingTransactions(log.client_id,log.clear_detail_id)" title="Detail">
<i class="fa fa-list-alt"></i>
</a>
<a ng-href="/client/clean_logs/{{currentUser.client.client_id}}/{{log.clearing_time|limitTo:10}}/export" target="_blank" ng-if="(log.clearing_time|limitTo:10) >= '2017-01-12'" href="/client/clean_logs/{{currentUser.client.client_id}}/{{log.clearing_time|limitTo:10}}/export" title="Download">
<a ng-href="/client/clean_logs/{{currentUser.client.client_id}}/settlement_logs/{{log.clear_detail_id}}/export" target="_blank" ng-if="(log.clearing_time|limitTo:10) >= '2017-01-12'" title="Download">
<i class="fa fa-download"></i>
</a>
</td>

Loading…
Cancel
Save