commit 等待invoice模板

master
luoyang 6 years ago
parent 652c076016
commit f777b4cee4

@ -734,11 +734,11 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
JSONObject client = clientManager.getClientInfo(client_id);
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");
if (partner.get("client_id") != null) {
if (client_id != partner.getIntValue("client_id") && parent_client_id != partner.getIntValue("client_id")) {
throw new ForbiddenException("No Permission");
}
}
JSONObject clearClient = clearingDetailMapper.listReport(clearingDetailId, client_id);
if (clearClient == null) {
throw new NotFoundException();

@ -1,17 +1,16 @@
package au.com.royalpay.payment.manage.management.clearing.web;
import au.com.royalpay.payment.manage.management.clearing.core.CleanService;
import au.com.royalpay.payment.manage.permission.manager.PartnerMapping;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.manage.permission.manager.RequireManager;
import au.com.royalpay.payment.manage.tradelog.beans.ClearingLogQuery;
import au.com.royalpay.payment.tools.CommonConsts;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
@ -44,4 +43,10 @@ public class CleanLogManagementController {
return cleanService.getSettlementLogs(query, manager);
}
@PartnerMapping("/{client_id}/settlement_logs/{clearingDetailId}/export")
public void exportListClearingTransactions(@PathVariable int client_id, @PathVariable String clearingDetailId,
@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject partner, HttpServletResponse resp) {
cleanService.exportListClearingTransactions(client_id, clearingDetailId, partner, resp);
}
}

@ -22,6 +22,4 @@ public interface ClearingDistributedSurchargeMapper {
List<JSONObject> getMonthDetailByClientId(@Param("datefrom") Date datefrom, @Param("dateto") Date dateto);
List<JSONObject> findTransactionsByDate(JSONObject params);
}

@ -27,5 +27,7 @@ public interface FinancialSurchargeAccountDetailMapper {
void update(JSONObject detail);
List<JSONObject> listSettlementDatesInMonth(@Param("month") String month);
List<JSONObject> listSettlementDatesByClientId(@Param("client_id") int client_id);
}

@ -287,6 +287,8 @@ public interface ClientManager {
List<JSONObject> getAccountTransactions(JSONObject account,String clientMoniker);
List<JSONObject> getAccountDetailByMonths(JSONObject account,String clientMoniker);
List<JSONObject> getAccountTransactionsByDate(JSONObject account,String clientMoniker, String date);
List<JSONObject> getAccountMonthDetails(JSONObject account,String clientMoniker);

@ -3440,6 +3440,15 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return transactions;
}
@Override
public List<JSONObject> getAccountDetailByMonths(JSONObject account, String clientMoniker) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
return financialSurchargeAccountDetailMapper.listSettlementDatesByClientId(client.getIntValue("client_id"));
}
@Override
public List<JSONObject> getAccountTransactionsByDate(JSONObject account, String clientMoniker, String date) {
JSONObject client = getClientInfoByMoniker(clientMoniker);

@ -195,6 +195,18 @@ public class PartnerViewController {
return clientManager.getAccountTransactions(manager, clientMoniker);
}
@PartnerMapping(value = "/{clientMoniker}/account/transactions/date", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER})
@ResponseBody
public List<JSONObject> accountTransactionsByDate(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject manager, @PathVariable String clientMoniker,@RequestParam String date) {
return clientManager.getAccountTransactionsByDate(manager, clientMoniker, date);
}
@PartnerMapping(value = "/{clientMoniker}/account/months", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER})
@ResponseBody
public List<JSONObject> getAccountDetailByMonths(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject manager, @PathVariable String clientMoniker){
return clientManager.getAccountDetailByMonths(manager, clientMoniker);
}
@PartnerMapping(value = "/accounts/{accountId}/audit_refund", method = RequestMethod.PUT, roles = PartnerRole.ADMIN)
@ResponseBody
public void toggleAccountAuditRefund(@PathVariable String accountId, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject enable) {

@ -4,6 +4,7 @@
<select id="getMonthDetailByClientId" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT d.client_id,c.client_moniker,c.company_name,
SUM(IF(d.type='Debit',total_surcharge,-total_surcharge)) total_surcharge,
SUM(IF(d.type='Credit',amount,0)) credit_amount,
SUM(IF(d.type='Debit',amount,0)) debit_amount,
SUM(IF(d.type='Debit',total_surcharge,0)) total_surcharge

@ -20,8 +20,19 @@
SELECT d.*,c.client_moniker,c.short_name,c.company_name,s.balance
FROM financial_surcharge_account_detail d INNER JOIN sys_clients c ON c.client_id=d.client_id
LEFT JOIN sys_clients_surcharge_accounts s ON s.client_id = d.client_id
WHERE d.settle_month= #{month}
WHERE
d.settle_month= #{month}
ORDER BY s.balance ASC
]]>
</select>
<select id="listSettlementDatesByClientId" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT d.*,c.client_moniker,c.short_name,c.company_name,s.balance
FROM financial_surcharge_account_detail d INNER JOIN sys_clients c ON c.client_id=d.client_id
LEFT JOIN sys_clients_surcharge_accounts s ON s.client_id = d.client_id
WHERE
s.client_id = #{client_id}
ORDER BY s.create_time DESC
]]>
</select>
</mapper>

