master
wangning 7 years ago
commit 808cbc40b6

@ -543,4 +543,10 @@ alter table sys_client_pre_apply add COLUMN `client_moniker` varchar(20) DEFAULT
alter table sys_client_pre_apply modify COLUMN `agree` tinyint(1) DEFAULT 0;
insert into `royalpay_production`.`sys_configs` ( `config_key`, `config_value`) values ( 'royalpayindustry.json', '[{"children":[{"children":[],"label":"机票","mccCode":"10001"},{"children":[],"label":"旅游行业","mccCode":"10002"},{"children":[],"label":"私人定制旅游","mccCode":"10003"},{"children":[],"label":"租车","mccCode":"10004"},{"children":[],"label":"巴士","mccCode":"10005"}],"label":"旅游出行","mccCode":"1"},{"children":[{"children":[],"label":"饭店","mccCode":"20001"},{"children":[],"label":"奶茶店","mccCode":"20002"},{"children":[],"label":"烧烤","mccCode":"20003"},{"children":[],"label":"火锅","mccCode":"20004"},{"children":[],"label":"Coffee","mccCode":"20005"},{"children":[],"label":"酒吧","mccCode":"20006"}],"label":"餐饮","mccCode":"2"},{"children":[{"children":[],"label":"培训类","mccCode":"30001"},{"children":[],"label":"移民留学","mccCode":"30002"},{"children":[],"label":"私人幼儿园","mccCode":"30003"}],"label":"教育","mccCode":"3"},{"children":[{"children":[],"label":"换汇","mccCode":"40001"},{"children":[],"label":"房产","mccCode":"40002"}],"label":"商务咨询","mccCode":"4"},{"children":[{"children":[],"label":"公众号服务商","mccCode":"50001"},{"children":[],"label":"各种媒体类宣传","mccCode":"50002"}],"label":"传媒","mccCode":"5","value":"{\"category\":\"SERVICE\",\"code\":\"7542\",\"description\":\"Car Washes\",\"parentCode\":\"S10\"}"},{"children":[{"children":[],"label":"美容院","mccCode":"60001"},{"children":[],"label":"医疗美容","mccCode":"60002"}],"label":"医美","mccCode":"6"},{"children":[{"label":"超市","mccCode":"70001"},{"children":[],"label":"服装店","mccCode":"70002"},{"children":[],"label":"鞋店","mccCode":"70003"},{"children":[],"label":"珠宝店","mccCode":"70004"},{"children":[],"label":"箱包","mccCode":"70005"}],"label":"零售","mccCode":"7"},{"children":[{"children":[],"label":"桌游吧","mccCode":"80001"},{"children":[],"label":"演唱会","mccCode":"80002"},{"children":[],"label":"马术训练","mccCode":"80003"},{"children":[],"label":"瑜伽","mccCode":"80004"},{"children":[],"label":"健身","mccCode":"80005"},{"children":[],"label":"社团","mccCode":"80006"},{"children":[],"label":"网吧","mccCode":"80007"},{"children":[],"label":"KTV","mccCode":"80008"},{"children":[],"label":"电影","mccCode":"80009"}],"label":"休闲娱乐","mccCode":"8"},{"children":[{"children":[],"label":"摄影","mccCode":"90001"},{"children":[],"label":"massage","mccCode":"90002"},{"children":[],"label":"通讯运营商","mccCode":"90003"},{"children":[],"label":"车行","mccCode":"90004"},{"children:":[],"label":"软件服务","mccCode":"90005"}],"label":"其他服务类","mccCode":"9"},{"children":[{"children":[],"label":"Hotel","mccCode":"100001"},{"children":[],"label":"Motel","mccCode":"100002"}],"label":"酒店","mccCode":"10"},{"children":[{"children":[],"label":"代购","mccCode":"110001"},{"children":[],"label":"物流(大宗出口贸易)","mccCode":"110002"},{"children":[],"label":"红酒出口","mccCode":"110003"},{"children":[],"label":"综合电商","mccCode":"110004"}],"label":"出口贸易","mccCode":"11"},{"children":[{"children":[],"label":"建材","mccCode":"120001"},{"children":[],"label":"家居","mccCode":"120002"}],"label":"家居建材","mccCode":"12"}]');
insert into `royalpay_production`.`sys_configs` ( `config_key`, `config_value`) values ( 'royalpayindustry.json', '[{"children":[{"children":[],"label":"机票","mccCode":"10001"},{"children":[],"label":"旅游行业","mccCode":"10002"},{"children":[],"label":"私人定制旅游","mccCode":"10003"},{"children":[],"label":"租车","mccCode":"10004"},{"children":[],"label":"巴士","mccCode":"10005"}],"label":"旅游出行","mccCode":"1"},{"children":[{"children":[],"label":"饭店","mccCode":"20001"},{"children":[],"label":"奶茶店","mccCode":"20002"},{"children":[],"label":"烧烤","mccCode":"20003"},{"children":[],"label":"火锅","mccCode":"20004"},{"children":[],"label":"Coffee","mccCode":"20005"},{"children":[],"label":"酒吧","mccCode":"20006"}],"label":"餐饮","mccCode":"2"},{"children":[{"children":[],"label":"培训类","mccCode":"30001"},{"children":[],"label":"移民留学","mccCode":"30002"},{"children":[],"label":"私人幼儿园","mccCode":"30003"}],"label":"教育","mccCode":"3"},{"children":[{"children":[],"label":"换汇","mccCode":"40001"},{"children":[],"label":"房产","mccCode":"40002"}],"label":"商务咨询","mccCode":"4"},{"children":[{"children":[],"label":"公众号服务商","mccCode":"50001"},{"children":[],"label":"各种媒体类宣传","mccCode":"50002"}],"label":"传媒","mccCode":"5","value":"{\"category\":\"SERVICE\",\"code\":\"7542\",\"description\":\"Car Washes\",\"parentCode\":\"S10\"}"},{"children":[{"children":[],"label":"美容院","mccCode":"60001"},{"children":[],"label":"医疗美容","mccCode":"60002"}],"label":"医美","mccCode":"6"},{"children":[{"label":"超市","mccCode":"70001"},{"children":[],"label":"服装店","mccCode":"70002"},{"children":[],"label":"鞋店","mccCode":"70003"},{"children":[],"label":"珠宝店","mccCode":"70004"},{"children":[],"label":"箱包","mccCode":"70005"}],"label":"零售","mccCode":"7"},{"children":[{"children":[],"label":"桌游吧","mccCode":"80001"},{"children":[],"label":"演唱会","mccCode":"80002"},{"children":[],"label":"马术训练","mccCode":"80003"},{"children":[],"label":"瑜伽","mccCode":"80004"},{"children":[],"label":"健身","mccCode":"80005"},{"children":[],"label":"社团","mccCode":"80006"},{"children":[],"label":"网吧","mccCode":"80007"},{"children":[],"label":"KTV","mccCode":"80008"},{"children":[],"label":"电影","mccCode":"80009"}],"label":"休闲娱乐","mccCode":"8"},{"children":[{"children":[],"label":"摄影","mccCode":"90001"},{"children":[],"label":"massage","mccCode":"90002"},{"children":[],"label":"通讯运营商","mccCode":"90003"},{"children":[],"label":"车行","mccCode":"90004"},{"children:":[],"label":"软件服务","mccCode":"90005"}],"label":"其他服务类","mccCode":"9"},{"children":[{"children":[],"label":"Hotel","mccCode":"100001"},{"children":[],"label":"Motel","mccCode":"100002"}],"label":"酒店","mccCode":"10"},{"children":[{"children":[],"label":"代购","mccCode":"110001"},{"children":[],"label":"物流(大宗出口贸易)","mccCode":"110002"},{"children":[],"label":"红酒出口","mccCode":"110003"},{"children":[],"label":"综合电商","mccCode":"110004"}],"label":"出口贸易","mccCode":"11"},{"children":[{"children":[],"label":"建材","mccCode":"120001"},{"children":[],"label":"家居","mccCode":"120002"}],"label":"家居建材","mccCode":"12"}]');
ALTER TABLE `sys_client_config`
ADD COLUMN `gateway_alipay_online` tinyint(1) NULL DEFAULT 1 COMMENT '支付宝线上网关使用线上渠道' AFTER `require_remark`;
ALTER TABLE `sys_clients`
ADD COLUMN `gateway_alipay_online` tinyint(1) NULL DEFAULT 1 COMMENT '支付宝线上网关使用线上渠道' AFTER `require_remark`;

@ -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