dev_0531
yechenhao 5 years ago
parent 7d4c86c846
commit eb655e1d22

@ -661,6 +661,10 @@ public class RedisUtil {
hset(customerId + "_" + staffId, shopId + "", val);
}
public void removeCustomerId(Long customerId, Long staffId, Long shopId){
hdel(customerId + "_" + staffId, shopId + "");
}
/**
*
* @param customerId ID

@ -370,6 +370,7 @@ public class CustomerService {
return;
}
//店铺信息
Long store_id = 0L;
PrivilageCpUserStoreDO poiStore = privilageCpUserStoreDOMapper.selectOneCpUser(turnBackDTOS.getUserId());
if (null == poiStore) {
QueryWrapper<PrivilageCpUserDO> cpUserQw = new QueryWrapper<>();
@ -378,8 +379,12 @@ public class CustomerService {
QueryWrapper<OpSellerCustomerRelation> relationQw = new QueryWrapper<>();
relationQw.eq("customer_id", customer.getId()).eq("user_id", privilageCpUserDO.getId()).eq("type", 3);
opSellerCustomerRelationDOMapper.delete(relationQw);
int delete = opSellerCustomerRelationDOMapper.delete(relationQw);
if (delete > 0){
redisUtil.removeCustomerId(customer.getId(),privilageCpUserDO.getId(),store_id);
}
} else {
store_id = poiStore.getStoreId();
String eaCode = turnBackDTOS.getEaCode();
PoiStoreStaff staff;
QueryWrapper<PoiStoreStaff> staffQw = new QueryWrapper<>();
@ -392,7 +397,10 @@ public class CustomerService {
}
QueryWrapper<OpSellerCustomerRelation> relationQw = new QueryWrapper<>();
relationQw.eq("customer_id", customer.getId()).eq("user_id", staff.getId());
opSellerCustomerRelationDOMapper.delete(relationQw);
int delete = opSellerCustomerRelationDOMapper.delete(relationQw);
if (delete > 0){
redisUtil.removeCustomerId(customer.getId(),staff.getId(),store_id);
}
}
}
@ -472,6 +480,9 @@ public class CustomerService {
int ii = opSellerCustomerRelationDOMapper.insert(insertRelation);
if(ii > 0){
// 放入redis
if (insertRelation.getType().equals(1)){
redisUtil.addVailKey(opCustomer.getId());
}
redisUtil.setCustomerId(opCustomer.getId() , sellerId, shopId, insertRelation.getId());
}
}
@ -521,7 +532,10 @@ public class CustomerService {
int cc = opSellerCustomerRelationDOMapper.insert(insertRelation);
if(cc > 0 && insertRelation.getType().equals(1)){
// 放入redis
redisUtil.addVailKey(opCustomer.getId());
if (insertRelation.getType().equals(1)){
redisUtil.addVailKey(opCustomer.getId());
}
redisUtil.setCustomerId(insertRelation.getCustomerId(),insertRelation.getUserId(),insertRelation.getStoreId(),insertRelation.getId());
}
}
}

Loading…
Cancel
Save