Commit 2727ce27 by guojuxing

导购列表查询支持联合商户查询

parent 25620429
......@@ -136,7 +136,7 @@ public interface ClerkApiService {
* @Title: getClerkByCodeAndStoreInfoId
* @Description:
* @author zhiwj
* @param enterpriseId
* @param enterpriseId 弃用
* @param clerkCode
* @param storeInfoId
* @return com.gic.api.base.commons.ServiceResponse<com.gic.store.dto.ClerkDTO>
......
......@@ -315,7 +315,7 @@ public class ClerkApiServiceImpl implements ClerkApiService {
public ServiceResponse<ClerkDTO> getClerkByCode(Integer enterpriseId, String clerkCode, Integer storeId) {
ServiceResponse<StoreDTO> storeResponse = storeApiService.getStoreById(enterpriseId, storeId);
if (storeResponse.getResult() != null) {
StoreDTO store = storeResponse.getResult();
//enterpriseId 弃用
return getClerkByCodeAndStoreInfoId(enterpriseId, clerkCode, storeId);
} else {
logger.warn("门店不存在 enterpriseId:{}, storeId:{}", enterpriseId, storeId);
......@@ -325,6 +325,7 @@ public class ClerkApiServiceImpl implements ClerkApiService {
@Override
public ServiceResponse<ClerkDTO> getClerkByCodeAndStoreInfoId(Integer enterpriseId, String clerkCode, Integer storeInfoId) {
//enterpriseId 弃用
TabClerk clerk = this.clerkService.getClerkByCode(enterpriseId, clerkCode, storeInfoId);
if (clerk != null) {
return EnterpriseServiceResponse.success(EntityUtil.changeEntityByJSON(ClerkDTO.class, clerk));
......
......@@ -394,8 +394,7 @@ public class StoreApiServiceImpl implements StoreApiService {
@Override
public void refreshCache(Integer enterpriseId, Integer storeId) {
String key = Constants.STORE_KEY + enterpriseId + ":" + storeId;
RedisUtil.delCache(key);
RedisUtil.delCache(getStoreRedisKey(enterpriseId, storeId));
}
@Override
......@@ -1313,7 +1312,7 @@ public class StoreApiServiceImpl implements StoreApiService {
@Override
public ServiceResponse<StoreDTO> getStoreById(Integer enterpriseId, Integer storeId) {
String key = Constants.STORE_KEY + enterpriseId + ":" + storeId;
String key = getStoreRedisKey(enterpriseId, storeId);
StoreDTO storeDTO = (StoreDTO) RedisUtil.getCache(key);
if (storeDTO == null) {
......@@ -1730,8 +1729,7 @@ public class StoreApiServiceImpl implements StoreApiService {
private void removeCache(Integer enterpriseId, List<Integer> storeIds) {
for (Integer storeId : storeIds) {
String key = Constants.STORE_KEY + enterpriseId + ":" + storeId;
RedisUtil.delCache(key);
RedisUtil.delCache(getStoreRedisKey(enterpriseId, storeId));
}
}
......@@ -2054,4 +2052,8 @@ public class StoreApiServiceImpl implements StoreApiService {
return null;
}
private static String getStoreRedisKey(Integer enterpriseId, Integer storeId) {
return Constants.STORE_KEY + enterpriseId + ":" + storeId;
}
}
......@@ -312,7 +312,10 @@
select
distinct store_info_id
from tab_clerk
where enterprise_id = #{enterpriseId}
where
store_info_id in (
select store_info_id from tab_store where enterprise_id = #{enterpriseId} and status = 1
)
<if test="search != null and search != '' ">
and (clerk_code like concat('%', #{search} ,'%') or clerk_name like concat('%', #{search} ,'%') or phone_number like concat('%', #{search} ,'%') )
</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment