[Y] 开放 cashier 菜单权限 & 临时子商户号标记

master
taylor.dang 5 years ago
parent a6aa25206d
commit 18bfb7e593

@ -13,7 +13,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.1.2</jib-maven-plugin.version>
<docker-image.version>1.0.9</docker-image.version>
<docker-image.version>1.0.10</docker-image.version>
</properties>
<dependencies>

@ -1,5 +1,6 @@
package au.com.royalpay.payment.manage.mappers.payment;
import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect;
import org.apache.ibatis.annotations.Param;
import com.alibaba.fastjson.JSONObject;
@ -27,5 +28,4 @@ public interface CommonSubMerchantIdMapper {
@AutoSql(type = SqlType.SELECT)
JSONObject find(@Param("sub_merchant_id") String subMerchantId);
}

@ -23,6 +23,7 @@ import org.apache.commons.lang3.time.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMethod;
@ -96,15 +97,14 @@ public class MerchantIdManageServiceImpl implements MerchantIdManageService {
@Override
public void generateClientsSunMerchantId() {
//重构未交易商户号逻辑
String tempSubMerchantIds = sysConfigManager.getSysConfig().getString("temp_sub_mch_id");
List<JSONObject> clients = clientAnalysisMapper.tradeSubMerchantIdBy60Days(DateUtils.addDays(new Date(), -60));
if (clients.size() > 0) {
clientSubMerchantIdMapper.deleteAll();
}
for (JSONObject client: clients) {
String subMerchantId = client.getString("sub_merchant_id");
if (subMerchantId != null && tempSubMerchantIds != null && tempSubMerchantIds.contains(subMerchantId)) {
client.put("temp_sub_merchant", true);
if (subMerchantId != null) {
client.put("temp_sub_merchant", checkSubMerchantIdInCommonPool(subMerchantId));
}
String id = client.getString("sub_merchant_id");
client.put("create_time",new Date());
@ -142,11 +142,10 @@ public class MerchantIdManageServiceImpl implements MerchantIdManageService {
}
private Map<String, List<JSONObject>> getClientMap(List<JSONObject> clients){
String tempSubMerchantIds = sysConfigManager.getSysConfig().getString("temp_sub_mch_id");
for (JSONObject client: clients) {
String subMerchantId = client.getString("sub_merchant_id");
if (subMerchantId != null && tempSubMerchantIds != null && tempSubMerchantIds.contains(subMerchantId)) {
client.put("temp_sub_merchant", true);
if (subMerchantId != null) {
client.put("temp_sub_merchant", checkSubMerchantIdInCommonPool(subMerchantId));
}
}
Map<String, List<JSONObject>> clientsMap = clients.stream()
@ -190,4 +189,11 @@ public class MerchantIdManageServiceImpl implements MerchantIdManageService {
String sign = DigestUtils.sha256Hex(validStr).toLowerCase();
return "time=" + time + "&nonce_str=" + nonceStr + "&sign=" + sign;
}
@Cacheable("common_sub_mch_id:")
public boolean checkSubMerchantIdInCommonPool(String subMerchantId) {
JSONObject json = commonSubMerchantIdMapper.find(subMerchantId);
return json != null;
}
}

@ -26,6 +26,7 @@ import au.com.royalpay.payment.manage.device.core.DeviceManager;
import au.com.royalpay.payment.manage.management.sysconfig.core.impls.PermissionPartnerManagerImpl;
import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper;
import au.com.royalpay.payment.manage.mappers.log.*;
import au.com.royalpay.payment.manage.mappers.payment.CommonSubMerchantIdMapper;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
import au.com.royalpay.payment.manage.mappers.redpack.ActClientInvitationCodeMapper;
import au.com.royalpay.payment.manage.mappers.risk.RiskAttentionMerchantsMapper;
@ -277,6 +278,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Resource
private MerchantSignInfoMapper merchantSignInfoMapper;
@Resource
private CommonSubMerchantIdMapper commonSubMerchantIdMapper;
@Resource
private Locker locker;
@ -372,12 +375,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
if (!StringUtils.equalsIgnoreCase(clientMoniker, PlatformEnvironment.getEnv().getTestMoniker())) {
String subMerchantId = client.getString("sub_merchant_id");
String tempSubMerchantIds = sysConfigManager.getSysConfig().getString("temp_sub_mch_id");
String tempSubMchSource = sysConfigManager.getSysConfig().getString("temp_sub_mch_id_source");
tempSubMchSource = tempSubMchSource == null ? "" : tempSubMchSource;
if (subMerchantId != null && tempSubMerchantIds != null && tempSubMerchantIds.contains(subMerchantId)
&& !tempSubMchSource.contains(client.getString("client_moniker"))) {
client.put("temp_sub_merchant", true);
if (subMerchantId != null) {
client.put("temp_sub_merchant", checkSubMerchantIdInCommonPool(subMerchantId));
}
}
if (client.getIntValue("approve_result") == 1
@ -526,9 +525,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
int authDays = PlatformEnvironment.getEnv().authDays();// 快速自助开通申请有效期
for (JSONObject partner : partners) {
String subMerchantId = partner.getString("sub_merchant_id");
if (subMerchantId != null && tempSubMchId != null && tempSubMchId.contains(subMerchantId)
&& !tempSubMchSource.contains(partner.getString("client_moniker"))) {
partner.put("temp_sub_merchant", true);
if (subMerchantId != null ) {
partner.put("temp_sub_merchant", checkSubMerchantIdInCommonPool(subMerchantId));
}
if (partner.getIntValue("approve_result") == 2) {
partner.put("expiry_time", DateUtils.addDays(partner.getDate("approve_time"), authDays));
@ -4911,6 +4909,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
}
@Cacheable("common_sub_mch_id:")
public boolean checkSubMerchantIdInCommonPool(String subMerchantId) {
JSONObject json = commonSubMerchantIdMapper.find(subMerchantId);
return json != null;
}
@Override
public JSONObject comListPartnerSelection(JSONObject manager, PartnerQuery query) {
JSONObject params = query.toJsonParam();
@ -4926,9 +4930,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
int authDays = PlatformEnvironment.getEnv().authDays();// 快速自助开通申请有效期
for (JSONObject partner : partners) {
String subMerchantId = partner.getString("sub_merchant_id");
if (subMerchantId != null && tempSubMchId != null && tempSubMchId.contains(subMerchantId)
&& !tempSubMchSource.contains(partner.getString("client_moniker"))) {
partner.put("temp_sub_merchant", true);
if (subMerchantId != null) {
partner.put("temp_sub_merchant", checkSubMerchantIdInCommonPool(subMerchantId));
}
if (partner.getIntValue("approve_result") == 2) {
partner.put("expiry_time", DateUtils.addDays(partner.getDate("approve_time"), authDays));

@ -881,7 +881,7 @@ margin-bottom: 10%;"/>
</li>
</ul>
</li>
<li ng-if="currentUser.client.client_moniker=='PINE' || currentUser.client.client_moniker=='LMEN'">
<li>
<ul>
<li>
<a ui-sref="cashiers">

Loading…
Cancel
Save