master
wangning 6 years ago
commit ad6243d386

@ -21,6 +21,7 @@ public class AppPermissionSupportImpl implements AppPermissionSupport {
private SysAppsMapper sysAppsMapper;
private final String signTemplate = "%s&%s&%s&%s&%s";
private Logger logger = LoggerFactory.getLogger(getClass());
public static final String[] NODES_IP_ADDRESSS = new String[]{"119.28.3.196","150.109.64.108", "119.28.178.24", "119.28.24.146", "119.28.77.25"};
@Override
public JSONObject validateSign(String appid, long timestamp, String ip, String requestUri, String sign) {
@ -44,6 +45,15 @@ public class AppPermissionSupportImpl implements AppPermissionSupport {
logger.debug("sso-str before hash:" + str);
String hash = DigestUtils.sha256Hex(str).toLowerCase();
if (!StringUtils.equals(hash, sign)) {
logger.error("[{}]请求的签名有误,使用节点 [{}] 签名", appid, NODES_IP_ADDRESSS.toString());
for (String nodeIp : NODES_IP_ADDRESSS) {
str = String.format(signTemplate, appid, auth, timestamp, requestUri, nodeIp);
logger.debug("NodeIp check sso-str before hash:" + str);
hash = DigestUtils.sha256Hex(str).toLowerCase();
if (StringUtils.equals(hash, sign)) {
return app;
}
}
throw new ForbiddenException("InvalidSign");
}
return app;

@ -198,7 +198,6 @@
<select id="listCustomersData" resultType="com.alibaba.fastjson.JSONObject">
SELECT o.customer_id,sum(if(t.transaction_type='Credit',t.clearing_amount,0)) amount,
sum(if(t.transaction_type='Credit',t.clearing_amount div 10,0)) points,
COUNT(DISTINCT o.order_id) orders,max(t.clearing_amount) max_order
FROM pmt_orders o
INNER JOIN pmt_transactions t on t.order_id=o.order_id and t.system_generate=0 and (t.transaction_type='Credit' or t.transaction_type>0)
@ -224,12 +223,11 @@
<if test="org_ids!=null">and o.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
</where>
GROUP BY o.customer_id ORDER BY points desc
GROUP BY o.customer_id
</select>
<select id="listCustomersDataAnalysis" resultType="com.alibaba.fastjson.JSONObject">
SELECT sum(if(t.transaction_type='Credit',t.clearing_amount,0)) total_amount,
sum(if(t.transaction_type='Credit',t.clearing_amount div 10,0)) total_points
SELECT sum(if(t.transaction_type='Credit',t.clearing_amount,0)) total_amount
FROM pmt_orders o
INNER JOIN pmt_transactions t on t.order_id=o.order_id and t.system_generate=0 and (t.transaction_type='Credit' or t.refund_id is not null)
<where>

@ -148,6 +148,7 @@ define(['angular', 'static/commons/commons', 'static/commons/angular-ueditor', '
// $scope.analysis = resp.data.analysis;
});
};
$scope.chooseToday();
$scope.orderDetail = function (order) {
orderService.managerOrderDetail(order)

@ -90,8 +90,8 @@
<div class="box">
<div class="box-header">
<h3 class="box-title">Customer List</h3>
<small>Total Amount:{{customers_analysis.total_amount}},Total
Points:{{customers_analysis.total_points}}
<small>Total Amount:{{customers_analysis.total_amount}}<!--,Total
Points:{{customers_analysis.total_points}}-->
</small>
</div>
@ -101,7 +101,7 @@
<tr>
<th>Customer openId</th>
<th>Amount(AUD)</th>
<th>Points</th>
<!-- <th>Points</th>-->
<th>Orders</th>
<th>Max Order(AUD)</th>
</tr>
@ -112,7 +112,7 @@
ng-click="order_params.customer_id=customer.customer_id;listCustomerOrders()">
<td ng-bind="customer.customer_id"></td>
<td ng-bind="customer.amount"></td>
<td ng-bind="customer.points"></td>
<!-- <td ng-bind="customer.points"></td>-->
<td ng-bind="customer.orders"></td>
<td ng-bind="customer.max_order"></td>
</tr>

Loading…
Cancel
Save