商户端增加require_remark,require_custinfo开关设置,Dashboard优化,修改bug

master
yuan 6 years ago
parent c1518c0d78
commit 4c66cb13b7

@ -152,14 +152,6 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
return res;
}
private JSONObject getSevenOrMonth(JSONObject params, JSONObject today){
JSONObject res = new JSONObject();
res.put("traded_partners", clientCustomersMapper.countTradedClients(params) + clientAnalysisMapper.countNewClients(today));
res.put("total_customers", clientCustomersMapper.countTotalCustomers(params) + clientAnalysisMapper.countClients(today));
res.put("old_customers", clientCustomersMapper.countTotalOldCustomers(params) + clientAnalysisMapper.countTradedPartners(params));
return res;
}
@Override
public List<JSONObject> getTradeInTypes(JSONObject params) {
return transactionAnalysisMapper.getTradeAmountInTypes(params);
@ -540,7 +532,7 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
}*/
@Override
public JSONObject getPlatformAmount(JSONObject params) {
String jsonStr = stringRedisTemplate.boundValueOps("org_ChannelAnalysis" + params.getString("begin")).get();
String jsonStr = stringRedisTemplate.boundValueOps("org_ChannelAnalysis" + params.getString("org_id")+params.getString("begin")).get();
JSONObject channelAnalysis = JSONObject.parseObject(jsonStr);
if(channelAnalysis != null){
return channelAnalysis;
@ -555,7 +547,7 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
}else {
resp = customerAndOrdersStatisticsMapper.getChannelCommonCount(params);
}
stringRedisTemplate.boundValueOps("org_ChannelAnalysis"+ params.getString("begin")).set(resp.toJSONString(), 5, TimeUnit.MINUTES);
stringRedisTemplate.boundValueOps("org_ChannelAnalysis"+ params.getString("org_id")+params.getString("begin")).set(resp.toJSONString(), 5, TimeUnit.MINUTES);
return resp;
}
}

@ -242,6 +242,10 @@ public interface ClientManager {
void changeRetailPaySurcharge(JSONObject account, boolean paySurcharge);
void changeRequireCustinfo(JSONObject account, boolean requireCustinfo);
void changeRequireRemark(JSONObject account, boolean requireRemark);
void changeSurcharge(JSONObject account,JSONObject device, UpdateSurchargeDTO updateSurchargeDTO);
void refusePartner(String clientMoniker, JSONObject manager, String refuse_remark);

@ -2933,6 +2933,30 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
.processClientConfigModify(new SwitchPermissionModify(account, client.getString("client_moniker"), "retail_surcharge", paySurcharge));
}
@Override
public void changeRequireCustinfo(JSONObject account, boolean requireCustinfo) {
int clientId = account.getIntValue("client_id");
JSONObject client = getClientInfo(clientId);
if (client == null) {
throw new InvalidShortIdException();
}
clientModifySupport
.processClientConfigModify(new SwitchPermissionModify(account, client.getString("client_moniker"), "require_custinfo", requireCustinfo));
}
@Override
public void changeRequireRemark(JSONObject account, boolean requireRemark) {
int clientId = account.getIntValue("client_id");
JSONObject client = getClientInfo(clientId);
if (client == null) {
throw new InvalidShortIdException();
}
clientModifySupport
.processClientConfigModify(new SwitchPermissionModify(account, client.getString("client_moniker"), "require_remark", requireRemark));
}
@Override
public void changeSurcharge(JSONObject account, JSONObject device, UpdateSurchargeDTO updateSurchargeDTO) {
JSONObject client = clientMapper.findClient(device.getIntValue("client_id"));

@ -342,6 +342,18 @@ public class PartnerViewController {
clientManager.changeRetailPaySurcharge(account, pass.getBooleanValue("retail_surcharge"));
}
@PartnerMapping(value = "/require_custinfo", method = RequestMethod.PUT)
@ResponseBody
public void changeRequireCustinfo(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
clientManager.changeRequireCustinfo(account, pass.getBooleanValue("require_custinfo"));
}
@PartnerMapping(value = "/require_remark", method = RequestMethod.PUT)
@ResponseBody
public void changeRequireRemark(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
clientManager.changeRequireRemark(account, pass.getBooleanValue("require_remark"));
}
@PartnerMapping(value = "/sign_events", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER})
@ResponseBody

