Commit da45a584 by 陶光胜

Merge branch 'developer' into 'master'

Developer

See merge request !4
parents 53bbb2fc b676529f
......@@ -122,4 +122,17 @@ public interface ClerkApiService {
* @throws
*/
ServiceResponse<Integer> addClerkToOtherStore(Integer clerkId, Integer storeId, Integer enterpriseId);
/**
* @Title: listClerkByStoreBrand
* @Description: 按店招品牌搜索所有导购
* @author zhiwj
* @param enterpriseId
* @param storeBrandId
* @param clerkName
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.store.dto.ClerkDTO>>
* @throws
*/
ServiceResponse<List<ClerkDTO>> listClerkByStoreBrand(Integer enterpriseId, Integer storeBrandId, String clerkName);
}
......@@ -18,13 +18,6 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<libraryVersion>4.0-SNAPSHOT</libraryVersion>
<gic-sharding-sdk>3.1-SNAPSHOT</gic-sharding-sdk>
<!-- api依赖,正式版会在 gic-pom-base 里生成 -->
<gic-store-api>4.0-SNAPSHOT</gic-store-api>
<gic-redis-data>4.0-SNAPSHOT</gic-redis-data>
<gic-bizdict-api>4.0.0-SNAPSHOT</gic-bizdict-api>
<gic-bizdict-sdk>4.0.0-SNAPSHOT</gic-bizdict-sdk>
<gic-platform-enterprise-api>4.0-SNAPSHOT</gic-platform-enterprise-api>
</properties>
<dependencies>
......@@ -52,12 +45,6 @@
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-sharding-sdk</artifactId>
<version>${gic-sharding-sdk}</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.5.1</version>
......
......@@ -58,7 +58,7 @@ public interface TabClerkMapper {
Integer countByPhoneNumber(@Param("storeId") Integer storeId, @Param("phoneNumber") String phoneNumber, @Param("clerkId") Integer clerkId);
List<TabClerk> listClerkByStoreInfoId(@Param("enterpriseId") Integer enterpriseId, @Param("storeClerkIds") List<Integer> storeClerkIds, @Param("search") String search);
List<TabClerk> listClerkByStoreInfoId(@Param("enterpriseId") Integer enterpriseId, @Param("storeClerkIds") List<Integer> storeClerkIds, @Param("storeInfoIds") String storeInfoIds, @Param("search") String search);
Integer getTotalClerk(@Param("enterpriseId") Integer enterpriseId, @Param("storeClerkIds") List<Integer> storeClerkIds, @Param("search") String search);
......
......@@ -74,12 +74,14 @@ public interface ClerkService {
* @Description: 查询下导购列表
* @author zhiwj
* @param enterpriseId 企业id
* @param storeIds 门店ids
* @param storeInfoIds 门店ids
* @param search 查询条件:clerkName or clerkCode
* @return java.util.List<com.gic.store.entity.TabClerk>
* @throws
*/
List<TabClerk> listClerkByStoreInfoId(Integer enterpriseId, List<Integer> storeIds, String search);
List<TabClerk> listClerkByStoreInfoId(Integer enterpriseId, List<Integer> storeInfoIds, String search);
List<TabClerk> listClerkByStoreInfoId(Integer enterpriseId, String storeInfoIds, String search);
Integer getTotalClerk(Integer enterpriseId, List<Integer> storeInfoIds, String search);
/**
......@@ -109,7 +111,7 @@ public interface ClerkService {
TabClerk getById(Integer clerkId);
List<TabClerk> listClerk(Integer enterpriseId, String search);
List<TabClerk> listClerkByStoreInfoId(Integer enterpriseId, String search);
TabClerk getClerkByCode(Integer enterpriseId, String clerkCode, Integer storeInfoId);
}
......@@ -88,8 +88,13 @@ public class ClerkServiceImpl implements ClerkService {
}
@Override
public List<TabClerk> listClerkByStoreInfoId(Integer enterpriseId, List<Integer> storeInfoClerkIds, String search) {
return tabClerkMapper.listClerkByStoreInfoId(enterpriseId, storeInfoClerkIds, search);
public List<TabClerk> listClerkByStoreInfoId(Integer enterpriseId, List<Integer> storeInfoIds, String search) {
return tabClerkMapper.listClerkByStoreInfoId(enterpriseId, storeInfoIds, null, search);
}
@Override
public List<TabClerk> listClerkByStoreInfoId(Integer enterpriseId, String storeInfoIds, String search) {
return tabClerkMapper.listClerkByStoreInfoId(enterpriseId, null, storeInfoIds, search);
}
@Override
......@@ -132,8 +137,8 @@ public class ClerkServiceImpl implements ClerkService {
}
@Override
public List<TabClerk> listClerk(Integer enterpriseId, String search) {
return this.tabClerkMapper.listClerkByStoreInfoId(enterpriseId, null, search);
public List<TabClerk> listClerkByStoreInfoId(Integer enterpriseId, String search) {
return this.tabClerkMapper.listClerkByStoreInfoId(enterpriseId, null, null, search);
}
@Override
......
......@@ -181,12 +181,11 @@ public class ClerkApiServiceImpl implements ClerkApiService {
// 查询条件对应的storeId
String storeIdByClerkSearch;
if (StringUtils.isNotBlank(clerkSearchDTO.getSearch())) {
List<Integer> storeInfoIdsBySearch = clerkService.getStoreInfoIdsBySearch(enterpriseId,
clerkSearchDTO.getSearch());
List<Integer> storeInfoIdsBySearch = clerkService.getStoreInfoIdsBySearch(enterpriseId, null);
if (CollectionUtils.isEmpty(groupIds) || CollectionUtils.isEmpty(storeInfoIdsBySearch)) {
storeIdByClerkSearch = "";
} else {
storeIdByClerkSearch = getStoreIdByStoreInfoIds(storeInfoIdsBySearch, clerkSearchDTO.getSearch());
storeIdByClerkSearch = getStoreIdByStoreInfoIds(storeInfoIdsBySearch, null);
}
} else {
storeIdByClerkSearch = "";
......@@ -291,7 +290,7 @@ public class ClerkApiServiceImpl implements ClerkApiService {
storeSearchDTO.setStoreGroupId(clerkSearchDTO.getStoreGroupId());
storeSearchDTO.setSearchJson(clerkSearchDTO.getSelectJson());
storeSearchDTO.setStoreIds(clerkSearchDTO.getStoreIds());
storeSearchDTO.setSearch(clerkSearchDTO.getSearch());
// storeSearchDTO.setSearch(clerkSearchDTO.getSearch());
return storeApiService.listStore(storeSearchDTO, pageNum, pageSize,
"storeId,storeName,storeCode,storeInfoId,ownType");
......@@ -329,7 +328,7 @@ public class ClerkApiServiceImpl implements ClerkApiService {
@Override
public ServiceResponse<List<ClerkDTO>> listClerk(Integer enterpriseId, String search) {
List<TabClerk> clerkList = this.clerkService.listClerk(enterpriseId, search);
List<TabClerk> clerkList = this.clerkService.listClerkByStoreInfoId(enterpriseId, search);
return ServiceResponse.success(EntityUtil.changeEntityListByJSON(ClerkDTO.class, clerkList));
}
......@@ -446,6 +445,23 @@ public class ClerkApiServiceImpl implements ClerkApiService {
}
}
@Override
public ServiceResponse<List<ClerkDTO>> listClerkByStoreBrand(Integer enterpriseId, Integer storeBrandId, String clerkName) {
StoreSearchDBDTO storeSearchDBDTO = new StoreSearchDBDTO();
storeSearchDBDTO.setEnterpriseId(enterpriseId);
storeSearchDBDTO.setStoreBrandId(storeBrandId);
List<StoreDTO> list = this.storeService.listStore(storeSearchDBDTO, 1, 10000);
if (CollectionUtils.isEmpty(list)) {
return EnterpriseServiceResponse.failure(ErrorCode.NOTEXISTS);
}
// list 如果太大, 让 mybatis 解析 会打满内存
String storeInfoIds = list.stream().map(e -> e.getStoreInfoId().toString()).reduce((x, y) -> x + "," + y).get();
storeInfoIds = "(" + storeInfoIds + ")";
List<TabClerk> clerkList = this.clerkService.listClerkByStoreInfoId(enterpriseId, storeInfoIds, clerkName);
List<ClerkDTO> dtoList = EntityUtil.changeEntityListByJSON(ClerkDTO.class, clerkList);
return EnterpriseServiceResponse.success(dtoList);
}
private static ServiceResponse<String> responseErrorElement(ImportClerkBatchResultEnum error) {
logger.warn("批处理导购错误返回结果:{}", error.toString());
return ServiceResponse.failure(error.getCode(), error.toString());
......
......@@ -627,7 +627,9 @@ public class StoreApiServiceImpl implements StoreApiService {
storeSearchDTO.setLongitude(nearByStoreSearchDTO.getLongitude());
storeSearchDTO.setLatitude(nearByStoreSearchDTO.getLatitude());
storeSearchDTO.setCityId(nearByStoreSearchDTO.getCityId());
storeSearchDTO.setStoreResource(Long.valueOf(storeWidgetId+""));
if(storeWidgetId != null){
storeSearchDTO.setStoreResource(Long.valueOf(storeWidgetId+""));
}
ServiceResponse<Page<StoreDTO>> storePage = this.listStore(storeSearchDTO, nearByStoreSearchDTO.getPageNum(), nearByStoreSearchDTO.getPageSize());
List<StoreDTO> list = storePage.getResult().getResult();
StorePhotoDTO storePhotoDTO = new StorePhotoDTO();
......
......@@ -218,6 +218,9 @@
#{item}
</foreach>
</if>
<if test="storeInfoIds != null ">
and store_info_id in ${storeInfoIds}
</if>
<if test="search != null and search != '' ">
and (clerk_code like concat('%', #{search} ,'%') or clerk_name like concat('%', #{search} ,'%') )
</if>
......
......@@ -384,7 +384,7 @@
and t1.city_id= #{store.cityId}
</if>
<if test="store.storeBrandId != null">
and t1.brand_ids like concat('%,', #{store.storeBrandId}, ',%')
and t1.brand_ids like concat('%', #{store.storeBrandId}, '%')
</if>
<if test="store.storeGroupIdList != null and store.storeGroupIdList.size()>0">
and t2.store_group_id in
......
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