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

master
yuan 7 years ago
commit 6704da48b9

@ -28,4 +28,7 @@ public interface TaskManualSettleMapper {
@AutoSql(type = SqlType.UPDATE)
void update(JSONObject task);
List<JSONObject> getEveryLatestRecord();
}

@ -55,6 +55,8 @@ public interface TransactionMapper {
double getClientUnClearedAmount(@Param("client_id") int clientId);
List<JSONObject> getClientsUnClearedAmount(@Param("client_ids") List<Integer> client_ids);
JSONObject getClientAmountAnalysis(JSONObject params);
PageList<JSONObject> listPreRefundClients(PageBounds pagination);

@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.settlement.core;
import com.alibaba.fastjson.JSONObject;
import java.util.Date;
import java.util.List;
/**
* Create by yixian at 2018-03-20 17:42
@ -13,4 +14,5 @@ public interface ManualSettleSupport {
JSONObject findCurrentSettle(int clientId, boolean includingUnsettleData);
List<JSONObject> listWithClearInfo();
}

@ -19,6 +19,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
@ -122,4 +123,24 @@ public class ManualSettleSupportImpl implements ManualSettleSupport {
}
return end;
}
@Override
public List<JSONObject> listWithClearInfo() {
List<JSONObject> manuals = taskManualSettleMapper.getEveryLatestRecord();
List<Integer> client_ids = new ArrayList<>(manuals.size());
manuals.parallelStream().forEach(p->{
client_ids.add(p.getInteger("client_id"));
});
List<JSONObject> clientUnsettle = transactionMapper.getClientsUnClearedAmount(client_ids);
for (JSONObject manual : manuals) {
for (JSONObject settle : clientUnsettle) {
if (manual.getIntValue("client_id") == settle.getIntValue("client_id")) {
manual.put("unsettle", settle.getBigDecimal("clearing_amount"));
break;
}
}
}
return manuals;
}
}

@ -1,6 +1,7 @@
package au.com.royalpay.payment.manage.system.web;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.settlement.core.ManualSettleSupport;
import au.com.royalpay.payment.manage.system.core.ClientContractService;
import com.alibaba.fastjson.JSONObject;
@ -14,13 +15,24 @@ import java.util.List;
import javax.annotation.Resource;
@RestController
@RequestMapping(value = "/manage/contract")
@RequestMapping(value = "/manage/common/analysis")
public class contractController {
@Resource
private ClientContractService clientContractService;
@Resource
private ManualSettleSupport manualSettleSupport;
@ManagerMapping(value = "/list",method = RequestMethod.GET)
public List<JSONObject> list(){
@ManagerMapping(value = "/contract/list", method = RequestMethod.GET)
public List<JSONObject> contractList() {
return clientContractService.list();
}
@RequestMapping(value = "/manualSettle/list", method = RequestMethod.GET)
public List<JSONObject> manualList() {
List<JSONObject> asd = manualSettleSupport.listWithClearInfo();
System.out.println(asd);
System.out.println(asd);
System.out.println(asd);
return manualSettleSupport.listWithClearInfo();
}
}

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="au.com.royalpay.payment.manage.mappers.payment.TaskManualSettleMapper">
<select id="getEveryLatestRecord" resultType="com.alibaba.fastjson.JSONObject">
SELECT
s.request_time,s.client_id,c.client_moniker
FROM
task_client_manual_settle s
left join sys_clients c on s.client_id = c.client_id
where s.request_time=(select max(B.request_time) from task_client_manual_settle B where s.client_id =B.client_id)
</select>
</mapper>

@ -173,6 +173,16 @@
WHERE clearing_status = 0 AND client_id = #{client_id}
</select>
<select id="getClientsUnClearedAmount" resultType="com.alibaba.fastjson.JSONObject">
SELECT ifnull(sum(if(transaction_type = 'Credit', clearing_amount, -clearing_amount)), 0) clearing_amount,client_id
FROM pmt_transactions
where clearing_status = 0 AND
client_id in
<foreach collection="client_ids" open="(" close=")" separator="," item="item">
#{item}
</foreach>
group by client_id
</select>
<select id="getClientAmountAnalysis" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT

@ -117,7 +117,6 @@
var operation_pause= /*[[${operation_pause}]]*/false;
var cancel_waring= /*[[${cancel_waring}]]*/'';
function is_weixin() {
var ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == "micromessenger") {
@ -135,7 +134,7 @@
} else if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
window.webkit.messageHandlers.appCmd.postMessage({type:'cmd_join_mondelay'});
} else if (/(Android)/i.test(navigator.userAgent)) {
android.appCmd('{\"type\":\"cmd_join_mondelay\",\"cancel_waring\":\"'+cancel_waring+'\"}');
android.appCmd('{\"type\":\"cmd_join_mondelay\"}');
} else {
}
@ -149,7 +148,8 @@
} else if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
window.webkit.messageHandlers.appCmd.postMessage({type:'cmd_cancel_mondelay',cancel_waring:cancel_waring});
} else if (/(Android)/i.test(navigator.userAgent)) {
android.appCmd('{\"type\":\"cmd_cancel_mondelay\",\"cancel_waring\":\"'+cancel_waring+'\"}'); } else {
android.appCmd('{\"type\":\"cmd_cancel_mondelay\",\"cancel_waring\":\"'+cancel_waring+'\"}');
} else {
}