@ -316,6 +316,7 @@
ifnull(sum(CASE WHEN s.channel = 'AlipayOnline' THEN s.total ELSE 0 END),0) alipayonlineamount,
ifnull(sum(CASE WHEN s.channel = 'AlipayOnline' THEN s.orders ELSE 0 END),0) alipayonline_order_count
FROM statistics_customer_order s
LEFT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1
]]>
<where>
s.client_id != 0
@ -403,7 +404,9 @@
and s.client_id=#{client_id}
</if>
<if test="channel!=null">and s.channel = #{channel}</if>
<if test="org_id!=null">and c.org_id = #{org_id}</if>
<if test="org_id!=null and org_ids==null">and c.org_id=#{org_id}</if>
<if test="org_ids!=null">and c.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<if test="bd_group!=null">and c.client_id in
(SELECT b.client_id FROM sys_client_bd b
INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id

@ -45,29 +45,41 @@
</update>
<select id="countTradedClients" resultType="java.lang.Integer">
select COUNT(DISTINCT client_id) traded_clients
FROM sys_clients_customers
select COUNT(DISTINCT s.client_id) traded_clients
FROM sys_clients_customers s
LEFT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1
<where>
<if test="begin!=null">and last_payment_time &gt;= #{begin}</if>
<if test="end!=null">and last_payment_time &lt;= #{end}</if>
<if test="begin!=null">and s.last_payment_time &gt;= #{begin}</if>
<if test="end!=null">and s.last_payment_time &lt;= #{end}</if>
<if test="org_id!=null and org_ids==null">and c.org_id=#{org_id}</if>
<if test="org_ids!=null">and c.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
</where>
</select>
<select id="countTotalCustomers" resultType="java.lang.Integer">
select COUNT(DISTINCT customer_id) total_customers
FROM sys_clients_customers
select COUNT(DISTINCT s.customer_id) total_customers
FROM sys_clients_customers s
LEFT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1
<where>
<if test="begin!=null">and last_payment_time &gt;= #{begin}</if>
<if test="end!=null">and last_payment_time &lt;= #{end}</if>
<if test="begin!=null">and s.last_payment_time &gt;= #{begin}</if>
<if test="end!=null">and s.last_payment_time &lt;= #{end}</if>
<if test="org_id!=null and org_ids==null">and c.org_id=#{org_id}</if>
<if test="org_ids!=null">and c.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
</where>
</select>
<select id="countTotalOldCustomers" resultType="java.lang.Integer">
select COUNT(DISTINCT customer_id) total_old_customers
FROM sys_clients_customers
select COUNT(DISTINCT s.customer_id) total_old_customers
FROM sys_clients_customers s
LEFT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1
<where>
<if test="begin!=null">and update_time &lt; #{begin} AND last_payment_time &gt; #{begin}</if>
<if test="end!=null">and last_payment_time &lt; #{end}</if>
<if test="begin!=null">and s.update_time &lt; #{begin} AND s.last_payment_time &gt; #{begin}</if>
<if test="end!=null">and s.last_payment_time &lt; #{end}</if>
<if test="org_id!=null and org_ids==null">and c.org_id=#{org_id}</if>
<if test="org_ids!=null">and c.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
</where>
</select>
</mapper>

@ -627,6 +627,42 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct
})
})
}
$scope.toggleRequireCustInfo = function () {
if (!$scope.paymentInfo) {
return;
}
if (!$scope.ctrl.require_custinfo) {
$scope.ctrl.require_custinfo = true;
return;
}
$http.put('/client/partner_info/require_custinfo', {require_custinfo: $scope.paymentInfo.require_custinfo}).then(function () {
}, function (resp) {
commonDialog.alert({
title: 'failed to change require customer Info permission status',
content: resp.data.message,
type: 'error'
})
})
};
$scope.toggleRequireRemark = function () {
if (!$scope.paymentInfo) {
return;
}
if (!$scope.ctrl.require_remark) {
$scope.ctrl.require_remark = true;
return;
}
$http.put('/client/partner_info/require_remark', {require_remark: $scope.paymentInfo.require_remark}).then(function () {
}, function (resp) {
commonDialog.alert({
title: 'failed to change require remark permission status',
content: resp.data.message,
type: 'error'
})
})
};
}]);
app.controller('clientPaymentMaterialCtrl', ['$scope', '$http', 'partner', function ($scope, $http, partner) {
$scope.paymentInfo = partner.data;

@ -145,6 +145,28 @@
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Order Config</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group" ng-if="'111'|withRole">
<label class="col-sm-2 control-label">Require Customer Information</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.require_custinfo" bs-switch
switch-change="toggleRequireCustInfo()">
</div>
</div>
<div class="form-group" ng-if="'111'|withRole">
<label class="col-sm-2 control-label">Require Remark</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.require_remark" bs-switch
switch-change="toggleRequireRemark()">
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Payment Page</div>
<div class="panel-body">

Loading…
Cancel
Save