dev_0531
kevin jiang 5 years ago
parent ed4e66ddfb
commit ee86a02690

@ -654,15 +654,15 @@ public class RedisUtil {
* @return * @return
*/ */
public Object getCustomerId(Long customerId, Long staffId, Long shopId){ 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){ 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){ 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 * @return ID
*/ */
public Long getExternalUserId(String externalUserId){ public Long getExternalUserId(String externalUserId){
Object obj = get(externalUserId); Object obj = get("EXTERNALUSERID_"+externalUserId);
return obj == null ? 0L : Long.parseLong(obj.toString()); return obj == null ? 0L : Long.parseLong(obj.toString());
} }
public void setExternalUserId(String externalUserId, Long customerId){ public void setExternalUserId(String externalUserId, Long customerId){
set(externalUserId, customerId); set("EXTERNALUSERID_"+externalUserId, customerId);
} }
public void batchAddExternalUserIdKey(List<OpCustomer> dataList) { public void batchAddExternalUserIdKey(List<OpCustomer> dataList) {
@ -714,7 +714,7 @@ public class RedisUtil {
@Override @Override
public List<OpCustomer> doInRedis(RedisConnection connection) throws DataAccessException { public List<OpCustomer> doInRedis(RedisConnection connection) throws DataAccessException {
for (OpCustomer opCustomer : dataList) { 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; return null;
} }
@ -728,7 +728,7 @@ public class RedisUtil {
@Override @Override
public List<OpSellerCustomerRelation> doInRedis(RedisConnection connection) throws DataAccessException { public List<OpSellerCustomerRelation> doInRedis(RedisConnection connection) throws DataAccessException {
for (OpSellerCustomerRelation item : dataList) { 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()); connection.hSet(key.getBytes(), item.getStoreId().toString().getBytes(), item.getId().toString().getBytes());
} }
return null; return null;

Loading…
Cancel
Save