add 总体重新对账按钮

master
Todking 3 years ago
parent bdf9a89767
commit 4079349402

@ -100,7 +100,7 @@ public interface CleanService {
List<JSONObject> findLogSettleByDate(Date date); List<JSONObject> findLogSettleByDate(Date date);
JSONObject validTransactions(Date date, boolean fix, boolean b, boolean b1); JSONObject validTransactions(Date date, boolean fix, boolean b, boolean b1,boolean isSendMessage);
void distributeBank(Date date, int clearingId, JSONObject bankDistribution); void distributeBank(Date date, int clearingId, JSONObject bankDistribution);

@ -1,6 +1,7 @@
package au.com.royalpay.payment.manage.management.clearing.core.impl; package au.com.royalpay.payment.manage.management.clearing.core.impl;
import au.com.royalpay.payment.core.PaymentApi; import au.com.royalpay.payment.core.PaymentApi;
import au.com.royalpay.payment.core.beans.OrderValidationChannelResult;
import au.com.royalpay.payment.core.beans.OrderValidationResult; import au.com.royalpay.payment.core.beans.OrderValidationResult;
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException; import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
@ -1577,7 +1578,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
} }
@Override @Override
public JSONObject validTransactions(Date dt, boolean fix, boolean b, boolean b1) { public JSONObject validTransactions(Date dt, boolean fix, boolean b, boolean b1, boolean isSendMessage) {
if (!b) { if (!b) {
JSONObject reportItem = validationLogMapper.findByDate(dt); JSONObject reportItem = validationLogMapper.findByDate(dt);
if (reportItem != null) { if (reportItem != null) {
@ -1591,6 +1592,22 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
log.put("result", report.getReport().toJSONString()); log.put("result", report.getReport().toJSONString());
validationLogMapper.removeByDate(dt); validationLogMapper.removeByDate(dt);
validationLogMapper.save(log); validationLogMapper.save(log);
// 是否发送消息通知
if (isSendMessage) {
List<JSONObject> developers = managerMapper.listDetailsByRole(null, ManagerRole.DEVELOPER.getMask());
List<OrderValidationChannelResult> channelResults = report.getChannelResults();
boolean valid = channelResults.stream().map(OrderValidationChannelResult::isSuccess).reduce(Boolean::logicalAnd).orElse(true);
StringBuilder statusString = new StringBuilder("订单校对已完成,状态:" + (valid ? "🌤️【成功】" : "🌨️【失败】"));
statusString.append("\r\n");
for (OrderValidationChannelResult info : channelResults) {
if (info.isSuccess()) {
continue;
}
statusString.append(info.getChannel().getChannelCode()).append(": [ ").append(info.isSuccess() ? "成功" : "失败")
.append(StringUtils.defaultIfBlank(info.getErrorMsg(), "")).append(" ]").append("\r\n");
}
publisher.publishEvent(new TaskFinishNotifyEvent(this, PlatformEnvironment.getEnv().getCompany() + " 订单校对", statusString.toString(), developers, valid));
}
return JSON.parseObject(log.getString("result")); return JSON.parseObject(log.getString("result"));
} }

@ -59,10 +59,11 @@ public class FinancialController {
@GetMapping("/order_validations/{date}") @GetMapping("/order_validations/{date}")
public JSONObject getCheckReport(@PathVariable String date, @RequestParam(defaultValue = "false") boolean fix, public JSONObject getCheckReport(@PathVariable String date, @RequestParam(defaultValue = "false") boolean fix,
@RequestParam(name = "use_cache", defaultValue = "true") boolean useCache) { @RequestParam(name = "use_cache", defaultValue = "true") boolean useCache,
@RequestParam(name = "is_send_message", defaultValue = "false") boolean isSendMessage) {
try { try {
Date dt = DateUtils.parseDate(date, new String[]{"yyyyMMdd"}); Date dt = DateUtils.parseDate(date, new String[]{"yyyyMMdd"});
return cleanService.validTransactions(dt, fix, !useCache, false); return cleanService.validTransactions(dt, fix, !useCache, false,isSendMessage);
} catch (ParseException e) { } catch (ParseException e) {
throw new ParamInvalidException("date", "error.payment.valid.invalid_date_format"); throw new ParamInvalidException("date", "error.payment.valid.invalid_date_format");
} }
@ -97,8 +98,8 @@ public class FinancialController {
@GetMapping("/get/transaction/status/{transactionId}") @GetMapping("/get/transaction/status/{transactionId}")
public TransactionStatus getTransactionStatus(@PathVariable String transactionId) { public TransactionStatus getTransactionStatus(@PathVariable String transactionId) {
if(transactionId.isEmpty()){ if (transactionId.isEmpty()) {
throw new ParamInvalidException("date","Transaction flow is empty"); throw new ParamInvalidException("date", "Transaction flow is empty");
} }
return cleanService.getTransactionStatus(transactionId); return cleanService.getTransactionStatus(transactionId);
} }
@ -114,7 +115,6 @@ public class FinancialController {
, noCache, channel, billType); , noCache, channel, billType);
try (InputStream in = new ByteArrayInputStream(file.content())) { try (InputStream in = new ByteArrayInputStream(file.content())) {
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(file.name(), Charsets.UTF_8.name())); response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(file.name(), Charsets.UTF_8.name()));
response.setContentLength(file.length()); response.setContentLength(file.length());

@ -164,6 +164,25 @@ define(['angular', 'uiRouter'], function () {
$scope.date = angular.copy($stateParams.date) $scope.date = angular.copy($stateParams.date)
$scope.date = $scope.date.substr(0, 4) + '-' + $scope.date.substr(4, 2) + '-' + $scope.date.substr(6) $scope.date = $scope.date.substr(0, 4) + '-' + $scope.date.substr(4, 2) + '-' + $scope.date.substr(6)
$scope.warningLevel = JSON.parse(sessionStorage.getItem('warningLevel')) $scope.warningLevel = JSON.parse(sessionStorage.getItem('warningLevel'))
$scope.validItAgain = function () {
commonDialog
.confirm({
title: 'Confirm reconciliations',
contentHtml: $sce.trustAsHtml('<input type="checkbox" id="isSendMessage">Agree to send push message'),
})
.then(function () {
var isSendMessage = document.getElementById('isSendMessage').checked
$http
.get('/sys/financial/order_validations/' + $stateParams.date, {
params: {
use_cache: false,
is_send_message: isSendMessage,
},
timeout: 300000,
})
.then($scope.startValid())
})
}
// 加载渠道信息 // 加载渠道信息
$scope.startValid = function () { $scope.startValid = function () {
$http $http

@ -10,6 +10,7 @@
<i class="fa fa-check-circle text-green fa-2x" style="margin-left: 24px;" ng-if="warningLevel === 0"></i> <i class="fa fa-check-circle text-green fa-2x" style="margin-left: 24px;" ng-if="warningLevel === 0"></i>
<i class="fa fa-exclamation-triangle text-yellow fa-2x" style="margin-left: 24px;" ng-if="warningLevel === 1"></i> <i class="fa fa-exclamation-triangle text-yellow fa-2x" style="margin-left: 24px;" ng-if="warningLevel === 1"></i>
<i class="fa fa-exclamation-triangle text-red fa-2x" style="margin-left: 24px;" ng-if="warningLevel === 2"></i> <i class="fa fa-exclamation-triangle text-red fa-2x" style="margin-left: 24px;" ng-if="warningLevel === 2"></i>
<button type="button" style="margin-left: 24px" class="btn btn-primary ng-binding ng-scope" ng-click="validItAgain()">Verify it again</button>
</section> </section>
<section class="content"> <section class="content">
<div ng-repeat="(index,item) in channelList"> <div ng-repeat="(index,item) in channelList">

Loading…
Cancel
Save