feat:分账门店映射
This commit is contained in:
@@ -418,4 +418,6 @@ public class RedisConstant {
|
|||||||
* 新管家缴费回调完成 标识
|
* 新管家缴费回调完成 标识
|
||||||
*/
|
*/
|
||||||
public static final String XGJ_CALLBACK_SHOP = "xgj_callback_shop:{0}";
|
public static final String XGJ_CALLBACK_SHOP = "xgj_callback_shop:{0}";
|
||||||
|
|
||||||
|
public static final String STORE_ID_MAPPING = "store_id_mapping";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,32 @@
|
|||||||
package com.cool.store.http;
|
package com.cool.store.http;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.cool.store.constants.RedisConstant;
|
||||||
|
import com.cool.store.dao.ShopInfoDAO;
|
||||||
|
import com.cool.store.dao.StoreDao;
|
||||||
|
import com.cool.store.entity.StoreDO;
|
||||||
import com.cool.store.enums.ErrorCodeEnum;
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
import com.cool.store.exception.ServiceException;
|
import com.cool.store.exception.ServiceException;
|
||||||
|
import com.cool.store.utils.RedisUtilPool;
|
||||||
import com.cool.store.utils.RsaSignUtil;
|
import com.cool.store.utils.RsaSignUtil;
|
||||||
|
import com.cool.store.utils.StringUtil;
|
||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import okhttp3.*;
|
import okhttp3.*;
|
||||||
|
import org.apache.catalina.Store;
|
||||||
import org.apache.poi.ss.formula.functions.T;
|
import org.apache.poi.ss.formula.functions.T;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author suzhuhong
|
* @Author suzhuhong
|
||||||
@@ -33,6 +43,11 @@ public class WalletHttpClientRest {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ObjectMapper objectMapper;
|
private ObjectMapper objectMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
RedisUtilPool redisUtilPool;
|
||||||
|
|
||||||
|
private static final String STORE_ID = "storeId";
|
||||||
|
|
||||||
@Value("${cool.api.rsa.private.key}")
|
@Value("${cool.api.rsa.private.key}")
|
||||||
private String coolPrivateKey;
|
private String coolPrivateKey;
|
||||||
@Value("${wallet.api.rsa.public.key}")
|
@Value("${wallet.api.rsa.public.key}")
|
||||||
@@ -238,7 +253,18 @@ public class WalletHttpClientRest {
|
|||||||
if (obj instanceof Map) {
|
if (obj instanceof Map) {
|
||||||
return (Map<String, Object>) obj;
|
return (Map<String, Object>) obj;
|
||||||
}
|
}
|
||||||
return objectMapper.convertValue(obj, new TypeReference<Map<String, Object>>() {});
|
Map<String, Object> map = objectMapper.convertValue(obj, new TypeReference<Map<String, Object>>() {
|
||||||
|
});
|
||||||
|
//门店映射
|
||||||
|
if (map.containsKey(STORE_ID)){
|
||||||
|
String key = RedisConstant.STORE_ID_MAPPING;
|
||||||
|
String storeId = (String) map.get(STORE_ID);
|
||||||
|
String storeIdMapping = redisUtilPool.hashGet(key, storeId);
|
||||||
|
if (StringUtil.isNotEmpty(storeIdMapping)){
|
||||||
|
map.put(STORE_ID,storeIdMapping);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user