Merge branch 'hotfix20180306transdownload' into develop

master
yixian 7 years ago
commit 1b0d05c1a7

@ -73,15 +73,10 @@ public class PartnerCardDashboardController {
return clientLoginLogRepository.listClientLoginLogs(client_moniker, query.getPage(), query.getLimit()); return clientLoginLogRepository.listClientLoginLogs(client_moniker, query.getPage(), query.getLimit());
} }
@RequestMapping("/{client_id}/{clearing_data}") @RequestMapping("/{client_id}/settlement_logs/{detailId}")
public JSONObject listClearingTransactions(@PathVariable int client_id, @PathVariable String clearing_data){ public JSONObject listClearingTransactions(@PathVariable int client_id, @PathVariable String detailId) {
try { return cleanService.getCleanLogTransactions(client_id, detailId);
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");
} }
}
} }

@ -627,9 +627,12 @@ public class RetailAppServiceImp implements RetailAppService {
@Override @Override
public void sendNoticeMessage(final NoticeInfo notice, final String[] client_monikers) { public void sendNoticeMessage(final NoticeInfo notice, final String[] client_monikers) {
sendingAppleMsgPool.execute(() -> {
for (String clientMoniker : client_monikers) { for (String clientMoniker : client_monikers) {
JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker);
if(client==null){
continue;
}
sendingAppleMsgPool.execute(() -> {
List<JSONObject> tokens = clientDeviceTokenMapper.listAllTokensByClient_id(client.getIntValue("client_id")); List<JSONObject> tokens = clientDeviceTokenMapper.listAllTokensByClient_id(client.getIntValue("client_id"));
if (tokens != null && tokens.size() > 0) { if (tokens != null && tokens.size() > 0) {
for (JSONObject devToken : tokens) { for (JSONObject devToken : tokens) {
@ -667,9 +670,9 @@ public class RetailAppServiceImp implements RetailAppService {
} }
} }
} }
}
}); });
} }
}
@Override @Override
public void sendCashbackMessage(final String cashbackAmount, final JSONObject order) { public void sendCashbackMessage(final String cashbackAmount, final JSONObject order) {
@ -1032,16 +1035,13 @@ public class RetailAppServiceImp implements RetailAppService {
Boolean isUpdate = PlatformEnvironment.getEnv().isAppUpdate(clientType); Boolean isUpdate = PlatformEnvironment.getEnv().isAppUpdate(clientType);
String updateContent = PlatformEnvironment.getEnv().getAppUpdateContent(clientType); String updateContent = PlatformEnvironment.getEnv().getAppUpdateContent(clientType);
int update_type = 0;// 0:不更新 1更新 2强制更新 int update_type = 0;// 0:不更新 1更新 2强制更新
String[] versionArr = version.split("\\."); String versionInt = version.replace(".","");
String[] newVersionArr = newAppVersion.split("\\."); String newAppVersionInt = newAppVersion.replace(".","");
for (int i = 0; i < newVersionArr.length; i++) { if (Integer.valueOf(versionInt)<Integer.valueOf(newAppVersionInt)){
if (Integer.valueOf(newVersionArr[i]) > Integer.valueOf(versionArr[i])) {
update_type = 1; update_type = 1;
if(isUpdate){ if(isUpdate){
update_type=2; update_type=2;
} }
i = newVersionArr.length + 1;
}
} }
JSONObject res = new JSONObject(); JSONObject res = new JSONObject();
res.put("update_type", update_type); res.put("update_type", update_type);

@ -31,7 +31,7 @@ public interface CleanService {
JSONObject getCleanLogTransactions(int detailId, JSONObject manager); 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; void settlementCsv(Date dt, HttpServletResponse resp) throws IOException;
@ -58,9 +58,9 @@ public interface CleanService {
List<String> listSettledDatesInMonth(Date mon); 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); List<JSONObject> getSettlementMonthReport(int year, int monthOfYear);

@ -238,8 +238,8 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
} }
@Override @Override
public JSONObject getCleanLogTransactions(int clientId, Date date) { public JSONObject getCleanLogTransactions(int clientId, String clearingDetailId) {
return settlementSupport.listSettlementTransactionsForClient(clientId, date); return settlementSupport.listSettlementTransactionsForClient(clientId, clearingDetailId);
} }
@Override @Override
@ -596,17 +596,17 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
} }
@Override @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); JSONObject client = clientManager.getClientInfo(client_id);
Assert.notNull(client); Assert.notNull(client, "Client not exists");
int parent_client_id = client.getIntValue("parent_client_id"); int parent_client_id = client.getIntValue("parent_client_id");
if (client_id != partner.getIntValue("client_id") && parent_client_id != partner.getIntValue("client_id")) { if (client_id != partner.getIntValue("client_id") && parent_client_id != partner.getIntValue("client_id")) {
throw new ForbiddenException("No Permission"); throw new ForbiddenException("No Permission");
} }
JSONObject clearClient = clearingDetailMapper.listReport(date, client_id); JSONObject clearClient = clearingDetailMapper.listReport(clearingDetailId, client_id);
if (clearClient == null) { if (clearClient == null) {
throw new NotFoundException(); throw new NotFoundException();
} }
@ -624,12 +624,13 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
} }
@Override @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; OutputStream ous = null;
try { try {
JSONObject clearTransation = listClearingTransactions(client_id, date, partner); JSONObject clearTransation = listClearingTransactions(client_id, clearingDetailId, partner);
resp.setContentType("application/octet-stream;"); 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(); ous = resp.getOutputStream();
HSSFWorkbook wb = new HSSFWorkbook(); HSSFWorkbook wb = new HSSFWorkbook();
Cell cell = null; Cell cell = null;
@ -638,7 +639,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
font.setFontHeightInPoints((short) 10); font.setFontHeightInPoints((short) 10);
CellStyle analysisStyle = wb.createCellStyle(); CellStyle analysisStyle = wb.createCellStyle();
analysisStyle.setFont(font); 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; int rowNum = 0;
Row row = sheet.createRow(rowNum); Row row = sheet.createRow(rowNum);
String[] title = {"order Id", "Client Order Id", "Transaction Time", "Channel", "Gateway", "Exchange Rate", "Transaction Type", "Currency", 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; continue;
} }
String clientMoniker = client.getString("client_moniker"); String clientMoniker = client.getString("client_moniker");
JSONObject clearing = clearingDetailMapper.listReport(date, clientId); JSONObject clearing = clearingDetailMapper.listReportByDate(date, clientId);
if (clearing == null) { if (clearing == null) {
continue; continue;
} }

@ -15,7 +15,6 @@ import java.text.ParseException;
import java.util.List; import java.util.List;
/** /**
*
* Created by davep on 2016-08-29. * Created by davep on 2016-08-29.
*/ */
@RestController @RestController
@ -33,24 +32,16 @@ public class CleanLogClientController {
} }
} }
@RequestMapping("/{client_id}/{clearing_data}") @RequestMapping("/{client_id}/settlement_logs/{clearingDetailId}")
public JSONObject listClearingTransactions(@PathVariable int client_id, @PathVariable String clearing_data, public JSONObject listClearingTransactions(@PathVariable int client_id, @PathVariable String clearingDetailId,
@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) { @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) {
try { return cleanService.listClearingTransactions(client_id, clearingDetailId, partner);
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");
}
} }
@PartnerMapping("/{client_id}/{clearing_data}/export") @PartnerMapping("/{client_id}/settlement_logs/{clearingDetailId}/export")
public void exportListClearingTransactions(@PathVariable int client_id, @PathVariable String clearing_data, public void exportListClearingTransactions(@PathVariable int client_id, @PathVariable String clearingDetailId,
@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, HttpServletResponse resp) { @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, HttpServletResponse resp) {
try { cleanService.exportListClearingTransactions(client_id, clearingDetailId, partner, resp);
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");
}
} }
// @RequestMapping(value = "/{clearId}.json") // @RequestMapping(value = "/{clearId}.json")

