|
|
|
@ -654,15 +654,15 @@ public class RedisUtil {
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public Object getCustomerId(Long customerId, Long staffId, Long shopId){
|
|
|
|
|
return hget(customerId + "_" + staffId, shopId + "");
|
|
|
|
|
return hget("CUSTOMERID_"+customerId + "_" + staffId, shopId + "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setCustomerId(Long customerId, Long staffId, Long shopId, Long val){
|
|
|
|
|
hset(customerId + "_" + staffId, shopId + "", val);
|
|
|
|
|
hset("CUSTOMERID_"+customerId + "_" + staffId, shopId + "", val);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void removeCustomerId(Long customerId, Long staffId, Long shopId){
|
|
|
|
|
hdel(customerId + "_" + staffId, shopId + "");
|
|
|
|
|
hdel("CUSTOMERID_"+customerId + "_" + staffId, shopId + "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -700,12 +700,12 @@ public class RedisUtil {
|
|
|
|
|
* @return 返回客户ID
|
|
|
|
|
*/
|
|
|
|
|
public Long getExternalUserId(String externalUserId){
|
|
|
|
|
Object obj = get(externalUserId);
|
|
|
|
|
Object obj = get("EXTERNALUSERID_"+externalUserId);
|
|
|
|
|
return obj == null ? 0L : Long.parseLong(obj.toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setExternalUserId(String externalUserId, Long customerId){
|
|
|
|
|
set(externalUserId, customerId);
|
|
|
|
|
set("EXTERNALUSERID_"+externalUserId, customerId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void batchAddExternalUserIdKey(List<OpCustomer> dataList) {
|
|
|
|
@ -714,7 +714,7 @@ public class RedisUtil {
|
|
|
|
|
@Override
|
|
|
|
|
public List<OpCustomer> doInRedis(RedisConnection connection) throws DataAccessException {
|
|
|
|
|
for (OpCustomer opCustomer : dataList) {
|
|
|
|
|
connection.set(opCustomer.getExternalUserid().getBytes(), opCustomer.getId().toString().getBytes());
|
|
|
|
|
connection.set(("EXTERNALUSERID_"+opCustomer.getExternalUserid()).getBytes(), opCustomer.getId().toString().getBytes());
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
@ -728,7 +728,7 @@ public class RedisUtil {
|
|
|
|
|
@Override
|
|
|
|
|
public List<OpSellerCustomerRelation> doInRedis(RedisConnection connection) throws DataAccessException {
|
|
|
|
|
for (OpSellerCustomerRelation item : dataList) {
|
|
|
|
|
String key = item.getCustomerId() + "_" + item.getUserId();
|
|
|
|
|
String key = "CUSTOMERID_"+item.getCustomerId() + "_" + item.getUserId();
|
|
|
|
|
connection.hSet(key.getBytes(), item.getStoreId().toString().getBytes(), item.getId().toString().getBytes());
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|