Merge branch 'hotfix_settlement_detail'

master
yixian 6 years ago
commit 33655b384f

@ -5,7 +5,7 @@
<parent>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-parent</artifactId>
<version>0.2.0</version>
<version>0.2.0-dev</version>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -205,6 +205,9 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
total.put("wechat_charge", 0);
total.put("royalpay_charge", 0);
total.put("net_amount", 0);
total.put("total_charge", 0);
total.put("tax_amount", 0);
total.put("charge_cashback", 0);
List<JSONObject> details = new ArrayList<>();
for (JSONObject log : logs) {
@ -214,6 +217,9 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
addBigDecimal(total, log, "wechat_charge");
addBigDecimal(total, log, "royalpay_charge");
addBigDecimal(total, log, "net_amount");
addBigDecimal(total, log, "total_charge");
addBigDecimal(total, log, "charge_cashback");
addBigDecimal(total, log, "tax_amount");
int clearingId = log.getIntValue("clearing_id");
List<JSONObject> logDetails = clearingDetailMapper.listReportsOfSettlement(clearingId);
details.addAll(logDetails);
@ -226,6 +232,9 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
.map(detail -> detail.getBigDecimal("clearing_amount"))
.reduce(BigDecimal::add)
);
data.put("clients", logDetails.stream()
.filter(detail -> bank.equals(detail.getString("settle_bank")))
.count());
return data;
}).collect(Collectors.toList());
log.put("bank_statistics", bankStatistics);

