Commit 80b91b83 by zhiwj

门店

parent 59ec200a
......@@ -6,6 +6,7 @@ import com.gic.api.base.commons.ServiceResponse;
import com.gic.store.dto.*;
import java.util.List;
import java.util.Map;
/**
* @author zhiwj
......@@ -54,6 +55,19 @@ public interface StoreApiService {
* @throws
*/
ServiceResponse<Page<StoreDTO>> listStore(StoreSearchDTO storeSearchDTO, Integer pageNum, Integer pageSize);
/**
* 按id查询门店图片 key:storeId value:门店图片列表
* @Title: listStorePhotoByIds
* @Description:
* @author zhiwj
* @param enterpriseId
* @param storeIdList
* @return com.gic.api.base.commons.ServiceResponse<java.util.Map<java.lang.Integer,java.util.List<java.lang.String>>>
* @throws
*/
ServiceResponse<Map<Integer, List<String>>> listStorePhotoByStoreIds(Integer enterpriseId, List<Integer> storeIdList);
/**
* @Title: getStoreById
* @Description: 查询门店详情
......
......@@ -28,6 +28,7 @@ import com.gic.store.entity.*;
import com.gic.store.service.*;
import com.gic.store.strategy.BulkUpdateStoreStrtegy;
import com.gic.store.utils.field.*;
import com.google.common.base.Joiner;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
......@@ -439,6 +440,27 @@ public class StoreApiServiceImpl implements StoreApiService {
}
@Override
public ServiceResponse<Map<Integer, List<String>>> listStorePhotoByStoreIds(Integer enterpriseId, List<Integer> storeIdList) {
StoreSearchDTO storeSearchDTO = new StoreSearchDTO();
storeSearchDTO.setEnterpriseId(enterpriseId);
storeSearchDTO.setStoreIds(Joiner.on(" ").join(storeIdList));
ServiceResponse<Page<StoreDTO>> serviceResponse = this.listStore(storeSearchDTO, 1, 20);
if (!serviceResponse.isSuccess()) {
return ServiceResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}
Map<Integer, List<String>> resultMap = new HashMap<>(16);
List<StoreDTO> storeDTOList = serviceResponse.getResult().getResult();
for (StoreDTO storeDTO : storeDTOList) {
List<StorePhotoDTO> photoList = storeDTO.getPhotoList();
List<String> list = Optional.ofNullable(photoList).orElse(Collections.emptyList()).stream().map(StorePhotoDTO::getImageUrl).collect(Collectors.toList());
resultMap.put(storeDTO.getStoreId(), list);
}
return EnterpriseServiceResponse.success(resultMap);
}
@Override
public ServiceResponse queryStoreFromES(JSONObject jsonObject, Integer pageNum, Integer pageSize, JSONObject sortJson, String returnFileds) {
if (StringUtils.isBlank(returnFileds)) {
returnFileds = StoreESFieldsEnum.STOREID.getField();
......
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