@ -608,6 +608,11 @@ margin-bottom: 10%;"/>
<i class="fa fa-tv"></i> <span>商户欠款|Pre Refund</span>
</a>
</li>
<li ui-sref-active="active">
<a ui-sref="surcharge_account_month">
<i class="fa fa-bell"></i> <span>后付费收款</span>
</a>
</li>
</ul>
</li>

@ -821,6 +821,16 @@
</div>
</a>
</div>
<div class="col-sm-2 col-xs-6">
<a ui-sref="surcharge_account_month" ui-sref-opts="{reload:true}">
<div class="description-block">
<img src="/static/images/main_menu/compliance_warning.png"/>
<div class="description-text">
<span>后付费收款</span>
</div>
</div>
</a>
</div>
</div>
</div>
<div class="list-group" ng-if="role=='accountant' || role=='director' || ('1000000000'|withRole)">

@ -21,18 +21,16 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
controller: 'surchargeAccountMonthCtrl'
})
}]);
app.controller('clientSurchargeAccountCtrl', ['$scope', '$http','$state','$filter', 'commonDialog','partner', function ($scope, $http,$state,$filter, commonDialog, partner) {
app.controller('clientSurchargeAccountCtrl', ['$scope', '$http','$state','$filter', 'commonDialog','partner','$uibModal', function ($scope, $http,$state,$filter, commonDialog, partner,$uibModal) {
$scope.partner = angular.copy(partner.data);
$scope.getBalance = function () {
$scope.surcharge = {};
if ($scope.partner.surcharge_mode != undefined && $scope.partner.surcharge_mode == "distributed") {
$http.get('/client/partner_info/' + $scope.partner.client_moniker + '/surcharge_account').then(function (resp) {
$scope.surcharge = resp.data;
})
}
};
@ -45,6 +43,32 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
$scope.getBalance();
$scope.getTransactions();
$scope.getDetailByMonths = function () {
$http.get('/client/partner_info/' + $scope.partner.client_moniker + '/account/months').then(function (resp) {
$scope.report = resp.data;
})
};
$scope.getDetailByMonths();
$scope.surchargeAccountDetail = function (client_moniker,mon) {
$uibModal.open({
templateUrl: '/static/payment/surchargeaccount/templates/client_surcharge_account_dialog.html',
controller: 'accountDetailCtrl',
size: 'lg',
resolve: {
client_moniker: function () {
return client_moniker;
},
month: function () {
return mon;
},
transactions: ['$http', function ($http) {
return $http.get('/client/partner_info/' + client_moniker + '/account/transactions/date?date=' + mon);
}]
}
});
};
}]);
app.controller('surchargeAccountMonthCtrl', ['$scope', '$http', '$filter', '$timeout', '$uibModal', 'commonDialog', 'chartParser','$sce',
@ -96,19 +120,6 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
$scope.loadReport($scope.report.month);
});
};
$scope.openClientBoard = function (client) {
$uibModal.open({
templateUrl: '/static/analysis/templates/partner_card.html',
controller: 'partnerCardCtrl',
resolve: {
clientMoniker: function () {
return client.client_moniker
}
},
size: 'lg'
})
};
$scope.fillMonthsSurcharge = function (details) {
var contentHtml = $sce.trustAsHtml('即将为[' + details.short_name + ']冲正,<span style="color: red">请确认商户信息</span>');

@ -46,9 +46,10 @@
<tr>
<th>商户编号</th>
<th>Short Name</th>
<th>Total Surcharge</th>
<th>充值总额</th>
<th>支出总额</th>
<th>结清</th>
<th>是否结清</th>
<!--<th>余额</th>-->
<th>操作</th>
</tr>
@ -57,10 +58,11 @@
<tr ng-repeat="details in report.details">
<td style="vertical-align:middle">
<a class="text-primary" role="button" title="Detail"
ng-click="openClientBoard(details)">
ui-sref="partners.detail({clientMoniker:details.client_moniker})">
<span ng-bind="details.client_moniker"></span></a>
</td>
<td ng-bind="details.short_name" style="vertical-align:middle"></td>
<td ng-bind="details.total_surcharge | currency:'$'"></td>
<td ng-bind="details.credit_amount|currency:'$'" style="color: green;vertical-align:middle" ></td>
<td ng-bind="details.debit_amount|currency:'$'" style="color: red;vertical-align:middle"></td>
<td style="vertical-align:middle">

@ -1,4 +1,3 @@
<section class="content-header">
<h1>
Client Surcharge Account
@ -14,40 +13,31 @@
<div class="box box-warning">
<div class="box-header">
<div class="form-horizontal col-sm-8" style="margin-top: 30px">
<div class="form-group" ng-if="partner.surcharge_mode=='distributed'">
<div class="form-group">
<label class="control-label col-xs-4 col-sm-3">手续费账户余额</label>
<div class="col-sm-6" style="font-size: 25px">
<p>{{surcharge.balance|currency:'AUD'}}</p>
</div>
</div>
<!--<div class="form-group" ng-if="partner.surcharge_mode=='distributed'">-->
<!--<label class="control-label col-xs-4 col-sm-3">允许手续费账户欠款</label>-->
<!--<div class="col-sm-6">-->
<!--<input type="checkbox" ng-model="partner.allow_surcharge_credit" bs-switch-->
<!--switch-change="allowSurchargeCredit(partner.allow_surcharge_credit)" switch-readonly="true">-->
<!--</div>-->
<!--<label class="control-label col-xs-4 col-sm-3">允许手续费账户欠款</label>-->
<!--<div class="col-sm-6">-->
<!--<input type="checkbox" ng-model="partner.allow_surcharge_credit" bs-switch-->
<!--switch-change="allowSurchargeCredit(partner.allow_surcharge_credit)" switch-readonly="true">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-xs-4 col-sm-3" style="padding-top:0px">Surcharge Mode:</label>-->
<!--<div class="col-xs-8 col-sm-6">-->
<!--<span class="control-label" ng-bind="partner.surcharge_mode"></span>-->
<!--<p class="text-info">-->
<!--<i class="fa fa-info"></i>启用到收支分离(distributed)模式,将使消费者支付手续费模式失效-->
<!--</p>-->
<!--</div>-->
<!--<label class="control-label col-xs-4 col-sm-3" style="padding-top:0px">Surcharge Mode:</label>-->
<!--<div class="col-xs-8 col-sm-6">-->
<!--<span class="control-label" ng-bind="partner.surcharge_mode"></span>-->
<!--<p class="text-info">-->
<!--<i class="fa fa-info"></i>启用到收支分离(distributed)模式,将使消费者支付手续费模式失效-->
<!--</p>-->
<!--</div>-->
<!--</div>-->
</div>
<div class="col-sm-4" style="text-align: center" ng-if="code_url">
<a class="thumbnail" download ng-href="{{code_url}}" uib-tooltip="Download">
<img ng-src="{{code_url}}">
</a>
<p>
<a ng-href="{{code_url}}" download><i class="fa fa-download"></i> Download Bill QR
Code Image</a>
</p>
</div>
</div>
</div>
<div class="box">
@ -112,3 +102,46 @@
</div>
</div>
</div>
<section class="content-header">
<h1>
每月手续费
</h1>
</section>
<div class="content">
<div class="row">
<div class="box box-warning">
<div class="box-body">
<div class="table-responsive col-sm-12">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>清算月份</th>
<th>Total Surcharge</th>
<th>支出总额</th>
<th>是否结清</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="details in report">
<td ng-bind="details.settle_month"></td>
<td ng-bind="details.total_surcharge | currency:'$'"></td>
<td ng-bind="details.debit_amount|currency:'$'"
style="color: red;vertical-align:middle"></td>
<td style="vertical-align:middle">
<span ng-if="details.is_valid">已结清</span>
<span ng-if="!details.is_valid">未付款</span>
</td>
<td style="vertical-align:middle">
<i class="fa fa-bars"
style="font-size: 15px;color: #3c8dbc;cursor: pointer;padding-left: 15px"
ng-click="surchargeAccountDetail(details.client_moniker,details.settle_month)"></i>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>

@ -0,0 +1,39 @@
<div class="modal-header">
<h4>Surcharge Account Detail{{partner.client_moniker?'('+partner.client_moniker+')':''}}</h4>
</div>
<div class="modal-body">
<div class="box box-default">
<div class="box-header">Debits</div>
<div class="box-body">
<div class="table-responsive col-sm-12">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Num</th>
<th>Settle Date</th>
<th>Amount</th>
<th>Total Surcharge</th>
<th>Tax Amount</th>
<th>Remark</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="tr in transactions|propsFilter:{type:'Debit'}:true">
<td>{{$index+1}}</td>
<td ng-bind="tr.settle_date|date:'yyyy-MM-dd'"></td>
<td ng-bind="tr.amount|currency:'AUD'"></td>
<td ng-bind="tr.total_surcharge|currency:'AUD'"></td>
<td ng-bind="tr.tax_amount|currency:'AUD'"></td>
<td>
{{tr.remark}}
<a ng-href="/client/clean_logs/{{tr.client_id}}/settlement_logs/{{tr.clearing_detail_id}}/export" target="_blank" title="Download">
<i class="fa fa-download"></i>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>

@ -78,7 +78,12 @@
<td ng-bind="tr.amount|currency:'AUD'"></td>
<td ng-bind="tr.total_surcharge|currency:'AUD'"></td>
<td ng-bind="tr.tax_amount|currency:'AUD'"></td>
<td ng-bind="tr.remark"></td>
<td>
{{tr.remark}}
<a ng-href="/sys/clean_logs/{{tr.client_id}}/settlement_logs/{{tr.clearing_detail_id}}/export" target="_blank" title="Download">
<i class="fa fa-download"></i>
</a>
</td>
</tr>
</tbody>
</table>

Loading…
Cancel
Save