@ -1,5 +1,5 @@
/**
* Created by yishuqian on 01/06/2017.
* Created by kira on 01/06/2017.
*/
define(['angular'], function (angular) {
'use strict';
@ -13,11 +13,15 @@ define(['angular'], function (angular) {
url: '/rate_warnings',
templateUrl: '/static/analysis/templates/settle_warnings.html',
controller: 'settleWarningsCtrl'
}).state('manual_settle', {
url: '/manual_settle',
templateUrl: '/static/analysis/templates/manual_settle.html',
controller: 'manualSettleCtrl'
})
}]);
app.controller('contractAnalysisCtrl', ['$scope', '$http', '$state', '$filter', 'commonDialog', function ($scope, $http, $state, $filter, commonDialog) {
$scope.getContractAnalysis = function () {
$http.get('/manage/contract/list').then(function (resp) {
$http.get('/manage/common/analysis/contract/list').then(function (resp) {
$scope.contract_analysis = resp.data;
});
};
@ -50,5 +54,15 @@ define(['angular'], function (angular) {
}
}]);
app.controller('manualSettleCtrl', ['$scope', '$http', function ($scope, $http) {
$scope.getContractAnalysis = function () {
$http.get('/manage/common/analysis/manualSettle/list').then(function (resp) {
$scope.contract_analysis = resp.data;
});
};
$scope.getContractAnalysis();
}]);
return app;
});

@ -4,9 +4,12 @@
<li ui-sref-active-eq="active" class="active">
<a ui-sref="contract">Contract</a>
</li>
<li ui-sref-active="active">
<li ui-sref-active-eq="active" class="active">
<a ui-sref="rate_warnings">Rate Warings</a>
</li>
<li ui-sref-active-eq="active" class="active">
<a ui-sref="manual_settle">Manual Settle</a>
</li>
</ul>
<div class="modal-body">
<div class="box box-danger">

@ -0,0 +1,38 @@
<div class="modal-header">Contract</div>
<ul class="nav nav-tabs">
<li ui-sref-active-eq="active" class="active">
<a ui-sref="contract">Contract</a>
</li>
<li ui-sref-active-eq="active" class="active">
<a ui-sref="rate_warnings">Rate Warings</a>
</li>
<li ui-sref-active-eq="active" class="active">
<a ui-sref="manual_settle">Manual Settle</a>
</li>
</ul>
<div class="modal-body">
<div class="box box-danger">
<div class="box-header">商户</div>
<div class="box-body table-responsive">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Client Moniker</th>
<th>Unsettled</th>
<th>Latest Record</th>
<th>Record Time</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="contract in manual_settle_analysis">
<td ng-bind="contract.client_moniker"></td>
<td ng-bind="contract.unsettle"></td>
<td ng-bind="contract.latest_clearing"></td>
<td ng-bind="contract.latest_clearing_time|date:'dd/MMM/yyyy'"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
Loading…
Cancel
Save