@ -34,7 +34,10 @@ public interface ClearingDetailMapper {
PageList<JSONObject> listReportsOfSettlementLogs(JSONObject params, PageBounds pagination); PageList<JSONObject> listReportsOfSettlementLogs(JSONObject params, PageBounds pagination);
@AutoSql(type = SqlType.SELECT) @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); PageList<JSONObject> listClientSettlementLog(JSONObject params, PageBounds pagination);
} }

@ -5,7 +5,7 @@
<select id="listWithOrderAnalysis" resultType="com.alibaba.fastjson.JSONObject" > <select id="listWithOrderAnalysis" resultType="com.alibaba.fastjson.JSONObject" >
select b.bill_id,b.status,b.currency,DATE_FORMAT(b.create_time,'%Y-%c-%e') create_date, DATE_FORMAT(b.create_time,'%H:%m:%s') create_time,b.remark,b.price,count(o.bill_order_id) order_counts,sum(o.order_total_amount) order_total_amount select b.bill_id,b.status,b.currency,DATE_FORMAT(b.create_time,'%Y-%c-%e') create_date, DATE_FORMAT(b.create_time,'%H:%m:%s') create_time,b.remark,b.price,count(o.bill_order_id) order_counts,sum(o.order_total_amount) order_total_amount
from pmt_bill b left join pmt_bill_order o from pmt_bill b left join pmt_bill_order o
on b.bill_id = o.bill_id and o.order_status &lt; 2 on b.bill_id = o.bill_id and o.order_status = 1
<where> <where>
b.client_id = #{param.client_id} b.client_id = #{param.client_id}
<if test="param.status != null"> <if test="param.status != null">

@ -237,7 +237,8 @@
sum(if(LOCATE('SURCHARGE',t.system_transaction_id),clearing_amount,0)) fee, 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 (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.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 FROM pmt_transactions t
WHERE t.channel='Settlement' WHERE t.channel='Settlement'
]]> ]]>

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

@ -17,9 +17,10 @@ define(['../app'], function (app) {
size: 'lg' size: 'lg'
}) })
} }
return { return {
clientClearingDetail: function (client_id,clearing_data,is_partner) { clientClearingDetail: function (client_id, detailId, is_partner) {
openDetail('/client/clean_logs/' + client_id+'/'+clearing_data,is_partner); openDetail('/client/clean_logs/' + client_id + '/settlement_logs/' + detailId, is_partner);
} }
} }

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

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

@ -111,8 +111,8 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.loadSettlementLogs(); $scope.loadSettlementLogs();
}; };
$scope.getClearingTransactions = function (client_id,clearData) { $scope.getClearingTransactions = function (client_id, detailId) {
clearingDetailService.clientClearingDetail(client_id,clearData,true) clearingDetailService.clientClearingDetail(client_id, detailId, true)
} }
}]); }]);
return app; return app;

@ -126,10 +126,10 @@
<td ng-bind="log.fee"></td> <td ng-bind="log.fee"></td>
<!--<td ng-bind="log.rate"></td>--> <!--<td ng-bind="log.rate"></td>-->
<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> <i class="fa fa-list-alt"></i>
</a> </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> <i class="fa fa-download"></i>
</a> </a>
</td> </td>

Loading…
Cancel
Save