@ -3,6 +3,8 @@ package au.com.royalpay.payment.manage.management.sysconfig.core;
import au.com.royalpay.payment.manage.management.sysconfig.beans.FuncInfo;
import au.com.royalpay.payment.manage.management.sysconfig.beans.PartnerModuleInfo;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import com.alibaba.fastjson.JSONObject;
import java.util.List;
@ -27,7 +29,7 @@ public interface PermissionPartnerManager {
List<String> listRoleFunctions(ManagerRole role);
void authorizeRole(ManagerRole role, List<String> functions);
void authorizeRole(PartnerRole role, List<String> functions);
List<JSONObject> listUserFunctions(int role);

@ -12,6 +12,7 @@ import au.com.royalpay.payment.manage.permission.manager.scanner.PermissionPartn
import au.com.royalpay.payment.manage.system.core.PermissionClientModulesService;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import au.com.royalpay.payment.tools.utils.id.IdUtil;
import com.alibaba.fastjson.JSONObject;
@ -175,7 +176,7 @@ public class PermissionPartnerManagerImpl implements PermissionPartnerManager {
}
@Override
@CacheEvict(value = ":login:managers:", allEntries = true)
@CacheEvict(value = ":login:partners:", allEntries = true)
public void setFunctionModule(String funcId, String moduleName) {
if (moduleName == null) {
throw new BadRequestException("module name not provided");
@ -204,10 +205,11 @@ public class PermissionPartnerManagerImpl implements PermissionPartnerManager {
@Override
@Transactional
@CacheEvict(value = ":login:managers:", allEntries = true)
public void authorizeRole(ManagerRole role, List<String> functions) {
permissionPartnerFunctionMapper.clearRolePermission(role.getInverseMask());
permissionPartnerFunctionMapper.authorizeRole(role.getMask(), functions);
@CacheEvict(value = ":login:partners:", allEntries = true)
public void authorizeRole(PartnerRole role, List<String> functions) {
permissionPartnerFunctionMapper.clearRolePermission(role.getCode());
permissionPartnerFunctionMapper.authorizeRole(role.getCode(), functions);
}
@Override

@ -5,6 +5,7 @@ import au.com.royalpay.payment.manage.management.sysconfig.beans.PartnerModuleIn
import au.com.royalpay.payment.manage.management.sysconfig.core.PermissionPartnerManager;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import com.alibaba.fastjson.JSONObject;
@ -81,8 +82,8 @@ public class SysPermissionPartnerConfigController {
public void authorizeRole(@PathVariable String roleMask, @RequestBody List<String> functions){
try {
int mask = Integer.parseInt(roleMask, 2);
for (ManagerRole role : ManagerRole.values()) {
if (mask == role.getMask()) {
for (PartnerRole role : PartnerRole.values()) {
if (mask == role.getCode()) {
permissionPartnerManager.authorizeRole(role,functions);
return;
}

@ -45,6 +45,7 @@ public interface ManagerMapper {
List<JSONObject> listByRole(JSONObject params);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid=1")
JSONObject findByWxOpenId(@Param("wx_openid") String openid);
List<String> listOpenIdsOfCompliances();

@ -73,18 +73,21 @@ public class PermissionClientModulesServiceImpl implements PermissionClientModul
}
private void saveMongoLog(JSONObject account, JSONObject oldRecord, JSONObject modifyData, String business) {
modifyData.remove("id");
PermissionClientModuleLog mongoRecord = new PermissionClientModuleLog();
mongoRecord.setBusiness(business);
mongoRecord.setClientId(oldRecord.getIntValue("client_id"));
mongoRecord.setClientMoniker(oldRecord.getString("client_moniker"));
mongoRecord.setCreateTime(new Date());
mongoRecord.setId(IdUtil.getId());
mongoRecord.setUserId(account.getString("manager_id"));
mongoRecord.setUserName(account.getString("display_name"));
mongoRecord.setNewData(modifyData.toJSONString());
Map<String, Object> beforeModify = modifyData.keySet().stream().collect(Collectors.toMap(key -> key, oldRecord::get));
mongoRecord.setOriginData(JSON.toJSONString(beforeModify));
mongoTemplate.insert(mongoRecord);
try {
modifyData.remove("id");
PermissionClientModuleLog mongoRecord = new PermissionClientModuleLog();
mongoRecord.setBusiness(business);
mongoRecord.setClientId(oldRecord.getIntValue("client_id"));
mongoRecord.setClientMoniker(oldRecord.getString("client_moniker"));
mongoRecord.setCreateTime(new Date());
mongoRecord.setId(IdUtil.getId());
mongoRecord.setUserId(account.getString("manager_id"));
mongoRecord.setUserName(account.getString("display_name"));
mongoRecord.setNewData(modifyData.toJSONString());
Map<String, Object> beforeModify = modifyData.keySet().stream().collect(Collectors.toMap(key -> key, oldRecord::get));
mongoRecord.setOriginData(JSON.toJSONString(beforeModify));
mongoTemplate.insert(mongoRecord);
}catch (Exception ignore){
}
}
}

@ -13,13 +13,13 @@
<update id="clearRolePermission">
<![CDATA[
UPDATE sys_permission_partner_functions
SET role = role & #{mask}
SET role = replace(role,#{mask},'')
]]>
</update>
<update id="authorizeRole">
<![CDATA[
UPDATE sys_permission_partner_functions
SET role = role | #{mask}
SET role = concat(role,#{mask})
WHERE func_id in
]]>
<foreach collection="func_ids" item="id" open="(" close=")" separator=",">
@ -29,7 +29,7 @@
<select id="listByRoleMask" resultType="com.alibaba.fastjson.JSONObject">
<include refid="joinModule"/>
<![CDATA[
WHERE f.role & #{mask} >0
WHERE f.role like concat('%',#{mask},'%')
]]>
</select>
<select id="listAll" resultType="com.alibaba.fastjson.JSONObject">

@ -87,7 +87,12 @@
<li class="list-group-item" ng-repeat="bank in getCurrentLog().bank_statistics">
<div class="row">
<span class="col-xs-1 text-bold" ng-bind="bank.bank"></span>
<span class="col-xs-11" ng-bind="bank.total_settle|currency:''"></span>
<span class="col-xs-11">
<span>Total Amount:</span>
<span ng-bind="bank.total_settle|currency:''"></span>
<span>Clients:</span>
<span ng-bind="bank.clients"></span>
</span>
</div>
</li>
</ul>
@ -119,7 +124,7 @@
<div class="col-xs-6 col-sm-3">
<span class="col-xs-6 text-bold">Total Charge</span>
<span class="col-xs-6"
ng-bind="(currentAnalysis.wechat_charge+currentAnalysis.royalpay_charge)|currency:''"></span>
ng-bind="currentAnalysis.total_charge|currency:''"></span>
</div>
<div class="col-xs-6 col-sm-3">
<span class="col-xs-6 text-bold">Channel Charge</span>
@ -129,6 +134,17 @@
<span class="col-xs-6 text-bold">RoyalPay Charge</span>
<span class="col-xs-6" ng-bind="currentAnalysis.royalpay_charge|currency:''"></span>
</div>
<div class="col-xs-6 col-sm-3">
<span class="col-xs-6 text-bold">Charge Cashback</span>
<span class="col-xs-6" ng-bind="currentAnalysis.charge_cashback|currency:''"></span>
</div>
</div>
<div class="row">
<div class="col-xs-6 col-sm-3">
<span class="col-xs-6 text-bold">GST</span>
<span class="col-xs-6"
ng-bind="currentAnalysis.tax_amount|currency:''"></span>
</div>
<div class="col-xs-6 col-sm-3">
<span class="col-xs-6 text-bold">Operate Time</span>
<span class="col-xs-6"
@ -141,8 +157,7 @@
<div class="row">
<div class="col-xs-12">
<ul class="list-group">
<li class="list-group-item" ng-repeat="channel in currentAnalysis.channel_analysis"
ng-if="channel.channel!='System'">
<li class="list-group-item" ng-repeat="channel in currentAnalysis.channel_analysis">
<div class="row">
<span class="col-xs-2"><img ng-src="{{channel.channel|channel_image}}"
class="channel-icon-lg"></span>

@ -27,7 +27,7 @@
<i class="fa fa-user-secret"></i>
Administrator
</a>
<a class="btn btn-app" role="button" ng-click="authorizeRole('10')">
<a class="btn btn-app" role="button" ng-click="authorizeRole('3')">
<i class="fa fa-eye"></i>
Compliance
</a>

@ -1245,6 +1245,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
commonDialog.alert({title: 'info', content: 'Wechat Institution Merchant Id not Refresh', type: 'info'});
return;
}
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/payment_config', {sub_merchant_id: $scope.paymentInfo.sub_merchant_id}).then(function (resp) {
commonDialog.alert({
title: 'Success',

Loading…
Cancel
Save