Commit a48c62a0 by 陶光胜

门店查询支持多个门店控件id聚合

parent 27a70a55
package com.gic.store.dto;
import java.util.HashSet;
import java.util.Set;
public class StoreColumnSet {
private Set<Integer> storeType = new HashSet<>();
private Set<Integer> status = new HashSet<>();
private Set<Integer> ErpStatus = new HashSet<>();
private Set<Integer> storeGroupId = new HashSet<>();
private Set<Integer> region = new HashSet<>();
public Set<Integer> getStoreType() {
return storeType;
}
public void setStoreType(Set<Integer> storeType) {
this.storeType = storeType;
}
public Set<Integer> getStatus() {
return status;
}
public void setStatus(Set<Integer> status) {
this.status = status;
}
public Set<Integer> getErpStatus() {
return ErpStatus;
}
public void setErpStatus(Set<Integer> erpStatus) {
ErpStatus = erpStatus;
}
public Set<Integer> getStoreGroupId() {
return storeGroupId;
}
public void setStoreGroupId(Set<Integer> storeGroupId) {
this.storeGroupId = storeGroupId;
}
public Set<Integer> getRegion() {
return region;
}
public void setRegion(Set<Integer> region) {
this.region = region;
}
}
......@@ -156,4 +156,12 @@ public interface StoreGroupApiService {
* @return
*/
ServiceResponse<List<StoreGroupDTO>> listStoreGroupByIds(List<Integer> storeGroupIdList, Integer enterpriseId);
/** @Description: 通过分组id查询分组
* @author taogs
* @Date 18:44 2019/8/12
* @Param
* @return
*/
ServiceResponse<List<StoreGroupDTO>> listStoreGroupByIds(List<Integer> storeGroupIdList, Integer enterpriseId, Integer level);
}
......@@ -3,6 +3,7 @@ package com.gic.store.service;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.store.dto.StoreBrandDTO;
import com.gic.store.dto.StoreColumnSet;
import com.gic.store.dto.StoreDTO;
import com.gic.store.dto.StoreWidgetDTO;
......@@ -86,4 +87,7 @@ public interface StoreWidgetApiService {
* @return result true表示存在
*/
ServiceResponse existByStoreInfoId(Integer enterpriseId, Integer storeWidgetId, Integer storeInfoId);
ServiceResponse<StoreColumnSet> getStoreColumnSet(Integer enterpriseId, Integer storeWidgetId);
}
......@@ -127,5 +127,7 @@ public interface TabStoreGroupMapper {
*/
TabStoreGroup selectUnGroupedStore(@Param("enterpriseId") Integer enterpriseId);
List<TabStoreGroup> listStoreGroupByIds(@Param("storeGroupIdList") List<Integer> storeGroupIdList, @Param("enterpriseId") Integer enterpriseId);
List<TabStoreGroup> listStoreGroupByIds(@Param("storeGroupIdList") List<Integer> storeGroupIdList,
@Param("enterpriseId") Integer enterpriseId,
@Param("level") Integer level);
}
\ No newline at end of file
......@@ -193,5 +193,5 @@ public interface StoreGroupService {

 */
TabStoreGroup selectAllStoreGroup(Integer enterpriseId);
List<TabStoreGroup> listStoreGroupByIds(List<Integer> storeGroupIdList, Integer enterpriseId);
List<TabStoreGroup> listStoreGroupByIds(List<Integer> storeGroupIdList, Integer enterpriseId, Integer level);
}
......@@ -159,8 +159,8 @@ public class StoreGroupServiceImpl implements StoreGroupService{
}
@Override
public List<TabStoreGroup> listStoreGroupByIds(List<Integer> storeGroupIdList, Integer enterpriseId) {
return this.tabStoreGroupMapper.listStoreGroupByIds(storeGroupIdList, enterpriseId);
public List<TabStoreGroup> listStoreGroupByIds(List<Integer> storeGroupIdList, Integer enterpriseId, Integer level) {
return this.tabStoreGroupMapper.listStoreGroupByIds(storeGroupIdList, enterpriseId, level);
}
}
......@@ -351,7 +351,13 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService {
@Override
public ServiceResponse<List<StoreGroupDTO>> listStoreGroupByIds(List<Integer> storeGroupIdList, Integer enterpriseId) {
List<TabStoreGroup> list = this.storeGroupService.listStoreGroupByIds(storeGroupIdList, enterpriseId);
List<TabStoreGroup> list = this.storeGroupService.listStoreGroupByIds(storeGroupIdList, enterpriseId, null);
return ServiceResponse.success(EntityUtil.changeEntityListByJSON(StoreGroupDTO.class, list));
}
@Override
public ServiceResponse<List<StoreGroupDTO>> listStoreGroupByIds(List<Integer> storeGroupIdList, Integer enterpriseId, Integer level) {
List<TabStoreGroup> list = this.storeGroupService.listStoreGroupByIds(storeGroupIdList, enterpriseId, level);
return ServiceResponse.success(EntityUtil.changeEntityListByJSON(StoreGroupDTO.class, list));
}
......
......@@ -6,10 +6,7 @@ import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.response.EnterpriseServiceResponse;
import com.gic.store.constant.StoreESFieldsEnum;
import com.gic.store.dto.StoreBrandDTO;
import com.gic.store.dto.StoreDTO;
import com.gic.store.dto.StoreSearchDTO;
import com.gic.store.dto.StoreWidgetDTO;
import com.gic.store.dto.*;
import com.gic.store.entity.TabStoreBrand;
import com.gic.store.service.StoreApiService;
import com.gic.store.service.StoreBrandService;
......@@ -232,6 +229,36 @@ public class StoreWidgetApiServiceImpl implements StoreWidgetApiService {
}
return ServiceResponse.success(false);
}
@Override
public ServiceResponse<StoreColumnSet> getStoreColumnSet(Integer enterpriseId, Integer storeWidgetId) {
StoreColumnSet storeColumnSet = new StoreColumnSet();
this.getStoreColumnSet(enterpriseId, storeWidgetId, 1, storeColumnSet);
return ServiceResponse.success(storeColumnSet);
}
private void getStoreColumnSet(Integer enterpriseId, Integer storeWidgetId, int pageNum, StoreColumnSet storeColumnSet){
ServiceResponse<Page<StoreDTO>> response = this.listStoreByStoreWidgetId(enterpriseId, storeWidgetId, pageNum, 10000);
if(response.isSuccess() && response.getResult() != null){
Page<StoreDTO> page = response.getResult();
List<StoreDTO> result = page.getResult();
if(CollectionUtils.isNotEmpty(result)){
for(StoreDTO storeDTO : result){
storeColumnSet.getErpStatus().add(storeDTO.getErpStatus());
storeColumnSet.getRegion().add(storeDTO.getRegionId());
storeColumnSet.getStatus().add(storeDTO.getStatus());
storeColumnSet.getStoreGroupId().addAll(storeDTO.getStoreGroupIdList());
storeColumnSet.getStoreType().add(storeDTO.getStoreType());
}
}
if(pageNum == 1 && page.getPages() > 1){
for(int i=2; i<= page.getPages(); i++){
this.getStoreColumnSet(enterpriseId, storeWidgetId, i, storeColumnSet);
}
}
}
}
private void getStoreId(Integer enterpriseId, Integer storeWidgetId, int pageNum, List<Integer> list){
ServiceResponse<Page<Integer>> response = this.listStoreIdByStoreWidgetId(enterpriseId, storeWidgetId, pageNum, 10000);
if(response.isSuccess() && response.getResult() != null){
......
......@@ -272,5 +272,8 @@
#{item}
</foreach>
</if>
<if test="level != null">
and group_level = #{level}
</if>
</select>
</mapper>
\ No newline at end of file
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